text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I'm fairly new to WPF and I've come across a problem that seems a bit tricky to solve. Basically I want a 4x4 grid thats scalable but keeps a square (or any other arbitrary) aspect ratio. This actually seems quite tricky to do, which surprises me because I would imagine its a reasonably common requirement.
I start wit... | [
0.22038652002811432,
-0.07290288060903549,
0.5714070200920105,
-0.27553683519363403,
-0.13774453103542328,
0.10683942586183548,
-0.2607853412628174,
-0.4699436128139496,
-0.30426326394081116,
-1.0580639839172363,
-0.023222630843520164,
0.5832379460334778,
-0.05341999605298042,
0.1121807396... | |
<Grid.ColumnDefinition Width="*"/>
<Grid.ColumnDefinition Width="*"/>
</Grid.ColumnDefinition>
...
</Grid>
```
Now if you set that to stretch, it can fill the Window or whatever container you put it in. The rows and column are uniform but the aspect ratio isn't fixed.
Then I tried putting it in a StackPanel ... | [
0.07067566365003586,
-0.11148570477962494,
0.3929796516895294,
-0.33808913826942444,
-0.0170739758759737,
0.28537070751190186,
-0.35746875405311584,
-0.1489969789981842,
-0.57579505443573,
-1.2735700607299805,
0.07824209332466125,
0.38633623719215393,
0.2153116911649704,
0.1045401096343994... | |
<Grid.RowDefinition Height="*"/>
<Grid.RowDefinition Height="*"/>
<Grid.RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<Grid.ColumnDefinition Width="*"/>
<Grid.ColumnDefinition Width="*"/>
<Grid.ColumnDefinition Width="*"/>
<Grid.Co... | [
-0.22375699877738953,
0.05844762921333313,
0.926460325717926,
-0.28036996722221375,
-0.26100486516952515,
0.1406313180923462,
-0.17363648116588593,
-0.4124322831630707,
-0.25230681896209717,
-1.0128655433654785,
-0.020510675385594368,
0.38146302103996277,
0.47052833437919617,
0.28662610054... | |
and keeps aspect ratio. The problem is that if the window isn't wide enough some of my grid is off the screen. I'd like to be able to scroll to it if that were the case. Likewise, I might need a minimum size, which might lead to vertical scrolling too.
Now I've tried putting my StackPanel and Grid (separately) in an a... | [
0.46022096276283264,
0.09700150042772293,
0.6878702640533447,
-0.03483165428042412,
0.0370422899723053,
0.025129225105047226,
0.3115560710430145,
0.038886282593011856,
-0.5015838742256165,
-0.6600925326347351,
0.2652929723262787,
0.5819767713546753,
0.30708199739456177,
0.08798021078109741... | |
better/easier way of doing this?
You need to put the content (the grid) inside a [Viewbox](http://msdn.microsoft.com/en-us/library/system.windows.controls.viewbox.aspx) and set the [Viewbox.Stretch Property](http://msdn.microsoft.com/en-us/library/system.windows.controls.viewbox.stretch.aspx) to [Stretch.Uniform](http:... | [
0.10911691188812256,
-0.5493472218513489,
0.2107522040605545,
0.056147124618291855,
0.0945841372013092,
0.23516356945037842,
-0.30079469084739685,
-0.2764814496040344,
-0.23216788470745087,
-0.8599763512611389,
-0.12608768045902252,
0.3153127133846283,
-0.014171946793794632,
0.052372142672... | |
Is it possible to perform a named-group match in Perl's regex syntax as with Python's? I always bind the `$n` values to proper names after matching, so I'd find it more convenient to do it in the regex itself if it's possible.
Python does it like so:
```
>>> import re
>>> regex = re.compile(r'(?P<count>\d+)')
>>> mat... | [
-0.0073095946572721004,
0.03597763180732727,
0.14753369987010956,
-0.15360981225967407,
-0.389285683631897,
-0.07100193947553635,
0.05105164647102356,
-0.38691458106040955,
-0.1886131912469864,
-0.2444765269756317,
-0.010928615927696228,
0.5591030716896057,
-0.44786572456359863,
-0.3471681... | |
specify names captures. You have to use the `%+` hash to retrieve them.
```
$variable =~ /(?<count>\d+)/;
print "Count is $+{count}";
```
This is only supported on Perl 5.10 and higher though. | [
0.19757312536239624,
-0.24250981211662292,
0.41442254185676575,
-0.0018785999855026603,
0.15649530291557312,
-0.09383261203765869,
-0.05632741004228592,
-0.05940907076001167,
-0.10936275869607925,
-0.4040241837501526,
0.05788859352469444,
0.6384391188621521,
-0.45789098739624023,
0.0769963... | |
I was wondering if anyone can help me get started with creating a room in Sandy 3D. I know I can generate the planes, but I am unsure as to how to implement simple physics (i.e. the player cannot walk through a wall). Is there a simple way to do this, or should I look into something like WOW (3D physics engine for Flas... | [
0.47829264402389526,
0.44758790731430054,
0.11220498383045197,
0.345753014087677,
-0.05952557176351547,
-0.2477378100156784,
0.009297390468418598,
0.05501033365726471,
-0.1699623018503189,
-0.5972461104393005,
0.17286871373653412,
0.6025079488754272,
0.15368355810642242,
-0.027453055605292... | |
I am trying to write a console app that simply lists the number of lists at the sharepoint root.
I tried doing it by using the following code, but the object SPContext.Current is null. Any ideas of how to get the web object?
```
SPWeb web = SPContext.Current.Site.OpenWeb("http://localhost") ;
```
```
SPSite spSite ... | [
0.16986078023910522,
0.13460929691791534,
0.847113847732544,
-0.15928944945335388,
-0.09806740283966064,
0.006603824906051159,
0.5643051266670227,
-0.0650593712925911,
-0.22046619653701782,
-0.8873397707939148,
-0.1739330142736435,
0.2466336041688919,
-0.5648711323738098,
0.267890244722366... | |
It seems like the classical way to handle transactions with JDBC is to set auto-commit to false. This creates a new transaction, and each call to commit marks the beginning the next transactions.
On multithreading app, I understand that it is common practice to open a new connection for each thread.
I am writing a RMI... | [
0.3668862581253052,
0.3703465163707733,
-0.012102419510483742,
0.02344457432627678,
-0.20585282146930695,
-0.14415273070335388,
0.3060755133628845,
-0.08780480921268463,
-0.3544042706489563,
-0.43859702348709106,
0.3422299921512604,
0.6569583415985107,
-0.27477380633354187,
0.1903984844684... | |
need to create a new connection for each thread. You don't have control over how the operating system timeslices execution of threads (notwithstanding defining your own critical sections), so you could inadvertently have multiple threads trying to send data down that one pipe.
Note the same applies to any network comm... | [
0.31937292218208313,
-0.3734571039676666,
0.06024309992790222,
0.31510141491889954,
-0.1398211270570755,
-0.13394635915756226,
0.22112715244293213,
-0.2025226652622223,
-0.5607175230979919,
-0.672335684299469,
0.06759171932935715,
0.08953412622213364,
-0.5424789786338806,
0.313323557376861... | |
and therefore lock out any other threads for an entire begin/commit cycle, then you might be able to share a database connection between threads. But I wouldn't do that even then, unless you really have innate knowledge of the JDBC protocol.
If most of your threads have infrequent need for database connections (or no ... | [
0.5024099349975586,
0.17411470413208008,
-0.025417305529117584,
0.2019190639257431,
-0.019156362861394882,
-0.28738081455230713,
0.16300256550312042,
0.02203373983502388,
-0.4228600263595581,
-0.554557204246521,
0.11010599881410599,
0.3628522455692291,
-0.2705998420715332,
0.22899049520492... | |
thread in your environment (or ask another specific question about that on StackOverflow).
**update:** To answer your question in the comment, most database brands don't support multiple concurrent transactions on a single connection (InterBase/Firebird is the only exception I know of).
It'd be nice to have a separa... | [
0.42070066928863525,
0.0044839996844530106,
0.008578603155910969,
0.200314000248909,
0.0795331820845604,
-0.4681222140789032,
0.09347279369831085,
0.6077582836151123,
-0.5094959139823914,
-0.7270516157150269,
0.11696331202983856,
0.2164442241191864,
-0.34866026043891907,
0.4835447072982788... | |
I am having a Html hyperlink. I need to link this hyperlink to another page.When I place the mouse over the link. It should show the image.
how to do this
That depends on where you need to display the image. If you are looking for something along the lines of an icon next to or behind the link, you could accomplish thi... | [
0.1534511148929596,
0.24057435989379883,
0.9280893206596375,
-0.1355540156364441,
-0.23369835317134857,
0.08628740906715393,
0.343488484621048,
0.05952509865164757,
-0.32972851395606995,
-0.9567230343818665,
-0.04826108738780022,
0.2145863175392151,
-0.2684388756752014,
0.06262816488742828... | |
my head, so you may need to make some minor adjustments.
If you wanted to show an image somewhere else on the page, you could accomplish that using javascript to hide/show the image on the link's mouseover event.
If this doesn't solve your problem, maybe you could supply some additional information to help guide ever... | [
0.7253119945526123,
0.10494573414325714,
0.34241873025894165,
0.3230370879173279,
0.11362024396657944,
-0.08610121160745621,
0.2422398030757904,
0.23382450640201569,
-0.19883379340171814,
-0.5125028491020203,
0.1792481392621994,
0.29794472455978394,
0.030753925442695618,
0.2383404672145843... | |
I prefer to use jQuery with my ASP.NET MVC apps than the Microsoft Ajax library. I have been adding a parameter called "mode" to my actions, which I set in my ajax calls. If it is provided, I return a JsonViewResult. If it isn't supplied, I assume it was a standard Http post and I return a ViewResult.
I'd like to be a... | [
0.2817590832710266,
-0.39122098684310913,
0.465282678604126,
0.07479440420866013,
-0.2745438516139984,
-0.18338972330093384,
0.3838779330253601,
0.20872345566749573,
-0.11268988251686096,
-0.8448493480682373,
0.1031055897474289,
0.7301341891288757,
-0.18276017904281616,
-0.1481358408927917... | |
way to accomplish it? I don't want to go crazy writing code since adding a single parameter works, it just isn't ideal.
Here's an except from MVC RC1 release notes - Jan 2009
**IsMvcAjaxRequest Renamed to IsAjaxRequest**
> The IsMvcAjaxRequest method been
> renamed to IsAjaxRequest. As part of
> this change, the IsAj... | [
0.3778672218322754,
-0.020594533532857895,
0.514238715171814,
-0.03333573415875435,
-0.3905644118785858,
-0.24818497896194458,
0.7061477303504944,
-0.42850521206855774,
-0.18733634054660797,
-0.38848015666007996,
0.09898743033409119,
0.31216901540756226,
-0.16398391127586365,
-0.1209812313... | |
of the form
> post in order to work around the issue
> of firewalls that strip unknown
> headers.
In other words - it was specifically renamed to be more 'compatible' with other libraries.
In addition, for anyone who hasnt read the [full release notes](http://go.microsoft.com/fwlink/?LinkID=137661&clcid=0x409) but ha... | [
0.15702371299266815,
-0.18270844221115112,
0.5003330707550049,
0.0919179916381836,
-0.23007526993751526,
-0.49378493428230286,
0.4050673842430115,
-0.18666031956672668,
0.03524938225746155,
-0.9018601775169373,
-0.39579010009765625,
0.2759222984313965,
-0.3489595949649811,
-0.0295623671263... | |
the .js file for MicrosoftAjax.MVC (not the exact name) if upgrading to RC1 from the Beta - otherwise this method won't work. It isn't listed in the release notes as a required task for upgrading so don't forget to. | [
0.38696566224098206,
0.1310240477323532,
0.23289288580417633,
0.20082834362983704,
0.11088430881500244,
-0.3844972550868988,
0.5935630798339844,
0.0478619821369648,
0.21968722343444824,
-0.4793081283569336,
-0.37322282791137695,
0.4283885657787323,
-0.27868324518203735,
0.06322764605283737... | |
Is it possible to use batch file (for XP) to call another batch file from **different** computer? if yes, how identify the target computer? Is it by IP comp ID?
I think you are having a tool problem, not a database problem! My advice would then be to change your tools, not to break your database in multiple parts. The ... | [
0.3389071524143219,
0.21623429656028748,
0.05805794522166252,
0.24177883565425873,
0.014275889843702316,
-0.09834237396717072,
0.0703100860118866,
-0.029169324785470963,
-0.4128560721874237,
-0.635995626449585,
0.20673510432243347,
0.5447584390640259,
-0.14165952801704407,
0.07691243290901... | |
Since upgrading to 2008 I and many people here have noticed that randomly VS will no longer step in to code or jump over breakpoints. Its got to the stage where debugging is becoming a real chore. We are running SP1 but noticed problem on 2008 basic too.
In ref to Robert's question: We host WCF and Remoting services i... | [
0.29994237422943115,
0.2194417268037796,
0.4821021258831024,
-0.044701870530843735,
-0.354041188955307,
-0.4118281602859497,
0.714065432548523,
-0.19535507261753082,
-0.2595349848270416,
-0.4381256699562073,
-0.0476774238049984,
0.7481260895729065,
-0.1473892331123352,
0.20362858474254608,... | |
behaviour.
Much of the debugging we do here is in service code so ATTACH to process to invaluable and sometimes is impossible to get to the state needed except by attaching to processes after they have started. It happens to developers both with extensions such as resharper and to those who run a vanilla VS.
Looking ... | [
-0.07781625539064407,
-0.0444357730448246,
0.39832231402397156,
0.08944052457809448,
-0.2385929375886917,
0.1159389540553093,
0.7441766262054443,
0.09631373733282089,
-0.6456424593925476,
-0.2733042240142822,
-0.04616132751107216,
0.7866991758346558,
-0.3980824947357178,
-0.143166080117225... | |
Below is my (simplified) schema (in MySQL ver. 5.0.51b) and my strategy for updating it. There has got to be a better way. Inserting a new item requires 4 trips to the database and editing/updating an item takes up to **7**!
**items**: itemId, itemName
**categories**: catId, catName
**map**: mapId\*, itemId, catId
... | [
-0.2540120780467987,
-0.07006954401731491,
0.6751954555511475,
-0.04855381324887276,
-0.05585182085633278,
0.18686091899871826,
0.1897825449705124,
-0.4933529198169708,
-0.15804685652256012,
-0.8254163265228271,
-0.08841875940561295,
0.45103421807289124,
-0.3007151484489441,
-0.05314536020... | |
OR catName = 'category' OR catName = 'name';
```
4) Conditionally batch insert into `map`.
```
INSERT IGNORE INTO map (mapId, itemId, catId)
VALUES ('1|1', 1, 1), ('1|2', 1, 2), ('1|3', 1, 3);
```
If inserting: we're done. Else updating: continue.
5) It's possible that we no longer associate a category with this ... | [
-0.23071634769439697,
-0.03013576753437519,
0.5009483098983765,
0.004870937205851078,
0.051198240369558334,
0.02406374365091324,
0.3512757420539856,
-0.2707504630088806,
-0.3444042503833771,
-0.4642122983932495,
-0.47671937942504883,
0.4632750153541565,
-0.32287847995758057,
0.380084156990... | |
if `affected rows > 0`, kill orphaned categories. I haven't found a way to combine these in MySQL, so this is #6 & #7.
```
SELECT categories.catId
FROM categories
LEFT JOIN map USING (catId)
GROUP BY categories.catId
HAVING COUNT(map.catId) < 1;
```
7) Delete IDs found in step 6.
```
DELETE FROM categories
WHERE ca... | [
-0.2368461638689041,
-0.11515603959560394,
0.4708488881587982,
-0.11456957459449768,
-0.12017784267663956,
0.11958687752485275,
0.3796441853046417,
-0.6776279807090759,
-0.223125621676445,
-0.7018458247184753,
-0.3112602233886719,
0.46722695231437683,
-0.6217707395553589,
-0.14141136407852... | |
FROM categories AS c
WHERE c.catName IN('each','category','name');
```
Otherwise, your solution is pretty standard, unless you want to use triggers to maintain the map table. | [
0.1566963493824005,
-0.09236839413642883,
0.12896645069122314,
0.0958605483174324,
0.059359561651945114,
-0.370974063873291,
0.003919336013495922,
-0.10057928413152695,
-0.3758181631565094,
-0.39096808433532715,
-0.5830721259117126,
0.3881533145904541,
-0.3462619185447693,
0.20828087627887... | |
What is the keyboard short cut in Eclipse to jump to the closing brace of a scope?
Place the cursor next to an opening *or closing* brace and punch `Ctrl` + `Shift` + `P` to find the matching brace. If Eclipse can't find one you'll get a *"No matching bracket found"* message.
***edit:*** as [mentioned by Romaintaz bel... | [
0.18548543751239777,
-0.23087450861930847,
0.06842929869890213,
-0.03340130299329758,
-0.10451298207044601,
0.13208764791488647,
-0.08870829641819,
-0.12795856595039368,
-0.0950455442070961,
-0.2548956573009491,
-0.0141682093963027,
0.7971023321151733,
-0.3311804234981537,
-0.3191701769828... | |
I am facing strange issue on Windows CE:
Running 3 EXEs
1)First exe doing some work every 8 minutes unless exit event is signaled.
2)Second exe doing some work every 5 minutes unless exit event signaled.
3)Third exe while loop is running and in while loop it do some work at random times.
This while loop continues unt... | [
0.17094747722148895,
-0.1873086839914322,
0.6664548516273499,
-0.10650666803121567,
-0.3983743190765381,
-0.2989436089992523,
0.6596395969390869,
-0.046947479248046875,
-0.22837744653224945,
-0.8694372773170471,
-0.19599340856075287,
0.5952681303024292,
-0.3684786856174469,
0.1844063550233... | |
instructions get executed in first and second.
As soon as third exe gets terminated first and second starts get processing.
It that can be the case that while loop in third exe is taking all CPU cycles?
I havn't tried putting Sleep but I think that can do some tricks.
But OS should give CPU to all processes ...
Any th... | [
0.22674408555030823,
-0.27188658714294434,
0.5339572429656982,
0.4468521177768707,
-0.2480546087026596,
0.07043149322271347,
0.36595290899276733,
-0.052553098648786545,
-0.35390597581863403,
-0.6796860694885254,
0.19420304894447327,
0.7258192300796509,
-0.1325136125087738,
-0.1686931699514... | |
loop is a poor substitute for a proper timer. | [
0.5828956961631775,
-0.23953883349895477,
0.019756488502025604,
0.15665346384048462,
0.11133494973182678,
-0.1950533241033554,
0.47803282737731934,
0.05777233839035034,
-0.013576431199908257,
-0.08211256563663483,
0.04175747558474541,
0.04320954158902168,
-0.31768909096717834,
0.1844857931... | |
What is the difference between request, response and server?
**Request :** From Client to Server
**Response:** From Server to Client
**Server:** Receive Request and Send Response
**Client:** Send Request and Receive Response | [
-0.11553927510976791,
-0.15215517580509186,
0.575042724609375,
0.12128658592700958,
-0.415324330329895,
0.7108356952667236,
-0.08899924159049988,
-0.2086309790611267,
-0.4412000775337219,
-0.6077331900596619,
-0.036876093596220016,
0.4377114176750183,
-0.06102071329951286,
0.28862082958221... | |
Basically, I'm trying to write the following (pseudocode) in an ASP.NET HttpModule:
```
*pre-code*
try { handler.ProcessRequest(...) }
catch (Exception) { *error-code* }
finally { *post-code* }
```
I've found that I can hook into HttpModule.PreExecuteHandler for "pre-code" and .Error for "error-code". But PostExecut... | [
0.2684314548969269,
-0.15352049469947815,
0.26361799240112305,
-0.04359036684036255,
-0.0015854832017794251,
-0.23192577064037323,
0.3415418267250061,
-0.16459105908870697,
-0.06904615461826324,
-0.9379199147224426,
-0.119144968688488,
0.1616981327533722,
-0.1577276885509491,
-0.0493098460... | |
than to not call Response.End. [This article](http://www.west-wind.com/Weblog/posts/494.aspx) explains it pretty well and offers an alternative to Response.End in case it is a side-effect of your having called Server.Transfer. | [
-0.14947909116744995,
-0.4532761871814728,
0.5600538849830627,
0.0005305224913172424,
-0.1959691196680069,
-0.08750566840171814,
0.24830666184425354,
-0.34771957993507385,
-0.2606807351112366,
-0.3560282588005066,
0.006640917621552944,
0.4651217460632324,
-0.0520431250333786,
0.24010384082... | |
I'm making a Java application with an application-logic-thread and a database-access-thread.
Both of them persist for the entire lifetime of the application and both need to be running at the same time (one talks to the server, one talks to the user; when the app is fully started, I need *both* of them to work).
Howev... | [
0.1893245279788971,
0.24994146823883057,
0.6495895981788635,
-0.05400758236646652,
0.10129434615373611,
0.05300673469901085,
0.293211966753006,
-0.18161706626415253,
-0.12011225521564484,
-0.8272058963775635,
-0.10577816516160965,
0.4636839032173157,
-0.4380429983139038,
0.1405857801437378... | |
db thread only exits at app shutdown.
`while (!dbthread.isReady()) {}` kind of works, but the empty loop consumes a lot of processor cycles.
Any other ideas? Thanks.
I would really recommend that you go through a tutorial like [Sun's Java Concurrency](http://java.sun.com/docs/books/tutorial/essential/concurrency/) be... | [
0.27315932512283325,
0.033888623118400574,
0.229675754904747,
0.030530326068401337,
-0.3080522418022156,
-0.24777856469154358,
0.650535523891449,
-0.07537341862916946,
-0.213511124253273,
-0.45252302289009094,
0.13123898208141327,
0.5148276686668396,
-0.31162312626838684,
0.230414867401123... | |
}
}
//continue with work after dbThread is ready
```
In your `dbThread`'s method, you would need to do something like this:
```
//do db work
synchronized(objectYouNeedToLockOn){
//set ready flag to true (so isReady returns true)
ready = true;
objectYouNeedToLockOn.notifyAll();
}
//end thread run method h... | [
0.342517614364624,
-0.03644439950585365,
0.425772488117218,
-0.04093029350042343,
0.09782280027866364,
-0.20455358922481537,
0.3285732567310333,
-0.36942657828330994,
-0.33424004912376404,
-0.26681753993034363,
-0.06186249107122421,
0.6382865905761719,
-0.41713646054267883,
0.2667080760002... | |
There are other (sometimes better) ways to do the above, e.g. with `CountdownLatches`, etc. Since Java 5 there are a lot of nifty concurrency classes in the `java.util.concurrent` package and sub-packages. You really need to find material online to get to know concurrency, or get a good book. | [
0.24154983460903168,
0.09950301796197891,
0.007245645392686129,
0.13715986907482147,
-0.2376280575990677,
-0.4759445786476135,
0.43121036887168884,
0.21773703396320343,
-0.6456947922706604,
-0.39573919773101807,
0.25383877754211426,
0.43337661027908325,
-0.2886797785758972,
0.0874469727277... | |
I have a quite big XML output from an application. I need to process it with my program and then feed it back to the original program. There are pieces in this XML which needs to be filled out our replaced. The interesting part looks like this:
```
<sys:customtag sys:sid="1" sys:type="Processtart" />
<sys:tag>valu... | [
0.4968239367008209,
0.02651125192642212,
0.5130956768989563,
-0.13931922614574432,
0.17428816854953766,
0.11351199448108673,
-0.21274587512016296,
-0.5664246678352356,
-0.43392089009284973,
-0.784766435623169,
0.13093794882297516,
0.23499460518360138,
-0.29915937781333923,
0.04120399057865... | |
those pieces but it does not work:
```
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(@"output.xml");
Regex regExp = new Regex(@"<sys:customtag(.*?)Processtart(.*?)/>(.*?)<sys:customtag (.*?)Procesend(.*?)/>", RegexOptions.Multiline & RegexOptions.IgnorePatternWhitespace & RegexOptions.CultureInvariant);
MatchCol... | [
0.332955002784729,
-0.08858393877744675,
0.5486899018287659,
-0.005840052850544453,
-0.06972549855709076,
-0.034078340977430344,
0.2705274224281311,
-0.4854811429977417,
-0.1619020700454712,
-0.47345298528671265,
-0.09700747579336166,
0.38350409269332886,
-0.4428119659423828,
0.09375130385... | |
newlines should work in your case.
> ...the mode where the dot also matches newlines is called "single-line mode". This is a bit unfortunate, because it is easy to mix up this term with "multi-line mode". Multi-line mode only affects anchors, and single-line mode only affects the dot ... When using the regex classes o... | [
0.23706349730491638,
-0.5836305022239685,
0.7237269878387451,
-0.13060863316059113,
0.13327275216579437,
-0.19398745894432068,
0.031655486673116684,
-0.3465897738933563,
-0.26655498147010803,
-0.8659390807151794,
-0.218279168009758,
0.450101375579834,
-0.6837798357009888,
-0.28133517503738... | |
I've been using Visual Studio as my main IDE for a while now (I still use Emacs for some personal projects, though).
I like the way Emacs formats C/C++ code and I'd like to convince Visual Studio use similar conventions for C# code. For instance, in Emacs, a C function call looks like:
```
functionName(argument1,
... | [
-0.06027694791555405,
0.4122026264667511,
0.23575222492218018,
-0.16171078383922577,
-0.3341608941555023,
0.04449274763464928,
-0.11443281918764114,
0.2570776045322418,
-0.11348923295736313,
-0.5146917700767517,
-0.12196895480155945,
0.7968593835830688,
-0.35625573992729187,
0.187479913234... | |
worse to me.
Is there a way to tweak Visual Studio code formatting rules? Any plugins that can handle that?
Many thanks,
Tools > Options > Text Editor > C# > Formatting
and
<http://www.jetbrains.com/resharper/features/code_formatting.html#Code_Formatting> | [
0.3899241089820862,
0.14137418568134308,
0.19123589992523193,
0.4199739694595337,
-0.006007770076394081,
-0.14673039317131042,
0.12861675024032593,
-0.09556487947702408,
-0.28633052110671997,
-0.33792951703071594,
0.03792494907975197,
0.877821147441864,
-0.07114608585834503,
-0.12213055789... | |
I am working on an algorithm that will try to pick out, given an HTML file, what it thinks is the parent element that most likely contains the majority of the page's content text.
For example, it would pick the div "content" in the following HTML:
```
<html>
<body>
<div id="header">This is the header we don't... | [
0.6229294538497925,
0.15665534138679504,
0.4469998776912689,
-0.006766600534319878,
-0.1290697455406189,
-0.2313254028558731,
-0.08059534430503845,
0.042162541300058365,
-0.19877561926841736,
-0.5091496706008911,
-0.2588527798652649,
-0.0039939177222549915,
-0.2295820116996765,
0.232642471... | |
most likely being the important page content.</div>
</body>
</html>
```
I have come up with a few ideas, such as traversing the HTML document tree to its leaves, adding up the length of the text, and only seeing what other text the parent has if the parent gives us more content than the children do.
Has anyone ev... | [
0.2150915414094925,
0.21011470258235931,
0.4402777850627899,
0.2702940106391907,
-0.07503531128168106,
-0.21338753402233124,
0.031061887741088867,
0.09352891147136688,
-0.31744584441185,
-0.637020468711853,
-0.12089411914348602,
0.2528831958770752,
-0.12651655077934265,
0.11637618392705917... | |
would be awesome.
You could create an app that looks for contiguous block of text disregarding formatting tags (if required). You could do this by using a DOM parser and walking the tree, keeping track of the immediate parent (because that is your output).
Start form parent nodes and traverse the tree for each node th... | [
0.16469019651412964,
-0.2550206780433655,
0.3899688720703125,
0.35714244842529297,
0.10780273377895355,
-0.09308421611785889,
0.3200239837169647,
-0.20870621502399445,
-0.12253028899431229,
-0.5247339010238647,
-0.11599081754684448,
0.6810643672943115,
-0.13498246669769287,
0.0215202625840... | |
the DOM and keep track of the nodes that you are scanning.
What language are you using? Any other details for your project? There may be language specific or package specific tools you could use as well. | [
0.32590892910957336,
-0.25791165232658386,
0.3167967200279236,
0.22724081575870514,
0.17502334713935852,
-0.3259626626968384,
0.3665941059589386,
0.4448363482952118,
0.08203651756048203,
-0.6761683821678162,
-0.23540650308132172,
0.8698711395263672,
-0.02117694728076458,
0.0313707329332828... | |
I mean what the most efficient way to get information about the quantity of your page's items and make sql query with LIMIT that you need. or I should get all items and then crop array with php functions?
now I do 2 queries: first to count all items and second to get items that I need with LIMIT.
OK, I'll be more co... | [
0.05276930704712868,
0.05111287906765938,
0.5381526350975037,
0.2681223154067993,
-0.39434221386909485,
0.06471794098615646,
-0.00007583696424262598,
-0.15614071488380432,
-0.23086732625961304,
-0.6339329481124878,
0.3060377538204193,
0.3789226710796356,
-0.1556072235107422,
0.230178236961... | |
show proper number of links (number of answers/20) and when I go to any link I want to recieve proper answers (for example 41 to 60 on the 3d page). So what's the best way to get number of items (answers) to show proper number of links and to get proper answers for each link?
I'm assuming you want a count of the number... | [
0.31685328483581543,
0.14194026589393616,
0.5726805925369263,
0.43914222717285156,
-0.23575718700885773,
0.04435788094997406,
-0.007746534422039986,
-0.020800771191716194,
-0.4126436114311218,
-0.7366849184036255,
0.20566213130950928,
0.28256914019584656,
-0.0503113828599453,
0.18331077694... | |
rows have been found, use one of the following.
You select the count of all rows such as:
```
select count(*) as counted, name, address
from contact
```
Or found rows:
```
SELECT SQL_CALC_FOUND_ROWS, name, address
from contact
```
This may be mysql specific I'm not sure.
Update:
For pagination you would do som... | [
-0.3083737790584564,
0.22416874766349792,
0.5852377414703369,
-0.24925343692302704,
0.19026979804039001,
0.2675349712371826,
-0.21547314524650574,
-0.25597676634788513,
-0.05158935487270355,
-0.7802621126174927,
0.022876186296343803,
0.35530170798301697,
-0.22659501433372498,
0.06298399716... | |
I have two machines setup to run Visual Studio 2008 (SP1) & NET Framework 3.5 (SP1). If I create a .tt file in a console appliaction on machine #1 it automatically creates the sub .cs file for me, however if I do the exact same on machine #2 then no sub .cs file is created.
I have tried toggling the "Show All Files" o... | [
0.5795941352844238,
0.11063927412033081,
0.421569287776947,
-0.15770681202411652,
-0.46585094928741455,
0.009878133423626423,
0.2578372359275818,
0.0002402553946012631,
-0.18934310972690582,
-0.7502856254577637,
0.07686901092529297,
0.7174530625343323,
-0.2835916578769684,
-0.0630126073956... | |
have been disabled somehow? If so, then how the heck do I turn them back on, it's annoying :-).?
I'm assuming you want a count of the number of rows you'll be reading so as to do some pagination or similar? I don't understand your need for the LIMIT in the context of your question. However, if you just want a count of ... | [
0.5283756852149963,
0.21829701960086823,
0.2608405351638794,
0.10947378724813461,
0.19070392847061157,
-0.03698869049549103,
0.15490005910396576,
0.11083181202411652,
-0.4070185422897339,
-0.5986512899398804,
-0.1641896814107895,
0.6932697892189026,
-0.4597213864326477,
0.15982286632061005... | |
pagination you would do something like the following - (Psuedocode)
$rows = array($result)
$num\_rows = sql\_calc\_found\_rows
$per\_page = 20
$pages = ceil($num\_rows / $per\_page)
**page**
$rows\_this\_page = array()
$rows\_this\_page = get\_values($rows, (min index)$page\_number \* $per\_page - $pe... | [
-0.5337132811546326,
-0.2887522280216217,
-0.10652963072061539,
0.10208000242710114,
-0.018679236993193626,
0.6626136898994446,
0.20581257343292236,
0.025616081431508064,
-0.13582849502563477,
-0.7431252598762512,
0.06372024118900299,
-0.07623603194952011,
-0.3623279631137848,
-0.237505197... | |
When interviewing for a programming position, did you ever get an answer to your question that you didn't quite expect? The answer could've been quite smart that you didn't even know or it could've been a dumbest answer you never expected. I'm expecting technical type of questions but anything interesting is fine.
Q: "... | [
0.8157568573951721,
0.01131533645093441,
-0.5975268483161926,
0.5865150690078735,
-0.33289337158203125,
0.22791528701782227,
0.1122327595949173,
-0.034147780388593674,
0.1773657202720642,
0.06872652471065521,
0.3130171597003937,
0.44787269830703735,
-0.07119911164045334,
-0.187840491533279... | |
I can't figure out how to define the default constructor (when it exists overloads) for a type in StructureMap (version 2.5) by code.
I want to get an instance of a service and the container has to inject a Linq2Sql data context instance into it.
I wrote this in my 'bootstrapper' method :
```
ForRequestedType<MyData... | [
-0.016279038041830063,
0.2096146196126938,
0.5737439393997192,
-0.17393572628498077,
-0.04662483185529709,
-0.0196186825633049,
0.4058239758014679,
-0.1424570232629776,
-0.15823937952518463,
-0.6821154952049255,
0.14582502841949463,
0.5196210145950317,
-0.5429989695549011,
0.18979717791080... | |
that I would not use the `[StructureMap.DefaultConstructor]` attribute.
You can specify a constructor with the ConstructedBy(). Please try this:
```
ForRequestedType<MyDataContext>().TheDefault.
Is.ConstructedBy(() => new MyDataContext());
```
This worked for me. | [
0.08542107790708542,
0.05018318071961403,
0.10511775314807892,
-0.3276156187057495,
0.043627843260765076,
-0.2202548384666443,
0.18828782439231873,
-0.02907523326575756,
-0.019324228167533875,
-0.39525407552719116,
0.020769355818629265,
0.6398696303367615,
-0.20418742299079895,
0.216346800... | |
Does anyone know a simple algorithm to check if a Sudoku-Configuration is valid? The simplest algorithm I came up with is (for a board of size n) in Pseudocode
```
for each row
for each number k in 1..n
if k is not in the row (using another for-loop)
return not-a-solution
..do the same for each column
``... | [
0.14391934871673584,
0.1366177201271057,
-0.007485533133149147,
0.2980409860610962,
-0.14894284307956696,
-0.023898400366306305,
0.1635931432247162,
-0.4414388835430145,
-0.3654637932777405,
-0.6020019054412842,
-0.012595543637871742,
0.23346808552742004,
-0.300201952457428,
0.137256368994... | |
sum on each column
* check for sum on each box
* check for duplicate numbers on each row
* check for duplicate numbers on each column
* check for duplicate numbers on each box
that's 6 checks altogether.. using a brute force approach.
Some sort of mathematical optimization can be used if you know the size of the boar... | [
0.0974070355296135,
0.015165341086685658,
0.01298429537564516,
-0.02737734653055668,
-0.21060112118721008,
0.24449725449085236,
0.17226262390613556,
-0.8089430928230286,
-0.5335167646408081,
-0.6010701656341553,
-0.05846194922924042,
0.12343908846378326,
-0.18122553825378418,
0.02074391767... | |
Is there a USB HID pen driver in Windows Vista?
If so, what are the requirements for USB descriptors, in order to make Windows Vista recognize the pen and load the pen driver?
What I'm searching for is the pen equivalent to the HID mouse driver, HID keyboard driver and mass storage driver. The mentioned example drive... | [
0.20421865582466125,
0.10762295871973038,
0.3236887454986572,
0.07245758175849915,
-0.09201566129922867,
-0.26503798365592957,
-0.09413614869117737,
-0.2148936688899994,
0.10543675720691681,
-0.6072597503662109,
0.3284674882888794,
1.0581941604614258,
-0.20879364013671875,
-0.0091275898739... | |
tables (from a USB protocol point of view). So far I'm able to make USB HID descriptors that qualify as mouse and keyboard (from OS point of view), and automatically uses the standard driver supplied by the OS.
For my Pen, however, Windows Vista just loads the generic HID driver, and does not realize that the device ... | [
-0.06137301027774811,
0.1572805792093277,
0.8045130968093872,
0.046829335391521454,
0.23394152522087097,
-0.004119975492358208,
-0.0014185431646183133,
-0.21947722136974335,
-0.2486339956521988,
-0.7055173516273499,
0.14874593913555145,
0.7237665057182312,
-0.09604479372501373,
-0.42957711... | |
or whatever) 12, it says "The order of allocation of nonstatic data members separated by an access-specifier is unspecified." "Unspecified" means implementation-dependent behavior that need not be documented.
Therefore, the standard is explicitly saying nothing about the allocation, except that i must precede j and k ... | [
0.15572459995746613,
0.03043905459344387,
-0.12883827090263367,
0.2235586941242218,
0.24928070604801178,
0.25279557704925537,
-0.14127250015735626,
-0.31788361072540283,
-0.38664740324020386,
0.00843191146850586,
-0.24419447779655457,
0.40050259232521057,
-0.22015050053596497,
0.0404252409... | |
I'm doing some research for my end of degree project: a multiplattform application developed using .net3.5 and mono2.0
I need some opinion about what you people think is the best Object Relational Mapping framework which will also run with mono.
Additionaly, any opinion about what ORM will work the best for my proje... | [
0.48556193709373474,
0.3244865834712982,
0.3212682008743286,
0.21050262451171875,
-0.16248489916324615,
-0.16937905550003052,
0.24738585948944092,
0.012104458175599575,
0.07465987652540207,
-0.7457727789878845,
0.04883630946278572,
0.44070202112197876,
0.14584341645240784,
0.26552224159240... | |
asume that if I manage to make it work with mac, adding support for linux in the future will be relative easy :) )
Thanks in advance
NHibernate is by far the best choice
there are also very good tools out there, I recommend:
[NHibernate Analyzer](http://ayende.com/projects/nhibernate-query-analyzer.aspx) | [
-0.35865747928619385,
-0.054963018745183945,
0.4066619873046875,
0.07080712169408798,
-0.26928064227104187,
-0.21244239807128906,
0.055943481624126434,
-0.20803602039813995,
-0.12757660448551178,
-0.5932565927505493,
-0.0414702482521534,
0.6541165113449097,
-0.23001612722873688,
0.02164078... | |
**Sorry answer found while typing**
I am trying to connect to an external webservice that requires username/password authentication through a proxy. I am using Visual Studio Express 2008 to generate a service reference
* I have connected to the same
webservice using a web reference.We
only had to set a larger timeou... | [
0.1681092083454132,
0.3479479253292084,
0.17646344006061554,
-0.02153540588915348,
-0.385194331407547,
-0.11651385575532913,
0.3464517891407013,
0.11462267488241196,
-0.25064709782600403,
-0.7947155833244324,
0.05270712450146675,
0.421306312084198,
-0.05858916789293289,
-0.1004005670547485... | |
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.net>
<defaultProxy useDefaultCredentials="true">
<proxy bypassonlocal="False" proxyaddress="http://***.***.****:80" />
</defaultProxy>
</system.net>
<system.serviceModel>
<bindings>
<c... | [
-0.17582860589027405,
-0.07058776915073395,
0.54319828748703,
-0.2366015911102295,
0.06964563578367233,
0.10932896286249161,
0.2011716365814209,
-0.25132623314857483,
-0.40940067172050476,
-0.8185229301452637,
-0.44612765312194824,
0.21844270825386047,
-0.21061038970947266,
0.1499962359666... | |
<textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
messageVersion="Soap12" writeEncoding="utf-8">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
... | [
-0.5181511640548706,
-0.03151337057352066,
0.35848864912986755,
-0.13116496801376343,
0.01856076531112194,
0.33722853660583496,
0.668164074420929,
-0.28245848417282104,
-0.2980632185935974,
-0.43184226751327515,
-0.2193954885005951,
0.6403998136520386,
-0.20173896849155426,
-0.206969231367... | |
<httpTransport manualAddressing="false" maxBufferPoolSize="524288"
maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
keepAliveEnabled="true" maxBufferSize="65... | [
-0.06270044296979904,
0.04839544743299484,
0.41452059149742126,
0.004147025756537914,
0.0228369552642107,
-0.13432911038398743,
0.8710087537765503,
-0.2736796736717224,
-0.2394614815711975,
-0.3302319347858429,
-0.17966926097869873,
0.6304081678390503,
-0.06476554274559021,
-0.023445589467... | |
realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
useDefaultWebProxy="true" />
</binding>
</customBinding>
</bindings>
<client> | [
-0.07572761178016663,
-0.10302340984344482,
0.714635968208313,
-0.0036841724067926407,
0.08552323281764984,
-0.15213583409786224,
0.5857346653938293,
-0.43887847661972046,
-0.20082500576972961,
-0.5088695883750916,
-0.12266568839550018,
0.26734012365341187,
-0.42403537034988403,
0.51598411... | |
<endpoint address="http://www.****.*****.****.com/samplewebservice/service.asmx"
binding="customBinding" bindingConfiguration="AreaWebServiceSoap12"
contract="ServiceReference1.ServiceSoap" name="ServiceSoap" />
</client>
</system.serviceModel>
</configura... | [
-0.11821603029966354,
-0.12127319723367691,
0.6431577801704407,
-0.2875916659832001,
-0.05695025250315666,
0.22179266810417175,
0.5896532535552979,
-0.5161556601524353,
-0.002180957468226552,
-0.7369047403335571,
-0.3810912072658539,
0.40582120418548584,
-0.08231356739997864,
0.16229546070... | |
Service.RawGpsData[] result = s.GetRawGpsData(0);
Console.WriteLine(String.Format("done:{0}",result.Length));
Console.ReadLine();
}
```
Just using this setup gives an error as expected:
*The HTTP request is not authorized with client authentication scheme Anonymous. The authentication header from the server is r... | [
0.19350995123386383,
0.029820766299962997,
0.5790113806724548,
0.06592559069395065,
-0.1885206401348114,
-0.3055318295955658,
0.6216607093811035,
-0.40986910462379456,
-0.2011643797159195,
-0.8009768724441528,
-0.10958638042211533,
0.4344705641269684,
-0.1720122992992401,
0.323250204324722... | |
and confidentiality.*
Sorry, while typing this question I stumbled upon the answer myself. I still think people might be interested in this and all comments and thoughts are still welcome. So I will leave the question here and make it community and post the answer myself.
Change the binding to :
```
<?xml version="1.... | [
0.2808341085910797,
-0.041405435651540756,
0.7030249238014221,
0.07507932931184769,
0.11800900101661682,
-0.4562179446220398,
0.15956929326057434,
-0.2759288251399994,
-0.059551920741796494,
-0.6187949180603027,
-0.5596119165420532,
0.3842434585094452,
-0.09332949668169022,
0.1042752414941... | |
<textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
messageVersion="Soap12" writeEncoding="utf-8">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</te... | [
-0.5181511640548706,
-0.03151337057352066,
0.35848864912986755,
-0.13116496801376343,
0.01856076531112194,
0.33722853660583496,
0.668164074420929,
-0.28245848417282104,
-0.2980632185935974,
-0.43184226751327515,
-0.2193954885005951,
0.6403998136520386,
-0.20173896849155426,
-0.206969231367... | |
<httpTransport manualAddressing="false" maxBufferPoolSize="524288"
maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Ntlm"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
keepAliveEnabled="true" maxBufferSize="65536" prox... | [
-0.05002812296152115,
0.03501318767666817,
0.5954997539520264,
0.03044826351106167,
0.10131891071796417,
-0.17504574358463287,
0.9504360556602478,
-0.3485881984233856,
-0.1613621711730957,
-0.3505445718765259,
-0.14806412160396576,
0.6530647873878479,
-0.09730274975299835,
0.08104354143142... | |
useDefaultWebProxy="true" />
</binding>
</customBinding>
```
So set authenticationScheme="Ntlm" | [
0.176364466547966,
0.011244100518524647,
0.19593319296836853,
-0.17547476291656494,
0.11106012761592865,
-0.40681782364845276,
0.5224159359931946,
-0.6935948133468628,
-0.20629578828811646,
-0.24198390543460846,
-0.26010408997535706,
0.4788702130317688,
-0.39694029092788696,
-0.02128740772... | |
Now that I've finnaly moved to doing some development/support work for Windows 2008 I find myself annoyed by the lack of one feature I just can't enable: the desktop shortcut to "My Computer" I've grown used to. I know how to enable this on XP and 2003, but I just can't find the setting on 2008.
How can a user configu... | [
0.09547817707061768,
0.2889803349971771,
0.3298150300979614,
-0.4046396315097809,
-0.13896557688713074,
0.14046423137187958,
0.4163980185985565,
0.34330105781555176,
-0.2996598184108734,
-0.5311742424964905,
0.09237993508577347,
0.7148844599723816,
-0.05618195980787277,
0.2238587886095047,... | |
I'm trying to reorder/group a set of results using SQL. I have a few fields (which for the example have been renamed to something a bit less specific), and each logical group of records has a field which remains constant - the address field. There are also fields which are present for each address, these are the same f... | [
0.46981069445610046,
0.6215837001800537,
0.11270425468683243,
-0.13284048438072205,
0.15480652451515198,
0.24883289635181427,
0.0347265899181366,
-0.29701876640319824,
-0.08263637870550156,
-0.5933781266212463,
-0.0011500880355015397,
0.16669631004333496,
-0.2003411054611206,
0.54326254129... | |
Values Address1
3 Jenny Are Address1
4 John All Address2
5 Lucy Totally Address2
6 Jenny Different Address2
7 Steve And Address2
8 Richard | [
0.12015792727470398,
0.7363155484199524,
0.5165643095970154,
0.005689713172614574,
0.08655431866645813,
0.3724621832370758,
0.5613199472427368,
-0.17216747999191284,
-0.2795093059539795,
-0.039804328233003616,
-0.43038246035575867,
0.1337823122739792,
0.22358493506908417,
0.258947253227233... | |
Blah Address2
address John Lucy Jenny Steve Richard
Address1 These Values Are (null) (null)
Address2 All Totally | [
0.7430112957954407,
0.42730313539505005,
0.4391501247882843,
-0.12062292546033859,
-0.14979563653469086,
0.05661182105541229,
0.7423587441444397,
0.27994590997695923,
-0.21395520865917206,
-0.04373439401388168,
-0.5771353840827942,
0.2505858242511749,
-0.4429226815700531,
0.119206123054027... | |
Different And Blah
```
For example: John,Lucy,Jenny,Steve and Richard are the only possible names at each address. I know this because it's stored in another location.
Can I select values from the actual records in the left hand image, and return them as a result set like the one on the right? I'm using My... | [
0.5495738387107849,
0.21436351537704468,
0.43529215455055237,
-0.04801779240369797,
0.2218879908323288,
0.8435355424880981,
0.15905098617076874,
0.10371442139148712,
-0.4175373613834381,
-0.46346157789230347,
-0.2727448642253876,
0.1944742351770401,
-0.26398804783821106,
0.4123853743076324... | |
max(if(forename='lucy',surname,null)) as lucy,
max(if(forename='jenny',surname,null)) as jenny,
max(if(forename='steve',surname,null)) as steve,
max(if(forename='richard',surname,null)) as richard,
address
from tablename
group by address;
```
It is a bit brittle though.
The... | [
0.12443959712982178,
0.09062819182872772,
0.4080803096294403,
-0.17148683965206146,
0.21270155906677246,
0.5858610272407532,
0.559410035610199,
0.037938978523015976,
-0.28959229588508606,
-0.36552587151527405,
-0.7007051110267639,
0.12176413089036942,
-0.40313589572906494,
0.33554750680923... | |
) ) tenants
from tablename
group by address;
``` | [
-0.09632530808448792,
0.34194064140319824,
0.42447036504745483,
-0.5564499497413635,
-0.03731958195567131,
0.014561577700078487,
0.16006670892238617,
-0.1719970703125,
-0.22822052240371704,
-0.33497363328933716,
-0.8477641940116882,
0.45337334275245667,
-0.4161926209926605,
0.3078234791755... | |
I have recently started looking into Google Charts API for possible use within the product I'm working on. When constructing the URL for a given chart, the data points can be specified in three different formats, unencoded, using simple encoding and using extended encoding (<http://code.google.com/apis/chart/formats.ht... | [
0.24436359107494354,
0.11847784370183945,
0.7148478627204895,
0.18736518919467926,
-0.25937551259994507,
0.1751624494791031,
0.042330771684646606,
0.03138848394155502,
-0.29728299379348755,
-0.5373129844665527,
0.08190154284238815,
0.19706107676029205,
-0.06601925194263458,
0.3785190880298... | |
your data yourself so that it fits within the 0-4095 range required by the API.
For example, if you have data values from 0 to 1,000,000 then you could divide all your data by 245 so that it fits within the available range (1000000 / 245 = 4081). | [
0.387929767370224,
0.2077348679304123,
0.523404061794281,
0.39589959383010864,
0.25560012459754944,
0.20081566274166107,
-0.08991856127977371,
-0.29450157284736633,
-0.22679606080055237,
-0.5062479972839355,
-0.014569944702088833,
0.23979173600673676,
0.028496919199824333,
0.26732608675956... | |
It's a simple case of a javascript that continuously asks "are there yet?" Like a four year old on a car drive.. But, much like parents, if you do this too often or, with too many kids at once, the server will buckle under pressure..
How do you solve the issue of having a webpage that looks for new content in the orde... | [
0.47199738025665283,
-0.07263767719268799,
0.37921738624572754,
0.2059204876422882,
-0.03685924410820007,
-0.34467968344688416,
0.09158778190612793,
0.18344198167324066,
-0.33204135298728943,
-0.49062439799308777,
0.16611675918102264,
0.16129763424396515,
0.26516661047935486,
0.29741090536... | |
more advanced way would use a [push-like](http://en.wikipedia.org/wiki/Push_technology) technique, by using [Comet](http://en.wikipedia.org/wiki/Comet_(programming)) techniques (long-polling and such). There's a lot of interesting stuff under that link.
I'm still waiting for a good opportunity to use it myself...
Oh,... | [
-0.22253990173339844,
-0.3861885666847229,
0.541560709476471,
-0.04441580921411514,
-0.2628099322319031,
-0.014609100297093391,
-0.31120172142982483,
-0.23054975271224976,
-0.32274335622787476,
-0.4928584396839142,
-0.19180302321910858,
0.10326851159334183,
0.04687071964144707,
-0.05908435... | |
I have hit a classic problem of needing to do a string replace on a text field in an sql 2000 database. This could either be an update over a whole column or a single field I'm not fussy.
I have found a few examples of how to use updatetext to achieve it but they tend to be in stored procedures, does anyone know of a ... | [
0.4389040172100067,
0.19216933846473694,
0.25949668884277344,
-0.04233990237116814,
-0.09558388590812683,
-0.4970836341381073,
0.3065701723098755,
-0.13153232634067535,
-0.08163363486528397,
-0.466412752866745,
0.10625304281711578,
0.6434730291366577,
-0.3645268678665161,
0.152022033929824... | |
text fields.
Edit: I realised I could probably get away with varchar(8000) so have swapped the fields to this type which fixes the issue. I never found a true solution.
I am afraid you cannot do it within a function
When you try to declare a function like:
```
create function dbo.textReplace(
@inText as text)
return... | [
0.16035982966423035,
0.09509243071079254,
0.31791016459465027,
-0.35603323578834534,
-0.3846098780632019,
-0.2114795595407486,
0.760962963104248,
-0.20414170622825623,
0.040220219641923904,
-0.4100864827632904,
-0.2876937985420227,
0.8108508586883545,
-0.5559584498405457,
0.153923600912094... | |
I am looking for the highest key value (a defined by the comparison operator) of a std::map.
Is this guaranteed to be
```
map.rbegin()->first
```
?
(I am a bit shaky on reverse iterators, and how much freedom there is in the implementation of std::map)
If not, please advise. I cannot change the data structure.... | [
-0.5863145589828491,
0.10660450905561447,
-0.02238820679485798,
-0.24432002007961273,
-0.016089176759123802,
0.21277408301830292,
0.07170066982507706,
-0.37933120131492615,
-0.18257977068424225,
-0.49320048093795776,
-0.21495965123176575,
0.4763900637626648,
-0.3470408022403717,
-0.0078978... | |
I am trying to convert my web application into a fully dynamic system. One thing I am trying to do is to load a different logo (set in the masterpage template) depending on the host.
But, even though the code is hit (in page\_init), there is no image displayed on any page inheriting the masterpage - no image, no red x... | [
0.09880608320236206,
0.020181577652692795,
0.5005651712417603,
-0.2090199738740921,
-0.0834498181939125,
0.05006453022360802,
0.3346376121044159,
0.12165142595767975,
-0.18552179634571075,
-1.011789321899414,
-0.24698473513126373,
0.5420199632644653,
-0.3582807779312134,
0.4289739727973938... | |
Image1.ImageUrl = "C:\Users\firstname.lastname\Documents\Visual Studio 2008\WebSites\ecardsystem\images\ECard Platform.jpg."
End If
End Sub
```
I know that I can add the image on the fly using literal controls through codebehind, but this will mean I need to design the html too, by hand, when the design is all ... | [
0.018300876021385193,
0.0693037211894989,
0.6650936603546143,
-0.08693495392799377,
-0.29155993461608887,
-0.09206230193376541,
0.10756777226924896,
-0.1818150281906128,
-0.21206879615783691,
-0.8998407125473022,
-0.13473546504974365,
0.5628788471221924,
-0.3739955425262451,
-0.18907563388... | |
enables parallel access.
In this case I'd define a 1D array which contains all the strings positioned one after another and another 1D array, sized 2\*numberOfStrings which contains the offset of each string within the first array and it's length:
For example - preparation for kernel:
```
char* buffer = st[0] +... | [
-0.20430763065814972,
-0.24302077293395996,
0.5547845363616943,
0.25370556116104126,
0.11602454632520676,
0.4329025447368622,
-0.12083013355731964,
-0.05831145495176315,
-0.42725619673728943,
-0.6071564555168152,
-0.03292684257030487,
0.35098493099212646,
-0.3981228768825531,
0.35877096652... | |
currentString = buffer + metadata[2 * currentIndex];
int currentStringLength = metadata[2 * currentIndex + 1];
``` | [
-0.28126922249794006,
-0.39721840620040894,
0.6072307825088501,
0.11348448693752289,
0.21796724200248718,
-0.2603417932987213,
-0.20544464886188507,
-0.5447818636894226,
-0.16603581607341766,
-0.024830816313624382,
-0.02122366987168789,
0.2455102503299713,
-0.3779433071613312,
0.1511750072... | |
Since MySQL doesn't seem to have any 'boolean' data type, which data type do you 'abuse' for storing true/false information in MySQL?
Especially in the context of writing and reading from/to a PHP script.
Over time I have used and seen several approaches:
* tinyint, varchar fields containing the values 0/1,
* varcha... | [
0.09832268208265305,
-0.052598800510168076,
0.20129846036434174,
0.13685466349124908,
-0.33022332191467285,
-0.035330139100551605,
0.13537293672561646,
0.19450493156909943,
0.14957024157047272,
-0.5442496538162231,
0.22184057533740997,
0.5514130592346191,
-0.21608391404151917,
-0.073647812... | |
designed for boolean values which I have overlooked? Do you see any advantages/disadvantages by using one type or another?
For MySQL 5.0.3 and higher, you can use `BIT`. The manual says:
> As of MySQL 5.0.3, the BIT data type is used to store bit-field
> values. A type of BIT(M) enables storage of M-bit values. M can ... | [
0.12204564362764359,
-0.05132603645324707,
0.3174797296524048,
-0.07104162871837616,
-0.1463654637336731,
0.045355409383773804,
0.40386489033699036,
-0.3756743371486664,
-0.11929360032081604,
-0.5461193323135376,
-0.060088325291872025,
0.7894220948219299,
-0.5281474590301514,
0.13093079626... | |
states that:
> We intend to implement full boolean
> type handling, in accordance with
> standard SQL, in a future MySQL
> release.
References: <http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html> | [
0.2565162181854248,
0.06753534823656082,
0.3447655737400055,
-0.08979443460702896,
0.016476284712553024,
-0.2199481576681137,
0.07422419637441635,
-0.013811539858579636,
0.13552787899971008,
-0.3964731693267822,
-0.20314985513687134,
0.2087303251028061,
-0.09414736926555634,
-0.14549733698... | |
During navigation of the `java.lang.reflect.Method` class I came across the method `isBridge`. Its Javadoc says that it returns true only if the Java spec declares the method as true.
Please help me understand what this is used for! Can a custom class declare its method as a bridge if required?
A bridge method may be ... | [
0.25622236728668213,
0.21642586588859558,
0.3693366050720215,
0.02107452042400837,
-0.038006119430065155,
0.05488956347107887,
0.23252712190151215,
-0.4210023880004883,
-0.2508476972579956,
-0.5422411561012268,
0.19390930235385895,
0.2640187442302704,
-0.4028741717338562,
0.223110273480415... | |
C<T> { abstract T id(T x); }
class D extends C<String> { String id(String x) { return x; } }
```
Now, given an invocation
```
C c = new D();
c.id(new Object()); // fails with a ClassCastException
```
The erasure of the actual method being invoked, `D.id(String)` differs in its signature from that of the compile-ti... | [
0.1722499579191208,
0.13908909261226654,
0.12679073214530945,
-0.2873515486717224,
0.04007968679070473,
-0.23395156860351562,
0.5051425099372864,
-0.2839309573173523,
-0.016320688650012016,
-0.2642224431037903,
-0.5276182889938354,
0.571807861328125,
-0.43428391218185425,
0.186316922307014... | |
semantics by creating bridge methods. In the above example, the following bridge method would be created in class D:
```
Object id(Object x) { return id((String) x); }
```
This is the method that would actually be invoked by the Java virtual machine in response to the call `c.id(new Object())` shown above, and it wi... | [
0.16219541430473328,
-0.07750605046749115,
0.34925922751426697,
0.15889698266983032,
-0.19006438553333282,
-0.07978098839521408,
0.415046364068985,
-0.3675726354122162,
-0.22157073020935059,
-0.5524457693099976,
-0.008079555816948414,
0.5683913230895996,
-0.373896986246109,
-0.205691307783... | |
*but the return type* of the overriding method, if it is a *subtype* of the return type of the other method.
Typically, a method `Object clone()` can be overridden by a `MyObject clone()`, but a bridge method will be generated by the compiler:
```
public bridge Object MyObject.clone();
``` | [
0.0928494855761528,
0.2263983190059662,
0.11281527578830719,
-0.010413900949060917,
0.23948286473751068,
-0.2580406963825226,
0.11803661286830902,
-0.16062161326408386,
0.09018991142511368,
-0.6062294840812683,
-0.3734198212623596,
0.24443453550338745,
-0.5176793336868286,
0.46275609731674... | |
I have a logical error. I provided the following as input:
* the salary is 30000
* the child n° is 9
So the the net salary will be:
* the family bonus + salary - tax
```
(750) + (30000) - (3000)
```
* but my program count them as
```
(1500) + (30000) + (6000)
```
My program doubled (accumulated) th... | [
0.3498474955558777,
-0.12162990868091583,
0.21750888228416443,
-0.04978938028216362,
-0.014491045847535133,
0.559657633304596,
-0.007611474487930536,
-0.0927470400929451,
-0.36938294768333435,
-0.41166922450065613,
0.03441263362765312,
0.6453325152397156,
0.020230699330568314,
0.5820412635... | |
e.ReadEmployee();
e.PrintEmployee();
}
}
class Employee
{
private string n;
private int byear;
private double sal;
private bool gen;
private bool mar;
private int child;
public static double tax = 0;
public static double familybonus = 0;
public string Ename
{
... | [
0.11456969380378723,
-0.2321779876947403,
-0.1496037244796753,
-0.18541404604911804,
0.2046975940465927,
0.32687896490097046,
0.3416522741317749,
-0.0335262157022953,
-0.006372929085046053,
-0.39314740896224976,
-0.3719075620174408,
0.49307316541671753,
-0.24110670387744904,
0.411551535129... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.