|
Brad Barnhill wrote: He installs software for a living now
"for a living"?
Greetings - Jacek
|
|
|
|
|
dear sir! I am not getting my queries fulfilled. i am not getting my relevant solutions to my queries. i require best programming code according to my topic.
thanks for your immediate feedback but i can't my relevant solutions.
Kindly sir! i request you to provide simple programming codes in 'c' & other topic if i required.
Very Very Thanks......
|
|
|
|
|
I guess that your question is too perfect to give a satisffactory answer.
Greetings - Jacek
|
|
|
|
|
tusharkaushik wrote: i require
I think that is your biggest mistake. Not one person here is required to answer a dang thing that you ask. I read your original questions and the responses to them. You did not do one thing to help yourself you simply demanded code for something that is easily research-able by any reasonable programmer/student. If you had shown code showing what you had tried and why it did not work, you might have gotten much better replies.
Programming is a race between programmers trying to build bigger and better idiot proof programs, and the universe trying to build bigger and better idiots, so far... the universe is winning.
A graduation ceremony is an event where the commencement speaker tells thousands of students dressed in identical caps and gowns that 'individuality' is the key to success
|
|
|
|
|
Three things:
1) This is not a good place to put this: as it says at the top of the Forum "a place to post examples of Coding Horrors and Worst Practices"
2) I just had a look at your queries. They have both been answered, but there is nothing there you could not have found easily yourself by either A) using google or B) attending your lectures. Preferably both.
3) Don't get demanding. We don't get paid for this, we do it because we want to share our knowledge. If you start in with "attitude" you will annoy people and reduce your chances of a useful answer.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
OriginalGriff wrote: 1) This is not a good place to put this: as it says at the top of the Forum "a place to post examples of Coding Horrors and Worst Practices"
Except, paradoxically, that makes his post in this forum a good example of "Worst Practices", making it completely appropriate
|
|
|
|
|
I don't get a pairodoxies, so I wouldn't know...
5!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
An ex-coworker asked me to help him with his first website (maybe last?).
It's for a real estate agency. He was stuck trying to process the search form with some selects (price range, state size, zone location, bla, bla.. )
All the code is a f***ing mess, but this piece of crap excels among all other:
$filter='';
$type=$_POST['type'];
$admin=$_POST['admin'];
$zone=$_POST['zone'];
$m2=$_POST['m2'];
$price=$_POST['price'];
if(($type!="selec") AND ($admin!="selec") AND ($zone!="selec") AND ($m2!="selec") AND ($price!="selec")){
$filter="type=\"$type\" AND admin=\"$admin\" AND price>=\"$pricemin\" AND price<=\"$pricemax\" AND city=\"$city\"";
}elseif(($type!="selec") AND ($admin!="selec") AND ($pricemin!="") AND ($pricemax!="")){
$filter="type=\"$type\" AND admin=\"$admin\" AND price>=\"$pricemin\" AND price<=\"$pricemax\"";
}elseif(($type!="selec") AND ($admin!="selec") AND ($pricemin!="") AND ($city!="")){
$filter="type=\"$type\" AND admin=\"$admin\" AND price>=\"$pricemin\" AND city=\"$city\"";
}elseif(($type!="selec") AND ($admin!="selec") AND ($pricemax!="") AND ($city!="")){
$filter="type=\"$type\" AND admin=\"$admin\" AND price>=\"$pricemax\" AND city=\"$city\"";
}elseif(($type!="selec") AND ($pricemin!="") AND ($pricemax!="") AND ($city!="")){
$filter="type=\"$type\" AND admin=\"$pricemin\" AND price>=\"$pricemax\" AND city=\"$city\"";
}elseif(($type!="selec") AND ($pricemax!="") AND ($city!="")){
$filter="type=\"$type\" AND price>=\"$pricemax\" AND city=\"$city\"";
}elseif(($type!="selec") AND ($pricemax!="") AND ($city!="")){
$filter="type=\"$type\" AND price>=\"$pricemax\" AND city=\"$city\"";
}elseif(($type!="selec") AND ($admin!="selec")){
$filter="type=\"$type\" AND admin>=\"$admin\"";
}elseif(($type!="selec") AND ($pricemin!="")){
$filter="type=\"$type\" AND price>=\"$pricemin\"";
}elseif(($type!="selec") AND ($pricemax!="")){
$filter="type=\"$type\" AND price>=\"$pricemax\"";
}elseif(($type!="selec") AND ($city!="")){
$filter="type=\"$type\" AND city>=\"$city\"";
}elseif($type!="selec"){
$filter="type=\"$type\"";
}elseif($admin!="selec"){
$filter="admin=\"$admin\"";
}elseif($pricemin!=""){
$filter="price=\"$pricemin\"";
}elseif($pricemax!=""){
$filter="price=\"$pricemax\"";
}elseif($city!=""){
$filter="city=\"$city\"";
}
$filter="";
}
I always knew he is not a genius.. but never thought someone could write code like this without realizing he was wrong
¿Eres tu John Wayne? ¿O soy yo? (Sorry about my english!)
|
|
|
|
|
Looks like perfectly normal PHP to me. You mean PHP doesn't have to look like a child wrote in in Quick Basic? If true, I am amazed...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
The ability to write total garbage is language- (and culture-) independent.
with the possible exception of APL, where nobody can tell if it's garbage or clever code. Described to me years ago as the world's first write-only language.
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
Thanks! I've been trying to forget the existence of APL...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
No exception, it's possible to write good and bad APL, or even J. The problem is that it has more features, so it's easier to abuse, and a lot of it is written by academics who don't really believe in professional software practices.
|
|
|
|
|
that actually DOES look like something i wrote in qbasic when i was 10.
|
|
|
|
|
ahhh crap, I think I just had a stroke
I may or may not be responsible for my own actions
|
|
|
|
|
"One can write Fortran in any language."
Time you enjoy wasting is not wasted time - Bertrand Russel
|
|
|
|
|
Well a comment or two would be pretty handy, as well as some better spacing (though I'm hoping you crammed it all together so it would fit better on the page?). That is one heck of a if statement though...
|
|
|
|
|
No, i didn't.. Sad but true
I've translated names and wrote the few comments...
¿Eres tu John Wayne? ¿O soy yo?
modified on Wednesday, June 8, 2011 12:59 PM
|
|
|
|
|
And I thought I was bad with comments... wow!
|
|
|
|
|
comments is the least of this codes problems.
|
|
|
|
|
D'oh! My Usual comments are not like this -_-'... Those were fast ones just for this post
¿Eres tu John Wayne? ¿O soy yo?
|
|
|
|
|
Wow this is very nice code.
I´ll zeropad it to fixed line length copy an inversion of it to the front, rotate counterclockwise 90 degrees, apply a color index substitution. Et voila, we´ve got a sprite for a space invaders clone.
|
|
|
|
|
I just went in to fix a compatibility issue in some code and ran into this beautiful 27 lines long list of variables set to an empty string. Then the code has a loop going through the provided data, which has a list of if statements in it, of which you can probably guess the length. All but 5 or so of these ifs have duplicate code. After the loop all these variables are passed to a constructor, which holds another nice long list of if statements...
Code: http://pastebin.com/uz3uMy0g[^]
It's GPL v2, so do feel free to use it!
|
|
|
|
|
... art... it's art...
<br />
public function SMWBibTeXEntry( <br />
$type, <br />
$address, <br />
$annote, <br />
$author, <br />
$booktitle, <br />
$chapter, <br />
$crossref, <br />
$doi, <br />
$edition, <br />
$editor, <br />
$eprint, <br />
$howpublished, <br />
$institution, <br />
$journal, <br />
$key, <br />
$month, <br />
$note, <br />
$number, <br />
$organization, <br />
$pages, <br />
$publisher, <br />
$school, <br />
$series, <br />
$title, <br />
$url, <br />
$volume, <br />
$year ) {<br />
<br />
if ( $type ) <br />
$this->bibTeXtype = ucfirst( $type ); <br />
else <br />
$this->bibTeXtype = 'Book';<br />
<br />
$fields = array();<br />
<br />
if ( $address ) $fields['address'] = $address;<br />
if ( $annote ) $fields['annote'] = $annote;<br />
if ( $author ) $fields['author'] = $author;<br />
if ( $booktitle ) $fields['booktitle'] = $booktitle;<br />
if ( $chapter ) $fields['chapter'] = $chapter;<br />
if ( $crossref ) $fields['crossref'] = $crossref;<br />
if ( $doi ) $fields['doi'] = $doi;<br />
if ( $edition ) $fields['edition'] = $edition;<br />
if ( $editor ) $fields['editor'] = $editor;<br />
if ( $eprint ) $fields['eprint'] = $eprint;<br />
if ( $howpublished ) $fields['howpublished'] = $howpublished;<br />
if ( $institution ) $fields['institution'] = $institution;<br />
if ( $journal ) $fields['journal'] = $journal;<br />
if ( $key ) $fields['key'] = $key;<br />
if ( $month ) $fields['month'] = $month;<br />
if ( $note ) $fields['note'] = $note;<br />
if ( $number ) $fields['number'] = $number;<br />
if ( $organization ) $fields['organization'] = $organization;<br />
if ( $pages ) $fields['pages'] = $pages;<br />
if ( $publisher ) $fields['publisher'] = $publisher;<br />
if ( $school ) $fields['school'] = $school;<br />
if ( $series ) $fields['series'] = $series;<br />
if ( $title ) $fields['title'] = $title;<br />
if ( $url ) $fields['url'] = $url;<br />
if ( $volume ) $fields['volume'] = $volume;<br />
if ( $year ) $fields['year'] = $year;<br />
<br />
[...]<br />
<br />
jep... it is...
(yes|no|maybe)*
|
|
|
|
|
Ohh that makes my brain hurt. He uses arrays but cant pass an array. Either the language limits passing arrays or he is a moron. Let me just assume the answer to that and we will move on
Brad Barnhill
|
|
|
|
|
See this piece of code:
class Person
{
private string name;
private string sname;
public Person(string argName, string argSName)
{
name = argName;
sname = argSName;
}
public string getName()
{
return name;
}
public string getSName()
{
return sname;
}
public override string ToString()
{
return name + " " + sname;
}
}
Now consider these few facts:
- the code is in C#, not Java
- in case you haven't noticed, this code violates some basic good-style C# coding guidelines
- the person who wrote this code teaches C# programming at university
- this piece of code was given to his students as a do-it-like-this example
- he never, ever uses properties (Java-style getXXX() and setXXX() methods seem to be good enough for him...)
- he sometimes names his classes and methods in Czech using diactitics (yes, it compiles fine since VS is Unicode-based, but... WTF?)
- And more!
|
|
|
|