15,894,343 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 yesotaso (Top 193 by date)
yesotaso
7-Sep-11 17:37pm
View
Common C Programming Errors
or you can say "C alike"...
double fifty = (1/2) * 100;
This code sets
fifty
to 0 not 50! Why? Because of integer division.
If you want something nailed use hammer, if you want something sliced use a knife...
yesotaso
4-Jul-11 2:36am
View
Indeed regex has all the tools in capable hands to chop the strings. +5
yesotaso
30-Jun-11 2:58am
View
+5, one modification may be added: format could have been done with 2 arguments, anyway thats unnecessary detail. What I wonder is what advantage does StringBuilder holds against plain string concatenation. I know thats another question but is it simply "performance" or "principles of oop".
yesotaso
30-Jun-11 2:45am
View
What he wrote is essentially correct OP should have reset the counter... But why there is a 2nd loop(That is from original code)?
yesotaso
30-Jun-11 2:43am
View
Nice, but why does he even need 12 of each record (144 total). I think the inner
do-while
is put there out of confusion.
yesotaso
30-Jun-11 2:34am
View
Added code block.
yesotaso
14-Jun-11 4:35am
View
You answered what is asked, it should have been given in more detail. ^^
yesotaso
14-Jun-11 4:25am
View
It is PDF extention take a look at
About PDF Portfolios
and
Sample 1
-
Sample 2
yesotaso
13-Jun-11 14:06pm
View
Provided your professor have database server installed, Solution 1 is the answer. If not AFAIK SqlCE installation can be included in your setup but that does not fit "SQL 2005" definition :)
yesotaso
13-Jun-11 13:53pm
View
Do you have
MySQL Connector
installed?
yesotaso
13-Jun-11 13:45pm
View
Indeed easist way and cleanest way if the restriction does not apply... My 5.
yesotaso
11-Jun-11 5:10am
View
Quote from question:
"I already have pooling(polling?) solution with Update Panel and Timer tick event that refreshes the web page on small interval and requests the data from database all the time."
yesotaso
11-Jun-11 5:06am
View
I dont have experience on web applications but I've read
Push technology
seems to be what you are looking for. Most probably you've read this aswell but if you google with keywords "server push" + some other relative words it might narrow down search window.
yesotaso
10-Jun-11 15:52pm
View
Thank you for the info and apologies for uninformed deviation from the subject.
yesotaso
10-Jun-11 14:59pm
View
Put this code fragment into "Question" by using
Improve Question
button if it is not meant to be answer.
yesotaso
10-Jun-11 14:57pm
View
Sorry for intrusion but isn't
IObservable<t> Interface
unavailable at .Net 3.5?
yesotaso
10-Jun-11 13:47pm
View
Could you please submit a
new question
regarding your problem. Since above question seems to be "Solved", the expert commentators you expect are less likely to see later question as this is not really labelled as question but a part of a solution...
[Edit:And tag your question properly such as "C# ASP.NET" or "C# WinForms" or "SQL Server" etc...]
yesotaso
10-Jun-11 13:40pm
View
Well it seems quite a feat even to get those work together do something :) Anyway, gratz and good luck.
yesotaso
10-Jun-11 10:37am
View
No problem at all.
yesotaso
10-Jun-11 10:36am
View
Thanks.
yesotaso
10-Jun-11 8:21am
View
See similar discussion:
SendMessage API and WM_PASTE
yesotaso
10-Jun-11 7:23am
View
Good one, but something bothers me. If powermode changes and PC goes to hibernate what good do knowing that? :P
yesotaso
10-Jun-11 7:23am
View
Deleted
Good one, but something bothers me. If powermode changes and PC goes to hibernate what good do knowing that? :P
yesotaso
9-Jun-11 17:23pm
View
:) Indeed .NET evolved much, but that doesnt change the fact that nuclear hand grenades has a very good blast radius :P
yesotaso
9-Jun-11 16:36pm
View
From
C++ -> C#: What You Need to Know to Move
"In C++ you have tremendous control over the creation and even the layout of your objects. You can create an object on the stack, on the heap, or even in a particular place in memory using the placement operator new."
... Which means you need
Totin' Chip Badge
to properly use it:) Otherwise it can turn into nuclear hand grenade.
yesotaso
9-Jun-11 4:47am
View
Could you please be more specific? Is
2²
the form you want to show it or you want the result as
4
?
yesotaso
3-Jun-11 5:39am
View
Yes you are correct, Yes he wrote "DES Encryption is more secure than
base64 encoding
" also correct I presume...
yesotaso
2-Jun-11 5:21am
View
Deleted
Sir, I urge you to check
for (int x = 0; x < bmpData.Width; x++)
Which should be
for (int x = 0; x < bmpData.Width; x+=4)
yesotaso
1-Jun-11 17:16pm
View
Either create a view combining some of columns or better take a look at
Database normalization
yesotaso
1-Jun-11 17:04pm
View
This is most probably about custom compiler related stuff, I have hazy memories of LL LR SLR LALR parsers... Even thought of those makes me nauseous.
yesotaso
1-Jun-11 10:09am
View
Ahem... Sorry about that I missed "Access" tag. This is for SQL server.
yesotaso
1-Jun-11 8:05am
View
You can query Elapsed time Stopwatch is running, yes? What you need is decide when to look at it whether each pass of sort algorithm or in the end. Regardless, you need to (or have someone) code it. You can use a
BackgroundWorker
or a simple
Timer
.
yesotaso
1-Jun-11 6:55am
View
See
Stopwatch Class
there is example code there aswell.
yesotaso
31-May-11 21:42pm
View
With all the good and bad we are mere mortals sir :)
yesotaso
31-May-11 20:52pm
View
0 -> 0
1 -> 85
2 -> 170
3 -> 255 ?
yesotaso
31-May-11 20:52pm
View
Deleted
0 -> 0
1 -> 85
2 -> 170
3 -> 255 ?
yesotaso
31-May-11 15:57pm
View
5+ from me. To OP: What is the result of "10 | 4" and "14 | 4"? Answer is "14" and "14". If you ask "14 == 4" answer is false, but if you ask "(14 | 4) == 14" answer is true.
yesotaso
31-May-11 7:20am
View
I cant imagine what downvoter was thinking :( apart from the typo there "end" => "and" it looks legit answer. Though I wouldn't use that logic and remove piece of input which may serve both "logical operator" and/or "the data itself", think of input "beast and beauty" the word "and" may serve both operator and input here. It might be better to construct eval tree from input text.
yesotaso
31-May-11 4:40am
View
Well, the logic behind your pattern is a little bit insufficient. I dont know how it seemed to work in the first place. As you can see I did not search for "imgres?imgurl", yes that is close to result but if you dont pinpoint
exact
location of goodies in someoneelse's string you'd waste quite a bit of time searching your way. So the brackets
'[' ']'
are the key to pinpoint target you should have looked for those.
yesotaso
30-May-11 20:10pm
View
Deleted
["/imgres?imgurl=
repeats in given url 21 times ok but
.*?(,"){5}
doesnt make much sense to me.
yesotaso
30-May-11 14:14pm
View
Good link +5. I was wondering what superiority holds using
System.Diagnostics.StopWatch
class has over using
Environment.TickCount
. I've read using DateTime class has some inaccuracy issues but I havent seen StopWatch vs TickCount comparison.
yesotaso
30-May-11 13:56pm
View
No problem.
yesotaso
30-May-11 13:35pm
View
Added pre tag
yesotaso
30-May-11 9:43am
View
http://www.sadoun.com/Sat/Installation/Installation.htm
Maybe?
Just kidding :)
yesotaso
29-May-11 20:31pm
View
Thank you.
yesotaso
29-May-11 18:18pm
View
No problem.
yesotaso
29-May-11 10:59am
View
If I may add:
While writing your question
Subject
you'd notice a
Related Entries
column which also brings up related posts you are trying to ask, which can serve as implicit search :P
yesotaso
29-May-11 5:21am
View
Please confirm the required output. What do you mean by "last string
S
(i.e last and
'S
"?
".net and asp.net and and and" would be modified to ".net and asp.net and and" or ".net and asp.net"
yesotaso
28-May-11 20:38pm
View
Ref MSDN:
All LINQ query operations consist of three distinct actions:
1- Obtain the data source.
2- Create the query.
3- Execute the query.
So, in this context 3rd step is missing.
OK, then what?
Again MSDN:
The query variable itself only stores the query commands. The actual execution of the query is deferred until you iterate over the query variable in a foreach statement. This concept is referred to as
deferred execution
.Queries that perform aggregation functions over a range of source elements must first iterate over those elements. Examples of such queries are Count, Max, Average, and First. These execute without an explicit foreach statement because the query itself must use foreach in order to return a result. To force immediate execution of any query and cache its results, you can call the
ToList<tsource>
or
ToArray<tsource>
methods.
TL;DR... you should have read it :P Correct answer is given by Wonde
yesotaso
28-May-11 15:27pm
View
</sarcasm>
yesotaso
28-May-11 15:20pm
View
Nah, I am content as it is :) 1 thing makes me veery curious though :D
Quote:
From
her
you can do all numeric operations on "number"
yesotaso
28-May-11 15:16pm
View
Thanks it is Kim's idea that I used so I didnt write seperate answer :)
yesotaso
28-May-11 7:34am
View
Good approach, and if I may add
class myInt{
public int Value;
public static myInt operator +(myInt left,int right)
{return new myInt(){Value=left.Value + right};}
public override string ToString() {return
string.Format("C{0,3:D3}",Value);
} //OriginalGriff's code
public bool FromString(string input){
System.Text.RegularExpressions.Match m = System.Text.RegularExpressions.Regex.Match(input, @"(?<string>[A-Za-z]+)(?<number>\d+)");
// Kim's code
if (m.Success) this.Value = m.Groups["number"].Value;
return m.Success;
}
}
etc :)
yesotaso
27-May-11 19:36pm
View
Take a look at "http://www.homeandlearn.co.uk/csharp/csharp_s1p5.html" it might feel like "Submarine Operation Manual For Complete ..iots" if you have absolutely no C# Windows Forms it might give you a start. The rest depends on how you use "Properties" window and google :) oh I almost forgot holy "F1" key.
yesotaso
27-May-11 19:04pm
View
I have absolutely no experience in WPF what so ever but I am quite sure events arent handled quite different from windows forms.
http://www.codeproject.com/Answers/202933/i-want-to-give-text-box-no-input-character-only-pu.aspx
has a veeery long code block which defines how to not do it and Answer 1 explains how to bind many buttons performing a common task to a single event handler.
As for the algorithm... well I dont see much of an algorithm there I've looked at the links its just a naming system for teeth which could be relevant but that does not even remotely smell like algorithm.
yesotaso
27-May-11 17:50pm
View
Absolutely far better to take a professional approach than poking into html. +5
yesotaso
27-May-11 16:39pm
View
Oh I forgot to mention, it does not perform clicking link etc on an opened browser it uses System.Windows.Forms.WebBrowser to do those.
yesotaso
27-May-11 14:58pm
View
It seems to me that you are shaking wrong tree... The IO itself is the bottle-neck, the idea of multi-threading is pipe-lining tasks so that with better usage of resources gaining performance, which would fail if one of tasks you try to pipeline takes %99.9 of time. Lets take an example, you copy 100MB of a file and copy it in ~10 secs, 2 consecutive copies would take ~20 secs but the fact is 2 concurrent copies would also take ~20 secs because of physical limitation which you can overcome only way : buy faster disk or buy motherboard with faster databridge DMA or whatever but it will cost dearly :)
yesotaso
27-May-11 5:25am
View
First of all, like Rob said both Array and List can carry you to the destination, but Arrays require little more maintainance :) It is always good to use whatever you are familiar, but also far more better to widen familiarity circle. Anyway among many other, most striking difference is you can expand list on the fly... For the presentation Rob already given the code for that.
yesotaso
26-May-11 18:43pm
View
No problem at all I figured later what was really going on but didnt have time to reply sorry about that. Anyway there are 2 solutions 1- Focus on content (thats what you did) 2- modify the repetition indicator of ".*" so that it would capture as least character as possible. so the final pattern should look like (?<=\"email\":\x20\")
.*?
(?=\"). Answer is updated accordingly.
yesotaso
26-May-11 15:56pm
View
Deleted
It is called "Race Condition" the variable "i" in that case is modified by another (or simply main) thread since you do not know
when
exactly the thread starts the behaviour of that loop is unpredictable. It might all be 9's or sequence like 222333399. To overcome that you may declare a temporary variable in that scope and use it as parameter.
yesotaso
26-May-11 12:18pm
View
I was thinking same "why 2D array" the problem itself isnt just sorting 2D array but the Tariff type itself is also fishy.
yesotaso
26-May-11 11:46am
View
Deleted
1 advice:
"public Training[,] Training = new Training[duration, status]" by the time you may have chance to assign duration and status above statement would already been called.
yesotaso
25-May-11 17:34pm
View
Good luck.
yesotaso
25-May-11 17:25pm
View
http://imageshack.us/photo/my-images/43/expressoa.jpg/
Here is proof :)
yesotaso
25-May-11 17:18pm
View
Sorry about that the comma shouldnt be there.
And I used this as reference and it seems to work:
string input = "{" + Environment.NewLine + "\"id\": \"499156235\"," + Environment.NewLine +
"\"login_url\": \"https://www.testing.com/platform/test_account_login.php?user_id=499156235\"," + Environment.NewLine +
"\"email\": \"mhuvdfmt_greenesteerin@tfbnw.net\"," + Environment.NewLine +
"\"password\": \"1752836968\"" + Environment.NewLine + "}";
yesotaso
25-May-11 17:06pm
View
I dont exactly know what input is I just modified a pattern in my closet:)
Edit: There might be a white-space hideously sneaking there messing up patterns :)
yesotaso
25-May-11 17:04pm
View
well I saw it before, but didnt know thats good old jason :P
http://www.imdb.com/title/tt0211443/
yesotaso
25-May-11 16:01pm
View
It is not related to "DialogResult", It can be a reference point to solve "Modify attributes on main_form depending on what user did with frm_login" nothing more nothing less.
yesotaso
25-May-11 14:30pm
View
I think the key feature is "Lossy Compression" that gets in the way but who knows?
yesotaso
25-May-11 14:16pm
View
No problem, but beware JS code behaviour or selection behaviour may depend on used browser.
yesotaso
25-May-11 14:07pm
View
Checkout:
http://stackoverflow.com/questions/275761/how-to-get-selected-text-from-textbox-control-with-javascript
or
Google : javascript replace selected text textbox
yesotaso
25-May-11 13:58pm
View
Rephrase: "How can I replace selected portion of a text in textbox with an arbitrary value in ASP.NET?"
If I were you I'd look for JavaScript solutions as well. Of course that depends on your need but that is not quite clear atm.
yesotaso
25-May-11 5:30am
View
Dude, this is creepy the demo code updated my system time :P
yesotaso
24-May-11 21:57pm
View
Added pre tags.
yesotaso
24-May-11 17:55pm
View
Please note that, depiction of wrong doing is abuse of the common. There is a thin line there do not cross it.
yesotaso
24-May-11 17:39pm
View
Excuse me... "Swear: 1- curse, obscene language 2- pledge, vow"
If it would be possible then when MS says "We swear, our products are secure" it would mean "@^+#!! Security and $#£+!! you..."
yesotaso
24-May-11 17:28pm
View
Source:
http://www.urbandictionary.com/define.php?term=seamless
Seamless (noun) - Used to describe a situation where everyone is told it will work perfectly, when in fact it's an unmitigated clusterfuck.
yesotaso
24-May-11 16:34pm
View
Checkout http://en.wikipedia.org/wiki/Variable_scope
yesotaso
24-May-11 16:07pm
View
Haha,
nodes[i].ParentNode.RemoveChild(nodes[i]);
looks like trying "Seppuku" :P
yesotaso
24-May-11 14:20pm
View
Thanks. It was not my first intetion to to promote Ruby but to give an interesting alternative, in the end well yes I did...
My point is do not expect everything from the tools, there are alternatives for which you should look around and make use of them to widen vision.
Edit: For the topic I dont think it is offly unrelated, for the risk it wouldnt be any more than trying to learn another code library. Besides it is open-source interpreter there is no licence hassle :)
yesotaso
24-May-11 13:42pm
View
As expected :) 5
yesotaso
22-May-11 16:34pm
View
Yeah sorry about vague stuff, anyway thanks for your time.
yesotaso
22-May-11 9:26am
View
Indeed what you wrote is correct. On the other hand, there is no triginometric calculations in my code atm. If I am to imrove picture quality with different algorithm thats another story but for now all I do is brute-force vector calculus. I havent even used the accelerator struct I implemented (an OCTree operating on AABB) in case of many object (I found a "USS Fletcher" model with 380k+ triangles thats my target to render) thats why I am trying to figure basic performance tricks. Thanks.
yesotaso
21-May-11 10:37am
View
I did not pre-calculate ray as I use "orthographic projection" whole tracing returns 3 RGB value and I write it to bitmap via for each ray
unsafe
{
byte* pData = (byte*)dat.Scan0;
int x3 = x * 3;
int y3 = y * dat.Stride;
*(pData + y3 + x3) = (byte)((output.red >= 1 ? 1 : output.red) * 255);
*(pData + y3 + x3 + 1) = (byte)((output.green >= 1 ? 1 : output.green) * 255);
*(pData + y3 + x3 + 2) = (byte)((output.blue >= 1 ? 1 : output.blue) * 255);
}
and return bitmap in the end.
Edit: I plan on multithreading for each core available but thats a lil further now.
yesotaso
21-May-11 10:23am
View
Actually viewray passed here by ref I thought "if I dont change it why copy it around?". Is tarted to decompose composite operator overloads into primitive type operations. Readability, maintainability dropped drastically though I got ~%15 increase in speed min-maxing... 1 thing keeps waving hands from sidelines
unsafe
:) Thanks for answer btw.
yesotaso
19-May-11 17:25pm
View
Irrelevant maybe but what does
com.ExecuteNonQuery();
do? Second from bottom line.
yesotaso
19-May-11 16:02pm
View
Hmm of course you can use axe to slice bread instead of kitchen knife :)
Thats not my 1...
yesotaso
19-May-11 14:59pm
View
Not only military... look at data source!!
yesotaso
19-May-11 12:34pm
View
Maybe I am low on sugar or maybe this is too complex, I cant say...
yesotaso
19-May-11 6:03am
View
Excuse me for being blunt, you should seriously visit an SQL tutor. Such as
http://www.w3schools.com/sql/default.asp
. You cannot use code given by others as it is you need to know what they do as you read code. And you should have enough knowledge about the syntax about what you are doing so that you should see what is occupying where its not supposed to be. Like "...main_password =
TextBox.Text
..." Your question
"http://www.codeproject.com/Answers/197565/SQL-Server-Compact-3-5-Database.aspx"
raises this impression aswell.
yesotaso
18-May-11 15:54pm
View
Umm sorry about that
"Data is entered to table with no problem, then text fields 1 to 5 can be updated but
no Date
since that unique field of course"
I misunderstood that part.
yesotaso
18-May-11 14:23pm
View
I think,
class IndexedDictionary<TKey,TValue> : System.Collections.Generic.Dictionary<TKey,TValue>
{
public TValue this[int index] {
get
{
if (typeof(TKey) != typeof(int))
{
if (index >= this.Count)
throw new IndexOutOfRangeException();
return this.Values.ElementAt(index);
}
else
{
var x = this.Where(p => p.Key.Equals(index));
if (x.Count() == 0)
throw new ArgumentOutOfRangeException();
return x.First().Value;
}
}
}
}
Edit: This should work as well, the "else" part requires a little re-work.
yesotaso
18-May-11 11:09am
View
Well, that field is nullable as far as I can see so it cannot be used for identification.
yesotaso
18-May-11 10:25am
View
Thats the purpose of PRIMARY KEY and/or NOT NULL. :) Besides allowing NULL for a field that is supposed to be unique beats the purpose.
yesotaso
18-May-11 8:15am
View
Deleted
The locking is done on data(database itself via extra SP's and/or fields).
yesotaso
18-May-11 8:10am
View
I used pessimistic approach before, ease of implementation vs user problems... It was quite a messy match. I had to implement 5-6 lock clean mechanism for each lock mechanism:) User PC crashes, power-shortages (they didnt connect switches to UPS) causing unforseen network problems, and some more stuff like arrogant users with habit of using task manager to close apps...
yesotaso
18-May-11 7:40am
View
It is the logic that is flawed I mean. The first if fails second one is bound to fail because there is no "r.Rows[0]". If the first if does not fail you should check "DBNull.Value.Equals(r.Rows[0]["main_password"])" before assigning it.
yesotaso
18-May-11 7:10am
View
Does it say Prolem1 or Problem2?
You seem to assume SqlCeDataReader return 1 record, which might be 0 or worse many!
Check "main_password","default_password" against DBNull before attempting to assign those to variables.
yesotaso
18-May-11 5:24am
View
Nice read :) my 5. But something bugs me, not that I can say I know what the ... is neural network, as if biology involvement not enough why would you drag nuclear chemistry stuff aswell? :P "return layer * Metadata.NeuronsPerLayer +
neutron
;"
It looks you built your own NBC... nvm
yesotaso
17-May-11 16:32pm
View
Link is dead, though the name JLCA points right direction :)
yesotaso
17-May-11 16:25pm
View
Please, pretty please explain what are you planning on the database when you connect to it? I mean in some countries if you pay enough they sell you any kind of licence, in that case having a drivers licence would make you an eligible driver?
yesotaso
17-May-11 14:24pm
View
Thanks.
yesotaso
17-May-11 14:24pm
View
Glad to see it works for you. A little warning, do some checking on input as parsing works quite picky and use try catch block to avoid unnecessary yanking due to invalid input.
yesotaso
16-May-11 20:30pm
View
Thanks.
yesotaso
16-May-11 17:38pm
View
Dont get me wrong, dealing with regex is messy work. You should get a 3rd party help like "http://www.ultrapico.com/Expresso.htm".
Sample from Expresso: \((?<AreaCode>\d{3})\)\s*(?<number>\d{3}(?:-|\s*)\d{4}) which matches (555) 555-5555.
yesotaso
16-May-11 17:25pm
View
I respectfully agree with Mr. Simmons. On the other hand, to get things working sometimes it takes little more than just googles.
yesotaso
16-May-11 17:11pm
View
Deleted
string input = "0x02 0x07 0x03 0xFF";
string[] chopped = input.Split(' ');
byte[] result = chopped.Select(s => Convert.ToByte(s,16)).ToArray();
Dont expect everything from government :P
yesotaso
16-May-11 16:44pm
View
Deleted
See edited solution.
yesotaso
16-May-11 16:36pm
View
I simply cannot find words to express how much I
rofl
having read that Mr. Barrow. Seriously, nice one :)
yesotaso
16-May-11 16:00pm
View
I see plus plus everywhere :)
yesotaso
16-May-11 15:38pm
View
...write a COM+ application to hold global auto-incremented value?
...create an SQL table which holds counter value and a SP which auto increments table value and return current counter?
...create an application that holds a static variable and publishes that one via HLA-RTI?
yesotaso
16-May-11 11:12am
View
strComputer = "."
Set objWMIService = GetObject( _
"winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetCards = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapterConfiguration " _
& "Where IPEnabled = True")
For Each objNetCard in colNetCards
objNetCard.ReleaseDHCPLease()
Next
From "http://msdn.microsoft.com/en-us/library/aa394595%28v=VS.85%29.aspx"
yesotaso
16-May-11 11:07am
View
:)Axe on the cable - sledge on the modem - right click "the" icon and disable, all works aswell. Though 1st 2nd options may be problematic on re-connect
yesotaso
16-May-11 11:01am
View
Quite concise :)
I found "http://wiki.musicbrainz.org/XML_Web_Service" if anyone interested.
yesotaso
16-May-11 10:26am
View
If you want to compare "files" Wayne explains the way to do that. If you want to compare likeness(not exact match) of "audio files", I would say stay away from that subject while you havent begun yet :). Most common known definition of AI is Artificial Intelligence but I doubt thats what you want to know.
yesotaso
16-May-11 6:05am
View
Is there anything this bloody LINQ doesnt apply? :P
tbh I dont like VB but http://msdn.microsoft.com/en-us/vbasic/bb887653.aspx shows some promising stuff.
yesotaso
15-May-11 16:03pm
View
Note: Don't use Caps Lock a lot, which you seem to favor.
Answer: What code does is, fit the image to a limited area while preserving its aspect ratio. (Or what it tries to do at first glance)
yesotaso
15-May-11 6:36am
View
5 + "Properties.Settings.Default.DatabaseSettings" is almost as long as the connection string itself :).
yesotaso
14-May-11 17:14pm
View
In the "System.Management" namespace there are tools to query WMI service local/remote. While querying the remote machine "System.Management.ConnectionOptions" class has impersonation options. Just query remote machine with anything with given creditials. That is one possible way.
yesotaso
14-May-11 16:43pm
View
Have you seen Billy Madison?
yesotaso
14-May-11 5:34am
View
Take a look at "http://en.wikipedia.org/wiki/Closed_world_assumption". If combobox does not know what you give is a tree, that tree does not exist for it. You would need to teach (simply code it in the way you want to see) it or it will interpret data the way it knows - a simple list of unordered strings.
yesotaso
13-May-11 19:12pm
View
Sorry but I think there is a misunderstanding on my side, the article I linked uses "System.Windows.Forms.WebBrowser" and loops the html tags via the foreach statement you wrote above. I did same such as:
webBrowser1.Navigate("http://sports.ladbrokes.com/");
and after receiving "DocumentCompleted" event I was able to loop it... Anyway sorry for being little help, as stated above this is an example I've encountered around.
yesotaso
11-May-11 7:21am
View
The method you use depends on default Font type-size etc. Think it lettor "O" as a little picture this method will align left side of picture to the coordinates you enter. Even if you calculate that and normalize it it wouldnt be the same with another font(another machine-pc etc). You should consider below solutions.
Looking at code: what did you do with "sizef". And is the size of picturebox equal to size of original picture? (ie. did you strech it?)
yesotaso
10-May-11 20:43pm
View
Yes sir, syntactically and semantically but not figuratively.
Edit: I mean it boils down to habits again. Use of powers of 2 - checking against "logical and" etc..
yesotaso
10-May-11 17:28pm
View
Is your original string UTF8?
string target = Encoding.UTF32.GetString(Encoding.UTF8.GetBytes(uri.AbsoluteUri.ToString()));
[Edit] hmm test results show strange stuff. just ignore this :)
yesotaso
10-May-11 15:50pm
View
Well yes 3 is not valid but it just compiles and runs :) Though I'd never do such thing knowingly.
yesotaso
10-May-11 15:43pm
View
A well deserved 5. One statement pops in my mind "command pattern"... Anyway it is matter of habits I guess. What you did almost always affect what you'd do.
yesotaso
10-May-11 15:24pm
View
What if... (just a thought)
[FlagsAttribute]
public enum psychoEnum
{ A = 0, B = 3, C = 4, D = 8 ... }
yesotaso
10-May-11 6:59am
View
Is it "windows" or "processes" are you talking about? Do you have 2 seperate window created 1 application, or 2 window created by 2 different application? I ask because title implies so.
[Edit] typo [/Edit]
yesotaso
9-May-11 7:50am
View
Propagation is the key of course. If there is an exception in the try block but catch block does not cover will the code not in "finally block" work. In OP's case it doesnt matter he'd catch base exception and show MessageBox etc and move on...
Side Note: I am not very fond of rethrowing if possible let exception pass your try block. Disposing older exception and trhowing new ones clouds the objective "stack trace"
yesotaso
8-May-11 13:56pm
View
Hmm, thats a fair point indeed.
yesotaso
8-May-11 13:24pm
View
Please post your comments by "Add Comment"
yesotaso
8-May-11 8:20am
View
"Automation is a black-art"...
yesotaso
8-May-11 6:52am
View
My 5. If point is your custom type see my solution.
yesotaso
8-May-11 6:38am
View
5. On on the spot links.
Off topic: I love this one too "http://www.amazon.com/Complete-Idiots-Guide-Submarines/dp/0028644719"
yesotaso
8-May-11 6:07am
View
Though your problem solved 1 piece of advice, check out your regional settings on your windows system "Control Panel -> Regional and Language Options" there you'd see how your system tries to parse numbers. You can customise as you wish (beware your installed applications also use this settings to parse stuff so caution is advised) change Decimal symbol "," to "." and Digit grouping symbol "." to "," that way you can parse floating points as "1234.678"
yesotaso
7-May-11 16:06pm
View
Please re-phrase question.
What is wrong with above code? Does it throw exception (if so give details about exception, stack-trace etc.) You do not like the way it works an you want an alternative? It does not have a functionality you want to add but you are not sure where to start? I personnally cannot figure head-tail of the sentence following the code fragment... From what I can figure you have the url of image stored in XML but you want the image itself inside database - not the URL. But that assumption is not alone enough to give an answer(at least for me).
yesotaso
7-May-11 15:25pm
View
Deleted
I am trying real hard what could possibly be the problem?
"(from b in blah select b).Distinct()" whatever you select the number of records comes from the "from b in blah" and the distinct only checks record level difference and you have control over that difference via "select"... Go ahead and try it yourself. http://www.sql-tutorial.com/sql-distinct-sql-tutorial/ for reference if wish to please your curiosity.
yesotaso
7-May-11 4:48am
View
Mye eyes bleeding... must look away... splat
yesotaso
7-May-11 4:46am
View
No problem. If it is solved, please press accept.
yesotaso
7-May-11 4:42am
View
Same Question: http://www.codeproject.com/Questions/192615/How-to-select-distinct-data-from-DataBase-with-LIN.aspx
Same inqusitor, same answer, 30 mins time frame...
yesotaso
7-May-11 4:31am
View
What does it have to do with performance? Besides if you include primary key, which happens to be uniques in the table, in distinct call you guarantee that all records are selected... Filter fields which set of fields you mean to be distinct and select them not whole record. For instance "...select p.Name, p.Department, p.School).Disticnt()" See above solution it is acceptable imo.
yesotaso
6-May-11 17:18pm
View
Deleted
Why not just use Dictionary? instead of constructing a List of courses a while loop make a dictionary<string,list> ? that way you can refer the list as dictonary[coursename]...
yesotaso
6-May-11 15:16pm
View
Text output may be deceptive. As 1 digit integer holds 1 byte in text 9 digit holds 9 byte.
yesotaso
6-May-11 15:12pm
View
Well it doesnt seem very hopeful situation, but if you are going to use disk minimize whatever you can. On that scale even 1 byte makes difference, most probably such hindrance will deviate your focus from main obejctive... Anyway all I can add is keep 4KB sector size in mind (it may vary due to system settings but by default it is 4) even if you read 1 byte that whole sector is read from disk to memory.
yesotaso
6-May-11 14:36pm
View
How many Neurons are we talking about? 10000*9000? If so adding even 1 int to a neuron would increase total size 360000000 bytes... damn I lost count of zeros there.
yesotaso
6-May-11 10:11am
View
I did something like this in the company I work a few minutes later I got phone from IT "Did you install some malware?" obviously corporate sercurity program may take it as network attack :)
yesotaso
6-May-11 9:36am
View
The reference table "conversion" does not have "Customer_ID" as Primary Key simple as that. If you want to add such constraint, "references conversion(Prospect_ID, Customer_ID)" but of course you do not have Prospect_ID column "Customer_follow_up" table and Customer_ID itself doesnot guarantee that you get right "conversion" record. It is design fault. 1st solution I can think of is make only "Customer_ID" as primary key and put a unique constraint on "Prospect_ID ,Customer_ID". that way it will work BUT I do not know the intention of making a PK with 2 fileds in the 1st place this may hurt your design.
yesotaso
6-May-11 9:23am
View
Think it as umm... "how to smugle goods" in archeology class :)
yesotaso
6-May-11 5:58am
View
Well said. :)
To OP: just curious can you share exam questions :P Not to help you cheat of course.
yesotaso
6-May-11 5:55am
View
This question seems [Solved] I suggest Submit new question with new problem.
yesotaso
6-May-11 5:55am
View
This question seems [Solved] I suggest Submit new question with new problem.
yesotaso
6-May-11 4:53am
View
Get Total Commander. Its best for "Bulk Rename" :)
yesotaso
6-May-11 4:50am
View
Hmm of course it wouldnt be wise to expect from a stranger to fit his namespace to yours :) even if his name space is the same even if you match his namespaces there is no guarantee that contents would be the same blah blah. I wish you luck on that matter :) To be honest while trying to help I too learn stuff :) 1 Final bit of advice dont eat candies from unknown entities you may get ... ummm bad stuff.
yesotaso
5-May-11 20:11pm
View
My 5 + uint.Parse(MyTextBox.Text ,System.Globalization.NumberStyles.HexNumber).
I need some time to digest 2nd though :)
yesotaso
5-May-11 14:28pm
View
Rocket surgery... Hmm is surgery a science or art? :)
yesotaso
5-May-11 14:05pm
View
Sorry for late answer it was a busy day. Basicly yes it copies 1 class with "simple" attributes to another. If an attribute is complex (a class-struct) type you can recurse for that field aswell.
Side note: I did a few tests without recursion. that piece just copy fine. As I mentioned earlier array types or collection types may prove to be difficult.
For the Error: Which version of VS do you use? ".ToDictionary(fi => fi.Name)" does not work if you do not have VS2008 or 2010. And dont forget to put null checks.
yesotaso
5-May-11 10:43am
View
The code fails if length of string is an odd number. If input is "1BD" which I think is a valid one substring fails :) Still a good one.
yesotaso
5-May-11 10:12am
View
Can Mr/Ms downrater? Can you elaborate? The statement above is perfecly fine though seems repetition but code was not given before to clear confusion.
yesotaso
4-May-11 17:49pm
View
You made my day dear friend :)
yesotaso
4-May-11 17:44pm
View
Deleted
The final piece of code is to show what is in byte array... I need some sleep
yesotaso
4-May-11 11:28am
View
Yes. And like Mr. Simmons said take a look around in this site and see Beginner section of c# or VB. In addition Google is your friend.
yesotaso
4-May-11 11:16am
View
Mathematical terms: Let a string be "WELCOME" then it may be considered as a set of letters 'W' 'E' 'L' 'C' 'O' 'M' 'E' a substring is a subset of this set like "ELCO"
which can be expressed as subtring starts 2nd char and length is 4 chars.
the statement in question means it starts at 1st char(because there is 1 number given starting letter is by default 1st one) and ends at i th char where "i" is the variable which represents the length of each line in the picture you sent.
yesotaso
4-May-11 11:13am
View
Improvement:
x = 10;
string pounds = new string('#',x);
:-)
yesotaso
4-May-11 10:53am
View
Nice work with excel :)
yesotaso
4-May-11 9:22am
View
Get a HEX editor, check out first few letters.
"PK" is zip file
"RIFF" is wav file
"Rar" is you know what
"JFIF" is jpg
Some have binary patterns etc. You should know what you are looking for.
yesotaso
4-May-11 9:05am
View
Thank you! Indeed this only applies to network print servers like HP jet direct. For the printers shared to network via Windows machine WMI is the way.
yesotaso
4-May-11 9:05am
View
Thank you sir.
yesotaso
4-May-11 8:38am
View
You may add scheduled task via c# code but I dont think thats the solution. Untrusted user might change system time yes but he can delete added task fom scheduler as well :) But of course OP should have specified his purpose .
yesotaso
3-May-11 15:50pm
View
Hmm
yesotaso
3-May-11 15:03pm
View
Can you give some samples? If you insist on Regular Expressions of course.
Like:
Johann Sebastian Bach - false
Wolfgang Amadeus Mozart - false
Manowar - true
it doesnt have to be that obvious :)
yesotaso
3-May-11 8:03am
View
One principles of design: Good design demands compromise. If you dont worry about memory management you need something else to worry about that. That Something else will consume your resources to achieve worrying business. Thats theory you better find sample cases to decide.
yesotaso
3-May-11 7:05am
View
Force user to use a webcam looking at clear sky top vector to true north to decide sun position... Calculate real date from solar polar coordinate angles heading and elevation... Hmm you're gonna need cartesian coordinates of camera as well. Bah!! I give up.
yesotaso
3-May-11 6:52am
View
My 5 + http://www.principlesofaccounting.com/chapter8/chapter8.html or http://en.wikipedia.org/wiki/Inventory_management if you want a suicidal study :) I know every single word in there but they mke no sense together in those pages.
yesotaso
2-May-11 17:46pm
View
Question:?
Answer:!
Audience:hmm :)
yesotaso
2-May-11 15:36pm
View
Result: You made a mistake and brought the obvious here. They saw 11 lines of error trying to tell you that the ASP.NET does not have permisson on "App_Data".
Irrelevance: I gave 5 to Mr. Manfred just for being handsome...
yesotaso
2-May-11 12:08pm
View
Thank you.
yesotaso
2-May-11 8:12am
View
How about "Regex.Replace("-3E7", "[^.0-9]", "");"? is it not valid?
yesotaso
2-May-11 7:45am
View
There is an application named "WatchCat" which can hide all windows even from taskbar except 1 of your choosing. I was using it for situations like:
"Boss is coming-I am playing solitaire-press CTRL+ALT+some key"
Boss:"Great performance!!"
Me:"Thats how dedicated I am"...
yesotaso
2-May-11 7:31am
View
My 5 + to OP:
Checkout http://msdn.microsoft.com/en-us/library/system.windows.forms.form.formclosing.aspx
It is a matter of accessing memory no longer yours after Close() event. That is your 1st concern then you decide whether you want to keep Form hidden or recreate it.
yesotaso
1-May-11 13:52pm
View
It seems I missed the User ID part but I guess you can filter rest.
yesotaso
1-May-11 13:17pm
View
There is "&" operator I remember from somehere, which enables lining up commands like "dir & cd .. & dir" but as far as I know it works like logical "and" operator if a command in a row fails rest wont execute. Or maybe it was so in unix...
yesotaso
30-Apr-11 21:18pm
View
If it was like:
pi += (4D/(8*n+1) - 1D/(4*n+2) - 1D/(8*n+5) - 1D/(8*n+6)) / (Math.Pow(16, n));
operator precedence and auto type cast would change scene but of course not even close to what he wants :)
yesotaso
30-Apr-11 13:58pm
View
Expressing your programming skillz is all good, but do it in a way that programs also reflect your understanding of business oriented problems in spite of how dull those problems might be(they usually are dull). It might seem "Sir! Yes sir!" approach at first but you need something to sell.
yesotaso
30-Apr-11 11:39am
View
Indeed I am. For instance, you have some horses, carriages and a loading dock. To solve low performance you need to know how good are your horses, how balanced are your carriages, how good is your crane operators. If your operator is drinking at work or a horse is running to death with empty carriage or a huge carriage kiling horses you have a problem...
yesotaso
29-Apr-11 11:04am
View
:) Mistake indeed.
yesotaso
29-Apr-11 8:07am
View
http://lmgtfy.com/?q=smtp+server+vista
Hope it helps.
yesotaso
29-Apr-11 7:53am
View
Indeed odd. I first thought about access modifier for InitializeComponent, but then realised the private modifier ensures initializer of both base and derived form runs...
yesotaso
28-Apr-11 22:10pm
View
Function OleTest(p1:PChar): Boolean; StdCall;
var ole1:TOleContainer;
fstr:TFileStream;
Begin
OleTest:= False;
ole1 := TOleContainer.CreateParented(0);
fstr := TFileStream.Create(p1,fmRead);
ole1.LoadFromStream(fstr);
ole1.DoVerb(ovPrimary);
..... Test dll
yesotaso
28-Apr-11 17:17pm
View
Voted 5. I was thinkg same:"Intense calculation <-?-> Degrade database performance" :) Anyway, observing a producer filling bottomless buffer or a consumer eating endless data may show where performance problem lies.
yesotaso
27-Apr-11 15:22pm
View
1 question: Is it possible exract OLE objects other than native ones? For instance, someone may include a "Excel.Document.8" in a "Word.Document.8" which are OLE compounds themselves.
yesotaso
27-Apr-11 10:40am
View
Is it safe to assume that you want to open a TCP/IP socket with port number 23 (default Telnet port) to target and send-receive unencrypted text from a web service application?
Show More