text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
a very good database for the solution, but now I'm wondering if I should scrap the code and write a SQL Server data provider instead (I know .Net already provides one, but it doesn't alone fit my business requirements for authorization).
Anyway, so I'm trying to think through this problem from a high level perspectiv... | [
0.4419536590576172,
0.2556535005569458,
-0.2074415683746338,
0.276441752910614,
0.2224900722503662,
-0.433087021112442,
0.4025728702545166,
0.1424499899148941,
-0.40867188572883606,
-0.42936015129089355,
0.31561899185180664,
0.4307745397090912,
-0.18207669258117676,
0.14690327644348145,
... | |
to AD either, just a situation where you had to evaluate between a good software solution and it's server maintenance constraints.
In general, the usability of a product is what makes people to choose between it and similar products. If the product has bad usability, the users won't care how high quality its code is - ... | [
0.7089765071868896,
0.6416672468185425,
0.3430342972278595,
0.0851931944489479,
-0.08005547523498535,
-0.003065234050154686,
0.10960576683282852,
-0.15174520015716553,
0.2420947104692459,
-0.5612949132919312,
0.06881608068943024,
0.6191704273223877,
-0.3433815836906433,
0.09482253342866898... | |
that will save many hours of work from the administrators.
One way to think about it, is first designing what would be the most usable solution from the end user's/administrator's viewpoint, and then making it an intellectual challenge to actually implement that optimal solution. It will probably require more effort f... | [
0.4935521185398102,
0.24256017804145813,
0.15584494173526764,
0.13493205606937408,
0.11500413715839386,
-0.3754206895828247,
0.05375106632709503,
-0.1044212207198143,
-0.14885666966438293,
-0.8237112760543823,
-0.10101842135190964,
0.6939499974250793,
-0.2165958136320114,
0.203501448035240... | |
tools - and those design decisions affect all levels of ZFS (for example storage pools).
As another example, I've been recently planning how do maintenance in a future project of mine - a distributed database and application server. Thinking about how typical administration tasks will happen (installing/upgrading appl... | [
0.27024030685424805,
0.21731136739253998,
0.12440326809883118,
0.49329179525375366,
0.12027256935834885,
-0.16214899718761444,
-0.18504589796066284,
-0.1565222442150116,
-0.24871233105659485,
-0.9388304948806763,
-0.11721821874380112,
0.6806037425994873,
-0.06325604021549225,
-0.0234150625... | |
Have a series of functions I am calling dynamically sort of like this:
```
$function = 'someFunction';
$x = $function();
```
.. however, if the function expects parameters, and I don't code it in the call, I seem to crash the page. For example:
```
function someFunction( $in_param1 ) {
return "SUCCESS";
}
$funct... | [
0.274383544921875,
0.017820706591010094,
0.2534898817539215,
0.06025490537285805,
-0.0065412139520049095,
-0.07134921848773956,
0.5222116112709045,
-0.2778845429420471,
-0.35127684473991394,
-0.35243815183639526,
-0.25251030921936035,
0.7955071926116943,
-0.32243403792381287,
0.10848376154... | |
I'm looking to write unit tests for a method such as this one:
```
public override bool ChangePasswordQuestionAndAnswer(string username, string password, string newPasswordQuestion, string newPasswordAnswer)
{
ISPMembershipUserDao userDao = GetISPMembershipUserDao();
if (ValidateUser(username, password))
... | [
-0.1464845836162567,
-0.009449220262467861,
0.9756976366043091,
-0.2677583694458008,
0.01992129534482956,
-0.06012670323252678,
0.42425936460494995,
-0.6467050909996033,
-0.19196000695228577,
-0.564588725566864,
-0.03702539950609207,
0.3596535921096802,
-0.1454855501651764,
0.1504037529230... | |
method to test. I'm using the Rhino Mocks framework. But one aspect has me questioning myself. I stub the DAO object and its save method, and I'm wondering how deeply I should test that user object that is passed to the save method. Should I assert that *every* property of that object is as I expect it to be? Or should... | [
0.2798473536968231,
0.11636574566364288,
0.13949215412139893,
0.06776358932256699,
-0.1806935966014862,
0.07865718007087708,
0.19781996309757233,
-0.39202022552490234,
-0.12021150439977646,
-0.38363251090049744,
0.42945584654808044,
0.6016956567764282,
-0.1711382269859314,
0.00814115535467... | |
hoping some people could give their opinions on this. Is there a rule of thumb or pattern to keep in mind for these types of situations?
**Warning: personal opinion ahead**
Ok, now that that's out of the way.... for me, it comes down to what I need to do to feel that my code properly implements the needed logic. In th... | [
0.20800822973251343,
0.12912096083164215,
0.19928543269634247,
0.04983653500676155,
0.01773044839501381,
0.1750514954328537,
0.6374599933624268,
-0.15434615314006805,
0.004440171178430319,
-0.423383891582489,
0.19343188405036926,
0.7456336617469788,
-0.27368152141571045,
-0.568355202674865... | |
and answer
- No checks of other properties on user object
However, if/when I got a bug filed that affected this part of the code, I'd add whatever (initially failing) tests were needed to cover the bug, fix the bug, and leave the tests. | [
0.49214911460876465,
0.31808724999427795,
-0.0466182567179203,
0.3181612491607666,
-0.11238721013069153,
-0.25057804584503174,
0.36885571479797363,
-0.15961477160453796,
-0.09590298682451248,
-0.23190827667713165,
-0.10080945491790771,
0.3034502863883972,
-0.005095246247947216,
-0.09497756... | |
What are CAD applications (Rhino, Autocad) of today written in and how are they organized internally ?
I gave as an example, Autocad and Rhino, although I would love to hear of other examples as well. I'm particularly interested in knowing what is their backend written in (multilanguage ?) and how is it organized, and... | [
0.5067721009254456,
0.2511756718158722,
-0.11787146329879761,
0.3359827399253845,
-0.08747312426567078,
-0.021169807761907578,
-0.303880512714386,
-0.06471442431211472,
-0.24691706895828247,
-0.6014482378959656,
0.06507199257612228,
0.7322842478752136,
-0.2305232435464859,
0.05761870741844... | |
most of you who have used them know, they handle amongs other things relatively complex rotational operations in realtime (shading is not interesting me). I've been doing some experiments with several packages recently, and for some larger models found that there is considerable difference in speed in, for example, pro... | [
0.14191889762878418,
0.033738475292921066,
0.2394714057445526,
0.269524484872818,
-0.1345398724079132,
0.05526978522539139,
-0.3855789303779602,
0.18250176310539246,
-0.7064465880393982,
-0.2812674641609192,
0.2584567070007324,
0.8950995206832886,
0.4043976366519928,
-0.024163581430912018,... | |
written in C++. It exposes a COM interface, as well as a .Net wrapper. Also, it graphics display is componentized and could be possibly replaced.
Way back in its history it used be cross-platform. However its been Windows only for about 10 years and now takes advantage every Windows feature I've seen.
You may be intere... | [
0.1075487807393074,
-0.15508757531642914,
0.46667152643203735,
0.11606473475694656,
-0.08216635137796402,
-0.10392537713050842,
-0.06694739311933517,
0.42813554406166077,
0.17922651767730713,
-0.8605725169181824,
-0.01389786135405302,
0.36749136447906494,
-0.220498189330101,
0.150663390755... | |
We had a file in our repository that we deleted several revisions ago. How do we get it back using TortoiseSVN without reverting our entire repository?
Go to the Show Log screen, and search for the revision when the file was deleted, then right click the file and select **Save revision to...**
 into the greasemonkey script** so that I can just go:
```
$(document).ready(functio... | [
0.6658151149749756,
0.3475894629955292,
0.6582022309303284,
-0.09644473344087601,
0.10722747445106506,
-0.10991492122411728,
-0.10922201722860336,
0.44965851306915283,
-0.15823101997375488,
-0.575151801109314,
0.4726475179195404,
0.7388232946395874,
0.031246541067957878,
-0.444072127342224... | |
google's hosted version of jQuery to complete.
The recommended way in recent versions of greasemonkey is to use the @require comment tag.
E.g.
```
// ==UserScript==
// @name Hello jQuery
// @namespace http://www.example.com/
// @description jQuery test script
// @include *
// @require http:... | [
0.3871082663536072,
0.35925543308258057,
0.5072441101074219,
-0.07079088687896729,
-0.34412384033203125,
-0.17646464705467224,
0.22533002495765686,
0.08537061512470245,
-0.03795672580599785,
-0.43970125913619995,
-0.06321500986814499,
0.5336248278617859,
-0.47781258821487427,
-0.4318765103... | |
will download and keep a locally cached copy of the remote file that can be read almost instantly. The cached copy is kept in the same folder as your installed user-script. The remote file is not monitored for changes.
Please be aware that, at the time of writing this answer, this @require tag is only read at install-... | [
0.3769920766353607,
-0.08931925147771835,
0.6613238453865051,
0.3657039403915405,
0.22223427891731262,
-0.3760446608066559,
0.41362956166267395,
-0.047942161560058594,
0.10522104799747467,
-1.0067765712738037,
-0.4594367444515228,
0.8641135096549988,
-0.23205754160881042,
-0.04641001299023... | |
I'm running Django on a server with a dozen or so virtual hosts set up. The first Django site I've put together works great, but I'm about to set up a second. Do I need to run a second fastcgi process?
For the first site I'm running fcgi this way:
```
/home/django/app1/manage.py runfcgi protocol=fcgi host=127.0.0.1 p... | [
-0.05360035598278046,
0.5001627206802368,
0.3971635103225708,
-0.3079346716403961,
-0.31884196400642395,
-0.18203844130039215,
0.28962162137031555,
-0.01568153128027916,
-0.3372217118740082,
-0.5396779179573059,
0.10261049121618271,
0.401511549949646,
-0.6207283735275269,
-0.07017661631107... | |
some way to handle more than one Django site with a single fastcgi? Is there a best practice for setting up a multi-Django server?
It depends on what you mean by site, and what your Django configurations look like.
Each Django settings.py defines one and only one database, one and only one urls.py tree.
Each Django h... | [
0.09517082571983337,
-0.041832514107227325,
0.34966152906417847,
0.38476672768592834,
-0.22475692629814148,
0.07272370159626007,
-0.2969385087490082,
-0.21117335557937622,
-0.5363102555274963,
-0.648367702960968,
0.06779204308986664,
0.15120840072631836,
-0.31308862566947937,
-0.2026787102... | |
a single fastcgi instance.
Note that Django's urls.py handler mostly ignores the hostname and port number in the url parsing in the request. However, if you include the Sites model, you can have the virtual host name become part of request processing. | [
-0.1124497577548027,
-0.05435040220618248,
0.028669048100709915,
0.209530770778656,
-0.32531628012657166,
-0.4143621027469635,
-0.06349243968725204,
0.2785375118255615,
-0.42115697264671326,
-0.5236414074897766,
-0.08929136395454407,
0.19154249131679535,
-0.38815081119537354,
0.24306866526... | |
I recently started playing with C#, but I am finding it very frustrating. It seems every time I want to add what I think is a simple control, I end up either scouring the internet or writing my own. I just feel like I spend more time recreating controls to get them to work the way they should, and less time actually cr... | [
0.36342576146125793,
-0.1449587643146515,
0.13429105281829834,
-0.08387969434261322,
0.22986657917499542,
-0.1299699991941452,
-0.005111368373036385,
-0.36674806475639343,
-0.47379612922668457,
-0.3255930542945862,
0.24411074817180634,
0.2956400215625763,
-0.35520684719085693,
0.1470262557... | |
for this simple alteration.
Am I just too new to C#/.net, or am I just expecting too much? I know SO loves C# so don't bite my head off for feeling this way, just help me understand what I am missing and whether I should continue learning and working with C#.
You're not the first, nor the last developer to have this ... | [
0.7157604694366455,
-0.08872676640748978,
0.08540856093168259,
0.36541277170181274,
-0.10121773928403854,
-0.2034166157245636,
0.14394120872020721,
0.27212485671043396,
-0.3636433780193329,
-0.6889731287956238,
0.19451265037059784,
0.31047481298446655,
0.15004649758338928,
0.41863676905632... | |
was with ASP.NET web controls.
That being said, I found that once I got over the (steep IMHO) learning curve of control development, many of my frustrations were eliminated. I feel that using inheritance and overriding virtual members to create new behavior is a very clean approach. Plus, it creates output that can be... | [
0.1834203451871872,
0.06686252355575562,
-0.19063664972782135,
0.17084302008152008,
-0.12950389087200165,
-0.2045343965291977,
0.052015163004398346,
-0.08553289622068405,
-0.16559773683547974,
-0.3310805559158325,
-0.014182896353304386,
0.4434792101383209,
-0.24249336123466492,
0.001851521... | |
recommend learning control development, or looking to third party solutions if possible. There are many companies that exist solely to fill the voids. Either way, I wouldn't judge the whole language based off of the default control set. | [
0.3348575234413147,
0.25900232791900635,
-0.3092873990535736,
0.32181447744369507,
0.07017727941274643,
-0.1576869934797287,
0.41612517833709717,
0.5302935838699341,
0.19401687383651733,
-0.3609248995780945,
-0.11129245907068253,
0.6465546488761902,
0.10118667781352997,
-0.0183743163943290... | |
Does WPF provide a framework to handle undo/redo? If not, what's a common way to do it?
I've implemented undo / redo for a WPF application and ended up publishing my undo / redo code to <http://muf.codeplex.com/>.
You can also get it via NuGet. Just look for "MUF" or "Monitored Undo Framework". It includes support fo... | [
0.6393256783485413,
-0.08933160454034805,
0.2712637186050415,
-0.0624086819589138,
-0.18100354075431824,
-0.24335211515426636,
0.26693254709243774,
-0.3285030722618103,
-0.37227001786231995,
-0.4984057545661926,
0.005226039327681065,
0.5056326985359192,
-0.41711995005607605,
-0.21773219108... | |
I am currently using jQuery to write an online application, that started off with a couple of lines of code, and have quickly now become over a 1000 lines.
My code's structure is simple. I have a window.load which wraps my javascript, and inside it I start adding my click event handlers, and the various functions that... | [
0.38401392102241516,
0.057700082659721375,
0.3306604027748108,
-0.1252184361219406,
-0.0642935112118721,
0.14360573887825012,
0.128525510430336,
-0.07091904431581497,
-0.08418410271406174,
-0.6329671144485474,
0.002446037484332919,
0.36895304918289185,
-0.18324114382266998,
-0.020573202520... | |
later use my CMS engine to concatenate and compress the files on the fly.
What is the best way in doing so. I am thinking that maybe I can give some of my functions their own namespace for further clarity; e.g. all animation functions are prefixed with ANIMATION - ANIMATION.moveDiv1(), ANIMATION.moveDiv2, MYEVENT.div1... | [
-0.0012721053790301085,
0.05513070523738861,
0.4789206087589264,
0.028376003727316856,
-0.24627698957920074,
0.37295588850975037,
-0.24872711300849915,
-0.0070012519136071205,
-0.46448108553886414,
-0.8796802163124084,
-0.06058816239237785,
0.30589306354522705,
-0.2907654941082001,
0.14381... | |
compression, there are some nice tools that you can use to compress things. Check out [YUI Compressor](http://developer.yahoo.com/yui/compressor/)
Modularity is a good goal with Javascript, but I would say the next level would be to actually use some Javascript OO techniques. If your app is simple enough, you can prob... | [
0.2360478639602661,
0.029204295948147774,
0.16063503921031952,
0.004576168023049831,
-0.2659808099269867,
0.2106899917125702,
-0.213082417845726,
-0.35499560832977295,
-0.2307554930448532,
-0.8245546221733093,
-0.09102004021406174,
0.4391661584377289,
-0.15294642746448517,
-0.1322157829999... | |
This is sort of a follow up on this question I read:
[What is the biggest mistake people make when starting to use LINQ?](https://stackoverflow.com/questions/777400/what-is-the-biggest-mistake-people-make-when-starting-to-use-linq)
The top answer is "That it should be used for everything." That made me wonder what exa... | [
0.20997513830661774,
0.14369802176952362,
-0.18134856224060059,
0.11057442426681519,
-0.20090198516845703,
-0.304866224527359,
0.0402575358748436,
0.12317609041929245,
-0.3916398882865906,
-0.07678957283496857,
0.13305047154426575,
0.5829986333847046,
-0.0941711813211441,
0.044224262237548... | |
In Javascript, you can extend existing classes by using its prototype object:
```
String.prototype.getFirstLetter = function() {
return this[0];
};
```
Is it possible to use this method to extend DOM elements?
you can extend the DOM by using the Element's prototype. However, this does not work in IE7 and earlier... | [
0.1940418928861618,
0.08523671329021454,
-0.08668443560600281,
-0.22945977747440338,
-0.06098545342683792,
-0.06930848956108093,
0.3196234405040741,
-0.22709685564041138,
0.022839203476905823,
-0.7125385403633118,
0.025774331763386726,
0.29805096983909607,
-0.502422034740448,
0.04230804741... | |
I'm at my wits end, and it's probably something really simple. Basically I've have got this code:
```
var menuitem = document.getElementById('mymenuitem');
alert(menuitem);
alert(varImChecking == null);
menuitem.setAttribute('disabled', (varImChecking == null) ? 'true' : 'false');
```
It should be disabling the 'mym... | [
0.1158195286989212,
0.2806571424007416,
0.4048302173614502,
-0.276257187128067,
0.1631321907043457,
0.038876723498106,
0.8370373249053955,
-0.250448614358902,
-0.10583937913179398,
-0.5547862648963928,
-0.31233349442481995,
0.7653951644897461,
-0.2989242970943451,
0.030293351039290428,
0... | |
do this?
**Edit:** Forgot to mention, no warnings or errors show up in the console.
I think I finally figured this out. The problem is that I had the menuitem I was trying to edit was **hardcoded inside a .xul file**. For whatever reason, this made it impossible to change the disabled or hidden attributes.
So I remov... | [
0.27804407477378845,
0.2490609586238861,
0.4567422568798065,
-0.14032484591007233,
0.20152896642684937,
-0.17213642597198486,
0.628734827041626,
-0.11514986306428909,
-0.14246147871017456,
-0.7012691497802734,
-0.273649662733078,
0.7796115875244141,
-0.39576056599617004,
0.0989637151360511... | |
many comments have pointed out, the above is not correct. You absolutely can change the disabled attribute on an item hard coded in a XUL file.
After much more debugging, paring the problem down to its core elements, pulling hair, etc, it turned out to be.... a typo. Grrr.. Sorry.
It turns out my document.getElementB... | [
0.2499196082353592,
0.020967040210962296,
0.3858276307582855,
0.17935612797737122,
0.022523006424307823,
-0.08303003013134003,
0.47585219144821167,
0.11134796589612961,
-0.27526113390922546,
-0.4887904226779938,
-0.18460939824581146,
0.3489078879356384,
-0.18750561773777008,
0.382869333028... | |
of debugging, I don't have that version to check again.
Anyway, it's working now, without having to dynamically create the menuitem. Thanks for all the help! | [
0.06369058042764664,
0.10427342355251312,
0.28327810764312744,
0.21685172617435455,
0.11505603790283203,
-0.1996241807937622,
0.5667834281921387,
0.5550485849380493,
-0.3194684386253357,
-0.5731616616249084,
0.19652266800403595,
0.5037425756454468,
0.118001289665699,
0.20155291259288788,
... | |
Here is a sample soap response from my SuperDuperService:
```
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<MyResponse xmlns="http://mycrazyservice.com/SuperDuperService"... | [
-0.14433783292770386,
-0.17804089188575745,
0.5812496542930603,
-0.10437838733196259,
-0.4744682312011719,
0.20220500230789185,
0.1247883215546608,
-0.7825027108192444,
-0.08618716895580292,
-0.5519003868103027,
0.08008658140897751,
0.10424646735191345,
-0.08120524138212204,
0.165252536535... | |
myNamespace))
select result.Element("Result").value
```
Don't have VS on this laptop so I can't double check my code, but it should point you in the right direction using LINQ to SQL. | [
-0.13148589432239532,
0.05963154882192612,
0.6663029193878174,
0.06577348709106445,
0.06020984426140785,
-0.06810876727104187,
0.30716198682785034,
-0.1684739738702774,
0.2286314219236374,
-0.8824182748794556,
0.26530978083610535,
0.5575289726257324,
0.023969100788235664,
0.275522738695144... | |
I have a base class DockedToolWindow : Form, and many classes that derive from DockedToolWindow. I have a container class that holds and assigns events to DockedToolWindow objects, however I want to invoke the events from the child class.
I actually have a question about how to implement what this [MSDN site](http://m... | [
0.07797905057668686,
-0.21034295856952667,
0.19531774520874023,
0.06780089437961578,
-0.24401496350765228,
-0.1158369854092598,
-0.025249237194657326,
-0.22600290179252625,
-0.25239190459251404,
-0.6090033650398254,
0.12371935695409775,
0.41416287422180176,
-0.07752864062786102,
0.35461974... | |
public abstract void Draw();
//The event-invoking method that derived classes can override.
protected virtual void OnShapeChanged(ShapeEventArgs e)
{
// Make a temporary copy of the event to avoid possibility of
// a race condition if the last subscriber unsubscribes
// immediately ... | [
0.12804442644119263,
-0.37918442487716675,
0.05685712397098541,
-0.21308307349681854,
0.2070363163948059,
-0.031245168298482895,
0.09121038764715195,
-0.044572167098522186,
0.10625913739204407,
-0.46935364603996277,
-0.2552085518836975,
0.6168543696403503,
-0.4847715198993683,
0.1623319089... | |
if (handler != null)
{
handler(this, e);
}
}
```
Sure this example compiles and works, but when I replace "ShapeChanged" with "Move" (an event I acquired from deriving from Form), it errors saying I cannot have Move on the right side without += or -=. I also removed the ShapeEventArgs ... | [
0.22236527502536774,
-0.35998156666755676,
0.04744469001889229,
-0.17944903671741486,
0.0438530333340168,
-0.07349210977554321,
0.18434013426303864,
-0.22595417499542236,
-0.017002345994114876,
-0.6585118174552917,
0.05152767151594162,
0.29233694076538086,
-0.22902008891105652,
0.210671916... | |
is inherited?
You cannot directly fire base class events. This is exactly the reason why you had to make your `OnShapeChanged` method `protected` instead of `private`.
Use [base.OnMove()](http://msdn.microsoft.com/en-us/library/system.windows.forms.control.onmove.aspx) instead. | [
0.08413243293762207,
-0.41238510608673096,
-0.07627993077039719,
0.1274900883436203,
0.07182523608207703,
-0.4803892970085144,
0.256661593914032,
-0.17268997430801392,
-0.4651947021484375,
-0.24331703782081604,
-0.13698777556419373,
0.4378608763217926,
-0.38709956407546997,
0.2067915946245... | |
I want to parse and XML file in an iPhone app without going to disk for it.
Can I do this? How? I have included a TXT helpfile in an app using MSVC.
I put the XML file in a Folder/Group named Resources in the project.
I have the XML file in the proj directory.
I right clicked on Resources folder and selected *ad... | [
0.3995262086391449,
-0.09419680386781693,
0.3885364830493927,
0.3684033155441284,
0.21151776611804962,
-0.08323241025209427,
0.3478606939315796,
-0.13789477944374084,
-0.21620891988277435,
-0.872665286064148,
-0.04845144599676132,
0.6950539350509644,
0.13934177160263062,
-0.070462673902511... | |
use:
```
NSString * const DG_XmlRecipeFile = @"/Users/appleuser/Cocoa/iHungry6/Recipes.xml";
```
It seems to me it should also work with:
```
NSString * const DG_XmlRecipeFile = @"Recipes.xml";
```
If I set the Path Type correctly. It does not.
I am a first timer. Thanks for reading this , Mark
Xcode copies the ... | [
0.4320948123931885,
0.13583636283874512,
0.4717358350753784,
0.04356299713253975,
0.04507715255022049,
-0.035666730254888535,
0.26294994354248047,
-0.5358067154884338,
-0.2529752850532532,
-1.0200289487838745,
-0.42056289315223694,
0.4481995701789856,
-0.4601192772388458,
-0.21466514468193... | |
*docsDirectory = [[paths objectAtIndex:0] retain];
NSString *newFilePath = [docsDirectory stringByAppendingPathComponent:@"Recipes.xml"];
NSError *error = nil;
[[NSFileManager defaultManager] copyItemAtPath:DG_XmlRecipeFile toPath:newFilePath error:&error];
``` | [
0.04774225130677223,
0.0780201330780983,
0.4246070683002472,
-0.19965487718582153,
0.06440140306949615,
-0.03689971938729286,
0.2678169906139374,
-0.25824129581451416,
-0.3184400498867035,
-0.7822597026824951,
-0.1970837414264679,
0.6576724648475647,
-0.3894723057746887,
0.1052100583910942... | |
I am trying to find the correct syntax to pass a varible to my JQuery Post.
```
var id = empid;
$.ajax({
type: "POST",
url: "../Webservices/EmployeeService.asmx/GetEmployeeOrders",
data: "{empid: empid}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(resul... | [
0.18484152853488922,
0.18585249781608582,
0.5571846961975098,
-0.042714618146419525,
-0.22288863360881805,
0.09658700227737427,
0.6209501624107361,
-0.042546212673187256,
-0.06427964568138123,
-0.566925585269928,
-0.21467335522174835,
0.5324856638908386,
-0.17907969653606415,
-0.0998565778... | |
+ "}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(result){
alert(result.d);
console.log(result);
}
});
``` | [
-0.12678880989551544,
-0.10304109752178192,
0.577853262424469,
-0.38227391242980957,
0.17994174361228943,
-0.052305564284324646,
0.2642008364200592,
-0.22570545971393585,
-0.1269124299287796,
-0.2921387851238251,
-0.9188987612724304,
0.6979398131370544,
-0.42271339893341064,
0.061823710799... | |
I'm working with UDP sockets in C++ for the first time, and I'm not sure I understand how they work. I know that `sendto`/`recvfrom` and `send`/`recv` normally return the number of bytes actually sent or received. I've heard this value can be arbitrarily small (but at least 1), and depends on how much data is in the so... | [
0.28045740723609924,
-0.030287742614746094,
0.18210949003696442,
-0.11346658319234848,
-0.14507369697093964,
-0.008995209820568562,
-0.041519079357385635,
-0.08378704637289047,
-0.22684511542320251,
-0.4783823490142822,
-0.054866973310709,
0.61981600522995,
-0.20081403851509094,
0.12186317... | |
UDP protocol remain coherent? Doesn't this imply that the bytes in a message can be arbitrarily shuffled when I receive them? Is there a way to guarantee that a message gets sent or received all at once?
It's a *little* stronger than that. UDP does deliver a full package; the buffer size can be arbitrarily small, but i... | [
0.09367421269416809,
-0.29575100541114807,
0.508474588394165,
-0.136478990316391,
-0.2866659164428711,
-0.4483213722705841,
0.16524331271648407,
-0.37295904755592346,
-0.46900951862335205,
-0.44146987795829773,
-0.17422282695770264,
0.36351802945137024,
-0.3309074342250824,
0.0234345868229... | |
delivery, so you have to check to make sure everything comes through.
But since you can implement all of TCP with UDP, it has to be possible.
usually, what you do with UDP is you make small packets that are discrete.
Metaphorically, think of UDP like sending postcards and TCP like making a phone call. When you send... | [
0.0323498360812664,
-0.5926845669746399,
0.1671724170446396,
0.06058024987578392,
-0.20612122118473053,
0.05997401475906372,
-0.15267910063266754,
-0.00487121706828475,
-0.4031984508037567,
-0.7265642881393433,
-0.2994365692138672,
0.1527445912361145,
-0.4038139283657074,
0.253298908472061... | |
I'd like to map a key to move the cursor in the XCode up by ten lines. Of course, I want another one to move down too. The key mapping would ideally be something like 'Control-Alt-P'.
Is there a way to achieve this in XCode without resorting to Automator?
---
Ashley has the answer below, the formatting was a little ... | [
0.07528991252183914,
-0.042131029069423676,
0.3563455045223236,
0.02939658612012863,
0.023887373507022858,
0.10215149074792862,
-0.03969484567642212,
-0.44633981585502625,
-0.06554421782493591,
-0.6113460063934326,
0.020653417333960533,
0.37816914916038513,
-0.08728593587875366,
-0.0381532... | |
<string>moveUp:</string>
<string>moveUp:</string>
</array>
```
You can use the example given [here](https://stackoverflow.com/questions/476953/delete-line-hot-key/477961#477961) and use a `DefaultKeyBinding.dict` file, except use `moveUp:` and `moveDown:` as your selectors.
Your particular dictionary entr... | [
-0.2415541559457779,
-0.0029041587840765715,
0.3400983214378357,
-0.2367793321609497,
-0.07612211257219315,
0.10781675577163696,
-0.0835757628083229,
-0.3439593017101288,
-0.43315833806991577,
-0.5049927830696106,
-0.2740522027015686,
0.37077635526657104,
-0.2751755118370056,
-0.1005509123... | |
have customized your keybindings through Xcode already you should instead add the same dictionary entry to your `.pbxkeys` file under the `text` dictionary section. | [
0.30715060234069824,
0.2273472398519516,
0.26111412048339844,
-0.05216843634843826,
0.06523752212524414,
-0.2107064574956894,
0.03282009810209274,
-0.19065053761005402,
-0.16971328854560852,
-0.5959696173667908,
-0.17771680653095245,
0.3829406499862671,
-0.12790639698505402,
0.041115354746... | |
Is there a way to get the last number from the `range()` function?
I need to get the last number in a Fibonacci sequence for first 20 terms or should I use a list instead of `range()`?
Not quite sure what you are after here but here goes:
```
rangeList = range(0,21)
lastNumber = rangeList[len(rangeList)-1:][0]
```
o... | [
0.246771901845932,
-0.27553024888038635,
0.6933573484420776,
-0.32886675000190735,
0.26528945565223694,
0.09852653741836548,
0.019534548744559288,
-0.42525526881217957,
-0.4184592366218567,
-0.34577691555023193,
-0.1818527728319168,
0.7502169013023376,
-0.09425158053636551,
0.1384043693542... | |
I have a perl script (part of the [XMLTV](http://wiki.xmltv.org/index.php/Main_Page) family of "grabbers", specifically [`tv_grab_oztivo`](http://web.aanet.com.au/auric/?q=node/14)).
I can successfully run it like this:
```
/sw/bin/perl /path/to/tv_grab_oztivo --output /path/to/tv.xml
```
I use the full paths to ev... | [
0.08598978072404861,
0.08355341851711273,
0.917069137096405,
-0.1369282305240631,
0.10823827981948853,
-0.0348827987909317,
-0.0037981998175382614,
0.2712695896625519,
-0.23089726269245148,
-0.586661159992218,
-0.27108779549598694,
0.5927648544311523,
-0.11726627498865128,
0.14376336336135... | |
runs just fine at the right time.
So, what can I do to debug? I can see from looking at `%ENV` in the two cases that the environment is very different, but what other approaches can I take to debugging? How can I see the output of the cron job, which might be some kind of perl "die" message or "not found" message from... | [
0.39381518959999084,
0.4286302924156189,
0.06788890063762665,
-0.0785866230726242,
0.1384088695049286,
-0.020721135661005974,
0.45097076892852783,
-0.020524300634860992,
-0.24647796154022217,
-0.40319547057151794,
-0.0018756268545985222,
0.9329554438591003,
-0.1786613017320633,
0.206309571... | |
cron. Best bet is to capture the ouput by using the command:
```
( /sw/bin/perl /path/to/tv_grab_oztivo ... ) >/tmp/qq 2>&1
```
and then have a look at `/tmp/qq`.
If it does turn out to be a missing environment, then you may need to put:
```
. ~/.profile
```
or something similar, into the execution chain of your... | [
-0.27114373445510864,
0.16105668246746063,
0.44733941555023193,
-0.045879535377025604,
0.31644803285598755,
0.3351866900920868,
-0.015261887572705746,
-0.23555703461170197,
-0.5070421695709229,
-0.6803724765777588,
-0.1181597039103508,
0.661404013633728,
-0.11743460595607758,
0.09214522689... | |
We have a D2007 application whose memory footprint grows steadily when running on Windows Server 2008 (x64, sp1).
It behaves normally on Windows Server 2003 (x32 or x64), XP, etc... where it goes up and down as expected.
We have tried with the included Memory Manager or the latest FastMM4 4.92 with the same resul... | [
-0.3730528652667999,
-0.0596231184899807,
0.5161777138710022,
0.08938777446746826,
0.10122806578874588,
-0.16021861135959625,
0.1265946477651596,
0.15374666452407837,
-0.47627776861190796,
-0.5100207328796387,
0.04111114889383316,
0.7993713617324829,
-0.043158579617738724,
-0.1240810826420... | |
- memory usage was monitored with Process Explorer; both Virtual Memory (Private Bytes) and Physical Memory (WorkingSet Private) are growing on Win2008
- memory consumption was still growing even when there was memory pressure. (that's how we came to investigate as it caused a failure, but only on Win2008 boxes)
*... | [
-0.19085298478603363,
-0.027428308501839638,
0.6008270978927612,
0.18441712856292725,
-0.366024911403656,
0.3460005819797516,
0.5266885757446289,
-0.18938423693180084,
-0.676869809627533,
-0.6737580299377441,
0.21368098258972168,
0.5570400953292847,
-0.1908717304468155,
0.00814261101186275... | |
just returns to where it was on XP.
If you launch multiple instances, the memory is not released to allow the other instances to run. Instead, the page file grows and the server crawls...
**Update 2**: see [QC report 73347](http://qc.embarcadero.com/wc/qcmain.aspx?d=73347)
After further investigation, we have **... | [
0.22704099118709564,
0.028552431613206863,
0.861163854598999,
-0.05581769347190857,
0.2410557121038437,
0.036421116441488266,
0.18481464684009552,
-0.14815029501914978,
-0.5748141407966614,
-0.6940879821777344,
0.015868183225393295,
0.5731661319732666,
-0.1441023349761963,
0.36614495515823... | |
CS_NUMBER = 10000000;
type
TCSArray = Array[1..CS_NUMBER] of TRTLCriticalSection;
PCSArray = ^TCSArray;
procedure TestStatic;
var
csArray: PCSArray;
idx: Integer;
begin
New(csArray);
for idx := 1 to length(csArray^) do
InitializeCriticalSection(csArray^[idx]);
for idx := 1 to length(csArray^) do
... | [
-0.13553081452846527,
0.04984840005636215,
0.24924421310424805,
-0.08675592392683029,
0.12781491875648499,
0.2511817514896393,
0.3420553505420685,
-0.4552648663520813,
-0.2840929329395294,
-0.45221832394599915,
-0.5241215229034424,
0.20249716937541962,
-0.18177179992198944,
0.2720863521099... | |
Microsoft made a change to the Critical Sections to add some debug information. This debug memory is not released until the end of the application but somehow cached and reused which is why after a while it can plateau.
The solution if you want to create a lot of Critical Sections without feeling this memory penalty i... | [
0.04751050844788551,
0.06492578983306885,
0.3845480978488922,
0.14803001284599304,
0.12570875883102417,
-0.04148809239268303,
0.21131370961666107,
0.17498527467250824,
-0.15806511044502258,
-0.5282806754112244,
-0.2867225706577301,
0.16876976191997528,
-0.17754003405570984,
0.3464616835117... | |
I am wondering if there is a cross-platform allocator that is one step lower than malloc/free.
For example, I want something that would simply call sbrk in Linux and VirtualAlloc in Windows (There might be two more similar syscalls, but its just an example).
I'm not familiar with the functions in question but:
```
#... | [
0.16004660725593567,
-0.18857942521572113,
0.2391759306192398,
0.060477837920188904,
-0.012064451351761818,
-0.3069325089454651,
-0.06865566223859787,
0.17387603223323822,
-0.058582644909620285,
-0.9417417645454407,
-0.1524018794298172,
0.8694594502449036,
-0.32850179076194763,
-0.15358310... | |
I'm adding a small .swf object (XSPF Web Music Player) to a site I'm working on. I need to add two lines of code to make external javascript calls, so, I guess I need to re-compile to actionscript (please forgive me, I'm extremely new to flash). I'm using MTASC to compile at the command line. I'm getting errors at the ... | [
0.1299179643392563,
0.12182598561048508,
0.24138358235359192,
-0.09402725845575333,
-0.1155468001961708,
-0.12133825570344925,
0.3621508479118347,
0.19115489721298218,
-0.44822973012924194,
-0.8703082799911499,
-0.011059371754527092,
0.6292543411254883,
-0.18710888922214508,
-0.00953526142... | |
guys see in there which would make it break at stop()? or any other pointers at all?
put the console.log before the dialog() it could be failing on that.
also, no need for the href's with javascript.
```
<a href="#"></a>
<script>
$(".btnImgDel").click(function (event) {
event.preventDefault();
});
</... | [
0.031112464144825935,
0.19204562902450562,
0.4514783024787903,
-0.13989418745040894,
0.24048829078674316,
-0.19112075865268707,
0.5364101529121399,
-0.077363982796669,
-0.2914108335971832,
-0.5739925503730774,
-0.33474060893058777,
0.8825724720954895,
-0.2817956507205963,
0.041866574436426... | |
I'm new to world of .NET programming and I want to know about websites that have articles, tips and other useful information about .NET and Microsoft technologies. The websites I currently visit are:
* MSDN
* StackOverflow
* WindowsClient.NET
* TheServerSide.NET
I'd love to learn about some new .NET websites!
* [PDC ... | [
0.7375984191894531,
0.023960791528224945,
0.5346179604530334,
0.29976019263267517,
-0.11720010638237,
-0.29178115725517273,
0.21564918756484985,
0.4281322956085205,
-0.6077888607978821,
-0.771970808506012,
-0.009897851385176182,
0.38494929671287537,
0.28985562920570374,
0.2698500156402588,... | |
blog](http://www.pluralsight.com/community/blogs/dbox/).
* [Channel 9](http://channel9.msdn.com/) has great videos,
interviews, etc.
* [Chris Sells site](http://www.sellsbrothers.com/) is cool.
* Tons of great [sessions from
Mix09](http://live.visitmix.com/).
* [WindowsClient.net](http://windowsclient.net/)
* [IIS.net]... | [
0.5839878916740417,
0.09460320323705673,
0.4597538709640503,
0.3002201020717621,
0.02634117752313614,
-0.4984602630138397,
0.09655671566724777,
0.05970548093318939,
-0.3513597249984741,
-0.5448338985443115,
-0.18710042536258698,
0.5537075996398926,
0.3560989499092102,
-0.12634682655334473,... | |
I would like to loop through audio in VB.NET.
Here is my code:
```
While blnAlert = True
My.Computer.Audio.Play("C:\cat_1.wav")
End While
```
But it freezes the app.
Cheers.
This is actually a pretty interesting question.
**HA HA DISREGARD THIS, I SUCK**
On edit: this answer works, but on MySQL it... | [
0.6082093119621277,
0.09858662635087967,
0.436938613653183,
0.08518556505441666,
-0.19254179298877716,
-0.29528459906578064,
0.6742337942123413,
-0.04314670339226723,
-0.21228648722171783,
-0.5214083194732666,
0.013819954358041286,
0.542770504951477,
-0.14967982470989227,
0.218464061617851... | |
you end up doing one database query per post, the dreaded *N+1 queries*.
If you want to get all posts at once (or some subset with a where) the following will *surprisingly* work. It assumes that comments have a monotonically increasing id (as a datetime is not guaranteed to be unique), but allows for comment ids to b... | [
0.11077216267585754,
-0.035328272730112076,
0.42092567682266235,
0.08272195607423782,
0.010604099370539188,
0.33855435252189636,
-0.03179603070020676,
-0.2456381469964981,
-0.1407184600830078,
-0.8624778985977173,
0.009654988534748554,
0.34843096137046814,
-0.3628435432910919,
0.2370138764... | |
as maxid,
(select max(id) from child where id < maxid
and parent_id = a.id) as maxidm1,
(select max(id) from child where id < maxidm1
and parent_id = a.id) as maxidm2
from parent a;
```
`maxidm1` is just "max id minus 1"; `maxidm2`, "max id minus 2" -- that is, the second and third greatest child ids *with... | [
-0.00024918364943005145,
-0.17158088088035583,
0.5849912166595459,
0.07012192159891129,
-0.04976537078619003,
0.8502826690673828,
-0.037613168358802795,
-0.02404121123254299,
-0.06213651970028877,
-0.7423132061958313,
-0.22878414392471313,
0.6017177104949951,
0.14021050930023193,
0.3056765... | |
c on (c.id = a.maxidm1)
left outer join child d on (c.id = a.maxidm2);
```
Naturally, you can add whatever where clause you want to that, to limit the posts: `where a.category = 'foo'` or whatever.
---
Here's what my tables look like:
```
mysql> select * from parent;
+----+------+------+------+
| id | a | b ... | [
-0.18700549006462097,
0.028472915291786194,
0.6021869778633118,
0.02556646056473255,
0.049262139946222305,
0.23165962100028992,
-0.02421405538916588,
-0.21717099845409393,
-0.03203249350190163,
-0.5259714126586914,
-0.2359488606452942,
0.31419482827186584,
-0.20018787682056427,
0.094482988... | |
3 | NULL |
+----+------+------+------+
3 rows in set (0.00 sec)
```
And a portion of child. Parent 1 has noo children:
```
mysql> select * from child;
+----+-----------+------+------+------+------+
| id | parent_id | a | b | c | d |
+----+-----------+------+------+------+------+
. . . .
| 18 | 3... | [
-0.6021704077720642,
0.12489292025566101,
0.5941499471664429,
-0.24404801428318024,
0.14549830555915833,
0.45007064938545227,
0.3471251428127289,
-0.4671076238155365,
-0.244965597987175,
-0.3610056936740875,
-0.4271501898765564,
0.1798573136329651,
-0.31702563166618347,
-0.1074578836560249... | |
| NULL | NULL | NULL | NULL |
| 21 | 3 | NULL | NULL | NULL | NULL |
| 22 | 2 | NULL | NULL | NULL | NULL |
| 23 | 2 | NULL | NULL | NULL | NULL |
| 24 | 3 | NULL | NULL | NULL | NULL |
| 25 | 2 | [
-0.22610566020011902,
0.3014662265777588,
-0.12361590564250946,
0.07321763783693314,
-0.3711974620819092,
0.2755989134311676,
0.8164911270141602,
-0.6865357160568237,
-0.3991501033306122,
-0.2632884383201599,
-0.27994057536125183,
0.00962217990309,
-0.47368520498275757,
0.2191362828016281,... | |
| NULL | NULL | NULL | NULL |
+----+-----------+------+------+------+------+
24 rows in set (0.00 sec)
```
And the view gives us this:
```
mysql> select * from parent_top_3;
+----+------+------+------+-------+---------+---------+
| id | a | b | c | maxid | maxidm1 | maxidm2 |
+----+------+------+------+----... | [
-0.303443968296051,
-0.31745392084121704,
0.5761112570762634,
0.2654207646846771,
0.10309845954179764,
0.4257204532623291,
0.3716268837451935,
-0.4230510890483856,
-0.1394679844379425,
-0.6154857873916626,
-0.2858126759529114,
0.5324135422706604,
-0.15019415318965912,
-0.16767634451389313,... | |
| 22 |
| 3 | 3 | 3 | NULL | 24 | 21 | 18 |
+----+------+------+------+-------+---------+---------+
3 rows in set (0.21 sec)
```
The explain plan for the view is only slightly hairy:
```
mysql> explain select * from parent_top_3;
+----+--------------------+------------+------+---------------+... | [
-0.5001276731491089,
-0.15954157710075378,
0.671397864818573,
0.3013157844543457,
0.08941780030727386,
0.12610186636447906,
0.3992176651954651,
-0.4144190847873688,
-0.2104848325252533,
-0.43453162908554077,
-0.36851388216018677,
0.3810097873210907,
-0.08882620185613632,
-0.030343633145093... | |
|
+----+--------------------+------------+------+---------------+------+---------+------+------+-------------+
| 1 | PRIMARY | <derived2> | ALL | NULL | NULL | NULL | NULL | 3 | |
| 2 | DERIVED | a | ALL | NULL | [
-0.4447823762893677,
-0.08282968401908875,
0.1428026258945465,
0.2847830653190613,
-0.3600085973739624,
0.1279229074716568,
0.3486528992652893,
-0.4323045313358307,
0.12942565977573395,
-0.3071501553058624,
-0.37008532881736755,
0.1498461365699768,
-0.5778976082801819,
0.3215171694755554,
... | |
| NULL | NULL | NULL | 3 | |
| 5 | DEPENDENT SUBQUERY | child | ALL | PRIMARY | NULL | NULL | NULL | 24 | Using where |
| 4 | DEPENDENT SUBQUERY | child | ALL | PRIMARY | NULL | NULL | NULL | [
-0.1843545287847519,
0.17658288776874542,
0.1714729517698288,
-0.06306593120098114,
-0.1672751009464264,
0.4242052435874939,
0.2917221486568451,
-0.38865047693252563,
-0.13090196251869202,
-0.2437848001718521,
-0.332796186208725,
0.3224363625049591,
-0.36666712164878845,
0.1649979650974273... | |
| 24 | Using where |
| 3 | DEPENDENT SUBQUERY | child | ALL | NULL | NULL | NULL | NULL | 24 | Using where |
+----+--------------------+------------+------+---------------+------+---------+------+------+-------------+
```
However, if we add an index for parent\_fks,it gets a better:
```
mysql>... | [
-0.30925312638282776,
0.08415686339139938,
0.3397739827632904,
0.02631453052163124,
-0.06287627667188644,
0.3763984441757202,
0.0646190345287323,
-0.5022988319396973,
-0.17936919629573822,
-0.7515832185745239,
-0.21384941041469574,
0.18783730268478394,
-0.4000999927520752,
0.07314644008874... | |
| rows | Extra |
+----+--------------------+------------+------+---------------+------+---------+-----------+------+-------------+
| 1 | PRIMARY | <derived2> | ALL | NULL | NULL | NULL | NULL | 3 | |
| 2 | DERIVED | a | [
-0.5524295568466187,
-0.05852910131216049,
0.3519771695137024,
0.20465758442878723,
-0.27243009209632874,
0.46338987350463867,
0.09983965754508972,
-0.533454954624176,
-0.034845467656850815,
-0.44632819294929504,
-0.33926722407341003,
0.07090095430612564,
-0.5036734342575073,
0.04373259842... | |
| ALL | NULL | NULL | NULL | NULL | 3 | |
| 5 | DEPENDENT SUBQUERY | child | ref | PRIMARY,pid | pid | 5 | util.a.id | 2 | Using where |
| 4 | DEPENDENT SUBQUERY | | [
-0.29912155866622925,
0.055224984884262085,
0.42017319798469543,
-0.1491018533706665,
-0.04546773061156273,
0.26721498370170593,
-0.052124105393886566,
-0.3745308518409729,
0.16329020261764526,
-0.30364370346069336,
-0.32015353441238403,
0.2473062127828598,
-0.3863276243209839,
0.177381515... | |
child | ref | PRIMARY,pid | pid | 5 | util.a.id | 2 | Using where |
| 3 | DEPENDENT SUBQUERY | child | ref | pid | pid | 5 | util.a.id | 2 | Using where |
+----+--------------------+------------+------+---------------+------+---------+-----------+------+-------------+
5 rows... | [
-0.6641476154327393,
0.27591145038604736,
0.542774498462677,
0.0011751841520890594,
0.3276902437210083,
0.6097930073738098,
0.13560402393341064,
-0.24666570127010345,
0.029193030670285225,
-0.6875357627868652,
-0.2806055247783661,
0.2957907021045685,
-0.14085905253887177,
0.232653886079788... | |
parent rows is few as 100, *even if we index into parent using its primary key*:
```
mysql> select * from parent_top_3 where id < 10;
+----+------+------+------+-------+---------+---------+
| id | a | b | c | maxid | maxidm1 | maxidm2 |
+----+------+------+------+-------+---------+---------+
| 1 | 1 | ... | [
-0.28417229652404785,
-0.09938009828329086,
0.4921801686286926,
0.25842130184173584,
0.10341674089431763,
0.4861683249473572,
0.04955257847905159,
-0.29914310574531555,
0.06459229439496994,
-0.6449642777442932,
-0.03180975466966629,
0.379454106092453,
0.018066689372062683,
0.22096297144889... | |
23 | 22 |
| 3 | 3 | 3 | NULL | 24 | 21 | 18 |
| 4 | NULL | 1 | NULL | 65 | 64 | 63 |
| 5 | NULL | 2 | NULL | 73 | 72 | | [
-0.21133098006248474,
0.21136416494846344,
0.06942851841449738,
-0.13628587126731873,
-0.2726411819458008,
0.33580681681632996,
0.5715153217315674,
-0.35289067029953003,
-0.4001556932926178,
-0.19671346247196198,
-0.21170401573181152,
0.11499212682247162,
-0.4815766513347626,
0.11395362764... | |
71 |
| 6 | NULL | 3 | NULL | 113 | 112 | 111 |
| 7 | NULL | 1 | NULL | 209 | 208 | 207 |
| 8 | NULL | 2 | NULL | 401 | 400 | 399 |
| 9 | NULL | 3 | | [
-0.16766925156116486,
0.29124072194099426,
0.20341075956821442,
-0.2174971103668213,
0.1181785836815834,
0.3053657114505768,
0.6041612029075623,
-0.25829461216926575,
-0.47416558861732483,
-0.021353112533688545,
-0.335829496383667,
0.16922159492969513,
-0.49500828981399536,
0.1166825518012... | |
NULL | 785 | 784 | 783 |
+----+------+------+------+-------+---------+---------+
9 rows in set (1 min 3.11 sec)
```
(Note that I intentionally test on a slow machine, with data saved on a slow flash disk.)
Here's the explain, looking for exactly one id (and the first one, at that):
```
mysql> explain sel... | [
-0.37042105197906494,
0.015437165275216103,
0.23867517709732056,
0.05173797905445099,
0.09224766492843628,
0.0066818236373364925,
0.40069398283958435,
-0.39562857151031494,
-0.08924365043640137,
-0.5279515385627747,
-0.14013241231441498,
0.28410470485687256,
-0.4355357885360718,
-0.0245629... | |
| Extra |
+----+--------------------+------------+------+---------------+------+---------+-----------+------+-------------+
| 1 | PRIMARY | <derived2> | ALL | NULL | NULL | NULL | NULL | 1000 | Using where |
| 2 | DERIVED | a | ALL | NULL | [
-0.1004326194524765,
-0.3048291504383087,
-0.022229105234146118,
0.3622889816761017,
-0.11425464600324631,
0.4600372314453125,
0.08548400551080704,
-0.7403566837310791,
-0.006658152677118778,
-0.4156060814857483,
-0.35033783316612244,
0.23466171324253082,
-0.5259491205215454,
-0.2738837897... | |
| NULL | NULL | NULL | 1000 | |
| 5 | DEPENDENT SUBQUERY | child | ref | PRIMARY,pid | pid | 5 | util.a.id | 179 | Using where |
| 4 | DEPENDENT SUBQUERY | child | ref | PRIMARY,pid | pid | 5 | | [
-0.3617509603500366,
0.083485446870327,
0.4949725270271301,
-0.17993563413619995,
-0.0699961930513382,
0.5032779574394226,
-0.11030199378728867,
-0.2793254852294922,
-0.07692951709032059,
-0.33471962809562683,
-0.281187504529953,
0.2308511883020401,
-0.25194495916366577,
0.0169878397136926... | |
util.a.id | 179 | Using where |
| 3 | DEPENDENT SUBQUERY | child | ref | pid | pid | 5 | util.a.id | 179 | Using where |
+----+--------------------+------------+------+---------------+------+---------+-----------+------+-------------+
5 rows in set (56.01 sec)
```
Over 56 seconds for one r... | [
-0.3549808859825134,
0.025956660509109497,
0.8075833916664124,
-0.03814440593123436,
0.09975842386484146,
0.3643297851085663,
0.3384075462818146,
-0.3397095501422882,
-0.16035953164100647,
-0.7189546227455139,
-0.09871406108140945,
0.52625972032547,
-0.2640112042427063,
-0.173726424574852,... | |
bad or worse:
```
mysql> explain select * from parent_top_3a where id = 1;
+----+--------------------+------------+------+---------------+------+---------+-----------+------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+----------... | [
-0.40823137760162354,
0.26830339431762695,
-0.20792976021766663,
0.04511057958006859,
-0.16151773929595947,
0.2197027951478958,
0.7372283339500427,
-0.13859525322914124,
0.06211734935641289,
-0.5609589219093323,
-0.17003315687179565,
0.351338267326355,
-0.4323282539844513,
0.13422140479087... | |
| 100 | Using where |
| 2 | DERIVED | <derived4> | ALL | NULL | NULL | NULL | NULL | 100 | |
| 4 | DERIVED | <derived6> | ALL | NULL | [
-0.16876158118247986,
0.3005940318107605,
0.06729844212532043,
-0.17803266644477844,
-0.06500321626663208,
0.39022645354270935,
0.2888912856578827,
-0.6842877268791199,
0.32987040281295776,
-0.2365729957818985,
-0.06726584583520889,
0.23049993813037872,
-0.223518967628479,
-0.1711901128292... | |
| NULL | NULL | NULL | 100 | |
| 6 | DERIVED | a | ALL | NULL | NULL | NULL | NULL | 100 | | [
-0.13645108044147491,
0.35566383600234985,
0.12488429248332977,
-0.07449968159198761,
-0.12102667987346649,
0.08902257680892944,
0.5810033679008484,
-0.45588019490242004,
0.08050079643726349,
-0.044416677206754684,
-0.3190813660621643,
0.07727516442537308,
-0.33756694197654724,
0.187159404... | |
|
| 7 | DEPENDENT SUBQUERY | child | ref | pid | pid | 5 | util.a.id | 179 | Using where |
| 5 | DEPENDENT SUBQUERY | child | ref | PRIMARY,pid | pid | 5 | a.id | 179 | Using where |
| 3 | DEPENDENT SUBQUERY | [
-0.294553279876709,
0.06701860576868057,
0.6090914011001587,
-0.24897077679634094,
-0.07504173368215561,
0.6297354102134705,
-0.22694575786590576,
-0.2375251054763794,
-0.25416067242622375,
-0.26109635829925537,
-0.36195942759513855,
0.442192018032074,
-0.2719690203666687,
-0.0355355180799... | |
| child | ref | PRIMARY,pid | pid | 5 | a.id | 179 | Using where |
+----+--------------------+------------+------+---------------+------+---------+-----------+------+-------------+
7 rows in set (0.05 sec)
```
But it completes *three* orders of magnitude faster, in 1/20th of a second!
How do we ... | [
-0.13580690324306488,
-0.09556069225072861,
0.8183394074440002,
0.18963107466697693,
0.2782546579837799,
0.7247366905212402,
0.18061727285385132,
-0.2995179295539856,
-0.21938703954219818,
-0.6915996670722961,
-0.149051696062088,
0.36585089564323425,
0.14758406579494476,
0.0011859704973176... | |
a.*,
(select max(id) from child where parent_id = a.id and id < a.maxid)
as maxidm1
from parent_top_1 a;
create view parent_top_3a as
select a.*,
(select max(id) from child where parent_id = a.id and id < a.maxidm1)
as maxidm2
from parent_top_2 a;
```
Not only does this work much more quickly, it's legal on... | [
-0.03954512998461723,
-0.08038389682769775,
0.39368611574172974,
-0.08708275109529495,
-0.25017356872558594,
0.4320233464241028,
0.2692233622074127,
-0.5908335447311401,
-0.23982346057891846,
-0.5175046920776367,
-0.12958359718322754,
0.41140544414520264,
-0.2093232125043869,
0.13997736573... | |
b | c | maxid | maxidm1 | maxidm2 |
+----+------+------+------+-------+---------+---------+
| 39 | NULL | 2 | NULL | NULL | NULL | NULL |
| 38 | NULL | 1 | NULL | NULL | NULL | NULL |
| 37 | NULL | 3 | NULL | NULL | NULL | NULL |
| 36 | NULL | 2 | NULL | | [
0.05606554448604584,
-0.1436966508626938,
0.1793876588344574,
0.10720043629407883,
-0.16399721801280975,
0.5075220465660095,
0.4362393319606781,
-0.49681001901626587,
0.014902729541063309,
-0.27818170189857483,
-0.015131429769098759,
0.5707918405532837,
-0.5430368185043335,
-0.016933511942... | |
NULL | NULL | NULL |
| 35 | NULL | 1 | NULL | NULL | NULL | NULL |
| 34 | NULL | 3 | NULL | NULL | NULL | NULL |
| 33 | NULL | 2 | NULL | NULL | NULL | NULL |
| 32 | NULL | 1 | NULL | NULL | | [
-0.23128394782543182,
0.43445679545402527,
-0.42540013790130615,
-0.0876438170671463,
-0.5708116292953491,
0.310081422328949,
0.8392382860183716,
-0.6411439776420593,
-0.05119818449020386,
-0.16449382901191711,
-0.10928941518068314,
-0.061474915593862534,
-0.7049810886383057,
0.18310293555... | |
NULL | NULL |
| 31 | NULL | 3 | NULL | NULL | NULL | NULL |
| 30 | NULL | 2 | NULL | 1537 | 1536 | 1535 |
| 29 | NULL | 1 | NULL | 1529 | 1528 | 1527 |
| 28 | NULL | 3 | NULL | 1513 | 1512 | | [
-0.6489885449409485,
0.1585780680179596,
0.1782560646533966,
-0.014792066067457199,
-0.558807373046875,
0.44235584139823914,
0.7636025547981262,
-0.19214800000190735,
-0.43219465017318726,
-0.08754950016736984,
-0.27738386392593384,
0.12305771559476852,
-0.6932970285415649,
-0.010317896492... | |
1511 |
| 27 | NULL | 2 | NULL | 1505 | 1504 | 1503 |
| 26 | NULL | 1 | NULL | 1481 | 1480 | 1479 |
| 25 | NULL | 3 | NULL | 1457 | 1456 | 1455 |
| 24 | NULL | 2 | NULL | 1425 | 1424 | 1423 |
| | [
-0.5174014568328857,
0.037048324942588806,
0.30437344312667847,
0.05996980518102646,
-0.43005678057670593,
0.3804108500480652,
0.33337339758872986,
-0.2528766691684723,
-0.45351243019104004,
-0.315684974193573,
0.0214625783264637,
-0.32684406638145447,
-0.4228271245956421,
0.37294667959213... | |
23 | NULL | 1 | NULL | 1377 | 1376 | 1375 |
| 22 | NULL | 3 | NULL | 1329 | 1328 | 1327 |
| 21 | NULL | 2 | NULL | 1281 | 1280 | 1279 |
| 20 | NULL | 1 | NULL | 1225 | 1224 | 1223 |
+----+------+------+------+-------+---------+---------+
20 rows in set (1.01 | [
-0.4254327118396759,
0.023155873641371727,
0.12158520519733429,
-0.12341953068971634,
-0.32723066210746765,
0.3539990186691284,
0.32985416054725647,
-0.5043973922729492,
-0.3583320081233978,
-0.6635357737541199,
-0.11205042898654938,
-0.05822281911969185,
-0.4867083430290222,
-0.0234478265... | |
sec)
```
Note that these timings are for MyIsam tables; I'll leave it to someone else to do timings on Innodb.
---
But using Postgresql, on a similar but not identical data set, we get similar timings on `where` predicates involving `parent`'s columns:
```
postgres=# select (select count(*) from parent) as parent... | [
-0.41344499588012695,
-0.33136385679244995,
0.424161434173584,
0.19113972783088684,
0.058647025376558304,
0.3524205982685089,
0.2669373154640198,
-0.32876741886138916,
-0.18818281590938568,
-0.4864427447319031,
-0.2125050276517868,
0.22391864657402039,
-0.08299454301595688,
0.2193269431591... | |
| | 18 | | 1464 | 1462 | 1461
21 | | 88 | | 1463 | 1460 | 1457
22 | | 72 | | 1488 | 1486 | 1485
23 | | 13 | | 1512 | 1510 | 1509
24 | | 49 | | 1560 | | [
-0.006176168564707041,
0.030330993235111237,
0.40968894958496094,
-0.3080418109893799,
-0.41121798753738403,
0.5143105983734131,
0.47416096925735474,
-0.41115057468414307,
-0.42665988206863403,
-0.20023460686206818,
-0.01762678101658821,
0.19493010640144348,
-0.4125341475009918,
0.23954989... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.