text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
MyStore
2 1 Electronics
3 1 Clothing
4 1 Books
5 2 Televisions
6 2 Stereos
7 5 Plasma
8 5 LCD
```
t\_categories (after modification)...
```
Cat Parent CategoryName Depth Breadcrumb
1 NULL MyStore NULL | [
0.009358271956443787,
0.2632063925266266,
0.4994673728942871,
0.1521185040473938,
-0.054016198962926865,
0.177568718791008,
-0.058649517595767975,
0.3366362750530243,
0.057625897228717804,
-0.4304862916469574,
-0.3189210295677185,
0.18624886870384216,
-0.4029012620449066,
0.383999794721603... | |
NULL
2 1 Electronics NULL NULL
3 1 Clothing NULL NULL
4 1 Books NULL NULL
5 2 Televisions NULL NULL
6 2 | [
0.43384015560150146,
0.6482968926429749,
0.08207816630601883,
0.10101890563964844,
-0.6112717986106873,
-0.33508777618408203,
0.6774128675460815,
-0.2888137698173523,
0.021657021716237068,
-0.10109687596559525,
-0.10382344573736191,
-0.1920664757490158,
-0.6376707553863525,
0.5642464160919... | |
Stereos NULL NULL
7 5 Plasma NULL NULL
8 5 LCD NULL NULL
```
t\_categories (after use of the script I gave)
```
Cat Parent CategoryName Depth Breadcrumb
1 NULL MyStore 0 | [
0.027130309492349625,
-0.009687401354312897,
0.13693055510520935,
-0.03148280456662178,
-0.20103593170642853,
0.005152497906237841,
0.2248348742723465,
0.09792026877403259,
0.05932272598147392,
-0.030337104573845863,
-0.1262669861316681,
0.45353052020072937,
-0.6438958644866943,
0.30840978... | |
/
2 1 Electronics 1 /1/
3 1 Clothing 1 /1/
4 1 Books 1 /1/
5 2 Televisions 2 | [
0.6151632070541382,
0.43625110387802124,
-0.2577148973941803,
0.1344866156578064,
-0.3360365927219391,
-0.3348495662212372,
0.14771787822246552,
-0.21589602530002594,
0.26870715618133545,
-0.3806575536727905,
-0.2744491696357727,
-0.16294749081134796,
-0.3714240789413452,
-0.06801761686801... | |
/1/2/
6 2 Stereos 2 /1/2/
7 5 LCD 3 /1/2/5/
8 7 Samsung 4 /1/2/5/7/
```
t\_products (as you have it now, no modifications)...
```
ID Cat Name
1 | [
-0.029521094635128975,
-0.04334679991006851,
0.6968020796775818,
-0.23470285534858704,
-0.07182721048593521,
0.063362255692482,
-0.05116001144051552,
-0.29804736375808716,
-0.19279487431049347,
-0.170738086104393,
-0.4032522737979889,
0.37898680567741394,
-0.5051000714302063,
0.38345736265... | |
8 Samsung LNT5271F
2 7 LCD TV mount, up to 36"
3 7 LCD TV mount, up to 52"
4 5 HDMI Cable, 6ft
```
Join categories and products (where categories is C, products is P)
```
C.Cat Parent CategoryName Depth Breadcrumb ID p.Cat Name
1 NULL MyStore 0 / NULL NULL NULL
2 | [
-0.42892906069755554,
-0.20198117196559906,
0.8008765578269958,
0.022281523793935776,
-0.19913436472415924,
0.2168232798576355,
0.11916077882051468,
-0.1812334656715393,
-0.49322035908699036,
-0.2045472413301468,
-0.3040608763694763,
0.3154159486293793,
-0.1921316683292389,
0.0459660552442... | |
1 Electronics 1 /1/ NULL NULL NULL
3 1 Clothing 1 /1/ NULL NULL NULL
4 1 Books 1 /1/ | [
0.3222098648548126,
0.5408318042755127,
0.07766971737146378,
0.10688166320323944,
-0.5747878551483154,
-0.22245071828365326,
0.412908136844635,
-0.3144461512565613,
0.23706601560115814,
-0.13903096318244934,
-0.16915449500083923,
0.09369456768035889,
-0.5030174851417542,
0.1290325075387954... | |
NULL NULL NULL
5 2 Televisions 2 /1/2/ 4 5 HDMI Cable, 6ft
6 2 Stereos 2 /1/2/ NULL NULL NULL
7 5 | [
0.23300252854824066,
-0.058815740048885345,
0.5440753698348999,
0.2887476980686188,
-0.2894839644432068,
0.04037364199757576,
0.5503371953964233,
0.13266754150390625,
-0.06135356426239014,
-0.07195745408535004,
-0.18680502474308014,
0.2735981345176697,
-0.5207686424255371,
0.49466037750244... | |
LCD 3 /1/2/5/ 2 7 LCD TV mount, up to 36"
7 5 LCD 3 /1/2/5/ 3 7 LCD TV mount, up to 52"
8 7 | [
-0.23212313652038574,
-0.354136198759079,
0.6705926656723022,
0.109344981610775,
-0.07158011943101883,
0.6258848905563354,
0.08661424368619919,
-0.3662981390953064,
-0.41494473814964294,
-0.5161356925964355,
-0.2129303365945816,
0.8522084951400757,
-0.059534311294555664,
-0.063329704105854... | |
Samsung 4 /1/2/5/7/ 1 8 Samsung LNT5271F
```
Now assuming that the products table was more complete so that there is stuff in each category and no NULLs, you could do a "Breadcrumb LIKE '%/5/%'" to get the last three items of the last table I provided. Notice that it includes the direct items ... | [
0.09825756400823593,
0.012376071885228157,
0.741523802280426,
0.0009936339920386672,
-0.2294064164161682,
0.16862480342388153,
0.14918546378612518,
-0.2525179982185364,
-0.2781575620174408,
-0.14246489107608795,
-0.5545527935028076,
0.2386259287595749,
-0.11508750170469284,
0.0835909768939... | |
Can you explain the concepts of, and relationship between, Covering Indexes and Covered Queries in Microsoft's SQL Server?
A covering index is one which can satisfy all requested columns in a query without performing a further lookup into the clustered index.
There is no such thing as a covering query.
Have a look at... | [
0.2261706292629242,
0.08499196916818619,
0.16033300757408142,
0.4474804997444153,
-0.04995279014110565,
-0.41196128726005554,
-0.0882161408662796,
-0.06552743166685104,
-0.07502500712871552,
-0.4493865668773651,
-0.06737518310546875,
0.2836187183856964,
-0.3525298237800598,
-0.034619268029... | |
Is there a `selector` that I can query for elements with an ID that ends with a given string?
Say I have a element with an id of `ctl00$ContentBody$txtTitle`. How can I get this by passing just `txtTitle`?
If you know the element type then: (eg: replace 'element' with 'div')
```
$("element[id$='txtTitle']")
```
If ... | [
0.005247094202786684,
-0.13247473537921906,
0.5575748682022095,
-0.09529443830251694,
0.001967969350516796,
-0.21273957192897797,
0.07142595946788788,
-0.2674020528793335,
0.027802564203739166,
-0.41637203097343445,
-0.28146183490753174,
0.6295123100280762,
-0.18836064636707306,
-0.2585590... | |
Here is part of my code
```
define('DIR_APP', 'app/');
class Questions
{
const QUESTIONS_FILE = DIR_APP . 'questions.xml';
}
```
Seems when I take the `define()`'d constant out of my class constant declaration, it works fine. But when I add it it throws this error:
```
Parse error: syntax error,... | [
-0.08477351814508438,
0.1780714988708496,
0.2828575074672699,
-0.20992325246334076,
-0.05051908642053604,
0.155438631772995,
0.19098792970180511,
-0.15911643207073212,
-0.1323278695344925,
-0.5090808272361755,
-0.13365772366523743,
0.622114360332489,
-0.4173017144203186,
-0.043220669031143... | |
get it to resolve it globally?
Thank you
It can't be done.
Quote from <http://www.php.net/manual/en/language.oop5.constants.php> :
> "The value must be a constant
> expression, not (for example) a
> variable, a class member, result of a
> mathematical operation or a function
> call"
I think you could
> defin... | [
-0.27253803610801697,
-0.08508838713169098,
0.2563965916633606,
0.31859543919563293,
0.22182387113571167,
-0.27684485912323,
0.3623993396759033,
-0.0587182492017746,
-0.2645626962184906,
-0.42691370844841003,
-0.19585958123207092,
0.5257768034934998,
-0.43848517537117004,
0.020452637225389... | |
I am trying to specifically to pad out the /'s in an a tag's text.
```
1234/1234/ABCDE => 1234 / 1234 / ABCDE
```
In context; if I have an a tag:
```
<a href="http://www.domain.com/path/to/page.html">12 34/1234A/BC DEFG</a>
```
I would like to get:
```
<a href="http://www.domain.com/path/to/page.html">12 34 / 12... | [
0.14984643459320068,
0.13790856301784515,
0.7024707794189453,
-0.12354588508605957,
-0.15072661638259888,
-0.19342945516109467,
0.2617303133010864,
-0.21465979516506195,
-0.061916518956422806,
-0.638213038444519,
-0.5425165295600891,
0.33106449246406555,
-0.4207116365432739,
-0.13413377106... | |
obviously won't work if there are newlines inside the tags or in-between tag pairs. | [
0.8705129027366638,
-0.04737015441060066,
0.4118703305721283,
0.05290429666638374,
0.32789215445518494,
-0.2422007918357849,
0.2477792203426361,
-0.2098083794116974,
-0.1488422453403473,
-0.3662897050380707,
-0.00465770810842514,
0.15507881343364716,
-0.2211771458387375,
-0.131238028407096... | |
How can I downgrade a C++ Visual Studio 2008 project to visual studio 2005?
Maybe there is a converter program that someone knows of or otherwise a process that I can undertake. Thanks.
I have no idea how well it works, but here's an open source converter tool:
* <http://sourceforge.net/projects/vspc>
that was an ex... | [
0.38373303413391113,
-0.12256839126348495,
0.1970006376504898,
-0.014210909605026245,
-0.21979069709777832,
0.07106877863407135,
0.04618667811155319,
-0.01940109021961689,
-0.3047083616256714,
-0.6386938095092773,
0.10593336075544357,
0.6748278737068176,
-0.10163149237632751,
0.03789385035... | |
Please, anyone can guide me how to do this stuff.
I have a pannel and a box, The pannel is my component pannel(inside component pannel is eg. image, TextArea, Video) and
Box is my target Box for my component creation. The user can select a component he/she want to create (dynamic creation)
and drag it to target Box(... | [
0.7519013285636902,
-0.13757501542568207,
0.3674885630607605,
0.23549826443195343,
-0.18253925442695618,
0.3021564185619354,
-0.2696055769920349,
-0.32795506715774536,
-0.19935911893844604,
-0.6938114166259766,
0.22496849298477173,
0.38086363673210144,
-0.20728163421154022,
0.2898750901222... | |
it seems this code works only on image
```
//-----action script-----//
private function dragIt(event:MouseEvent, value: String, objParent: String, objName: String):void
{
var dragInitiator:Image = event.currentTarget as Image;
var dragSource:DragSource = new Drag... | [
0.04241301864385605,
-0.4290156066417694,
0.6626906991004944,
-0.20824141800403595,
0.03282155096530914,
0.19709832966327667,
0.18518753349781036,
-0.1931036412715912,
-0.06697659194469452,
-0.4152553081512451,
-0.2393568903207779,
0.688202977180481,
-0.7674535512924194,
0.0555996894836425... | |
dragSource.addData(objParent, 'parent');
dragSource.addData(objName, 'objname');
var dragProxy:Image = new Image();
dragProxy.source = event.currentTarget.source;
DragManager.doDrag(dragInitiator, dragSource, event, dragProxy);
}
private function dragE... | [
-0.10520089417695999,
-0.37948817014694214,
0.4137851297855377,
-0.2067573219537735,
-0.007970351725816727,
0.31193599104881287,
-0.06343536078929901,
-0.25641316175460815,
-0.06571532040834427,
-0.42111921310424805,
-0.4222881495952606,
0.6896914839744568,
-0.6609594821929932,
0.254274308... | |
var dropTarget:Box=event.currentTarget as Box;
dropTarget.setStyle("borderThickness", 5);
DragManager.acceptDragDrop(dropTarget);
}
private function dragExitHandler(event:DragEvent):void
{
var dropTarget:Box=event.currentTarget as Box; | [
0.2209509164094925,
-0.5153828859329224,
0.5001334547996521,
-0.10522829741239548,
0.061316631734371185,
0.29103174805641174,
0.1584671288728714,
-0.2455306202173233,
-0.23515132069587708,
-0.14987193048000336,
-0.2470557689666748,
0.7889518737792969,
-0.5997804403305054,
0.012029798701405... | |
revertBoxBorder();
}
private function revertBoxBorder():void
{
targetBox.setStyle("borderThickness", 1);
}
private function dragDropHandler(event:DragEvent):void | [
0.2356375902891159,
-0.5474451780319214,
0.6358221173286438,
0.0298727098852396,
-0.01640981063246727,
0.06796357035636902,
0.24332986772060394,
-0.21148574352264404,
-0.2126384824514389,
-0.49540045857429504,
-0.11087459325790405,
0.8339260220527649,
-0.43699735403060913,
-0.0770025625824... | |
{
var value:String = event.dragSource.dataForFormat('value') as String;
var objParent:String = event.dragSource.dataForFormat('parent') as String;
if(value == "mp3")
{
//do something
} | [
-0.03755741938948631,
-0.15142780542373657,
0.056967828422784805,
-0.0546799898147583,
0.37266016006469727,
0.17147977650165558,
0.3117486238479614,
-0.19636774063110352,
-0.17917893826961517,
0.04447869956493378,
-0.2978942096233368,
0.7363407611846924,
-0.448097825050354,
0.2626907229423... | |
else if (value == "image")
{
if (objParent == "panel")
{
var imgView: Image = new Image; | [
-0.2721492350101471,
-0.24454323947429657,
0.5156452655792236,
-0.34741032123565674,
0.1265685111284256,
0.14830723404884338,
0.3509696424007416,
-0.25764772295951843,
-0.032172661274671555,
-0.6206291913986206,
-0.3288549780845642,
0.7736568450927734,
-0.38219356536865234,
0.0542902238667... | |
imgView.x = event.stageX;
imgView.y = event.stageY;
addChild(imgView);
imgView.name = String(getChildByName(imgView.name).parent.numChildren-1); | [
-0.11997008323669434,
-0.2577700912952423,
0.14490705728530884,
-0.34300193190574646,
0.059173449873924255,
0.1794665902853012,
0.4381626844406128,
0.0124885905534029,
0.14381660521030426,
-0.5207703709602356,
-0.23966671526432037,
0.2718566060066223,
-0.16257698833942413,
0.38491901755332... | |
imgView.addEventListener(MouseEvent.MOUSE_MOVE, function(e:MouseEvent):void
{
dragIt(e, value, 'box', Image(e.target).name);
});
imgView.source = ImgInsert; | [
-0.05774803087115288,
-0.3824412226676941,
0.597293496131897,
-0.31246301531791687,
-0.13674063980579376,
0.13821305334568024,
0.39531928300857544,
-0.27895447611808777,
-0.03827407956123352,
-0.6601359248161316,
-0.26223739981651306,
0.7141357660293579,
-0.7701065540313721,
0.171877160668... | |
}
else
{
var objName:String = event.dragSource.dataForFormat('objname') as String;
getChildByName(objName).parent.getChildAt(int(objName)).x = event.stageX; | [
-0.2556600570678711,
-0.240255668759346,
-0.012357688508927822,
-0.45619186758995056,
0.43665939569473267,
0.32047393918037415,
0.5450820922851562,
0.008347648195922375,
0.11566805839538574,
-0.46814969182014465,
-0.32321277260780334,
0.41733163595199585,
-0.24866417050361633,
0.3534858226... | |
getChildByName(objName).parent.getChildAt(int(objName)).y = event.stageY;
}
}
else if (value == "textarea")
{
//do something | [
0.13827186822891235,
-0.33839428424835205,
0.02342878095805645,
-0.06919416040182114,
0.19057586789131165,
0.001906371908262372,
0.7662388682365417,
-0.19161944091320038,
0.19556161761283875,
-0.5171868205070496,
-0.3265862464904785,
0.3988921344280243,
0.030405934900045395,
0.009805469773... | |
}
}
//-----mxml code------//
<mx:Panel x="0" y="37" width="91" height="417" layout="absolute" title="Component" borderColor="#8DA5AB" color="#345860" borderStyle="outset">
<mx:Image x="7" y="43" width="21" height="18" source="{TxtAreaInsert}" mouseMove="dragIt(event,'textarea','panel','')"/>
<mx:Image... | [
0.017900243401527405,
-0.2931254506111145,
1.120022177696228,
0.12748093903064728,
0.011007869616150856,
0.10993208736181259,
-0.13886816799640656,
-0.6561567187309265,
-0.37297186255455017,
-0.45772168040275574,
-0.04240491986274719,
0.805440366268158,
-0.163077250123024,
-0.1208505630493... | |
inside target box?
(This is like GUI of flex when creating component)
Thank you..
check out [Rogue-Development.com's Object Handles](http://www.rogue-development.com/objectHandles.html) I've used this with pretty good success for moving / resizing components. | [
0.5051981210708618,
-0.19970272481441498,
0.0762750580906868,
0.1125950813293457,
-0.4745388627052307,
-0.1592603474855423,
0.033615510910749435,
-0.27722978591918945,
-0.13541722297668457,
-0.6476847529411316,
0.2700073719024658,
0.6806951761245728,
-0.04273824021220207,
-0.06618028134107... | |
Using Jquery to Open a dialog (with modal:true), which contains a form. Now i am removing some elements from the form based on choices made by user on the form.This resizes the dialog but the overlay is not resized. A shadow is left behind.
Is there a way to re size the overlay when the dialog is resized?
below is so... | [
0.21000219881534576,
-0.23757460713386536,
0.5568733215332031,
-0.23406440019607544,
0.14146459102630615,
-0.020124778151512146,
0.2930845320224762,
-0.35980018973350525,
0.017913732677698135,
-0.6992137432098389,
-0.02191442996263504,
0.5070106387138367,
-0.49650049209594727,
0.0095987543... | |
$("#modify_tag_window").fadeIn();
$("#task_help_text").fadeIn();
}else{
$("#modify_task_window").fadeOut();
$("#modify_tag_window").fadeOut();
$("#task_help_text").fadeOut();
```
Now after this `fadeOut()` the dialog is resized but the overlay is not resized. A... | [
0.026302974671125412,
-0.2001010626554489,
0.5570241212844849,
-0.3879043161869049,
0.1777304857969284,
0.1413981318473816,
0.36096251010894775,
-0.19625838100910187,
-0.17469166219234467,
-0.7554301619529724,
-0.11775954067707062,
0.8878377676010132,
-0.35381701588630676,
0.02614961192011... | |
I need to collect statistics from my server application written in python. I am looking for some general guidance on how to setup models and exactly how to store the statistics information. I was thinking of storing and organizing all this information in a database, but my implementation is turning out to be too specif... | [
0.611829400062561,
0.10632900148630142,
0.054041750729084015,
0.3904443383216858,
-0.06277669221162796,
-0.05759202316403389,
0.0332077294588089,
0.14385439455509186,
-0.2688398063182831,
-0.43459391593933105,
0.36768120527267456,
0.2830471396446228,
-0.2621594965457916,
-0.047804053872823... | |
your problem. But I have created a few similar programs and here's some things that I found that worked well.
* Create an asynchronous logging service so the logging doesn't adversely affect your code's performance. (You need to be mindful of where you are storing your data, where it is processed, etc. because you can... | [
0.2596147358417511,
-0.10878526419401169,
0.22439895570278168,
0.483603298664093,
0.058990463614463806,
-0.22866831719875336,
0.5776097178459167,
0.2105257511138916,
-0.4315713942050934,
-0.7169268727302551,
-0.027681121602654457,
0.6117485761642456,
-0.39128878712654114,
-0.03109301254153... | |
data
+ Always include the time the action was performed. If you can capture run time that it typically useful too. | [
0.3437683582305908,
-0.5260458588600159,
0.22301289439201355,
0.4597731828689575,
-0.29484474658966064,
-0.30320292711257935,
0.02959454618394375,
-0.16277945041656494,
-0.13229964673519135,
-0.3090665638446808,
0.07038402557373047,
0.30610185861587524,
-0.06210722774267197,
-0.34149882197... | |
I've read some of the questions regarding anemic domain models and separation of concerns. What are the best techniques for performing/attaching domain logic on anemic domain objects? At my job, we have a pretty anemic model, and we're currently using "helper" classes to perform the database/business logic on the domai... | [
0.6543158292770386,
0.054024383425712585,
0.1548139452934265,
-0.08507654070854187,
0.3995797336101532,
0.44039398431777954,
-0.45407846570014954,
0.08016035705804825,
0.1563364565372467,
-0.3784252107143402,
-0.09277302771806717,
0.8486752510070801,
-0.12196565419435501,
0.605037093162536... | |
// Lookup Customer and Product in db
// Create records for purchase
// etc.
}
}
```
When the app needs to do a purchase, it would create the StoreHelper, and call the method on the domain objects. To me, it would make sense for the Customer/Product to know how to save itself to a repository, but... | [
0.4384838938713074,
0.27383536100387573,
0.19897876679897308,
0.0109049491584301,
0.28671225905418396,
0.17853598296642303,
-0.12735816836357117,
-0.062008388340473175,
0.06742755323648453,
-0.47207459807395935,
-0.11759554594755173,
0.4959377348423004,
-0.39250215888023376,
0.214894071221... | |
Customer.Purchase(Product), but that is putting domain logic on the entity.
Here are some techniques I've come across, not sure which are good/bad:
1. Customer and Product inherit from an "Entity" class, which provides the basic CRUD operations in a generic fashion (using an ORM maybe).
* Pros: Each data object woul... | [
0.34470510482788086,
-0.07277247309684753,
0.053065020591020584,
0.19743409752845764,
0.04962138831615448,
-0.0968218445777893,
-0.4385184645652771,
-0.3028724491596222,
0.05582093819975853,
-0.419870525598526,
0.008161959238350391,
0.7752166390419006,
-0.17375469207763672,
0.2648583352565... | |
it make sense to have DAOs for the "pure database" operations, and separate business helpers for the more business-specific operations?
* Is it better to use non-static or static helper classes for this?
* Pros: domain objects are not tied to any database/business logic (completely anemic)
* Cons: not very OO, not v... | [
-0.04954303801059723,
-0.1853162944316864,
0.11343958973884583,
0.33755046129226685,
0.007992880418896675,
-0.13217048346996307,
-0.042807646095752716,
-0.14909522235393524,
-0.3571861982345581,
-0.3780840337276459,
-0.19431836903095245,
0.60798579454422,
-0.5417332649230957,
-0.3650819659... | |
to attach the CRUD/business methods to a domain object without touching it
* Is this a valid approach? What are pros/cons?
5. Other techniques?
What are the best techniques for handling this? I'm pretty new to DDD (I'm reading the Evans book - so maybe that will open my eyes)
Martin Fowler has written a lot about dom... | [
0.3946685492992401,
0.4090855121612549,
0.22112895548343658,
-0.06800346821546555,
0.030818726867437363,
0.19273881614208221,
0.12354622781276703,
-0.24446192383766174,
-0.2676639258861542,
-0.7164475917816162,
0.21112918853759766,
0.4032081961631775,
-0.5632848739624023,
0.149741888046264... | |
the description of your problem, it sounds like your helper classes contain both domain/business rules *and* database implementation details.
The Active Record would move the helper's domain logic and database code into the other domain objects (like your `Entity` base class). The Data Mapper would move the helper's ... | [
-0.20423009991645813,
-0.05497332662343979,
0.2908267676830292,
0.39441362023353577,
0.029738541692495346,
-0.08608757704496384,
0.00683929119259119,
-0.2538529336452484,
-0.2375575304031372,
-0.7524363994598389,
-0.009841769933700562,
0.6596126556396484,
-0.3702443242073059,
-0.0999215394... | |
a good introduction to Evans' book. Plus "Domain Driven Design Quickly" is available as a free PDF. | [
0.035852693021297455,
-0.2824164927005768,
-0.04418535903096199,
0.283359169960022,
-0.04279184341430664,
-0.6847187280654907,
0.16512709856033325,
0.15756554901599884,
0.04632619023323059,
-0.8132132887840271,
-0.0705219954252243,
0.3034763038158417,
0.0568065345287323,
0.0321687646210193... | |
Is there Anyone that has experience with any open source, or relatively cheap voice recognition API for java? I'm pretty much looking for something that will turn spoken words into text.
From the java speech recognition page on sun, it seems that it is something that is rather dead. My requirements is something that a... | [
0.0849011018872261,
0.4639826714992523,
-0.07522611320018768,
0.0616653636097908,
-0.2447604238986969,
-0.03869524598121643,
0.3270627558231354,
0.3173341155052185,
-0.14170704782009125,
-0.7150577306747437,
0.1300993710756302,
0.4559329152107239,
-0.11520493775606155,
0.038976941257715225... | |
error rate. Training seems like a project all in itself, I'm hoping to gather some strength to try it this weekend.
IBM ViaVoice
There are news announcements floating around for 2004 about [Via Voice being made open source](http://www.linux.com/feature/10482). It seems the news release was premature and that it nev... | [
0.25982892513275146,
0.021128026768565178,
0.30234184861183167,
-0.17014308273792267,
-0.09281895309686661,
0.10280390828847885,
0.09365364164113998,
0.5811901092529297,
-0.006408744025975466,
-0.3643779754638672,
0.04612591490149498,
0.387966126203537,
0.17221872508525848,
0.3283620774745... | |
an arm and a leg. And just using it will take the ones you have left, at least after my experience with websphere and their IDE.
Nuance
It seems they still might create products for linux. But I think they got lost and followed IBM into the server market. I'm not that sure about this one, their web-site is not that... | [
0.7104794383049011,
0.2652452886104584,
-0.18510301411151886,
0.29966673254966736,
-0.12566007673740387,
-0.28513073921203613,
0.33802109956741333,
0.17739638686180115,
-0.647549569606781,
-0.3228992819786072,
0.1973884403705597,
0.2078545242547989,
-0.04227924719452858,
0.0875448510050773... | |
this weekend to see if it wants to be friends. Else worse case, I'll be looking at using Microsoft's speech solution. It has worked well for me in the past, but it's not a great linux solution. I could probably use it through wine, but then I'll have two separate servers... messy messy.
Oh and what seems a good place ... | [
0.42161479592323303,
0.06016397103667259,
0.5385070443153381,
0.0014594683889299631,
-0.05701972544193268,
-0.16757851839065552,
0.3223004639148712,
0.24278567731380463,
-0.15144364535808563,
-0.5182673931121826,
0.05140848830342293,
0.5235860347747803,
0.5217170119285583,
0.06419000774621... | |
I'm logging errors to the event log using the usual:
```
System.Diagnostics.Trace.TraceError("<" + purpose + "><time>" + DateTime.Now.ToUniversalTime() + "</time><message>" + message + "</message></" + purpose + ">");
```
and am wondering if there is a way to call this log file and display it for the user (either i... | [
0.21946214139461517,
0.209331676363945,
0.1555599868297577,
0.023615144193172455,
0.03523214906454086,
-0.07410242408514023,
0.297956258058548,
0.0833759605884552,
-0.3227877914905548,
-0.7971190214157104,
0.26473990082740784,
0.6614295244216919,
-0.14493343234062195,
0.14073634147644043,
... | |
entries in the applications log as follows
```
var log = EventLog.GetEventLogs().Where(x => x == "Application").First();
foreach (var entry in log.Entries) {
// Do something with the entry
}
``` | [
-0.31667986512184143,
0.11626911908388138,
0.4918416738510132,
-0.12582232058048248,
0.24463222920894623,
-0.1118202805519104,
0.09826778620481491,
-0.23952241241931915,
-0.14536885917186737,
-0.5473882555961609,
-0.5346901416778564,
0.4690116047859192,
-0.26165932416915894,
0.066195189952... | |
I need to be able to create a quiz type application with 20 some odd multiple choice questions.
I have 3 models: `Quizzes`, `Questions`, and `Answers`.
I want in the admin interface to create a quiz, and inline the quiz and answer elements.
The goal is to click "Add Quiz", and be transferred to a page with 20 ques... | [
0.09121973812580109,
0.15398989617824554,
0.3489808440208435,
0.24966204166412354,
-0.07914263755083084,
0.3118569254875183,
0.00442825723439455,
-0.3751763105392456,
-0.08463837951421738,
-0.6911997199058533,
-0.004532521590590477,
0.5651068687438965,
-0.10860495269298553,
0.2170301973819... | |
models.CharField(blank=true, max_length=50)
question = models.ForeignKey(Question)
class QuestionInline(admin.TabularInline):
model = Question
extra = 20
class QuestionAdmin(admin.ModelAdmin):
inlines = [QuestionInline]
class AnswerInline(admin.TabularInline):
model = Answer
extra = 4
class ... | [
-0.17037321627140045,
-0.0745331197977066,
0.3917061984539032,
0.08050411939620972,
-0.02924920618534088,
0.2677258849143982,
0.09959940612316132,
-0.37379008531570435,
-0.3230782747268677,
-0.43209633231163025,
0.07883776724338531,
0.6086766719818115,
-0.35850730538368225,
0.0260588377714... | |
admin (i.e. you can't have a Quiz with inline Questions, with each inline Question having inline Answers). So you'll need to lower your sights to just having inline Questions (then if you navigate to view a single Question, it could have inline Answers).
So your models are fine, but your admin code should look like th... | [
-0.07587314397096634,
0.20247524976730347,
0.5422140955924988,
0.36509573459625244,
-0.4416966438293457,
0.2851751744747162,
0.2719842493534088,
-0.4928113520145416,
0.04866538569331169,
-0.7770790457725525,
-0.10042703151702881,
0.5622323155403137,
-0.45355722308158875,
-0.128453776240348... | |
doesn't make sense for AnswerAdmin to have an AnswerInline, or QuestionAdmin to have a QuestionInline (unless these were models with a self-referential foreign key). And QuizAdmin can't have an AnswerInline, because Answer has no foreign key to Quiz.
If Django did support nested inlines, the logical syntax would be fo... | [
-0.1628732979297638,
-0.11021038889884949,
0.4552513062953949,
0.3281290531158447,
-0.3715066909790039,
0.017592979595065117,
0.045560259371995926,
-0.12870481610298157,
-0.3882581293582916,
-0.26366084814071655,
-0.10459403693675995,
0.5240529775619507,
-0.36636465787887573,
-0.2215113192... | |
- makes for a long page, but makes it easy to add lots of questions at once. | [
0.1701894998550415,
0.2960301339626312,
0.11316424608230591,
0.4156290292739868,
-0.12282130122184753,
-0.13260005414485931,
-0.02133750729262829,
-0.21547791361808777,
0.05561632290482521,
-0.24217477440834045,
-0.05673641338944435,
0.051222629845142365,
0.17684362828731537,
0.06513371318... | |
What is the real use of indexer in C#?
It looks pretty confusing as I am a new c# programmer. It looks like an array of objects but it's not.
You can think of an indexer as a Property that takes a parameter.
What you do with this parameter is up to you.
Generally, the indexers are used where providing , well, an *in... | [
0.04477044194936752,
0.07139892876148224,
0.1685812920331955,
0.27112770080566406,
-0.2910861670970917,
-0.1306987851858139,
-0.24653680622577667,
-0.024369576945900917,
-0.3599044978618622,
-0.5149657130241394,
-0.009619778953492641,
0.592344343662262,
-0.35096603631973267,
-0.00819439813... | |
give the position of the object we want to return.
I wrote a blog entry a while ago on the aspects of [indexers using reflection](http://blog.nkadesign.com/2006/net-the-limits-of-using-reflection/).
One of the examples I gave was:
```
using System;
using System.Collections;
public class DayPlanner
{
... | [
0.1784699559211731,
-0.3960071802139282,
0.7441024780273438,
0.03050162084400654,
0.12264934182167053,
-0.08276476711034775,
-0.06845255196094513,
0.011704494245350361,
-0.24988315999507904,
-0.5335541367530823,
-0.13007612526416779,
0.17142558097839355,
-0.12072844058275223,
0.29128763079... | |
get {
return _meetings[date] as string;
}
set {
_meetings[date] = value;
}
}
// Second indexer, overloads the first
public string | [
-0.09269313514232635,
-0.37804290652275085,
0.3373492360115051,
0.23773421347141266,
0.2461758553981781,
-0.29050061106681824,
0.16080763936042786,
0.003188231959939003,
-0.2525458037853241,
-0.3082425594329834,
-0.36492031812667847,
0.5058247447013855,
-0.41037634015083313,
0.275442957878... | |
this[string datestr] {
get {
return this[DateTime.Parse(datestr)] as string;
}
set {
this[DateTime.Parse(datestr)] = value;
}
}
}
```
And then you could | [
0.2496338039636612,
-0.19854891300201416,
0.5072488784790039,
-0.18157561123371124,
0.5319692492485046,
-0.19067031145095825,
-0.07884910702705383,
-0.07540881633758545,
-0.08374211192131042,
-0.31777605414390564,
-0.21968908607959747,
0.42593491077423096,
-0.3224571943283081,
0.1831418275... | |
use it like this:
```
DayPlanner myDay = new DayPlanner();
myDay[DateTime.Parse("2006/02/03")] = "Lunch";
...
string whatNow = myDay["2006/06/26"];
```
That's just to show you can twist the purpose of an indexer to do what you want.
Doesn't mean you should though... :-) | [
0.054571934044361115,
-0.36937448382377625,
0.7598804235458374,
-0.16531872749328613,
0.08927225321531296,
-0.0885172113776207,
-0.25824543833732605,
0.09012202173471451,
-0.2817336320877075,
-0.2916052043437958,
0.025374779477715492,
0.07435427606105804,
-0.14472657442092896,
0.3150159716... | |
Consider my `Event` class, and that i store `DateTime`'s in the DB as UTC dates. I simply want to return a filtered range based on the current date in a particular time zone - easy right?
This works fine:
```
IQueryable<Event> test1 = this.GetSortedEvents().Where(e => e.FinishDateTime.Date >= DateTime.UtcNow.Date);
... | [
0.0674017146229744,
-0.2755695581436157,
0.4709123969078064,
0.010261036455631256,
-0.08652321249246597,
-0.2595142424106598,
0.36269325017929077,
-0.3408684730529785,
0.15568485856056213,
-0.6567807793617249,
-0.31904613971710205,
0.32549962401390076,
-0.18715405464172363,
0.2643489539623... | |
return utcTime.AddHours(3);
> }
>
> ```
This does NOT work:
```
IQueryable<Event> test3 = this.GetSortedEvents().Where(e => e.FinishDateTime.RiyadhTimeFromUtc().Date >= DateTime.UtcNow.RiyadhTimeFromUtc().Date);
```
.. and i get this NotSupportedException: Method 'System.DateTime RiyadhTimeFromUtc(System.DateT... | [
0.2319497913122177,
0.06402243673801422,
0.5460209846496582,
-0.14569240808486938,
0.02351454459130764,
-0.27983129024505615,
0.5791707634925842,
-0.20205199718475342,
0.006002092268317938,
-0.4204109013080597,
-0.2726811170578003,
0.5296423435211182,
-0.42924395203590393,
0.19561566412448... | |
here (or a different workaround approach to this problem) i'd be really grateful.
You have to think about it in terms of an expression tree, which is how Linq-to-SQL parses your query to turn it into SQL.
When examining the tree it will see a `DateTime` object and then check whether the method called on it is one of t... | [
0.5946404933929443,
0.07031669467687607,
0.37663891911506653,
0.047114744782447815,
0.25519508123397827,
-0.2790929973125458,
-0.2424146831035614,
-0.00565172266215086,
-0.3537446856498718,
-0.22939105331897736,
0.029448436573147774,
0.38378527760505676,
-0.1036931499838829,
-0.10208718478... | |
isn't in the expression tree, it's hidden in the IL. So it doesn't matter whether the contents of the extension method are supported, because Linq-to-SQL can't work out what the contents are.
The point of creating methods is encapsulation and information hiding, which typically works well in application development, b... | [
0.2509474456310272,
0.0449095293879509,
0.21309581398963928,
0.2120920717716217,
0.1540919989347458,
-0.21786031126976013,
-0.04783030226826668,
-0.292811781167984,
-0.2278425097465515,
-0.4319590926170349,
-0.08883381634950638,
0.2351398468017578,
-0.2923823297023773,
-0.1717890202999115,... | |
efficient is not to use an extension method, and just use `AddHours(3)` directly on the `DateTime` object.
It's one of the unfortunate limitations of Linq. Like many things it's a somewhat leaky abstraction which, while providing common syntax over a range of sources, has different limitations and restrictions on whi... | [
0.0535687617957592,
0.004729758482426405,
0.33565759658813477,
-0.005294091068208218,
0.281782865524292,
-0.2818702757358551,
0.05690848082304001,
-0.09083246439695358,
0.17846228182315826,
-0.577218234539032,
-0.18763130903244019,
0.47931864857673645,
-0.624143660068512,
-0.48478183150291... | |
I am getting an error when I try to checkout code using TortoiseSVN.
> Error: OPTIONS of 'Serverpath': could not connect to server
> (http:Serverpath)
Any thoughts?
You have to think about it in terms of an expression tree, which is how Linq-to-SQL parses your query to turn it into SQL.
When examining the tree it w... | [
0.32578951120376587,
-0.13645166158676147,
0.473550945520401,
-0.09593325853347778,
0.2643296718597412,
0.021011454984545708,
0.2679462730884552,
0.15295028686523438,
-0.4532175660133362,
-0.5448769927024841,
0.12334875762462616,
0.48104384541511536,
-0.32281890511512756,
-0.12211650609970... | |
to see what it does, as the information about that method's body isn't in the expression tree, it's hidden in the IL. So it doesn't matter whether the contents of the extension method are supported, because Linq-to-SQL can't work out what the contents are.
The point of creating methods is encapsulation and information... | [
0.45763275027275085,
0.037382468581199646,
0.2705077528953552,
0.27775269746780396,
0.12217818945646286,
-0.33830830454826355,
0.028254056349396706,
-0.35480132699012756,
-0.1909882128238678,
-0.47384917736053467,
-0.09475944936275482,
0.3718346953392029,
-0.2622867226600647,
-0.0189948659... | |
Linq expression, the only thing you can do to keep the query efficient is not to use an extension method, and just use `AddHours(3)` directly on the `DateTime` object.
It's one of the unfortunate limitations of Linq. Like many things it's a somewhat leaky abstraction which, while providing common syntax over a range ... | [
0.19787020981311798,
0.02560003660619259,
0.4372895359992981,
0.07397697120904922,
0.05614062771201134,
-0.37473344802856445,
0.06756985187530518,
-0.016421353444457054,
0.004388205707073212,
-0.3290467858314514,
-0.14922665059566498,
0.4674299955368042,
-0.4659610986709595,
-0.23303428292... | |
Recently I found a very surprising behavior in c#.
I had a method which takes `IEnumerable<Object>` as a parameter and i was passing
`IEnumerable<string>` but it's not possible.
While in c# everything can be upcast to Object than why this is not possible?
It's totally confusing for me.
Please someone clear me on this i... | [
0.2847554087638855,
-0.18324065208435059,
0.25366416573524475,
0.14861157536506653,
-0.5300978422164917,
-0.32367005944252014,
0.13596540689468384,
-0.04464876651763916,
-0.3372189998626709,
-0.5007846355438232,
0.05176199972629547,
0.6591368913650513,
-0.5355294942855835,
0.44151541590690... | |
there is no typing relationship between an `IEnumerable<object>` and an `IEnumerable<string>`, just because string is a subtype of object. They're just considered two completely unrelated types, like a string and an int (they still both are subtypes of object, but everything is)
There are a few workarounds and excepti... | [
0.33671244978904724,
-0.20722346007823944,
-0.03968561440706253,
-0.038069359958171844,
-0.41506901383399963,
-0.07499668002128601,
0.18245890736579895,
-0.2610073387622833,
-0.1858769953250885,
-0.7224876284599304,
0.03235555440187454,
0.42807745933532715,
-0.4531807005405426,
0.048252973... | |
for reference type, i.e. passing in a string[] type to a method acccepting object[] types should work. | [
0.15033146739006042,
-0.06448964774608612,
0.16452938318252563,
0.05792497843503952,
0.010102638974785805,
-0.053627967834472656,
0.032741378992795944,
-0.17646722495555878,
0.017045389860868454,
-0.32714229822158813,
-0.05611223727464676,
0.6410298347473145,
-0.5641849040985107,
-0.019148... | |
Could somebody please explain this piece of Ruby code:
```
def add_spec_path_to(args) # :nodoc:
args << {} unless Hash === args.last
args.last[:spec_path] ||= caller(0)[2]
end
```
I have seen the `<<` operator used for concatenation strings or as a bitwise operator in other languages but could somebody explain i... | [
0.18542584776878357,
0.13615693151950836,
0.17821989953517914,
-0.14991095662117004,
-0.26019957661628723,
-0.37760111689567566,
0.47249579429626465,
-0.05820072442293167,
-0.25172093510627747,
-0.12014208734035492,
-0.11250860244035721,
0.33777928352355957,
-0.46065208315849304,
0.2590956... | |
idiom: it assigns the value only if it is not already set. The effect is the same as code like
```
if some_variable == nil
some_variable = some_value
end
```
or
```
some_variable= some_value unless some_variable
```
===, when not overridden, compares two objects for identity. In the case of `Hash === args.last... | [
-0.006635621655732393,
-0.03313785791397095,
0.02227330394089222,
0.025825440883636475,
-0.33113837242126465,
-0.35032427310943604,
0.17444244027137756,
-0.30498331785202026,
0.0829220786690712,
-0.6578943729400635,
-0.12026843428611755,
0.5320636034011841,
-0.39977890253067017,
0.12040194... | |
around, for example:
```
a = [{}]
Hash === a.last #=> true
a.last === Hash #=> false
```
The trailing arguments to a method may be supplied as the contents of a hash without needing to provide the {}
So you can do this:
```
def hello(arg1, arg2, arg3)
puts [arg1.class, arg2.class, arg3.class].join(',')
end
hell... | [
-0.10001736134290695,
0.06852546334266663,
0.23158791661262512,
-0.21553750336170197,
0.07027923315763474,
0.18231093883514404,
0.047124769538640976,
-0.21197043359279633,
-0.15269388258457184,
-0.12026065587997437,
-0.16759203374385834,
0.33467814326286316,
-0.40893492102622986,
-0.095325... | |
args would have to be input as an array, whcih would rather defeat the object.
```
def add_spec_path_to(*args) # now args is an array
args << {} unless Hash === args.last # if trailing arguments cannot be
# interpreted as a Hash, add an empty | [
-0.06374364346265793,
0.02813013084232807,
0.7653581500053406,
-0.4003187417984009,
-0.2783210873603821,
0.027454964816570282,
0.26122742891311646,
-0.33735236525535583,
-0.509932279586792,
-0.26609349250793457,
-0.019539494067430496,
0.40099000930786133,
-0.7486373782157898,
0.05337952077... | |
# Hash here so that following code will
# not fail
args.last[:spec_path] ||= caller(0)[2] # Set | [
0.16006802022457123,
-0.0695355087518692,
0.612831175327301,
-0.35599198937416077,
0.27314040064811707,
-0.1954471617937088,
0.4013817310333252,
-0.47146710753440857,
-0.18337726593017578,
-0.19607742130756378,
-0.19117754697799683,
0.7114424705505371,
-0.2949177622795105,
-0.2128450274467... | |
the spec_path option if it's not
# already set
end
```
EDIT: Expanding further on the \*args thing, try this:
```
def x(*args)
puts args.join(',')
puts args.map{|a| a.class }.join(',')
end
x 1,2,:a=>5,:b=>6
1,2,a5b6
Fixnum,Fixnum,Hash
```
... using \*args causes args ... | [
0.21087521314620972,
-0.10770534723997116,
0.6159982085227966,
-0.22221910953521729,
-0.027244407683610916,
0.024421248584985733,
0.04297349974513054,
-0.49508628249168396,
-0.3681859076023102,
-0.515617847442627,
-0.01802024431526661,
0.6259291172027588,
-0.6692657470703125,
-0.0257931631... | |
then args has to be an array before I call the method, or I'll get an "ArgumentError: wrong number of arguments" for anything but one thing passed. So it has to look like this:
```
y [1,2,{:c=>3,:d=>4}]
```
...with the Hash explicitly created with {}. And it's ugly.
All the above tested with MRI 1.8.6, btw. | [
-0.14803141355514526,
0.34259113669395447,
0.7104789018630981,
-0.4152030944824219,
-0.2313927859067917,
0.0038173452485352755,
0.20317299664020538,
-0.3719594180583954,
-0.20736989378929138,
-0.4506530463695526,
0.42274293303489685,
0.4647134840488434,
-0.47588205337524414,
0.147487968206... | |
Of course if I put enough rows eventually there will be a repeat. But let's assume I choose a big enough id field.
I want to know if I can assume that the id uniquely identifies the row over time. And if the client sends me an id I want to be able to determine what row it refers or if the row was deleted (or if it is ... | [
0.38297510147094727,
0.20484714210033417,
0.47282856702804565,
0.08256020396947861,
0.3713385760784149,
-0.0005429277662187815,
0.13553225994110107,
0.08343641459941864,
-0.4020470976829529,
-0.7065173387527466,
-0.006958763115108013,
0.6531914472579956,
-0.2843485474586487,
0.216213628649... | |
- will it be continue creating ids where it left - or may be it will decide to "fill in the holes"
If you have a "int not null auto increment primary key" that you never reset, then yes IDs will not be reused.
However, this raises an interesting question - what happens *if* you happen to reuse an old ID (even though i... | [
0.3534538447856903,
-0.09107685834169388,
0.34814217686653137,
0.298555850982666,
0.1740446239709854,
-0.28176814317703247,
0.3343433141708374,
-0.064162977039814,
-0.2662753462791443,
-0.6924739480018616,
-0.22200800478458405,
0.43845847249031067,
-0.256424218416214,
0.2843002676963806,
... | |
I'll flesh out my answer), about this quote: *"And if the client sends me an id I want to be able to determine what row it refers or if the row was deleted"*. It's always possible to determine what row an ID belongs to if it's not deleted (kind of vital to be able to extract information out of your database).
**Howeve... | [
0.3908216059207916,
0.11426107585430145,
0.17729489505290985,
0.27564844489097595,
0.14593935012817383,
-0.3064473569393158,
0.03612510487437248,
0.19809673726558685,
-0.27211007475852966,
-0.6493686437606812,
0.10016379505395889,
0.664982795715332,
0.028832267969846725,
0.0797827318310737... | |
preferably by [triggers](http://www.google.com/search?hl=sv&q=mysql+triggers+to+audit&btnG=S%C3%B6k&lr=) . | [
0.3601830303668976,
-0.05100396275520325,
0.3343757390975952,
-0.08638789504766464,
0.017120081931352615,
-0.3303750157356262,
0.36084049940109253,
-0.1721639484167099,
-0.36747580766677856,
0.041492801159620285,
-0.6426623463630676,
0.303745836019516,
-0.048394642770290375,
-0.32495516538... | |
I'm having a table (an existing table with data in it) and that table has a column UserName.
I want this UserName to be unique.
So I add a constraint like this:
```
ALTER TABLE Users
ADD CONSTRAINT [IX_UniqueUserUserName] UNIQUE NONCLUSTERED ([UserName])
```
Now I keep getting the Error that duplicate users exist i... | [
-0.10289410501718521,
0.627525806427002,
0.27164414525032043,
-0.22077254951000214,
-0.25617995858192444,
0.36766350269317627,
0.02468804083764553,
-0.0022016253788024187,
-0.7437344789505005,
-0.4054586887359619,
0.3850424289703369,
0.13078673183918,
-0.7416834831237793,
0.528515636920929... | |
apperently he fails to compare an "e" and "é" or "è" ... It's like he ignores these, is there any way that sql doesn't ignore these accents when adding the unique key contraint.
SOLUTION:
THX to you guys I've found the solution.
This fixed the problem:
```
ALTER TABLE Users
ALTER COLUMN UserName nvarchar(250) COLLA... | [
-0.06525346636772156,
0.568128228187561,
0.6433927416801453,
0.07862457633018494,
-0.0959867537021637,
0.14913183450698853,
0.18281127512454987,
-0.12974315881729126,
-0.13032685220241547,
-0.6058540344238281,
-0.1470859944820404,
0.6015835404396057,
-0.021100956946611404,
0.28156200051307... | |
Is it possible to cancel a linq2sql query? Like if I have built a query that takes a while to run, I would like it to be possible for the user to cancel it. Does anyone have any good ideas on this?
So, according to [Richard Szalay](https://stackoverflow.com/users/3603/richard-szalay)'s comment:
> Your best bet is to r... | [
0.1829880177974701,
0.017795700579881668,
-0.09203248471021652,
0.24279683828353882,
0.21091362833976746,
-0.4673197567462921,
0.10373279452323914,
0.10640578716993332,
-0.44245290756225586,
-0.05504510551691055,
-0.13373960554599762,
0.3728572726249695,
-0.47657880187034607,
0.15872457623... | |
but until that happens this will have to do.
Haven't started to implement this yet (have to finish some other things first), but one way it could work:
* In the working thread, do the queries in a separate query thread and then Join that thread until it is finished.
* When user hits cancel, call the `Interrupt` metho... | [
0.3975539803504944,
-0.08219199627637863,
0.6117870807647705,
0.160705104470253,
0.09797940403223038,
0.06668896973133087,
0.20879974961280823,
0.1691230684518814,
-0.32789215445518494,
-0.5108433961868286,
0.061516981571912766,
0.5671155452728271,
-0.107022725045681,
0.1530078947544098,
... | |
Is there another way to convert AutocadDWG To PDF but to use third party programs? Thanks for any suggestions.
So, according to [Richard Szalay](https://stackoverflow.com/users/3603/richard-szalay)'s comment:
> Your best bet is to run the query in a background thread and simply unsubscribe from the container object's ... | [
0.06892698258161545,
-0.03096110001206398,
0.12433196604251862,
0.3133344352245331,
0.03137778863310814,
-0.3653600513935089,
0.12261894345283508,
0.019993938505649567,
-0.24741938710212708,
-0.5075345039367676,
-0.2657795548439026,
0.632265567779541,
-0.4835333228111267,
0.011780209839344... | |
way it could work:
* In the working thread, do the queries in a separate query thread and then Join that thread until it is finished.
* When user hits cancel, call the `Interrupt` method of the working thread, which would then get an `ThreadInterruptedException` and stop waiting for the query thread to finish.
---
M... | [
0.32676687836647034,
-0.3215097486972809,
0.6313552260398865,
0.17692232131958008,
0.06073001027107239,
0.07667960971593857,
0.11141926795244217,
0.05686645582318306,
-0.4193330407142639,
-0.378131628036499,
0.025553546845912933,
0.564818799495697,
-0.1496446579694748,
0.09942582994699478,... | |
Any thoughts on the efficiency of this? ...
```
CommentText.ToCharArray().Where(c => c >= 'A' && c <= 'Z').Count()
```
Ok, just knocked up some code to time your method against this:
```
int count = 0;
for (int i = 0; i < s.Length; i++)
{
if (char.IsUpper(s[i])) count++;
}
```
The result:
> Yours: 19737 ticks... | [
0.1848135143518448,
0.09674549847841263,
0.531320333480835,
0.011011109687387943,
-0.027356306090950966,
0.0741477683186531,
0.2940891981124878,
-0.23523692786693573,
-0.14860832691192627,
-0.5507603287696838,
0.27882614731788635,
0.5409932136535645,
0.05738795921206474,
0.1566098779439926... | |
like what is X windows,Cygwin,file system
Ok, just knocked up some code to time your method against this:
```
int count = 0;
for (int i = 0; i < s.Length; i++)
{
if (char.IsUpper(s[i])) count++;
}
```
The result:
> Yours: 19737 ticks
>
>
> Mine: 118 ticks
Pretty big difference! Sometimes the most straight-fo... | [
0.3597739636898041,
0.05533801019191742,
0.6471307873725891,
-0.009038315154612064,
-0.07078283280134201,
0.08356591314077377,
0.29756271839141846,
-0.313475638628006,
-0.3215765953063965,
-0.3719722032546997,
0.3417464792728424,
0.49456945061683655,
-0.10850545763969421,
0.182718977332115... | |
I have two tables: **TableA** (`ID [int, pk], Name [string])` and **TableB** `(ID [int, pk], TableA_ID [int, fk], Name [string], DateStamp [datetime (dd/mm/yyyy hh:MM:ss)])`. There is a one-to-many relationship between TableA and TableB.
An inner join on the two tables will give me the following results:
```
TableA.... | [
-0.20323437452316284,
0.27159079909324646,
0.7616095542907715,
-0.16487832367420197,
-0.18671463429927826,
0.39711517095565796,
-0.10611262172460556,
-0.096897654235363,
-0.2990480363368988,
-0.903195858001709,
0.16168266534805298,
0.36918118596076965,
0.05539665371179581,
0.23920303583145... | |
2, 'File B', 'Version 1', 03/01/2009 09:10:00
2, 'File B', 'Version 2', 20/01/2009 20:00:00
3, 'File C', 'Version 1', 01/01/2009 17:00:00
```
What I actually want is the following (each row from TableA and the last matching row from TableB):
```
TableA.ID, TableA.Name, TableB.Name, TableB.D... | [
0.005104560870677233,
0.32141658663749695,
0.8752312660217285,
0.07634773850440979,
0.37940922379493713,
0.4372311234474182,
-0.1305786818265915,
-0.19942700862884521,
-0.23589284718036652,
-0.6818307042121887,
-0.12510946393013,
0.5713828206062317,
-0.04106767848134041,
0.0021995774004608... | |
'Version 2', 20/01/2009 20:00:00
3, 'File C', 'Version 1', 01/01/2009 17:00:00
```
This is the query that I'm using to achieve this:
```
SELECT ta.ID, ta.Name, tb.Name, tb.DateStamp
FROM TableA ta INNER JOIN TableB tb ON ta.ID = tb.TableA_ID
WHERE tb.ID IN (
SELECT TOP 1 tb2.ID
FROM TableB tb2
WHERE ... | [
0.022588614374399185,
-0.04751808941364288,
0.4777010679244995,
-0.2814885079860687,
-0.03439156711101532,
-0.31440478563308716,
0.33964869379997253,
-0.2780229449272156,
-0.08523191511631012,
-0.8095136284828186,
0.09570852667093277,
0.5859339237213135,
-0.45945265889167786,
0.08801349252... | |
that. In the end I always had to use a subquery to get the row I'm after in TableB.
Any help much appreciated.
No, there is no requirement to do GROUP BY here, this should be solved through a correlated sub-query:
```
SELECT
TableA.ID,
TableA.Name,
TableB.Name,
TableB.DateStamp
FROM
TableA
INNER JOIN T... | [
0.011982032097876072,
0.23378302156925201,
0.40549299120903015,
-0.06867362558841705,
0.11640943586826324,
0.052327658981084824,
-0.2748858630657196,
-0.13254320621490479,
-0.2514197528362274,
-0.46840718388557434,
0.10386722534894943,
0.3303603529930115,
-0.17256850004196167,
0.0526373349... | |
GROUP BY is only necessary if you have more than one record in `TableB` with equal `TableA_ID` *and* equal `DateStamp`.
---
For the specific example you've shown, a GROUP BY query *happens to produce* the correct result. It's still wrong, because the correct result is more a side-effect in this situation.
```
SELECT... | [
0.08202055096626282,
0.17917338013648987,
0.32573115825653076,
-0.1752633899450302,
-0.03206178918480873,
-0.26443788409233093,
-0.06775233894586563,
-0.6434345245361328,
-0.3886999189853668,
-0.2527156472206116,
-0.21499794721603394,
0.024798760190606117,
-0.39378026127815247,
0.200306400... | |
But since this correlation is a mere accident, the GROUP BY query is wrong. | [
-0.1375061422586441,
-0.0359271839261055,
0.1705416738986969,
0.1458120048046112,
-0.05600544437766075,
-0.1564415842294693,
-0.1142829954624176,
-0.24019242823123932,
0.00858380738645792,
-0.3517249524593353,
-0.0584854781627655,
0.19660994410514832,
-0.1329728364944458,
0.335751205682754... | |
I am new to silverlight - I've seen the [tutorials](https://stackoverflow.com/questions/70269/silverlight-2-drag-and-drop-tutorials) and all, what I am looking for are high-level steps required to implement drag&drop and maybe a bit of (pseudo)code just to get an idea.
Any help appreciated!
Could you explain exactly w... | [
0.6586542129516602,
0.2263142168521881,
-0.04864989593625069,
0.05556034296751022,
-0.24414585530757904,
-0.32988107204437256,
-0.061996202915906906,
-0.24210619926452637,
0.058486633002758026,
-0.8672624230384827,
0.405784547328949,
0.3666836619377136,
-0.24572855234146118,
0.064588464796... | |
your needs?
EDIT:
The basic skeleton of a drag and drop implementation would look like:
```
bool isDragging = false;
void elementMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
if (element.CaptureMouse())
{
isDragging = true;
element.MouseMove += elementMouseMove;
//start d... | [
0.48113492131233215,
-0.11133651435375214,
0.7641630172729492,
-0.146924689412117,
0.433838814496994,
0.17188052833080292,
0.3021373748779297,
-0.5901185274124146,
0.016120336949825287,
-0.6554615497589111,
-0.06020558997988701,
0.8003193736076355,
-0.6130421757698059,
-0.162382572889328,
... | |
isDragging = false;
element.MouseMove -= elementMouseMove;
//Drop code goes here
}
}
```
Add the MouseLeftButtonUp/Down handlers to the element that you want to drag.
In the MouseMove event handler, add the code that you want to execute during the drag: e.g. change Canvas.Top and Canvas.Left to ... | [
-0.21684139966964722,
-0.4058759808540344,
0.25666388869285583,
-0.19482384622097015,
0.22691810131072998,
-0.03510192781686783,
-0.07003147155046463,
-0.4098060727119446,
-0.2600051462650299,
-0.5919022560119629,
-0.07522350549697876,
0.6295093297958374,
-0.532936155796051,
-0.36977165937... | |
execute when the "drop" occurs. For example, you might want to implement a "recycle bin" that elements can be dragged to. In that case, you would want to know what elements are underneath the mouse at the point of the drop. You can use VisualTreeHelper.FindElementsAtHostCoordinates, passing the mouse position relative ... | [
0.20148642361164093,
-0.43506842851638794,
0.21576009690761566,
0.06979741156101227,
0.28671538829803467,
-0.06353418529033661,
0.4274700880050659,
-0.3699122369289398,
-0.21644917130470276,
-0.48495692014694214,
-0.42921578884124756,
0.5488281846046448,
-0.14287328720092773,
-0.2864210307... | |
Using SWT, what is the common way to indicate that a menu item (from a taskbar menu) is the currently active selection? Checkmark? Bold? How is this done with code?
Use the [CHECK](http://help.eclipse.org/stable/nftopic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/SWT.html#CHECK) style during instantiatio... | [
-0.04299120604991913,
-0.3538602590560913,
0.5939456224441528,
-0.1524764597415924,
-0.2919132113456726,
-0.10723196715116501,
0.001402431633323431,
-0.08915801346302032,
-0.4169296324253082,
-0.5940282940864563,
-0.5611094236373901,
0.3868366479873657,
-0.33610373735427856,
-0.00143359124... | |
I want to do this: "If there's a module *X* containing a function *Y* then call it, otherwise don't."
I'm aware that I can use `CallByName(Object, MethodName, ...)` to call a method or property of an object instance.
Is it possible to call a global sub/function which is not bound to an object?
```
//Module1
Public S... | [
0.3163609802722931,
0.053324390202760696,
0.2957923412322998,
-0.12918145954608917,
0.0602668859064579,
-0.25155240297317505,
0.3407827913761139,
-0.5479859709739685,
-0.2567022144794464,
-0.5382302403450012,
-0.04029853269457817,
0.7949948310852051,
-0.39628803730010986,
0.274318903684616... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.