Whats so bad about telerik?
loba
@loba
Best posts made by loba
Latest posts made by loba
-
Dynamic Hardcoding.
This is one of the gems I encountered today written by a guy thats no longer here.
Requirement: To show a list of "contact types" retrieved from the DB into a Cached DataSet in a drop down list.e.g. Phone, Email, Postal Address, Fax, Mobile etc..
This values must not be hardcoded since we might add new contact types like facebook,twitter etc..
This is what i found... note that for each item, the methods to get the info - name, id, are fired multiple times.
-----------------------------------------WTF CODE---------------------------------------------------
/// <summary>
/// Loads the data into the dropdownlist [cmbLocatorType]
/// </summary>
private void LoadData()
{
cmbLocatorType.Items.Add(new RadListDataItem(
LocatorType.Get().GetName(LocatorType.Get().GetId(LocatorTypeCodes.AfterHoursPhone)),
LocatorType.Get().GetId(LocatorTypeCodes.AfterHoursPhone)));
cmbLocatorType.Items.Add(new RadListDataItem(
LocatorType.Get().GetName(LocatorType.Get().GetId(LocatorTypeCodes.DaytimePhone)),
LocatorType.Get().GetId(LocatorTypeCodes.DaytimePhone)));
cmbLocatorType.Items.Add(new RadListDataItem(
LocatorType.Get().GetName(LocatorType.Get().GetId(LocatorTypeCodes.Email)),
LocatorType.Get().GetId(LocatorTypeCodes.Email)));
cmbLocatorType.Items.Add(new RadListDataItem(
LocatorType.Get().GetName(LocatorType.Get().GetId(LocatorTypeCodes.Fax)),
LocatorType.Get().GetId(LocatorTypeCodes.Fax)));
cmbLocatorType.Items.Add(new RadListDataItem(
LocatorType.Get().GetName(LocatorType.Get().GetId(LocatorTypeCodes.SMS)),
LocatorType.Get().GetId(LocatorTypeCodes.SMS)));
cmbLocatorType.SelectedIndex = 0;
dateTimeSelector1.Value = DateTime.Now;
}-----------------------------------------------------------------------------
---------------------------Patched---------------------------------------
/// <summary>
/// Loads the data into the dropdownlist [cmbLocatorType]
/// </summary>
private void LoadData()
{
LocatorType type = LocatorType.Get();
foreach (LocatorTypeBe.LocatorTypeRow row in type.BusinessEntity.LocatorType)
{
cmbLocatorType.Items.Add(new RadListDataItem(row.Name,row.Id));
}
dateTimeSelector1.Value = DateTime.Now;
}---------------------------Patched---------------------------------------
-
RE: Thinking out of the box!
@valerion said:
I don't think it's that bad. He's a GP, not a software engineer or IT professional, and came up with a solution to work around his lack of networking knowledge. It's not like it's a commercial product or anything.
I think TRWTF is that a GP and a Radiologist have to house-share... surely they could afford their own place?
The TRWTF here is that he took all the trouble to learn how to program an "invisible" browser to log in to his gmail which should be harder than googling for a managed DNS service or reading about APIs to access gmail.
-
RE: Thinking out of the box!
@Zecc said:
You have to admit it's pretty admirable that someone could have made such an "overengineered" solution work.
Just out of curiosity: if all the other people really weren't relevant, why mention them? Are you preparing for future posts?
Hahaha maybe? depends on whether you guys wanna hear more "over-engineered work". He's a pretty interesting guy actually and the solutions he provide to certain problems are very interesting!
-
Thinking out of the box!
Hi all,
This is one of many stories involving a current housemate who never ceases to amaze us. If you like this, I can submit more stories about him next time
Some background<o:p></o:p>
We recently had a family (1 couple and 1 infant) move into our house which is currently being shared by my family and another housemate who’s also a software developer.…
Husband (General Practitioner) who does a bit of coding on the side during his free time. --> He's the main character in this story
His Wife (Radiologist) – not relevant in this story
His Son (Infant) – not relevant in this storyMe (Software Engineer)
My Wife (Homemaker) – not relevant in this story
My Son (Infant) – not relevant in this storyHousemate (Software Engineer)
The Scenario<o:p></o:p>
So the husband (not from the IT industry), Keith was telling us how he missed local TV dramas/episodes from Singapore ever since he moved over to Perth,Australia and Keith’s got the bright idea of setting up a home server that would record all the shows from the TV and stream it over the internet so that he will be able to watch it while he’s here.
Since Singapore’s internet infrastructure is highly developed and competitive enough for Keith to sign up to a Starhub Maxonline Ultimate plan which offers speeds of up to 100Mbps download and 2Mbps upload at a reasonable price (with no download limit), we thought that this solution might actually work and applauded Keith for being so smart.
Consequently, I mentioned that Starhub only offers dynamic ip addresses and me and my housemate automatically assumed that Keith would being signing up to a web-redirection service like dydns or no-ip to get his dynamic ip address resolved automatically.
Keith gave us an incredulous look and ask what dydns or no-ip was… We looked at each other and asked Keith: “So how did you actually manage to resolve the ip addresses when Starhub (the isp) resets it?”
The Objective<o:p></o:p>
How do you resolve a dynamic ip address that resets occasionally without using a managed dns service? So you can find out the correct ip to log in to your server?
Keith’s Solution<o:p></o:p>
Keith proudly explains his solution to the problem:
He coded a small service app (in VB) that runs every 15 minutes in the streaming server. This app generates an invisible browser. The browser then redirects to one of those whatismyIp.com sites to capture his ip address. Then the browser automatically logs into his gmail account (hardcoded username/password) and composes an email that pastes the captured ip address and sends it back to his own gmail account. Finally, all he needs to do is just log into his own gmail and he will be able to find the server’s new address whenever he wants to watch some Singapore TV.
P.s. If I remember correctly, he mentioned something about hardcoding the coordinates of the user/password and submit button box so that he can manipulate the mouse in the "invisible" browser to the correct location and enter his credentials into the input boxes and make the mouse "left-click" on the login button.
Conclusion<o:p></o:p>
We looked at each other, shook our heads and silently agreed not to discuss any IT related topics when he’s around. On a side note, we did try to tell him that there's gmail api available that allows a user to log in but he said he didnt trust other people's code. LOL
The Consolation<o:p></o:p>
At least he didn’t code his own streaming software…..
<o:p> </o:p>
<o:p> </o:p>
<o:p> </o:p>