|
No doubt, a question like this deserves to be here in the hall of shame.
|
|
|
|
|
Ok... now we're reaching the level of absurdity
(yes|no|maybe)*
|
|
|
|
|
s_mon wrote: Ok... now we're reaching the level of absurdity
[Paradox] A programming question posted in the hall of shame and in a proper forum in one go? That case should be included in a forum guide above.
Greetings - Jacek
|
|
|
|
|
tarunbatra3393 wrote: hey - i am going to make browser
OK.
tarunbatra3393 wrote: if any one have the super code and trick
Well, I'll be the first to tell you something constructive: don't post your e-mail address here... you'll get ultra-spammed. You will receive the answers directly.
Anyway and
|
|
|
|
|
|
tarunbatra3393 wrote: hey - i am going to make browser if any one have the super code and trick to
make an xcellent browser than send it to tarun3393@gmail.com
I thought your'e gonna make one? Why do you need codes? :P
Good judgment comes from experience, and experience comes from bad judgment. Barry LePatner
|
|
|
|
|
At least you put it in the right category, for this is truly a "Hall of Shame" worthy request.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
A couple of years back, I was getting small "fill-in" jobs off Rent-A-Coder (now VWorker.com). One guy posted the following bid request:
"I want a website made. It must have all feature of Google and eBay. Shopping like Amazon would be good too. No time wasters."
And his bid limit for this task?
$250.
|
|
|
|
|
Some people are just clueless
|
|
|
|
|
|
Was troubleshooting some code in C# and came across this:
This is not the original code, but just to give an idea of what happens.
try
{
Console.WriteLine("enter try catch");
try
{
Console.WriteLine("enter try finally");
throw new Exception("try-finally exception");
Console.WriteLine("exit try finally");
}
finally
{
Console.WriteLine("finally called");
}
Console.WriteLine("exit try catch");
}
catch (Exception ex)
{
Console.WriteLine("exception: " + ex.Message);
}
Output is:
enter try catch<br />
enter try finally<br />
finally called<br />
exception: try-finally exception<br />
The problem was that exit try catch was never called.
I think the person that has written the code believed that a try-finally has implicit catch.
|
|
|
|
|
protected void LiveList_OnItemDataBound(object sender, RepeaterItemEventArgs e)
{
HiddenField username = (HiddenField)e.Item.FindControl("hidden_username");
Image mapbtn = (Image)e.Item.FindControl("mapbtn");
System.Web.UI.HtmlControls.HtmlTableRow tr = (System.Web.UI.HtmlControls.HtmlTableRow)e.Item.FindControl("rowlive");
if (mapbtn != null && username != null)
{
UserProfile selectedUser = null;
selectedUser = Sql.GetUserDetails(username.Value);
if (selectedUser != null)
{
BroadcastOptions broadcastOptions = BroadcastOptions.None;
int sessionId = 0;
if (Sql.CheckActiveSession(selectedUser.UserId, Visibility.IncludePrivate, out sessionId, out broadcastOptions))
{
Location[] locs = Sql.GetLocationByVodID(sessionId);
if (locs.Length > 0)
{
String mapUrl = mViewWebSite.AbsolutePath(
String.Format("/map.aspx?live=true&target_id={0}&uid={1}", sessionId, selectedUser.UserId.ToString()));
mapbtn.Enabled = true;
mapbtn.ImageUrl = "Images/miniWorldMap.png";
mapbtn.Attributes.Add("style", "Cursor:Pointer");
mapbtn.Attributes.Add("onclick", "ShowLocation('" + mapUrl + "')");
}
}
}
}
}
The above code was written by our previous senior web developer (that's what told to me when I was hired).
On every item bound on the repeater he
1) reads the username from hidden control
2) call database to load user details
3) another call to database to check any active sessions
4) another call to load whole list of gps locations to find whether gps is enables or not
5) then finally enable the map button if gps is enabled
Amazingly this list is inside an update panel that updated every 10 seconds
So for an average list of 30 users => total 3x30 = 90 database calls every 10 seconds
when i traced the page it was hauling at 320 Kb every 10 sec.
Fixed this in database, bringing a bool flag back by doing some joins and determining weather gps is enabled or not. Now only 1 db call every 10 sec.
|
|
|
|
|
saxenaabhi6 wrote: Looks like a database call obsession to me…
Come on, that's not obsession.
That's the relationship between boys and their toys.
A hidden needle is way more effective than an unsheathed sword.
That is, in the hand of professionals.
What about you?
Just pray your enemies are blind
|
|
|
|
|
saxenaabhi6 wrote: senior web developer
... and now? retired?
Little bit of a question... was he willing to rethink what've done?
(yes|no|maybe)*
|
|
|
|
|
hehe i dont know...
but i doubt my manager, he might have lied to me that they had a senior developer before, just to save reputation of the company
|
|
|
|
|
The kind of company, that relies more on titles...
(yes|no|maybe)*
|
|
|
|
|
UserProfile selectedUser = null;
selectedUser = Sql.GetUserDetails(username.Value);
You might want to confirm that your KPI isn't based on the number of lines you write.
"You get that on the big jobs."
|
|
|
|
|
We've outsourced some of our dev work, everytime they do something we have to check it because they keep on making mistakes.....
...when testing a change one of the developers made I noticed that the expected change didn't happen.
He said to me it should work, and he's created a unit test to test the change works...
...I then looked at his unit test:
if (order.Allocations[0].TriPartyEligibilityCriteria != null)
{ Assert.IsTrue(order.Allocations[0].TriPartyEligibilityCriteria.Length > 0); }
I had to walk him through this to explain to him just why his test was bad, very bad indeed and it took me over an hour to explain why that was bad and what he should have done instead!
The amount of time we spend inspecting their code and refactoring makes this whole outsourcing exercise a joke
|
|
|
|
|
Suffering in a similar fashion though the code, itself, works most of the time. They are just so untidy.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
Perhaps I'm missing the obvious, but why couldn't that be a valid part of a unit test?
|
|
|
|
|
You could certainly assert the length as part of the test, but the check for null is wrong - you should know if the value will be null or not and do an assertion on that (it may be valid for it to be null, for example if some other property is invalid, but this should be part of the spec).
|
|
|
|
|
I agree it should be part of the spec. There's nothing to indicate in the message or sample that it's incorrect for it to be optional element which can be null. (Only that if it isn't null then it should have a length greater than zero).
|
|
|
|
|
Me (paraphrasing): No, colleague, putting each one of a list of 24 values into its own text box is not an efficient method of data storage. How about putting them into an array, then you can reference them by number.
Colleague: I didn't know about arrays.
Me: (stunned silence)
Colleague: I use goto s to get to the code that reads data from the right text box.
Me: Modern programming recommendations are that you keep usage of goto s to a minimum because it makes determining program flow very difficult.
Colleague: Really?
Me:
|
|
|
|
|
There comes a time when some should consider alternate career paths. I believe the local Burger King is hiring.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
He or his colleague
(yes|no|maybe)*
|
|
|
|