jephthah 1,888 Posting Maven

spend less time worrying about your avatar, and you'll have more time to do your own work and not have to resort to cheating.

jephthah 1,888 Posting Maven

so you want us to rework some code for your "friend's" homework assignment, and to hurry up about it, and to do it in a way that satisfies the teacher's requirements.

sounds legit.

jephthah 1,888 Posting Maven

god that's horrible.

jephthah 1,888 Posting Maven

@nitin1:

remember everything is in Base2, binary. so 2^11, the exponent, is a value between -1022 and +1023, but that is still the exponent of a base2 number, i.e. 2^-1022 to 2^1023 as a range, so in base10 it gives a total decimal range of 10^-383 to 10^384.

Similarly, 52 + 1 significant bits (fraction bits plus sign bit) is also in base2; when converted to base10, you get a total decimal precision of ~16 digits, plus or minus 1 digit, for a decimal range of 15-17 digits depending on how the rounding works out.

the various links given above explain the detail, but i think it's just remembering the several conversions between base2 and base10 that is tripping you up. It should all make sense to you once you remember that.

jephthah 1,888 Posting Maven

i feel like Rip Van Winkle. What is all this fancy bling?

jephthah 1,888 Posting Maven
int grade = 87;
char letter[6] = "FDCBAA";

int main(void)
{
   printf("grade %d is letter '%c'\n", grade, letter[(grade>59)?grade/10-5:0]);
   return 0;
}
jephthah 1,888 Posting Maven

i totally agree that it is poor practice to include libraries for source code that is not used by that source code.

i also agree there is no value for creating extra header files just for the sake of sticking some includes in there. i have multiple header files to keep track of the large number of prototypes, constants, macros and conditional preprocessor directives. my current project has over 20 different .C source files, and at least 15 of them have their own header files.

Now I also like to put the include files in there while i'm at it. some have suggested that is bad practice, but they have not sufficiently explained why.

i guess the end result of my question is that, as long as you avoid unnecessary or redundant calls, it doesnt matter where you put your various includes, defines, etc.

jephthah 1,888 Posting Maven

I'm sorry, I'm not explaining myself clearly. I'm not saying to use a single "catch all" header file for every single source file. each source file has it's own header file.

a second source such as the "source2.c" that Walt cites -- or "whatever.c" for that matter -- would not use the "source.h" file previously described.

"source2.c" will have its own corresponding "source2.h". "whatever.c" will have its own corresponding "whatever.h". and these individual header files will have only those #includes, #defines, etc. that their corresponding source files require.

as for static code, I mean it's not interpreted. you can't just change or add new a library on the fly and expect your code to just use it. if you change the name of the #included library, you must recompile your code to incorporate that library's interface whether the library is called from the source or the header.

jephthah 1,888 Posting Maven

The only difference I can see is, if you use the second method you have to open and update the header.h file whenever you need a new libraries functionality..The first method, just add the include at the top of the file no updating a header file.

i can't imagine why you would ever need a completely new library in your otherwise static code.... and even if you did, how would it be better to have to change the source code rather than the header file? in either case you will still have to recompile and redistribute a new version


My preference is to include header files where they are needed. If you need to functionality of stdio.h in your header (i.e you need to use FILE ) the include it otherwise it is just noise.

obviously. I only include library headers that are needed. "source.c" includes "source.h", which itself contains all the #defines, typedefs, #includes, etc. that "source.c" needs.

what i'm asking here is what is the "Best Practices" for including header files? is there a real reason why you should not put the #include statements in the header .H file? Or, at least, is there some reason why it's better to put your #includes in the source .C file?

thanks

jonsca commented: Welcome back +7
jephthah 1,888 Posting Maven

so there's an argument about best practice for #include statements.

many people put all the relevant #include <header.h> statements at the top of the .c source code.

some people prefer to put the relevant #include statements within the .h header file that is associated with the .c source code


consider:

Example 1

"source.c"

#include <library1.h>
#include <library2.h>
#include <library3.h>
#include "another.h"
#include "etc.h"
#include "source.h"

