text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
of shared state which may be out of sync at any given time, and is minimally aware of some of the complexities of multithreaded code. * A good understanding of weak references demonstrates that a person knows about the intimate details of the garbage collector and how it decides when to free memory. Sure, you could ask...
[ 0.2638823091983795, 0.011078418232500553, 0.1294296681880951, 0.3924764394760132, -0.20643916726112366, -0.28923019766807556, 0.1470962017774582, 0.2496229112148285, -0.16180454194545746, -0.5216816067695618, -0.2396419495344162, 0.46066877245903015, -0.053275927901268005, -0.0668947324156...
would anyone need to implement their own hashtable or linked list? **A:** I'm not implying that the Dictionary class is inferior or that people should roll their own hashtable. This is a basic question which tests whether a person has a *minimal* understanding of datastructures. Thats what these questions test for: ba...
[ 0.5332601070404053, 0.23106694221496582, -0.19355934858322144, 0.2983890473842621, -0.2100929319858551, -0.17989155650138855, 0.13904081284999847, 0.13078026473522186, -0.046277403831481934, -0.48534706234931946, -0.007869761437177658, 0.4757995009422302, -0.10356590151786804, -0.042721755...
this thread is "questions every good .NET developer should know". Every .NET developer begins their career writing crud apps, and 90% of all application development people do for a living is concerned with line-of-business applications. I think questions testing a persons knowledge of line-of-business apps are appropr...
[ 0.5707235932350159, 0.6004385948181152, 0.06684620678424835, 0.3617193400859833, 0.005350217688828707, -0.24753978848457336, 0.23873718082904816, 0.14466623961925507, -0.0010418808087706566, -0.3248104155063629, 0.20401331782341003, 0.6560664772987366, 0.13353386521339417, -0.3192340731620...
I have an update query being run by a cron task that's timing out. The query takes, on average, five minutes to execute when executed in navicat. The code looks roughly like this. It's quite simple: ``` // $db is a mysqli link set_time_limit (0); // should keep the script from timing out $query = "SLOW QUERY"; $resul...
[ 0.11997489631175995, 0.02554382011294365, 0.44668203592300415, -0.08896180242300034, 0.022656971588730812, -0.07502695918083191, 0.33256515860557556, -0.14891959726810455, -0.03250929340720177, -0.5818222761154175, 0.1865319460630417, 0.5751979351043701, -0.2816047966480255, 0.156921684741...
from the command line rather than through Apache? Thanks I had the same problem somwhere, and "solved" it with the following code (first two lines of my file): ``` set_time_limit(0); ignore_user_abort(1); ```
[ 0.38857561349868774, 0.29315781593322754, 0.3701224625110626, -0.10265567153692245, 0.21156515181064606, -0.18243475258350372, 0.60594642162323, -0.18694932758808136, -0.07089469581842422, -0.41366010904312134, -0.23348625004291534, 0.45979762077331543, -0.4179607629776001, 0.0334767438471...
If I were looking to create my own language are there any tools that would help me along? I have heard of yacc but I'm wondering how I would implement features that I want in the language. The first tool I would recommend is the Dragon Book. That is the reference for building compilers. Designing a language is no easy ...
[ 0.5090774893760681, 0.062054503709077835, -0.260754257440567, 0.30573102831840515, -0.3652096390724182, -0.1482546329498291, 0.02913004718720913, 0.21926116943359375, 0.04263434186577797, -0.5576189160346985, 0.09120595455169678, 0.8643677830696106, -0.08573849499225616, -0.410571724176406...
also more modern tools for generating lexer and parser, e.g. for java there are ANTLR (I also remember javacc and CUP, but I used myself only ANTLR). The fact that ANTLR combines parser and lexer and that eclipse plugin is availabe make it very comfortable to use. But to compare them, the type of parser you need, and k...
[ -0.06873192638158798, 0.21512840688228607, -0.11413616687059402, 0.26396453380584717, -0.44094958901405334, -0.17617028951644897, -0.11500529199838638, -0.15462657809257507, -0.3282388746738434, -0.7288674712181091, 0.1664411872625351, 0.6583185791969299, -0.15460357069969177, -0.473223745...
the anwsers could be more helpful.
[ 0.3233218789100647, 0.1592809557914734, 0.09592410922050476, 0.16950678825378418, -0.1667453795671463, 0.07335925847291946, -0.09005100280046463, 0.20189246535301208, -0.1236281543970108, -0.33826249837875366, 0.030738268047571182, 0.3020141124725342, 0.1640738993883133, 0.0715401321649551...
What would you suggest for the following scenario: A dozen of developers need to build and design a complex system. This design needs to be documented for future developers and the design decisions must be noted. These reports need to be made about every two months. My question is how this project should be documente...
[ 0.6439990401268005, 0.17140311002731323, 0.01958371140062809, 0.2681390643119812, 0.27505096793174744, -0.16822637617588043, 0.06639950722455978, -0.18014290928840637, -0.34580835700035095, -0.5442165732383728, -0.009474636055529118, 0.47157609462738037, 0.004769092425704002, 0.09537319839...
much time to adjust every part. Assume that the documentation parts from each developer arrive just a few days before deadline. A collaborative system (i.e. wiki) wouldn’t work properly since there wouldn’t be anything to read until a few days before deadline. Or should a few people (2-3) be tasked with writing the...
[ 0.27510717511177063, -0.11006490141153336, -0.043505314737558365, 0.13601726293563843, 0.10357818007469177, 0.13417573273181915, 0.21035580337047577, -0.5554811358451843, 0.023926183581352234, -0.6543393731117249, -0.14836929738521576, 0.5267289280891418, 0.19566749036312103, -0.1604386568...
the first case, you'll have a domain expert who is responsible for roughing out the design of what you're going to deliver - with developers chipping in as necessary. In the second case, we use a technical author - they document the application, so they should have a good idea of how it hangs together, and you involve ...
[ 0.48712214827537537, 0.08587722480297089, 0.04302138090133667, 0.347928524017334, 0.1355305165052414, 0.09009841084480286, -0.3874427080154419, -0.00007029621338006109, -0.0029792238492518663, -0.4153997004032135, -0.35525402426719666, 0.9327001571655273, 0.2653156518936157, -0.32449704408...
*Let's say I have download links for files on my site.* When clicked these links send an AJAX request to the server which returns the URL with the location of the file. What I want to do is direct the browser to download the file when the response gets back. Is there a portable way to do this? Try this lib <https:/...
[ 0.21675075590610504, 0.10822387784719467, 0.5355392694473267, 0.031062794849276543, -0.2944831848144531, -0.30080923438072205, 0.19739773869514465, 0.2220662385225296, -0.16939449310302734, -1.026239037513733, 0.2107594609260559, 0.5520029664039612, -0.05455179139971733, 0.2479688823223114...
Has anybody had any success with developing for Android platform using Netbeans (5.5+ ) IDE? I know of atleast netbeans one plugin that is supposed to support it but wanted to hear if anyone is using netbeans for Android development and how easy it is to set it up. There is a project called nbandroid (formerly called u...
[ 0.5654773712158203, -0.0786362886428833, 0.16183747351169586, 0.04018964618444443, -0.328702837228775, -0.2207154482603073, 0.05272883549332619, 0.1286153346300125, -0.042778898030519485, -0.8035115003585815, 0.41993266344070435, 0.36020320653915405, -0.2603513300418854, 0.1979465335607528...
I know how they are different syntactically, and that C++ uses new, and C uses malloc. But how do they work, in a high-level explanation? See [What is the difference between new/delete and malloc/free?](https://stackoverflow.com/questions/240212/what-is-the-difference-between-newdelete-and-mallocfree#240308) I'm just ...
[ 0.17667405307292938, 0.07689028233289719, 0.23449236154556274, 0.06629998236894608, -0.010262418538331985, -0.0683535784482956, 0.19448482990264893, -0.4060761034488678, -0.32955414056777954, -0.3359304666519165, -0.25507852435112, 0.5313635468482971, -0.2665555477142334, -0.11612917482852...
finds an overload of an operator new allocation function, that one is called using the arguments given to new and sizeof(TypeId) as its first argument: Sample: ``` new (a, b, c) TypeId; // the function called by the compiler has to have the following signature: operator new(std::size_t size, TypeOfA a, TypeOfB b, Ty...
[ 0.020632799714803696, -0.028670592233538628, 0.03264738246798515, -0.29240262508392334, 0.21798847615718842, -0.12465599179267883, 0.13180029392242432, -0.47200536727905273, -0.06859312951564789, -0.6477383971214294, -0.2278556227684021, 0.4291037619113922, -0.47131091356277466, -0.0558162...
environment will create an object of the type given by the type-id in the memory returned by the allocation function. There are a few special allocation functions given special names: * `no-throw` new. That takes a `nothrow_t` as second argument. A new-expression of the form like the following will call an allocation...
[ -0.14049451053142548, 0.026818862184882164, 0.047488048672676086, -0.10847872495651245, 0.18975016474723816, 0.01099600549787283, 0.001361337024718523, 0.14361758530139923, -0.3492068946361542, -0.9530292749404907, -0.2040395736694336, 0.3707887828350067, -0.5364902019500732, 0.31257742643...
only create objects when needed, later. Code: ``` // the following function is defined implicitly in the standard library void * operator(std::size_t size, void * ptr) throw() { return ptr; } ``` If the allocation function returns storage, and the the constructor of the object created by the runtime throws, the...
[ 0.023379893973469734, -0.078293077647686, 0.10880714654922485, -0.20444239675998688, 0.11876344680786133, -0.017164206132292747, 0.19057942926883698, -0.2241496443748474, -0.12098632007837296, -0.6871591806411743, -0.32316169142723083, 0.6788074374198914, -0.4409526288509369, 0.12860897183...
If you call delete yourself, then the compiler will use the normal operator delete function taking only a `void*` pointer: ``` int * a = new int; => void * operator new(std::size_t size) throw(std::bad_alloc); delete a; => void operator delete(void * ptr) throw(); TypeWhosCtorThrows * a = new ("argument") TypeWhosCto...
[ -0.011558538302779198, -0.1004381775856018, 0.3047107756137848, -0.4713122844696045, -0.009694921784102917, 0.23283512890338898, 0.4062359929084778, -0.4227317273616791, -0.19094499945640564, -0.3665734827518463, -0.6473607420921326, 0.6615137457847595, -0.4659154713153839, 0.1211994439363...
plain `operator new`. The operator can be passed a first argument not exactly `sizeof(TypeId)*N`: The compiler could add some space to store the number of objects created (necassary to be able to call destructors). The Standard puts it this way: * `new T[5]` results in a call of operator `new[](sizeof(T)*5+x)`, and * ...
[ -0.09487179666757584, 0.00047086834092624485, 0.24243435263633728, -0.440463125705719, -0.10187350958585739, 0.05827455595135689, 0.05495696887373924, -0.44632983207702637, -0.11242340505123138, -0.42909717559814453, -0.5528472661972046, 0.6957496404647827, -0.24313266575336456, -0.1430640...
Is there any way to create an array-like object in JavaScript, without using the built-in array? I'm specifically concerned with behavior like this: ``` var sup = new Array(5); //sup.length here is 0 sup[0] = 'z3ero'; //sup.length here is 1 sup[1] = 'o3ne'; //sup.length here is 2 sup[4] = 'f3our'; //sup.length...
[ 0.11123105138540268, -0.032994840294122696, 0.10783404856920242, -0.18051086366176605, 0.024732671678066254, 0.054412491619586945, 0.28355228900909424, -0.3830988109111786, -0.4703936278820038, -0.5670839548110962, -0.1240248903632164, 0.5147439241409302, -0.509002685546875, -0.23254095017...
is the language not flexible enough for that? According to the [Mozilla docs](https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array), values returned by regex also do funky things with this index. Is this possible with plain javascript? Now we have ECMAScript 2015 (ECMA-262 6th Edition; E...
[ 0.02278183214366436, 0.06878885626792908, 0.5729509592056274, -0.06332133710384369, -0.028656156733632088, 0.036190252751111984, 0.07599251717329025, -0.04606518894433975, -0.34871384501457214, -0.2564775347709656, -0.13942952454090118, 0.5039798021316528, -0.7132900357246399, -0.148431345...
// http://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype-@@iterator value: () => { let index = 0; return { next: () => ({ done: index >= target.length, value: target[index++] }) }; }
[ -0.14390665292739868, -0.5968554615974426, 0.4622221291065216, -0.15915025770664215, 0.0755234956741333, 0.04576439782977104, -0.031108682975172997, -0.5878146290779114, -0.40648114681243896, -0.2751215100288391, -0.1629733443260193, 0.3126569092273712, -0.2359536737203598, -0.107793726027...
} }); const isArrayIndex = function(p) { /* an array index is a property such that ToString(ToUint32(p)) === p and ToUint(p) !== 2^32 - 1 */ const uint = p >>> 0; const s = uint + ""; return p === s && uint !== 0xffffffff; }; const p = new Proxy(target, { set: function(target, prope...
[ -0.29505085945129395, -0.3274230659008026, 0.7983266115188599, -0.05737806484103203, 0.19311608374118805, 0.1704028695821762, -0.011351928114891052, -0.5063060522079468, -0.2279490828514099, -0.36547037959098816, -0.33855706453323364, 0.4108943045139313, -0.41864681243896484, 0.16436417400...
"length") { // http://www.ecma-international.org/ecma-262/6.0/index.html#sec-arraysetlength const newLen = value >>> 0; const numberLen = +value; if (newLen !== numberLen) { throw RangeError(); } const oldLen = target.length; if (newLen >= oldLen) { ...
[ 0.02885264717042446, -0.507398247718811, 0.8458496928215027, -0.36192193627357483, -0.031372953206300735, 0.03421887382864952, 0.20973289012908936, -0.6234094500541687, -0.4507174491882324, -0.21689090132713318, -0.1460643857717514, 0.4555758535861969, -0.1388196349143982, 0.13497976958751...
newLen; return true; } else { // this case gets more complex, so it's left as an exercise to the reader return false; // should be changed when implemented! } } else if (isArrayIndex(property)) { const oldLenDesc = Object.getOwnPropertyDescriptor(target, "leng...
[ 0.10164691507816315, -0.3167688548564911, 0.610355019569397, -0.3154045045375824, 0.33885201811790466, -0.22453197836875916, 0.46090441942214966, -0.4202653169631958, -0.13703025877475739, -0.5601847767829895, -0.14862124621868134, 0.7444362044334412, -0.22238454222679138, 0.39207443594932...
const oldLen = oldLenDesc.value; const index = property >>> 0; if (index > oldLen && oldLenDesc.writable === false) { return false; } target[property] = value; if (index > oldLen) { target.length = index + 1; }
[ 0.03210397809743881, -0.11431960016489029, 0.5805989503860474, -0.20103883743286133, 0.26199573278427124, -0.036219798028469086, 0.20443007349967957, -0.4396534562110901, -0.20586208999156952, -0.5343536138534546, -0.3170265555381775, 0.6902335286140442, -0.16359972953796387, 0.29509097337...
return true; } else { target[property] = value; return true; } } }); return p; } ``` I can't guarantee this is actually totally correct, and it doesn't handle the case where you alter length to be smaller than its previous value (the behaviour there is a bit complex to get right; ...
[ 0.14200520515441895, -0.18506935238838196, 0.22847285866737366, -0.3266395926475525, 0.03780805319547653, -0.2803897261619568, 0.2970214784145355, -0.4039449691772461, -0.15550707280635834, -0.3276750147342682, -0.13400870561599731, 0.7174850702285767, -0.10013679414987564, 0.2607833147048...
you can implement it. It also doesn't mimic behaviour of [[Call]] and [[Construct]] on `Array`, which is another thing you couldn't do prior to ES6—it wasn't possible to have divergent behaviour between the two within ES code, though none of that is hard. This implements the `length` property in the same way the spec ...
[ 0.28404930233955383, -0.5062451362609863, 0.41252249479293823, 0.16627883911132812, -0.15161989629268646, -0.4583450257778168, 0.34643667936325073, -0.32037895917892456, -0.2896530032157898, -0.47455888986587524, 0.11522150039672852, 0.7585242986679077, -0.4018162488937378, -0.082549579441...
property access in the VM being constant time), and the only case in which it provides non-constant time performance is the not implemented case when `newLen - oldLen` properties are deleted (and deletion is slow in most VMs!).
[ -0.1068059504032135, -0.20075149834156036, 0.6507095098495483, 0.1522275060415268, 0.3012368679046631, -0.4011339843273163, 0.4494209587574005, -0.10866481810808182, -0.47889524698257446, -0.44514405727386475, -0.5405900478363037, 0.545201301574707, 0.02663552388548851, 0.4026445746421814,...
Looking at the [mozilla documentation](https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array), looking at the regular expression example (headed "Creating an array using the result of a match"), we have statements like: > input: A read-only property that reflects the original string again...
[ 0.17707397043704987, 0.06999930739402771, 0.25684356689453125, 0.11141884326934814, -0.2144557237625122, -0.011827969923615456, 0.06486548483371735, -0.3657424747943878, -0.19367624819278717, -0.4386524558067322, -0.012286094948649406, 0.5480311512947083, -0.42454302310943604, -0.190763220...
in EcmaScript 5, with support in newer browsers. See [Aidamina's answer](https://stackoverflow.com/questions/366047/can-read-only-properties-be-implemented-in-pure-javascript/2964881#2964881). If you need to support "older" browsers, you could use one of the methods in this answer as a fallback. --- In Firefox, Opera...
[ -0.29410770535469055, -0.007143863942474127, 0.6498070955276489, -0.09197339415550232, 0.024589549750089645, -0.13763338327407837, 0.18206115067005157, -0.665058970451355, 0.03328929841518402, -0.7737666368484497, -0.4351043105125427, 0.9043334126472473, -0.6066550612449646, -0.40293151140...
allowed, but doesn't do anything alert(myObject.readOnlyProperty); // 42 ``` If you already have an object, you can call `__defineGetter__` and `__defineSetter__`: ``` var myObject = {}; myObject.__defineGetter__("readOnlyProperty", function() { return 42; }); ``` Of course, this isn't really useful on the web bec...
[ 0.07033486664295197, -0.006798285525292158, 0.43585532903671265, 0.057269610464572906, 0.15342946350574493, -0.5725054144859314, 0.3836596608161926, 0.05453358218073845, -0.21115724742412567, -0.5835634469985962, -0.37243807315826416, 0.6180320382118225, -0.4984416961669922, 0.081247396767...
I want to create extra rules in FXCop. Custom Rules to help ensure specific best practices like checking against inline sql. I'm really looking for good resources and examples. Thanks! [This tutorial](http://www.binarycoder.net/fxcop/html/index.html) seems really comprehensive.
[ 0.6294078230857849, -0.015324501320719719, 0.0609322115778923, 0.1513848751783371, -0.02568734809756279, -0.09124473482370377, -0.14213812351226807, 0.21778100728988647, -0.1643718183040619, -0.5466413497924805, 0.29259148240089417, 0.44685328006744385, -0.18072552978992462, -0.45313587784...
I found the following code to create a tinyurl.com url: ``` http://tinyurl.com/api-create.php?url=http://myurl.com ``` This will automatically create a tinyurl url. Is there a way to do this using code, specifically C# in ASP.NET? You should probably add some error checking, etc, but this is probably the easiest way...
[ 0.2973470985889435, 0.1865084320306778, 0.7226884365081787, 0.07583735883235931, 0.14528866112232208, -0.00917719304561615, 0.010597001761198044, 0.07074148207902908, -0.36202892661094666, -0.7031795978546143, -0.1223311722278595, 0.23013795912265778, -0.2812678813934326, 0.450065076351165...
I'm trying to write a greasemonkey script, and it would be preferable for it to be able to work with images (specifically, find the darkest pixel in an image). Is there a way to do this or must I embed flash? Since it's Firefox specific, you can use a canvas element. I've never written a greasemonkey script, so I don't...
[ 0.8299672603607178, 0.36289170384407043, 0.2643800377845764, -0.35535210371017456, 0.13775469362735748, 0.07321427017450333, 0.010888650082051754, -0.13120655715465546, -0.043002888560295105, -0.8722607493400574, 0.40194180607795715, 0.6256672143936157, -0.46870186924934387, -0.30071488022...
= image.width; canvas.height = image.height; // Draw the image onto the canvas var ctx = canvas.getContext("2d"); ctx.drawImage(image, 0, 0); // Get the pixel data var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); // Loop through imageData.data - an array with 4 values per pixel: red, green, blue,...
[ 0.22979556024074554, -0.3014920949935913, 0.5327088236808777, -0.17052771151065826, -0.1721685230731964, 0.6503279805183411, 0.2855426073074341, -0.6545817255973816, -0.3474440574645996, -0.32048630714416504, -0.27039822936058044, 0.2153465896844864, -0.7118449807167053, -0.146899968385696...
= imageData.data[index + 1]; var b = imageData.data[index + 2]; var a = imageData.data[index + 3]; // Do whatever you need to do with the rgba values } } ```
[ 0.13466817140579224, 0.18117113411426544, 0.2750047743320465, -0.3723668158054352, -0.18866272270679474, 0.00782507099211216, 0.18296681344509125, -0.3525550067424774, -0.2559106647968292, -0.49757060408592224, -0.33679717779159546, 0.4858379662036896, -0.5968509912490845, 0.06437596678733...
Perhaps this is a naive question. In my understanding, ASP.NET MVC cannot work with ViewState and Postback which is fundamentals of ASP.NET forms. Is that correct? If that's it, then all ASP.NET Web Controls depending on ViewState & Postback cannot be used in ASP.NET MVC, right? ASP.NET's server-side controls work wit...
[ 0.17294755578041077, -0.13298064470291138, 0.5266008377075195, 0.2953769564628601, -0.13916762173175812, -0.21578246355056763, -0.07599703222513199, -0.364981085062027, -0.07891058176755905, -0.4723101556301117, -0.11929765343666077, 0.563992977142334, -0.4432859420776367, 0.11758103966712...
a strong separation of concerns between the UI and the code that populates that UI. At first glance, especially to hardened ASP.NET veterans, MVC can seem like a huge step backwards (if you've were coding then, visions of ASP COM development might dance in your head). But give MVC a try. It is very interesting and ...
[ 0.5043670535087585, 0.0561000257730484, -0.10017041862010956, 0.030851542949676514, -0.26910632848739624, -0.09500619024038315, 0.1256338506937027, 0.1636633425951004, -0.4484175145626068, -0.4862021803855896, -0.1546991467475891, 0.4144267737865448, -0.12078191339969635, -0.03686945140361...
I'm looking for help getting started working programmatically with audio. Specifically, the platform I'm working with exposes APIs to extract audio data from a resource (like an MP3), or to play back arbitrary data as audio. In both cases the actual data is byte arrays of 32bit floats representing 44.1 KHz stereo. Wha...
[ 0.7821187376976013, 0.2737025320529938, 0.04260289669036865, 0.3152875602245331, -0.19638687372207642, -0.17168204486370087, -0.2432050257921219, -0.24956174194812775, 0.06314996629953384, -0.2930644154548645, 0.21602652966976166, 0.7755781412124634, -0.11151690036058426, 0.208889603614807...
in the comments, what you want to look into is [PCM audio](http://en.wikipedia.org/wiki/Pulse-code_modulation). In a nutshell, [sound](http://en.wikipedia.org/wiki/Sound) is a wave that travels through air. In order to capture that sound, we use a [microphone](http://en.wikipedia.org/wiki/Microphone), which contains a...
[ 0.5786076188087463, -0.05713343992829323, 0.30244162678718567, 0.10614648461341858, 0.12142600119113922, 0.003872681874781847, -0.15498657524585724, -0.5046372413635254, -0.006827501114457846, -0.19401705265045166, -0.17997552454471588, 0.34432581067085266, 0.025966456159949303, 0.33772096...
case, stored as a pulse-code modulated (PCM) audio data. A [speaker](http://en.wikipedia.org/wiki/Loudspeaker) works in opposite; the PCM signal is converted to analog by an [digital-to-analog converter](http://en.wikipedia.org/wiki/Digital-to-analog_converter) (DAC), then the analog signal goes to the speaker where i...
[ 0.07622000575065613, 0.23187918961048126, 0.277290403842926, 0.12124521285295486, 0.0830470621585846, 0.14573825895786285, -0.08404054492712021, -0.41663631796836853, 0.07755372673273087, -0.40658456087112427, -0.19198130071163177, 0.9706825017929077, -0.36592745780944824, 0.14678396284580...
will have each audio sample have an amplitude in the range of -1 to 1. This will be dependent on the data type you are using for storing each sample. (I haven't dealt with 32-bit `float`s before, so this may be different.) **Amplification** In order to amplify the audio, (therefore, increasing the volume of the sound...
[ 0.2958546578884125, -0.09506671875715256, 0.6557515859603882, -0.013036385178565979, 0.004597192630171776, 0.05639263615012169, 0.21462507545948029, -0.9006122946739197, -0.15329492092132568, -0.4390338659286499, -0.06361036747694016, 0.8652575016021729, -0.4004826545715332, 0.142624422907...
foreach s in samples: s = s * 2 amplified_samples = amplify(original_samples) // result: amplified_samples == [0, 1, 0, -1, 0] ``` The resulting samples are now amplified by 2, and on playback, it should sound much louder than it did before. **Silence** When there are no vibrations, there is no sound. Sil...
[ 0.26277923583984375, 0.10025916248559952, 0.47572264075279236, -0.30308595299720764, -0.04717246815562248, 0.20480073988437653, 0.2975015342235565, -0.8768397569656372, -0.23294802010059357, -0.39305439591407776, -0.3012870252132416, 0.4897020161151886, -0.07958146184682846, 0.212960034608...
s = 0 silent_samples = silence(original_samples) // result: silent_samples == [0, 0, 0, 0, 0] ``` Playing back the above should result in no sound, as the membrane on the speaker is not moving at all, due to a lack of change in amplitude in the samples. **Speed Up and Down** Speeding things up and down can be ach...
[ 0.4489906430244446, -0.2093060165643692, 0.5580698847770691, -0.10753846168518066, -0.1373501718044281, 0.30460256338119507, 0.46237677335739136, -0.6537770628929138, -0.4649074077606201, -0.2947414219379425, -0.004250870551913977, 0.6174797415733337, -0.08812055736780167, 0.40460520982742...
KHz source and playing back at 44 KHz, the sound will be very fast and high pitched like birds chirping. Changing the samples themselves (and keeping a constant playback sampling rate) means that samples either (a) get thrown out or (b) are added in. *To speed up* the playback of the audio, throw out samples: ``` or...
[ 0.25643959641456604, -0.1456567645072937, 0.33269768953323364, -0.13590706884860992, -0.04430418089032173, 0.033035267144441605, -0.054576579481363297, -0.5947162508964539, 0.015348916873335838, -0.22082754969596863, 0.010243884287774563, 0.6472893953323364, -0.30173349380493164, 0.4650626...
return new_samples faster_samples = faster(original_samples) // result: silent_samples == [0, 0.2, 0.4] ``` The result of the above program is that the audio will speed up by a factor of 2, similar to playing back an audio that sampled at 22 KHz at 44 KHz. *To slow down* the playback of the audio, throw in a few s...
[ 0.5001093745231628, -0.08249574899673462, 0.6182337403297424, -0.04772327467799187, 0.08436301350593567, 0.10128899663686752, 0.3377070724964142, -0.788057267665863, -0.3195979595184326, -0.49735867977142334, -0.16308924555778503, 0.7682729959487915, -0.12110864371061325, 0.143092632293701...
= slower(original_samples) // result: silent_samples == [0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3] ``` Here, extra samples were added, thereby slowing down the playback. Here, we have an `interpolation` function that makes a "guess" as to how to fill in that extra space that much be added. **Spectrum Analysis and Sounds ...
[ 0.19970372319221497, -0.3102380335330963, 0.400483638048172, 0.05177423357963562, -0.08231064677238464, 0.008029114454984665, -0.04057107865810394, -0.7235692143440247, -0.23725156486034393, -0.452391654253006, 0.034290630370378494, 0.75199955701828, -0.08944924175739288, 0.136595621705055...
now you have the frequency components of the audio, if you change the amount of If you want to cut-off certain frequencies, you can use FFT to transform the sound data into the frequency-time domain, and zero-out the frequency components that are not desired. This is called [filtering](http://en.wikipedia.org/wiki/Ba...
[ 0.1826973855495453, -0.31936195492744446, 0.4856732189655304, -0.1401107907295227, -0.3480779230594635, -0.1323949247598648, 0.1350627988576889, -0.8178093433380127, -0.02724141627550125, -0.3929104208946228, -0.08242066204547882, 0.6692335605621338, -0.285833477973938, 0.22875873744487762...
the maximum frequency, any frequency above 11 KHz will be cut out. (For audio played back at 44 KHz, the maximum theoretical frequency that can be produced is 22 KHz. See [Nyquist–Shannon sampling theorem](http://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem).) If you want to do something like increas...
[ 0.07262853533029556, -0.25206583738327026, 0.2578941881656647, -0.011583910323679447, -0.2472337931394577, 0.029611987993121147, 0.08007816225290298, -0.5960685014724731, -0.14395685493946075, -0.3329605758190155, -0.006042592227458954, 1.0439813137054443, -0.22848540544509888, 0.325998067...
things that can be done to the samples to manipulate the audio. Just go ahead and experiment! It's the most exciting way to learn. Good luck!
[ 0.6343309879302979, 0.06223635748028755, -0.01079557090997696, 0.4816991984844208, 0.3687589764595032, -0.43477046489715576, 0.4314098656177521, 0.3285313844680786, -0.04775998368859291, -0.2772621512413025, 0.3536115884780884, 0.5489144325256348, 0.27499687671661377, 0.16680660843849182, ...
I'm new to regular expressions and would appreciate your help. I'm trying to put together an expression that will split the example string using all spaces that are not surrounded by single or double quotes. My last attempt looks like this: `(?!")` and isn't quite working. It's splitting on the space before the quote. ...
[ 0.35167771577835083, 0.015524950809776783, 0.10322754830121994, -0.045360974967479706, -0.26201727986335754, 0.20290833711624146, 0.07894270122051239, 0.043981995433568954, -0.16681735217571259, -0.538886547088623, -0.11703465133905411, 0.5145925283432007, -0.42308011651039124, -0.26698327...
Essentially, you want to grab two kinds of things from your string: sequences of characters that aren't spaces or quotes, and sequences of characters that begin and end with a quote, with no quotes in between, for two kinds of quotes. You can easily match those things with this regular expression: ``` [^\s"']+|"([^"]*...
[ 0.01572507806122303, -0.0686006098985672, 0.08230356127023697, 0.041428614407777786, -0.07541050761938095, 0.07247717678546906, -0.16831183433532715, -0.4089481830596924, -0.032563596963882446, -0.5373244881629944, -0.1282401978969574, 0.2922433018684387, -0.4720008671283722, -0.2788097858...
ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(subjectString); while (regexMatcher.find()) { if (regexMatcher.group(1) != null) { // Add double-quoted string without the quotes matchList.add(regexMatcher.group(1)); ...
[ 0.13506825268268585, -0.2743447721004486, 0.31605932116508484, -0.26080578565597534, -0.4355883300304413, 0.09342094510793686, 0.32665666937828064, -0.7952342629432678, -0.1958911120891571, -0.346954345703125, -0.25981226563453674, 0.3861589729785919, -0.6752434968948364, -0.16389955580234...
``` If you don't mind having the quotes in the returned list, you can use much simpler code: ``` List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"[^\"]*\"|'[^']*'"); Matcher regexMatcher = regex.matcher(subjectString); while (regexMatcher.find()) { matchList.add(rege...
[ 0.3264680504798889, -0.06046478450298309, 0.41493815183639526, -0.19184555113315582, -0.17446058988571167, -0.04805198684334755, 0.1919262558221817, -0.7979313135147095, -0.1619812399148941, -0.6262282133102417, -0.18552380800247192, 0.526191234588623, -0.6572604179382324, -0.1061923652887...
> **Possible Duplicate:** > > [When to use “strictfp” keyword in java?](https://stackoverflow.com/questions/517915/when-to-use-strictfp-keyword-in-java) What is the use of Strictfp method in java? `strictfp` is a method or class modifier that forces the JVM to do floating point math a certain way that is guaranteed...
[ 0.24896743893623352, -0.13547927141189575, 0.139917254447937, -0.02516198344528675, -0.22863849997520447, -0.21030518412590027, 0.1904388815164566, -0.4329133629798889, -0.46751847863197327, -0.5061686038970947, -0.053688518702983856, 0.2429542988538742, -0.4031149744987488, -0.36600384116...
Here's an example: ``` Double d = (1/3); System.out.println(d); ``` This returns 0, not 0.33333... as it should. Does anyone know? That's because `1` and `3` are treated as `integers` when you don't specify otherwise, so `1/3` evaluates to the `integer` `0` which is then cast to the `double` `0`. To fix it, try `(1...
[ 0.19097574055194855, 0.1923816055059433, -0.017060711979866028, -0.3739723861217499, 0.0490545853972435, -0.04538945481181145, 0.3339199721813202, -0.29478538036346436, -0.16485345363616943, -0.3489115238189697, -0.17598150670528412, 0.5829558372497559, -0.41571494936943054, -0.08869002759...
I'd like to make a simple html form where a person can upvote or downvote an item. However I don't like the default look of a `<input type="submit">` . What other options do I have to send a POST request than a bulky, default button? You can also make pretty buttons with just css, here's a nice article: <http://partic...
[ 0.23106083273887634, -0.45922377705574036, 0.16128325462341309, -0.004463304299861193, -0.16265404224395752, 0.2667040228843689, 0.0061677382327616215, 0.06384806334972382, -0.4528430104255676, -0.8530707955360413, 0.3047806918621063, 0.2934292256832123, -0.27888402342796326, 0.02753650769...
I'm trying to use prototype and scriptaculous to hide and display a div element but the function (below) to take advantage of the prototype setStyle property isn't working and I'm not sure what the problem is. ``` <script type="text/javascript" language="javascript"> function bodyOnload() { $('content1...
[ 0.14309896528720856, 0.03201144188642502, 0.5935083031654358, -0.36518123745918274, -0.09354937076568604, 0.054867636412382126, 0.3625134527683258, -0.5596067905426025, -0.0659584105014801, -0.7191780805587769, 0.040788862854242325, 0.3534475862979889, -0.4185449481010437, -0.0246622152626...
var slideDown = 0.5; var slideUp = 0.5; contentId = $(contentId); if (currentId != contentId) { if (currentId == null) { new Effect.SlideDown(contentId, {duration: slideDown}); } else {
[ 0.002255224622786045, -0.5135194659233093, 0.8550850749015808, -0.4010170102119446, 0.08959054946899414, -0.06801463663578033, 0.3502947688102722, -0.22753699123859406, -0.18766379356384277, -0.34941205382347107, -0.23532721400260925, 0.4059545695781708, -0.3383536636829376, 0.343269407749...
new Effect.SlideUp(currentId, {duration: slideUp}); new Effect.SlideDown(contentId, {duration: slideDown}); } currentId = contentId; } else { new Effect.SlideUp(currentId, {duration: slideUp}); currentId = null;
[ -0.046959392726421356, -0.3666713833808899, 0.8505768775939941, -0.35664671659469604, 0.10270576179027557, 0.10293695330619812, 0.15131829679012299, -0.1933046281337738, -0.41418635845184326, -0.6398502588272095, -0.3322726786136627, 0.10055875778198242, -0.5015751719474792, 0.478974848985...
} }; </script> ``` The preceding function is called as such: ``` <div id="accordion"> <div id="part1"> <div id="nav1" onclick="new Effect.Accordion('content1');"> Post a comment 1 </div> <div id="content1"> <form id="form" name="form" action="post.php" meth...
[ -0.10562816262245178, -0.2966519296169281, 0.688664972782135, -0.451858252286911, -0.0998704731464386, 0.24904988706111908, -0.11516246944665909, -0.27219557762145996, -0.14524558186531067, -0.5538989901542664, -0.3233397901058197, 0.6919330358505249, -0.49353495240211487, -0.0824688002467...
cols="20" rows="10"></textarea> <button type="submit">Post Comment</button> <input type="hidden" name="blogID" value="1" /> <input type="hidden" name="userID" value="3" /> <input type="hidden" name="parentID" value="7" /> <div class="spacer"></div></form> ...
[ -0.37072470784187317, -0.34976211190223694, 0.693780243396759, 0.05153893306851387, -0.054502129554748535, 0.2977847158908844, -0.21362590789794922, -0.30606186389923096, -0.11123809963464737, -0.5906426310539246, -0.3821312487125397, 0.29566076397895813, -0.27710604667663574, 0.0615994781...
<div id="nav2" onclick="new Effect.Accordion('content2');"> Post a comment 2 </div> <div id="content2"> <form id="form" name="form" action="post.php" method="post"> <textarea name="commentbody" cols="20" rows="10"></textarea> <button type="submit">Post Com...
[ 0.0017084786668419838, -0.28653258085250854, 0.7021581530570984, -0.0814243033528328, -0.31535804271698, 0.2031211107969284, 0.06319257616996765, -0.3972781002521515, -0.22943224012851715, -0.6239012479782104, -0.2601913511753082, 0.41726741194725037, -0.37624964118003845, -0.1096156015992...
value="1" /> <input type="hidden" name="userID" value="3" /> <input type="hidden" name="parentID" value="7" /> <div class="spacer"></div></form> </div> </div> </div> ``` Here's what happens with the code. * In both ie and firefox it does nothing but when you click on t...
[ -0.07579595595598221, -0.14015640318393707, 0.5934909582138062, -0.3391883671283722, 0.009921129792928696, -0.0141073539853096, 0.3518432080745697, -0.36761674284935, -0.2357422113418579, -0.7621482014656067, -0.048742543905973434, 0.6289524435997009, -0.42747583985328674, -0.0352342724800...
elements. Any help with be greatly appreciated. [maxnk](https://stackoverflow.com/questions/366251/#366297) already covered the main issue. But, Prototype recommends using the [`dom:loaded`](http://www.prototypejs.org/api/document/observe) event instead of `window.onload`: ``` document.observe("dom:loaded", bodyOnloa...
[ 0.09253258258104324, -0.12746866047382355, 0.21371810138225555, 0.03281697630882263, -0.06722711026668549, -0.10335537046194077, 0.19363074004650116, -0.4808277487754822, -0.2724725604057312, -0.7579575181007385, -0.014120552688837051, 0.3941276967525482, -0.4057270288467407, -0.1056791618...
It seems that any kind of graphic library like [DirectFB](http://www.directfb.org/) or [MiniGui](http://www.minigui.org/) requires some sort of underlying operation system like Linux or uClinux. I am challenged with writing a software for a micro controller with just 512kb flash, an LCD display and a touchscreen to di...
[ 0.3703015446662903, -0.12064824253320694, 0.5136552453041077, 0.2616173028945923, -0.1113363727927208, -0.05892662703990936, -0.2213296890258789, 0.2983637750148773, -0.3155887722969055, -0.9844765663146973, 0.19257362186908722, 0.5309815406799316, -0.28113436698913574, 0.26973435282707214...
array of pixels. Sometimes palletized sometimes not, but that doesnt matter, you can write yours however you want. There is tons of free code out there for drawing lines and arcs, etc. The killer may be fonts but I think you will find that a third party app will chew up all of your memory just doing fonts, you are re...
[ 0.7065971493721008, -0.11631279438734055, 0.3555656671524048, 0.3839617371559143, -0.3686302602291107, 0.03797251731157303, 0.31768593192100525, 0.07104995846748352, -0.1809147745370865, -0.7547062635421753, 0.576545238494873, 0.4660192131996155, -0.49025869369506836, -0.08036982268095016,...
to see what you are drawing, and trivial to turn a series of .bmp files into a video if you want to watch some action. If you use generic C, and no libc calls (write your own memcpy, memset, etc) this code will run anywhere, on the host for development and on the target. Fonts are going to be your killer you have to...
[ 0.6554681658744812, -0.14722216129302979, 0.36542680859565735, 0.32217854261398315, -0.04120899364352226, 0.11077584326267242, 0.1690344363451004, 0.12054241448640823, -0.4394153952598572, -0.6763824224472046, 0.15116283297538757, 0.4296448826789856, -0.3695538341999054, -0.132845833897590...
just buy one of the many lcd solutions that do all of this for you and you simply send it commands like draw "Hello World!" at some (x,y) using blue as the foreground and white as the background. Basically I think the non-os solutions are still going to use too many libraries and be too big for your specific applicat...
[ 0.5380324125289917, 0.04626473784446716, 0.08685696125030518, 0.20516733825206757, 0.0011423409450799227, 0.03565839305520058, -0.0022104165982455015, 0.551933765411377, -0.06987488269805908, -0.689224123954773, 0.37179887294769287, 0.39953216910362244, -0.35707852244377136, 0.297498017549...
some os dependent library (allows for maximum portability from one OS or not to another).
[ -0.005853855982422829, -0.1765182763338089, 0.09816908836364746, 0.36499711871147156, 0.1995471715927124, -0.2701951861381531, -0.0488910935819149, 0.3129900395870209, -0.056441303342580795, -0.7108870148658752, -0.47233808040618896, 0.3287990689277649, -0.22091643512248993, 0.101939931511...
How can I send a DELETE request with delphi 7 and the ICS component so that I can access a REST api? By the time you incorporate some third party solution you could have just written it yourself. For most if not all environments the screen is just a two dimensional array of pixels. Sometimes palletized sometimes not, ...
[ 0.4393032491207123, -0.08421659469604492, 0.527916431427002, 0.2768559455871582, -0.1318272352218628, -0.09498894214630127, 0.4560266137123108, 0.11463090032339096, -0.0362682044506073, -0.9357302188873291, 0.17738646268844604, 0.43820545077323914, -0.32293108105659485, 0.01399638410657644...
your memory just doing fonts, you are resource limited so you will want to pre-compute the fonts and just copy the bits. Make a two dimensional array of data, do all of your work on your favorite host at first, it is trivial to save .bmp files if you want to see what you are drawing, and trivial to turn a series of .b...
[ 0.4943242371082306, 0.04186510667204857, 0.23191863298416138, 0.2855290174484253, -0.061039816588163376, 0.07821668684482574, 0.08431658148765564, -0.04599284008145332, -0.3505954146385193, -0.6506354808807373, 0.17674033343791962, 0.5149433612823486, -0.3481857180595398, -0.08073947578668...
the target. Fonts are going to be your killer you have to pre-compute them but manage to squeeze that info down into as small as you can, and at runtime extract the data and copy the bits for each letter into the virtual screen as fast as you can. Or just buy one of the many lcd solutions that do all of this for you...
[ 0.44871020317077637, -0.22754280269145966, 0.2948058545589447, 0.23297463357448578, 0.05992821976542473, 0.2813778221607208, 0.1859484165906906, 0.4737589955329895, -0.0014636492123827338, -0.8643833994865417, 0.19616037607192993, 0.48960167169570923, -0.4325926601886749, 0.121940359473228...
libraries and be too big for your specific application. 2d arrays of bytes or pixels are trivial to manage yourself. Even if you are writing an application for a desktop platform I would do it this way and at the last minute copy the fully renedered screen update to some os dependent library (allows for maximum portabi...
[ 0.33887407183647156, -0.017765777185559273, 0.11450529843568802, 0.5483717322349548, -0.0322473905980587, -0.21800702810287476, 0.001521239522844553, 0.10330561548471451, -0.24661487340927124, -0.7648703455924988, 0.09147796779870987, 0.5504639148712158, -0.4807974100112915, 0.096984915435...
I have an external DLL whose source code is C#. From the documentation for the DLL, I determined that it writes its debug messages to the console using `Console.WriteLine`. I'd like to use this DLL within a WinForms application. However, what I have discovered is that I cannot see the debug messages emitted by the DLL...
[ 0.22211970388889313, 0.15919229388237, 0.5802769064903259, -0.00803313311189413, 0.10885528475046158, -0.08796091377735138, 0.11625130474567413, -0.06730792671442032, 0.12928889691829681, -0.6751120090484619, -0.1053955927491188, 0.5713282823562622, -0.16259950399398804, 0.2046291083097458...
you control (e.g. a StringWriter).
[ 0.3613784611225128, 0.012556319124996662, 0.08376885950565338, 0.399728387594223, 0.10710007697343826, -0.4608812928199768, -0.12564751505851746, -0.12330810725688934, -0.18429867923259735, -0.218351349234581, -0.3689454197883606, 0.7084945440292358, -0.20794092118740082, 0.151251450181007...
Sometimes it seems natural to have a default parameter which is an empty list. Yet [Python produces unexpected behavior in these situations](https://stackoverflow.com/questions/1132941/least-astonishment-and-the-mutable-default-argument). If for example, I have a function: ``` def my_func(working_list=[]): workin...
[ 0.09410316497087479, 0.1430569440126419, 0.11475110799074173, -0.4230826795101166, -0.3716857135295868, 0.1418449878692627, 0.22023636102676392, -0.2914256453514099, -0.6083181500434875, -0.2860772907733917, -0.28888189792633057, 0.8362878561019897, -0.364322692155838, -0.0845271423459053,...
[] # alternative: # working_list = [] if working_list is None else working_list working_list.append("a") print(working_list) ``` [The docs](https://docs.python.org/reference/compound_stmts.html#function-definitions) say you should use `None` as the default and explicitly [test for it](https://stacko...
[ 0.15620310604572296, 0.20688815414905548, 0.23332099616527557, -0.246707484126091, 0.0777287632226944, -0.11815542727708817, 0.12598024308681488, -0.3276195824146271, -0.2925286889076233, -0.08596727252006531, -0.39003264904022217, 0.6796019077301025, -0.30747538805007935, -0.1957180202007...
I am very interested in streaming data for web-applications. I have tried out some javascript libraries, but the hacks and browser-incompatibilities drive me crazy ! HTML5 will hopefully standardize streaming data, but until then, hopefully I can resort to Flash to make this work in all browsers. Unfortunately, I'm not...
[ 0.29505476355552673, 0.10476350784301758, 0.2755473852157593, 0.1884169727563858, -0.22588202357292175, -0.31536391377449036, 0.1833636462688446, 0.27472829818725586, -0.32895565032958984, -0.7899371981620789, 0.03082863800227642, 0.6407915353775024, -0.26466426253318787, 0.002703765407204...
with what you're doing, it sounds like you should be looking at [URLStream](http://help.adobe.com/en_US/AS3LCR/Flash_10.0/index.html). When you're loading things that Flash intuitively understands (MP3s, JPGs, SWFs and so on) then you would normally use a [Loader](http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/dis...
[ 0.09675806015729904, -0.03679399564862251, 0.2762012183666229, -0.048222169280052185, -0.24807418882846832, -0.36755722761154175, 0.17651674151420593, -0.213173046708107, -0.48850876092910767, -0.7097171545028687, -0.2846996486186981, 0.6118311882019043, -0.016470277681946754, -0.159215331...
I want to serialize a Dictionary that has a custom `IEqualityComparer`. I've tried using `DataContractSerializer` but I can't get the `Comparer` to be serialized. I can't use `BinaryFormatter` because of [this](https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=303278&wa=wsignin1.0). I ...
[ 0.19891253113746643, 0.12081442028284073, 0.4061676561832428, -0.1026022732257843, -0.04966207966208458, 0.2644745409488678, 0.3235195279121399, -0.08257561922073364, -0.1821032166481018, -0.7375914454460144, -0.13762173056602478, 0.4396580159664154, -0.33541473746299744, 0.086867615580558...
I am currently reading "Beginning CakePHP:From Novice to Professional" by David Golding. At one point I have to use the CLI-command "cake bake", I get the welcome-screen but when I try to bake e.g. a Controller I get the following error messages: ``` Warning: mysql_connect(): Can't connect to local MySQL server throug...
[ -0.1063121035695076, 0.36406806111335754, 0.5054454803466797, -0.2750598192214966, -0.059386175125837326, -0.07624690979719162, 0.21318721771240234, -0.15338470041751862, 0.011052489280700684, -0.6465290188789368, -0.44229909777641296, 0.39366862177848816, -0.03220615163445473, 0.064765378...
Your database does not have any tables. ``` I suspect that the error-messages has to do with php trying to access the wrong mysql-socket, namely the default osx mysql-socket - instead of the one that MAMP uses. Hence I change my database configurations to connect to the UNIX mysql-socket (:/Applications/MAMP/tmp/mysq...
[ 0.008241715840995312, 0.2000303417444229, 0.39830461144447327, 0.2160363495349884, 0.13413220643997192, -0.03517542779445648, 0.3243272304534912, 0.03624149411916733, -0.28694263100624084, -0.6582241654396057, 0.36994314193725586, 0.6379263401031494, -0.5286124348640442, 0.3644543290138244...
'login' => 'my_user', 'password' => 'my_pass', 'database' => 'blog', 'prefix' => '', ); } ``` But I get the same error-messages with the new socket: ``` Warning: mysql_connect(): Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock:3306' (2) in /App...
[ -0.16858860850334167, 0.12504206597805023, 0.6306362748146057, 0.04079321399331093, 0.22540399432182312, 0.145431786775589, 0.5138415694236755, 0.11115127801895142, -0.3374716639518738, -0.6544901132583618, -0.44923484325408936, 0.46946659684181213, -0.47901979088783264, 0.2429581284523010...
not a valid MySQL-Link resource in /Applications/MAMP/htdocs/blog/cake/libs/model/datasources/dbo/dbo_mysql.php on line 154 Error: Your database does not have any tables. ``` Also, even though I use the UNIX-socket that MAMP show on it's welcome-screen, CakePHP loses the database-connection, when using this socket in...
[ 0.40384113788604736, 0.3399326205253601, 0.20114995539188385, 0.12789085507392883, -0.21584734320640564, -0.25253957509994507, 0.5859600901603699, 0.23284991085529327, -0.315089613199234, -0.7253600358963013, 0.19691292941570282, 0.4511916935443878, -0.17394722998142242, 0.1660098582506179...
can be a security enhancement, # if all processes that need to connect to mysqld run on the same host. # All interaction with mysqld must be made via Unix sockets or named pipes. # Note that using this option without enabling named pipes on Windows # (via the "enable-named-pipe" option) will render mysqld useless! # #...
[ 0.24663524329662323, 0.05155712366104126, 0.2496267706155777, 0.18485772609710693, 0.12159404903650284, -0.3608117699623108, 0.40624016523361206, 0.27920448780059814, -0.26170456409454346, -0.8400185108184814, -0.19059008359909058, 0.5050907731056213, -0.30843740701675415, 0.46123409271240...
I removed the leading colon in the host-parameter, same result. From the error, it looks like it's trying to connect to an actual IP address and not a UNIX socket, look: ``` '/Applications/MAMP/tmp/mysql/mysql.sock:3306' ``` It's appending a port to the socket, which is wrong. So, I'd first try to configure MySQL...
[ -0.15591564774513245, 0.07497818022966385, 0.375562846660614, -0.05058131739497185, -0.05087744817137718, 0.0030687497928738594, 0.3418414890766144, 0.27655214071273804, -0.29975369572639465, -0.8799583315849304, 0.00037103809881955385, 0.49362125992774963, -0.34372732043266296, 0.50786995...
I'm having issues getting Firefox to update a webpage when its class is changed dynamically. I'm using an HTML `table` element. When the user clicks a cell in the table header, my script toggles the class back and forth between `sorted_asc` and `sorted_des`. I have pseudo element which adds an arrow glyph (pointing up...
[ 0.12893064320087433, 0.40192580223083496, 0.3609583079814911, -0.25142034888267517, 0.01666313409805298, 0.021082377061247826, 0.28685230016708374, -0.0925736278295517, -0.25313782691955566, -0.7135853171348572, -0.0339507982134819, 0.3972620964050293, -0.6295459866523743, 0.12040923535823...
think it's a bug as it works fine in Safari, and as I don't see any `:hover` tags in my CSS or other entries that might interfere. Anyone seen this before, or know how to work around the issue? It's kind of cheesy, but since you're using javascript anyway, try this after you changed the className: ``` document.body.s...
[ 0.47246187925338745, 0.254036545753479, 0.13481003046035767, -0.10147475451231003, 0.22760261595249176, -0.24290838837623596, 0.2658815383911133, 0.26550808548927307, -0.38946962356567383, -0.812994122505188, 0.014236160553991795, 0.5608326196670532, -0.32834261655807495, -0.17513360083103...
Having a table with a column like: `mydate DATETIME` ... I have a query such as: ``` SELECT SUM(foo), mydate FROM a_table GROUP BY a_table.mydate; ``` This will group by the full `datetime`, including hours and minutes. I wish to make the group by, only by the date `YYYY/MM/DD` not by the `YYYY/MM/DD/HH/mm`. How t...
[ 0.04786405339837074, 0.17756646871566772, 0.5354738831520081, -0.25444644689559937, -0.021845808252692223, 0.2699233293533325, -0.15520355105400085, -0.31363359093666077, -0.37752071022987366, -0.6264098286628723, -0.0006743934936821461, 0.26495516300201416, -0.07536241412162781, 0.1519112...
There is a socket related function call in my code, that function is from another module thus out of my control, the problem is that it blocks for hours occasionally, which is totally unacceptable, How can I limit the function execution time from my code? I guess the solution must utilize another thread. I'm not sure h...
[ 0.4884834289550781, 0.0013326845364645123, 0.07882904261350632, -0.04263317957520485, -0.22564439475536346, -0.17785383760929108, 0.36826661229133606, 0.14365801215171814, -0.5394400358200073, -0.5625839233398438, 0.03578460216522217, 0.60296630859375, -0.36988362669944763, 0.1976699680089...
signal def signal_handler(signum, frame): raise Exception("Timed out!") signal.signal(signal.SIGALRM, signal_handler) signal.alarm(10) # Ten seconds try: long_function_call() except Exception, msg: print "Timed out!" ```
[ 0.04959622770547867, -0.07154481112957001, 0.320794939994812, -0.27946946024894714, 0.08124362677335739, 0.15470723807811737, 0.5781336426734924, -0.42185863852500916, -0.29923954606056213, -0.3365924060344696, -0.26538336277008057, 0.24871201813220978, -0.3531186282634735, -0.048047069460...
I create business applications with heavy database use. Most of the programming work is just to connect components to the database and modifying components to adapt to general interface behaviour. I mostly use Delphi with its rich VCL library, and generally buy components needed. I keep most of the business logic in th...
[ 0.33711349964141846, 0.6413750648498535, -0.08193022757768631, -0.15198354423046112, -0.08070938289165497, -0.06072456017136574, 0.38297346234321594, 0.2627292573451996, -0.1132582500576973, -0.40677016973495483, -0.13142743706703186, 0.6083410382270813, -0.37779319286346436, -0.0169291049...
meaning that subclassing is fairly often used because it's a convenient method for re-use, technical inheritance. Closures and lambdas of C# make inheritance for technical reasons much less relevant. So normally inheritance is used for semantic reasons (like cat extends animal). The last C# project I worked on, we mo...
[ 0.19926315546035767, -0.16053488850593567, -0.13247579336166382, 0.012201478704810143, -0.25834062695503235, -0.26794666051864624, 0.3991144895553589, 0.0066889370791614056, -0.335575670003891, -0.48581427335739136, -0.1330345720052719, 0.2301921844482422, -0.39309293031692505, 0.195935443...
I was asked to manage and develop a project. The client does not really care if I hire people who would do it or I do it myself. Thus, I've decided to be more manager than developer. Are there any (free / low cost) web projects that could help me to communicate with each "sub-developer" outta there on Internet? What...
[ 0.6418376564979553, 0.23612239956855774, -0.14222405850887299, -0.03025255911052227, -0.02820650115609169, -0.05126535892486572, 0.18837329745292664, 0.07126448303461075, -0.29347342252731323, -0.5376082062721252, 0.20725437998771667, 0.2957299053668976, 0.08843746036291122, 0.192013919353...
possible similar service to know this. If you have some real-life experience with this kind of problem I'm about to encounter, please, write it here. Thank you As many open source projects found, [trac](http://trac.edgewall.org/) is a good fit - lightweight project management with integrated [subversion](http://svn....
[ 0.3933257460594177, -0.12658387422561646, 0.09454957395792007, 0.3409872055053711, -0.00026740049361251295, -0.37010782957077026, 0.032517191022634506, -0.010135543532669544, -0.12294574826955795, -0.5483383536338806, 0.08865289390087128, 0.55826735496521, -0.17474715411663055, -0.14892968...
provides an interface to Subversion, an integrated Wiki and convenient reporting facilities. > > > Trac allows wiki markup in issue descriptions and commit messages, creating links and seamless references between bugs, tasks, changesets, files and wiki pages. A timeline shows all current and past project events in or...
[ 0.49440261721611023, -0.2923373579978943, 0.17030277848243713, 0.26937776803970337, -0.0503263920545578, -0.16135400533676147, 0.22468063235282898, 0.224537655711174, -0.1689898669719696, -0.5855684876441956, -0.21046610176563263, 0.41617560386657715, -0.1570223718881607, 0.065720260143280...
Premise ======= I believe that there is a way to objectively define "Good" and "Bad" Object-Oriented design techniques and that, as a community we can determine what these are. This is an academic exercise. If done with seriousness and resolve, I believe it can be of great benefit to the community as a whole. The comm...
[ 1.092038869857788, 0.2521401643753052, -0.23675712943077087, 0.4003867506980896, 0.10669661313295364, -0.2745257318019867, 0.4533292353153229, -0.32084327936172485, 0.2371457815170288, -0.42801305651664734, -0.0652543157339096, 0.5482760667800903, -0.012066961266100407, 0.06596773117780685...
other type of languages). I'm not planning on accepting one answer, instead I'd like the answers to contribute to the final collection or be a rational debate of the issues. I realize that this may controversial, but I believe we can iron something out. There are exceptions to most every rule and I believe this is wh...
[ 0.288191556930542, 0.22280381619930267, 0.06206703558564186, 0.10759429633617401, -0.089461550116539, -0.12808823585510254, 0.5215625166893005, -0.10716786235570908, -0.07165390253067017, -0.4904904365539551, -0.15085649490356445, 0.7468462586402893, -0.2572634220123291, -0.234471023082733...