text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
t1.Elapsed += new ElapsedEventHandler(OnElapsedTime); t1.Interval = //SomeTimeInterval t1.Enabled = true; t1.Start(); } private void OnElapsedTime(object source, ElapsedEventArgs e) { try { GetRecords();
[ -0.1098700612783432, -0.4622787535190582, 0.5500981211662292, -0.18508201837539673, 0.3922576606273651, -0.01973295398056507, 0.49794092774391174, -0.26391005516052246, -0.08448846638202667, -0.3586559593677521, -0.3106907606124878, 0.7222588062286377, -0.3524226248264313, 0.09930956363677...
} catch (Exception ex) { EventLog.WriteEntry(ex.Message); } } public void GetRecords() { try { string ConnectionString = //Connection string from web.config
[ 0.15360748767852783, -0.47861751914024353, 0.2679038643836975, -0.12796351313591003, 0.27640411257743835, -0.11656226217746735, 0.3981158435344696, -0.12902209162712097, -0.37118831276893616, -0.5565642714500427, -0.3058583438396454, 0.3853498101234436, -0.40278780460357666, 0.315849661827...
WebRequest Request = HttpWebRequest.Create(ConnectionString); Request.Timeout = 100000000; HttpWebResponse Response = (HttpWebResponse)Request.GetResponse(); } catch (Exception ex) { } } ``` I think you're missing something about disposing your objects like ...
[ -0.025073669850826263, -0.22338241338729858, 0.33255621790885925, 0.12519238889217377, -0.24680206179618835, -0.3247785270214081, 0.4539855420589447, -0.19044551253318787, -0.24444791674613953, -0.8146488666534424, -0.1982503980398178, 0.45389145612716675, -0.4695451259613037, 0.4394416213...
I am used to structural programming (eg:C), OO programming(eg:Java), Scripting(eg:Javascript), Web (eg:HTML,JSP,Servlets,CSS) etc. Now, when I am getting started with Eclipse RCP plugin development, the whole thing gives a strange feel to me in terms of programming. The way things are in Eclipse RCP development is qui...
[ 0.7053884863853455, 0.43052437901496887, 0.037414923310279846, -0.1663358211517334, -0.39821234345436096, -0.33909037709236145, 0.002300900174304843, 0.060068465769290924, -0.22794665396213531, -0.5027478337287903, -0.016063353046774864, 0.717962384223938, 0.08525555580854416, 0.0421439222...
wanted to know how others feel if their development background is similar to me! It may feel different because it is heavily based on **[OSGI](https://stackoverflow.com/questions/16140/whats-the-best-way-to-get-started-with-osgi)** That involves splitting your application into components, which should typically have a...
[ 0.5569744110107422, -0.0955142080783844, 0.1136685460805893, 0.15527957677841187, 0.1466389149427414, -0.15916405618190765, -0.08820663392543793, -0.28160130977630615, -0.49607396125793457, -0.2879069745540619, 0.027778610587120056, 0.2613051235675812, -0.05157449096441269, -0.018134225159...
on which the services concept of OSGi is build, and that can be quite different than traditional OO development.
[ 0.32585588097572327, 0.21053314208984375, 0.27988171577453613, 0.02270163781940937, 0.16330556571483612, 0.25515761971473694, -0.0338178314268589, 0.012727061286568642, -0.06819066405296326, -0.7921505570411682, -0.34411105513572693, 0.4293002486228943, 0.1946020871400833, -0.0621039383113...
I need to add to the page from within a custom control. I can't use a stylesheet (.css) because I'm using a url(...) and need to resolve the url. Right now I'm doing: ``` Page.Header.Controls.Add(new LiteralControl("<style type='text/css'>.xyz { color: blue; }</style>")); ``` But I'm hoping for something a touch mo...
[ 0.3372592628002167, -0.027618341147899628, 0.6504285931587219, -0.10170886665582657, -0.07167992740869522, -0.1035325825214386, 0.29005974531173706, -0.31481418013572693, -0.22252774238586426, -0.8652938008308411, 0.07810024172067642, 0.3295673727989197, -0.45624876022338867, 0.15641565620...
done by your server control): ``` Page.Header.Controls.Add( New HtmlInlineStyle(".xyz { width:300px;padding-left:10px }"); ``` This [blog entry](http://www.west-wind.com/WebLog/posts/158367.aspx) and the comments show some alternatives (ScriptManager.RegisterClientScriptBlock). But in my opinion your solution is ...
[ 0.015312195755541325, -0.18311309814453125, 0.49632754921913147, 0.12851034104824066, 0.2829521894454956, -0.09331393986940384, 0.6976878046989441, -0.12947633862495422, -0.31620484590530396, -0.7017185688018799, -0.1704423874616623, 0.36842578649520874, -0.015506906434893608, -0.183732569...
I'm searching for a User Interface Design tool to visualize a possible GUI in a documentation. I *must not* generate code. I know that Microsoft Visio provides a functionality. But are there any alternatives? **Which software do you use for visualizing a GUI?** PS. Another well-known tool is [The Pencil Project](http...
[ 0.379594624042511, 0.09604135155677795, 0.22157476842403412, 0.04127465933561325, 0.07196718454360962, 0.0946740210056305, -0.12457319349050522, -0.06862863898277283, -0.28779324889183044, -0.6832019090652466, 0.2264772653579712, 0.5719079971313477, -0.13733045756816864, -0.312850207090377...
[This answer](https://stackoverflow.com/questions/301576/how-do-i-tell-valgrind-to-memcheck-forked-processes/301587#301587) to [this question](https://stackoverflow.com/questions/301576/how-do-i-tell-valgrind-to-memcheck-forked-processes/) says that there's no way to attach Valgrind to an already running process. Ar...
[ 0.17124956846237183, 0.1947706937789917, 0.2102784365415573, 0.25622716546058655, 0.0052585783414542675, -0.13789881765842438, 0.06309354305267334, 0.22014057636260986, -0.26869863271713257, -0.44393905997276306, -0.12196611613035202, 0.5861197710037231, -0.10705587267875671, 0.15784162282...
I am currently working on a small N-Tier application in C# which uses Linq-to-Entities (SQL Express 2005 for the DB) and WPF and I am wondering what type of data collection my business logic layer should be supplying to the user interface. Are there downsides (performance, validation etc) to binding form objects like ...
[ -0.03510581701993942, 0.1344844400882721, 0.465577095746994, 0.12157262861728668, -0.45621711015701294, -0.1705283522605896, 0.08872849494218826, -0.16759724915027618, 0.05859755724668503, -0.7067019939422607, -0.10628821700811386, 0.40230533480644226, -0.22012224793434143, 0.1281108856201...
is counter-intuitive. All you need is a `List<T>` / `BindingList<T>` etc; i.e. ``` var qry = ...; var list = qry.ToList(); ``` Now use `list` as the binding source. IMO, the data-context would be [hidden behind a repository interface](http://marcgravell.blogspot.com/2009/02/pragmatic-linq.html), but your mileage ma...
[ 0.3681393265724182, 0.07011979818344116, 0.6002649664878845, 0.08957747370004654, -0.001929056248627603, -0.15044398605823517, 0.22408133745193481, -0.44066867232322693, -0.2591778337955475, -0.3706912398338318, 0.1261061280965805, 0.2862025499343872, -0.07987245917320251, 0.06594527512788...
I am programming win32 using `fopen` `fread` `fwrite` in C. How can I force windows to write data through to the disk? Is than an API call for this? I have a program that must absolutely make sure that data is saved to disk before it saves to a different indexing file, otherwise if there are crashes the index file ca...
[ 0.3860975205898285, 0.21748191118240356, 0.3963877260684967, -0.14446602761745453, -0.06315732002258301, -0.29159489274024963, 0.14817869663238525, -0.08856658637523651, -0.029686952009797096, -0.7719535827636719, -0.1162310242652893, 0.9001743793487549, -0.36086422204971313, 0.13656988739...
which does exactly what you want.
[ 0.39845356345176697, 0.3500000238418579, 0.23367059230804443, 0.1406373232603073, -0.032961759716272354, 0.21039606630802155, -0.027118077501654625, -0.07427138835191727, -0.0407564714550972, 0.20137497782707214, 0.0845869705080986, 0.514783501625061, 0.10634749382734299, -0.09402602910995...
When i have a relation between two entities in my model: [GroupMember] (\*) ----- (1) [User] and tries to select items from this relation with LINQ: From entity in \_user.GroupMember select entity I always get an empty result unless I load the relation first with following statement: \_user.GroupMember.Load() Is ...
[ -0.06839296221733093, -0.09422226995229721, 0.2648092806339264, -0.052145276218652725, -0.016711637377738953, -0.16885176301002502, -0.008214670233428478, -0.25231632590293884, -0.3010782301425934, -0.36235305666923523, -0.07043667882680893, 0.4206111431121826, -0.3014151453971863, 0.35903...
What are the most important guidelines to follow if you need to break an interface in a .NET application? How do these guidelines change before and after your application has been deployed? I know there are other questions that debate when/where interfaces should be used, however I don't want to get into that. I just ...
[ 0.526321291923523, 0.23462823033332825, 0.2096182405948639, 0.29924312233924866, 0.21421203017234802, -0.1187913715839386, 0.3831576108932495, -0.17963436245918274, -0.3633882701396942, -0.44815680384635925, 0.11517750471830368, 0.7297028303146362, -0.2676016688346863, -0.07736184448003769...
about renaming methods and variables, is this ever going to break an interface? One strong recommendation I've come across in the past is "never break an interface". But doesn't this produce a messy design such as IDocument, IDocument2, IDocument3, IDocument4, IDocument5, IDocument6 etc, as seen in the mshtml COM libr...
[ 0.437732458114624, -0.19776278734207153, 0.11268516629934311, 0.3719438314437866, -0.1002524122595787, -0.10607554018497467, 0.42520180344581604, 0.013054943643510342, -0.19705048203468323, -0.6605694890022278, -0.028409406542778015, 0.8009664416313171, -0.4890117347240448, 0.2807749509811...
you release a new library/app then you will need to provide some assistance to them to indicate what changes are required, how you manage this is dependent on whther the change can happen whilst maintaining the old functions/properties. If you can then judicious use of [Obsolete("Use the new Blah method instead", false...
[ 0.4034331142902374, 0.21666720509529114, 0.3435410261154175, 0.17031027376651764, 0.3614829480648041, -0.29823818802833557, 0.36072468757629395, -0.2411031872034073, -0.2030602991580963, -0.7333260178565979, -0.5706734657287598, 0.5734199285507202, -0.4893326461315155, 0.04815920442342758,...
that binary and source compatibility is to be maintained for, say 5 years (a short period of time for OS platform APIs) then you have little choice but to go with an entirely new interface, adding methods to an interface will break code implementing it (either at compile, at type validation or at method invocation depe...
[ 0.3404536545276642, 0.060851309448480606, 0.20168310403823853, 0.22219489514827728, 0.19815751910209656, -0.28661221265792847, 0.31092581152915955, -0.10244596004486084, -0.09035590291023254, -0.48637211322784424, -0.16108404099941254, 0.44646552205085754, -0.10254894196987152, -0.06339597...
I've often wondered why languages with a `null` representing *"no value"* don't differentiate between the passive *"I don't know what the value is"* and the more assertive *"There is no value."*. There have been several cases where I'd have liked to differentiate between the two (especially when working with user-inpu...
[ -0.24046020209789276, 0.14461205899715424, -0.05906543508172035, -0.2936914563179016, -0.15645328164100647, 0.28991976380348206, 0.7834079265594482, 0.2055066078901291, -0.251461923122406, -0.20654645562171936, -0.5178837180137634, 0.33805128931999207, -0.31929126381874084, 0.2571723163127...
for nulls too](http://msdn.microsoft.com/en-us/library/b3h38hb0.aspx). So, if we can have one `null`, why can't we have two? In my programming, I recently adopted the practice of differentiating "language null" and "domain null". The "language null" is the special value that is provided by the programming language to...
[ 0.17537803947925568, -0.04006272554397583, -0.0378759428858757, 0.06877410411834717, -0.37251296639442444, -0.17756874859333038, 0.33718541264533997, 0.18365047872066498, -0.2169906198978424, -0.2913626730442047, -0.1854078322649002, 0.1609671711921692, -0.5423169732093811, 0.6634168624877...
domain null, but I have found that it tends to make code more procedural (less object oriented) and the intent harder to discern. Every time to want a null, ask yourself: is that a language null, or a domain null?
[ 0.2638414800167084, 0.009327840991318226, -0.23849092423915863, 0.10479655116796494, -0.340287983417511, -0.4019436240196228, 0.4936480224132538, 0.36862197518348694, -0.12232205271720886, -0.3433346152305603, -0.3682548701763153, 0.19061002135276794, -0.42959064245224, 0.280607134103775, ...
How to get the fraction length? If at all possible, without using string operation or loop ``` should all return length of 3: 5.234 5.23400 5.234000 ``` Any programming language is accepted [EDIT] Not a homework, I want to display fractions at its minimum. Example, I defined numeric(18,8) in database. If the user ...
[ 0.2407919317483902, 0.0782325267791748, 0.3439265787601471, -0.0033350398298352957, -0.29771390557289124, 0.2879815995693207, 0.15470005571842194, -0.6234095692634583, -0.19620147347450256, -0.5179928541183472, 0.10458425432443619, 0.19650329649448395, 0.13114260137081146, 0.21734367311000...
Return 4 num *= 10 If Int(num) = num Then Return 5 num *= 10 If Int(num) = num Then Return 6 num *= 10 If Int(num) = num Then Return 7 num *= 10 If Int(num) = num Then Return 8 Throw New Exception("Number exceeds expected precision") ``` No string operations, no loops. **EDIT:** BTW, to do this with a loop: ``` re...
[ -0.18515852093696594, -0.15727226436138153, 0.2572859525680542, -0.2625049650669098, -0.12641775608062744, 0.09176283329725266, 0.4988505244255066, -0.6428471207618713, -0.18661868572235107, -0.38478904962539673, -0.23119859397411346, 0.3274818956851959, -0.10643057525157928, 0.02984518185...
How can I change the time I've made a commit in my local repository? Suppose I've done several commits and noticed that the date on my computer is wrong. Suppose also that these commits were not pushed anywhere yet. You can do it easily with MQ (Mercurial Queues): Set up a bad date repo ``` + hg init + echo line + h...
[ 0.20419476926326752, -0.2966443598270416, 0.26023417711257935, 0.024251792579889297, 0.14515739679336548, 0.21021558344364166, 0.5015285015106201, -0.2360708862543106, -0.616489827632904, -0.539137601852417, -0.040077973157167435, 0.3754769265651703, -0.3162776827812195, 0.2429500073194503...
Ry4an Brase <ry4an@mini> date: Thu Dec 03 00:00:00 2009 -0600 summary: third changeset: 1:c1fe70008824 user: Ry4an Brase <ry4an@mini> date: Wed Dec 02 00:00:00 2009 -0600 summary: second changeset: 0:abb97adaa541 user: Ry4an Brase <ry4an@mini> date: Tue Dec 01 00:00:00 2...
[ -0.4319227933883667, -0.03333456814289093, 0.7757181525230408, -0.5174852013587952, -0.10976918786764145, 0.32117295265197754, 0.3435680866241455, -0.29156050086021423, -0.39584073424339294, -0.6247773766517639, -0.3870905041694641, 0.7878955602645874, -0.49754393100738525, 0.1761364042758...
hg qimport -r 0 ``` Make each patch the qtip in turn and fix the date ``` + hg qrefresh -D + hg qpop Now at: 1.diff + hg qrefresh -D + hg qpop Now at: 0.diff + hg qrefresh -D ``` Reapply the patches ``` + hg qpush applying 1.diff Now at: 1.diff + hg qpush applying 2.diff Now at: 2.diff ``` Turn each patch back ...
[ -0.12233197689056396, -0.11001106351613998, 1.0442123413085938, -0.13609538972377777, -0.2159627079963684, 0.04096740111708641, 0.3785473704338074, -0.5542505979537964, -0.16526342928409576, -0.7043976187705994, -0.30770817399024963, 0.5018683671951294, -0.06130943447351456, -0.02747863531...
third changeset: 1:5cbb9fc51bcc user: Ry4an Brase <ry4an@mini> date: Wed Feb 25 22:29:02 2009 -0600 summary: second changeset: 0:ec58d1f24278 user: Ry4an Brase <ry4an@mini> date: Wed Feb 25 22:29:02 2009 -0600 summary: first ```
[ -0.5580340623855591, 0.19069871306419373, 0.7973992824554443, -0.48744770884513855, -0.15612317621707916, 0.10482163727283478, 0.379609614610672, -0.315268337726593, -0.2802126109600067, -0.7496723532676697, -0.3722982108592987, 0.5653732419013977, -0.2944856882095337, 0.296745240688324, ...
Reading a book on Entity Framework and they say that LINQ is only available for C# and VB.NET. But for other languages you can use Entity SQL. If you are doing a project in C#, is there any reason to use Entity SQL anyway? Any experiences with this? Maybe it could be for something that can't be expressed in Linq? Tho...
[ 0.5716436505317688, 0.03665585070848465, 0.2864339053630829, 0.23477044701576233, -0.09618491679430008, -0.526599645614624, 0.0033247426617890596, 0.0852610394358635, -0.21704167127609253, -0.2807672917842865, 0.3095848262310028, 0.5297400951385498, -0.42815864086151123, -0.084434963762760...
Linq and Dynamic Linq See [Is there a way I can dynamically define a Predicate body from a string containing the code?](https://stackoverflow.com/questions/566984/is-there-a-way-i-can-dynamically-define-a-predicate-body-from-a-string-containing)
[ -0.19980338215827942, -0.3277432322502136, 0.302023321390152, 0.020952802151441574, -0.16834546625614166, -0.1023699939250946, -0.15197253227233887, -0.234140083193779, -0.44431769847869873, 0.05320598930120468, -0.2732440233230591, 0.6068694591522217, -0.3806530833244324, -0.2942022085189...
i'm doing a test how hash and salt passwords. Well , i can add hash and salt password to the Database but i got stuck to store passwords from database. i have a simple Database : ``` Table _______
[ 0.16544093191623688, 0.6437092423439026, 0.052789073437452316, -0.02142380177974701, 0.09339097887277603, -0.015009400434792042, 0.14081116020679474, 0.19004392623901367, -0.08949578553438187, -0.9128234386444092, 0.4172278344631195, 0.45377570390701294, 0.016401197761297226, 0.27863672375...
ProvaHS -------- (PK) LoginID int
[ -0.4608509838581085, 0.4347059428691864, 0.04928853362798691, -0.613860011100769, -0.3535672724246979, 0.740329921245575, 0.4936584234237671, -0.4177348017692566, -0.1583636850118637, -0.21869540214538574, -0.3793060779571533, 0.3096301555633545, -0.033735428005456924, 0.010989292524755001...
UserName nvarchar(50) Password nvarchar(50) Salt nvarchar(50) ``` So i create a form to add new
[ -0.33262917399406433, 0.22392043471336365, 0.3821186423301697, -0.3131484389305115, -0.05802625045180321, 0.0485004298388958, 0.4361779987812042, -0.34351277351379395, 0.05345072224736214, -0.876242458820343, 0.0447174496948719, 0.40499287843704224, -0.042568761855363846, 0.304151117801666...
record to the database with this code: ``` public partial class Window1 : Window { public Window1() { InitializeComponent(); } #region SALT public static class PasswordCrypto { private static SHA1CryptoServiceProvider Hasher = new SHA1CryptoServiceProvider(); //Private...
[ -0.39520642161369324, -0.07671944797039032, 0.5131901502609253, -0.28822028636932373, 0.09109476208686829, -0.042169950902462006, 0.32531845569610596, -0.0624915286898613, -0.21829812228679657, -0.8035092949867249, -0.43708086013793945, 0.1455627828836441, -0.16247130930423737, 0.497104555...
byte[] buffer = new byte[saltSize + 1]; RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider(); rng.GetBytes(buffer); return Convert.ToBase64String(buffer); } static internal string HashEncryptString(string s) { byte[] clearBytes = Encoding...
[ -0.34371107816696167, -0.1711013913154602, 0.3099417984485626, -0.6412137150764465, 0.16367225348949432, 0.22272568941116333, 0.20090192556381226, -0.3529694080352783, -0.2354256957769394, -0.4479024410247803, -0.35481804609298706, 0.2732144892215729, -0.3499511182308197, 0.331380963325500...
byte[] hashedBytes = Hasher.ComputeHash(clearBytes); return Convert.ToBase64String(hashedBytes); } static internal string HashEncryptStringWithSalt(string s, string salt) { return HashEncryptString(salt + s); } } #endregion private void GetSalt() ...
[ -0.3406120538711548, -0.11489042639732361, 0.5020355582237244, -0.30499887466430664, 0.007882535457611084, -0.012711236253380775, 0.47116193175315857, -0.11485160887241364, -0.10292813926935196, -0.5003095269203186, -0.18963737785816193, 0.4204963147640228, -0.1759631186723709, 0.209724321...
this.textBoxSalt.Text = PasswordCrypto.GetSalt(16); } private void GetSaltHash() { // It's how i salt and hash the password before to save it to the Database this.textBoxPassword.Text = PasswordCrypto.HashEncryptStringWithSalt(this.textBoxClear.Text, this.textBoxSalt.Text); } ...
[ -0.2881309986114502, 0.05288585647940636, 0.180844247341156, 0.06866047531366348, 0.28838685154914856, -0.1902923285961151, 0.6604294180870056, -0.38358163833618164, -0.17800265550613403, -0.8825052976608276, -0.49164772033691406, 0.7515340447425842, -0.062300849705934525, 0.24185936152935...
this.textBoxClear.Text = PasswordCrypto.HashEncryptString(this.textBoxPassword.Text); } private void Add(object sender, RoutedEventArgs e) { DataClasses1DataContext dc = new DataClasses1DataContext(); try { if (textBoxUserName.Text.Length > 0) { ...
[ -0.05157516896724701, -0.16051901876926422, 0.3658170700073242, -0.48722583055496216, 0.11388256400823593, 0.2092762291431427, 0.8434810042381287, -0.5103968977928162, -0.02645265869796276, -0.43029582500457764, -0.4671373963356018, 0.6523931622505188, -0.3836076855659485, 0.05771081149578...
tab.UserName = textBoxUserName.Text; tab.Password = textBoxPassword.Text; tab.Salt = textBoxSalt.Text; dc.ProvaHs.InsertOnSubmit(tab); dc.SubmitChanges(); }
[ -0.2788020968437195, 0.025594638660550117, 0.35694023966789246, -0.20661602914333344, -0.23353137075901031, 0.24730339646339417, 0.6236749291419983, -0.250950425863266, -0.10626836866140366, -0.6836372017860413, -0.3042597770690918, 0.4340803325176239, -0.31656789779663086, 0.1999766975641...
} catch (Exception ex) { MessageBox.Show("Error!!!"); } } private void HashButton(object sender, RoutedEventArgs e) { GetHash(); } private void SaltButton(object sender, RoutedEventArgs e) { GetSalt(); } private void HashSaltButton...
[ -0.16832774877548218, -0.22179296612739563, 0.28652244806289673, -0.38857054710388184, 0.0550711527466774, 0.16251322627067566, 0.5227351784706116, -0.0675884559750557, -0.10785100609064102, -0.34033459424972534, -0.27738457918167114, 0.4477064311504364, -0.36802834272384644, 0.28088378906...
sender, RoutedEventArgs e) { GetSaltHash(); } private void Close_W(object sender, RoutedEventArgs e) { this.Close(); } } ``` } * with this method i can salt,hash and save password to the database..(following advices StackOverflow's member ) thanks.. Now i'm testing how store pa...
[ -0.17133541405200958, -0.14547084271907806, 0.6089615821838379, -0.3388844430446625, -0.019587168470025063, -0.11906293779611588, 0.46685516834259033, -0.11071377992630005, 0.05806872248649597, -0.866356372833252, -0.4356670379638672, 0.5712061524391174, -0.3367573618888855, 0.358488678932...
} #region SALT public static class PasswordCrypto { private static SHA1CryptoServiceProvider Hasher = new SHA1CryptoServiceProvider(); //Private Hasher As New MD5CryptoServiceProvider() static internal string GetSalt(int saltSize) { byte[] buffer = new byte[saltS...
[ -0.5573734045028687, -0.1990114003419876, 0.5604473948478699, -0.2896977663040161, 0.04226323962211609, -0.036673031747341156, 0.4173358976840973, -0.24916939437389374, -0.06857387721538544, -0.6607205271720886, -0.3013080656528473, 0.10417646914720535, -0.15194867551326752, 0.532883584499...
rng.GetBytes(buffer); return Convert.ToBase64String(buffer); } static internal string HashEncryptString(string s) { byte[] clearBytes = Encoding.UTF8.GetBytes(s); byte[] hashedBytes = Hasher.ComputeHash(clearBytes); return Convert.ToBase64String(h...
[ -0.4321213364601135, -0.1280851513147354, 0.2525249123573303, -0.5540181994438171, 0.10226091742515564, 0.21342015266418457, 0.2585175037384033, -0.19280512630939484, -0.27534550428390503, -0.27736032009124756, -0.5288509130477905, 0.43775561451911926, -0.4733732044696808, 0.36134299635887...
} static internal string HashEncryptStringWithSalt(string s, string salt) { return HashEncryptString(salt + s); } } #endregion private void closs(object sender, RoutedEventArgs e) { this.Close(); } public bool ValidateApplicationUser(string userNa...
[ -0.2088668942451477, -0.04799828305840492, 0.6471408009529114, -0.3821861147880554, 0.08175992220640182, -0.1362612396478653, 0.6496418714523315, 0.006636857986450195, 0.20104584097862244, -0.46776044368743896, -0.2719195783138275, 0.40563157200813293, -0.3368666172027588, 0.28627628087997...
bool OK = false; DataClasses1DataContext dc = new DataClasses1DataContext(); object saltValue = from c in dc.ProvaHs where c.UserName == userName select c.Salt; if (!(saltValue == System.DBNull.Value)) { password = PasswordCrypto.HashEncryptStringWithSalt(password...
[ -0.24318653345108032, 0.08046048879623413, 0.3011842966079712, -0.31827351450920105, -0.08934411406517029, 0.1957690268754959, 0.8022392392158508, -0.41895297169685364, -0.054980192333459854, -0.42217984795570374, -0.33834609389305115, 0.4003028869628906, -0.17784006893634796, 0.4059122502...
var query = from c in dc.ProvaHs where c.UserName == userName && c.Password == password select new { c.LoginID, c.UserName, c.Password }; if (query.Count() != 0) { return true; } return false; } private void Confirm(object sender, RoutedEventArgs e)
[ 0.16978885233402252, -0.22194555401802063, 0.5223383903503418, 0.0007986252312548459, 0.1712772250175476, 0.007977854460477829, 0.3587563931941986, -0.36360377073287964, 0.0773884505033493, -0.18237510323524475, -0.15585322678089142, 0.5512726902961731, -0.26824960112571716, 0.413147181272...
{ bool authenticated = true; if (usernameTextBox.Text != "" && passwordTextBox.Password.ToString() != "") { authenticated = ValidateApplicationUser(usernameTextBox.Text, passwordTextBox.Password.ToString()); } if (!authenticated) {
[ -0.3120451271533966, 0.08040598779916763, 0.42923837900161743, -0.37882497906684875, -0.022634845227003098, -0.22997167706489563, 0.7968576550483704, -0.439207524061203, 0.2745339572429657, 0.050449188798666, -0.5996655225753784, 0.6072319746017456, -0.2747356593608856, 0.20628507435321808...
MessageBox.Show("Invalid login. Try again."); } else { MessageBox.Show("Aaaaahhhh.JOB DONE!!!!...."); } } } ``` when i debug the application i receive always an error at this code line : if (query.Count() != 0) in "query" = Empty :"Enumeration
[ -0.09092054516077042, 0.221231147646904, 0.5251999497413635, -0.4668007493019104, 0.1695929318666458, -0.08680325001478195, 0.6859302520751953, -0.18620452284812927, -0.1738854944705963, -0.3794749081134796, -0.2892371416091919, 0.5026776194572449, -0.49512532353401184, 0.3102720081806183,...
yielded no results" Do you have any suggest how work out this error and store password from database in my case? Thanks Try: ``` public bool ValidateApplicationUser(string userName, string password) { DataClasses1DataContext dc = new DataClasses1DataContext(); var saltValue = dc.ProvaHs.Where(c => c.UserName == u...
[ 0.12344622611999512, 0.08557704836130142, 0.33958756923675537, -0.12449033558368683, 0.009555916301906109, 0.04481010138988495, 0.9176756739616394, -0.6133542060852051, 0.03561681881546974, -0.5232560038566589, -0.0757124125957489, 0.5686337351799011, -0.140995055437088, 0.3261100947856903...
(saltValue == null) return false; password = PasswordCrypto.HashEncryptStringWithSalt(passwordTextBox.Password, saltValue.ToString()); return dc.ProvaHs.Any(c => c.UserName == userName && c.Password == password); } ```
[ -0.09701351821422577, 0.23548711836338043, 0.17191876471042633, -0.4416518807411194, 0.14535537362098694, 0.06902271509170532, 0.8384044170379639, -0.27902844548225403, 0.017757151275873184, -0.47429609298706055, -0.16798727214336395, 0.7175047397613525, -0.1050785630941391, 0.190273195505...
I just downloaded the developer edition of SQL Anywhere. How can I get a list of tables in the database I'm connected to?. Also for a particular table, how do I get the meta-data for that table (column names, types, etc)? I have not used SQL-Anywhere for many years however the following statement should work ``` selec...
[ 0.22816959023475647, 0.19245852530002594, 0.44366034865379333, 0.06749764084815979, 0.062684066593647, -0.19208110868930817, 0.15749341249465942, 0.0092496732249856, -0.19235756993293762, -0.3549838364124298, 0.016904719173908234, 0.37320682406425476, -0.3446395695209503, 0.007662609685212...
I'm in a school project on information security, and one of the assignments is to write some secure pages in PHP. None of the people on my group know PHP, that is not a big problem though, we'll learn enough to create the simple pages needed. One of the tips the students assistants have given is to use the two functio...
[ 0.35013025999069214, -0.031376369297504425, 0.33045196533203125, 0.3178902268409729, 0.4155588150024414, -0.29361194372177124, 0.5597677230834961, -0.014208020642399788, -0.23719528317451477, -0.37594348192214966, -0.05057701840996742, 0.3741454482078552, -0.07069715112447739, -0.299745976...
the other groups systems, it is important both that our own system is safe, and to find possible vulnarabilites in the other group's systems. And most of the groups will use these two functions blindly. So my questions are: 1. Is there any known vulnerabilities in `strip_tags()`? 2. Is there any known vulnerabilities ...
[ 0.21233990788459778, -0.04536765068769455, 0.20788872241973877, 0.06072979047894478, -0.01405240036547184, -0.2881793677806854, 0.49749141931533813, -0.5851902365684509, -0.27028313279151917, -0.3004510700702667, -0.36192938685417175, 0.5031536817550659, -0.34007543325424194, -0.1096937581...
htmlentities to make certain that no malicious code is being output to the browser. You'll also probably want to run [all](http://joelonsoftware.com/articles/Wrong.html) dynamic content through some sort of filter function before outputting it to the browser. This is one area where a well-organized and cohesive OO appr...
[ 0.19222426414489746, -0.06432633846998215, 0.2936513125896454, 0.0006126881344243884, -0.4298102557659149, -0.17478981614112854, 0.6439026594161987, -0.004087618086487055, -0.4388737082481384, -0.3468656837940216, -0.2994706332683563, 0.38607946038246155, -0.4428311586380005, -0.0259963218...
only touch the tip of the iceberg when it comes to PHP security. There are a number of other issues that have to also be dealt with such as: * [Secure Session Management](http://shiflett.org/articles/the-truth-about-sessions) * [Session Fixation](http://shiflett.org/articles/session-fixation) I would recommend that y...
[ 0.35326576232910156, 0.40407928824424744, -0.05343823879957199, 0.23291313648223877, -0.49976810812950134, -0.5616354942321777, 0.5297729969024658, 0.15022040903568268, -0.3454941213130951, -0.12852142751216888, 0.2801365256309509, 0.532073438167572, 0.0028433052357286215, -0.0113213695585...
as making certain configuration files that contain sensitive information (like database passwords) are not stored in publicly available directories. On that final item, if it is possible, you will want to look into using .htaccess files or their IIS equivalent to make certain only the files you intend access to are pu...
[ 0.5895075798034668, -0.2792718708515167, 0.03518107160925865, 0.38882261514663696, 0.21830230951309204, -0.4646584093570709, 0.3700827956199646, 0.35919150710105896, -0.31097596883773804, -0.5394461750984192, -0.13401693105697632, 0.40939581394195557, -0.167838454246521, -0.028017787262797...
that could have all been easily resolved. 1) Password log in attempts where not throttled. In other words if a user attempts to log in and fails then a repeat request from their IP might require 2 seconds to process the second time, then 4 the next and so on. This makes it impractical for a bot to make continuous log...
[ -0.23709875345230103, -0.17639683187007904, 0.2648378014564514, 0.31080734729766846, -0.09870323538780212, -0.0290303286164999, 0.6241904497146606, -0.2640942931175232, -0.048259440809488297, -0.4751823842525482, -0.19132494926452637, 0.6474475264549255, -0.09817865490913391, -0.2069848179...
a dictionary at hacking a password than it is to come up with random strings of numbers and letters. Also the amount of time crack a password increases exponentially as more characters are added. You can see [this post](http://www.codinghorror.com/blog/archives/001206.html) from Jeff Atwood for more information on thi...
[ 0.5112987160682678, 0.1136629581451416, -0.6449580788612366, 0.1167311817407608, 0.03587433695793152, -0.1558396816253662, 0.35482123494148254, 0.17818357050418854, 0.03960668668150902, -0.6369978189468384, -0.02346106432378292, 0.40059179067611694, -0.12155134975910187, -0.242300689220428...
I have to caculate the number of business days between a given time period which is simple enough, however taking into account public holidays adds in a dimension of complexity. My solution is not what I would call elegant nor efficient as it retrieves public holidays and puts them in a list, checks to see if a date i...
[ 0.21188335120677948, 0.1705278754234314, 0.6181966662406921, 0.02402779459953308, -0.13527394831180573, -0.1384335160255432, 0.39402955770492554, 0.09945915639400482, -0.5954445004463196, -0.22383707761764526, -0.053441133350133896, 0.1699002981185913, -0.11662567406892776, 0.1351852715015...
to hold the public holidays? If you've got the public holidays stored in order, in a list, you can just do a binary search to find where in the list the start of your time period falls, and another to find where in the list the end of the time period falls. Then you just need to take the "normal" difference (removing w...
[ 0.32912272214889526, -0.06330539286136627, 0.717019259929657, 0.14775465428829193, 0.010508359409868717, -0.3970290422439575, 0.3071455657482147, 0.03183034434914589, -1.1612648963928223, 0.10946517437696457, -0.3320390582084656, 0.10795848071575165, 0.03731175884604454, 0.2137417048215866...
naturally comparable time structure. Note the return value is negative if the key you're searching for isn't actually in the list (which it won't be most of the time). See the remarks in the docs.)
[ 0.04249133914709091, -0.04407329112291336, 0.15403395891189575, 0.14035804569721222, 0.28047460317611694, -0.3145269453525543, 0.049236975610256195, -0.055452000349760056, -0.25260522961616516, -0.6489793062210083, -0.21990080177783966, 0.5842969417572021, 0.07107395678758621, 0.0740326344...
I'll design and implement database for data acquisition and started to wonder what might be the best relational database structure for multivariable solution. There can be dozens of variables (configurable), different types (boolean, integer, float at least, maybe string). Values of different variables are not related....
[ 0.16921642422676086, 0.19203704595565796, 0.33109718561172485, 0.2791946828365326, 0.1887979507446289, 0.29232534766197205, 0.057355623692274094, -0.29407867789268494, -0.3050168454647064, -0.48947760462760925, 0.24751688539981842, 0.3301798403263092, -0.24395182728767395, 0.35673183202743...
separate table for variable definition and one or more table for timeseries, one record for each variable-value-timestamp: 1. Have some common data type which can store all values (string?) 2. Have multiple columns, one for each type 3. Have multiple tables for data values, one table for each type Something else? B...
[ 0.5038574934005737, 0.027667973190546036, 0.44169309735298157, 0.32898205518722534, -0.22327540814876556, 0.09557787328958511, 0.12468910962343216, -0.14056450128555298, -0.7925387620925903, -0.34324121475219727, 0.029610447585582733, -0.04799254238605499, 0.011557312682271004, 0.267673820...
falls. Then you just need to take the "normal" difference (removing weekends) and subtract the count of items between the results of the binary searches. Be careful of time periods which start or end on a public holiday! ([`List<T>.BinarySearch`](http://msdn.microsoft.com/en-us/library/3f90y839.aspx) method should be...
[ 0.10827423632144928, -0.2827192544937134, 0.6127263903617859, 0.2758914530277252, 0.17744633555412292, -0.16077835857868195, 0.8023152351379395, 0.06773010641336441, -0.5648598670959473, -0.3338331878185272, -0.2732631266117096, -0.00049031269736588, 0.2502865195274353, 0.3107714354991913,...
i wonder if there is a way to use the basedOn property of wpf styles with dynamicresources. e.g. ``` <Style BasedOn="{DynamicResource somestyle}"> <Setter Property="SomeProp" Value="SomeValue"/> </Style> ``` this e.g. throws an error indicating that the usage of dynamicresources in combination with BasedOn styles...
[ 0.3657132387161255, -0.22473320364952087, 0.10713906586170197, 0.14976558089256287, -0.10240168124437332, -0.36107543110847473, 0.15743042528629303, -0.057789236307144165, -0.43024346232414246, -0.455722838640213, -0.25576257705688477, 0.4728296399116516, -0.271406888961792, 0.187329038977...
a dynamic resource, so whenever that resource changes, `Style A1` and `Style A2` should change their `BasedOn` property. However, once a Style is being used in your application, it becomes a sealed object. `Style A` becomes immutable. One workaround you can use is: 1. `Style A` needs to change. 2. Create a new Style ...
[ 0.4779462516307831, -0.18989698588848114, 0.5169003009796143, 0.3221471905708313, 0.2637094557285309, -0.3503487706184387, 0.0314234234392643, -0.14434726536273956, -0.30097803473472595, -0.45098942518234253, -0.3153364658355713, 0.5910064578056335, -0.5166682600975037, 0.15821777284145355...
resources collection so that the three new styles are in there. `{DynamicResource StyleA1}` and `{DynamicResource StyleA2}` should now pick up the fact that those resources changes (from step 4) and update any references automatically. Note that this is a very simple scenario. Real world style hierarchies can be more...
[ 0.09396875649690628, -0.15562301874160767, 0.166788712143898, 0.2143096923828125, 0.0049249399453401566, -0.06640949845314026, 0.22702617943286896, 0.0554213747382164, -0.4773328900337219, -0.7748793959617615, -0.19936691224575043, 0.6581465601921082, -0.2382398396730423, -0.09166759997606...
There is a nvarchar column in a table that allows empty values. Once there is a none-empty value it must be uniqe. Is it possible to define this rule without a trigger? EDIT: <http://decipherinfosys.wordpress.com/2007/11/30/multiple-null-values-in-a-unique-index-in-sql-serverdb2-luw/> is a nice workaround. The on...
[ -0.17434757947921753, 0.011165403760969639, 0.23609130084514618, 0.031737763434648514, -0.037804942578077316, -0.23873330652713776, 0.31980764865875244, -0.029978688806295395, -0.4532812833786011, -0.3793580234050751, -0.04757148399949074, 0.3200640082359314, -0.3606056869029999, 0.4186418...
Style A / \ Style A1 Style A2 ``` this might not be a difficult scenario. You refer to `StyleA` using a dynamic resource, so whenever that resource changes, `Style A1` and `Style A2` should change their `BasedOn` property. However, once a Style is being used in your application, it becomes a sealed obj...
[ 0.5214155316352844, -0.06742682307958603, 0.32652780413627625, -0.033461593091487885, 0.15228256583213806, -0.35691118240356445, 0.14826899766921997, -0.20370087027549744, -0.19764795899391174, -0.482385516166687, -0.32597941160202026, 0.47663334012031555, -0.5523949265480042, 0.1693797707...
`Style A1` and `Style A2`. You'd need to write a copy procedure that makes copies of all the `Setters`, `Resources`, etc. Set the `BasedOn` to the new version of `Style A`. 4. Update the resources collection so that the three new styles are in there. `{DynamicResource StyleA1}` and `{DynamicResource StyleA2}` should n...
[ 0.5000595450401306, -0.1314205527305603, 0.28205233812332153, 0.04579214006662369, -0.15292800962924957, -0.05634194612503052, 0.13975872099399567, -0.2531227767467499, -0.28924572467803955, -0.6390912532806396, -0.16632424294948578, 0.6740908622741699, -0.3933536112308502, -0.176464140415...
helped out.
[ 0.32869046926498413, 0.3391385078430176, 0.10149236023426056, 0.32450395822525024, -0.0271077249199152, 0.06077417731285095, 0.08660496026277542, -0.15761800110340118, -0.296562522649765, -0.40131208300590515, 0.06916423887014389, 0.228531152009964, 0.33820125460624695, -0.2961469888687134...
Is there a way to get the available resource translations of a .net dll? Our software is being translated in some different languages, and I would like to give the user the choise of what language the software is in, although I would only like to let them choose only between the languages it has been translated in. I ...
[ 0.3396351635456085, -0.0981968566775322, 0.3117624819278717, 0.16415762901306152, 0.1414959579706192, 0.06461431831121445, 0.28464189171791077, 0.09123539179563522, -0.13678613305091858, -0.7133575677871704, -0.3104127049446106, 0.5601447224617004, -0.2596786320209503, -0.09728080034255981...
// load default language to the list languageList.Add(new Language("English", "en")); string fileName = "myProgram.resources.dll"; // load other languages available in the folder DirectoryInfo di = new DirectoryInfo(Application.StartupPath); foreach (DirectoryInfo dir in di.GetDirect...
[ -0.03561583161354065, -0.04780324175953865, 0.39578115940093994, -0.38345834612846375, 0.46078014373779297, 0.13852083683013916, 0.42880377173423767, 0.2434626966714859, 0.08540298789739609, -0.7132375240325928, -0.5744632482528687, 0.8497803807258606, -0.49122461676597595, 0.0243036448955...
{ try { CultureInfo ci = new CultureInfo(dir.Name); languageList.Add(new Language(ci.NativeName, ci.Name)); }
[ 0.17450055480003357, -0.18139658868312836, 0.30062827467918396, -0.25809386372566223, 0.3516277074813843, 0.31949710845947266, 0.5041037201881409, -0.018534623086452484, 0.12038131803274155, -0.6996526718139648, -0.42216917872428894, 0.4398968517780304, -0.41175520420074463, 0.163384109735...
catch { // whatever happens just don't load the language and proceed ;) continue; }
[ 0.1460457146167755, -0.25192388892173767, -0.13361585140228271, -0.12486425042152405, 0.09212905168533325, -0.10641716420650482, 0.6841772794723511, 0.13675111532211304, -0.1830972284078598, -0.11518924683332443, -0.4691454768180847, 0.39749816060066223, -0.3911516070365906, -0.23146744072...
} } } ``` It ads some exception handling overhead but how many users will create custom folders in the installation directory with the fake resource named exactly as localization file?? :P
[ 0.25433146953582764, 0.24776814877986908, 0.2009616196155548, 0.07906205207109451, 0.3245702087879181, -0.10332702100276947, 0.11209747940301895, 0.19537056982517242, -0.11776573956012726, -0.40290015935897827, -0.25545376539230347, 0.48637062311172485, -0.2519277334213257, 0.0241186935454...
I recently made the statement to a colleague that: > NullReferenceExceptions should *never* > be explicitly caught I used the word never.... hmmm. I've never seen a appropriate use case myself for catching them but I wanted to check if anyone else has? Never is such a strong word after all..... It depends on why; s...
[ 0.3399941325187683, 0.18384002149105072, -0.2570720911026001, 0.00811840035021305, -0.10014254599809647, -0.2063712477684021, 0.5722336769104004, 0.08952567726373672, -0.578040599822998, -0.43383336067199707, -0.08382992446422577, 0.4597974121570587, -0.3011530041694641, 0.2290181517601013...
I am getting a list of running processes via LINQ. The two properties I want are "ProcessName" and "WorkingSet64". However, in my UI, I want these properties to be called "ProcessName" and "ProcessId". How can I remap the name "WorkingSet64" to "ProcessId"? I did a pseudo syntax of what I am looking for below: ```...
[ 0.24344082176685333, 0.038160551339387894, 0.41476970911026, -0.27699026465415955, 0.2343488186597824, 0.22307251393795013, 0.18512366712093353, -0.10285213589668274, -0.054715462028980255, -0.8991563320159912, -0.24086670577526093, 0.37063753604888916, -0.2168578952550888, 0.2474929690361...
var theProcesses = from p in Process.GetProcesses() orderby p.WorkingSet64 descending select new { p.ProcessName, p.WorkingSet64 alias "ProcessId" }; foreach (var item in theProcesses) {
[ -0.3185664117336273, -0.02062326855957508, 0.533768892288208, -0.32500410079956055, 0.35453081130981445, 0.5557989478111267, 0.23869913816452026, -0.4309256672859192, -0.13269788026809692, -0.36184680461883545, -0.38331571221351624, 0.41890013217926025, -0.21005049347877502, 0.439677625894...
TheListBox.Items.Add(item); } } } } ``` ``` select new { p.ProcessName, ProcessId = p.WorkingSet64 }; ```
[ -0.251080721616745, -0.15543894469738007, 0.4337647557258606, -0.28200358152389526, 0.13070373237133026, 0.3863805830478668, 0.15228228271007538, -0.4688602685928345, -0.5397748947143555, -0.6177563667297363, -0.30178552865982056, 0.37095484137535095, -0.3278978765010834, 0.344027906656265...
What is the best way to find the user's home directory in Java? The difficulty is that the solution should be cross-platform; it should work on Windows 2000, XP, Vista, OS X, Linux, and other Unix variants. I am looking for a snippet of code that can accomplish this for all platforms, and a way to detect the platform....
[ -0.08719892799854279, 0.29818448424339294, 0.12888507544994354, -0.29359179735183716, 0.39929652214050293, -0.2526756227016449, 0.30350759625434875, 0.09429925680160522, -0.2018149197101593, -1.0206838846206665, -0.03144903481006622, 0.36976826190948486, -0.319367915391922, 0.3261141479015...
are using an older version of Java, the `System.getProperty("user.home")` approach is probably still the best. The `user.home` approach seems to work in a very large number of cases. A 100% bulletproof solution on Windows is hard, because Windows has a shifting concept of what the home directory means. If `user.home...
[ 0.16361092031002045, 0.2284848988056183, 0.14384493231773376, -0.06257397681474686, 0.18682274222373962, -0.22800879180431366, 0.4517200291156769, -0.28289371728897095, -0.21790410578250885, -0.7889147400856018, -0.14060673117637634, 0.5826227068901062, -0.28888973593711853, -0.01832095533...
I have a 2D array of doubles in Java which is basically a table of values and I want to find out how many rows it has... It is declared elsewhere (and allocated) like this: ``` double[][] table; ``` then passed to a function... ``` private void doSomething(double[][] table) { } ``` In my function I want to know...
[ 0.18436940014362335, 0.21461693942546844, 0.27988845109939575, -0.24559998512268066, -0.32381460070610046, 0.0597296766936779, 0.11749836057424545, -0.4642827808856964, -0.20196670293807983, -0.5021674036979675, 0.1185523271560669, 0.5243335962295532, -0.7016926407814026, -0.11412998288869...
rows x cols? In Java a 2D array is nothing more than an array of arrays. This means that you can easily get the number of rows like this: ``` int rows = array.length; ``` This also means that each row in such an array *can* have a different amount of elements (i.e. each row can have a varying number of columns). `...
[ -0.004206113051623106, 0.09677903354167938, 0.37684574723243713, -0.1325891613960266, -0.3172711730003357, 0.012120217084884644, -0.009882082231342793, -0.331916481256485, -0.2200697958469391, -0.6881846785545349, -0.0720125064253807, 0.2717008888721466, -0.6419861316680908, -0.14237363636...
number of columns than the first one. But in that case I'd wrap the 2D-array in some Matrix class (that you might have to write). This kind of array is called a [Jagged Array](http://xahlee.info/java-a-day/arrays2.html).
[ 0.010610891506075859, -0.09874250739812851, 0.12115491181612015, -0.24847377836704254, -0.4742008447647095, -0.10762819647789001, 0.18233667314052582, -0.27358579635620117, -0.417918860912323, -0.5532211661338806, 0.015643885359168053, 0.07429520040750504, -0.48324352502822876, -0.14799658...
All the projects I work interface to a piece of hardware and this is often the main purpose of the software. Are there any effective ways I can apply TDD to the code that works with the hardware? **Update:** Sorry for not being clearer with my question. The hardware I use is a frame grabber that capture images from a...
[ 0.8794910907745361, 0.164586141705513, 0.25710415840148926, 0.18283866345882416, 0.03543127328157425, -0.07612645626068115, 0.15466469526290894, 0.025034351274371147, -0.10722135752439499, -0.589261531829834, 0.021399077028036118, 0.6775308847427368, 0.004686274100095034, -0.06638266891241...
the hardware that I want to test. For instance does my software cope correctly when there isn't a camera attached, does it properly start and stop grabbing etc. But this is so tied into the hardware I don't know how to test it when the hardware isn't present or if I should even be trying to do this? **2nd Update:** I'...
[ 0.6624149680137634, 0.09679123014211655, -0.005386795848608017, 0.4357496500015259, 0.09644795209169388, 0.1625201404094696, 0.22032274305820465, -0.6011732816696167, 0.18796683847904205, -0.3958914875984192, 0.03546437248587608, 0.5954188704490662, -0.002421717392280698, -0.39020541310310...
tests for this, you can run them again if you have any doubts whether your mockups work correctly. 2. The second part run against the mockups. This part runs automatically. Part #1 gets run manually after you made sure the hardware is wired up correctly, etc. A good idea is to create a suite of tests which run against...
[ 0.2694902718067169, -0.05066484212875366, -0.20149393379688263, 0.22063393890857697, -0.25326845049858093, 0.2621326744556427, 0.3625332713127136, -0.38523709774017334, 0.11107978969812393, -0.6220030784606934, 0.004647938068956137, 0.7849743366241455, -0.12685438990592957, -0.075010128319...
YourTests extends TestCase { public IDriver getDriver() { return new MockDriver (); } public boolean shouldRun () { return true; } public void testSomeMethod() throws Exception { if (!shouldRun()) return; // Allows to disable all tests assertEquals ("1", getDriver().someMethod()); } } `...
[ 0.5534520149230957, -0.04955744743347168, 0.3561880588531494, 0.06532357633113861, 0.10098356753587723, 0.04977225139737129, 0.4364955425262451, -0.42217114567756653, 0.17977865040302277, -0.7395768165588379, 0.09417397528886795, 0.8672482967376709, -0.20699502527713776, 0.2328434586524963...
boolean shouldRun () { return "yes".equals (System.getProperty("manual")); } } ```
[ 0.09767849743366241, -0.3341311812400818, 0.1528049111366272, -0.1549621969461441, 0.18866999447345734, -0.12066631019115448, 0.47244992852211, -0.24310439825057983, 0.22356194257736206, -0.37573355436325073, -0.0887703150510788, 0.8426001071929932, -0.24403837323188782, -0.018853425979614...
I have what appears to be a very annoying problem. When compiling a project in Eclipse, I see no Console that shows the invocation of the Java compiler and the build results (as in NetBeans). If I, for instance, import an existing project into Eclipse and invoke Project->Build Project, is there a view that will show ...
[ 0.21366333961486816, 0.23542147874832153, -0.0755142867565155, -0.10227859765291214, -0.4472481906414032, -0.2452215850353241, 0.26905569434165955, 0.01834676042199135, -0.06030699238181114, -0.7792206406593323, 0.14131993055343628, 0.674439013004303, -0.24459253251552582, 0.05871035158634...
them. I'm aware that there is a "Problems" view, which shows a list of problems (and not just compiler errors) in all projects and not the particular project that I am working with, which makes it very inconvenient to locate and jump to source of the problem. Since Eclipse JDT provides its own built-in Java compiler, ...
[ 0.3252311050891876, 0.48066747188568115, 0.22421739995479584, 0.15385226905345917, -0.11951804161071777, 0.006433715112507343, 0.06666616350412369, -0.12117074429988861, -0.24441415071487427, -0.7652672529220581, 0.01039236318320036, 0.7832154631614685, -0.3894098997116089, -0.174011439085...
modification, hence no visible "`java`" invocation. --- You can replace/complete the java compiler with a javac` call of your own: For instance, **[Using Alcatel-Lucent nmake with Eclipse JDT](http://www.bell-labs.com/project/nmake/manual/eclipsejdt.html)** does precisely that, and uses a configuration launcher (whi...
[ 0.0445406399667263, 0.13416452705860138, 0.052233800292015076, -0.003936098422855139, -0.08695178478956223, -0.01939363032579422, 0.2538298964500427, -0.4313001036643982, -0.21545839309692383, -0.6252505779266357, -0.35416579246520996, 0.5268566012382507, -0.43478500843048096, -0.131384074...
I've read a lot of times that one should never blindly catch exceptions. Some people say it's ok to wrap your Main() into a catch block to display errors instead of just exiting ([see this SO post for example](https://stackoverflow.com/questions/368184/does-it-make-sense-to-catch-exceptions-in-the-main)), but there see...
[ 0.24977874755859375, 0.11772386729717255, -0.107878178358078, 0.2686341404914856, 0.11623689532279968, -0.3200479745864868, 0.8254771828651428, 0.08540952950716019, -0.6914477944374084, -0.259307324886322, 0.04836305230855942, 0.0023618140257894993, -0.36746495962142944, 0.1853822469711303...
it starts, it loads all the Customer into its local cache. To, me, it makes a lot of sense to write this : ``` foreach (string CustomerID in Customers) try { LoadCustomer(CustomerID);
[ -0.1164814755320549, 0.013729661703109741, 0.264372318983078, -0.3857623338699341, 0.3652244508266449, 0.064115010201931, 0.08929058909416199, 0.05395090952515602, 0.2320665568113327, -0.5207527279853821, -0.28906577825546265, 0.6794313788414001, -0.2682511508464813, 0.19648244976997375, ...
} catch (Exception ex) // blind catch of all exceptions { // log the exception, and investigate later. } ``` Without the blind catch, failing to load a single Customer would just crash all
[ 0.36949339509010315, 0.0016563022509217262, 0.007325845304876566, 0.0074654193595051765, 0.13409359753131866, -0.15440760552883148, 0.3339611291885376, -0.15278397500514984, -0.1531241536140442, -0.31800320744514465, -0.2875189781188965, 0.5569330453872681, -0.5126060247421265, 0.021949535...
the server. **I definitely prefer having my server up with a little unknown side effect on one customer rather than my whole server down.** Of course, if I ever run my catch code, the first thing I'll do is fix the bug in my code. Is there something I'm overlooking here? Are there known best practices (other than th...
[ 0.10855424404144287, 0.11730743199586868, 0.3313935399055481, -0.08376771211624146, -0.11710470914840698, -0.13627032935619354, 0.3574710488319397, 0.28541919589042664, -0.4991430640220642, -0.5141171216964722, 0.06639578938484192, 0.47538667917251587, -0.18790709972381592, -0.020418982952...
in the event of unexplainable errors, vs **Correctness**, prefering to fail completely rather than produce unreliable results. Clearly if you are working on, for example, life-support systems, you don't want your system to simply shut down due to an unknown error condition. Cotninuing to operate, even if your state is...
[ 0.28270888328552246, 0.009197916835546494, -0.015548071824014187, 0.4914873242378235, 0.03428957611322403, 0.07788415253162384, 0.41110455989837646, 0.2740376591682434, -0.42098116874694824, -0.42054125666618347, -0.32378631830215454, 0.3276365101337433, -0.0991908386349678, 0.319715440273...
judgment call. In the main, it would seem that life-support systems programming is more rare than shopping-cart programming, so the broad advice is for people to do what's most common, which is fail in the event of an unexpected error. It's understood that if you are working on a case where that's not appropriate (such...
[ 0.15659750998020172, 0.03642883151769638, 0.009324105456471443, -0.03165672719478607, 0.022218074649572372, -0.036438241600990295, 0.35899174213409424, 0.24308328330516815, -0.1582682877779007, -0.44838908314704895, 0.09546707570552826, 0.8330709934234619, -0.09069711714982986, -0.25243648...
If I have a multiple column index(a,b,c) and one separate index d then my query is using b,a,c,d order whether both the index will be chosen? Whether index will be choosen or not for this query? Apologies! I have since discovered that I can use DateTime span.. thanks go to this article on asp.net forums: <http://forum...
[ 0.07461543381214142, 0.06601238995790482, 0.3033788502216339, 0.05998773127794266, -0.048383381217718124, 0.05787926912307739, 0.23397104442119598, -0.053508806973695755, -0.5435799956321716, -0.5492910742759705, 0.09649884700775146, 0.2521328628063202, -0.0032064211554825306, 0.2776205241...