text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
if($categoryID == $_POST['categorytoremoveValue']) { return $categoryArray; } } } $xmlDoc->save( $myXML ); } ``` Well the above prints me an array of [0]->0 all the time when i slot the return outside the
[ -0.2876985967159271, -0.1432904452085495, 0.6297626495361328, -0.4286280870437622, -0.1869557648897171, 0.02971811220049858, 0.09351734071969986, -0.28861624002456665, -0.1723349541425705, -0.16748036444187164, -0.20868413150310516, 0.4056001305580139, -0.36110228300094604, 0.1080523356795...
if. is there a better way? I've tried using getElementbyId as well but I've no idea how to work that. I would prefer not to use an attribute though if that would make things easier. Ok, let’s try this complete example of use: ``` function CatRemove($myXML, $id) { $xmlDoc = new DOMDocument(); $xmlDoc->load($my...
[ 0.06893184036016464, -0.3870842158794403, 0.5464279055595398, 0.05290418863296509, 0.031019536778330803, -0.13633237779140472, 0.13129620254039764, -0.3375653624534607, -0.05581558495759964, -0.7418466210365295, -0.13653045892715454, 0.5116448402404785, -0.2470930814743042, 0.1938895434141...
data $xml = <<<XML <?xml version="1.0"?> <details> <person>name</person> <data1>some data</data1> <data2>some data</data2> <data3>some data</data3> <category id="0"> <categoryName>Cat 1</categoryName> <categorydata1>some data</categorydata1> </category> <category id="1"> <categoryName>Cat 2</categoryName> ...
[ 0.14371004700660706, -0.11032156646251678, 0.17459307610988617, 0.40112096071243286, -0.0534706674516201, -0.06716391444206238, 0.08646495640277863, -0.571969211101532, -0.06344693154096603, -0.1892716884613037, -0.3396952450275421, 0.1447061151266098, -0.024830738082528114, 0.065316252410...
I need to create a database column which will store a string encrypted using Triple DES. How do I determine the length of the encrypted string column? (Answers for algorithms other than Triple DES are also welcome.) Block-ciphers such as DES, 3DES and AES can only operate on blocks of bytes. DES and 3DES operate on bl...
[ 0.12494814395904541, 0.22299693524837494, 0.40964603424072266, 0.21744313836097717, -0.20772966742515564, 0.1589691936969757, 0.41207078099250793, -0.3103245794773102, -0.04719698056578636, -0.7752390503883362, -0.24777017533779144, 0.2763584554195404, -0.17682617902755737, 0.1184018999338...
has a length divisible with the block-length (8 bytes for 3DES). The value of the padding-bytes is the number of bytes added. Fx. ABCDEF is padded to ABCDEF0505050505 and 0011223344556677 is padded to 0011223344566770808080808080808. Note that this is easy to remove: you just look at the final byte of the padded bytes,...
[ 0.07790888845920563, 0.06924083083868027, 0.5444875359535217, -0.02657909132540226, -0.28007227182388306, 0.1343608796596527, -0.1531524807214737, -0.6439406871795654, -0.35507896542549133, -0.548912525177002, -0.14552156627178192, 0.5206395387649536, -0.018220534548163414, -0.056624926626...
encryption of a string of length n will have length: ``` n + 8 - (n % 8) ```
[ -0.3319757282733917, 0.20088502764701843, 0.18654119968414307, -0.1759529560804367, 0.22780083119869232, -0.025499768555164337, 0.415741503238678, -0.3740798830986023, -0.31176015734672546, -0.05760139971971512, -0.4981836676597595, 0.59739750623703, -0.41649848222732544, -0.00636220630258...
In Visual Studio.NET when coding I constantly use (no selection) CTRL-C, CTRL-V to make a quick copy of a line. Unfortunately this works differently in the XAML editor (it pastes the new line in the middle of the current line). Does anyone know the hotkey to copy a line in XAML? If you map the .xaml extension to the ...
[ 0.599495530128479, -0.004155186470597982, 0.2802383303642273, 0.21576173603534698, -0.09319419413805008, -0.13473305106163025, 0.1594659388065338, 0.022804178297519684, -0.16746588051319122, -0.8344206809997559, 0.008188650012016296, 0.5716143250465393, -0.35620638728141785, -0.01591476798...
For example, if I have a user model and I need to validate login only (which can happen when validating a form via ajax), it would be great if I use the same model validations defined in the User model without actually instantiating a User instance. So in the controller I'd be able to write code like ``` User.valid_a...
[ 0.29843759536743164, -0.13219328224658966, 0.06376903504133224, 0.3229489028453827, -0.17512816190719604, -0.4051576554775238, 0.1869754195213318, -0.18080398440361023, -0.38306909799575806, -0.4841105043888092, 0.3253282904624939, 0.4764300584793091, -0.12031740695238113, 0.17414626479148...
behaviour into a class method: ``` class User < ActiveRecord::Base def self.valid_attribute?(attr, value) mock = self.new(attr => value) unless mock.valid? return mock.errors.has_key?(attr) end true end end ``` Now, you can call ``` User.valid_attribute?(:login, "login value") ``` just ...
[ -0.05761720612645149, -0.15171128511428833, 0.35633277893066406, -0.4412495791912079, -0.15283825993537903, 0.05226229876279831, 0.7016537189483643, -0.33159056305885315, -0.526094913482666, -0.5267205238342285, -0.13561005890369415, 0.6542162895202637, -0.47934290766716003, 0.238194182515...
I've been struggling with this one SQL query requirement today that I was wondering if someone could help me with. I have a table of sports questions. One of the columns is the team related to the question. My requirement is to return a set number of random questions where the teams are unique. So lets say we have th...
[ 0.2220575213432312, 0.32527634501457214, 0.049959857016801834, 0.07761359959840775, -0.15358024835586548, -0.022903399541974068, -0.19504034519195557, -0.21595068275928497, -0.3768411874771118, -0.6932967901229858, 0.023665059357881546, 0.5228699445724487, -0.16328102350234985, -0.22440183...
answer 2 team B question 3 answer 3 team B question 4 answer 3 team D question 5 answer 3 team A question 6 answer 3 team C question 7 answer 3 team F question 8 answer 3 team C question
[ -0.4302932620048523, 0.2107657641172409, 0.032338812947273254, 0.2871251106262207, -0.26675161719322205, 0.35607388615608215, 0.6450774073600769, -0.45082491636276245, -0.3671865165233612, -0.23344208300113678, -0.37442123889923096, -0.04119734838604927, -0.3375643789768219, -0.46564406156...
9 answer 3 team G question 10 answer 3 team D ``` A valid result would return: ``` question 1 answer 1 team A question 2 answer 2 team B question 4 answer 3 team D question 6 answer 3 team C question 7 answer
[ -0.35048073530197144, 0.2036460041999817, 0.018166150897741318, 0.35900548100471497, -0.3546190857887268, 0.38701534271240234, 0.5379658341407776, -0.18991129100322723, -0.2785889506340027, -0.10779937356710434, -0.6283944845199585, 0.04568146541714668, -0.5040009617805481, -0.485377252101...
3 team F ``` I feel that it should be possible to accomplish this as a clean SQL statement with some clever use of Distinct and Take but I haven't been able to get it right yet. Best solution so far is from [Mladen Prajdic](https://stackoverflow.com/users/31345/mladen-prajdic). I have just updated it slightly t...
[ -0.5296955108642578, 0.28437697887420654, 0.30936530232429504, -0.3133384585380554, -0.4728849232196808, -0.09198826551437378, 0.21731777489185333, -0.7583135962486267, -0.2303716242313385, -0.24852846562862396, -0.08593837171792984, 0.43341711163520813, -0.5404899716377258, -0.49092465639...
top 5 * from ( select ROW_NUMBER() over(partition by team order by team) as RN, * from @t ) t where RN = 1 order by NEWID() ```
[ -0.2105681300163269, -0.1195986196398735, 0.3611304759979248, -0.2160535305738449, 0.3214312493801117, 0.08698716759681702, 0.3587188720703125, -0.45322075486183167, -0.412148118019104, -0.5963459610939026, -0.3267539143562317, 0.36639493703842163, 0.034164004027843475, 0.32490667700767517...
Can anyone tell how correct the following code below. Iam tryin to create a stored procedure that returns the rowcount of a table whose name is passed to it. ``` CREATE PROCEDURE spROWCOUNTER ( @tablename nvarchar(20) @rowCountVal int OUTPUT ) AS DECLARE @strQuery nvarchar(300) SET @strQuery = 'SELECT @rowC...
[ -0.2795974314212799, 0.11488333344459534, 0.695805549621582, -0.10653042793273926, -0.1604701280593872, 0.0046168225817382336, 0.2578742206096649, -0.6503691077232361, -0.13028484582901, -0.43928012251853943, 0.22500550746917725, 0.6080469489097595, -0.21254877746105194, 0.0790843144059181...
@rowCountVal int OUTPUT AS SELECT @rowCountVal = ISNULL(SUM(spart.rows), 0) FROM sys.partitions spart WHERE spart.object_id = object_id(@tablename) AND spart.index_id < 2 RETURN @rowCountVal ```
[ -0.5861202478408813, -0.036228783428668976, 0.7780143618583679, -0.539592444896698, 0.004346623085439205, 0.3762319087982178, 0.1008157879114151, -0.3359244763851166, -0.02733708545565605, -0.7767050862312317, 0.07798038423061371, 0.40252530574798584, -0.12711867690086365, 0.17364177107810...
``` public class WrapperTest { static { print(10); } static void print(int x) { System.out.println(x); System.exit(0); } } ``` In the above code `System.exit(0)` is used to stop the program. What argument does that method take? Why do we gave it as `0`. Can anyone explain the ...
[ -0.050789739936590195, -0.03992285206913948, 0.33907049894332886, -0.14027120172977448, 0.2652284801006317, -0.2769804000854492, 0.3671628534793854, -0.09261590987443924, -0.1713239699602127, -0.13885506987571716, -0.5113739967346191, 0.28770533204078674, -0.4958389401435852, 0.56864446401...
additional information.
[ 0.206902876496315, 0.03348809853196144, 0.12259772419929504, 0.37196943163871765, 0.4153101146221161, -0.16802112758159637, 0.1295529007911682, 0.27542248368263245, -0.2131935954093933, -0.47355157136917114, -0.0037204213440418243, -0.11232844740152359, 0.13565421104431152, 0.0130127565935...
When using Delphi IDE, it will silently change SQLConnection.Connected to "true" when populating field or table lists in various properties. Since I don't want to release with Connected = true, I need my dunit test to fail when TSQLConnection.Connected is left true in dfm. I solve this in another way. I wrote a littl...
[ 0.24105198681354523, 0.09749509394168854, 0.485077440738678, 0.10602598637342453, -0.03650258108973503, -0.48922106623649597, 0.35931485891342163, -0.47307172417640686, 0.021723154932260513, -0.4156259596347809, 0.05739524960517883, 0.7305559515953064, -0.26249343156814575, 0.2386004328727...
this utility in your build script (I use FinalBuilder). My script starts by looping on .dfm files, stripping any of these properties, and then it compiles and runs the unit tests. If they pass, then it continutes to build the main application. To me, this is a better way than having a unit test fail, as you can start o...
[ 0.2503232955932617, 0.11507697403430939, 0.4920026659965515, -0.26894715428352356, 0.32239049673080444, -0.013507498428225517, 0.5917482972145081, -0.4853360056877136, 0.058082517236471176, -0.8386566042900085, -0.29518234729766846, 0.7046294808387756, 0.06113651022315025, 0.09783138334751...
if(0 <> Pos('TADOConnection', szLine)) then begin szSeeking := 'Connected'; nState := 1; end else if(0 <> Pos('TADOTable', szLine)) then begin szSeeking := 'Active'; nState := 1;
[ -0.3772115409374237, -0.38791924715042114, 0.6456369161605835, -0.1557304859161377, 0.27522996068000793, -0.13294042646884918, 0.6079649329185486, -0.05285603180527687, -0.1043836772441864, -0.5088798999786377, -0.6623426675796509, 0.06612899899482727, -0.5390341877937317, 0.34246236085891...
end else if(0 <> Pos('TADOQuery', szLine)) then begin szSeeking := 'Active'; nState := 1; end else if(0 <> Pos('TDBISAMTable', szLine)) then begin szSeeking := 'Active';
[ -0.23220385611057281, -0.375167578458786, 0.45631250739097595, -0.19730931520462036, 0.0996665209531784, -0.21539755165576935, 0.6285146474838257, -0.22011961042881012, 0.05604153126478195, -0.412556529045105, -0.5713576078414917, 0.35741299390792847, -0.368283748626709, 0.0332276225090026...
nState := 1; end else if(0 <> Pos('TDBISAMDatabase', szLine)) then begin szSeeking := 'Connected'; nState := 1; end else if(0 <> Pos('TDBISAMSession', szLine)) then begin
[ 0.030963947996497154, -0.5692421793937683, 0.2986920177936554, -0.028602290898561478, -0.003522484330460429, 0.0017251844983547926, 0.6567776799201965, -0.31691351532936096, -0.16737991571426392, -0.6158499717712402, -0.4407498836517334, 0.27739518880844116, -0.46133217215538025, 0.0795967...
szSeeking := 'Active'; nState := 1; end else if(0 <> Pos('TDBISAMQuery', szLine)) then begin szSeeking := 'Active'; nState := 1; end; end; 1 : begin
[ -0.2948705852031708, -0.5267446041107178, 0.5834921598434448, -0.27803725004196167, 0.05713741481304169, -0.08820224553346634, 0.6705085039138794, -0.21471305191516876, -0.12694396078586578, -0.5565053820610046, -0.54982590675354, 0.2530188262462616, -0.30814453959465027, 0.013501444831490...
bFound := True; if(0 <> Pos('end', szLine)) then begin nState := 0; end else if(0 <> Pos(szSeeking, szLine)) then begin nPos := Pos('=', szLine); if nPos > 0 then
[ -0.1652815043926239, -0.16850611567497253, 0.4639159142971039, -0.36826956272125244, 0.32379114627838135, 0.233294278383255, 0.4852294921875, -0.3235131502151489, -0.11079002171754837, -0.2901180386543274, -0.4830532371997833, 0.30917873978614807, -0.3693937659263611, -0.375876784324646, ...
begin memoFile.Lines[nFileLoop] := Copy(szLine, 1, nPos) + ' False'; end; end; end; end; // case end; ```
[ -0.006198759190738201, 0.04322437569499016, 0.36789435148239136, -0.042954202741384506, 0.2578411400318146, 0.23204605281352997, 0.508919894695282, -0.207071453332901, -0.014961089007556438, -0.5951018333435059, -0.5879526734352112, 0.27056318521499634, -0.4438524842262268, 0.2950501143932...
I can implement the error function, erf, myself, but I'd prefer not to. Is there a python package with no external dependencies that contains an implementation of this function? I have found [this](http://pylab.sourceforge.net/packages/included_functions.html) but this seems to be part of some much larger package (and ...
[ 0.0468059666454792, 0.23030219972133636, 0.18519222736358643, -0.21959397196769714, -0.07873376458883286, 0.03523179888725281, 0.4901127815246582, -0.17467473447322845, -0.20963819324970245, -0.4016304314136505, -0.02552112750709057, 0.8751450777053833, -0.34173864126205444, -0.14770175516...
Is there really not a TSpinEdit control for floats in Delphi? It looks like there are [third party components](http://www.tmssoftware.com/site/advspin.asp) that supply a control that will work. How do you implement TSpinEdit for floats? I've been creating my own with a TEDit field and a TSpinButton positioned right be...
[ 0.6204686164855957, -0.3313596844673157, 0.42755448818206787, 0.258535772562027, -0.45688968896865845, -0.353572279214859, -0.11875957995653152, -0.26550614833831787, 0.06708522140979767, -0.41670867800712585, 0.2666042745113373, 0.3489076495170593, -0.4925648272037506, -0.2056598514318466...
How can I generate hash value for a byte array, in J2ME? It doesn't have to be very very secure but it should be fast. As suggested by Josh Bloch in his Effective Java book: ``` public int hashCode() { int result = 17; for (int i = 0; i < array.length; i++) { result = 31*result + (int)array[i]; } re...
[ -0.02849986031651497, -0.045184362679719925, 0.058879103511571884, -0.30066239833831787, -0.04586806148290634, -0.1646069586277008, 0.3671841621398926, -0.6670622825622559, -0.04578531160950661, -0.5687620639801025, -0.0985320508480072, 0.4434814453125, -0.22088119387626648, -0.07379312813...
On more than one occasion I've been asked to implement rules for password selection for software I'm developing. Typical suggestions include things like: * Passwords must be at least *N* characters long; * Passwords must include lowercase, uppercase and numbers; * No reuse of the last *M* passwords (or passwords used ...
[ 0.5004966259002686, 0.021879753097891808, -0.08413195610046387, 0.09000915288925171, 0.20336660742759705, -0.09288482367992401, 0.1814831644296646, 0.19935302436351776, -0.3321434557437897, -0.6236153244972229, -0.18811891973018646, 0.4251611530780792, -0.1737714558839798, 0.28703257441520...
down increases, also reducing security. **Is there any quantitative evidence that password restriction rules make systems more secure?** **If there is, what are the 'most secure' password restriction strategies to use?** --- **Edit** Ólafur Waage has kindly pointed out a [Coding Horror article on dictionary attacks...
[ 0.16150560975074768, 0.1997235119342804, 0.2143840193748474, 0.15664951503276825, -0.17276103794574738, -0.1054079681634903, 0.331198126077652, -0.11010999232530594, -0.6992223262786865, -0.5680741667747498, -0.13992774486541748, 0.3873569071292877, -0.1089477464556694, -0.0217911265790462...
though - by restricting the available > passwords, you reduce the size of the > space of all allowable passwords. > Doesn't this make passwords easier to > guess? In theory, yes. In practice, the "weak" passwords you disallow represent a tiny subset of all possible passwords that is disproportionately often chosen...
[ -0.05122349411249161, 0.05440869182348251, 0.2701007127761841, 0.23515698313713074, 0.05559031665325165, -0.1444273144006729, 0.42645263671875, -0.05872827768325806, -0.2829117178916931, -0.7462911009788513, -0.27813777327537537, 0.5815216898918152, -0.23650136590003967, 0.1390914618968963...
perhaps in extreme high-security environments where everyone really understands the need for security.
[ 0.27901822328567505, -0.11423051357269287, -0.1618788093328476, 0.2129991501569748, 0.3503870666027069, -0.08287390321493149, 0.365830659866333, 0.019053900614380836, -0.19071649014949799, -0.1734650880098343, -0.27587831020355225, 0.2554559111595154, 0.1080641895532608, -0.166484922170639...
Is it bad practice to have a string like "name=Gina;postion= HouseMatriarch;id=1234" to hold state data in an application.I know that I could just as well have a struct , class or hashtable to hold this info. Is it acceptable practice to hold delimited key/value pairs in a database field– just for use in where the d...
[ 0.2556597590446472, 0.09724842756986618, -0.13841624557971954, 0.2064909040927887, 0.15185867249965668, -0.24784637987613678, 0.07259224355220795, -0.1387825459241867, -0.2997974455356598, -0.23473352193832397, -0.16477368772029877, 0.021124664694070816, -0.45491674542427063, 0.29320570826...
is hard to access, validate and process the data in a string. It will take you much more time to write the code to parse your string to get at your data than just using the language structures of C#. I would also advise against storing key/value pairs in database fields if the other option is just adding columns for t...
[ 0.2592683732509613, 0.2409370094537735, 0.0839850902557373, 0.20493043959140778, 0.028307387605309486, -0.12728901207447052, 0.2646324932575226, -0.20724402368068695, -0.18061938881874084, -0.3842083513736725, 0.027426335960626602, 0.49920520186424255, -0.46253877878189087, 0.0657340735197...
have to hold? Or perhaps you should elaborate on the context of the application to make the intent clearer. It is not all black and white :-)
[ 0.7213413715362549, 0.23775701224803925, 0.25335144996643066, -0.08659838140010834, 0.6439284086227417, -0.1475679725408554, 0.03410140052437782, -0.43828392028808594, -0.29399746656417847, 0.19786953926086426, -0.31498774886131287, 0.3370933532714844, -0.6546326279640198, 0.27788588404655...
I am using C# to write a method that returns the following information about a table: column names, column types, column sizes, foreign keys. Can someone point me in the right direction on how to accomplish this ? To get the FK and Schema you should be able to use: ``` DA.FillSchema() DS.Table("Name").PrimaryKey ...
[ -0.09102509170770645, 0.35575202107429504, 0.6942849159240723, -0.2180282175540924, -0.08681094646453857, 0.11152855306863785, 0.27683761715888977, -0.3874014616012573, -0.4126848578453064, -0.5794329643249512, 0.04732849821448326, 0.3525089621543884, -0.1353687047958374, 0.182485327124595...
String>(); string connectionString = "Integrated Security=SSPI;" + "Persist Security Info = False;Initial Catalog=Northwind;" + "Data Source = localhost"; SqlConnection connection = new SqlConnection(); connection.ConnectionString = connectionString; connecti...
[ -0.40932294726371765, -0.3352275788784027, 0.653235673904419, -0.17996077239513397, 0.14786608517169952, -0.13183948397636414, 0.3340218961238861, -0.25027698278427124, -0.3208087682723999, -0.5303330421447754, -0.5139207243919373, 0.28022292256355286, -0.3589284121990204, 0.40545248985290...
command.Connection = connection; command.CommandText = "exec sp_tables"; command.CommandType = CommandType.Text; SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read())
[ -0.32565927505493164, -0.20936422049999237, 0.5816811919212341, -0.23431909084320068, 0.13909703493118286, -0.01876530423760414, 0.3036819398403168, -0.295073002576828, -0.2430409938097, -0.4178299903869629, -0.304463654756546, 0.5253763794898987, -0.31701672077178955, 0.28771400451660156,...
tablesList.Add(reader["TABLE_NAME"].ToString()); } reader.Close(); command.CommandText = "exec sp_columns @table_name = '" + tablesList[0] + "'"; command.CommandType = CommandType.Text; reader = command.ExecuteReader(); if (reader.HasRows)
[ -0.5675742030143738, -0.11046948283910751, 0.8166725635528564, -0.4557884931564331, 0.07085339725017548, 0.1010839194059372, 0.2731689512729645, -0.5268598794937134, -0.3192313015460968, -0.5611934065818787, -0.4854884743690491, 0.4457349181175232, -0.31852415204048157, 0.04290570691227913...
{ while (reader.Read()) columnsDictionary.Add(reader["COLUMN_NAME"].ToString(), reader["TYPE_NAME"].ToString()); } } ```
[ -0.3596394956111908, 0.2214530110359192, 0.6808478236198425, -0.39701226353645325, 0.25280123949050903, 0.05504302307963371, 0.21375349164009094, -0.07358839362859726, -0.16918271780014038, -0.43255525827407837, -0.4072745740413666, 0.6400060057640076, -0.47969868779182434, 0.1099667400121...
Can anyone point into the right direction here. I want to respond when my application receives memory warning, (i want to know how to respond to this notification). Plus, How much memory can i wire with my application? Any articles or book reference would be great. Thanks. If your app gets a memory warning (such as in...
[ 0.2991134822368622, 0.0547434538602829, 0.08899533003568649, 0.2554689049720764, 0.036893680691719055, -0.08608582615852356, 0.36117351055145264, 0.3362066447734833, -0.5424359440803528, -0.49669721722602844, -0.0640222355723381, 0.5829898715019226, 0.08471355587244034, 0.19255118072032928...
not actively using that array, you should release it. Then, regenerate it when you need it again. A little more information is here: [Observing Low-Memory Warnings](http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/ApplicationEnvironment/chapter_3_section_5.html#//apple...
[ 0.17305350303649902, -0.07638473808765411, 0.09847613424062729, -0.10838411003351212, 0.16212305426597595, -0.28581681847572327, 0.47471174597740173, 0.07419059425592422, -0.49045610427856445, -0.2801991403102875, -0.27823004126548767, 0.5457824468612671, -0.43833616375923157, -0.230977326...
I was playing around with Boost.Regex to parse strings for words and numbers. This is what I have so far: ``` #include <iostream> #include <string> #include <boost/foreach.hpp> #include <boost/regex.hpp> #include <boost/range.hpp> using namespace std; using namespace boost; int main() { regex re ( "(...
[ 0.012159431353211403, 0.19516871869564056, 0.6744547486305237, -0.42833155393600464, 0.0246441587805748, 0.299571692943573, 0.565742552280426, -0.31499236822128296, -0.15510398149490356, -0.1654788702726364, -0.11369656771421432, 0.7954680919647217, -0.3850598931312561, -0.1565563082695007...
3323 parse."; sregex_iterator m1(s.begin(), s.end(), re), m2; BOOST_FOREACH (const match_results<string::const_iterator>& what, make_iterator_range(m1, m2)) { cout << ":" << what[1].str() << ":" << what.position(1) << ":" << what.length(1) << endl; } return 0; } ``` Is there a way to tell re...
[ -0.47429358959198, -0.0946429967880249, 0.4479117691516876, -0.18073618412017822, 0.03132399544119835, 0.12107180058956146, 0.5991883277893066, -0.6445192098617554, 0.03930174186825752, -0.2724415361881256, -0.17671406269073486, 0.560631513595581, -0.36051541566848755, -0.28661197423934937...
"cheat" in that it simply loads the whole stream into a buffer and then calls Boost.Regex on that buffer. Making a regex search on a stream's contents without having to entirely load it in memory can be done with the "[partial match](http://www.boost.org/doc/libs/1_55_0/libs/regex/doc/html/boost_regex/partial_matches....
[ -0.0905887559056282, -0.12258218973875046, 0.13854701817035675, 0.056466687470674515, 0.1664193570613861, -0.08341416716575623, 0.19468124210834503, 0.08756870031356812, 0.13608582317829132, -0.309566468000412, -0.18011736869812012, 0.795087456703186, -0.3572273552417755, -0.19523599743843...
I wonder if anyone else is facing the same issue. I have a UITextView field placed in a UITableViewCell. Sometimes it does not displays the text. When i click or scroll the table view, it appears. Any guesses? --- Details: I call a method in *viewDidLoad* method that calls a web service to retrieve some data. On rec...
[ 0.2600152790546417, -0.03780398145318031, 0.7599935531616211, 0.11600536853075027, -0.2696027457714081, -0.10692375898361206, 0.16302961111068726, -0.11592555791139603, -0.10739926993846893, -0.8704373240470886, -0.11655396223068237, 0.4967230260372162, -0.002141296397894621, 0.22983704507...
in *UITableViewCell*. I call *[tableView reloadData]* right after setting values in *UILabel* and *UITextView*, but i do not re-create the *UITableViewCell*. Thanks for your reply and pointers. I solved this by calling `[myTableView reloadData];`
[ 0.24409614503383636, 0.00525464816018939, 0.7468974590301514, 0.08125530928373337, -0.4380585253238678, -0.1874997913837433, 0.3123408854007721, 0.06104537844657898, -0.147920623421669, -0.8968431353569031, -0.2683848738670349, 0.4263871908187866, -0.1884443759918213, 0.23197753727436066, ...
I'm doing some real quick and dirty benchmarking on a single line of C# code using DateTime: ``` long lStart = DateTime.Now.Ticks; // do something long lFinish = DateTime.Now.Ticks; ``` The problem is in the results: ``` Start Time [633679466564559902] Finish Time [633679466564559902] Start Time [6336794665645699...
[ 0.10863300412893295, -0.02488783374428749, 0.5466892719268799, -0.0645642876625061, 0.037945084273815155, 0.08062876760959625, 0.3852892220020294, -0.09802762418985367, -0.4192144572734833, -0.6084772348403931, 0.19055193662643433, 0.7070080637931824, 0.07804332673549652, 0.008418098092079...
clear. EDIT: As previously suggested, it is also advisable to run your code a number of times in order to get a reasonable average time.
[ 0.5044125914573669, -0.10989698022603989, 0.37907639145851135, -0.015944957733154297, 0.15947069227695465, -0.45084694027900696, 0.32624197006225586, -0.0467868335545063, -0.176489919424057, -0.548617422580719, -0.2969528138637543, 0.5805345177650452, -0.2108498364686966, -0.29819953441619...
My onclick function works beautifully when i pass one variable and doesn't respond once i try to pass two variables. is something wrong with my syntax? everything supporting this code has been tested and works fine so i'm certain something is wrong with the syntax the onclick line of code. any help would be awesome. ...
[ -0.38278302550315857, -0.003874684451147914, 1.14903724193573, 0.022044898942112923, 0.18272480368614197, 0.030460264533758163, 0.3114742636680603, -0.27756041288375854, 0.08625379949808121, -0.672084391117096, -0.26241111755371094, 0.7774980664253235, -0.44573646783828735, 0.0383727848529...
ATTACHMENTS = Replace(LTRIM(RTRIM(ATTACHMENTS)), '"& StoredPath & "' ,'') WHERE EMAIL_LETTERS_HOLD_ID= "& AttID & " ") objConn.Close Set objConn = Nothing response.redirect RedirectURL %> ``` > onclick=""deleteRecordAtt(" & AttID &","& StoredPath & " )"" Concatenating strings without escaping - never a good idea. Pr...
[ -0.19389280676841736, 0.1446637511253357, 0.7811844944953918, -0.19538410007953644, -0.07806780189275742, -0.08488301932811737, 0.5876439809799194, -0.32045188546180725, -0.20805561542510986, -0.8221846222877502, -0.2852679491043091, 0.5666828751564026, -0.43953269720077515, 0.011847196146...
errors turned on in your browser so you can see when something like this goes wrong, instead of it just silently failing. The naive solution is to add wrapping quotes: ``` onclick=""deleteRecordAtt(" & AttID &", '"& StoredPath & "' )"" ``` which results in: ``` onclick="deleteRecordAtt(123, 'file.gif')" ``` whic...
[ 0.2329050600528717, 0.26705271005630493, 0.27766379714012146, 0.1401776224374771, 0.18905028700828552, 0.16347162425518036, 0.6155667901039124, 0.006669201422482729, 0.012700293213129044, -0.4957630932331085, 0.04260125383734703, 0.7661903500556946, -0.4866562485694885, 0.0424211286008358,...
character escapes. A simple version would start with something like (untested, I am not a VBScript coder): ``` <% jsLiteral= Replace(StoredPath, "\", "\x5C") jsLiteral= Replace(jsLiteral, "'", "\x27") jsLiteral= "'" & jsLiteral & "'" %> <input ... onclick="deleteRecordAtt(<%= AttID %>, <%= Server.HTMLEncod...
[ -0.32489049434661865, -0.20158787071704865, 0.46272197365760803, 0.10277296602725983, 0.06261739134788513, 0.18194997310638428, 0.673712432384491, -0.482317179441452, -0.018007952719926834, -0.38961243629455566, -0.38955551385879517, 0.3766235113143921, -0.7716973423957825, 0.0493139810860...
attacker said something like: ``` StoredPath=', ''));DROP TABLE EMAIL_SEND_ATTACHMENTS;-- ``` then whoops, goodbye database! More likely is that you'll get hit by one of the many automated SQL injection attacks currently spreading Russian malware around the web. Escape your SQL string literals or, better, use param...
[ -0.37659990787506104, 0.17297685146331787, 0.4465291202068329, -0.0847359374165535, 0.06197816878557205, -0.016324756667017937, 0.6346698999404907, -0.23908255994319916, -0.1321793496608734, -0.6914418339729309, -0.548850953578949, 0.47221916913986206, -0.4179428517818451, 0.04475348070263...
is actually a different object to document.location, and is the correct one to use if you wish to move the browser to a new page. Writing to document.location is not supposed to work, although it might still do on some browsers sometimes if you are lucky.
[ 0.2310619056224823, -0.15302594006061554, 0.3680122196674347, 0.3137972950935364, 0.18342173099517822, -0.22373448312282562, 0.3614301085472107, 0.22492653131484985, -0.3846449553966522, -0.6847018003463745, -0.2224537432193756, 0.2179606407880783, -0.10672787576913834, -0.1678978800773620...
I have a generic class in my project with derived classes. ``` public class GenericClass<T> : GenericInterface<T> { } public class Test : GenericClass<SomeType> { } ``` Is there any way to find out if a `Type` object is derived from `GenericClass`? ``` t.IsSubclassOf(typeof(GenericClass<>)) ``` does not work. Tr...
[ -0.06164915859699249, -0.07724590599536896, 0.29691949486732483, -0.1077900230884552, -0.16326099634170532, -0.05085808038711548, 0.5967769622802734, -0.31536275148391724, 0.05294705554842949, -0.48691514134407043, -0.005310222040861845, 0.3984588384628296, -0.4282688796520233, 0.403993993...
} toCheck = toCheck.BaseType; } return false; } ```
[ 0.10238008946180344, 0.1376199871301651, -0.19981160759925842, -0.3430284857749939, 0.2607855200767517, -0.2566082179546356, 0.5587512850761414, -0.22670504450798035, 0.14990146458148956, -0.20257309079170227, -0.3377716839313507, 0.7034338116645813, -0.44127169251441956, 0.266775608062744...
Is there a parser/library which is able to read an HTML document into a DOM tree using Java? I'd like to use the standard `DOM/Xpath` API that Java provides. Most libraries seem have custom API's to solve this task. Furthermore the conversion HTML to XML-DOM seems unsupported by the most of the available parsers. Any...
[ 0.2506662905216217, 0.007881452329456806, -0.007703229319304228, 0.10521632432937622, -0.16381138563156128, -0.06413150578737259, 0.21214033663272858, -0.06057332828640938, -0.2301056683063507, -0.5925297141075134, -0.07657158374786377, 0.6904752850532532, -0.2553562521934509, -0.225313156...
I've got data in SQL Server 2005 that contains HTML tags and I'd like to strip all that out, leaving just the text between the tags. Ideally also replacing things like `&lt;` with `<`, etc. Is there an easy way to do this or has someone already got some sample T-SQL code? I don't have the ability to add extended stor...
[ 0.014033921994268894, 0.21900251507759094, 0.28146082162857056, -0.18558655679225922, -0.3078944981098175, -0.2182103842496872, 0.22144199907779694, -0.0850939005613327, -0.07986892014741898, -0.35695746541023254, 0.06165052577853203, 0.590904712677002, -0.30527836084365845, -0.11723598837...
to make for easy reuse. So for example converting this: ``` <B>Some useful text</B>&nbsp; <A onclick="return openInfo(this)" href="http://there.com/3ce984e88d0531bac5349" target=globalhelp> <IMG title="Source Description" height=15 alt="Source Description" src="/ri/new_info.gif" width=15 align=top b...
[ 0.16686555743217468, -0.0774703249335289, 0.9624468088150024, -0.09798327833414078, -0.2721495032310486, -0.27776068449020386, -0.010440961457788944, -0.5063360929489136, -0.37235602736473083, -0.5901198983192444, -0.35637471079826355, 0.3260253667831421, -0.323959082365036, 0.046714797616...
SET @Length = (@End - @Start) + 1 WHILE @Start > 0 AND @End > 0 AND @Length > 0 BEGIN SET @HTMLText = STUFF(@HTMLText,@Start,@Length,'') SET @Start = CHARINDEX('<',@HTMLText) SET @End = CHARINDEX('>',@HTMLText,CHARINDEX('<',@HTMLText)) SET @Length = (@End - @Start) + 1 END ...
[ 0.12921717762947083, -0.3319234848022461, 1.1147511005401611, -0.18747973442077637, -0.06976421922445297, -0.4289650619029999, 0.3495608866214752, -0.8099719882011414, -0.15270556509494781, -0.4179019629955292, -0.27894076704978943, 0.651201069355011, -0.2410004436969757, -0.28415706753730...
to something like 4000, it will work in SQL Server 2000 as well.
[ 0.04028112441301346, -0.058947037905454636, 0.5884861350059509, 0.25195199251174927, 0.16897763311862946, -0.43311911821365356, 0.08444780111312866, -0.20162774622440338, -0.08081860095262527, -0.5978721976280212, -0.021773576736450195, 0.3283407688140869, 0.08414812386035919, -0.079645395...
I am developing a c# GUI and was wondering if there were any (preferably free) runtime diagnostic programs available. What Im looking for is a way to monitor user interactions with my GUI and what functions are called when. Preferably I do not want to add stacks of debug code as this has the potential to change the b...
[ 0.7086663246154785, -0.06735303997993469, 0.04146210104227066, 0.108869768679142, -0.35578158497810364, -0.3460599482059479, 0.2740212082862854, 0.08358155190944672, 0.14288663864135742, -0.6540979146957397, 0.15046162903308868, 0.7076610922813416, -0.3689364194869995, -0.09492317587137222...
Compact Framework but since 2.00 is now geared more towards Desktop too.
[ -0.3617272675037384, -0.08453964442014694, 0.7100114822387695, 0.006582322064787149, -0.23136897385120392, -0.356407105922699, 0.0925128161907196, -0.14022058248519897, -0.073854960501194, -0.9980323910713196, -0.1844557821750641, 0.356845885515213, -0.1921522319316864, 0.09979468584060669...
i'd like to prevent bots from hacking weak password-protected accounts. (e.g. this happend to ebay and other big sites) So i'll set a (mem-) cached value with the ip, amount of tries and timestamp of last try (memcache-fall-out). But what about bots trying to open any account with just one password. For example, the ...
[ 0.2593773305416107, 0.2776848375797272, 0.2840251624584198, 0.1568349450826645, -0.10366565734148026, 0.0349612794816494, 0.4228028655052185, 0.1741100698709488, -0.38400933146476746, -0.7158480286598206, 0.03970322012901306, 0.5418885946273804, -0.050675179809331894, 0.1762450784444809, ...
49 tries to reset the lock. Is there any way to do it right? What do big platforms do about this? What can i do to prevent idiots from blocking all users on a proxy with retrying 50 times? If there is no best practice - does this mean any platform is brute-forceable? At least with a hint on when counters are resette...
[ 0.2670460045337677, -0.0025687438901513815, 0.4003843069076538, 0.35164931416511536, 0.025312447920441628, 0.0241618100553751, 0.6931767463684082, -0.6255370378494263, -0.3489549160003662, -0.5266954898834229, 0.07075387239456177, 0.4822445809841156, -0.14409960806369781, -0.13932316005229...
How can I access Class object for Generics? Currently, I am doing it this way: ``` List<String> list= new ArrayList<String>(); list.getClass(); ``` Is this OK? Or, what should be the way? That will return the same as ArrayList.class. Java generics erase the generic type at runtime; in other words, from "list" you'l...
[ 0.09624417871236801, 0.11510629951953888, 0.360749214887619, -0.13175030052661896, -0.2710745334625244, -0.14463336765766144, 0.6756259799003601, -0.047629985958337784, -0.3319203853607178, -0.5864312648773193, 0.16024582087993622, 0.40652143955230713, -0.4219786524772644, 0.39526611566543...
What's the best way to discover a file's filetype within php? I heard that the browser may be tricked, so what's a better way of doing this? You can use [finfo\_file](http://www.php.net/manual/en/function.finfo-file.php) ``` <?php echo finfo_file(finfo_open(FILEINFO_MIME), "foo.png"); ?> ```
[ 0.36387526988983154, 0.188741073012352, 0.31567129492759705, -0.22224560379981995, 0.2144441157579422, -0.1353127360343933, 0.29640060663223267, -0.20489831268787384, -0.36063456535339355, -0.23305131494998932, -0.09296080470085144, 0.408637136220932, -0.4927505850791931, 0.009482990019023...
There is a data file and some image files that I have to download to our local servers every night using asp.net. What is the best way to do this? UPDATE Ok, after viewing the responses I see my initial post of using asp.net is a poor choice. How would you write it for a console app in C#. I am not sure what classes ...
[ 0.3070545792579651, -0.13051913678646088, 0.5555707216262817, 0.42028090357780457, -0.0940004214644432, 0.032467372715473175, 0.17679904401302338, 0.14322078227996826, -0.22381208837032318, -0.9199959635734558, 0.08370116353034973, 0.5947859883308411, -0.07914416491985321, 0.03597607091069...
class Program { public static void Main(string[] args) { using (WebClient wc = new WebClient()) { wc.DownloadFile("http://www.mydomain.com/resource.img", "c:\\savedImage.img"); } } } } ```
[ 0.15247420966625214, -0.2183723896741867, 0.44525036215782166, 0.045498378574848175, 0.19349560141563416, -0.15649287402629852, 0.20083805918693542, 0.2301778942346573, -0.2402281016111374, -0.5226085782051086, -0.3775835335254669, 0.5643464922904968, -0.5204854607582092, 0.636458754539489...
How do you check the windows version in Win32 at runtime? Use the [`GetVersionEx()`](http://msdn.microsoft.com/en-us/library/ms724451(VS.85).aspx) or [`VerifyVersionInfo()`](http://msdn.microsoft.com/en-us/library/ms725492(VS.85).aspx) functions.
[ 0.292677640914917, -0.047493867576122284, 0.168691024184227, 0.15933692455291748, 0.15266166627407074, -0.5195764899253845, 0.35624006390571594, 0.09670089185237885, 0.04839276894927025, -0.5095846056938171, -0.17686787247657776, 0.7396001815795898, -0.1521500051021576, -0.3458239436149597...
Why is it impossible to have a reference to void? The only thing I found in the C++ Standard is this line, at **8.3.2.1** > A declarator that specifies the type "reference to *cv* void" is ill-formed. Why is it that way? Why can't I write a "generic" function that accept a `void&`? Just to be clear, I have no usefu...
[ 0.4907509982585907, 0.30890366435050964, 0.12813200056552887, -0.07390253990888596, -0.015034567564725876, -0.3359481394290924, 0.4121388792991638, 0.18940800428390503, -0.2937135696411133, -0.1154344379901886, -0.16517148911952972, 0.7165799736976624, -0.41967350244522095, 0.2851178348064...
a pointer-to-void. However, I could cast it to a reference-to-*sometype* in order to use it, couldn't I? In fact, I don't see why the following snippet can work... ``` void foo(void *data) { int *i = reinterpret_cast<int*>(data); // do something with i } ``` ...while this one cannot: ``` void foo(void &data...
[ 0.19924615323543549, 0.1377403736114502, 0.20715831220149994, 0.032294098287820816, 0.009729336947202682, 0.11259524524211884, 0.2995520532131195, -0.013534216210246086, -0.1983584612607956, -0.3325715661048889, 0.0009405369637534022, 0.455819696187973, -0.6006544232368469, 0.2817659974098...
operation on it, except taking its address (and not its size). "void" has two uses: to disclaim any knowledge of type (as in void \*), and to specify nothing as opposed to something (void function return). In neither case is it possible to say anything about a void something except that it may have an address. If you...
[ 0.17183583974838257, 0.06653451174497604, 0.043520864099264145, -0.16884344816207886, 0.08398355543613434, -0.23241761326789856, 0.20172449946403503, 0.2578352689743042, -0.07688461989164352, -0.14350378513336182, -0.48420482873916626, 0.4600570797920227, -0.2573809027671814, 0.12326311320...
I've been using Git now for a couple of months on a project with one other developer. I have several years of experience with [SVN](http://en.wikipedia.org/wiki/Apache_Subversion), so I guess I bring a lot of baggage to the relationship. I have heard that Git is excellent for branching and merging, and so far, I just ...
[ 0.43457934260368347, 0.06190715357661247, -0.1756797581911087, 0.013924716040492058, -0.08432279527187347, -0.3465366065502167, 0.3657935559749603, 0.4586576819419861, -0.0969940796494484, -0.6367791295051575, 0.27894771099090576, 0.2828151285648346, -0.1458924114704132, 0.4383265078067779...
from my desire to merge willy-nilly, and that I should be using rebase instead of merge in many situations. For example, here's the workflow that he's laid down: ``` clone the remote repository git checkout -b my_new_feature ..work and commit some stuff git rebase master ..work and commit some stuff git rebase master ...
[ 0.5318122506141663, -0.05433664843440056, 0.32543307542800903, -0.23104508221149445, 0.15622568130493164, 0.25191229581832886, 0.04488416761159897, -0.2947545349597931, -0.23977917432785034, -0.834346354007721, -0.1313839852809906, 0.48106274008750916, -0.13432927429676056, 0.4280533194541...
commit, push to origin/my_new_feature git merge master (to get some changes that my partner added) ..work, commit, push to origin/my_new_feature git merge master ..finish my_new_feature, push to origin/my_new_feature git checkout master git merge my_new_feature delete remote branch delete local branch ``` There are t...
[ 0.5574551224708557, -0.031107429414987564, 0.40760454535484314, -0.24286873638629913, 0.26378196477890015, 0.18283741176128387, 0.03694000840187073, -0.3583424687385559, -0.052088357508182526, -0.8515364527702332, -0.18796731531620026, 0.7388573884963989, -0.09592396020889282, 0.4072061181...
hate to have code on my laptop that's not mirrored somewhere else. My reasoning for the merge instead of rebase is that merge seems to be standard and rebase seems to be an advanced feature. My gut feeling is that what I'm trying to do is not an advanced setup, so rebase should be unnecessary. I've even perused the ne...
[ 0.4750109612941742, 0.28239160776138306, -0.23694436252117157, -0.0878816694021225, 0.028030261397361755, -0.23767931759357452, 0.4460050165653229, 0.09121005237102509, -0.05334397777915001, -0.8491794466972351, 0.028770923614501953, 0.6089595556259155, -0.33436042070388794, 0.398958981037...
of conflicts with things that should have not mattered. The conflicts just made no sense to me. It took me a day to sort everything out, and eventually culminated in a forced push to the remote master, since my local master has all conflicts resolved, but the remote one still wasn't happy. What is the "correct" workfl...
[ 0.1301758587360382, -0.15218117833137512, 0.47753778100013733, 0.2242286652326584, 0.1386132836341858, -0.10833685845136642, 0.39062970876693726, -0.1213119775056839, -0.45125776529312134, -0.36482399702072144, -0.00012226308172103018, 0.485964298248291, -0.039274588227272034, 0.2231312692...
the original workflow is correct, at least in our case. In other words, this is what we do and it works: ``` clone the remote repository git checkout -b my_new_feature ..work and commit some stuff git rebase master ..work and commit some stuff git rebase master ..finish the feature, commit git rebase master git checko...
[ 0.47166988253593445, 0.13559652864933014, 0.16847969591617584, -0.09388917684555054, 0.1861695796251297, -0.04325707256793976, 0.16493463516235352, -0.27968963980674744, -0.0685308426618576, -0.794573962688446, -0.2133239060640335, 0.5828149914741516, -0.28003475069999695, 0.36727482080459...
commits on master, even if they're a little messy on our branches. So, this is what we do: ``` clone the remote repository git checkout -b my_new_feature ..work and commit some stuff git rebase master ..work and commit some stuff git rebase master ..finish the feature, commit git rebase master git checkout master git ...
[ 0.5906689763069153, 0.18052701652050018, 0.23368428647518158, -0.10134129971265793, 0.16933956742286682, -0.11287965625524521, 0.1836978942155838, -0.32037320733070374, -0.33499792218208313, -0.8069716691970825, -0.2426428496837616, 0.5323782563209534, -0.2658911645412445, 0.37708303332328...
a single package. For larger features, it's probably not a great idea, especially if your individual commits are already atomic. It really comes down to personal preference. **Github and Bitbucket (others?) Pull Requests** - In case you're wondering how merge/rebase relates to Pull Requests, I recommend following all ...
[ 0.38985854387283325, -0.28829070925712585, 0.3262973427772522, 0.17694783210754395, -0.14893066883087158, -0.10236357152462006, 0.16142185032367706, -0.10218650102615356, -0.4601960778236389, -0.5995253324508667, -0.2607523202896118, 0.25425755977630615, -0.2632858455181122, 0.191997945308...
I know). Specifically, it works like this: ``` clone the remote repository git checkout -b my_new_feature ..work and commit some stuff git rebase master ..work and commit some stuff git rebase master ..finish the feature, commit git rebase master git push # May need to force push ...submit PR, wait for a review, make ...
[ 0.6217607259750366, 0.12352417409420013, 0.5690544247627258, -0.24707379937171936, 0.18376339972019196, -0.009419260546565056, 0.17176730930805206, -0.021149782463908195, 0.0612788200378418, -0.8195679187774658, -0.14689308404922485, 0.5275311470031738, -0.05802798271179199, 0.555101394653...
struggling, just stick with it and eventually you'll see the light at the end of the tunnel. "Conflicts" mean "parallel evolutions of a same content". So if it goes "all to hell" during a merge, it means you have massive evolutions on the same set of files. The reason why a rebase is then better than a merge is that: ...
[ 0.04000883549451828, -0.1766703575849533, 0.17358185350894928, 0.26805412769317627, 0.13280035555362701, 0.013507951982319355, 0.4086977243423462, -0.19765284657478333, -0.43595418334007263, -0.731800377368927, -0.270089328289032, 0.4395149052143097, -0.12110533565282822, 0.339446932077407...
plus only your changes to reapply. I confirm that the correct workflow in that case (evolutions on common set of files) is **rebase first, then merge**. However, that means that, if you push your local branch (for backup reason), that branch should not be pulled (or at least used) by anyone else (since the commit his...
[ 0.5397987365722656, -0.36623215675354004, 0.8263305425643921, -0.04596547409892082, 0.03425340726971626, 0.12396866083145142, -0.01582660712301731, -0.2901018559932709, -0.7835157513618469, -0.49605876207351685, -0.27247869968414307, 0.8020955324172974, -0.30167266726493835, 0.168048143386...
public branch like a patch that is up-to-date with current `HEAD`. (a similar technique [exists for bazaar](http://fourkitchens.com/blog/2009/04/20/alternatives-rebasing-bazaar)) * [**Avoiding Git Disasters: A Gory Story**](https://randyfay.com/content/avoiding-git-disasters-gory-story): about the dangers of `git pus...
[ 0.1371680349111557, -0.4767337143421173, -0.06091716140508652, 0.23859147727489471, -0.07963220030069351, -0.12917664647102356, 0.5717788934707642, 0.46275103092193604, -0.5361599326133728, -0.1946665495634079, -0.3736504018306732, 0.037421390414237976, -0.2664317786693573, 0.1529707461595...
I´m in need to pass some results from the database around. Instead of pass a whole dataset, or a constructed sql query, I tried to pass a LinqDataSource configured object. On the source page, I configure the LinqDataSource object properties **Where** and **WhereParameters** using the values set by the user on the cont...
[ -0.11832394450902939, -0.08366535604000092, 0.42753514647483826, 0.27146831154823303, -0.031641628593206406, -0.17334136366844177, 0.43649280071258545, -0.15940746665000916, -0.05706021934747696, -0.7537097334861755, 0.04577573388814926, 0.3691021800041199, -0.2906441390514374, 0.269522577...
a disposed object. > > > Object name: 'DataContext accessed after Dispose.'. On both pages, the source and the receiver, the LinqDataSource objects are declared as: ``` <asp:LinqDataSource ID="myLinqDS" runat="server" ContextTypeName="MyProject.MyDBNamedpace.MyDataContext" TableName="TheTable" OrderBy...
[ 0.12123624235391617, -0.013917631469666958, 0.98722904920578, 0.09294729679822922, -0.1543675661087036, 0.2203749716281891, 0.04252541437745094, -0.3253830075263977, -0.04901420325040817, -0.7156462073326111, -0.05749858170747757, 0.5696355104446411, 0.0032527968287467957, 0.34475639462471...
(LinqDataSource)Session[System.Web.HttpUtility.UrlDecode(Request.QueryString[guid])]; aDataList.DataSource = myLinqDS; aDataList.DataBind(); ``` You should **not** be storing the DataContext in Session (or anywhere) for the following reasons: * The DataContext isn't thread safe * The DataContext is designed as a Unit...
[ -0.16480837762355804, 0.10684812813997269, 0.521723747253418, 0.2919524013996124, 0.20609444379806519, -0.34426942467689514, 0.3855094313621521, -0.20716245472431183, -0.3503529131412506, -0.35454466938972473, -0.2604808807373047, 0.44373589754104614, -0.21853488683700562, 0.39089131355285...
My co-workers rarely (if ever) use XML Comments when working on our software (I can't say I'm any better). I've recently seen the benefits of using them, but are they really worth it if the code they're documenting is written clearly (expressive/descriptive variable/function names, some in-line commenting)? Thanks! XM...
[ 0.568505048751831, 0.22089971601963043, -0.08614876866340637, 0.36313754320144653, -0.5201290845870972, -0.14877140522003174, 0.03615560755133629, 0.06758321821689606, -0.2825343608856201, -0.6484858989715576, 0.1212906613945961, 0.508068859577179, 0.2729478180408478, -0.09843544661998749,...
I have to develop software for a USB scale that, when you press a button on it, sends serial communications over USB. I can see the values in HyperTerminal. I am going to use the .NET classes for Serial communication to trap the data. The problem is, I don't have the scale. The scale is connected to a remote computer...
[ 0.44728773832321167, 0.17381039261817932, 0.3672322928905487, 0.10907185077667236, 0.012508341111242771, -0.11665382236242294, 0.17027521133422852, 0.09896409511566162, -0.1748366504907608, -0.7457059025764465, 0.592638373374939, 0.4848993718624115, -0.33588048815727234, 0.5104297399520874...
with a reasonably good idea of what the scale will report, and only test when I think I have a solution. I'm looking for something locally, that can mimic the scale and send to my .NET Serial classes, the same output as the scale. Ideally, if I could record the scale's data, and then play it back on another machine, i...
[ 0.5235366821289062, -0.18387334048748016, 0.21771948039531708, 0.2733692526817322, 0.04460086673498154, 0.15415513515472412, 0.17737522721290588, -0.08376652747392654, -0.19723302125930786, -0.7600250840187073, 0.1807715892791748, 0.7959593534469604, -0.19030554592609406, 0.124300397932529...
a scale emulator app that talks out thru one port, and plug that into the other port where your software is running.
[ 0.13101094961166382, -0.05789382755756378, 0.5019416809082031, 0.45803603529930115, 0.2436521202325821, 0.5629104375839233, -0.10134030878543854, 0.2857024073600769, 0.057902898639440536, -0.6640772223472595, 0.3850310742855072, 0.5806141495704651, -0.012505178339779377, -0.019338665530085...
I need the code to a couter that is allowed to overflow and where < > continue to tell earlier values from later values, for some defined interval. To clarify, one possible implementation would be: Consider two such counters `cur` and `dut` (device under test), consider two functions: ``` bool isEarlier(cur, dut) ...
[ -0.03977200388908386, 0.04608125612139702, 0.564109742641449, -0.03793168440461159, -0.12069415301084518, 0.15341217815876007, 0.12874817848205566, -0.5444211363792419, 0.1129673644900322, -0.20434166491031647, -0.1084008738398552, 0.7034233212471008, 0.075927734375, 0.18441379070281982, ...
32768: isEarlier -> false, isLater -> true * 32768 to 49152: invalid, log error * 49152 to 65536: isEarlier -> true, isLater -> false I can write the code myself, no problem. I'm just lazy. I know for fact that there is something like that in PostgreSQL (transaction ids wrap), I just couldn't locate the function that ...
[ -0.1831873506307602, 0.28313732147216797, 0.3470912277698517, 0.240104079246521, -0.014559311792254448, -0.20018531382083893, 0.4935307204723358, 0.20671021938323975, -0.3401687741279602, -0.1214035302400589, 0.09118255972862244, 0.7378911375999451, -0.20861564576625824, -0.036228649318218...
a safeguard. As the differences between cur and dut become bigger, the function eventually complains. I think you're talking about handling the wraparound of the number circle correctly. It's quite easy, actually. This doesn't do precisely what you said (not sure why you have that "exception" interval), but: ``` type...
[ 0.10162139683961868, -0.02236814983189106, 0.22906942665576935, -0.1405765265226364, 0.1100238710641861, -0.15626710653305054, 0.46515586972236633, -0.4794671833515167, -0.018069589510560036, -0.23686805367469788, -0.10806044936180115, 0.7095032930374146, -0.1834222972393036, 0.01547120045...
at diff=-32768, so that if a=5 and b=32772, diff=-32767 which is less than 0 and hence 5 is "earlier" than 32772. If a=5 and b=32774, diff=-32769=32767 which is greater than 0 and hence 5 is "later" than 32774. This defines "earlier" and "later" in the sense of (a) the simplest math, and (b) because wraparound counters...
[ -0.415964275598526, -0.11074383556842804, 0.45183703303337097, -0.005278497468680143, -0.07485197484493256, 0.37652358412742615, 0.13683634996414185, -0.806817352771759, -0.17449156939983368, -0.34386488795280457, -0.3876205384731293, 0.23301729559898376, 0.27223801612854004, 0.16388511657...
simple math is used to pick easiest... this "violates" the antisymmetric property of "earlier" and "later" in the sense that isLater(5,32773) is true and isLater(32773,5) is also true. But how do you know whether "5" represents a count of 5, or "5" represents a count of 65541? (just as abs(-32768) == -32768 gives an od...
[ -0.24786417186260223, -0.13489437103271484, 0.44488725066185, 0.00796440802514553, -0.06909003853797913, -0.016354702413082123, 0.34319961071014404, -0.6033110618591309, -0.26117992401123047, 0.19216471910476685, -0.10016796737909317, 0.569089949131012, -0.2606307864189148, -0.155011415481...
happen at -32768+K, then use this instead: ``` bool isEarlier(uint16_t a, uint16_t b) { int16_t diff = a-b-K; return diff < -K; } bool isLater(uint16_t a, uint16_t b) { int16_t diff = b-a-K; return diff < -K; } ``` This no longer uses closest; if, for example, K=12768, and a=5, then for b=6,7,8,9,... 200...
[ -0.1561727076768875, -0.16006918251514435, 0.6798368096351624, -0.38161495327949524, 0.13226695358753204, 0.1207045167684555, 0.26993146538734436, -0.4621875584125519, 0.04653403162956238, -0.20013879239559174, 0.05043019726872444, 0.7438310384750366, -0.17901472747325897, 0.07340010255575...