15,892,298 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by BobJanova (Top 200 by date)
BobJanova
12-Jun-14 8:34am
View
Isn't it just the commented out part at the bottom?
BobJanova
3-Jun-14 14:16pm
View
Cool. I'll post it as an answer then since otherwise the question still looks unanswered.
Ed: check out some articles about WPF data binding, though. You'll really want to learn that stuff if you're staying in WPF.
BobJanova
3-Jun-14 6:15am
View
Can you just cast it?
ValueBoxControl control = (ValueBoxControl)List.SelectedItem;
Really though you should be data binding both controls to the same view model layer, so when you change selected item on the list view it causes the other control to update
through the data source
and not through this kind of UI spaghetti.
BobJanova
27-May-14 12:11pm
View
Please for the love of sanity and your future/present employers learn about data security before trying to write database code!
BobJanova
23-May-14 8:57am
View
I disagree, I'd always separate domain model classes (User in this example) and database interaction code. Model classes should be creatable and usable anywhere (e.g. unit tests) without needing to know anything about their data source.
BobJanova
23-May-14 8:52am
View
What is IO? What is Out? What is the interface/API of the device you are attempting to interact with?
BobJanova
29-Apr-14 10:59am
View
I said how to do it if you need to (disable client-side caching and hope the browser respects the headers). I stand by the sentiment that you almost never need to do this.
The only purpose of doing it is to protect sensitive information
from the user who was just accessing it
. Site authentication solves a different problem: how to prevent information which is sensitive to a user being accessed by
other
users. Most people asking this question, including you judging by your reference to 'in the public domain' as the alternative, mix the two up.
If your potential problem is other users seeing someone's information, you only need server-side authentication and (if you worry about packet interception) HTTPS or another SSL-based transfer protocol. You do not need to mess with caching or the Back button unless you want a user not to be able to see what they were looking at before, and most people asking the question do not need that.
If you have nothing concrete to contribute, don't respond.
Have you really followed your own advice there? Responding to a 2-year-old post that wasn't even the 'accepted' answer to have a go at the answerer isn't much of a contribution, either.
That said, welcome to CP, hopefully we'll see you getting into the community and answering people's problems too!
BobJanova
25-Apr-14 12:45pm
View
Have each of the four forms attach to the DataReceived event. Bang, done! That's the magic of delegates :-)
BobJanova
16-Dec-13 13:36pm
View
Nearly but no. The user can still record the response and save it, or block the initial request to video.php and then submit it manually.
BobJanova
16-Dec-13 11:50am
View
The user can watch browser traffic (e.g. through Chrome's F12), stop the initial request to video.php, and go direct to access.php with the VID token in the initial page. Additionally, the user can record the response to the request to access.php and save it.
BobJanova
16-Dec-13 5:46am
View
I'm guessing your string is comma separated or similar in which case you want to use string.Split.
BobJanova
16-Dec-13 5:00am
View
This regex matches a left paren, then anything that isn't a right paren, then a right paren, and as you note it isn't tied to the end of the string. So for example in a string "CodeProject (UK) Ltd. (3)", this answer will match "UK" (and result in a string "CodeProject (0) Ltd. (3)") whereas mine will match "3".
BobJanova
12-Dec-13 12:24pm
View
Right. It should be a parameterised query though to avoid SQL injection as you say.
I would use a left join for this, as I would say it's more useful to get a row with a null for ImageTB.Picture rather than no results (which is what happens with an inner join).
BobJanova
12-Dec-13 12:09pm
View
This doesn't appear to be possible without some low level hackery.
BobJanova
12-Dec-13 12:06pm
View
Deleted
[removed - meant to post as solution not comment]
BobJanova
12-Dec-13 9:28am
View
Indeed. In fact this is a general thing, 'pointer to X' and 'X pointer' are two ways of saying the same thing - e.g. int* is either 'pointer to integer' or 'integer pointer'.
BobJanova
11-Dec-13 13:09pm
View
Downvoting because you are encouraging the storage of the password in plain text in the database. Please read Griff's article linked from his answer about why that's a very bad thing.
BobJanova
11-Dec-13 13:06pm
View
Downvoting because you are encouraging the storage of the password in plain text in the database. Please read Griff's article linked from his answer about why that's a very bad thing.
Also, because you aren't using parameterised queries so you are open to SQL injection, which is a really bad thing.
Put together, implementing a site with a login mechanism as you have put here is
a major security risk
: with a small amount of guesswork a malicious attacker can create a user for himself, delete all existing users and generally destroy your data. Although this particular exploit doesn't provide a way to read data from the database, if you write code like this you will undoubtedly be providing read-write SQL injection opportunities as well.
BobJanova
11-Dec-13 5:37am
View
I often find it more convenient to store the hex string for the hash because then you can just do a 'where username=@1 and password=@2' with strings which is easy. This does require that the connection between web application and database is secure (as the actual hash used to log in is sent) but that's usually a given.
BobJanova
17-May-13 10:10am
View
Where are you trying to invoke it from? Javascript/VBScript?
Are you in charge of the website so you can add an id to it?
BobJanova
17-May-13 5:39am
View
:facepalm:
Do you know what 'static' means (particularly in the context of a web app)? It means that there is one copy of the data for the whole application! So of course it will overwrite it whenever someone visits the page!
You should almost never use a static variable in a web app. The scope of that field is basically undefined, as it is global across a particular instance of the app, but you have no control over when the app is started and stopped, or whether it will be sharded, so you never actually know how many users are sharing a static.
Just read it out of the session whenever you need it (or put it in a method-local variable if that makes sense).
BobJanova
17-May-13 4:56am
View
You said you put it in the session. That is
entirely different
from a static field!
BobJanova
16-May-13 10:21am
View
You should be submitting a new record as an atomic query. 'insert into table (userid, data) values (@UserID, @data)'
cannot
mix up user IDs and data. What are you actually doing in your insert process?
BobJanova
16-May-13 7:16am
View
Downvoted because it is so easy to search for ... the google search gives a worked answer in the second hit!
BobJanova
16-May-13 7:15am
View
Using the user name or ID as a key and storing that in the session is fine. It's more likely that your database query is at fault if you are having trouble in that area.
BobJanova
22-Jan-13 11:47am
View
The gain was significant for me. What I was doing was populating a data table from a data object through reflection (because the data object could be of different types), and the time to look up the properties (through GetFields) was a lot more than the time to read all the values and populate the grid. Caching the FieldInfo objects made the UI refresh go from painful to not noticable.
Using Reflection.Emit is another step down the same road: a larger performance gain but more obfuscation and complication in the mechanism.
BobJanova
22-Jan-13 11:38am
View
This doesn't answer the question. It also implies that DateTime.Equals and DateTime.Compare are the same thing, which they aren't.
BobJanova
27-Nov-12 6:10am
View
Actually delete the column! Pay attention to the error message you get from the alter statement when you try to delete it. My guess would be that you have a trigger or foreign key lookup against the column so it wouldn't let you delete it, and you didn't notice. But you haven't provided enough information to do more than guess.
BobJanova
27-Nov-12 5:22am
View
The only possible answer to this is that you didn't actually delete the CNIC column; maybe the alter statement failed.
BobJanova
19-Nov-12 6:45am
View
It seemed in between comment and solution to me, in that correctly diagnosing the problem is often 90% of fixing it. I was hoping that someone would provide code and then I could edit it in or refer to it.
Views on a question typically drop off after the first day anyway as it slips off the first page; I'm not sure you can blame me for that :-). Also it's been a weekend!
Are you still having problems?
BobJanova
16-Nov-12 5:14am
View
If they are both controls bound to the same data source then it should just work. If you are constructing the menu yourself then you will have to handle the binding to both explicitly.
BobJanova
13-Nov-12 12:01pm
View
If it's file offsets it probably needs to be 4 or maybe even 8 bytes (though I doubt this person is working on seriously large 64-bit data just yet).
BobJanova
13-Nov-12 5:08am
View
No, where do you do stuff to 'drawing'? All you've shown so far is where you
use
'drawing' by painting it onto a control. Calling that again will refresh the control, but with the same image that it had before. You need to call again the code that actually creates the drawing.
BobJanova
13-Nov-12 4:28am
View
And where do you draw it?
It looks like you have everything hooked up correctly and you just need to draw all over 'drawing' again.
BobJanova
9-Oct-12 4:48am
View
um, read the last sentence of my answer ...
BobJanova
2-Oct-12 8:11am
View
I don't have a code example for the first way, but it's fairly simple:
Bitmap b = new Bitmap(control.Width, control.Height);
control.DrawToBitmap(b, control.Bounds)
I linked to that method in my answer already :-).
The second way is a moderate amount of work.
BobJanova
28-Sep-12 11:00am
View
Haha, you're welcome and thanks. So tempting to put that in my forum signature ...
BobJanova
27-Sep-12 11:04am
View
Oh right, sorry. When you look at the .svc in a browser, is the method defined correctly? Does it look different for the local and remote servers?
This is some form of configuration error and frankly there's no way anyone on here is going to be able to solve it for you.
BobJanova
27-Sep-12 10:56am
View
Then the problem is with the client. Are you -sure- you updated the service reference after you made this a GET method?
BobJanova
27-Sep-12 10:15am
View
You have obviously not tried 'all possible things', or you'd have tripped over the one that makes it work ;)
There is very little to go on here. You've posted some code that should work. Have you tried looking at the HTTP requests that are actually being made, to see whether the argument is being passed?
Does it work if you change the URL to the remote server and re-run? If so it's something to do with your local server.
BobJanova
27-Sep-12 5:10am
View
Perhaps you used to have it defined as POST and haven't updated the client?
BobJanova
25-Sep-12 6:09am
View
homework
BobJanova
24-Sep-12 4:52am
View
I don't think that is possible, as the texture coordinates are attached to a vertex just like its spatial coordinates.
BobJanova
21-Sep-12 11:19am
View
Learn how to use the command line. This command wouldn't run from anywhere. You need to put quotes around command line parameters that have spaces in.
BobJanova
21-Sep-12 8:10am
View
Asking for 'quick answers' will result in 1-votes and not an answer. I am editing your title so people can see what you are actually asking.
BobJanova
21-Sep-12 5:14am
View
What does 'multithreaded locking technique' even mean? As Sowraaj points out, locking sections of code forces them into single threaded behaviour.
BobJanova
14-Sep-12 11:55am
View
Are you sure you included all the quotes in this example? Including those single ones in the string around a?
BobJanova
14-Sep-12 4:39am
View
Splitting a task like this up to its independent parts, which can be run in parallel, is within the definition of parallel programming that I'm familiar with.
BobJanova
28-Aug-12 12:07pm
View
Check the permissions etc on that directory. Try running your application with Outlook closed down (including all the background services it uses); maybe it is watching the directory and stopping you doing things there.
BobJanova
23-Aug-12 11:12am
View
Your question is not clear. What do you actually want to do?
BobJanova
23-Aug-12 11:10am
View
MyNodeItem
does
contain a List<MyNodeItem>.
BobJanova
22-Aug-12 8:14am
View
<input type="button" önclick="window.location=someurl.aspx"/>
(or a submit button in a <form action=someurl.aspx>)
... and have someurl.aspx render the content.
I mean, the whole purpose of server side scripting is to generate HTML and send it back to the client. If you can't do that then you need to go back to step 1 and learn how to use it.
BobJanova
20-Aug-12 11:51am
View
It depends what you mean by 'functionally essential'. I don't think there's a functional difference that you can't cover either in the constructor or in a Shown event handler with a first-use guard. But the time between the end of the constructor and Loaded being called can be several seconds, so if you've got UI to update when something is 'about to happen' there can be a business case for using Loaded.
BobJanova
17-Aug-12 4:57am
View
Between the end of the constructor and Load being called, the operating system and Framework do a whole bunch of stuff behind the scenes that you can't interfere with. That includes making OS controls and window handles, so if you want to do anything which requires that the control actually exists, you can't do it in the constructor.
All that setup also takes quite a bit of time, so if you kill a splash screen in a constructor then there will be an appreciable gap in time before the form actually displays.
BobJanova
16-Aug-12 5:49am
View
What problem?
AJAX requires client-side JavaScript. There's no getting around that.
BobJanova
16-Aug-12 5:42am
View
If you want to do form-initialisation things that require controls to be fully set up, you need to do them in a Load handler. For example data binding on DataGridViews doesn't run until the control is 'loaded'; I've had to add special processing in Form.Load for that in the past.
Also, it's a good time to kill a splash screen.
BobJanova
15-Aug-12 11:07am
View
Welcome. I edited the solution with these modifications.
BobJanova
15-Aug-12 11:06am
View
Define 'fail'.
Do you even have an OrderByType controller method (this is the URL that you're posting to)?
BobJanova
15-Aug-12 11:05am
View
You need to do that -and- set up a timer.
BobJanova
15-Aug-12 10:42am
View
That's what I get for typing it straight in here ... though you should be able to work it out as well. Try
if(!openForms.TryGetValue(type, out c) || c.IsDisposed)
BobJanova
15-Aug-12 9:52am
View
Not sure it was you but when voting on a solution, please remember 5* = good and 1* = bad.
Also, 'urgent' means 'people will skip over your question because you're too demanding'. If it's that urgent, you should already know enough to complete your task instead of expecting strangers to do it for you.
BobJanova
15-Aug-12 9:51am
View
You are loading the AJAX response into 'mydiv'. Do you mean the content of the response also contains all the boilerplate and div tags?
BobJanova
15-Aug-12 9:00am
View
Can you open the file in a different editor?
BobJanova
8-Aug-12 11:41am
View
You should post this as an answer to receive your 5s :p
BobJanova
3-Aug-12 9:54am
View
There's an important point here. The current time can be found on the client, with pure JS; you don't need AJAX or any server side gubbins at all.
BobJanova
2-Aug-12 10:53am
View
This is a partial solution, because if you set a range like 18-20h this will always fail.
BobJanova
2-Aug-12 10:52am
View
Seems like homework, this is a really arbitrary looking requirement.
BobJanova
2-Aug-12 5:49am
View
Paste the exception report and the line numbers of your code. There is no way you can be getting a null pointer exception on Context.Response.End because you've already used Context.Response several times above, so it can't be null.
BobJanova
31-Jul-12 6:40am
View
This seems like a homework question ...
BobJanova
20-Jul-12 12:22pm
View
Check the calling convention of the DLL: is it compatible with LoadLibrary? Do you need to specify parameter-type suffices to the name?
BobJanova
20-Jul-12 12:21pm
View
That's not C#, it's VB.
BobJanova
19-Jul-12 13:15pm
View
Okay, so new plan: have your C function accept a pointer to a callback function (which you can hook to with a delegate in C#), that returns whether processing should abort and close the streams etc. That function (in C#) can simply return true or false depending on whether you want to cancel.
BobJanova
19-Jul-12 12:46pm
View
A query parameter is a ?key=value in the URL, or in a posted back form. I think there's also a Command interface in ASP.net that you can use to attach result values to buttons. I'm not an expert on old school ASP.net though (because it's awful).
BobJanova
18-Jul-12 10:30am
View
I didn't know that data binding on a control hooks onto changes for classes that don't implement INotifyPropertyChanged. I'm going to have to play with this later because I'm sure I have done something similar and it didn't work. Your solution is interesting and new to me.
BobJanova
18-Jul-12 10:29am
View
Oh that is nice, I didn't know that was possible.
BobJanova
18-Jul-12 10:17am
View
Are you sure the .mdb is not set up to auto-decrement keys? A data bound DGV is quite a thin wrapper around its data source.
BobJanova
17-Jul-12 17:18pm
View
You always need to implement INotifyPropertyChanged in the source of a data binding, even using the built-in mechanisms, if you want the target to be updated when the source changes. That's true now when you are binding to a combo, if you want the combo to update when you set MyClass.MyValue.
I wonder if you want the binding the other way around, i.e. something is bound to an instance of MyClass. That's most directly analogous to the combo situation you give, and while a Control doesn't directly support INotifyPropertyChanged, the data binding mechanism is similar, just all done internally instead of through interfaces.
Note that the -target- of a binding doesn't need to know anything about the binding, it will just have its property setter called sometimes.
BobJanova
14-Jun-12 9:55am
View
It's not clear what you're asking. If you explain that properly, you might well find that you've answered your own question.
BobJanova
8-Jun-12 6:25am
View
deleted - reposted with corrections as new ticket shortly after this one
BobJanova
1-Jun-12 5:52am
View
unclear
BobJanova
31-May-12 11:57am
View
What do the columns represent?
BobJanova
31-May-12 10:37am
View
In what way is it not working? Check the SQL error message, it will tell you what the problem is. My guess is that you didn't add the table with the right name, you made a mistake with a column name, or you didn't apply the correct permissions to your web user on the tables. But without the error message from the database it is impossible to do more than guess.
BobJanova
31-May-12 9:36am
View
Then you're pretty much screwed, the whole purpose of obfuscation is to remove meaning from the compiled code (IL in this case) so if you're looking for particular meaningful names you will not succeed.
BobJanova
30-May-12 11:46am
View
Good job answering this in a non-snide fashion, +5
BobJanova
29-May-12 6:39am
View
5 for this because server-side handling of TextChanged is a terrible user experience and doing it with client-side script is the correct answer.
ed: even if you need some server-side information, you should do it with client script and AJAX
BobJanova
28-May-12 6:12am
View
I offered a 4 because of the confusing part about multiple inheritance. Interfaces don't replace MI; they provide a method of specifying multiple required behaviour, but not one for -inheriting- that behaviour.
BobJanova
25-May-12 12:06pm
View
Show the JS please. There may be a caching or target issue.
BobJanova
24-May-12 17:28pm
View
That's because you didn't do what I suggested, you're still declaring Calenders (sic) inside each method.
BobJanova
22-May-12 10:51am
View
Yes, a Linq expression as written on your second line is the right answer. However, since all you want to do is iterate over it, I wouldn't use ToList, I'd just do
listbox.Items.Clear();
for(string s in source.Where(s => s.StartsWith(input)))
listbox.Items.Add(s);
BobJanova
22-May-12 10:45am
View
Vague and seems like you made no effort.
If you have a database for messages, and you know how many unread ones there are, it's simply a case of modifying the markup that you send back to include that on the client side.
BobJanova
22-May-12 6:58am
View
Where are you looking? I think stdout for web apps ends up in a log file somewhere, but it might just get swallowed if you don't set up logging.
BobJanova
21-May-12 11:03am
View
I second the suggestion to look for loading and throwing away. Simply using a static image shouldn't be slow enough to notice.
BobJanova
21-May-12 11:02am
View
The use of 'blue' and 'green' leads me to believe he's talking about channels as well, but it could also be a hue filter.
BobJanova
18-May-12 13:09pm
View
Very funny, but compare can mean 'are they equal', 'is one larger than the other in sort order', and various other domain specific things.
BobJanova
18-May-12 11:34am
View
Define 'compare'.
BobJanova
17-May-12 11:29am
View
Absolutely.
BobJanova
15-May-12 6:41am
View
This should work. Have you tried paging through the results and seeing if all the relevant rows are highlighted?
BobJanova
15-May-12 6:37am
View
WinForms? WPF? ASP.net?
BobJanova
14-May-12 8:39am
View
Really? WPF won't let you set things like this? Whyever not?
BobJanova
14-May-12 8:37am
View
I use the LumenWorks one (the first link you posted), it is awesome and has a nice permissive licence. Reading a CSV properly is hard (the spec is not particularly clear and quotes are awkward) and something ideally suited to farming out to a third party library.
BobJanova
10-May-12 9:51am
View
I'm not sure that any requests you try to fire off in that handler will be given time to go anywhere, even if you're still connected.
BobJanova
10-May-12 7:09am
View
What do you mean by 'debug'? If you mean 'walk through source code', that's essentially impossible (I know it's not actually, but it's a hard problem).
BobJanova
9-May-12 12:10pm
View
I believe what the questioner wants is to create a graphical editor, which produces some output that can be then used to create a page.
BobJanova
9-May-12 12:08pm
View
I doubt this is to do with parent/child windows (although as SAK hints at, it's actually 'owner/owned' with forms in .Net, parent/child is strictly a different thing). Most likely you are doing something in the wrong thread and either stalling the UI thread or trying to do UI interactions in another thread.
If you can create a simple example which fails for you, without any external dependencies or 'clever code', that would be interesting. My suspicion is that in the process of making such an example you will discover which component of your application is responsible for this weird side effect.
BobJanova
9-May-12 12:06pm
View
nice triple post there SAK ;)
BobJanova
8-May-12 10:42am
View
What happens if you don't do 'this.Close()'?
BobJanova
8-May-12 10:41am
View
The style is weird, but setCounter returns the new value, so I don't think this is the problem.
BobJanova
5-May-12 6:43am
View
I wouldn't try to connect Flash up to a SQL database directly at all. Instead, I'd write a web app layer (in ASP.net or PHP or a similar server side technology that is good at talking to databases) which translated data to/from the form that is easy to deal with in Flash, probably XML as AS3 has good XML support built in.
BobJanova
4-May-12 6:05am
View
Are you permitting cookies in IE?
BobJanova
3-May-12 6:36am
View
Reason for my vote of 1
blatantly homework, you didn't even bother rephrasing the question
BobJanova
3-May-12 6:34am
View
So, um, what's your question?
BobJanova
2-May-12 13:42pm
View
I'm not working on this software any more, but thanks.
BobJanova
2-May-12 8:51am
View
What you're doing looks close to right, though you might want to set a clipping rectangle.
BobJanova
2-May-12 8:49am
View
Reason for my vote of 1
no context, vague, no description of actual problem
BobJanova
30-Apr-12 10:15am
View
Reason for my vote of 1
unclear, vague
BobJanova
24-Apr-12 13:07pm
View
In short, no.
BobJanova
24-Apr-12 7:28am
View
This sounds like a third party component, in which case you should ask this on the vendor's forums.
BobJanova
23-Apr-12 8:44am
View
What are the actual contents of the file?
BobJanova
13-Apr-12 8:49am
View
Adding 'homework' tag to this, it blatantly is. Also a cross post with C# forum.
BobJanova
13-Apr-12 8:47am
View
Really? If that's true, it's insane.
BobJanova
12-Apr-12 13:11pm
View
Virtual statics can be useful, certainly. And you are correct, in my mind, to say that a Delphi constructor is more like a (virtual) static method than a conventional language constructor, although it does have special things about it.
Delphi's meta-types are excellent, and even dynamic typing like JavaScript and ActionScript give you a lot more in this department than C#. I too would like to see that particularly idea stolen for .Net.
I don't see any reason why we can't have virtual statics, either.
BobJanova
12-Apr-12 11:04am
View
You need to actually define the language first. I'm not sure you really understand what you're asking ...
BobJanova
11-Apr-12 17:13pm
View
Virtual constructors aren't virtual in the same sense as normal methods, even in Delphi; they are called on a type reference (in .Net speak, a Type) instead of on an instance. Constructors can be invoked in a similar way in ActionScript, and in .Net Activator.CreateInstance does a similar job.
In a way all constructors in .Net are already virtual and overridden, as you must call a base class constructor.
BobJanova
30-Mar-12 5:52am
View
Is this your code? If so, how come you don't understand it?
You're not likely to get an answer to such a vague question with a large code dump.
The whole thing is quite ugly to my eye, too.
BobJanova
29-Mar-12 13:06pm
View
I don't know the details, sorry, I'm not an ASP.net old school expert.
BobJanova
28-Mar-12 11:56am
View
Check your session configuration.
BobJanova
28-Mar-12 6:50am
View
'Like facebook' isn't a good spec. You need to work out what you actually want. There are a large number of AJAX chat tutorials if you search for it.
BobJanova
27-Mar-12 7:18am
View
I don't understand the question. Passing a different 'date' variable to this code should already do what you ask for.
BobJanova
19-Mar-12 14:58pm
View
I was giving the questioner the benefit of the doubt in assuming that it was not a 'gimme codez' question, and that he was merely confused as to how to operate on images in C#.
You are, of course, correct that correctly stitching together separate images is a complex operation, though I'm not convinced that perspective effects are that important for the '90% case' (landscape shots taken with a standard digital camera focused at infinity). Again, I was assuming that the poster realised that it was a hard problem and was interested in exploring the core algorithms, because if not, it's a 'gimme codez' that wouldn't even be worth posting against.
BobJanova
19-Mar-12 7:46am
View
Did you write this code? And if so, how did you write it without understanding those things?
BobJanova
19-Mar-12 7:00am
View
Clever. Gets my 5, even if it is a repost from SO.
BobJanova
19-Mar-12 6:59am
View
The message for a security exception usually makes it fairly clear what permission you need but don't have.
BobJanova
16-Mar-12 10:04am
View
Well clearly the problem is the 'height=130px'.
BobJanova
16-Mar-12 7:49am
View
Do you mean parameterised queries (for database lookup)? If not, I don't really know what this question is trying to ask.
BobJanova
16-Mar-12 6:02am
View
+1 for #D
BobJanova
16-Mar-12 5:57am
View
deleted as repost: http://www.codeproject.com/Questions/348119/how-to-use-message-box
BobJanova
16-Mar-12 5:56am
View
Seems like you need to go back over this section of your course and read it slower and more in depth so it goes in.
BobJanova
16-Mar-12 5:41am
View
Does it not have a PlainText property or similar? Or, uh, why not just use a <textarea> if you just want the plain text ...
BobJanova
15-Mar-12 12:56pm
View
No, the => syntax for defining lambda functions is a part of the language. You can, for example, use it to define event handlers:
myButton.Click += (s, e) => { some stuff with s and e };
System.Linq defines a lot of extension methods (such as FirstOrDefault, Where, Select), mostly against IEnumerable<T> (which List<T> implements) which take functions (which you can declare as lambdas) as parameters that define how to filter, convert, compare etc.
There's really more going on than can be explained in a comment here; searching for 'Linq tutorial' and 'C# lambda' should get you some useful introductory material.
BobJanova
15-Mar-12 9:38am
View
I'm not sure this is possible. I don't think you can get an event for 'the content pointed to by this link was completely downloaded', and you can only get the browser to download a file by a direct link, as far as I know. The only thing I can think of is if there is some way to make a javascript: url return something with headers and a Content-Type/Content-Disposition. But I don't think there is.
BobJanova
15-Mar-12 9:19am
View
Not clear. You can clear a dictionary (i.e. remove all items) using Dictionary.Clear().
BobJanova
14-Mar-12 13:30pm
View
Good point, I hadn't noticed that passwords were involved.
BobJanova
14-Mar-12 9:32am
View
At no point do you do anything with the 'childNode' column, either in the reading or writing phase. So it will do nothing (actually the INSERT should fail unless you gave it a default value).
BobJanova
14-Mar-12 9:30am
View
Are you sure you're submitting the service request in the right format? Check the service provider's documentation and examples.
BobJanova
13-Mar-12 8:28am
View
Is a map of int->delegate really any clearer than storing the name of the delegate directly? I don't think so.
BobJanova
12-Mar-12 9:00am
View
What exception?
Do you get an exception in the server as well?
BobJanova
8-Mar-12 13:36pm
View
These are all questions you should ask your teacher. No-one here on CP is being paid to be your personal tutor.
BobJanova
8-Mar-12 10:39am
View
repost
BobJanova
8-Mar-12 9:49am
View
If it's causing a UI refresh each time, it certainly can be.
BobJanova
8-Mar-12 9:49am
View
This will not help at all for updating a UI control.
BobJanova
8-Mar-12 9:48am
View
If you don't have any known location where you can read the starting location of all the records, you're pretty much screwed. You have to read sequentially through the file, up to the point you want, at least once to find all the places where the records start.
This is a consequence of a nice human-readable text format.
However, I'm guessing the file is so small (anything under megabytes) that just reading it sequentially and loading the whole object structure into memory and manipulating it there would be fine.
BobJanova
8-Mar-12 7:16am
View
Perhaps you need to reread the course/tutorial material about delegates?
You create the sort method or comparison function outside the component, wherever you are calling it, and pass it in. E.g.
class CallingClass {
static void CallComponent(){
YourComponent c = new YourComponent();
List<string> list = (new string[] { "Test", "Another test", "42" }).ToList();
c.EncryptAndSort(list, ComparatorMethod);
}
int ComparatorMethod(string a, string b) { return a.CompareTo(b); }
}
... which assumes you declared a delegate like
public delegate int ComparisonDelegate(string a, string b);
(This exercise also seems poorly designed, you shouldn't have the encryption component doing sorting and duplicate removal anyway.)
BobJanova
8-Mar-12 6:53am
View
5 for winning the race :p
BobJanova
8-Mar-12 6:43am
View
Sounds like homework. Since you're supposed to 'figure out the best solution' as part of the exercise, it spoils the point to give you one ;). But you can just have the outer interface method of the assembly (where you specify the list) accept either a 'sort the whole list' method or a comparator as an argument. You can specify delegates in the argument list of methods and it will just work, e.g.
function DoStuff(EventHandler e){
// ...
e(null, null);
}
// somewhere else
myInstance.DoStuff(HandlerMethod);
// ...
void HandlerMethod(object sender, EventArgs ea){
Console.WriteLine("Handled");
}
BobJanova
8-Mar-12 5:58am
View
I don't really understand the question. The component doesn't need to know about the list if it can encrypt each item individually (the caller can just sort the list outside any calls to this module).
If you're writing this as a .Net assembly you can just expose events or methods with delegates (or Func<...> types) directly.
BobJanova
7-Mar-12 9:42am
View
Short answer: ASP.net (non-MVC) is a pile of crap and half the controls don't work in standards-compliant ways. You would be better off writing a navigation menu control from scratch and using that; it's not that hard.
BobJanova
7-Mar-12 7:06am
View
Have you actually attached this event handler to the grid? Not trying to be funny but that's usually why events don't fire.
BobJanova
7-Mar-12 7:04am
View
You almost certainly don't need to, and shouldn't, do this. A single form should generally be a self contained UI entity and you oughtn't to be poking about inside one from another. There are exceptions but they are unusual. Please say why you think you need to do this because there may well be a better solution to the actual problem you have.
BobJanova
7-Mar-12 6:58am
View
Not clear. Do you mean you want to be able to use the media controls to play content that is in a MemoryStream inside your app?
BobJanova
5-Mar-12 11:24am
View
You can lock tables within a single transaction trivially. I think you mean permanently locking a whole table as a read only archive, in which case you should remove the UPDATE and DELETE (and ALTER etc) privileges from the application user on that table.
BobJanova
5-Mar-12 7:40am
View
I gave you a 5, but in C#, arrays are always sequential, fixed length and indexed by integer. The more general case, including 'associative arrays' (i.e. arrays indexed by string or other object, or sparse keys), and variable length vectors, would be covered by 'collection' in C#/.Net terminology.
BobJanova
2-Mar-12 8:53am
View
Format it with a method like this (you can pass a double[]) and then copy it to the clipboard.
BobJanova
1-Mar-12 11:58am
View
The null-termination is a good suggestion.
However, this: "C# strings are unicode and the resultant byte array will have two "bytes" for every "character" in the string" ... is not true, unless you're using the UTF16 encoding to generate the byte array. Encoding.Default and Encoding.ASCII are 1:1, and Encoding.UTF8 is 1 byte for low-bit characters.
BobJanova
23-Feb-12 9:18am
View
I updated the question to fix the tags.
However, you haven't really asked a question, so it still needs clarification from you.
BobJanova
23-Feb-12 5:32am
View
What is AD?
BobJanova
22-Feb-12 14:15pm
View
You need to declare the delegate to take an int.
BobJanova
22-Feb-12 11:06am
View
If you're relying on an external dependency like this for other tests, then they're not really unit tests in the strictest sense. See if you can make everything genuinely unit testable, and pass in a mocked-out path instead of actually asking the environment.
Some things (file access, database connection code etc) actually needs integration testing (i.e. needs to know stuff like this), but it's a good discipline to carefully isolate that and to provide carefully controlled mocks to unit tests of logic.
BobJanova
22-Feb-12 10:45am
View
Did your network connection go down? Did Google Maps go down?
BobJanova
22-Feb-12 9:48am
View
This is not a Visual Studio question.
What server class are you using?
What do you mean by 'select/de-select each client'? (Are you talking about a user interface? Some sort of code based filtering?)
What about 'transfer the data individually'?
BobJanova
22-Feb-12 9:45am
View
Unclear
BobJanova
22-Feb-12 9:45am
View
Why not just put pConfigurationMaster in the session?
Also, 'very urgent' tends to mean people skip over your question. If it's 'very urgent' then *you need to do some work*, CP is not a hire-a-coder site.
BobJanova
21-Feb-12 14:28pm
View
Which treeview control are you using? Have you checked its documentation? (chances are it has expand/contract methods in some form).
BobJanova
21-Feb-12 14:10pm
View
5 is incoming!
BobJanova
21-Feb-12 6:58am
View
What's this? Just a code dump of a semi-related web page? This doesn't answer the question at all.
BobJanova
21-Feb-12 6:57am
View
You should probably ask this on the DevExpress forums.
BobJanova
21-Feb-12 6:47am
View
Good information, although a simple INSERT statement is atomic and therefore shouldn't need transaction protection.
BobJanova
21-Feb-12 6:47am
View
What is the problem? This should just work. Do you mean you want to see updates from one window in another one 'pseudo-live'?
BobJanova
21-Feb-12 6:46am
View
Did you give the collapsible panel extenders different IDs?
BobJanova
21-Feb-12 6:30am
View
'Since we can not handle by changing only CSV parsing method only' - this is false, I've given you two working solutions (3 and 4) for the problem as stated.
BobJanova
21-Feb-12 6:20am
View
You'll get my 5 if this is confirmed to be the case. Good thinking.
BobJanova
21-Feb-12 6:18am
View
Define 'isn't working'.
BobJanova
20-Feb-12 16:20pm
View
On the server side, you get them as query parameters. If you want to get them client side, you can look the elements up by ID (e.g. document.getElementById('search_1_content').value).
BobJanova
20-Feb-12 13:30pm
View
Well, you should have specified that, because using a third party library is by far the best way to approach CSVs. The Jet ODBC driver is a third party library, anyway.
BobJanova
20-Feb-12 11:29am
View
5 for this, it's what I would have typed except I couldn't remember the tag/property names :p
BobJanova
20-Feb-12 11:23am
View
That looks like a huge pain to use.
BobJanova
20-Feb-12 8:59am
View
You can bind the Value property of a progress bar to whatever you like. (Expose a property on your search class which notifies changes and bind that to the progress bar.) Is that what you mean?
BobJanova
20-Feb-12 8:58am
View
I don't really understand what you're trying to do.
BobJanova
20-Feb-12 8:53am
View
deleted as repost
BobJanova
18-Feb-12 7:02am
View
You have to actually adapt what I've posted, not just post it verbatim and expect it to work, since it obviously has incomplete parts.
I did get the function pointer syntax wrong though (although you could have looked that up just as well as me).
extern int start_something(void (*f)()) {
// do some stuff ...
(*f)(); // call back to the outside
}
BobJanova
17-Feb-12 16:22pm
View
start_something's supposed to be a (normal) function which _takes_ a pointer as a parameter, not itself a pointer.
BobJanova
17-Feb-12 13:01pm
View
Uh, like the solution says, you have to write those methods. They look something like
byte[] ToBytes() {
ByteBuilder bb = new ByteBuilder();
bb.AddInt(id);
bb.AddString(name);
return bb.GetBytes();
}
and
void FromBytes(ByteBuilder data){
id = data.ReadInt();
name = data.ReadString();
}
BobJanova
17-Feb-12 12:58pm
View
:)
BobJanova
17-Feb-12 12:28pm
View
Changed your tags, this is not a C# question.
BobJanova
17-Feb-12 9:31am
View
You will probably need to ask the person that wrote the control, as the most likely reason is that you are using it in a way they didn't expect and there is a bug in their binding code.
BobJanova
17-Feb-12 9:21am
View
"if current year is 12 then it uses user control12 n if current year is 11 it uses for11."
This is very deeply broken and you should stop doing that. Controls should be generic things that don't depend on the context in which you want to use them.
BobJanova
17-Feb-12 9:20am
View
If you can't use any active server-side scripting (i.e. .aspx, .php, etc) then you are pretty much screwed, but in that case you aren't using ASP.net at all anyway.
Do you mean that you want to run .htm files through the ASPX processor? If so, that is an IIS configuration setting, but it would be very confusing, so you need to explain your requirement and why it isn't just nonsense.
BobJanova
16-Feb-12 9:50am
View
It's two completely different answers depending on which way he's doing authentication, and I don't feel like writing both :P (actually doing work at work today).
BobJanova
16-Feb-12 7:52am
View
I removed the C# tag, because this is basically a client side JS question. I assume you know how to get database information on the server side and send HTML in response to an AJAX request already.
BobJanova
16-Feb-12 7:48am
View
Are you using the default Membership/Role stuff, or are you using a completely custom authentication scheme?
BobJanova
16-Feb-12 7:40am
View
My 5, this is the correct approach.
Show More