text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
Here's a common code pattern I have to work with: ``` class foo { public: void InitMap(); void InvokeMethodsInMap(); static void abcMethod(); static void defMethod(); private: typedef std::map<const char*, pMethod> TMyMap; TMyMap m_MyMap; } void foo::InitMap() { m_MyMap["abc"] = &foo::abcM...
[ 0.03390421345829964, -0.021773597225546837, 0.5247091054916382, -0.28611981868743896, 0.36604923009872437, 0.05472720414400101, 0.4242735505104065, -0.49185243248939514, -0.3069921135902405, -0.7240915298461914, -0.4047897458076477, 0.7576004862785339, -0.5071092247962952, 0.18521052598953...
that the map is processed in (within the for loop) can differ based upon whether the build configuration is Release or Debug. It seems that the compiler optimisation that occurs in Release builds affects this order. I thought that by using `begin()` in the loop above, and incrementing the iterator after each method ca...
[ 0.314744770526886, 0.14682720601558685, 0.03359733149409294, -0.155621737241745, 0.22695648670196533, -0.13777483999729156, 0.28329893946647644, -0.3085586726665497, -0.09075062721967697, -0.49993520975112915, -0.35808679461479187, 0.4470709562301636, -0.07589267939329147, 0.12483810633420...
dependency bugs aren't found until the external QA team start testing (because they use a Release build). Can anyone explain this strange behaviour? Don't use `const char*` as the key for maps. That means the map is ordered by the addresses of the strings, not the contents of the strings. Use a `std::string` as the ke...
[ 0.06985919177532196, -0.029064595699310303, 0.0983797088265419, 0.054286371916532516, 0.19817331433296204, -0.3720172643661499, 0.21468526124954224, 0.19244025647640228, -0.3349088430404663, -0.6112338900566101, -0.1156478226184845, 0.5396937131881714, -0.8118381500244141, 0.24446928501129...
I've been parsing through some log files and I've found that some of the lines are too long to display on one line so Terminal.app kindly wraps them onto the next line. However, I've been looking for a way to truncate a line after a certain number of characters so that Terminal doesn't wrap, making it much easier to sp...
[ 0.23634713888168335, -0.13479095697402954, 0.6239563226699829, -0.23642851412296295, 0.03817027434706688, 0.23435737192630768, 0.2670832574367523, -0.1368853747844696, -0.2557850182056427, -0.3614795207977295, -0.04387165233492851, 0.2331986129283905, -0.43033432960510254, 0.02160399779677...
is probably built into some other tools (sed?) That I just don't know enough about to use for this task. So my question sort of a reverse question: how do I truncate a line of stdin Without writing a program to do it? Pipe output to: ``` cut -b 1-LIMIT ``` Where LIMIT is the desired line width.
[ 0.4914221167564392, -0.1387653350830078, 0.357070654630661, -0.25742119550704956, -0.29028499126434326, 0.17603765428066254, 0.1488792598247528, -0.1358283907175064, 0.08097059279680252, -0.46016573905944824, 0.11109070479869843, 0.4000648260116577, -0.008062096312642097, 0.180413052439689...
PHP, as we all know is very loosely typed. The language does not require you to specify any kind of type for function parameters or class variables. This can be a powerful feature. Sometimes though, it can make debugging your script a painful experience. For example, passing one kind of object into a method that expec...
[ 0.09939134865999222, 0.17408034205436707, 0.04742427542805672, 0.14425262808799744, -0.46898794174194336, -0.3395916819572449, 0.2938291132450104, 0.22219829261302948, -0.22118456661701202, -0.2082459181547165, 0.3763871192932129, 0.1756078153848648, -0.3557068109512329, 0.0726450085639953...
won't be used until later on in the script's execution. In this case you end up getting an error much later than when you passed the original argument. Instead of complaining that what I passed doesn't have a specific method or variable, or waiting until much later in script execution for my passed in object to be use...
[ 0.42023149132728577, 0.3086290955543518, 0.41606953740119934, -0.09087073057889938, -0.2646852135658264, 0.06867213547229767, 0.5458412170410156, -0.023729512467980385, -0.013516492210328579, -0.7349956035614014, 0.05692684277892113, 0.2795563340187073, -0.22313553094863892, -0.00221260916...
How can I introduce some type-checking into my scripts so that I can get more easily understood error messages? Also, how can you do all this while accounting for inheritance in Php? Consider: ``` <?php class InterfaceClass { #... } class UsesInterfaceClass { function SetObject(&$obj) { // What do I p...
[ 0.11174032092094421, 0.123198501765728, 0.198949933052063, 0.015156522393226624, -0.3098333775997162, -0.07256308197975159, 0.2522120475769043, -0.34103432297706604, -0.03018171899020672, -0.6470218896865845, 0.41246408224105835, 0.4669492244720459, -0.4235180616378784, -0.0144540313631296...
extends InterfaceClass { } ?> ``` I want ConcreteClass instances, and all future, unknown user-defined objects, to also be acceptable to SetObject. How would you make this allowable in checking for the correct type? Actually for classes you can provide type hinting in PHP (5+). ``` <?php class UsesBaseClass { ...
[ 0.07308612018823624, -0.06076733022928238, 0.3872666656970978, -0.1264697015285492, -0.09148295968770981, -0.2901121973991394, 0.14119575917720795, -0.315596342086792, 0.1349978893995285, -0.6748325824737549, 0.0842343419790268, 0.6232542991638184, -0.5150878429412842, -0.337651789188385, ...
The question posed came about during a 2nd Year Comp Science lecture while discussing the impossibility of generating numbers in a deterministic computational device. This was the only suggestion which didn't depend on non-commodity-class hardware. Subsequently nobody would put their reputation on the line to argue d...
[ 0.3947356045246124, -0.0968203991651535, 0.162480428814888, 0.2146105021238327, -0.3795783817768097, 0.153254896402359, 0.07240155339241028, -0.013845671899616718, -0.4422881007194519, -0.16257871687412262, 0.2577553391456604, 0.2253703624010086, -0.11593930423259735, 0.20793871581554413, ...
know what your random numbers are, but they would also control them. Of course there's still the question of how deterministic your local network is, so it might not be as easy as all that in practice. But since you get no benefit from pinging random IPs on the internet, you might just as well draw entropy from ethern...
[ 0.5874658226966858, -0.29036518931388855, 0.1203208789229393, 0.514160692691803, -0.09795155376195908, -0.3531917333602905, -0.05047796294093132, 0.03536459058523178, -0.293673038482666, -0.5258040428161621, 0.28033292293548584, 0.49868884682655334, -0.2114732265472412, 0.01830138638615608...
in the fundamentals of security (and the only practical needs for significant quantities of truly random data are security-related) you MUST assume that a fantastically well-resourced, determined attacker will do everything in their power to break your system. For practical security, you can assume that nobody wants y...
[ 0.3067604601383209, 0.05806384235620499, -0.16664117574691772, 0.4547573924064636, 0.28318142890930176, -0.19670481979846954, 0.2566233277320862, 0.03718167170882225, -0.2642402946949005, -0.019842926412820816, -0.3484973609447479, 0.4280363619327545, -0.0553518608212471, -0.01646407321095...
of kit to defeat your proposal, I can't accept it as an advance over current best practice. AFAIK /dev/random follows fairly close to best practice for generating truly random data on a cheap home PC] [**Another edit**: it has suggested in comments that (1) it is true of any TRNG that the physical process could be inf...
[ 0.544926643371582, -0.016396764665842056, 0.3980451226234436, 0.04583359509706497, -0.0972088873386383, -0.3988752067089081, 0.015643786638975143, -0.4831053912639618, -0.0886058434844017, -0.5825756788253784, 0.22325380146503448, 0.3510833978652954, -0.3066287636756897, 0.1133618354797363...
is obvious that you can't generate random numbers on a deterministic machine, which is what provoked the question. But then in CS terms, a machine with an external input stream is non-deterministic by definition, so if we're talking about ping then we aren't talking about deterministic machines. So it makes sense to lo...
[ 0.22486573457717896, -0.08410020917654037, -0.21612033247947693, 0.4966798424720764, -0.3713219165802002, -0.1084217056632042, -0.2786341607570648, 0.18478626012802124, -0.40267103910446167, -0.4287134110927582, 0.3668197989463806, 0.30175691843032837, -0.32276108860969543, 0.0768996477127...
Assuming that a network is not subverted is a much bigger (and unnecessary) assumption than assuming that your own hardware is not subverted. The answer to (2) is philosophical. If you don't mind your random numbers having the property that they can be chosen at whim instead of by chance, then this proposal is OK. But...
[ 0.4060538113117218, -0.11711649596691132, 0.054895464330911636, 0.34350070357322693, -0.019116457551717758, -0.22994714975357056, 0.13115693628787994, -0.11668568104505539, -0.1547975093126297, -0.30216237902641296, 0.1700541079044342, 0.5266237854957581, -0.36467188596725464, 0.1443209201...
RNG output. You don't know their probability distribution, and they certainly aren't uniformly distributed (which is normally what people want from an RNG). So, you need to decide how many bits of entropy per ping you are willing to rely on. Entropy is a precisely-defined mathematical property of a random variable wh...
[ 0.06671921908855438, -0.46836861968040466, 0.32055428624153137, 0.1504928469657898, -0.0976615697145462, -0.10678530484437943, -0.16824214160442352, -0.06070869788527489, -0.2614270746707916, -0.5346540808677673, -0.045076046139001846, 0.5046616196632385, -0.3219425082206726, -0.0269267763...
of the inputs. 'Total' doesn't necessarily mean sum: if the inputs are statistically independent then it is the sum, but this is unlikely to be the case for pings, so part of your entropy estimate will be to account for correlation. The sophisticated big sister of this hashing operation is called an 'entropy collector'...
[ -0.04967048019170761, -0.4383535087108612, -0.05866177752614021, 0.5452771186828613, -0.03322359547019005, 0.23258966207504272, -0.25426676869392395, 0.2091294676065445, -0.27285531163215637, -0.3073106110095978, 0.11451167613267899, 0.2687516510486603, -0.12303095310926437, 0.278226435184...
to know how 'random' your seed value was - you can use the best PRNG in the world, but its entropy is still limited by the entropy of the seed.]
[ 0.3280898630619049, -0.001095092506147921, -0.24959251284599304, 0.4078637957572937, 0.2050774097442627, 0.2632071077823639, -0.4312436282634735, -0.028468606993556023, -0.10587648302316666, -0.12126923352479935, 0.32233768701553345, 0.22851885855197906, 0.12259067595005035, 0.168115943670...
A couple of months ago I've coded a tiny tool that we needed at work for a specific task, and I've decided to share it on CodePlex. It's written in C# and honestly it's not big deal but since it's the first project I've ever built from scratch in that language and with the goal of opening it from the very beginning, on...
[ 0.6614990234375, 0.12042193859815598, -0.23957470059394836, 0.12712687253952026, -0.06751538068056107, -0.04963800683617592, 0.10932622104883194, 0.3369608521461487, -0.0034088375978171825, -0.5601767301559448, 0.30354487895965576, 0.241244375705719, 0.03434154763817787, 0.0436518825590610...
participation, stimulate curiosity or just recieve more feedback about it? By the way this is the project I'm talking about: <http://www.codeplex.com/winxmlcook/> I know I sound like a broken record constantly posting this book, but just about everything you could ever need to know about running an open source project...
[ 0.5875270366668701, 0.007382370997220278, -0.23411090672016144, 0.20780149102210999, -0.3343604803085327, -0.4348520338535309, 0.12387295812368393, 0.2176002562046051, -0.38367611169815063, -0.5987634062767029, 0.14051836729049683, 0.488613486289978, 0.18027494847774506, -0.072202630341053...
I'm teaching/helping a student to program. I remember the following process always helped me when I started; It looks pretty intuitive and I wonder if someone else have had a similar approach. 1. Read the problem and understand it ( of course ) . 2. Identify possible "functions" and variables. 3. Write how would I do...
[ 0.22063428163528442, 0.011638916097581387, -0.11447517573833466, 0.11910548061132431, -0.010843392461538315, 0.14844608306884766, 0.4499035179615021, -0.002666537882760167, 0.027339577674865723, -0.8122700452804565, 0.09165893495082855, 0.30269452929496765, 0.11138926446437836, -0.20912078...
a coding solution, but, by applying this method I managed to learn how to program. So for a project description like: > *A system has to calculate the price of an Item based on the following rules ( a description of the rules... client, discounts, availability etc.. etc.etc. )* I first step is to understand what th...
[ 0.36753925681114197, -0.32961878180503845, 0.3050209879875183, 0.18605738878250122, 0.0012266028206795454, 0.35870063304901123, -0.06526558846235275, -0.32094261050224304, -0.08708591759204865, -0.562364935874939, 0.04105360805988312, 0.654217541217804, 0.032738447189331055, 0.152735739946...
) then discount = 5% if( clientAge > 60 or < 18 ) then discount = 5% return item_price - discounts... end ``` And then pass it to the programming language.. ``` public class Problem1{ public int getPrice( int itemPrice, int quantity,hourOdDay ) { int discount = 0; if( hou...
[ -0.028245560824871063, -0.18863455951213837, 0.8831942081451416, -0.11667123436927795, 0.29872286319732666, 0.40468859672546387, -0.2922040820121765, -0.09608078747987747, -0.03250708803534508, -0.30098092555999756, -0.39000001549720764, 0.712973415851593, 0.05768284574151039, 0.1837421506...
U don't know how to calculate percentage... // create a function and move on. discount += percentOf( 5, itemPriece ); . . . you get the idea..
[ 0.30821776390075684, -0.18963907659053802, 0.43840646743774414, 0.11554387211799622, -0.027934599667787552, 0.2644108235836029, 0.13351163268089294, -0.0338556282222271, 0.06031995266675949, -0.4454071819782257, 0.13262413442134857, 0.6214603781700134, 0.13328665494918823, 0.41174656152725...
} } public int percentOf( int percent, int i ) { // .... } } ``` Did you went on a similar approach?.. Did some one teach you a similar approach or did you discovered your self ( as I did :( ) I did something similar. * Figure out the rules/logic. * Figure out the math. * Then try and co...
[ 0.39759624004364014, 0.2689003050327301, -0.04048782214522362, 0.01954687014222145, 0.06892619282007217, -0.13117673993110657, 0.5363609790802002, -0.11282545328140259, 0.09610939025878906, -0.6987938284873962, 0.2481403797864914, 0.6502649784088135, -0.05299155414104462, -0.01239807065576...
you come up against a complex problem that requires you to break it down.
[ 0.051779553294181824, 0.3806073069572449, -0.43639039993286133, 0.2941516637802124, 0.014319038949906826, 0.09853732585906982, 0.2816911041736603, -0.3582158088684082, -0.23715324699878693, -0.6149988770484924, -0.09137610346078873, 0.522565484046936, 0.2813825309276581, -0.054628051817417...
I have a SQL query (MS Access) and I need to add two columns, either of which may be null. For instance: ``` SELECT Column1, Column2, Column3+Column4 AS [Added Values] FROM Table ``` where Column3 or Column4 may be null. In this case, I want null to be considered zero (so `4 + null = 4, null + null = 0`). Any sugge...
[ -0.50261390209198, 0.011096952483057976, 0.5841706991195679, -0.09788072109222412, 0.11004072427749634, 0.15530358254909515, -0.12277169525623322, -0.1404639184474945, -0.15062640607357025, -0.587857723236084, 0.08026929199695587, 0.4242858588695526, -0.16100330650806427, 0.179979071021080...
Considering "private" is the default access modifier for class Members, why is the keyword even needed? It's for you (and future maintainers), not the compiler.
[ 0.15965533256530762, -0.11946134269237518, -0.1682358831167221, 0.30379313230514526, 0.16273123025894165, -0.3593997657299042, 0.3387922942638397, 0.22967423498630524, -0.17929576337337494, -0.11560565233230591, -0.5130483508110046, 0.46641039848327637, -0.04552504047751427, 0.239408060908...
I am told that good developers can spot/utilize the difference between `Null` and `False` and `0` and all the other good "nothing" entities. What *is* the difference, specifically in PHP? Does it have something to do with `===`? It's language specific, but in PHP : ------------------------------------ **`Null`** me...
[ 0.1594811975955963, 0.12234170734882355, 0.04924508556723595, -0.07697059959173203, -0.5270845293998718, -0.35035285353660583, 0.6106422543525696, 0.24981632828712463, -0.23027367889881134, -0.36369162797927856, -0.08736124634742737, 0.599265992641449, -0.0985061451792717, -0.0962456241250...
a boolean context*, which (in PHP) is `False`. If you test it with `==`, it's testing the boolean value, so you will get equality. If you test it with `===`, it will test the type, and you will get inequality. So why are they useful ? ------------------------ Well, look at the `strrpos()` function. It returns False ...
[ -0.21217234432697296, 0.1697012037038803, 0.05231170728802681, -0.015099483542144299, -0.11344126611948013, -0.1756221055984497, 0.5449363589286804, -0.23976030945777893, -0.08887499570846558, -0.27353355288505554, -0.1643749326467514, 0.5362730026245117, -0.3408498466014862, 0.03931577503...
! } ?> ``` And of course, if you deal with states: You want to make a difference between `DebugMode = False` (set to off), `DebugMode = True` (set to on) and `DebugMode = Null` (not set at all, will lead to hard debugging ;-)).
[ 0.16176210343837738, 0.0745115801692009, -0.08173295110464096, -0.16215890645980835, 0.31103798747062683, -0.0975959450006485, 0.5308119654655457, -0.3238423764705658, -0.10317421704530716, -0.05461632087826729, -0.44938066601753235, 0.6480425000190735, -0.36773020029067993, 0.502908229827...
My Invoice model has an address\_id attribute, and I don't want this address\_id to change FOREVER. So I don't want this to happen outside the class: ``` invoice.address_id = 1 invoice.address = some_address ``` Rails automatically adds this address\_id attribute to the model from the invoice table, so how can I dec...
[ 0.05040133371949196, 0.05257079750299454, 0.1907283514738083, 0.05503685772418976, 0.03041418083012104, -0.1281384378671646, 0.4904187321662903, -0.010529649443924427, -0.21709007024765015, -0.6549549698829651, 0.0002650893875397742, 0.4796263873577118, -0.2660432457923889, 0.2606907486915...
I'd like to learn assembler. However, there are very few resources for doing assembler with OS X. Is there anyone out there who has programmed in assembly on a Mac? Where did you learn? And, is there any reason I shouldn't be doing assembly? Do I risk (significantly) crashing my computer irreparably? If you're using ...
[ 0.3082300126552582, 0.46313270926475525, -0.4106387495994568, 0.05445198714733124, -0.19352523982524872, -0.1381852626800537, 0.20368187129497528, -0.060946669429540634, -0.04813524708151817, -0.5113710761070251, 0.06698009371757507, 0.7414680123329163, -0.12584391236305237, -0.12790581583...
-S and read the assembly generated * Use [Sandpile](http://sandpile.org/) * Join #openrce on irc.freenode.net and use [OpenRCE](http://openrce.org/) Also, if you're not in kernel mode then there's no chance of screwing anything up, really, and even if you are in kernel mode it's hard to really destroy anything. Edit:...
[ 0.4405287504196167, -0.032304782420396805, 0.10323488712310791, 0.2894645631313324, -0.5294784903526306, -0.5475069284439087, 0.3454552888870239, 0.037716343998909, -0.04576166719198227, -0.8025240898132324, -0.4428533613681793, 0.7497727274894714, -0.2695218026638031, -0.03160508722066879...
On some systems it is UTF-8, on others latin-1. How do you set this? Is it something in php.ini? (I know you can set the encoding/charset for a given page by setting HTTP headers, but this is not what I am looking for.) Alex If you're using a PowerPC Mac, look into gcc inline assembler. Otherwise, look into nasm. I c...
[ 0.08686576038599014, 0.27763012051582336, 0.1785823404788971, 0.00609816936776042, -0.11446041613817215, -0.14671771228313446, -0.03367405757308006, 0.05899989604949951, -0.2713567614555359, -0.7400485873222351, -0.1069316491484642, 0.486168771982193, -0.42446082830429077, -0.1385803371667...
Join #openrce on irc.freenode.net and use [OpenRCE](http://openrce.org/) Also, if you're not in kernel mode then there's no chance of screwing anything up, really, and even if you are in kernel mode it's hard to really destroy anything. Edit: Also, get gcc and such from XCode not Macports or somesuch. You're in for a...
[ 0.4446374177932739, -0.1977950632572174, 0.055814921855926514, 0.35866379737854004, -0.603218138217926, -0.686734676361084, 0.41512686014175415, 0.15725377202033997, -0.14088983833789825, -0.7058481574058533, -0.05652732029557228, 0.49079498648643494, -0.3118804395198822, 0.010035043582320...
I was reading about output buffering in JavaScript **[here](http://www.webreference.com/programming/javascript/jkm3/4.html),** and was trying to get my head around the script the author says was the fastest at printing 1 to 1,000,000 to a web page. (Scroll down to the header "The winning one million number script".) Af...
[ 0.32896795868873596, -0.07230279594659805, 0.350028395652771, 0.2597588002681732, -0.21603548526763916, 0.09602367132902145, -0.045000262558460236, 0.18903648853302002, -0.3943752944469452, -0.6882285475730896, 0.5097121000289917, 0.3810543715953827, 0.14943401515483856, -0.150158122181892...
probably CS101, but I'm one of those blasted, self-taught hackers and I was hoping to benefit from the wisdom of the collective on this one. Thanks!) What makes this script so efficient compared to other approaches? ----------------------------------------------------------------- There are several optimizations that ...
[ 0.011110775172710419, 0.14005792140960693, 0.21389682590961456, 0.30773642659187317, -0.06464061886072159, 0.1560346931219101, 0.2719876170158386, 0.3378734886646271, -0.2628719210624695, -0.799027681350708, 0.2729906141757965, 0.4834407866001129, -0.3734801709651947, -0.19943825900554657,...
ask about it explicitly. The integer math that he's utilizing has two performance benefits: integer addition is cheaper per operation than string manipulation and it uses less memory. I don't know how JavaScript and web browsers handle the conversion of an integer to a display glyph in the browser, so there may be a ...
[ 0.469881534576416, -0.09828638285398483, 0.38944554328918457, 0.41249188780784607, -0.21020923554897308, 0.13525186479091644, 0.2640279531478882, -0.43236634135246277, -0.12873613834381104, -0.42981356382369995, 0.16094942390918732, 0.49698346853256226, -0.27791497111320496, -0.16449332237...
is to send it to the display. Therefore the penalty for sending an integer vs a string to document.write would have to exceed 3 orders of magnitude offset the performance advantage of manipulating integers. Why does buffering speed things up? ----------------------------------- The specifics of why it works vary depe...
[ -0.02463505044579506, -0.19072964787483215, 0.4279773533344269, 0.2650488317012787, -0.08327151834964752, 0.09129056334495544, -0.2615250051021576, -0.009915410540997982, -0.2936878502368927, -0.5171416401863098, 0.04619409888982773, 0.5236721634864807, -0.19720841944217682, -0.03011510334...
it too little work and it won't be using every available bit that passes under the head of the spindle as the disk rotates. Give it too much, and your application will have to wait (or be put to sleep) while the disk finishes your write - time that could be spent getting the next record ready for writing! Some of the k...
[ 0.18461714684963226, 0.16527441143989563, 0.5851241946220398, 0.10106515884399414, 0.20168544352054596, 0.09573777765035629, -0.07013446092605591, -0.13637188076972961, -0.4698924422264099, -0.4737902879714966, -0.014731358736753464, 0.5982226729393005, -0.030580347403883934, 0.07573658972...
pipeline full. If you give the CPU too little work, it will spend time spinning NO OPs while it waits for you to task it. If you give the CPU too much, you may not dispatch requests to other resources, such as the disk or the video card, which could execute in parallel. This means that later on the CPU will have to wai...
[ 0.2795286476612091, -0.5208532810211182, 0.39821475744247437, 0.11603511869907379, 0.1199892908334732, 0.1456989049911499, -0.19874198734760284, -0.0021783974952995777, -0.2955965995788574, -0.5236678123474121, 0.02313004434108734, 0.6707919836044312, -0.2578153610229492, -0.21184271574020...
is (in order of decreasing proximity): registers, L1 cache, L2 cache, L3 cache, RAM. In the case of writing a million numbers to the screen, it's about drawing polygons on your screen with your video card. Think about it like this. Let's say that for each new number that is added, the video card must do 100,000,000 op...
[ 0.09116165339946747, 0.17826540768146515, 0.5498986840248108, 0.3991908133029938, 0.029712753370404243, 0.47982969880104065, 0.0030686529353260994, -0.14059334993362427, -0.516913652420044, -0.6657527089118958, 0.1719837486743927, 0.06889740377664566, -0.09915447235107422, 0.18909139931201...
10^14 operations - 100 trillion operations! At the other extreme, if you took the entire 1 million numbers and sent it to the video card all at once, it would take only 100,000,000 operations. The optimal point is some where in the middle. If you do it one a time, the CPU does a unit of work, and waits around for a lon...
[ -0.13870175182819366, -0.10046917200088501, 0.510860800743103, 0.2914547920227051, 0.0030280479695647955, 0.3519829213619232, -0.030606120824813843, -0.025625403970479965, -0.5618924498558044, -0.5941227078437805, -0.11445710062980652, 0.21491527557373047, -0.23095600306987762, 0.011976880...
a very specific and well defined platform with a specific algorithm (e.g. writing packet routing for an internet routing) you typically cannot determine this mathematically. Typically, you find it empirically. Guess a value, try it, record the results, then pick another. You can make some educated guesses of where to s...
[ -0.07255931198596954, -0.10571593046188354, 0.020217983052134514, 0.39529478549957275, 0.11669928580522537, -0.00038234301609918475, 0.0965796634554863, 0.04847763478755951, -0.3140821158885956, -0.85880446434021, 0.3018423318862915, 0.2021956592798233, -0.1323940008878708, -0.274484992027...
under pinnings of computers are binary and word sizes are *typically* in multiples of two (but this isn't always the case!). For example, 64 bytes is more likely to be optimal than 60 bytes and 1024 is more likely to be optimal than 1000. One of the bottlenecks specific to this problem is that most browsers to date (Go...
[ 0.19552025198936462, 0.059020668268203735, 0.23960798978805542, 0.07131455838680267, -0.4509308636188507, 0.18686237931251526, 0.15865541994571686, -0.10129803419113159, -0.5046403408050537, -0.44264501333236694, -0.0001767841022228822, -0.11001264303922653, -0.2735897898674011, 0.22455117...
long time until the document.write call returns. If the javascript was run as separate process, asynchronously, like in chrome, you would likely get a major speed up. This is of course attacking the source of the bottleneck not the algorithm that uses it, but sometimes that is the best option. Not nearly as succinct a...
[ 0.1564500629901886, -0.04801049456000328, 0.4100256860256195, 0.16885745525360107, 0.01583188958466053, -0.28791579604148865, 0.31788820028305054, 0.03652620315551758, -0.08980461210012436, -0.7085525393486023, -0.029189612716436386, 0.42663756012916565, 0.05733685567975044, -0.21377250552...
or addressing performance issues.
[ -0.09342794865369797, 0.06976518779993057, -0.16269555687904358, 0.1537286788225174, 0.2548272907733917, 0.44091150164604187, 0.04309456795454025, 0.0018754744669422507, -0.08261848241090775, -0.3405499756336212, -0.503878653049469, 0.6532509922981262, 0.241496279835701, -0.419152438640594...
Is there such a thing as an x86 assembler that I can call through C#? I want to be able to pass x86 instructions as a string and get a byte array back. If one doesn't exist, how can I make my own? To be clear - I don't want to *call* assembly code from C# - I just want to be able to assemble code from instructions and...
[ 0.4864015281200409, 0.2999418377876282, -0.016238609328866005, 0.01911267079412937, -0.09053082764148712, 0.05815122276544571, 0.04277918487787247, 0.0038759110029786825, -0.2907605767250061, -0.48995983600616455, 0.04916081205010414, 0.5670115351676941, -0.36096400022506714, 0.06586007773...
on a personal project, I wrote quite a bit of code to do something like this. It doesn't take strings -- x86 opcodes are methods on an X86Writer class. Its not documented at all, and has nowhere near complete coverage, but if it would be of interest, I would be willing to open-source it under the New BSD license. **UP...
[ 0.6828832030296326, 0.3401842415332794, -0.12255219370126724, 0.0430673211812973, 0.1372242271900177, -0.4201277792453766, 0.38388770818710327, 0.49478209018707275, -0.20959705114364624, -0.5784775018692017, 0.07975932210683823, 0.22560705244541168, -0.13663212954998016, 0.2862308621406555...
I've heard many times that all programming is really a subset of math. [Some suggest](http://c2.com/cgi-bin/wiki?ProgrammingIsMath) that OO, at its roots, is mathematically based, but I don't get the connection, aside from some obvious examples: * using induction to prove a recursive algorithm, * formal correctness pr...
[ 0.4450652301311493, 0.40574097633361816, -0.3683079779148102, 0.17208847403526306, -0.18073995411396027, -0.009481068700551987, 0.09400288760662079, 0.20006592571735382, -0.1892915517091751, -0.25310611724853516, -0.12314526736736298, 0.2755037844181061, -0.3506193161010742, 0.213385924696...
to enterprise/OO development, if there is a strong enough connection, that is. Overall, remember that mathematics is a formal codification of logic, which is also what we do in software. The list of topics in your question is loaded with mathematical problems. We are able to do programming on a fairly **high level of ...
[ 0.43710944056510925, 0.2499535083770752, -0.035135213285684586, 0.2064729481935501, 0.33913928270339966, -0.10373470932245255, -0.2399117797613144, 0.09837202727794647, -0.3226470947265625, -0.5395399928092957, -0.21549946069717407, 0.5745514631271362, 0.1571105569601059, -0.28112688660621...
expression engine. I think you've hit on an interesting point. Programming is an art and a science. There are a lot of "tools of the trade", and you don't necessarily sit down and do a lot of high-level mathematics in order to simply write a program. In fact, when you're programming, you many not really being doing mu...
[ 0.495004802942276, 0.10610031336545944, -0.0873309001326561, 0.5791465044021606, -0.07614937424659729, -0.0742742046713829, 0.15341931581497192, 0.2893030047416687, -0.17775706946849823, -0.9281620383262634, 0.15612368285655975, 0.9271610379219055, 0.02929600700736046, -0.1507273018360138,...
don't necessarily have to work in, but they involve more math. For example, while you can certainly learn a language and write some apps without any formal mathematics, you won't get very far in **algorithm analysis** without some applied math.
[ 0.7304748296737671, 0.22654509544372559, -0.14846941828727722, 0.4964330494403839, 0.2641773521900177, -0.3054915964603424, 0.27345046401023865, 0.303131103515625, -0.2727632224559784, -0.6941227912902832, -0.31103208661079407, 0.4452272057533264, 0.07395971566438675, -0.5754501223564148, ...
I can't find a reference to it but I remember reading that it wasn't a good idea to call virtual (polymorphic) methods within a destructor or the Dispose() method of IDisposable. Is this true and if so can someone explain why? Calling virtual methods from a finalizer/`Dispose` is unsafe, for the same reasons [it is un...
[ 0.1495458483695984, -0.02223941870033741, -0.16614723205566406, 0.13627159595489502, 0.2353348731994629, -0.3669399321079254, 0.19724875688552856, -0.11281991750001907, -0.31761205196380615, -0.33305665850639343, -0.2302681803703308, 0.4503049850463867, -0.2380893975496292, 0.4877294003963...
disposing)`, and think this makes it Ok to use *any* virtual method durring a dispose. Consider the following code: ``` class C : IDisposable { private IDisposable.Dispose() { this.Dispose(true); } protected virtual Dispose(bool disposing) { this.DoSomething(); } protected virtual ...
[ 0.39827635884284973, -0.09584908187389374, 0.1912878304719925, -0.16447387635707855, 0.1978679746389389, -0.34592583775520325, 0.02958495169878006, -0.487194687128067, -0.08675026893615723, -0.576704740524292, -0.3973119556903839, 0.7192736268043518, -0.6144981384277344, 0.2859401702880859...
base.Dispose(disposing); } protected override void DoSomething() { X.Whatever(); } } ``` Here's what happens when you Dispose and object of type `D`, called `d`: 1. Some code calls `((IDisposable)d).Dispose()` 2. `C.IDisposable.Dispose()` calls the virtual method `D.Dispose(bool)` 3. `D.Dispose(...
[ 0.3934728503227234, 0.05916802957653999, 0.29719358682632446, -0.12304756790399551, 0.2110627144575119, -0.28953254222869873, 0.1458771824836731, -0.36481744050979614, -0.10882477462291718, -0.5524083971977234, -0.3256300985813141, 0.6387652158737183, -0.46780556440353394, 0.29759263992309...
`base.Dispose(dispose)` call to before they clean-up their own object. And, yes, that does work. But do you really trust Programmer X, the Ultra-Junior Developer from the company you developed `C` for, assigned to write `D`, to write it in a way that the error is either detected, or has the `base.Dispose(disposing)` ca...
[ 0.5970486998558044, 0.18411654233932495, -0.41514137387275696, 0.18138998746871948, 0.11950088292360306, -0.3520936369895935, 0.03047608584165573, -0.11920924484729767, -0.039460621774196625, -0.21796242892742157, 0.021578120067715645, 0.47675368189811707, -0.23028333485126495, -0.12853612...
Expanding this question on how I learnt to pass from [problem description to code](https://stackoverflow.com/questions/137375/) Two people mentioned TDD. Would it be good for a starter to get into TDD ( and avoid bad habits in the future ? ) Or would it be too complex for a stage when understand what a programming l...
[ 0.3764929175376892, -0.06905660778284073, -0.2197819948196411, 0.31619545817375183, -0.36648184061050415, -0.18912214040756226, 0.5512276291847229, -0.4505752921104431, -0.1879882663488388, -0.29303666949272156, 0.29376697540283203, 0.3148239254951477, 0.08980226516723633, -0.1693194657564...
hard. So for a beginner, writing tests gets the thinking juice going in the right direction, which is contractual behaviour, not implementation behaviour.
[ 0.3372221291065216, 0.13689662516117096, -0.3593185245990753, -0.11109330505132675, -0.09043261408805847, -0.05510098487138748, 0.5967227220535278, -0.08183889091014862, -0.13499826192855835, -0.3313814401626587, -0.20540198683738708, 1.0481477975845337, 0.42719703912734985, -0.41545951366...
I was wondering if there was a way to use "find\_by\_sql" within a named\_scope. I'd like to treat custom sql as named\_scope so I can chain it to my existing named\_scopes. It would also be good for optimizing a sql snippet I use frequently. While you can put any SQL you like in the conditions of a named scope, if you...
[ 0.7716699242591858, -0.1454356461763382, 0.054884109646081924, 0.096026211977005, 0.10579745471477509, -0.14793968200683594, 0.3388262093067169, -0.31113401055336, -0.22949187457561493, -0.5464511513710022, 0.12281754612922668, 0.8670973777770996, -0.18796959519386292, 0.30345064401626587,...
string in there - if you have more than one they get joined with AND) ``` Item.mine.find :all => SELECT * FROM items WHERE ('user_id' = 887 and IS_A_NINJA() = 1) ``` However, this doesn't ``` Items.mine.find_by_sql 'select * from items limit 1' => select * from items limit 1 ``` So the answer is "No". If you thin...
[ -0.2597201466560364, -0.206681489944458, 0.049454960972070694, 0.08178108930587769, -0.11822488158941269, -0.14970439672470093, 0.1770506054162979, -0.19234436750411987, -0.08207728713750839, -0.45638376474380493, -0.002611506264656782, 0.2250668704509735, -0.24259713292121887, 0.237460002...
can add things to the conditions without affecting everything else (which is how `with_scope` and `named_scope` work). With `find_by_sql` however, you just give rails a big string. It doesn't know what goes where, so it's not safe for it to go in and add the things it would need to add for the scopes to work.
[ 0.4971763789653778, -0.1826820969581604, -0.20536863803863525, 0.2338605374097824, 0.11935952305793762, -0.4394741952419281, 0.3652445077896118, -0.1832711547613144, -0.14416439831256866, -0.725804328918457, 0.2854919135570526, 0.3802169859409332, -0.34626853466033936, -0.0618312694132328,...
Is there something like [InstallShield](http://en.wikipedia.org/wiki/InstallShield) that I can use for free? **[WiX](http://wix.sourceforge.net/)** * **Very powerful and flexible**. * Can produce MSI packages (Microsoft deployment format of choice) * **Almost no documentation** * **Very steep learning curve.** * XML-b...
[ -0.025793639943003654, -0.24405109882354736, 0.12585999071598053, 0.07367807626724243, -0.04848555102944374, -0.060520026832818985, 0.28055933117866516, -0.09278146177530289, 0.030098311603069305, -0.987331748008728, -0.30498602986335754, 0.6195811629295349, -0.27858054637908936, -0.323412...
get things done.** * XML-based (but schema is not very user-friendly, doesn't really matter as you would use GUI editor anyway) * The best option if you have only basic installer requirements and don't have time to learn something new. **[IzPack](http://izpack.org/)** * **Cross-platform** * Maven integration * Custom...
[ 0.4367768168449402, -0.3479444682598114, 0.2286752313375473, 0.23273278772830963, 0.1637624055147171, -0.3954324424266815, 0.5056537389755249, -0.11249995976686478, -0.4051232635974884, -0.9750916957855225, -0.47627952694892883, 0.6412901878356934, 0.06749556213617325, -0.23073813319206238...
In a J2EE application (like one running in WebSphere), when I use `System.out.println()`, my text goes to standard out, which is mapped to a file by the WebSphere admin console. In an ASP.NET application (like one running in IIS), where does the output of `Console.WriteLine()` go? The IIS process must have a stdin, st...
[ -0.03145328909158707, -0.08236048370599747, 0.39298155903816223, -0.14064401388168335, -0.2882997393608093, -0.1365743726491928, 0.31011471152305603, -0.058921970427036285, -0.20480012893676758, -0.8598055243492126, -0.1894153505563736, 0.26385498046875, -0.1378447413444519, -0.01982121542...
can change the `TextWriter`, but it still didn't answer the question on what the initial value of the Console is, or how to set it in config/outside of runtime code. If you look at the `Console` class in [.NET Reflector](http://en.wikipedia.org/wiki/.NET_Reflector), you'll find that if a process doesn't have an associa...
[ 0.026436420157551765, -0.07450723648071289, 0.5494508743286133, 0.1684601753950119, 0.013063369318842888, 0.06918270140886307, 0.08498905599117279, -0.2123745232820511, 0.14230594038963318, -0.6016584634780884, 0.06521940976381302, 0.5585954785346985, -0.11847341805696487, 0.21336087584495...
from calling `SetOut`, there is no way to configure the default. **Update 2020-11-02**: As this answer is still gathering votes in 2020, it should probably be noted that under ASP.NET Core, there usually *is* a console attached. You can configure the [ASP.NET Core IIS Module](https://learn.microsoft.com/en-us/aspnet/c...
[ 0.13938789069652557, -0.33720695972442627, 0.7197754383087158, 0.1900743693113327, 0.11894333362579346, -0.2131635695695877, 0.25787970423698425, -0.26720795035362244, -0.25498390197753906, -1.0225424766540527, -0.40609920024871826, 0.4736975431442261, -0.3438057005405426, 0.06086738035082...
stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" /> <system.webServer> ```
[ -0.09433421492576599, 0.2320222109556198, 0.32992902398109436, 0.09266252815723419, 0.1973540037870407, -0.14404462277889252, 0.4947267472743988, 0.08777733892202377, -0.1367071270942688, -0.5848544836044312, -0.42193078994750977, 0.5538697838783264, -0.23927320539951324, 0.000749175669625...
I setup phpMyID on one of my machines, and I'm trying to get apache to redirect to HTTPS only when a password is being submitted. I am doing this as my original setup of redirecting all openid traffic didn't work stackoverflow doesn't like my self signed certificate. This is the new rule I've written, but its not worki...
[ -0.2218068689107895, 0.27677813172340393, 1.0141266584396362, -0.13838982582092285, -0.10240041464567184, -0.367479145526886, 0.5829022526741028, -0.5896695852279663, 0.09228882193565369, -0.8099880814552307, 0.2703987658023834, 0.6859264969825745, -0.3514808714389801, 0.19902774691581726,...
There are a lot of new features that came with the .Net Framework 3.5. Most of the posts and info on the subject list stuff about new 3.5 features and C# 3 changes at the same time. But C# 3 can be used without .Net 3.5. Does anyone know of a good post describing the changes to the language? (Besides the boring, explic...
[ 0.5564782619476318, 0.27824732661247253, -0.016919972375035286, -0.05148663371801376, -0.3428877294063568, -0.002366940723732114, 0.19967524707317352, 0.2597846984863281, -0.44921332597732544, -0.5365527868270874, -0.01210791990160942, 0.6187114119529724, -0.14312045276165009, 0.0392995290...
esp the section on language features.
[ 0.13217100501060486, 0.140638068318367, -0.14463387429714203, -0.17299698293209076, 0.1353696584701538, -0.058793507516384125, 0.4339042007923126, 0.4172011911869049, 0.005480972584336996, -0.582495927810669, -0.6936342120170593, 0.622469961643219, 0.2415429949760437, -0.6287582516670227, ...
Is there a better unit testing tool than [WaTiR](http://wtr.rubyforge.org/) for Ruby web testing? Or is the defacto standard? What unit testing tools do you use? I didn't feel that I could mark any 1 of these as an answer. From what I see from the responses, is that WaTiR is one of the best if you're sticking with Ru...
[ 0.5582184195518494, 0.15624038875102997, -0.4780272841453552, 0.296977162361145, -0.37299391627311707, -0.06155878305435181, 0.592242956161499, -0.3242734372615814, 0.006882847752422094, -0.5002029538154602, 0.009544956497848034, 0.48406144976615906, -0.039984080940485, 0.01599954813718795...
[Functional Testing Tools Roundup](http://www.hanselminutes.com/default.aspx?showID=11) that sort of talks about this question. When it comes down to it, I think the answer is that WaTiR is a great testing tool if it fits your situation.
[ 0.23142604529857635, -0.135484978556633, 0.10286643356084824, 0.16145606338977814, -0.4590013921260834, -0.29216206073760986, 0.22763171792030334, -0.2842356264591217, -0.15348248183727264, -0.28153902292251587, 0.13694548606872559, 0.5656044483184814, 0.2936058044433594, 0.019848821684718...
This is aquamacs 1.5 on a macbook. Exact error when I try to spell-check: Error: The file "/Library/Application Support/cocoAspell/aspell6-en-6.0-0//en-common.rws" is not in the proper format. Wrong endian order. ADDED: I indeed had the wrong version of cocoAspell. But installing the right version didn't work until I...
[ -0.07651513814926147, 0.03235948830842972, 0.3375161290168762, 0.022377638146281242, 0.07727969437837601, -0.2931388020515442, 0.4577712118625641, 0.2991284430027008, -0.3987545371055603, -0.737234890460968, -0.1283658742904663, 0.6988476514816284, -0.2446727305650711, -0.12142273038625717...
How to post a username, password and multiple binary files from a single html form and process it using php? I'm not allowed to use ajax. first off check out these pages on PHP.net 1. [file upload info](http://us3.php.net/features.file-upload) 2. [`move_uploaded_file`](http://us3.php.net/manual/en/function.move-upload...
[ 0.5250127911567688, 0.12409702688455582, 0.510315477848053, -0.07072282582521439, -0.13725948333740234, -0.26525166630744934, 0.09521187096834183, -0.24206045269966125, -0.22344206273555756, -0.9511063694953918, 0.1429457664489746, 0.2403564453125, -0.07521018385887146, -0.0858752802014350...
/> <input type="file" name="uploadFile[]" /><br /> <input type="file" name="uploadFile[]" /><br /> <!-- Add as many of these as you want --> </p> <p> <input type="submit" /> </p> </form> </body> </html> ``` **processStuff.php** ``` <pre> <?...
[ 0.4597107172012329, -0.16482272744178772, 0.24013261497020721, -0.11223524063825607, -0.10161668807268143, 0.27225762605667114, 0.07757216691970825, -0.873932421207428, -0.26535624265670776, -0.3304907977581024, -0.15629900991916656, 0.44870343804359436, -0.13027580082416534, -0.3826339840...
'<h2>Username & password</h2>' echo "Username: {$_POST['username']}\nPassword: {$_POST['password']}"; echo '<hr />'; echo '<h2>Uploaded files</h2>' foreach($_FILES['uploadFile']['tmp_name'] as $i => $tempUploadPath) { if (empty($tempUploadPath)) { // this <input type="file" /> was...
[ 0.23994885385036469, 0.01878492347896099, 0.3330482840538025, -0.2524207532405853, -0.07146499305963516, 0.1174425333738327, 0.5903414487838745, -0.8643090128898621, -0.21124078333377838, -0.6016625165939331, -0.43052777647972107, 0.39147132635116577, -0.5785251259803772, 0.079806014895439...
echo '<strong>A file named "', $_FILES['uploadFile']['name'][$i], "\" was uploaded</strong>\n"; echo "\ttemporarily stored at: ", $tempUploadPath, "\n"; echo "\tmime type: ", $_FILES['uploadFile']['type'][$i], "\n"; echo "\tsize: ", $_FILES['uploadFile']['size'][$i], " by...
[ 0.376637727022171, -0.18552160263061523, -0.12116020172834396, -0.14090466499328613, -0.10936977714300156, 0.11480262130498886, 0.700779914855957, -0.6056800484657288, -0.09732168167829514, -0.19221872091293335, -0.2077556848526001, 0.23007479310035706, -0.7539983987808228, 0.1423023939132...
((empty($_FILES['uploadFile']['size'][$i]) ? '<em>no errror</em>' : $_FILES['uploadFile']['size'][$i])), "\n\n"; // do something useful with the uploaded file // access it via $tempUploadPath and use move_uploaded_file() to move
[ -0.050457995384931564, -0.26178085803985596, 0.6305022239685059, -0.09329945594072342, 0.31178319454193115, 0.29470738768577576, 0.15670832991600037, -0.06779862195253372, -0.26564106345176697, -0.7586650252342224, -0.44567134976387024, 0.5036005973815918, -0.38116654753685, 0.116752691566...
// it out of the temp path before you manipulate it in any way!!!!! // see http://us3.php.net/features.file-upload // and http://us3.php.net/manual/en/function.move-uploaded-file.php } } ?> </pre> ``` The HTML file shows how to set the `enctype` of the `<form>` & the second for...
[ 0.4970911741256714, -0.39078715443611145, 0.6825263500213623, 0.1464897096157074, 0.13319694995880127, -0.03151616081595421, 0.20998023450374603, -0.16946813464164734, -0.2649511396884918, -0.5396531820297241, -0.3419044017791748, 0.19869711995124817, -0.06158766523003578, -0.2121198475360...
the file(s) ASAP. They're uploaded to a temp location and the system will delete them unless you deal with them. So move 'em somewhere first then do whatever you need w/ them. Hoep this helps Arin
[ 0.6911217570304871, 0.2352837473154068, 0.15556275844573975, 0.4859321117401123, 0.11332789808511734, -0.00460464134812355, 0.015924980863928795, 0.11262498795986176, -0.25808098912239075, -0.5561819672584534, -0.23638196289539337, 0.5258154273033142, -0.012780904769897461, -0.124764122068...
I would like to know and understand the steps involved in fetching mail from pop3 server using plain c language Steps: 1. Connect to the server's port (usually 995) using [OpenSSL](http://www.openssl.org/docs/ssl/ssl.html) 2. Verify the certificate 3. Send regular pop3 commands over the SSL socket you just opened. (LI...
[ 0.3119298815727234, -0.026259560137987137, 0.6573144197463989, 0.2920140326023102, -0.22437043488025665, -0.012804693542420864, 0.29256951808929443, 0.06737063825130463, -0.1480298936367035, -0.5626670122146606, -0.2777565121650696, 0.12290533632040024, -0.23327191174030304, -0.04318381100...
I am fascinated by the performance of applications such as "Rollercoaster Tycoon" and "The Sims" and FPS games. I would like to know more about the basic application architecture. (Not so concerned with the UI - I assume MVC/MVP piriciples apply here. Nor am I concerned with the math and physics at this point.) My mai...
[ 0.3750045895576477, 0.0628112331032753, 0.16009512543678284, 0.5472537875175476, -0.11077560484409332, 0.39083898067474365, -0.11603976786136627, 0.07967773824930191, -0.38732609152793884, -0.6697520613670349, 0.14351403713226318, 0.525283694267273, 0.1558883637189865, -0.08313989639282227...
are these objects being processed in a giant loop, one at a time - or is each object processing in it's own thread**? How many threads are practical in a simulation like this? (Ballpark figure of course, 10, 100, 1000) I'm not looking to write a game, I just want the design theory because I'm wondering if such design ...
[ 0.2426653653383255, -0.2303052395582199, 0.009132449515163898, 0.4629896283149719, 0.09256376326084137, 0.060025181621313095, -0.08724008500576019, 0.02843506820499897, -0.40902870893478394, -0.6516892910003662, 0.5413883924484253, 0.3440752923488617, -0.4397493004798889, 0.129557460546493...
be represented by an instance of a class with properties and behaviors, all the interactions between the entities would have to be explicitly defined and when you want these entities to interact a function gets called the properties of the interacting entities gets changed. System Dynamics is completely different, it...
[ -0.038360346108675, -0.3373485803604126, -0.004186021164059639, 0.4864024519920349, -0.13379423320293427, 0.20095962285995483, -0.0405409149825573, -0.27416476607322693, -0.5546175241470337, -0.5506525039672852, 0.28133147954940796, 0.4324871003627777, -0.3923252522945404, 0.35596317052841...
there are multiple formulas that you have to calculate, the time to calculate is independent of the values in the formula. But there is no way to look at an individual entity in this approach. The Agent based approach lets you put entities in specific locations and lets you interact with specific entities in your simul...
[ 0.21136265993118286, -0.3633422553539276, -0.12587954103946686, 0.40441372990608215, 0.1688646823167801, 0.07737892866134644, 0.0812898799777031, 0.040824778378009796, -0.486236035823822, -0.7154343724250793, 0.04145096614956856, 0.16412237286567688, -0.5904479026794434, 0.0276049710810184...
you will probably not have one big huge model that does everything but multiple systems that do specific tasks, some of these will not need to be updated very often e.g. something that determines the weather, others might need constant updates. Even if you put them in separate threads you will want to pause or start th...
[ 0.5301218628883362, -0.4483037292957306, 0.13170678913593292, 0.5358844995498657, 0.09470397979021072, -0.03800652176141739, 0.19670908153057098, 0.06801033765077591, -0.696179211139679, -0.6845694184303284, 0.21628466248512268, 0.26159217953681946, -0.4096487760543823, -0.0103074982762336...
I've wanted this for fluent interfaces. See, for example [this](http://channel9.msdn.com/forums/Coffeehouse/257556-C-Extension-Properties/) Channel9 discussion. Would probably [require](http://ayende.com/Blog/archive/2007/12/02/Why-C-doesnt-have-extension-properties.aspx) also adding indexed properties. What are your ...
[ -0.1356872320175171, 0.053150955587625504, 0.46890002489089966, -0.07327597588300705, -0.2664511501789093, -0.04700816050171852, 0.30642279982566833, -0.15929162502288818, -0.19448314607143402, -0.5311939716339111, -0.0459778867661953, 0.7345666885375977, -0.34429118037223816, 0.1028742343...
the Is as a property unless I directly modify the source on the session object.
[ 0.004701422061771154, 0.2180548906326294, 0.3236532211303711, -0.06292281299829483, 0.01804138533771038, -0.5037074089050293, 0.22273962199687958, 0.22754532098770142, 0.08128762245178223, -0.5491281747817993, -0.5237572193145752, 0.505381166934967, -0.12055246531963348, 0.6370885968208313...
I have a report in SSRS 2005 that's based on a query that's similar to this one: ``` SELECT * FROM MyTable (NOLOCK) WHERE col1 = 'ABC' AND col2 LIKE '%XYZ%' ``` I need to be able to dynamically include the AND part of the WHERE clause in the query based on whether the user has checked a checkbox. Basically, this i...
[ -0.3160570561885834, 0.23804569244384766, 0.269654780626297, -0.2735099196434021, -0.4044683575630188, 0.03704053536057472, 0.11055617034435272, -0.09867565333843231, -0.4538240432739258, -0.10593151301145554, 0.07332446426153183, 0.20589101314544678, -0.7213564515113831, 0.214376196265220...
AND (@checked = 0 OR col2 LIKE '%XYZ%') ``` This is a classic "pattern" in SQL for conditional predicates. If `@checked = 0`, then it will return all rows matching the remainder of the predicate (`col1 = 'ABC'`). SQL Server won't even process the second half of the `OR`. If `@checked = 1` then it will evaluate the s...
[ 0.03422900661826134, -0.09525460004806519, 0.20821601152420044, -0.22871685028076172, -0.1635136753320694, 0.06965559720993042, -0.19300268590450287, -0.15763811767101288, -0.1657673716545105, -0.42205068469047546, -0.2503136396408081, 0.3217485845088959, -0.5188382863998413, 0.19817957282...
col1 = 'ABC' AND (@checked1 = 0 OR col2 LIKE '%XYZ%') AND (@checked2 = 0 OR col3 LIKE '%MNO%') ``` Don't use dynamic SQL, don't use IF or CASE.
[ -0.1975695788860321, 0.19624777138233185, 0.15964239835739136, -0.1942659467458725, 0.0015518307918682694, -0.08424444496631622, 0.07264718413352966, 0.12593992054462433, -0.05295715108513832, -0.3821205198764801, -0.23180167376995087, 0.29059088230133057, -0.7599690556526184, -0.064364761...
How do I determine whether an object is a member of a collection in VBA? Specifically, I need to find out whether a table definition is a member of the `TableDefs` collection. Your best bet is to iterate over the members of the collection and see if any match what you are looking for. Trust me I have had to do this ma...
[ 0.2564239501953125, 0.005438623484224081, -0.030308768153190613, 0.09094847738742828, -0.060683585703372955, -0.11067921668291092, 0.15237538516521454, -0.2600597143173218, -0.2788013517856598, -0.5344241261482239, 0.11906682699918747, 0.5285344123840332, -0.09656764566898346, 0.2022592425...
In Java, there is a practice of declaring every variable (local or class), parameter final if they really are. Though this makes the code a lot more verbose, this helps in easy reading/grasping of the code and also prevents mistakes as the intention is clearly marked. What are your thoughts on this and what do you fo...
[ -0.08817293494939804, 0.14885279536247253, -0.21835380792617798, -0.2583986520767212, -0.4407273232936859, -0.4457956850528717, 0.4216756522655487, 0.04248568043112755, -0.36723610758781433, -0.5115678906440735, -0.24546422064304352, 0.3297642171382904, -0.3307771682739258, -0.186543032526...
possibilities that you (or the next programmer, working on your code) will misinterpret or misuse the thought process which resulted in your code. At least it should ring some bells when they now want to change your previously immutable thing. At first, it kind of looks awkward to see a lot of `final` keywords in your...
[ 0.3485661745071411, 0.012748468667268753, -0.10402924567461014, 0.23173119127750397, 0.18295897543430328, 0.12385034561157227, 0.23155222833156586, 0.08271761238574982, -0.44752949476242065, -0.49322718381881714, -0.188478022813797, 0.24373899400234222, -0.20016714930534363, 0.347229510545...
`final` I'll do it.
[ 0.007309931330382824, 0.3707497715950012, 0.5576303601264954, -0.150028795003891, -0.06479582190513611, -0.17042328417301178, 0.12271394580602646, 0.08993472158908844, 0.1600896120071411, -0.579715371131897, 0.18664485216140747, 0.503963053226471, 0.13618683815002441, 0.056439608335494995,...
We are writing a complex rich desktop application and need to offer flexibility in reporting formats so we thought we would just expose our object model to a scripting langauge. Time was when that meant VBA (which is still an option), but the managed code derivative VSTA (I think) seems to have withered on the vine. W...
[ 0.40760913491249084, 0.31134259700775146, 0.022855568677186966, -0.06743817776441574, -0.22191110253334045, -0.16580957174301147, 0.30528780817985535, 0.3790367543697357, -0.13421347737312317, -0.7308905720710754, 0.038978081196546555, 0.4080258011817932, -0.1934286653995514, 0.11912588775...
I'm working on a django app right and I'm using cherrypy as the server. Cherrypy creates a new thread for every page view. I'd like to be able to access all of these threads (threads responsible for talking to django) from within any of them. More specifically I'd like to be able to access the thread\_data for each of ...
[ 0.7539790272712708, -0.026350483298301697, 0.290274053812027, 0.11527439951896667, -0.14101240038871765, -0.049799252301454544, -0.00893570389598608, 0.4094718098640442, -0.4877742528915405, -0.5320754647254944, 0.4938240349292755, 0.49746426939964294, -0.2839415669441223, 0.16970963776111...
of them should be accessible via threading.enumerate(). However, if you're talking specifically about cherrypy.thread\_data, that's something else: a threading.local. If you're using a recent version of Python, then all that's coded in C and you (probably rightfully) don't have cross-thread access to it from Python. I...
[ 0.16868865489959717, 0.07440964132547379, 0.09902387112379074, 0.17283929884433746, 0.023654524236917496, -0.16374777257442474, 0.08121136575937271, 0.4657835364341736, -0.37786054611206055, -0.6253450512886047, -0.26610100269317627, 0.5245406031608582, -0.26556655764579773, 0.237177297472...