int main(void)
{
    //etc...

"source.h"

#ifndef _SOURCE_H
#define _SOURCE_H

#define RELEVANT_MACRO_IN_SOURCE_C   
//etc...

#endif

Example 2

"source.c"

#include "source.h"

int main(void)
{
    //etc...

"source.h"

#ifndef _SOURCE_H
#define _SOURCE_H

#include <library1.h>
#include <library2.h>
#include <library3.h>
#include "another.h"
#include "etc.h"

#define RELEVANT_MACRO_IN_SOURCE_C  

//etc...

#endif

FTR, i'm in the camp for Example 2. It's my personal preference housekeeping sort of thing, but some people claim that including #includes within the header file is bad practice.

with the include guards, i'm not sure why that would be a problem, assuming you don't have circular references.

thanks

jephthah 1,888 Posting Maven

hrmm... it looked like some significant fixes were in order, but apparently i was mistaken.

the entire site layout makes it obvious that content and quality is secondary to flash and attracting visitors. the features that made it worth dealing with one-off homework seekers and signature spammers are now gone.

i really have lost interest in participating here. i've been trying to care about this site, but it's just not happening.

bye.

.

jephthah 1,888 Posting Maven

What do you like on internet?

pics of your mom, mostly.

JamieLynnSEO commented: Hahahaah. Awesome! +0
jephthah 1,888 Posting Maven

alright, someone close this tard-magnet thread already.

jephthah 1,888 Posting Maven

that's "ma'am"

jephthah 1,888 Posting Maven

yeah, the color sucks. it's the most immediately visible chgange and causes a visceral reaction. But it's also the most superficial and the least of everyone's concerns.

the larger issues are that the things that people appreciated most are now gone, and things we never expected to be a concern (such as basic readability) are now real problems.

it truly begs the question, 'why am i even here?'. i used to enjoy participating. now, when i open up the webpage, it just makes me annoyed.


.

William Hemsworth commented: *agrees* +6
jephthah 1,888 Posting Maven

...

I found out that it is said that about 2/3 of software engineers in India are trained by NIIT , why there are still so many people willing to be trained by NIIT

yeah, and about 90% of the Indian "software engineers" work as phone support techs.


...

NIIT is stated as the No.1 and largest IT trainer in Asia ( some articles even state that NO.1 and largest IT trainer in world )

every diploma mill loves to focus on their size and number of studets. why would you think that size is some kind of important metric? quantity does not equal quality. the reason they're so huge is that they have ZERO standards for their admissions. any high-functioning retard with a checkbook or handful of cash can get in.


...

NIIT has helped IBM to train most of the IT professionals in the company . As we know , IBM is really top in the field of IT , if the standard of teaching of NIIT is not good , why such a top company will co-operate with it ?

you're talking about "IBM-India". Not IBM. and the politics behind IBM offshoring half their company is a complex subject. And most of the work you're talking about involves answering questions like "why doesn't my computer turn on?" and "why am i not getting my email?"


...

I'm posting these facts here just to clarify my …

jephthah 1,888 Posting Maven

necroposter lol.

jephthah 1,888 Posting Maven

yeah, i dont' like the whole thing where the rep and threads solved are hidden either.

the move here has been to suppress the content and context and the accomplishments of the veteran posters, and generally make everything hard to read.

i've lost interest in making serious replies in the programming forums.

jephthah 1,888 Posting Maven
jephthah 1,888 Posting Maven

oh, scorpio. that's hot.

jephthah 1,888 Posting Maven

ah, okay. i'm glad i didnt spend any time searching the standard libraries. :-)

jephthah 1,888 Posting Maven

can you explain where these error codes come from?

#define IO_GETS_ALLOC 0x1DE27
#define IO_GETS_NOPOOL 0x1B24A
jephthah 1,888 Posting Maven

it's about Ethics, not Morals

and if you think Ethics aren't a HUGE issue in today's business world, you surely have been living in a cave. hell, I have to study an entire section on Ethics in order to take my PE (professional engineer's) Exam.

but whatever, it's clear you were not kidding. so you're either exposing yourself as a liar, or you're just covering your tracks because you're scared. I'll give you the benefit of the doubt and assume the latter.

Now anyhow, where were we .... oh, yes. we've addressed the double backslash filename issue (\\), so what other questions do you have :)

.

jephthah 1,888 Posting Maven

i like to do that to myself occasionally.

jephthah 1,888 Posting Maven

...

your the one who is out of line, and I'm just calling you out on it. Sorry if you don't like the attention.


I will be crying in my pillow tonight, I hope you are satisfied. :(


.

jephthah 1,888 Posting Maven

...

i'd be sooo very thankful if u could code this part for me in C asap. ... please can u do it in an hour or so ? please give it a try.

...

am seriously ready to pay a reasonable amount for this... around $20 ... i need to submit tomorrow.


dude... i'm not going to make threats, but this looks pretty incriminating to me. and it's worse than cheating on homework, you were offering to pay us to help you cheat on your final semester project.

you need to think about this.

your problem is trivial and you could have had all the help you needed and then some, if you would have just come in without the hysterics.

but rather than take responsibility and work it out like everyone else, you've gone and compromised your academic integrity. I'm not going to spend the time to track you down and turn you in ... but you'll know. and you'll remember this day.

my screen name is a legendary figure who did the same thing: Panicked right before leading a major battle, and promised God he would make a sacrifice of a member of his household if he could get help to defeat his enemies. Now, Jephthah could have won the battle without divine intervention, but by trying to game the system, he wound up having to make his only daughter a burnt offering. Judges 11:29-40, …

jephthah 1,888 Posting Maven

no offence. i'm a student and that all i can afford

that's why we HELP for FREE.

don't you have some sort of academic integrity policy at your school? I'm sure paying for homework is in violation of that.

i just turned in someone to their engineering dean and course professor for this.

jephthah 1,888 Posting Maven

$20? LOL. we don't want your spare change. we'll help you for free. but only if you're ready to do the work. you couldnt afford us, otherwise.

jephthah 1,888 Posting Maven

here's a clue, Sherlock: this thread was created in August 2009. The OP hasn't made a single post since. and most likely they never will.

i've got better things to do than write trivial algebraic functions for no audience and no reason.

jephthah 1,888 Posting Maven

you can also send complaints to me.

I run this place.

jephthah 1,888 Posting Maven

..

Okay you guys are utterly ridiculous. If you don't like the design, GOOD BYE. No one really gives a shit. Keep that to yourself. I mean seriously, complain much? So please, complaining people!!!!!!!!!!!!!!!!

Hey guy. I know you sound mad. But it will be okay. Because you see, we're not really fighting, we're discussing. And no matter what, none of this your fault, and we all still love each other. I promise.

Now run along back into bed, okay sport?


.

jephthah 1,888 Posting Maven

...


WRT visible overall rep - is this like the previous version of DW where members had those little green (or orange) rectangles next to their profiles in the posts? I have to admit, I quite liked those.


yes, exactly.

having colored icons of some sort to indicate if a thread was positive or negative repped... and having the same colored system to indicate if a user was positive or negative repped, overall.

it gave me a sense of being able to know which threads and posters to pay attention to and which to disregard.

now i just have to disregard everyone

jephthah 1,888 Posting Maven

...

I'm new to Daniweb, but I seriously won't be here too long

Hi. thanks for sharing :)


.

jephthah 1,888 Posting Maven

when are we going to get colored icon for each post that has been up-repped or down-repped?

when are we going to get visible representation people who are so lousy, that they've been downvoted into the negative?

jephthah 1,888 Posting Maven

Narue >> That quoting method is worse than awful. Pick one method and stick to it, don't combine them.


okay, fine. I like the concept of quote tags, and i like the boxed out separation, but the font face makes me ill.

so i'll go back to the old newsgroup variation.

jephthah 1,888 Posting Maven

..

>> I guess I'll take this opportunity to tell things which have been bothering me for quite some time after the upgrade:

  • The font family; it's bad IMO, to an extent that the font face ends up giving more importance to the surrounding bell-n-whistles and less importance to the content. Many here would agree with me that we have to *squint* our eyes to read the question. This is amplified by the smaller font used inside quotes having the same font family.
  • The color scheme used; I really don't have problem with purple but the way a post is represented (white background inside light gray) again ends up putting strain on the eyes.
  • Different colors for read/unread threads. Icons are nice but the link color *needs* to change. This is because it has been always this way. If I have to look at images to see which threads I've read/not read, it ends up being quite a bother.

Other than these things, I really don't see anything else which would be a big hindrance when browsing/using the site for a long period of time


QFMFT

.

Narue commented: That quoting method is worse than awful. Pick one method and stick to it, don't combine them. +0
jephthah 1,888 Posting Maven

or maybe, i'm right outside your window

(*ducks*)

jephthah 1,888 Posting Maven

interesting story.

it doesnt surprise me, being they a for-profit corporation. they overcharge students and underpay faculty. all with an eye on the bottom line.

yep, that's what i look for in an education.

jephthah 1,888 Posting Maven

Eternal Sunshine. great movie.

jephthah 1,888 Posting Maven

...

>> People's real names are also google searchable. google your real name and you may also get some hits.

meh. mine only shows some entries at the Department of Corrections.

jephthah 1,888 Posting Maven

wait, wait.... you want me to....

download Turbo C and install it on my 21st Century machine, just so I can ... compile some broken-down code that won't work anyhow?

lol! :D


now, seriously. you need to wheel that trash on out of here. Take it home and fix it up. bring us back a C program that can ACTUALLY COMPILE, not some bastardized C/C++ hybrid, and none of these deprecated libraries from 1989.

Then and only then will i bother to compile it and verify it is indeed still broken, anyhow. and then you can go donate $20 to some charity.

otherwise, GTFO.

jephthah 1,888 Posting Maven

Look. here's your first hint. you do NOT reinstall your OS every time something difficult or confusing occurs.

i mean, seriously, just THINK about that.

now did you write the file1.c to the directory in the first place? what happens when you try to do it again? any warnings?

is your directory write-protected? find a file in that directory and "touch" it. any warnings?

do an "ls -l" command on the directory itself to see the owner and group permissions. use "chown" or "chmod", respectively, to change them if they're not what they should be. use the "su" or "sudo" command if you need to increase your own permission to do so.

.

jephthah 1,888 Posting Maven

Do I detect an air of sarcasm young man? - iamthwee

no... we can all agree that the goal of increasing post count and thread count is a good thing.

However.... i bet that the near-record number of threads and posts are related to this crazy design. at least Im certainly not seeing any increase in the programming forums.

jephthah 1,888 Posting Maven

...

>> Refusing to help anyone in the forums is, to be honest, not going to sway anyone to your point of view. If something is going to be changed it ... will not get changed as a result of holding any forum to ransom.


oooh. that's fear, right there. i believe we found the pressure point.

Singleton commented: Your a huge idiot for not using the quote tags wrong. Get a freakin life. +0
jephthah 1,888 Posting Maven

goodlord, do NOT reinstall your OS. and you're wasting your time with g++ unless you want to compile C++ (.cpp) files. the simple fact is just that your gcc is obviously not able to see your file1.c, and there has to be a simple explanation.

do this:

first type " pwd " and <enter>
then type " ls -l *.c " and <enter>
then type " gcc -o file1 file1.c " and <enter>

one after another, in teh same window, without doing anything else, and cut and paste the entire results (command and response) here.

jephthah 1,888 Posting Maven

Hey, now, you two go get a room already.

Aia commented: Here! For the good nature. +8
jephthah 1,888 Posting Maven

...

>> well they have a phone number I'd love to hear them tell that directly. it would be a fun fight

SO TUFF

jephthah 1,888 Posting Maven

well... congrats!

iamthwee commented: Do I detect an air of sarcasm young man? +0
jephthah 1,888 Posting Maven

..

>> Just leave out the quote tags. Why do all that extra work?

because i actually do like the grey bar with Username as a sort of frame for the quote.

and it really only takes about 10 seconds.


.

jephthah 1,888 Posting Maven

strsep is good, but not portable to WIN32 compilers.

http://www.gnu.org/s/libc/manual/html_node/Finding-Tokens-in-a-String.html

0x69 commented: agree, too specific means too bad :) +1