text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
to solve this issue? Any help would be greatly appreciated. I designed and implemented the table-relationships feature in Zend Framework. My first comment is that you wouldn't use `findDependentRowset()` anyway -- you'd use `findParentRow()` if the Action has a foreign key reference to User. ``` $actionTable = new Ac...
[ -0.21928738057613373, -0.14870844781398773, 0.5119218230247498, -0.2700338363647461, 0.14896467328071594, 0.1872861087322235, 0.21185725927352905, -0.3740064799785614, -0.2750782370567322, -0.586931586265564, -0.050282713025808334, 0.6552515625953674, -0.3267684578895569, 0.210811391472816...
the project) to retrieve a Rowset based on a join between Action and User. ``` $actionTable = new Action(); $actionQuery = $actionTable->select() ->setIntegrityCheck(false) // allows joins ->from($actionTable) ->join('user', 'user.id = action.user_id'); $joinedRowset = $actionTable->fetchAll($actionQuery); forea...
[ -0.01381631288677454, -0.2782646715641022, 0.4976722300052643, -0.06991513818502426, 0.0719207301735878, 0.09926707297563553, 0.18126404285430908, -0.6370517015457153, -0.3857329785823822, -0.4316325783729553, -0.24145013093948364, 0.4567960798740387, -0.4167490005493164, 0.020199257880449...
1 Buy 1 Bill 2 Sell 1 Bill 3 Buy 2 Aron 4 Sell
[ 0.5258090496063232, -0.0014871847815811634, 0.12966591119766235, -0.33982712030410767, -0.5444223284721375, 0.11929319053888321, 0.23847824335098267, -0.43105176091194153, 0.045918211340904236, -0.1554882973432541, -0.05272388830780983, 0.6401060819625854, -0.4207560420036316, 0.2909294366...
2 Aron ``` Next for the row with action\_id=1, I change one of the fields that came from the User object: ``` $joinedRow->user_name = 'William'; $joinedRow->save(); ``` Questions: when I view the next row with action\_id=2, should I see 'Bill' or 'William'? If 'William', does this mean that saving row 1 has ...
[ -0.36516743898391724, 0.06581806391477585, 0.3736199736595154, -0.34081363677978516, -0.007801856379956007, 0.3840816020965576, 0.23384155333042145, -0.5035349726676941, -0.36583125591278076, -0.6128044128417969, -0.25569629669189453, 0.5201148986816406, -0.5368480086326599, 0.070249490439...
consider the object-oriented design. Each Row is a separate object. Is it appropriate that calling `save()` on one object has the side effect of changing values in a separate object (even if they are part of the same collection of objects)? That seems like a form of [Content Coupling](http://en.wikipedia.org/wiki/Coupl...
[ 0.21673156321048737, -0.026038866490125656, -0.0037678051739931107, 0.0292353555560112, -0.20116174221038818, -0.2557569146156311, 0.14899317920207977, -0.13871853053569794, 0.07029559463262558, -0.4099498391151428, -0.12196299433708191, 0.6479041576385498, -0.5180277228355408, 0.383364170...
I am looking for a way to change the password of a local user account (local Administrator) on a Windows (XP in this case) machine. I have read the [CodeProject article](http://www.codeproject.com/KB/threads/Reset-Administrator-Pass.aspx) about one way to do this, but this just doesn't seem 'clean'. I can see that th...
[ -0.01005598995834589, 0.2247113734483719, 0.21382573246955872, -0.009339532814919949, 0.22426393628120422, -0.2006785124540329, 0.37937217950820923, 0.046218156814575195, -0.2235850840806961, -0.9709382057189941, -0.11468736082315445, 0.76165372133255, -0.1952931135892868, 0.37477904558181...
ManagementObject managementObject = new ManagementObject("WinNT://" + computerName + "/" + username); // Throws Exception object[] newpasswordObj = {newPassword}; managementObject.InvokeMethod("SetPassword", newpasswordObj); } ``` Is there a better way to do this? (I'm using .NET 3.5) **Edit:...
[ -0.5308550596237183, 0.015439406968653202, 0.434102326631546, 0.1666785329580307, 0.01913762278854847, -0.2130436897277832, 0.36584970355033875, -0.26691901683807373, -0.21477104723453522, -0.5949389338493347, -0.08773801475763321, 1.1862391233444214, -0.30296269059181213, 0.20246551930904...
directoryEntry.Invoke("SetPassword", newPassword); } ``` Try the `DirectoryEntry` class instead of `ManagementObject` class.
[ -0.19348670542240143, -0.26706457138061523, 0.12022095173597336, -0.18803854286670685, 0.3903660178184509, -0.48776325583457947, 0.3096258342266083, 0.1719253957271576, -0.023825235664844513, -0.7335199117660522, -0.2875775992870331, 0.8051431775093079, -0.4087978005409241, 0.2452699542045...
I come from a .NET world and I'm new to writting C++. I'm just wondering what are the preferred naming conventions when it comes to naming local variables and struct members. For example, the legacy code that I've inheritted has alot of these: ``` struct MyStruct { TCHAR szMyChar[STRING_SIZE]; bool ...
[ 0.5394574403762817, 0.19488739967346191, 0.464463472366333, -0.1688871681690216, 0.1575075089931488, 0.1100916787981987, 0.041984617710113525, 0.0648321881890297, -0.16741691529750824, -0.34938979148864746, -0.06177942827343941, 0.19995757937431335, -0.03208177909255028, 0.5157144665718079...
ppMyObjects; } ``` Coming from a C# background I was shocked to see the variables with hungarian notation (I couldn't stop laughing at the pp prefix the first time I saw it). I would much rather name my variables this way instead (although I'm not sure if capitalizing the first letter is a good convention. I've seen...
[ 0.14599327743053436, 0.3523821532726288, 0.47968989610671997, -0.24595491588115692, -0.062086135149002075, 0.03975081816315651, 0.0729249119758606, -0.0908699482679367, -0.2529153823852539, -0.25250333547592163, -0.19065292179584503, 0.0030608908273279667, -0.46421557664871216, 0.214643344...
MyPointer; MyObject** MyObjects; } ``` My question: Is this (the former way) still a preferred way to name variables in C++? References: <http://geosoft.no/development/cppstyle.html> <http://www.syntext.com/books/syntext-cpp-conventions.htm> <http://ootips.org/hungarian-notation.html> Thanks! That kind o...
[ 0.24373866617679596, 0.2645747661590576, 0.17710179090499878, 0.03576672822237015, -0.05358051508665085, -0.11255134642124176, 0.057680342346429825, 0.3317030966281891, -0.0923151969909668, -0.5450284481048584, -0.28707829117774963, 0.2395637482404709, -0.12809844315052032, 0.0837615281343...
I'm going through MSIL and noticing there are a lot of [nop](http://msdn.microsoft.com/en-us/library/system.reflection.emit.opcodes.nop.aspx) instructions in the MSIL. The MSDN article says they take no action and are used to fill space if the opcode is patched. They're used a lot more in debug builds than release bui...
[ 0.3189599812030792, 0.016684597358107567, 0.21227681636810303, -0.0010785589693114161, -0.03801419958472252, -0.09815383702516556, 0.3236956298351288, 0.2475212812423706, -0.3631797134876251, -0.5262063145637512, -0.5442960262298584, -0.01728034019470215, -0.4111984670162201, -0.1726286262...
if it is combined with others in the generated code. * It allows the loader to patch a jump with a different-sized target offset. * It allows a block of code to be aligned at a particular boundary, which can be good for caching. * It allows for incremental linking to overwrite chunks of code with a call to a new sectio...
[ 0.5487725734710693, -0.4165213108062744, 0.0057107689790427685, 0.16156376898288727, -0.34712091088294983, -0.09762760996818542, 0.1701018065214157, -0.3476997911930084, -0.3640061616897583, -0.5721449255943298, -0.14285027980804443, 0.13820815086364746, -0.3512027859687805, -0.24107190966...
Here's a quicky question. Which method name makes the most sense for an Objective-C Cocoa application? ``` -(void) doSomethingWithAnimation:(BOOL)animated ``` or: ``` -(void) doSomething:(BOOL)animated ``` or even: ``` -(void) doSomethingAnimated:(BOOL)animated ``` I think the Cocoa convention would give your e...
[ 0.2642389237880707, 0.12958699464797974, -0.0544370673596859, 0.17002379894256592, 0.1674971729516983, 0.511719822883606, -0.20558138191699982, 0.0701383501291275, -0.2740073502063751, -0.2937847673892975, -0.29343217611312866, 0.4535864591598511, -0.284292608499527, -0.20767748355865479, ...
Two questions: 1. Can someone point me to unbiased data that compares .NET performance to VB 6 performance? I have searched but it is surprisingly difficult to find. 2. What is the best way to compare .NET performance to VB 6 performance as an app behaves at a customer's site? We have a WindowsForms, client-server ap...
[ 0.21648092567920685, 0.0796651542186737, 0.3181628882884979, 0.25999879837036133, -0.10563508421182632, 0.08976849168539047, 0.22193658351898193, -0.20801106095314026, -0.10401655733585358, -0.7566769123077393, 0.13644179701805115, 0.6654727458953857, -0.05053112283349037, -0.1064030155539...
6 code because .NET runs in a VM? I wrote 100% of the code in C#, so it was not ported by some third person or wizard. Not all customers make this complaint, so we suspect something environmental. Is our only option to measure performance at a customer site? Some of our customers use SQL Server 2005 on Windows Server ...
[ 0.6279619336128235, 0.23541326820850372, 0.20689088106155396, 0.16341526806354523, -0.2328454852104187, -0.3930043876171112, 0.4963345527648926, 0.05301225185394287, -0.19801335036754608, -0.34819528460502625, 0.010716060176491737, 0.42424046993255615, -0.35727351903915405, 0.4787899255752...
are compiled to IL that is somewhat analogous to Java's ByteCode, the important difference is that the IL is also in turn compiled to fully native code before the app starts, rather than interpreted by a VM. Moving on to the .Net/VB6 comparison. I can't point to specific data, but from personal experience it depends o...
[ 0.6526104807853699, -0.1470891833305359, 0.1900496631860733, -0.08539193123579025, -0.03506352752447128, 0.12876339256763458, 0.23538289964199066, -0.5169630646705627, -0.11309449374675751, -0.5873770117759705, -0.18315857648849487, 0.4433206021785736, -0.3848395347595215, -0.3153285682201...
I haven't actually seen results from real apps. But I feel like I have a sense of the strengths and weaknesses of both platforms. * Application A does some serious cpu-heavy number crunching. In this case, I have to believe the results here would be almost identical. Both VB6 and .Net compile down to native code, and ...
[ 0.3624126613140106, -0.024224456399679184, 0.2443200647830963, 0.039492975920438766, -0.05633411183953285, -0.09886012226343155, 0.49423083662986755, 0.12442648410797119, -0.31806132197380066, -0.7249587178230286, -0.14033806324005127, 0.8481923937797546, -0.09591326862573624, -0.120416529...
advantage. * Application B goes out and retrieves a value from a database. Again, results are probably very close, though I'd have to give .Net a very slight edge for two reasons: it uses a native sql client, which is supposedly a little faster, and it does things like automatic connection pooling and makes it easier t...
[ -0.15497305989265442, -0.08077623695135117, 0.17075735330581665, 0.153371199965477, -0.20422713458538055, 0.011603137478232384, -0.11342493444681168, -0.005153995007276535, -0.2534779906272888, -0.7395200133323669, 0.30967044830322266, 0.46123436093330383, 0.09111201018095016, -0.213473960...
have to give vb6 the nod. It's based on an older, less glitzy widget set which will frankly be cheaper to render. Also, the WinForms components aren't known for being all that speedy. However, the difference probably isn't as large as you might think, and you're probably not completely redrawing forms that often, eithe...
[ 0.2548114061355591, 0.1209348738193512, 0.37321770191192627, -0.05560273304581642, -0.16674840450286865, -0.20283803343772888, 0.2591035068035126, -0.11153218895196915, -0.16621293127536774, -0.641697883605957, -0.22365449368953705, 0.4337003231048584, -0.16462254524230957, 0.0533441491425...
simply not available in vb6 to help developers overcome the slowness. That said, if you're not aware of those tools, poor string operation choices could easily bog down your app doing useless work. This is also likely contributing to user complaints. * Application E is going to repeatedly load an Xml document into memo...
[ 0.12347432225942612, 0.1772809773683548, 0.14101919531822205, 0.24175480008125305, -0.06290500611066818, -0.32438454031944275, 0.26806703209877014, 0.3337812125682831, -0.23851563036441803, -0.573470950126648, -0.14771263301372528, 0.5328027009963989, -0.25577205419540405, 0.22018329799175...
freeing memory during the loads. However, I think the biggest thing here is going to be disk speed, which means the difference wouldn't be that large. * Application F will repeatedly start a .Net or vb6 program, wait for it to become ready (for some definition of "ready"), and then close it. Here vb6 likely has the adv...
[ 0.2038125842809677, 0.007157886866480112, 0.2693915367126465, 0.1543530374765396, -0.1385885775089264, -0.04365256801247597, 0.1638862043619156, -0.0720074474811554, -0.48596829175949097, -0.7492334246635437, -0.18527257442474365, 0.5474128723144531, -0.10472441464662552, -0.09281624853610...
this is normally only true the *first* time you start the app on a particular machine, and there are ways to pre-compile the .Net code. This may also contribute to perceived slowness. One important point is that for all of these applications, the .Net app is likely going to have a *much* larger memory footprint. For s...
[ 0.2969735264778137, 0.2617461085319519, 0.32142162322998047, 0.26361146569252014, 0.08141350001096725, -0.03595588356256485, 0.5145187973976135, 0.3019385039806366, -0.44590672850608826, -0.7291308045387268, -0.20440220832824707, 0.44898146390914917, -0.22978311777114868, 0.008612533099949...
caching more, which saves cpu time. And for .Net specifically, it's saving up allocation/deallocation operations for periods when it's more important or when the pc is otherwise idle. I don't have time, but it's be interesting to see someone use the StopWatch implementation (at least for the .Net side) mentioned in [t...
[ 0.4035993814468384, -0.24753087759017944, -0.06012045964598656, 0.26869291067123413, -0.09210006147623062, -0.091388039290905, -0.12429148703813553, 0.004784203600138426, -0.35927510261535645, -0.6985224485397339, 0.16013078391551971, 0.5317409038543701, -0.11611153185367584, -0.2227809727...
I'm practicing for the upcoming ACM programming competition in a week and I've gotten stumped on this programming problem. **The problem is as follows:** --- You have a puzzle consisting of a square grid of size 4. Each grid square holds a single coin; each coin is showing either heads (H) and tails (T). One such pu...
[ 0.7964141368865967, -0.11273913830518723, 0.34949564933776855, 0.3697063624858856, -0.14268708229064941, -0.06523752212524414, -0.17689567804336548, -0.38614338636398315, -0.4926215708255768, -0.47034573554992676, 0.21058182418346405, 0.07624810189008713, -0.22968654334545135, 0.2672180235...
time we flip a coin, we must also flip the adjacent coins direct above, below and to the left and right in the same row. Thus if we flip the second coin in the second row we must also flip 4 other coins, giving us this arrangment (coins that changed are shown in bold). > H **T** H H > > **H** **H** **H** T > > ...
[ 0.1774965077638626, -0.17133352160453796, 0.3005754351615906, 0.254425048828125, 0.0370684377849102, 0.2843571603298187, -0.1494496613740921, -0.3412874937057495, -0.6438473463058472, -0.9333718419075012, 0.12648740410804749, 0.02510114200413227, -0.005637535359710455, 0.3181667625904083, ...
other, then we flip fewer coins. We do not "wrap around" to the other side. For example, if we flipped the bottom right coin of the arragnement above we would get: > H T H H > > H H H T > > H H H **H** > > T T **T** **H** Note: Only coins showing (T) tails can be selected for flipping. However, anytime we...
[ 0.4155506193637848, -0.3346220850944519, 0.2717857360839844, 0.4512594938278198, -0.2797560393810272, -0.00020426820265129209, -0.17053265869617462, -0.1809368133544922, -0.509458065032959, -0.5277891159057617, 0.07516686618328094, 0.18782983720302582, -0.11927083879709244, 0.2214835882186...
for some arragnements to not have solutions, all the problems given will have solutions. The answer we are looking for is, for any given 4x4 grid of coins what is the least number of flips in order to make the grid entirely heads. For Example the grid: H T H H T T T H H T H T H H T T The answer to this g...
[ 0.2911020815372467, 0.045430127531290054, 0.37417691946029663, 0.08376102894544601, -0.3306872546672821, 0.06891246885061264, -0.07066060602664948, -0.4021240174770355, -0.35140007734298706, -0.42316025495529175, 0.2746240496635437, 0.1879161149263382, -0.24735841155052185, 0.1606067270040...
that will flip the adjacent coins according the rules above and I have a **isSolved()** method that will determine if the puzzle is in a solved state (all heads). So we have our "mechanics" in place. The part we are having problems with is how should we loop through, going an the least amount of times deep? Your puzzl...
[ 0.10128199309110641, -0.3208164870738983, -0.026977956295013428, 0.41299867630004883, 0.027030492201447487, -0.25542470812797546, -0.02322191745042801, -0.29407602548599243, -0.6758121252059937, -0.37629732489585876, 0.18851220607757568, 0.1676095873117447, -0.04930642992258072, 0.05741844...
about the way the searches work, they even contain code samples in several languages. Either search can be recursive, if you're sure you won't run out of stack space.
[ 0.12653978168964386, 0.12373262643814087, -0.23620815575122833, 0.4815264344215393, 0.1940878927707672, -0.06117425486445427, 0.06774885952472687, -0.07623901218175888, -0.35474222898483276, -0.5241675972938538, -0.13834288716316223, 0.3778448700904846, -0.032091934233903885, -0.1563854962...
[What Makes a Good Unit Test?](/questions/61400/what-makes-a-good-unit-test) says that a test should test only one thing. What is the benefit from that? Wouldn't it be better to write a bit bigger tests that test bigger block of code? Investigating a test failure is anyway hard and I don't see help to it from smaller ...
[ 0.49636709690093994, 0.22468066215515137, -0.2957229018211365, 0.32193493843078613, -0.08439890295267105, -0.07785899937152863, 0.389650821685791, -0.15411728620529175, -0.001531412242911756, -0.2519361674785614, -0.049726780503988266, 0.3125225305557251, 0.15566560626029968, 0.18284150958...
list class. Why should I make separate tests for addition and removal? A one test that first adds then removes sounds simpler. I'm going to go out on a limb here, and say that the "only test one thing" advice isn't as actually helpful as it's sometimes made out to be. Sometimes tests take a certain amount of setting u...
[ 0.7103800177574158, -0.28735727071762085, -0.44766297936439514, 0.2444463074207306, -0.14682438969612122, -0.3161228895187378, 0.5583003759384155, -0.2192302644252777, -0.43375691771507263, -0.2374982386827469, 0.22556591033935547, 0.5046716928482056, -0.14071442186832428, -0.3844208121299...
the world is how you expect it to be before the second action. Less code, faster test run. Con: if *either* action fails, you'll get the same result: the same test will fail. You'll have less information about where the problem is than if you only had a single action in each of two tests. In reality, I find that the ...
[ 0.2960209846496582, -0.1103266105055809, 0.16849906742572784, 0.16544371843338013, -0.013272449374198914, 0.12617270648479462, 0.5649966597557068, -0.06098199635744095, -0.47488564252853394, -0.5692180395126343, 0.14578810334205627, 0.6505221724510193, -0.20719510316848755, 0.0373970977962...
it pass, refactor" cycle. I view that as an *ideal* cycle, but one which doesn't always mirror reality. Sometimes it's simply more pragmatic to add an extra action and check (or possibly just another check to an existing action) in a current test than to create a new one.
[ 0.6937466859817505, -0.16896465420722961, 0.23702046275138855, 0.1907932013273239, -0.15521183609962463, 0.2434268593788147, 0.4186243712902069, -0.4447330832481384, 0.024931585416197777, -0.39106515049934387, 0.2029406577348709, 0.39199864864349365, -0.25915592908859253, -0.20270237326622...
In Apple's iPhone apps (like Contacts), they have a nice magnifying glass icon at the top of the table view index. Since the table view index API is character-based, I assume that this magnifying glass is a Unicode character. So far I've resorted to placing a question mark character there, but that looks lame. Can any...
[ -0.17435307800769806, 0.3015825152397156, 0.6411560773849487, 0.14698433876037598, 0.0647302195429802, 0.0011676328722387552, 0.22419670224189758, 0.15831588208675385, -0.307939350605011, -0.5924206376075745, -0.11871051788330078, 0.5991263389587402, -0.2270035296678543, -0.183358907699584...
I need to replace the standard Overflow function in a ToolStrip to a "More..." button which would then pop up a menu with the overflowed items. Does anyone have any ideas about how to accomplish this? I wrote something very similar to this awhile ago. The code I used is pasted below, and you are free to modify it to su...
[ 0.6124958395957947, -0.2165440320968628, 0.33433347940444946, 0.3247970938682556, 0.14809854328632355, -0.32244008779525757, 0.09360109269618988, 0.060025814920663834, -0.21470610797405243, -0.8032200336456299, -0.019630245864391327, 0.9163091778755188, -0.26977598667144775, 0.030457753688...
public ToolStripCustomiseMenuItem() : base("Add Remove Buttons") { this.Overflow = ToolStripItemOverflow.Always; DropDown = CreateCheckImageContextMenuStrip(); } ContextMenuStrip checkImageContextMenuStrip = new ContextMenuStrip(); internal ContextMenuStrip CreateChe...
[ 0.13419067859649658, -0.3362733721733093, 0.41316816210746765, 0.08004456013441086, -0.029962316155433655, -0.17975926399230957, 0.4209737479686737, -0.3005430996417999, 0.2949906885623932, -0.733031153678894, -0.2884088456630707, 0.8392743468284607, -0.516517698764801, 0.09243182837963104...
checkImageContextMenuStrip.ShowImageMargin = true; checkImageContextMenuStrip.Closing += new ToolStripDropDownClosingEventHandler(checkImageContextMenuStrip_Closing); checkImageContextMenuStrip.Opening += new CancelEventHandler(checkImageContextMenuStrip_Opening); DropDownOpening += new EventHan...
[ -0.19912296533584595, -0.08874306827783585, 0.5779994130134583, -0.13901005685329437, 0.17168846726417542, -0.224847212433815, 0.49784940481185913, -0.24050123989582062, 0.1169496402144432, -0.49353402853012085, -0.6601578593254089, 0.7617090344429016, -0.494022935628891, 0.151113241910934...
foreach (ToolStripItem ti in Owner.Items) { if (ti is ToolStripSeparator) continue; if (ti == this) continue; MyToolStripCheckedMenuItem itm = new MyToolStripCheckedMenuItem(ti); itm.Checked = ti.Visible; DropDownItems.Add(itm); } } void check...
[ 0.2562589645385742, -0.21046051383018494, 0.4495103061199188, -0.23091016709804535, 0.36216554045677185, -0.057133886963129044, 0.5728419423103333, -0.3112635612487793, 0.04752994328737259, -0.6180961728096008, -0.36987006664276123, 0.705697238445282, -0.22785231471061707, 0.12502960860729...
ToolStripDropDownClosingEventArgs e) { if (e.CloseReason == ToolStripDropDownCloseReason.ItemClicked) { e.Cancel = true; } } } internal class MyToolStripCheckedMenuItem : ToolStripMenuItem { ToolStripItem tsi; public MyToolStripCheckedMenuItem(ToolStripItem tsi) : base(t...
[ 0.1714879870414734, -0.3290958106517792, 0.573085367679596, 0.285634309053421, 0.07549726217985153, -0.2606721818447113, 0.40194636583328247, -0.34250324964523315, 0.21225635707378387, -0.7061143517494202, -0.4283311665058136, 0.7742193341255188, -0.23673270642757416, -0.19682128727436066,...
this.CheckState = CheckState.Checked; CheckedChanged += new EventHandler(MyToolStripCheckedMenuItem_CheckedChanged); } void MyToolStripCheckedMenuItem_CheckedChanged(object sender, EventArgs e) { tsi.Visible = this.Checked; } } ```
[ 0.001932899933308363, -0.30853182077407837, 0.41543036699295044, -0.14958623051643372, 0.16728271543979645, -0.25804898142814636, 0.3925493359565735, 0.06135034188628197, -0.29809898138046265, -0.6140966415405273, -0.2169184386730194, 0.5713508725166321, -0.422814279794693, 0.0830031260848...
I'm currently on chapter 4 of Real World Haskell, and I'm trying to wrap my head around [implementing foldl in terms of foldr](http://book.realworldhaskell.org/read/functional-programming.html#x_E9). (Here's their code:) ``` myFoldl :: (a -> b -> a) -> a -> [b] -> a myFoldl f z xs = foldr step id xs z where step...
[ -0.019286811351776123, 0.16675005853176117, 0.8720986843109131, -0.4105483889579773, -0.2470822036266327, -0.3027563989162445, 0.4047287404537201, -0.3721981644630432, -0.09888045489788055, -0.6944463849067688, -0.13664261996746063, 0.25452861189842224, -0.3281077742576599, -0.048917274922...
step x zipsfn [] = [] step x zipsfn (y:ys) = (x, y) : (zipsfn ys) ``` How this works: (foldr step done xs) returns a function that consumes ys; so we go down the xs list building up a nested composition of functions that will each be applied to the corresponding part of ys. How to come up with it: I star...
[ 0.06659445911645889, -0.34434476494789124, 0.7399945259094238, -0.3016318082809448, 0.10683024674654007, -0.07137239724397659, -0.04482650384306908, -0.7188857793807983, -0.06144474074244499, -0.5316511988639832, -0.20324794948101044, 0.30318745970726013, -0.6063022017478943, -0.3053840398...
it had to be to make the types and values come out right. It was easiest to consider the simplest cases first before the harder ones. The first line could be written more simply as ``` zip2 = foldr step done ``` as mattiast showed.
[ 0.08510321378707886, -0.3354070782661438, 0.36565008759498596, -0.20083948969841003, 0.05251066014170647, 0.08664065599441528, 0.03610699623823166, -0.3400454819202423, -0.2117089331150055, -0.4066554605960846, -0.2852420210838318, 0.1551961749792099, -0.4357545077800751, -0.29750570654869...
I'm trying to add parameters to an objectDataSource at runtime like this: ``` Parameter objCustomerParameter = new Parameter("CustomerID", DbType.String, customerID); Parameter objGPDatabaseParameter = new Parameter("Database", DbType.String, gpDatabase); //set up object data source parameters...
[ -0.14544908702373505, -0.09284291416406631, 0.600134551525116, -0.043083932250738144, -0.04405154287815094, 0.09498690813779831, 0.24347570538520813, -0.21217714250087738, -0.16969719529151917, -0.7042794227600098, -0.04233849421143532, 0.6007369756698608, -0.426107257604599, 0.15510542690...
page\_load of the page containing the objectDataSource). Add them to the event for the operation you are trying to use. For example, if these parameters are part of the SELECT command then add them to the Selecting event, if they need to go with the UPDATE command then add them on the Updating event. The ObjectDataSou...
[ 0.012234884314239025, -0.3487953841686249, 0.7800512313842773, 0.005089027341455221, 0.14420349895954132, -0.037829767912626266, -0.04895046353340149, 0.0010514160385355353, -0.11704257130622864, -0.7549301385879517, -0.1448773741722107, 0.7086690664291382, -0.31917017698287964, -0.0807192...
= customerId; e.InputParameters["database"] = dbName; ```
[ -0.018173130229115486, 0.07322389632463455, 0.3385523557662964, -0.1315571516752243, -0.1657673865556717, 0.23546600341796875, 0.29830202460289, -0.09056070446968079, 0.37061697244644165, -0.5338992476463318, -0.19517895579338074, 0.41995108127593994, -0.2662477195262909, 0.417073845863342...
Derik Whitaker posted an [article](http://devlicio.us/blogs/derik_whittaker/archive/2008/10/22/how-is-interacting-with-your-data-repository-in-your-controller-different-or-better-than-doing-it-in-your-code-behind.aspx) a couple of days ago that hit a point that I've been curious about for some time: **should business l...
[ 0.30674055218696594, 0.12133938819169998, -0.13076244294643402, 0.09319356828927994, -0.3650916516780853, -0.13120967149734497, -0.22510012984275818, -0.1130337044596672, -0.21549803018569946, -0.5666698813438416, 0.3097328841686249, 0.20779281854629517, -0.35025325417518616, 0.16442944109...
You should be aiming for fat models, skinny controllers. For example, instead of having: ``` public interface IOrderService{ int CalculateTotal(Order order); } ``` I would rather have: ``` public class Order{ int CalculateTotal(ITaxService service){...} } ``` This assumes that tax is calculate by...
[ 0.18460020422935486, -0.1673182100057602, 0.22870349884033203, 0.09609653800725937, -0.12753765285015106, 0.08054377138614655, -0.14194703102111816, -0.24544668197631836, -0.23670294880867004, -0.4449913203716278, -0.011589732021093369, 0.5285245180130005, -0.4003209173679352, -0.038202431...
like that.
[ 0.13020572066307068, 0.09982308745384216, -0.00677943741902709, 0.03464522585272789, -0.0626932829618454, -0.2348249852657318, 0.10042262077331543, 0.036735668778419495, -0.08174458146095276, -0.08312803506851196, 0.07830283045768738, 0.046925973147153854, -0.23274511098861694, 0.119585268...
I know VS2008 has the remove and sort function for cleaning up using directives, as does Resharper. Apart from your code being "clean" and removing the problem of referencing namespaces which might not exist in the future, what are the benefits of maintaining a "clean" list of using directives? Less code? Faster compi...
[ 0.4224424660205841, -0.21217893064022064, 0.11322508752346039, 0.14826147258281708, -0.22838908433914185, -0.34507742524147034, 0.19654236733913422, -0.11858706921339035, -0.39529526233673096, -0.6219468712806702, 0.2707950472831726, 0.695036768913269, -0.2931356728076935, 0.08921905606985...
I am running GNU Emacs on Windows so entering: ``` M-x shell ``` launches the Windows command-line DOS shell. However, I would like to instead be able to run the Cygwin Bash Shell (or any other non-Windows shell) from within Emacs. How can this be easily done? `shell-file-name` is the variable that controls which sh...
[ 0.16137632727622986, 0.2883768677711487, 0.4118967354297638, -0.2134329378604889, -0.07388020306825638, -0.37552952766418457, 0.42270931601524353, -0.236167773604393, -0.12032441049814224, -0.5544746518135071, -0.19671660661697388, 0.8340708017349243, -0.38526180386543274, 0.46565192937850...
"Run cygwin bash in shell mode." (interactive) (let ((explicit-shell-file-name "C:/cygwin/bin/bash")) (call-interactively 'shell))) ``` You will probably also want to pass the `--login` argument to bash, because you're starting a new Cygwin session. You can do that by setting `explicit-bash-args`. (Note that ...
[ 0.11326513439416885, 0.0814998522400856, 0.2067997306585312, -0.3917089104652405, 0.010422240942716599, -0.5836877226829529, 0.5142229795455933, -0.09003215283155441, -0.16035743057727814, -0.4250847399234772, -0.30441924929618835, 1.1025537252426147, -0.32304275035858154, -0.0680269896984...
I wonder why no browser out there has such simple but essential feature. Am I missing something? Is there a technical reason? I'm tired of all those javascript/flash/java hacks out there ... There is no technical reason preventing the browser from calculating the total bytes to be sent and then tracking how many have ...
[ 0.17650635540485382, 0.2512117028236389, 0.4811362326145172, -0.06891440600156784, -0.2880064845085144, -0.12343650311231613, 0.4010664224624634, 0.10468339174985886, -0.6376733183860779, -0.2289598286151886, 0.11944393813610077, 0.412401407957077, -0.522857666015625, 0.042957745492458344,...
the developers. Users who regularly upload very large files tend to use tools like FTP that are designed for this purpose, so they are not affected.
[ 0.35951125621795654, 0.12912526726722717, 0.11141608655452728, 0.30008721351623535, 0.029151152819395065, -0.45568951964378357, 0.0128563167527318, 0.2377224564552307, -0.6304295063018799, -0.4299929141998291, -0.545114278793335, 0.5977048873901367, -0.2154114693403244, -0.0005755703314207...
I'd like to install Java on a Psion 5MX with GNU/Linux 16MB RAM machine, will it be possible? Unfortunatly, ["KVM must be installed by the manufacturer"](http://www.java.com/en/download/faq/5000080100.xml). What I want is to be able to is to write basic Java code, test and sketch simple algorithms. Important notes: ...
[ 0.27809634804725647, 0.1202126070857048, -0.013420197181403637, 0.1263594776391983, 0.0706615075469017, -0.025788486003875732, 0.2779163718223572, -0.04167044162750244, -0.040548767894506454, -0.8444550633430481, 0.09808403253555298, 0.6491260528564453, -0.10871187597513199, -0.29387915134...
big overhead in embedded places as compared to writing native code). The answer is maybe. I've seen Java running on a machine with 4MB of RAM, but it was not running Linux (in fact there was no OS at all). Link: [Java on the Nintendo DS](http://www.volny.cz/molej/pstrosnds/)
[ 0.1687435507774353, -0.033406954258680344, 0.0022574658505618572, 0.00808167178183794, 0.00442054308950901, 0.09625133872032166, 0.28497233986854553, -0.007803589105606079, -0.4242525100708008, -0.36673250794410706, 0.0363999679684639, 0.4321679472923279, -0.1218775063753128, -0.2894413471...
Does anyone know a trick in Visual Studio 2008 to make it remember the outline toggles you have in place on aspx files between restarts? (the little plus or minus symbol on the left for code blocks) In the code behind cs file it remembers the toggle on the #region tags... hoping for something like that I can do on the...
[ 0.291601300239563, 0.03321026265621185, 0.5503872036933899, 0.013189236633479595, -0.01682836003601551, -0.04983021318912506, 0.36243441700935364, 0.09163264185190201, -0.474530428647995, -0.5997581481933594, 0.026907123625278473, 0.3669566214084625, -0.1013706773519516, -0.047873098403215...
as well, so I submitted [feedback on Microsoft Connect](https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=467059). If this issue bothers you to, please rate it on MS Connect.
[ 0.5978002548217773, -0.15676042437553406, 0.5507913827896118, 0.11110236495733261, -0.48944783210754395, 0.25832000374794006, 0.24325309693813324, 0.22276568412780762, -0.188543900847435, -0.5314403176307678, 0.22536121308803558, 0.4530068635940552, 0.005047870799899101, 0.2851741313934326...
I have to make a newsletter sending utility application which will collect the list of subscriber from our central database and send out the newsletter. I've considered the possibility to be blacklisted due to flooding if I just flush out all emails at once, so I decided to go on a desktop-based softwer which will emai...
[ 0.2525436282157898, -0.06126464530825615, 0.4890475273132324, 0.110118068754673, -0.11067787557840347, 0.008374015800654888, 0.3538261950016022, -0.05082598328590393, -0.44644495844841003, -0.7072397470474243, 0.2691780924797058, 0.48696932196617126, -0.1151914894580841, 0.2374708801507949...
applies more appropriate to the real-world of mail servers configuration... thanks I've implementing sending to max 600 e-mails per recipient domain. That seems to be working fine for some time now and sounds like an OK solution. Still, some SysAdmin insight on this would be appreciated.
[ 0.34849509596824646, 0.1279492974281311, 0.6737998127937317, 0.1571090668439865, -0.16660743951797485, 0.003146019298583269, 0.3612527847290039, 0.02022808976471424, -0.2761684060096741, -0.7911032438278198, 0.1302892118692398, 0.3870076537132263, -0.13254466652870178, -0.05023578554391861...
I have trouble comparing 2 double in Excel VBA suppose that I have the following code ``` Dim a as double Dim b as double a = 0.15 b = 0.01 ``` After a few manipulations on b, b is now equal to 0.6 however the imprecision related to the double data type gives me headache because ``` if a = b then //this will nev...
[ 0.3879449665546417, 0.2868610918521881, 0.2085985541343689, -0.29958346486091614, -0.5973745584487915, -0.09064973145723343, 0.305091917514801, -0.453640878200531, -0.14596949517726898, -0.27106738090515137, 0.4311201274394989, 0.514188289642334, -0.4024161696434021, 0.11834486573934555, ...
to a constant error margin unless you know for sure what the absolute range of the floats is beforehand.
[ 0.6184485554695129, 0.01294827088713646, 0.7907087802886963, 0.3551446497440338, 0.185580775141716, -0.1956852674484253, 0.2735508978366852, -0.3659991919994354, -0.06355971843004227, -0.7411613464355469, 0.12491422146558762, 0.6073116660118103, 0.19152423739433289, -0.06976917386054993, ...
Finding out what's selected in real browsers is as simple as: ``` var range = { start: textbox.selectionStart, end: textbox.selectionEnd } ``` But IE, as usual, doesn't understand. What's the best cross-browser way to do this? I'll post this function for another time, seeing as this question got linked to from a...
[ 0.1376505047082901, -0.22688043117523193, 0.4647691547870636, -0.14878544211387634, -0.0784437358379364, -0.18361541628837585, 0.07018271833658218, -0.2034793198108673, 0.0639130249619484, -0.7826290130615234, -0.058517538011074066, 0.5787441730499268, -0.08938173204660416, -0.178537487983...
call the textarea's `focus()` method before calling it. ``` function getInputSelection(el) { var start = 0, end = 0, normalizedValue, range, textInputRange, len, endRange; if (typeof el.selectionStart == "number" && typeof el.selectionEnd == "number") { start = el.selectionStart; end =...
[ -0.027148086577653885, -0.325706422328949, 0.5318098664283752, -0.2554103136062622, 0.20653890073299408, 0.2580109238624573, 0.05995587259531021, -0.48115119338035583, 0.09790831804275513, -0.48267990350723267, -0.6743258833885193, 0.7631871104240417, -0.24517235159873962, 0.05791829153895...
len = el.value.length; normalizedValue = el.value.replace(/\r\n/g, "\n"); // Create a working TextRange that lives only in the input textInputRange = el.createTextRange(); textInputRange.moveToBookmark(range.getBookmark()); // Check if the start and end of t...
[ -0.2306373566389084, -0.4856424629688263, 0.6794790029525757, -0.18591231107711792, 0.3295971751213074, 0.3209092319011688, -0.01603906974196434, -0.25020745396614075, -0.058821581304073334, -0.6162573099136353, -0.3742212653160095, 0.5634400844573975, -0.1325564980506897, -0.1085045114159...
// of the input, since moveStart/moveEnd doesn't return what we want // in those cases endRange = el.createTextRange(); endRange.collapse(false); if (textInputRange.compareEndPoints("StartToEnd", endRange) > -1) { start = end = len;
[ -0.3221650719642639, -0.16384395956993103, 0.5136417746543884, -0.29032808542251587, 0.020178750157356262, 0.24937103688716888, 0.216090127825737, -0.33604103326797485, 0.0946003720164299, -0.4796399474143982, -0.44612613320350647, 0.3088039755821228, -0.11479111760854721, 0.21713744103908...
} else { start = -textInputRange.moveStart("character", -len); start += normalizedValue.slice(0, start).split("\n").length - 1; if (textInputRange.compareEndPoints("EndToEnd", endRange) > -1) { end = len;
[ -0.40979740023612976, -0.527668833732605, 0.43494558334350586, -0.17093196511268616, 0.10086497664451599, 0.30509448051452637, 0.22652673721313477, -0.25560498237609863, 0.0831570252776146, -0.44512665271759033, -0.4201957583427429, 0.43993470072746277, -0.10761379450559616, -0.08394709229...
} else { end = -textInputRange.moveEnd("character", -len); end += normalizedValue.slice(0, end).split("\n").length - 1; } } }
[ -0.22796112298965454, -0.6684291362762451, 0.23368412256240845, -0.21252471208572388, 0.1869356632232666, 0.17848926782608032, 0.24135707318782806, -0.20711854100227356, 0.07462739944458008, -0.44504302740097046, -0.3505593240261078, 0.601499080657959, -0.1503511220216751, -0.0924638658761...
} return { start: start, end: end }; } var el = document.getElementById("your_input"); el.focus(); var sel = getInputSelection(el); alert(sel.start + ", " + sel.end); ```
[ 0.0967908576130867, -0.30976974964141846, 0.6587271094322205, -0.24071931838989258, 0.3913803994655609, -0.03798716887831688, 0.07852989435195923, -0.1211765855550766, -0.15107326209545135, -0.6314471364021301, -0.7071434259414673, 0.8149904012680054, -0.3138296902179718, -0.14058400690555...
Given the following file: ``` department=value1 location=valueA location=valueB department=value2 ``` I use the following to load the file into a Perl hash: ``` use File::Slurp; use Data::Dumper; my %hash = map { s/#.*//; s/^\s+//; s/\s+$//; m/(.*?)\s*=\s*(.*)/; } read_file($file); print Dumper(\%hash);...
[ -0.3181478977203369, 0.08966947346925735, 0.49626731872558594, -0.32832854986190796, 0.15034069120883942, 0.01393226720392704, 0.030074184760451317, -0.26081275939941406, -0.12786288559436798, -0.4402388036251068, -0.49272453784942627, 0.2928682267665863, -0.13573583960533142, 0.2164161056...
'department' => 'value1,value2' }; ``` Thanks. Here you go: ``` my %hash; while (<FILE>) { chomp; my ($key, $val) = split /=/; $hash{$key} .= exists $hash{$key} ? ",$val" : $val; } ``` This walks through every line splitting on the '=' sign and either adds an entry or appends to an existing entry ...
[ 0.02237599901854992, -0.04785296320915222, 0.5686950087547302, -0.11130677908658981, 0.17646461725234985, -0.02507634647190571, 0.13686244189739227, 0.20973677933216095, -0.29706263542175293, -0.4267008602619171, -0.4286673367023468, 0.5028353929519653, -0.2431774139404297, 0.3351568281650...
The way I do 80-column indication in Vim seems incorrect:`set columns=80`. At times I also `set textwidth`, but I want to be able to see and anticipate line overflow with the `set columns` alternative. This has some **unfortunate** side effects: 1. I can't `set number` for fear of splitting between files that have d...
[ 0.20991790294647217, -0.019662311300635338, 0.593222439289093, -0.23986943066120148, -0.39639803767204285, 0.03030954860150814, 0.6069861054420471, -0.36271989345550537, -0.34316760301589966, -0.7903214693069458, -0.09909860044717789, 0.7516271471977234, -0.2350853681564331, -0.04950430989...
me to `set columns` every time I open or close a pane, so starting a new session is less hassle. How do you handle the 80-character indication when you want to `set numbers`, vertically split, etc.? I have this set up in my .vimrc: ``` highlight OverLength ctermbg=red ctermfg=white guibg=#592929 match OverLength /\%8...
[ -0.02865057997405529, 0.10006583482027054, 0.613169252872467, -0.3511051535606384, -0.076012521982193, 0.1440473347902298, 0.20270702242851257, 0.045257117599248886, -0.24500486254692078, -0.8397265076637268, 0.0894719734787941, 0.7679101228713989, -0.2674369812011719, -0.22299042344093323...
I was wondering about implementing my own sessions (more for an exercise than anything else) for a GAE app I'm working ... at first I was thinking of using the datastore to store the session data. However, every time something needs to be added to the session 'bucket', it would require saving to the datastore. Obviousl...
[ 0.40821513533592224, 0.12160492688417435, -0.008059564977884293, 0.17060737311840057, -0.030507300049066544, -0.09041242301464081, 0.4602263867855072, 0.3038482367992401, -0.3751354217529297, -0.4410169720649719, 0.2415376752614975, 0.6142145395278931, -0.33755171298980713, 0.1580718755722...
mean we are left with only the following options: 1. Storing all session data in cookies 2. Writing all session data to datastore and memcache, and then only reading from memcache Anyone have any other ideas? I suggest checking out (and contributing to) these three implementations of appengine sessions before rolling...
[ 0.4436603784561157, 0.10202901810407639, 0.26995784044265747, 0.10263673961162567, -0.012347415089607239, 0.030620744451880455, 0.49790599942207336, -0.09461615979671478, -0.25948742032051086, -0.8137410283088684, -0.09924725443124771, 0.9900019764900208, -0.2209683358669281, -0.4511199593...
Can anyone suggest some references or other resources that are useful in learning MCML? I have a small pet project I have been working on for a while using C# and .Net 3.5. I have reached a point where I want to be able to send output from it to Windows Media Center, but I have been having a hard time finding coherent...
[ 0.5240181088447571, 0.18442048132419586, 0.13394729793071747, 0.4005485773086548, -0.03307926282286644, -0.1801120638847351, -0.00518993753939867, 0.17134223878383636, -0.41250309348106384, -0.6026307344436646, 0.14670239388942719, 0.37399226427078247, -0.17080186307430267, 0.2912455499172...
out (and contributing to) these three implementations of appengine sessions before rolling out your own: * [app-engine-patch](http://code.google.com/p/app-engine-patch/) * [gaeutilities](http://gaeutilities.appspot.com/) * [gae-session](https://github.com/dound/gae-sessions) Your options look fine but choosing betwee...
[ 0.27281856536865234, 0.07422183454036713, 0.04137502238154411, -0.03247513622045517, -0.05241867154836655, 0.43719184398651123, 0.04426608979701996, -0.23214426636695862, -0.3071343004703522, -0.7290995717048645, -0.2168607860803604, 0.7033504247665405, -0.131825253367424, -0.4497934281826...
What is the best way to validate a crontab entry with PHP? Should I be using a regex, or an external library? I've got a PHP script that adds/removes entries from a crontab file, but want to have some way to verify that the time interval portion is in a valid format. Hmmm, interesting problem. If you're going to reall...
[ 0.29467904567718506, 0.2949138283729553, 0.5552750825881958, 0.4885670840740204, -0.06629593670368195, 0.15453490614891052, 0.11532080918550491, -0.11213173717260361, -0.2655892074108124, -0.22378703951835632, 0.3435346484184265, 0.5854061841964722, 0.07229040563106537, 0.23766708374023438...
4, Saturday), a Vixie cron-style shortcut (60/5) or any combination of the above -- any single regex approach is going to get very hairy, fast. Just using the `crontab` program of Vixie cron to validate isn't sufficient, because it actually doesn't validate completely! I can get `crontab` to accept all sorts of illega...
[ 0.3097161054611206, 0.16432224214076996, 0.5229396224021912, 0.2613488435745239, -0.12919753789901733, -0.30920660495758057, 0.5859314799308777, -0.20252911746501923, -0.18387143313884735, 0.012967614457011223, -0.08842065185308456, 0.6014723181724548, -0.172137051820755, -0.07402022182941...
<http://www.phpclasses.org/browse/package/1189.html> * <http://www.phpclasses.org/browse/package/1985.html> Another approach (depending on what your app needs to do) might be to have PHP construct the crontab entry programatically and insert it, so you know it's always valid, rather than try to validate an untrusted s...
[ 0.06925449520349503, 0.1894012689590454, 0.27376416325569153, 0.1720041036605835, -0.15538541972637177, 0.04075426980853081, 0.13090291619300842, -0.30886781215667725, -0.43674734234809875, -0.374349445104599, 0.013430928811430931, 0.23893918097019196, -0.2043231874704361, 0.12706355750560...
Using jQuery, how would you `show()` every `div.foo` on a page in a random order, with a new one appearing every X milliseconds? **Clarification**: I want to start with all these elements hidden and end with all of them showing, so it wouldn't make sense to `show()` the same element twice. I originally thought I'd ma...
[ 0.3321210443973541, -0.03052406944334507, 0.22147369384765625, -0.1096491813659668, -0.3786014914512634, -0.1674385666847229, 0.06419379264116287, -0.17500139772891998, -0.3159003257751465, -0.5206955075263977, -0.04156548157334328, 0.13480709493160248, -0.5003404021263123, 0.1001284122467...
interesting way to do this would be the extend Javascript's Array base object with a shuffle function. In Prototype (should be the same in JQuery, except jQuery.extend). This is quick and dirty shuffle, there are plenty of other ways to do it. ``` Object.extend(Array.prototype, { shuffle : function() { this.sort...
[ 0.25614508986473083, -0.41525498032569885, 0.2686738669872284, -0.08617042750120163, 0.15963131189346313, -0.2594890296459198, -0.1906854212284088, -0.40914109349250793, -0.3955370783805847, -0.7589015364646912, 0.015898285433650017, 0.3060975670814514, -0.31077760457992554, -0.07038434594...
intervals). Might want to make that 'non-destructive' though by cloning the array returned by the shuffle method instead of sorting it directly.
[ 0.2934172749519348, -0.45322683453559875, 0.19748911261558533, 0.13441255688667297, 0.16575229167938232, -0.03607942909002304, 0.018475357443094254, -0.22567196190357208, -0.136314257979393, -0.5938600301742554, -0.10179527848958969, 0.5153071284294128, -0.2078045904636383, 0.0250798147171...
I am using a mock object in RhinoMocks to represent a class that makes calls to MessageQueue.GetPublicQueues. I want to simulate the exception thrown when message queueing is operating in workgroup mode, which is a MessageQueueException, to ensure that I am catching the exception correctly The MessageQueueException ha...
[ 0.3184797763824463, 0.08387445658445358, 0.01962989754974842, -0.021486839279532433, -0.11835279315710068, -0.2250428944826126, 0.42033156752586365, -0.16930200159549713, -0.28896889090538025, -0.4223802089691162, 0.13472381234169006, 0.7533252835273743, -0.38973522186279297, 0.06951153278...
Type t = typeof(MessageQueueException); ConstructorInfo ci = t.GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, new Type[] { typeof(int) }, null); MessageQueueException ex = (MessageQueueException)ci.Invoke(new object[] { 911 }); throw ex; ```
[ 0.31581658124923706, -0.42492973804473877, 0.5940734148025513, -0.21339792013168335, 0.2260492593050003, 0.12356478720903397, 0.46195992827415466, -0.2394147515296936, 0.00203136308118701, -0.5807239413261414, -0.4571003019809723, 0.3983747661113739, -0.7026543021202087, 0.3673636913299560...
I have the following situation: A user will define a certain filter on a page, and on postback I will query the database using that filter and return a bunch of matching records to the user, each with a checkbox next to it, so he can choose whether to act on each of those records. In Classic ASP / PHP I can generate ...
[ 0.3248949944972992, 0.06048193201422691, 0.2901572585105896, 0.05751220881938934, -0.22591930627822876, -0.1564311981201172, -0.010048463009297848, -0.03805819898843765, -0.1270921230316162, -0.7845966219902039, 0.18759237229824066, 0.3218247890472412, -0.45942553877830505, -0.136295780539...
Repeater with a Template containing the checkbox, bind the Repeater to a Dataset, and then on the second Postback, I just do: ``` For Each it As RepeaterItem In repContacts.Items Dim chkTemp As CheckBox = DirectCast(it.FindControl("cbSelect"), CheckBox) If chkTemp.Checked Then End If Next ``` However th...
[ 0.39545977115631104, -0.1448301076889038, 0.7248667478561401, 0.16994024813175201, -0.05304877460002899, -0.34806880354881287, 0.4645056426525116, -0.03406953811645508, -0.14026355743408203, -0.7307431101799011, 0.11905568838119507, 0.5664306879043579, -0.35463643074035645, 0.4939711987972...
through Request.Form as in the old days, however, I was looking for a cleaner Do it the same way you did it in classic ASP. Use <input type="checkbox"> instead of <asp:checkbox>. You can access the raw post paramaters using Request.Form
[ 0.5031612515449524, -0.34927213191986084, 0.2985864579677582, 0.18334366381168365, -0.36113548278808594, -0.019157305359840393, 0.4124264419078827, -0.37992605566978455, -0.2386454939842224, -0.9208993315696716, -0.3076969385147095, 0.2197464555501938, -0.3380541205406189, 0.30509591102600...
There are many different styles of variable names that I've come across over the years. The current wikipedia entry on naming conventions is fairly light... I'd love to see a concise catalog of variable naming-conventions, identifying it by a name/description, and some examples. If a convention is particularly fav...
[ 0.5230506658554077, 0.3447280824184418, -0.12183693051338196, 0.3767853081226349, 0.030473174527287483, -0.24879413843154907, -0.06648685038089752, 0.028392182663083076, -0.3779747486114502, -0.12229988723993301, 0.0017622725572437048, 0.5857015252113342, -0.23288199305534363, 0.3609605729...
conventions and lots of examples. His examples run through a number of "best practices" for different languages, but ultimately leave it up to the developer, dev manager, or architect to decide the specific action.
[ 0.5865654945373535, 0.20546388626098633, 0.0009075921261683106, 0.4072985053062439, 0.073028564453125, -0.25084221363067627, 0.4758765697479248, -0.27605339884757996, -0.04591197147965431, -0.7681942582130432, -0.5367541313171387, 0.6261909604072571, -0.11572257429361343, -0.14545553922653...
My WinForms application has a tab with a `System.Windows.Forms.WebBrowser` control. There are several controls that set the WebBrowser's `.Url` property, and when the form repaints it calls the WebBrowser's `.Refresh(WebBrowserRefreshOption.Completely)` method. Occasionally, however, the form gets repainted and the We...
[ 0.5525453090667725, -0.02701062150299549, 0.7180269956588745, -0.0992182195186615, 0.07226620614528656, -0.17775718867778778, 0.2684766948223114, -0.20809166133403778, 0.15119342505931854, -0.6668698191642761, -0.07305754721164703, 0.762416660785675, -0.050018422305583954, 0.28668594360351...
Why doesn't `.Refresh( )` wait until the control has "had time to load the new document" before it redraws? Is there any way to force this to happen? Unless you're doing something very special, it doesn't make sense to force the WB to repaint itself. Since it is its own control and has its own Handle, it is quite capab...
[ 0.758243978023529, 0.017199864611029625, 0.5159831047058105, 0.045618936419487, 0.12505444884300232, -0.10971755534410477, 0.1765526384115219, -0.002108155284076929, -0.19433175027370453, -0.45518502593040466, -0.21196098625659943, 0.22525034844875336, -0.11383482068777084, 0.6298866271972...
I *think* I know how to create custom encrypted RSA keys, but how can I read one encrypted like ssh-keygen does? I know I can do this: ``` OpenSSL::PKey::RSA.new(File.read('private_key')) ``` But then OpenSSL asks me for the passphrase... How can I pass it to OpenSSL as a parameter? And, how can I create one compa...
[ -0.10364942997694016, 0.040578871965408325, 0.5205267071723938, -0.03943375498056412, -0.09624917060136795, -0.19929936528205872, 0.44882553815841675, -0.5181993246078491, -0.18909651041030884, -0.6286231875419617, -0.45026740431785583, 0.37573379278182983, -0.6267445087432861, 0.150677353...
I copy the public key to the server and use the private one to login). Also, when I open an ssh-keygen file via OpenSSL and then check its contents, it appears to have additional characters at the beginning and end of the key. Is this normal? I don't really understand some of this security stuff, but I'm trying to le...
[ 0.17655274271965027, 0.07356347143650055, 0.3570384979248047, 0.1431267410516739, 0.06773535907268524, -0.345055490732193, 0.47738131880760193, 0.05757104605436325, -0.24984537065029144, -0.7719078063964844, -0.13560262322425842, 0.577539324760437, -0.3701949417591095, 0.12222513556480408,...
accomplish this... And then I go and test again, and sure enough, OpenSSL can open the private key just fine without Net::SSH... I've made so much tests that somehow I didn't test this correctly before. But I still have the issue of creating an SSH compatible key pair... and maybe I'll go test again and have the answe...
[ 0.17154888808727264, 0.12816491723060608, 0.5144510269165039, 0.28745201230049133, 0.03530002757906914, -0.24430537223815918, 0.5992661714553833, -0.15242141485214233, -0.18718655407428741, -0.5957885384559631, -0.10242778062820435, 0.3969801664352417, -0.02515920251607895, -0.048515241593...
Given this algorithm, I would like to know if there exists an iterative version. Also, I want to know if the iterative version can be faster. This some kind of pseudo-python... the algorithm returns a reference to root of the tree ``` make_tree(array a) if len(a) == 0 return None; node = pick a random p...
[ -0.18363451957702637, -0.33546537160873413, 0.412977397441864, -0.18988826870918274, 0.031513527035713196, 0.16799156367778778, 0.17938221991062164, -0.07979430258274078, -0.1736396700143814, -0.5596679449081421, 0.0152108334004879, 0.06215852126479149, -0.35381966829299927, 0.313834339380...
node.right = make_tree(subset, such the distance is greater or equal to the median) return node ``` A recursive function with only one recursive call can usually be turned into a tail-recursive function without too much effort, and then it's trivial to convert it into an iterative function. The canonical example her...
[ -0.4278208911418915, -0.35584157705307007, 0.13991227746009827, -0.14308752119541168, -0.008143180049955845, -0.036116305738687515, 0.23321501910686493, -0.42647799849510193, -0.056799113750457764, -0.31210216879844666, -0.17389501631259918, 0.6229156851768494, -0.6364231109619141, -0.2369...
if m <= 1: return k else: return fac_helper(m - 1, m * k) return fac_helper(n, 1) # iterative with accumulator def fac(n): k = 1 while n > 1: n, k = n - 1, n * k return k ``` However, your case here involves two recursive calls, and
[ -0.35971418023109436, -0.25953930616378784, 0.2878640592098236, -0.49836957454681396, 0.09627609699964523, 0.24030908942222595, 0.2267197072505951, -0.597237229347229, -0.017986368387937546, -0.42047616839408875, -0.271373450756073, 0.7793975472450256, -0.5672065019607544, -0.1097817495465...
unless you significantly rework your algorithm, you need to keep a stack. Managing your own stack may be a little faster than using Python's function call stack, but the added speed and depth will probably not be worth the complexity. The canonical example here would be the Fibonacci sequence: ``` # naïve recursion de...
[ 0.0554719939827919, -0.43921124935150146, 0.22826966643333435, -0.20330362021923065, 0.19899193942546844, -0.1779702752828598, 0.23376286029815674, -0.6629461050033569, -0.1447976678609848, -0.24511517584323883, -0.2167288362979889, 0.7423195838928223, -0.6600736975669861, -0.2434029430150...