|
Member
(04-05-2011, 07:43 PM)
|
#252
Originally Posted by Not A Fur:
I do know this: I initialize all of my stuff once (and only once). from there, I reference it when I'm updating or drawing the game. |
|
Member
(04-05-2011, 07:50 PM)
|
#253
Originally Posted by iapetus:
I'm not a big fan of tricky questions (ex. Swap two integers in C++ w/o using an if statement, etc). |
|
Member
(04-05-2011, 07:50 PM)
|
#254
Reading this thread made me realize that despite my CS degree I'm glad I went towards the management side of things rather than the down-and-dirty technical side.
That said, I'm glad that I went through that education, because there have been several times where I've had an enormous, monotonous task to fulfill, and writing a program made it infinitely easier to tackle. Recent example: I had 3,600 network configuration files that I needed to parse from one enormous text file into individual files. 90% of the files followed the same format, but the others were ones and twos that someone didn't configure properly. I figured writing a parser was the best way to solve the problem. Problem is the only available language I had was Python (government computer, didn't have rights to install others), which I'd never used before. My background was mostly C++ and Perl, so luckily a lot of the basic principles were applicable. Managed to figure it out in a few days after figuring out the language. |
|
(04-05-2011, 07:51 PM)
|
#255
I have to say, I'm so glad to see that there aren't any QA rants here yet. I'm currently working on some stuff from an offsite office. These guys don't have any sense of following the dev-QA cycle, and of course they're not maintaining any change lists (at least that I'm privy to).
I'm about to unleash a boatload of defects... don't know if they'll ever be addressed... |
|
Banned
(04-05-2011, 07:52 PM)
|
#258
I've been in aggressive interviews where the guy was asking questions about stuff he wasn't even really comfortable with (physics math, advanced 3d rendering techniques, stuff he obviously just read up on to formulate a challenging question) and i turned the tables by answering and then asking him more questions about the subject that he implied he would be able to answer by asking me the question in the first place. pretty funny to turn the tables and have the interviewer turn into a stuttering sweaty nervous mess. One of those interviews ended up in me not getting the job :)
Originally Posted by Drkirby:
or you could make a precalculated global lookup table of 100 funtion pointers for each iteration and jump to the right one for each index assuming you have function pointer support in your lingo :p
Last edited by diddles; 04-05-2011 at 07:57 PM.
|
|
Corporate Apologist
(04-05-2011, 07:53 PM)
|
#259
Originally Posted by Ecrofirt:
|
|
got my tag in the OT
(04-05-2011, 08:01 PM)
|
#261
Originally Posted by diddles:
I had a guy try to do this to me. And was like "You're just being all high and mighty because you have the answers in front of you." I put down all the papers and said, "Very well. Ask me anything you want." He proceeded to throw a bunch of questions at me that were all fairly simple. I answered all of those and then said, "Do you have any more questions for me? Because if not , your interview is over." As to my interview style I always ask them what they feel they're really good at and start there. If they're really good at certain things they can learn the rest. If they think they're good and are crap or mediocre on that then they probably can't be taught. Also I almost never pose straight code questions. I always pose a problem and let them have at it. As for my rant: I hate it when users think everything is a bug. For example: "Hey! This process ran on this record and wasn't supposed to! Fix it!" "Can you prove that the flag for processing wasn't Y when the process ran? Because it's hard coded in there. I don't see how this is even possible. Also if it were ignoring the process flag it would've happened to every record and not this one." "But I unchecked the flag!" "Yes. Did you do that before or after the process ran?" "Just fix it!!" |
|
Member
(04-05-2011, 08:04 PM)
|
#262
Originally Posted by Drkirby:
|
|
Member
(04-05-2011, 08:05 PM)
|
#263
Originally Posted by diddles:
|
|
Member
(04-05-2011, 08:07 PM)
|
#264
Originally Posted by Drkirby:
Things are in the preliminary stage right now, but it's already bigger tan just a one or two class program. I've got screens, wedges, balls, factories, etc. |
|
(04-05-2011, 08:07 PM)
|
#265
Originally Posted by Steve Youngblood:
|
|
Member
(04-05-2011, 08:16 PM)
|
#266
Originally Posted by Zoe:
|
|
(04-05-2011, 08:17 PM)
|
#267
Originally Posted by Steve Youngblood:
|
|
Member
(04-05-2011, 08:19 PM)
|
#268
Originally Posted by Zoe:
I think I'd prefer to see someone do it the two check way since it suggests an understanding of how to use ifs instead of just following the question and setting up an if statement for each possibility it mentions. |
|
Member
(04-05-2011, 08:24 PM)
|
#269
Originally Posted by Drkirby:
Things to know: * My Game class has a GameScreen object, and when the Game class calls Update() and Draw(), they subsequently call the Update() and Draw() functions for the GameScreen object. * Ring is a class * Wedge is a class *rings.Wedges is a list of wedges Here's the main code. As you can see, the rings list is populated once, and is just referred to after that: I should point out that my code seems to run like shit whether or not anything is drawn to the screen. It'll bounce between 60 and 45FPS consistently. This even happens if I set the Draw() code to immediately return, which has led me down the path of thinking that there's a culprit in my Update() function. Update: If I tell my Update() function to return immediately, the FPS jumps to between 58 and 60FPS, so I know the issue is there. I'll add in my Ring class code after this, which has got to be the main issue somehow. Here's my GameScreen class http://pastebin.com/b7XpQ3kt Here's my Ring class http://pastebin.com/WrQTzMLk
Last edited by Ecrofirt; 04-05-2011 at 09:29 PM.
|
|
Member
(04-05-2011, 08:36 PM)
|
#270
Code:
void FizzBuzz(int START, int END) {
Debug.Assert(START>0); Debug.Assert(END>START);
string[] fb = new string[15];
for( int i = 0; i < fb.Length; i++ )
fb[i]=null;
fb[2] = fb[5] = fb[8] = fb[11] = "fizz";
fb[4] = fb[9] = "buzz";
fb[14] = "fizzbuzz";
for( int i = START, j = (i-1)%15; i <= END; i++, j++ ) {
if (j==15) j = 0;
Console.WriteLine(fb[j] ?? i.ToString());
}
}
5 years of ASP3.0/ASP.NET development has made me lazy and stupid. Haven't actually had to optimize anything other than SQL queries in god knows how long.
Last edited by Mister Zimbu; 04-05-2011 at 08:40 PM.
|
|
Member
(04-05-2011, 08:39 PM)
|
#271
Originally Posted by Zoe:
|
|
Member
(04-05-2011, 08:43 PM)
|
#272
I was watching a presentation yesterday and a guy said "Looking at old code is like going back in time...to when I sucked at coding"
So true. I am 2 years out of school now and when I look at my code originally to now it's incredible. I hate working on any of my old projects. |
|
Member
(04-05-2011, 09:18 PM)
|
#273
Originally Posted by nickcv:
For example, I was considering leaving my current place of employment almost solely because of a managers decisions. The guy was fantastic. He was really bright, an incredible coder, and a really hard worker. He just had absolutely no business sense whatsoever. We were tasked with a full re-architecture of our system, and he decided that we should do it all web based. That was great. I was happy. It was good experience doing web-based development, great experience working with SOA architecture, etc. The problem was that four months later he informed us that our clients could only support IE 6, and the technology and intensity of what we were trying to accomplish couldn't be achieved with that browser, so we had to start over using a Swing client. Four months work down the drain. Sure, there was some back end work that was fine (all of the services) but we had written tons of Spring controllers and jsp etc that were essentially thrown away. All because he didn't ask our business client if they could support a modern browser. Of our year of development time four months of it were flushed, and we still had to push the product out by the original deadline. Now, I was assigned to client side development for this, so I wasn't really aware of the massive issues that were present on the server side development. His plan was to write an intermediary SQL language that would allow us to use the same queries for each different database implementation (even though our clients exclusively used SQL Server). The idea was that they would be able to create domain objects and query them across databases and database implementations. It was sort of like writing our own implementation of data warehousing and data cube software, except instead of storing it in a central data warehouse, which would have been the intelligent thing to do, we'd simply query the 10, 20, 30 who knows however many servers for every request (that should be throwing up huge red flags for performance in and of itself). Not only was there absolutely no focus on just making it so that it supported the type of data objects our client needed (he wanted to be able to expand the business to other clients) but in general there was no focus on one domain. It was like the Sports Car/Mini-van/Truck that Alan Cooper wrote about in "The Inmates are Running the Asylum". So our small team of four started out on this adventure. I was writing all of the client side code, one of us was writing server side services, one of use was writing the entire data integration system, and the boss was writing the intermediary SQL querying language. About five months in the guy writing the data integration stuff started making a huge fuss about things and complaining that it wouldn't work. I was busy trying to meet my own deadlines so I didn't have the time to jump in the code there and see what was up. About four or five more months into this my boss came to all of us (I think it was right after thanksgiving) and said he was leaving for another company. It was obvious to us at this point that this project was a shit show and we had essentially wasted almost a full year of R&D on a project that was destined for a garbage can, and the boss jumped ship. At about this point I started poking around in the server side code to see what the problem was and I could immediately see that the project was no feasible for a team our size, and probably should never have been attempted anyway. I was sitting on two years experience and this was obvious to me. But they were business decisions. I then realized that while what he wanted us to do was pretty groundbreaking and intriguing from a technical perspective, the technical side and the business side never matched up. It was that inability to sync the technical and the business side together that essentially led to the downfall of the project, and it's the reason I was searching for a new job. Now, to me if someone told me that story it would tell me that they had a good head on their shoulders, that they understood the importance of matching the goals with what the business end of things require, and a whole slew of different things about them as a candidate for hire. If you simply discount them as a candidate for saying "My last boss had no idea what he was doing" and don't try to get some sound reasoning out of them you're probably doing yourself a disservice. |
|
Member
(04-05-2011, 09:24 PM)
|
#276
Originally Posted by AbortedWalrusFetus:
However, If they say: "My boss couldn't code his way out of a box, his company was worthless hurr" then that probably isn't going to land you a job. He said "trash talked" so I'm assuming something more like the second. |
|
Corporate Apologist
(04-05-2011, 09:30 PM)
|
#277
Originally Posted by ultron87:
|
|
Member
(04-05-2011, 09:33 PM)
|
#278
Originally Posted by Drkirby:
|
|
Member
(04-05-2011, 09:40 PM)
|
#279
Originally Posted by Kalnos:
|
|
(04-05-2011, 09:42 PM)
|
#280
Originally Posted by ultron87:
Code:
for (int i = 1; i < 101; ++i) {
String result = "";
if !(i % 3)
result += "Fizz";
if !(i % 5)
result += "Buzz";
if !(result.size())
result += i; // yeah, I know this part doesn't work
System.Out.println(result);
}
|
|
Corporate Apologist
(04-05-2011, 09:44 PM)
|
#281
Originally Posted by jman2050:
Here is a quick way to do it using a truth value though. Code:
for (int i = 0; i <= 100; i++)
{
bool FizzBuzz = false;
if (i % 3 == 0) { cout << fizz; FizzBuzz = true;}
if (i % 5 == 0) { cout << buzz; FizzBuzz = true;}
if (!FizzBuzz) cout << i;
cout << endl;
}
Last edited by Drkirby; 04-05-2011 at 09:52 PM.
|
|
Member
(04-05-2011, 09:50 PM)
|
#282
Originally Posted by Drkirby:
|
|
Posting on the wrong forum
(04-05-2011, 09:57 PM)
|
#283
I design business applications on rpgile for the telcos. They fucking suck, and everything fucking sucks.
Lemme put it this way: someone wrote a program in java to call the rpg binaries so that they return a value ... For a login page done in active server pages. Yes, that's for real. |
|
got my tag in the OT
(04-05-2011, 10:08 PM)
|
#284
Originally Posted by Steve Youngblood:
That typically will tell you if they're arrogant or well thought out or whatever. Then I ask what they'd do to mitigate it if they had the power. |
|
Banned
(04-05-2011, 10:15 PM)
|
#285
The most hilarious thing I've come across so far, only being a IT student at the uni was second semester of my OOT class, when someone managed to send his answer to the current assignment to all-theclass@mail.address instead of just to the teacher. Of course I opened it to see how others were coding and how that looked. Just before I did this I was sort of wondering if my code was at all pretty.
I open his and I just wanted to puke. He really had no consistency and horrible comments. It started with: Code:
/* Hi here is my Oblig3 which has one small problem that is little confusing for me with null objec that makes my waiting list to function when * i call it again it shows some error and sometimes i get "NullPointerException which is about null object and little complicated with String object * i do hope you will help me with it please as usual write to me all the comments you would say (maybe you don like how i write in english or * without easyIO :-) Joke!!! ok Thank yo checking. * /*//////////////////////////////////////////////////////////////////////////////////////////////////////// Someone replied "don't worry. No one is gonna use it". |
|
Corporate Apologist
(04-05-2011, 10:27 PM)
|
#286
Originally Posted by jman2050:
Really, we are arguing over what could at best amount to one or two clock cycles. Overall both take about just as long. Is there some sort of Fizzbuzz solution that will uses even less commands? |
|
Member
(04-05-2011, 10:27 PM)
|
#287
The only example I can think of recently that was mind boggling was someone who, in trying to help with another issue, I noticed that he was duplicating data from a parent table into a child table. I.e. Parent has field "type_id," "type_name" and a bunch of other data. The child obviously needed the primary key from the parent, which he correctly added to the child table. However, I noticed that he also duplicated the "type_name" in the child table. I asked if there was some reason for this move that I wasn't seeing. His response? To be able to sort by the "type_name" when displaying. This person wasn't new.
|
|
(04-05-2011, 10:35 PM)
|
#288
So at my company QA doesn't have access to the version control system, so we're dependent upon comments (if SQL) or release notes to figure out what's been changed.
This is what's in the files I'm looking at right now: Code:
Ver x.x.4 - 7/2010 Ver x.x.3 - 6/2010 Ver x.x.2 - 5/2010 Ver x.x.1 - 4/2010 Ver x.x.2 - 1/2011 Ver x.x.3 - 2/2011 |
|
Member
(04-05-2011, 10:39 PM)
|
#289
Zoe I would like to post a sincere and heartfelt apology to QA on the behalf of programmers.
The amount of shit you folks put up with from us is unreal. I currently owe my QA lead about 40 beers. QA: "Hey, I just spent four hours verifying that all the bugs you claimed were fixed are in fact still present, and was wondering when you were going to get a chance to revisit them." Me: "Oh. Uh. I forgot to tell you that I did all that work on a hotfix branch." QA: (somehow, miraculously, refrains from killing me) |
|
Corporate Apologist
(04-05-2011, 10:57 PM)
|
#291
Originally Posted by Zoe:
|
|
Member
(04-05-2011, 11:00 PM)
|
#292
Originally Posted by Drkirby:
I imagine there are some sneaky clever ways to do Fizzbuzz in less commands, though nothing really practical comes to mind. |
|
Member
(04-05-2011, 11:33 PM)
|
#293
Originally Posted by ronito:
how many times did you do it to master it that way? anyhow the dude started talking trash about his boss all by himself, no one asked him about it. |
|
got my tag in the OT
(04-05-2011, 11:41 PM)
|
#294
Originally Posted by nickcv:
Last edited by ronito; 04-05-2011 at 11:46 PM.
|
|
Member
(04-06-2011, 01:32 AM)
|
#296
I suppose if you're hiring for C or C++ programmers, the following could be a fun question to ask. I read about it in Joel Spolsky's book and recognized it immediately since I've had more hands on time with C++ than anything else:
Code:
#include <iostream>
using namespace std;
int main()
{
char text1[] = "hello";
char text2[] = "jimmy";
cout << "Before: \n" << text1 << '\n' << text2 << endl;
char* p = text1;
char* q = text2;
// asking why and how this line works!
while (*q++ = *p++);
cout << "\nAfter: \n" << text1 << '\n' << text2 << endl;
cin.get();
return 0;
}
|
|
(04-06-2011, 01:36 AM)
|
#297
Originally Posted by ronito:
|
|
Member
(04-06-2011, 03:25 AM)
|
#298
Originally Posted by Spoo:
Code:
#include <iostream>
using namespace std;
int main()
{
char text1[] = { 'h', 'e', 'l', 'l', 'o' };
char text2[] = { 'j', 'i', 'm', 'm', 'y' };
char text3[] = "hello";
char text4[] = "jimminy";
cout << "Before: \n" << text1 << '\n' << text2 << endl;
cout << text3 << endl << text4 << endl;
char* p = text3;
char* q = text4;
while (*p++ = *q++);
cout << "\nAfter first loop: \n" << text1 << '\n' << text2 << endl;
cout << text3 << endl << text4 << endl;
p = text1;
q = text2;
while (*p++ = *q++);
cout << "\nAfter second loop: \n" << text1 << '\n' << text2 << endl;
cout << text3 << endl << text4 << endl;
cin.get();
return 0;
}
|
|
Banned
(04-06-2011, 03:33 AM)
|
#299
Quote:
|
|
Member
(04-06-2011, 03:40 AM)
|
#300
This is something I've been dealing with a lot lately:
Given this struct in C++ (assume Win32 and no #pragma packing):
Quote:
|