|
Balboos wrote: I've heard that some are contracting out the management, too.
Interesting choice. Boneheaded decisions taken 5 timezones later. I suppose that it might be better than instant stupidity.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
JazzJackRabbit wrote: truly feel sorry for any guy who has to deal with clients who can think up such idiocracy.
See, thats where you're most likely mistaken. A client would never come up with that _exact_ idea. The client simply wanted to see 25000 pieces of info in screen. This "smart" developer figured that a datagrid would be best for his needs. And now that people have told him that its impossible, guess what he's going to tell the client? "Sir, its impossible to display 25000 pieces of information on screen.".
|
|
|
|
|
OMFG LOL!! Wat n00b, my grandpa could think of a better idea :P
|
|
|
|
|
I had to go back and look at how the product search was working on an old classic asp application. I happened to find this little gem lurking in the database. Fortunately there is some sanitizing going on in the asp to prevent a sql injection but a little piece of me died when I saw it.
<br />
ALTER procedure [dbo].[ily_products_search_keyword]<br />
(@sWhere varchar(2000) )<br />
as<br />
<br />
set nocount on<br />
<br />
declare @sql varchar(8000)<br />
<br />
select @sql = 'SELECT products.product_id,products.product_name,products.file_url, '<br />
select @sql = @sql + 'products.print_url, products.product_desc '<br />
select @sql = @sql + ' FROM products '<br />
select @sql = @sql + ' WHERE products.active = 1 '<br />
select @sql = @sql + @sWhere<br />
select @sql = @sql + ' ORDER BY products.product_name '<br />
<br />
exec(@sql)<br />
|
|
|
|
|
Agile development in it's purest form :p
xacc.ide
The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."
|
|
|
|
|
eggsovereasy wrote: ALTER procedure [dbo].[ily_products_search_keyword]
(@sWhere varchar(2000) )
as
set nocount on
declare @sql varchar(8000)
select @sql = 'SELECT products.product_id,products.product_name,products.file_url, '
select @sql = @sql + 'products.print_url, products.product_desc '
select @sql = @sql + ' FROM products '
select @sql = @sql + ' WHERE products.active = 1 '
select @sql = @sql + @sWhere
select @sql = @sql + ' ORDER BY products.product_name '
exec(@sql)
I wonder what will happen if I try the following:
exec [dbo].[ily_products_search_keyword] ' delete from products select * from products'
|
|
|
|
|
You need a ";--" at the end because of the order by, but yeah, its pretty bad.
|
|
|
|
|
eggsovereasy wrote: You need a ";--" at the end because of the order by
Not really, the "order by" was taken care of by the preceding "select * ", although it is unnecessary since no row will be returned.
|
|
|
|
|
|
Long time ago, in a vb6 application I found this:
Private Sub SetFocusControl(ByRef objControl As Control)
Dim EnabledControl As Boolean
EnabledControl = objControl.Enabled
objControl.Enabled = True
objControl.SetFocus
objControl.Enabled = EnabledControl
End Sub
Marc R.
|
|
|
|
|
That person must have come from the Access world where you can't set the focus to a control unless it's Enabled first. IIRC, you couldn't even set the Text of a control unless it had the focus!
|
|
|
|
|
Not at all! He is from c and c++ world...
Marc R.
|
|
|
|
|
MarcR. wrote: He is from c and c++ world...
I guess VB6 can do that to the best of us.
BDF
|
|
|
|
|
Typical VB code script.
Follow your nose using DoubleAnimationUsingPath
|
|
|
|
|
Hi,
I think control must be enabled then only we can set the focus.Because i faced this problem in one of my project.
If the control is in diabled then we can't do any operation on it.if you want set focus on the control, it must be enabled as per the code which you written here.
otherwise it throws the exception....
Any mistake pls forgive me.
Thanks and Regards
Ganesan.S
Software Engineer
|
|
|
|
|
The question is, why would you want to imperatively set focus on a potentially disabled control?
It's like, are you giving a user a listbox that lists all of the controls on the form and when they select one, you set focus to it? I mean I could see how that's useful...like if you have 20 thousand controls on the form. But here's the real question...Why would you want to make a disabled control enabled?
Maybe it was a handler for a checkbox and when the user checks the box, it enables a previously disabled control and sets the focus so the user...can...oh wait, it disables the control before the user can do anything.
WTF?
|
|
|
|
|
bool bool_report_progress = false;
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
...
if (bool_report_progress)
backgroundWorker1.ReportProgress(x, listbox1_Search.Items.Count + " items were found so far.");
}
private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
lable_reported_progress.Text = e.UserState.ToString();
}
private void checkbox1_report_progress_CheckedChanged(object sender, EventArgs e)
{
<font color=#00ee00>bool_report_progress = lbl_reported_progress.Visible = checkbox1_report_progress.Checked;</font>
}
As if I've been charged per letter;P
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
...do it all in Page_Load!
My company recently purchased a smaller company and our development department took over developing their web applications. My first task was to put a new user control on a few pages in one of the apps. While working on the first page I noticed something a bit odd...
(Sorry for the VB. In my defense, I didn't write the app.)
Private Sub Page_Load(blah, blah) Handles Page.OnLoad
' create some objects, initialize some variables
If Page.IsPostBack
' validate the user input
ValidateInput()
' save the user input to the database
SaveInput()
End If
End Sub
Farther down in the code I find this...
Private Sub Submit_Click(obj, args) Handles btnSubmit.OnClick
' direct the user to the new page
Response.Redirect(page.aspx)
End Sub
Smile and the world smiles with you. Laugh and the world thinks your insane.
|
|
|
|
|
I feel your pain there. I'm working on a website right now, and the framework we are using to build it - all its samples, all the pages that are there to build upon - not a single event handler. All postbacks and redirects. Sometimes it makes me want to puke
|
|
|
|
|
And this guy still lives?!!!!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
"There is no wealth like knowledge, no poverty like ignorance." Ali ibn Abi Talib
|
|
|
|
|
disable reader(1)
return
gosub printMainMenu
' disable reader(1)
return
I found this little pretty in a basic program im writing. the indentation indicates my genius.
|
|
|
|
|
bigbrownbeaver wrote: the indentation indicates my genius
The lack thereof indicates otherwise.
|
|
|
|
|
Apparently it was stripped out when I posted it. Double wammy
|
|
|
|
|
tip 1!
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
This one showed up in a code review. 'Nuff said.
string EntityID = new System.Text.StringBuilder("").ToString();
Cheers!
Humble Programmer
,,,^..^,,,
|
|
|
|