text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
would like that vagueness preserved if I switch to a regular expression. I am better with regex's just not so good with like. My query is "LIKE 'matchme%'"
Update
------
Based on tomalak's comment and OIS's brilliant idea to use preg\_grep, this might be something more along the lines of a final solution for you.
```... | [
0.46393996477127075,
-0.12482121586799622,
0.7239169478416443,
-0.12314435839653015,
0.014683561399579048,
0.2160734087228775,
0.4848853647708893,
-0.4195781946182251,
0.16572660207748413,
-0.4529075026512146,
0.17725317180156708,
0.665284276008606,
-0.39538195729255676,
0.2031429558992386... | |
array(
'foobar'
,'barfoo'
,'barfoobaz'
);
foreach ( $likeClauses as $clause )
{
echo "Testing $clause:";
echo '<pre>';
print_r( selectLikeMatches( $testInput, $clause ) );
echo '</pre>';
}
```
Original Post Below
-------------------
Is this along the lines of what you're after?
```
<?ph... | [
0.6080288290977478,
0.026456963270902634,
0.3362593948841095,
-0.29119136929512024,
0.18792219460010529,
0.23612214624881744,
0.5946386456489563,
-0.6732707023620605,
0.13906380534172058,
-0.26467955112457275,
-0.02931550331413746,
0.6463990807533264,
-0.3927176296710968,
0.205360561609268... | |
as $test )
{
foreach ( $likeClauses as $clause )
{
echo "Testing '$test' against like('$clause'): ";
if ( preg_match( convertLikeToRegex( $clause ), $test ) )
{
echo 'Matched!';
} else {
echo 'Not Matched!';
} | [
0.6943639516830444,
-0.08179616183042526,
0.16542136669158936,
-0.35027194023132324,
0.08876988291740417,
-0.02786967158317566,
0.9076639413833618,
-0.8472950458526611,
0.124958835542202,
-0.049765463918447495,
-0.15916232764720917,
0.5260743498802185,
-0.4878212511539459,
0.11423984915018... | |
echo '<br>';
}
echo '<hr>';
}
``` | [
0.1287403106689453,
0.33914661407470703,
-0.009894204325973988,
-0.3142288327217102,
-0.08826523274183273,
-0.022069456055760384,
0.4838283360004425,
-0.4739687442779541,
0.033145833760499954,
-0.34673312306404114,
-0.449957937002182,
0.41197827458381653,
-0.44199469685554504,
0.2128081321... | |
I hate to resort to dumping problems on other people, and I'm sure this is a stupid problem that can be easily fixed, but it's really getting to annoy me and I can't figure it out.
Well I tried installing Microsoft C# Visual Express, but after a few minutes into the installation I got a "Windows Module Installer stopp... | [
0.5389888882637024,
0.3372887670993805,
0.30348747968673706,
-0.07403786480426788,
-0.038677655160427094,
-0.18515276908874512,
0.47680872678756714,
0.23640552163124084,
-0.4207514822483063,
-0.4789033532142639,
0.05134759470820427,
0.9207931160926819,
-0.4160361886024475,
-0.0667754113674... | |
ways to restart the service, still no luck.
The installation involved Microsoft .NET Framework v3.5, which Vista has been trying to update for a while now (with no attempts successful). Maybe this could be part of the problem? I searched it up on the Internet, and some related issues were caused by the ".NET Framework... | [
0.21278119087219238,
-0.045071493834257126,
0.35705846548080444,
0.213531494140625,
0.26831087470054626,
-0.3044106960296631,
0.5033645629882812,
0.08079124242067337,
-0.15220382809638977,
-0.5853268504142761,
-0.19497066736221313,
0.8874322175979614,
-0.25656136870384216,
0.00285371323116... | |
fails (no explanation given)
```
3) Attempted to install Microsoft C# Visual Express
```
a) Software requires .NET Framework
b) .NET Framework automatically included in installation
c) Download fails, error message appears with no explanation.
d) Windows Module Installer stays open, with no way to exit.
```
4) Com... | [
-0.08187521249055862,
0.4985993504524231,
0.46631914377212524,
0.0171864852309227,
0.37309345602989197,
0.020787186920642853,
0.93707275390625,
-0.00945515651255846,
-0.21439115703105927,
-0.6279251575469971,
-0.30790767073631287,
0.8209612965583801,
-0.22438879311084747,
0.156452238559722... | |
formatting... This is my first time using this site.)
Check your CSS and/or javascript. It sounds like there is a transparent element (like a div) beging placed over the elements in the page. | [
0.5877987742424011,
0.036409977823495865,
0.4913643002510071,
0.289083868265152,
-0.2754763662815094,
-0.40184926986694336,
0.006129526533186436,
0.08314046263694763,
-0.24988356232643127,
-0.9913366436958313,
0.12593109905719757,
0.48356664180755615,
-0.3841964304447174,
-0.14305171370506... | |
Say that I have this code:
```
rentalEaseDataSet.tblCheckbookEntry.Rows.Add(newRow);
```
I want to get the identity of a column from that row I just added. How can I do this? Say the row is called ID.
For reference, I'm using C# and sql server express.
Well, that row hasn't actually been saved to the database yet, ... | [
0.3226662278175354,
0.28833988308906555,
0.3827197551727295,
-0.08784697204828262,
0.07745525985956192,
-0.0636783018708229,
0.05803633853793144,
-0.040005091577768326,
-0.09760845452547073,
-0.702012300491333,
0.20889560878276825,
0.5172683596611023,
-0.23501139879226685,
0.37615981698036... | |
I'm getting odd results in some VB6 code which I've narrowed to this:
```
Debug.Print Hex(&hEDB80000 + &h8300)
```
Shows **EDB78300**
That can't by right can it? Surely it should be **EDB88300**?
Am I going mad?
Don't forget how [negative numbers are expressed in binary](http://en.wikipedia.org/wiki/Two's_compleme... | [
0.1460692435503006,
0.2581634819507599,
-0.04202346131205559,
-0.12140285223722458,
-0.28744062781333923,
-0.1437695324420929,
0.5010504722595215,
-0.32321304082870483,
-0.3022693693637848,
-0.53904789686203,
-0.14476938545703888,
0.4481014609336853,
-0.30804961919784546,
0.276218444108963... | |
that's **-306708480**
Because &h8300 fits in 16-bits, VB interprets it as an **integer** (16-bits). Because the high bit is set, VB6 knows that it's negative.
Let's undo the two's complement (in a *16-bit* world)
```
(~&h8300 + 1) = &h7DFF + 1 = &h7D00 = 32000
```
since the sign bit was set, that's **-32000**. Whe... | [
-0.013876073993742466,
0.10710426419973373,
0.19307930767536163,
-0.3394638001918793,
-0.19364787638187408,
0.16816604137420654,
0.3089256286621094,
-0.36198127269744873,
-0.20696988701820374,
-0.48835089802742004,
-0.33982813358306885,
0.46788290143013,
-0.3309386670589447,
0.255737900733... | |
16384 // Fits in 16-bits, sign bit is not set
&h0008000 is interpreted as -32768 // Fits in 16-bits, sign bit is set
&h0010000 is interpreted as 65536 // Requires 32-bits, sign bit is not set
```
as mentioned in the other post, you can get around this by explicitly marking values as longs
```
&h0004000& is interpre... | [
-0.3424719274044037,
0.33430880308151245,
0.5899915099143982,
-0.09351806342601776,
-0.12346956133842468,
0.5596340894699097,
0.30436190962791443,
-0.5791457295417786,
-0.4994522035121918,
0.14359448850154877,
-0.17126552760601044,
0.31812164187431335,
-0.4295285940170288,
-0.1583431363105... | |
I'm designing a website to teach myself how to use table joins in mysql and have got stuck pretty early on. (The numbers are Wii friend codes, if that helps you make sense of this!)
I have 3 tables:
users:
```
id, firstname, surname
```
games:
```
id, title
```
numbers:
```
number, users_id, game_id
```
The ... | [
0.011759313754737377,
0.38657382130622864,
0.46452832221984863,
0.16803789138793945,
-0.04577043652534485,
0.18910211324691772,
-0.2839246988296509,
-0.037007492035627365,
-0.1852119117975235,
-0.6068711280822754,
0.24900029599666595,
0.2665347754955292,
-0.025421125814318657,
0.4097211956... | |
get out all the numbers belonging to foogame. However, this returns any user who doesn't have a code for this game with a random code from another user. How do I make this query only return the users who actually have a code for that game?
I find it easier if you actually use joins because you won't miss a join conditi... | [
0.000404395250370726,
-0.03670183941721916,
0.08275793492794037,
-0.00590655580163002,
-0.07302724570035934,
-0.17189756035804749,
-0.03162342682480812,
-0.3473329246044159,
-0.3777090609073639,
-0.6705165505409241,
-0.024513553828001022,
0.4680995047092438,
-0.45823895931243896,
0.3278044... | |
> ```
INNER JOIN is the equivalent of what you did - it limits specifically. | [
0.41323739290237427,
0.07511023432016373,
0.2031763792037964,
-0.13223043084144592,
-0.12123551964759827,
-0.232719287276268,
0.22594447433948517,
-0.3253672122955322,
0.10074435919523239,
-0.6541612148284912,
-0.03558411821722984,
0.6084238886833191,
-0.17079512774944305,
-0.0431617908179... | |
I want to make all objects in an array perform a selector. I've discovered the appropriately named `makeObjectsPerformSelector:` method, but I have a question with it. If I use it on an array, will it change the existing array or return a new one? If it modifies the existing object, what be the easiest way to return a ... | [
0.40374746918678284,
-0.31622955203056335,
0.06632490456104279,
-0.19541481137275696,
-0.15673623979091644,
0.03234565258026123,
0.19297094643115997,
-0.3941895663738251,
-0.12305498868227005,
-0.29905226826667786,
0.2569558322429657,
0.39146655797958374,
-0.5858339071273804,
0.05619854107... | |
by default most copies in Cocoa are shallow copies, which means you get a new array, but the underlying objects it points to are the same objects. You will need to use initWithArray:copyItems to make it copy the root level items as well. If you want a new array containing the altered objects as well as the old array do... | [
0.13535869121551514,
0.06257336586713791,
0.35197359323501587,
0.04770226776599884,
0.04532022401690483,
-0.24159763753414154,
0.14951547980308533,
-0.19790758192539215,
-0.364755243062973,
-0.7553287148475647,
-0.09302252531051636,
0.5218426585197449,
-0.40839579701423645,
0.3412300348281... | |
I thought that the quotation mark (") was simply a type of grouping marker but I'm debugging some NHibernate code and notice that while
```
SELECT * FROM site WHERE site_id = 3;
```
Works fine
```
SELECT * FROM "site" WHERE site_id = 3;
```
fails with a table or view does not exist error.
What gives?
Putting dou... | [
0.16176171600818634,
0.3113282024860382,
-0.49152737855911255,
0.2056705802679062,
-0.3333442807197571,
0.0314067006111145,
0.18217748403549194,
-0.0892290398478508,
0.19369664788246155,
-0.0303396824747324,
0.13481684029102325,
0.5453746318817139,
-0.16761744022369385,
-0.1163639277219772... | |
(with the exception of all upper case identifiers, where double-quotes are meaningless).
Under the covers, Oracle is always doing case-sensitive identifier matching. But it always casts identifiers that are not double-quoted to upper case before doing the matching. If you put double-quotes around an identifier, Oracle... | [
-0.15990877151489258,
0.318144828081131,
-0.01373287197202444,
0.21087832748889923,
-0.08795502036809921,
-0.15784122049808502,
-0.13586947321891785,
-0.23253557085990906,
-0.15987057983875275,
-0.4666415750980377,
0.015158957801759243,
0.3442457914352417,
-0.2663605511188507,
-0.190587282... | |
col2 number
)
```
you cannot do
```
SELECT * FROM my_other_table
SELECT * FROM MY_OTHER_TABLE
SELECT * FROM My_Other_Table
SELECT * FROM "MY_OTHER_TABLE"
```
but this
```
SELECT * FROM "my_other_table"
```
will work | [
-0.6463528275489807,
0.10375545918941498,
0.5685593485832214,
-0.22971445322036743,
0.16339722275733948,
0.06084137409925461,
-0.23094132542610168,
-0.44390633702278137,
-0.30828508734703064,
-0.5799949169158936,
-0.1286342740058899,
0.4438348114490509,
-0.46421462297439575,
-0.35743799805... | |
More specifically, what's the most elegant way to cast the Graphics object in a paint() call up to a Graphics2D object?
```
public void paint(Graphics g) {
// How do I convert/cast/etc the g variable to a Graphics2D object?
}
```
Or am I missing the point here? Is there a better way to handle this in general?
``... | [
0.04629991948604584,
0.1588883399963379,
0.269084095954895,
-0.1917259246110916,
-0.45070314407348633,
-0.040849849581718445,
0.002156222704797983,
-0.09365081042051315,
-0.07545973360538483,
-0.6996225118637085,
-0.058592766523361206,
0.7691625356674194,
-0.5468062162399292,
-0.1558352559... | |
I am having trouble getting inside my Search WebMethod from my JQuery call.
Maybe someone could help to point me in the right direction.
I also packed up everything into a zip file incase someone wants to check it out for a closer look.
<http://www.filedropper.com/jsonexample>
Thanks
Ryan
```
<%@ Page Language=... | [
-0.05819174647331238,
-0.0018013762310147285,
0.6290635466575623,
0.06579093635082245,
0.0021154109854251146,
-0.20663930475711823,
0.3375839293003082,
-0.19581715762615204,
-0.538767397403717,
-0.497287392616272,
-0.24789687991142273,
0.42536789178848267,
0.047923315316438675,
-0.11083150... | |
url: "Default.aspx/Search",
data: "{text:" + search + "}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
alert('Success!');
}
};
$.ajax(options);
}
</script>
</head>
<body>
<form id="form1" runat="server">
... | [
-0.20890367031097412,
-0.041843727231025696,
0.6891977190971375,
0.0315711684525013,
-0.1250496804714203,
-0.0029575834050774574,
0.17184537649154663,
0.09073690325021744,
-0.0550362765789032,
-0.4387281537055969,
-0.7742611765861511,
0.36527785658836365,
-0.07332722842693329,
0.3117060661... | |
<a href="#" onclick="Search()" id="goSearch">Search</a>
<br />
<div id="Load" />
</form>
</body>
</html>
```
And here is the code behind for the default.aspx
```
Imports System.Data
Imports System.Web.Services
Imports System.Web.Script.Serialization
Partial Class _Default
... | [
-0.27741777896881104,
0.13712836802005768,
0.2896772027015686,
-0.0763733983039856,
0.08126404881477356,
-0.0701829120516777,
-0.06289200484752655,
-0.3634190261363983,
-0.09340138733386993,
-0.8333746790885925,
-0.47739002108573914,
0.4734979271888733,
-0.2510054409503937,
0.1885039508342... | |
Return "test"
End Function
End Class
```
To solve a problem like this, the first thing to do is watch it in Firebug.
If you click the "Search" link and watch the POST request/response in Firebug's console, you'll see it's throwing a 500 server error: Invalid JSON Primitive.
The reason for that is becaus... | [
0.003704810980707407,
0.2539196014404297,
0.2771969437599182,
-0.1628696620464325,
0.04387974739074707,
-0.2214437574148178,
0.5151114463806152,
-0.17749084532260895,
0.39664846658706665,
-0.5600143671035767,
-0.29941684007644653,
0.5320549011230469,
-0.089244045317173,
-0.1252902448177337... | |
} will *not* work. If you provide jQuery with an actual JSON literal instead of a string, it will convert that into a key/value pair of test=search and POST that instead of the JSON. That will also cause an ASP.NET AJAX ScriptService or PageMethod to throw the Invalid JSON Primitive error. | [
0.3728371560573578,
-0.32924899458885193,
-0.07618972659111023,
0.07630079984664917,
0.1887594610452652,
-0.19584232568740845,
0.3948243260383606,
0.023876341059803963,
0.05161026865243912,
-0.6934517621994019,
-0.14227409660816193,
0.6591952443122864,
-0.37176457047462463,
-0.050562832504... | |
I need to convert decimal values to their fractional equivalents, similar to this [previous question](https://stackoverflow.com/questions/379176/format-double-as-fraction).
I'm using the code posted in one of the answers as a starting point since it mostly does what I need it to do.
```
string ToMixedFraction(decima... | [
0.26118120551109314,
0.07731955498456955,
0.40951007604599,
-0.2011037915945053,
-0.01356498897075653,
0.17071355879306793,
0.22447864711284637,
-0.5019428133964539,
-0.29844075441360474,
-0.23523564636707306,
-0.06941533088684082,
0.6245928406715393,
0.08751536160707474,
0.192955955862998... | |
the most part, but I need to take common repeating decimal values (.3333333) and display that to the user as 1/3.
Does anyone happen to know how this might be possible to do?
From [Link](https://web.archive.org/web/20170924064702/http://mathforum.org/library/drmath/view/61579.html)
Take the number of digits in the re... | [
0.013638000935316086,
0.08028852939605713,
0.3303465247154236,
-0.019895372912287712,
-0.2230624407529831,
0.4760837256908417,
0.25259584188461304,
-0.25236985087394714,
-0.35842564702033997,
-0.11393242329359055,
0.044281814247369766,
0.06001315265893936,
-0.030954614281654358,
0.22219496... | |
I'm using WMI to collect system information. It works fine on every system I've tested it on, but I have one or two users that are reporting problems. The debug logs show the WMI code is throwing a "Provider load failure" exception. I haven't been able to replicate the issue.
The users have verified that the WMI servi... | [
0.2271575927734375,
0.05898599699139595,
0.17012964189052582,
0.0076746647246181965,
0.18986131250858307,
-0.30967631936073303,
0.20404782891273499,
0.013884523883461952,
-0.30996018648147583,
-0.6133625507354736,
-0.0753151997923851,
0.5498708486557007,
-0.34379106760025024,
0.22670139372... | |
I've got rather poor knowledge of \*nix virtualization capabilities and trying to clarify one thing. If one has root on host machine, does it always mean that he has root on all VMs of that host? If yes, then could there be a bogus setup where this is not true?
I'm asking cause I heard two different answers to that qu... | [
0.5379167199134827,
0.21876005828380585,
0.043561145663261414,
0.22885194420814514,
0.05132072791457176,
-0.23048028349876404,
0.2757708728313446,
0.36543869972229004,
-0.446486234664917,
-0.3961857557296753,
0.28995415568351746,
0.4187025725841522,
-0.11454170942306519,
0.3913169205188751... | |
to lose the data, just want to have some insights and words to google for ;-)
Thanks everyone!
Ultimately, having root on the VM host is the same as having physical access to a regular machine. They can't just "login" to the VM as root (well, you can with some virtualisation technologies like OpenVZ) but they can get i... | [
0.21360738575458527,
-0.11039728671312332,
0.39324885606765747,
0.6687753200531006,
0.1822233349084854,
-0.16361689567565918,
0.45571228861808777,
0.22879189252853394,
-0.40771347284317017,
-0.3831338882446289,
-0.1444127857685089,
0.5051157474517822,
0.1422237604856491,
0.2775317728519439... | |
same level of access and ability to do bad things to your service. | [
0.10781535506248474,
0.008003943599760532,
0.11406511813402176,
0.41666048765182495,
-0.08732174336910248,
-0.05321028456091881,
0.12998312711715698,
-0.09953417629003525,
-0.10564766824245453,
-0.6199215054512024,
0.30089932680130005,
0.5027145743370056,
0.04086802527308464,
-0.1221146583... | |
Are there any tools available in Linux which graphically or textually display memory usage for a program? For example, if I write a C++ program and would like to verify that objects are being allocated and deallocated properly in memory, are there applications available that would visually show the objects being instan... | [
0.21463699638843536,
0.06415111571550369,
-0.1929158717393875,
0.019062552601099014,
-0.09991142153739929,
-0.07532870024442673,
-0.14830707013607025,
0.3349640369415283,
-0.5857832431793213,
-0.7011196613311768,
0.04516884312033653,
0.6556859016418457,
-0.16092152893543243,
-0.01629714667... | |
Has anyone used the Pragmatic Programmers screencast series [Coding in Objective-C 2.0](http://pragprog.com/screencasts/v-bdobjc/coding-in-objective-c-2-0)?
They look good, but I don't know if I could get just as much value out of a text book or other web links.
I bought both screen casts. I'm neither a starving stude... | [
0.8420514464378357,
0.2556283473968506,
-0.1655229926109314,
0.18670427799224854,
-0.03467991575598717,
0.06088784337043762,
0.10595093667507172,
-0.12478264421224594,
-0.14770495891571045,
-0.44711413979530334,
0.12745411694049835,
0.7169327139854431,
0.11264249682426453,
-0.2900863885879... | |
great detail.
So yes, I found them to be worth the $5 and I'll buy any more that come out. | [
0.44001108407974243,
0.28154340386390686,
-0.2162742018699646,
0.29518187046051025,
0.19200952351093292,
0.33732056617736816,
0.13532346487045288,
0.4289324879646301,
-0.29419752955436707,
-0.2582865357398987,
0.4292406737804413,
0.7209004163742065,
0.48703786730766296,
-0.0421985164284706... | |
The default databinding on `TextBox` is `TwoWay` and it commits the text to the property only when `TextBox` lost its focus.
Is there any easy XAML way to make the databinding happen when I press the `Enter` key on the `TextBox`?. I know it is pretty easy to do in the code behind, but imagine if this `TextBox` is insi... | [
-0.05237807705998421,
-0.08505744487047195,
0.471064031124115,
-0.23102077841758728,
-0.09444167464971542,
-0.20070067048072815,
0.3518032431602478,
0.013221478089690208,
-0.10296071320772171,
-0.690989077091217,
-0.3045653700828552,
0.65702223777771,
-0.6263816356658936,
0.078901387751102... | |
"UpdatePropertySourceWhenEnterPressed", typeof(DependencyProperty), typeof(InputBindingsManager), new PropertyMetadata(null, OnUpdatePropertySourceWhenEnterPressedPropertyChanged));
static InputBindingsManager()
{
}
public static void SetUpdatePropertySourceWhenEnterPressed(DependencyObject dp, Depen... | [
-0.05040045827627182,
-0.16768869757652283,
0.666731059551239,
-0.10397270321846008,
0.4529097080230713,
0.2429707646369934,
0.3665022850036621,
-0.533562183380127,
-0.015927903354167938,
-0.6517939567565918,
-0.6235856413841248,
0.740334689617157,
-0.33968672156333923,
0.13659057021141052... | |
if (element == null)
{
return;
}
if (e.OldValue != null)
{
element.PreviewKeyDown -= HandlePreviewKeyDown;
}
if (e.NewValue != null)
{ | [
-0.2506105899810791,
-0.2560555636882782,
0.2638499438762665,
-0.18280641734600067,
0.12275023013353348,
-0.10255465656518936,
0.6085392832756042,
-0.2745155394077301,
0.1298329085111618,
-0.582364559173584,
-0.4133787453174591,
0.5092784762382507,
-0.20442050695419312,
0.31639644503593445... | |
element.PreviewKeyDown += new KeyEventHandler(HandlePreviewKeyDown);
}
}
static void HandlePreviewKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
DoUpdateSource(e.Source);
}
}
static void DoUpdateSource(object source)
{
Dep... | [
-0.008227990008890629,
-0.27210143208503723,
0.4256608486175537,
-0.048184555023908615,
0.07426662743091583,
-0.09846440702676773,
0.17821772396564484,
-0.5030372738838196,
0.04418008401989937,
-0.4090449810028076,
-0.27186739444732666,
0.6267685294151306,
-0.05148623511195183,
0.330314338... | |
=
GetUpdatePropertySourceWhenEnterPressed(source as DependencyObject);
if (property == null)
{
return;
}
UIElement elt = source as UIElement;
if (elt == null)
{
return; | [
0.0970715880393982,
-0.3505714535713196,
0.4762789011001587,
-0.12943030893802643,
0.1813918948173523,
0.2505183219909668,
0.47669142484664917,
-0.4637293219566345,
0.1917039006948471,
-0.5988225936889648,
-0.31459110975265503,
0.7020493149757385,
-0.22416138648986816,
0.3557441532611847,
... | |
}
BindingExpression binding = BindingOperations.GetBindingExpression(elt, property);
if (binding != null)
{
binding.UpdateSource();
}
}
}
```
Then in your XAML you set the `InputBindingsManager.UpdatePropertySourceWhenEnterPressedProperty` property to the one you want... | [
-0.12893624603748322,
0.08196888118982315,
0.8530110120773315,
-0.23208241164684296,
0.17485468089580536,
-0.3202926516532898,
0.233560711145401,
-0.5288997888565063,
-0.2168920487165451,
-0.7237997651100159,
-0.29137924313545227,
0.6090298891067505,
-0.6600340604782104,
0.2820964753627777... | |
b:InputBindingsManager.UpdatePropertySourceWhenEnterPressed="TextBox.Text"/>
```
(You just need to make sure to include an xmlns clr-namespace reference for "b" in the root element of your XAML file pointing to which ever namespace you put the InputBindingsManager in). | [
0.06368736922740936,
0.26610204577445984,
0.20812590420246124,
-0.42158377170562744,
-0.02259882725775242,
-0.3430860936641693,
0.13516633212566376,
0.06866447627544403,
-0.12012871354818344,
-0.4289027452468872,
-0.5520898103713989,
0.2517610192298889,
-0.6674487590789795,
0.0600552484393... | |
In the book I'm reading at the moment ([C++ Without Fear](https://rads.stackoverflow.com/amzn/click/com/0321246950)) it says that if you don't declare a default constructor for a class, the compiler supplies one for you, which "zeroes out each data member". I've experimented with this, and I'm not seeing any zeroing -o... | [
0.14015018939971924,
-0.03900259733200073,
-0.07526804506778717,
-0.04515597224235535,
0.0953681692481041,
-0.11550522595643997,
0.34128904342651367,
0.12633508443832397,
-0.03028157167136669,
-0.4652719795703888,
-0.19414687156677246,
0.3652077317237854,
-0.34766173362731934,
0.0756068974... | |
does not have a default constructor, this is a compilation failure)
* default construct each member variable in the order of declaration. (If a member does not have a default constructor, this is a compilation failure).
Note:
The POD data (int,float,pointer, etc.) do not have an explicit constructor but the default... | [
0.3440686762332916,
-0.08540444076061249,
0.030599193647503853,
0.14479206502437592,
0.13522280752658844,
-0.12713392078876495,
0.17333951592445374,
-0.11408296227455139,
-0.1023089736700058,
-0.4791562259197235,
-0.27031072974205017,
0.618592381477356,
-0.5088378190994263,
0.1484050303697... | |
you cheat and explicitly declare one but don't define it)).
The default implementation is:
### Destructor:
* If user-defined destructor is defined, execute the code provided.
* Call the destructor of each member in reverse order of declaration
* Call the destructor of the base class.
### Copy Constructor:
* Call... | [
0.22162409126758575,
-0.19060617685317993,
0.067695751786232,
-0.0923377126455307,
0.23654146492481232,
0.0453035905957222,
0.3059955835342407,
-0.15487954020500183,
0.11974374949932098,
-0.6279686689376831,
-0.14061178267002106,
0.9140818119049072,
-0.4898780286312103,
0.16225655376911163... | |
copying the data (Hence the shallow copy problem associated with RAW pointers).
Move
----
If no destructor/copy Constructor/Copy Assignment/Move Constructor/Move Assignment operator is defined the compiler builds the move operators for you one of those for you.
The default implementation is:
Implicitly-declared m... | [
0.14712978899478912,
-0.17018142342567444,
0.3498130440711975,
0.04511331766843796,
-0.07807186245918274,
0.11325706541538239,
-0.09160775691270828,
0.04713067784905434,
-0.10177299380302429,
-0.49904316663742065,
-0.14465105533599854,
0.3861047029495239,
-0.6431031227111816,
0.07646182924... | |
variable in the order of declaration.
* Return a reference to this. | [
0.16018903255462646,
0.1353195607662201,
0.14865903556346893,
-0.03209640830755234,
-0.19824674725532532,
-0.050257861614227295,
-0.05181911960244179,
-0.06258534640073776,
-0.12985515594482422,
-0.026538019999861717,
-0.20645378530025482,
0.4974057078361511,
-0.27739253640174866,
0.440510... | |
Are there any code linting tools for ObjectiveC?
Have a look at the [**LLVM/Clang Static Analyzer**](https://clang.llvm.org/docs/UsersManual.html#controlling-static-analyzer-diagnostics)
The LLVM/Clang static analyzer is a standalone tool that find bugs in C and Objective-C programs and it is very early in development... | [
0.08694921433925629,
0.2049652487039566,
0.4741817116737366,
0.024478081613779068,
0.07025950402021408,
-0.2146620750427246,
-0.08820679783821106,
-0.26507511734962463,
-0.2399967610836029,
-0.37074336409568787,
0.22891837358474731,
0.46508124470710754,
-0.7013433575630188,
-0.149854853749... | |
I'm getting this warning in my Test::Unit output...
```
/usr/local/bin/ruby -I.:lib:test -rtest/unit -e "%w[test/functional/sessions_controller_test.rb].each { |f| require f }" | unit_diff -u
Loaded suite -e
Started
.../Users/ethan/project/mtc/contactdb/app/views/sessions/new.html.haml:30: warning: multiple values for... | [
-0.03761093690991402,
0.38817039132118225,
0.3819895386695862,
-0.27141380310058594,
-0.017994217574596405,
-0.003286332357674837,
0.6636526584625244,
-0.4463312029838562,
-0.5060232281684875,
-0.499760240316391,
-0.20012827217578888,
0.43205782771110535,
-0.39348357915878296,
-0.005725921... | |
API docs for `form_tag`. It seems like my code is following what they have in the examples.
The `form_tag` block takes no parameters. So remove the `|f|` and the warning should go away. | [
0.4682481586933136,
0.0594092458486557,
0.11920666694641113,
-0.34056946635246277,
0.14219930768013,
-0.3163740932941437,
0.4448802173137665,
0.20872193574905396,
-0.049880724400281906,
-0.1952490210533142,
-0.22332577407360077,
0.6405183672904968,
-0.5845799446105957,
0.2803969085216522,
... | |
Is there an easy way to get only the unique values out of a list of strings in C#? My google-fu is failing me today.
(I know I can put them in another structure and pull them out again. I'm looking for stupidly-easy, like Ruby's .uniq method. C# has bloody well everything else, so I'm probably just using the wrong syn... | [
-0.058402519673109055,
0.17892515659332275,
0.2968541085720062,
-0.10899356007575989,
-0.22313718497753143,
-0.3118036985397339,
0.19146816432476044,
-0.0607064850628376,
-0.43218135833740234,
-0.3943469524383545,
-0.14499984681606293,
0.5693747401237488,
-0.41068294644355774,
-0.016281276... | |
I am trying to display a single item (not contained in a collection) using a DataTemplate. Here's what I've got so far, which is displaying nothing. Replacing `ItemsControl` with `ListBox` displays an empty listbox (so I know the element is there).
```
<ItemsControl
ItemsSource="{Binding Session}"
... | [
0.07227923721075058,
0.07828954607248306,
0.19044212996959686,
-0.1873372346162796,
-0.22058740258216858,
-0.04582016170024872,
0.3532625436782837,
-0.2622370719909668,
-0.4683779776096344,
-0.7798325419425964,
-0.1217072382569313,
0.34131428599357605,
-0.3627901077270508,
0.21785946190357... | |
displaying the same information elsewhere in my app and wanted the presentation style defined as a resource so I can update it in one place.
Any ideas, or should I create a 1-element collection in my ViewModel and bind to that?
*Edit: This is what I ended up doing, although the answer below is also a solution. I'm qu... | [
0.30766865611076355,
0.12191618233919144,
0.3416772186756134,
0.1480100452899933,
-0.005753374192863703,
-0.18883632123470306,
0.14983613789081573,
-0.15486042201519012,
-0.4009530544281006,
-0.656065046787262,
0.0385843887925148,
0.25987735390663147,
-0.31995993852615356,
-0.1509763896465... | |
ItemsSource="{Binding Session_ListSource}"
ItemTemplate="{StaticResource SessionHeaderDataTemplate}" />
```
ViewModel:
```
private Session m_Session;
public Session Session
{
get { return m_Session; }
set
{
if (m_Session != value)
{ | [
-0.23280516266822815,
-0.2610161006450653,
0.6412832140922546,
-0.056615374982357025,
0.03526359051465988,
0.028444496914744377,
0.3703002333641052,
-0.30600878596305847,
-0.43667271733283997,
-0.5180197954177856,
-0.4468556344509125,
0.5815056562423706,
-0.13107752799987793,
0.24368539452... | |
m_Session = value;
OnPropertyChanged("Session");
// Added these two lines
Session_ListSource.Clear();
Session_ListSource.Add(this.Session);
}
} | [
-0.10157417505979538,
-0.20996299386024475,
0.593728244304657,
-0.40243270993232727,
0.3904130458831787,
0.07394178956747055,
0.40225717425346375,
0.015249153599143028,
-0.585115909576416,
-0.3834811747074127,
-0.3772859573364258,
0.617286741733551,
-0.3416208028793335,
0.34017735719680786... | |
}
// Added this property.
private ObservableCollection<Session> m_Session_ListSource = new ObservableCollection<Session>();
public ObservableCollection<Session> Session_ListSource
{
get { return m_Session_ListSource; }
set
{
if (m_Session_ListSource != value)
... | [
-0.33239853382110596,
-0.02989908494055271,
0.754957377910614,
-0.268396258354187,
0.3353652358055115,
-0.07591253519058228,
0.37395063042640686,
-0.256779283285141,
-0.48056918382644653,
-0.5157555937767029,
-0.5124598741531372,
0.9066995978355408,
-0.39189520478248596,
0.0254048164933919... | |
m_Session_ListSource = value;
OnPropertyChanged("Session_ListSource");
}
}
}
```
Stick with your datatemplates for simple views with no code behind instead of having to create another user controls. Use a ContentControl to display your DataTemplate for a single item.
```
<Cont... | [
-0.007785900495946407,
-0.05882660672068596,
0.7687354683876038,
0.010139199905097485,
0.06552194803953171,
-0.23148345947265625,
0.31543269753456116,
-0.32549726963043213,
-0.7013526558876038,
-0.6241618394851685,
-0.2968772351741791,
0.8195193409919739,
-0.3257383704185486,
-0.0177279245... | |
I'm a XAML/WPF newbie, and I thought I'd write an alarm clock application to get into it. I want to get past the basic textboxes, dropdowns etc, which are fairly simple once you get the hang of the layout model, but I'd like to get into the graphics side of things.
I'd like to display alarm clock digits on a black bac... | [
0.9149965047836304,
0.35375770926475525,
0.16265112161636353,
-0.04003126174211502,
0.2535077929496765,
0.06296650320291519,
-0.28738486766815186,
0.1758987009525299,
-0.151779904961586,
-0.5032795071601868,
0.3997843563556671,
0.28282150626182556,
-0.03853617236018181,
0.07855729013681412... | |
for inspiration but struggling a little.
Take a look at the [XAML Reflections](http://windowsclient.net/downloads/folders/wpfsamples/entry3741.aspx) sample on the [WindowsClient.net](http://windowsclient.net/).
If you need more samples, the WindowsClient site also has a [Control Gallery](http://windowsclient.net/downl... | [
0.3323952257633209,
-0.3311741352081299,
-0.1557070016860962,
0.564010739326477,
-0.0945838987827301,
0.1537814438343048,
0.008442721329629421,
-0.17414560914039612,
-0.319534569978714,
-0.4515397846698761,
0.08393693715333939,
0.22451063990592957,
0.028180742636322975,
-0.0208460316061973... | |
I would like to remove all unused CSS selectors from a common CSS file. While the Firefox extension "Dust Me Selectors" works well, it only works per page. It reports unused selectors for a page but some could be used on other pages.
Is there a tool which can go through a folder, scan all the files and bring up a list... | [
0.4922676086425781,
-0.08912824094295502,
0.07312260568141937,
0.11583049595355988,
-0.1938108652830124,
-0.3926883339881897,
-0.0029817644972354174,
-0.009202073328197002,
-0.34555739164352417,
-0.8424047231674194,
0.36620593070983887,
0.01767929084599018,
-0.4348040819168091,
0.190258935... | |
Imagine I want to create an application which is very similar to MS Word 2007, using C++ in VS2008 and the MFC Feature Pack. For the ribbon, there are 3 options available to me:
1. **Use the ribbon from MFC Feature Pack without acquiring a license.**
Probably dodgy in the long run. You're all right until your produ... | [
0.3130083680152893,
0.06177171319723129,
0.47193169593811035,
-0.052046604454517365,
0.17883552610874176,
0.3239668309688568,
0.07264919579029083,
0.09571313112974167,
-0.27914664149284363,
-0.6230894327163696,
0.30164197087287903,
0.4672284722328186,
-0.1273394525051117,
0.242073655128479... | |
to register an [Office UI License](http://msdn.microsoft.com/en-us/office/aa973809.aspx), the chances are that I would be turned down because it is a competing product:
> *The license is available for applications on any platform, except for applications that compete directly with the five Office applications that cur... | [
0.37086567282676697,
0.23302392661571503,
1.0658057928085327,
0.04541609063744545,
0.2636870741844177,
0.11543670296669006,
0.12105119228363037,
-0.1262534260749817,
-0.18990962207317352,
-0.3271959125995636,
-0.19356350600719452,
0.09880084544420242,
-0.04100111871957779,
0.31024464964866... | |
with no problem.
I don't want to spend any money unless absolutely necessary. How about if I use option #1 until I get hassled about it, at which point I could ditch it and go for #3? Would it be too late?
Of course all the above is hypothetical... ;)
---
***Note:*** I don't care about any patents or copyrights rel... | [
0.5525766611099243,
-0.1470070779323578,
0.6964418888092041,
0.08631814271211624,
-0.0763976126909256,
0.2003009170293808,
0.05220992490649223,
0.009073315188288689,
-0.12740352749824524,
-0.5257018804550171,
0.27871620655059814,
0.5237017869949341,
-0.08586977422237396,
0.4109286069869995... | |
as long as it's not a "competing product", whatever that means.
In the context of my theoretical question, I would certainly be a competitor, and so I'd say it's too risky to use any kind of ribbon.
Of course in real life, whether or not you're a competitor isn't quite so black and white. I'd probably go with Option ... | [
0.5275912880897522,
0.018712246790528297,
0.5958657264709473,
0.10051726549863815,
0.34712114930152893,
-0.18592369556427002,
-0.03996914625167847,
-0.2585625648498535,
-0.15545757114887238,
-0.33036983013153076,
-0.09788184612989426,
0.6042066216468811,
0.20870544016361237,
0.308784365653... | |
currently have the
> ribbon in office. That's Word, Excel,
> Powerpoint, Outlook and Access."
The word *primary* gives the impression that a product containing a rich-text editor could have a ribbon bar on it, as long as the product's main purpose is different to Word. e.g. a version control system which allowed ric... | [
0.09301560372114182,
0.09384861588478088,
0.7412062883377075,
-0.0006682252860628068,
-0.018619846552610397,
0.09977157413959503,
-0.04804489389061928,
0.20615510642528534,
-0.464388906955719,
-0.7064599394798279,
-0.26840895414352417,
0.2602863609790802,
0.04770738631486893,
0.45250546932... | |
I have a Tree.
```
class TreeNode {
public TreeNode(string name, string description) {
Name = name;
Description = description;
}
string Name { get; set; }
string Description { get; set; }
public List<TreeNode> Children = new List<TreeNode>();
}
```
I would like to populate a larg... | [
0.39356729388237,
0.12492977827787399,
-0.015582713298499584,
0.18655307590961456,
0.05216895416378975,
0.056705404072999954,
0.2135651707649231,
-0.10886454582214355,
-0.40491700172424316,
-0.5337821841239929,
-0.27264368534088135,
-0.05143488571047783,
-0.019853977486491203,
0.2950145006... | |
1, desc1
Grandchild 1, desc1
Child 2, desc2
```
How would you go about populating the tree in an elegant an maintainable way?
I find this code quite repetitious and error prone:
```
var parent = new TreeNode("Parent", "desc");
var child1 = new TreeNode("Child 1", "desc1");
var child2 = new TreeNode("Child 2... | [
-0.14896713197231293,
-0.002948884619399905,
0.4158218801021576,
0.09993133693933487,
-0.013920240104198456,
0.2952520251274109,
0.4829614758491516,
-0.41269952058792114,
-0.17400828003883362,
-0.6838930249214172,
-0.3876916170120239,
0.3151300251483917,
-0.08509248495101929,
0.09808748960... | |
to find another approach.
* You can fabricate an **internal DSL**, typically with a **fluent interface**.
* Follow the [`XElement` example of **functional construction**](http://msdn.microsoft.com/en-us/library/bb387019.aspx).
* Create an **external DSL** with a custom parser. If you design the language carefully, the ... | [
0.3620338439941406,
0.0006741433753632009,
0.33019793033599854,
0.2116694152355194,
-0.33809423446655273,
-0.14534683525562286,
0.3976593315601349,
0.015069744549691677,
-0.25838738679885864,
-0.7255008816719055,
-0.22721223533153534,
0.5899250507354736,
-0.38206616044044495,
0.13042356073... | |
easy to swap data around by changing files, and easier to ready file change histories. Finally, and external DSL is good when a non-programmer will be supplying the data.
The tradeoff here is time vs. value. **How much data you will have / how often it will change / who will change it** are the questions you have to a... | [
0.32135558128356934,
-0.408572256565094,
0.3593057692050934,
0.4420930743217468,
0.29130539298057556,
-0.16554492712020874,
-0.20227168500423431,
-0.06731130927801132,
-0.3776552975177765,
-0.6903398633003235,
0.0236679557710886,
0.7076189517974854,
0.16485092043876648,
-0.0555474311113357... | |
If I add a new case class, does that mean I need to search through all of the pattern matching code and find out where the new class needs to be handled? I've been learning the language recently, and as I read about some of the arguments for and against pattern matching, I've been confused about where it should be used... | [
0.10133883357048035,
-0.14766082167625427,
0.1233629435300827,
-0.10680341720581055,
-0.17139413952827454,
0.3889426290988922,
0.19602015614509583,
-0.2359275072813034,
-0.05889859050512314,
-0.8556979298591614,
0.08705473691225052,
0.44162601232528687,
-0.3804347813129425,
-0.160028278827... | |
use it," but what are some positive use cases for it and what are some negative ones?
Jeff, I think you have the right intuition: it depends.
Object-oriented class hierarchies with virtual method dispatch are good when you have a relatively fixed set of methods that need to be implemented, but many potential subclasse... | [
0.29442402720451355,
-0.10914208739995956,
-0.2046431005001068,
0.6288123726844788,
0.19330260157585144,
-0.23528017103672028,
0.12889966368675232,
0.17250947654247284,
-0.14876556396484375,
-0.6160619854927063,
0.0180410947650671,
0.7235145568847656,
-0.06130304932594299,
-0.1166092082858... | |
implement the new method).
Data types with functionality based on pattern matching are good when you have a relatively fixed set of classes that belong to a data type, but many potential functions that operate on that data type. In such a setup, it's relatively easy to add new functionality for a data type (just patte... | [
0.3033061623573303,
-0.14274592697620392,
0.15344937145709991,
0.4581461250782013,
0.056140344589948654,
-0.2609519064426422,
0.39913782477378845,
-0.5811339616775513,
-0.11469082534313202,
-0.7119806408882141,
-0.18467162549495697,
0.6528146266937256,
-0.46447354555130005,
-0.077603615820... | |
OO approach is GUI programming. GUI elements need to support very little functionality (drawing themselves on the screen is the bare minimum), but new GUI elements are added all the time (buttons, tables, charts, sliders, etc). The canonical example for the pattern matching approach is a compiler. Programming languages... | [
-0.06646119058132172,
-0.08266930282115936,
0.17382773756980896,
0.11582697927951813,
0.13165131211280823,
0.058484625071287155,
-0.4487321972846985,
0.007385248318314552,
-0.103765107691288,
-0.8429161310195923,
-0.22608539462089539,
0.383728563785553,
-0.4442584812641144,
-0.428099960088... | |
method dispatch. Regular classes support virtual method dispatch and can be pattern matched by defining an extractor in the corresponding companion object. It's up to the programmer to decide when each approach is appropriate, but I think both are useful. | [
-0.17525988817214966,
-0.41644591093063354,
0.028313348069787025,
0.5110698938369751,
-0.14537149667739868,
-0.13069632649421692,
-0.031172601506114006,
0.06991346925497055,
-0.005444047506898642,
-0.4452372193336487,
-0.10795864462852478,
0.56754070520401,
-0.22775068879127502,
-0.2522848... | |
My project requires me to validate a large number of web URLs. These URLs have been captured by a very unreliable process which I do not control. All of the URLs have already been regexp validated and are known to be well-formed. I also know that they all have valid TLDs
I want to be able to filter these URLs quickly ... | [
0.6329873204231262,
0.3785063922405243,
0.20400755107402802,
0.41085031628608704,
-0.005781067069619894,
-0.4733087122440338,
0.4111229181289673,
0.015098011121153831,
-0.09978476911783218,
-0.38159021735191345,
0.010623452253639698,
0.19941526651382446,
0.04975410923361778,
0.427236735820... | |
a 404 error).
Given that there are a lot of these I do not want to download the entire page, just the HTTP header and then take a good guess from the content of the header whether the page is likely to exist.
Can it be done?
To really make this fast you might also use [eventlet](http://pypi.python.org/pypi/eventlet) ... | [
0.3318907916545868,
-0.28171584010124207,
0.39598456025123596,
0.44130387902259827,
-0.002740667900070548,
-0.4320143163204193,
0.34136515855789185,
0.043506741523742676,
-0.2870008647441864,
-0.7046632766723633,
-0.15384382009506226,
0.5639318227767944,
-0.14054523408412933,
-0.1197948232... | |
you should get pretty much concurrency by using a coroutines pool. | [
0.15422117710113525,
0.15829059481620789,
0.2318340539932251,
0.4345587491989136,
0.02329888381063938,
-0.18639960885047913,
0.027822274714708328,
0.25053858757019043,
-0.5482863783836365,
-0.3768472373485565,
0.48773396015167236,
0.47297802567481995,
-0.40941816568374634,
0.04169213399291... | |
Silverlight 2.0 has been out for a little while now. What are the concepts that you often see used incorrectly or think are misunderstood?
I think its early days yet to have established a large enough set of instances of "usage" to determine those concepts which can be said to be "often" misunderstood. | [
0.6217536926269531,
0.18972668051719666,
0.3894248604774475,
-0.048925820738077164,
-0.32774850726127625,
-0.7450121641159058,
0.22028686106204987,
0.4332609474658966,
0.11534719914197922,
-0.45183825492858887,
0.39359524846076965,
0.4104159474372864,
-0.20261333882808685,
0.03030448779463... | |
Hey guys, I'm researching something for a friend of mine who's involved in road construction. He needs some sort of a device that he can use to measure distance or area between points. I have done some GPS programming in the past but for mobile devices and i wasn't too impressed with accuracy. That was quite a few year... | [
0.8816404938697815,
0.3533388674259186,
0.4005599021911621,
0.07932776212692261,
-0.005166580900549889,
0.03992513567209244,
0.2672974169254303,
0.42790141701698303,
-0.16512079536914825,
-0.446239709854126,
0.6603338122367859,
0.3333594501018524,
0.01937566138803959,
0.03049817681312561,
... | |
application on it, something that hooks up through a USB port would maybe work? I found u-blox PCI hard that works with laptops and PCs. Has anyone on here had any experience with it? Perhaps there are other devices i'd need to look into?
I appreciate any help i can get on this. Thank you.
If you really need to embed ... | [
0.32257166504859924,
-0.273000568151474,
0.2782053053379059,
0.5109817385673523,
0.1389739215373993,
0.17822858691215515,
0.0647626519203186,
0.04641998931765556,
-0.07091651111841202,
-0.48340144753456116,
0.7124146819114685,
0.785339891910553,
0.03950067609548569,
0.19954925775527954,
... | |
once it's warmed up and it mounts like a disk on Linux, OS X and Windows where you can just pull the logs off and process them. You can use GPSBabel to convert them into whatever format you need, though the default is NMEA.
If someone else has a better solution I'd be curious to hear it too - affordable GPS toys for p... | [
0.2840871214866638,
0.142295703291893,
0.5102941989898682,
0.31475916504859924,
0.31289932131767273,
-0.3588887155056,
-0.07413581013679504,
0.4304945468902588,
0.1153845340013504,
-0.6647183299064636,
0.05117374286055565,
0.780507504940033,
0.23758462071418762,
-0.026711566373705864,
0.... | |
I'm trying to fix the test suite on an project which I've inherited from another programmer for some java database code. The project itself is using hibernate and MySQL for the DB stuff, but for the purposes of the test cases dbunit is being used. I can correctly load and initialize hibernate's session factory, but I k... | [
0.5672045946121216,
0.1793137937784195,
-0.08970239758491516,
-0.06433246284723282,
-0.1323707401752472,
-0.2773837745189667,
0.39207419753074646,
-0.05330786108970642,
-0.023548472672700882,
-0.821116030216217,
0.1609952449798584,
0.46582797169685364,
-0.2518061697483063,
0.24207749962806... | |
method in the database test case base class looks like this:
```
@Override
protected void setUp() throws Exception {
super.setUp();
IDataSet dataSet = new FlatXmlDataSet(new File(mDataFile));
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
session.beginTransaction();
IDat... | [
0.12987415492534637,
-0.03686605393886566,
0.43253371119499207,
-0.044889964163303375,
0.10188843309879303,
-0.01773112267255783,
0.40355464816093445,
-0.6093834638595581,
0.06278232485055923,
-0.6772604584693909,
-0.07537047564983368,
0.5095859169960022,
-0.34260496497154236,
0.3527596890... | |
XML schema by hand and with Eclipse, even going to the point of making sure the ordering of the tables in the two files matched. I'd rather not paste those files in here (as it would involve a lot of search-replacing), but trust me that I've looked through dbunit examples and made sure that the syntax matches.
Any ide... | [
0.5371949076652527,
0.12139803916215897,
0.1177474707365036,
0.17417964339256287,
-0.26691558957099915,
-0.1534079760313034,
0.33264052867889404,
-0.021651625633239746,
-0.19656692445278168,
-0.7000529766082764,
-0.012949042953550816,
0.27707231044769287,
-0.060256388038396835,
-0.00524787... | |
see that all of my tables are actually in there, along with all of the test data. So at least that part seems to be working correctly.
@Bogdan: Hrm... good idea. I'll try loading the data with a regular INSERT.
@sleske: Also a good suggestion. Thanks for the hints; hopefully this will set me on the right path to fixin... | [
0.6135517358779907,
0.19338594377040863,
0.3170401155948639,
0.2539388835430145,
-0.21149785816669464,
-0.07126418501138687,
0.3539884388446808,
0.29657241702079773,
-0.2021552175283432,
-0.40476906299591064,
0.1281348615884781,
0.4961843490600586,
-0.23367923498153687,
0.01358921267092228... | |
call instead. There doesn't seem to be much of a performance trade-off.
For reference I'm doing about 30-60 requests of about 5K-30K per request per second on a quad core machine from another quad core machine. WCF has been holding up quite well so far. | [
0.5249395966529846,
-0.2082938849925995,
0.41433167457580566,
0.15892070531845093,
-0.1443876177072525,
-0.1677168309688568,
0.3429880738258362,
0.04535993933677673,
-0.24404843151569366,
-0.7527883052825928,
0.20124424993991852,
0.7496356964111328,
-0.06093564257025719,
0.1596615910530090... | |
I have an ASP.Net page with a C# code behind.
However, I've been asked to not use a code behind - so that it will be easier to deploy in SharePoint.
Is there a way to include the C# code in the ASP.Net page, without using a separate code behind file?
By default Sharepoint does not allow server-side code to be execut... | [
0.45909059047698975,
0.1298724263906479,
-0.17006754875183105,
-0.18568748235702515,
-0.1433519870042801,
-0.15823571383953094,
0.22868937253952026,
-0.13325302302837372,
-0.19511856138706207,
-0.5362042784690857,
-0.018277883529663086,
0.2495488077402115,
0.0207423847168684,
-0.0706962347... | |
it using a [solution](http://msdn.microsoft.com/en-us/library/aa543214.aspx).
If still no, you can include all the code you'd normally place in a codebehind like so:
```
<script language="c#" runat="server">
public void Page_Load(object sender, EventArgs e)
{
//hello, world!
}
</script>
``` | [
0.08764363825321198,
-0.14822235703468323,
0.446878045797348,
0.09959299862384796,
0.19761048257350922,
-0.19243626296520233,
0.28090333938598633,
0.08972775936126709,
-0.19904355704784393,
-0.6666894555091858,
-0.34058481454849243,
0.24137359857559204,
-0.37784722447395325,
0.272343993186... | |
**Note:** This question originally asked in 2009, when powershell did not have support for the `&&` operator.
In 2019, per Jay's answer, microsoft added support for `&&` and `||` in Powershell 7.
<https://stackoverflow.com/a/564092/234>
---
Original Question
`&&` is notoriously hard to search for on Google Search, b... | [
0.554286777973175,
0.30322808027267456,
0.5646038055419922,
-0.13382412493228912,
0.11226765811443329,
-0.22539278864860535,
0.2869317829608917,
0.21034477651119232,
-0.24128946661949158,
-0.3758326768875122,
-0.19044508039951324,
0.4566214978694916,
-0.16156908869743347,
0.015741517767310... | |
&& a.exe
```
---
If you just want to run multiple commands on a single line and you don't care if the first one fails or not, you can use `;` For most of my purposes this is fine.
For example: `kill -n myapp; ./myapp.exe`.
In CMD, '&&' means "execute command 1, and if it succeeds, execute command 2". I have used it... | [
0.5368544459342957,
0.06309925019741058,
0.13004907965660095,
-0.2005244344472885,
0.017667287960648537,
-0.2259211391210556,
0.3418765068054199,
-0.0919964537024498,
-0.13221514225006104,
-0.31098607182502747,
0.050314322113990784,
0.7874729633331299,
-0.36543720960617065,
-0.168136909604... | |
you will probably be better off separating the statements, like this:
```
build
if ($?) {
run_tests
}
```
**2019/11/27**: The `&&`operator is now available for [PowerShell 7 Preview 5+](https://github.com/PowerShell/PowerShell#get-powershell):
```
PS > echo "Hello!" && echo "World!"
Hello!
World!
``` | [
0.21014685928821564,
0.01802190952003002,
0.3095080256462097,
0.00470455689355731,
0.18925359845161438,
-0.2298458218574524,
0.5516808032989502,
-0.20697104930877686,
-0.17747996747493744,
-0.32754045724868774,
-0.40564775466918945,
0.4641335606575012,
-0.48231711983680725,
0.1826948076486... | |
Is there any way to know in C# the type of application that is running.
Windows Service
ASP.NET
Windows Form
Console
I would like to react to the application type but cannot find a way to determine it.
You should have the client code tell your code what the context is and then work from that. At best, you will be abl... | [
0.3941110372543335,
-0.061269909143447876,
0.4012865126132965,
0.033654455095529556,
-0.1875547170639038,
-0.18810631334781647,
0.15225385129451752,
0.05303606763482094,
-0.2865842282772064,
-0.8729776740074158,
-0.09044817835092545,
0.4775777757167816,
-0.11488760262727737,
-0.00738692656... | |
Presentation Foundation, see if the static Current property on the Application class is not null.
* For a service, there really is no way to determine this, since services do not have to register process handles, thread handles, or the like.
* For console windows, if none of the above is true, then I would assume this ... | [
0.1294018030166626,
0.0341675691306591,
-0.025733914226293564,
0.165437251329422,
-0.2551344931125641,
-0.35596030950546265,
0.33033493161201477,
0.0959058478474617,
-0.3427145183086395,
-0.7020146250724792,
0.1294311136007309,
0.3425997197628021,
-0.3175577223300934,
0.3230799436569214,
... | |
I have a windows service that reads from app.config.
I want some settings to be encrypted, however, I don't want to use the ProtectedConfigurationProvider classes provided in .NET because they encrypt files based on the machine they are running on using DPAPI.
What I wanted was a way for our administrator to deploy t... | [
0.5493468046188354,
0.18539053201675415,
0.1366499960422516,
0.041380878537893295,
0.20433861017227173,
-0.07137852907180786,
0.3300180733203888,
0.22953227162361145,
-0.06417219340801239,
-0.9089176058769226,
-0.0781891942024231,
0.7355270981788635,
-0.2172069251537323,
0.1654566079378128... | |
given an encrypted file
* and you want to decrypt the file
* without hard-coding the key
the obvious solution is to ask for the key when needed from a trusted third party | [
0.08734460175037384,
0.053513359278440475,
-0.1469423770904541,
0.288131445646286,
0.20377881824970245,
0.011278132908046246,
0.4192142188549042,
-0.13192462921142578,
-0.03103218786418438,
-0.34775257110595703,
-0.6410138607025146,
0.39221543073654175,
-0.09814943373203278,
0.061269424855... | |
I want to convert my String object to Enumerable of its 1-sized substrings (not chars), how can I do this efficiently in Ruby?
```
"xyzzy".split(//) => ["x", "y", "z", "z", "y"]
``` | [
0.3924453556537628,
-0.03304066136479378,
0.008110427297651768,
-0.09411103278398514,
-0.09191206097602844,
0.13932403922080994,
0.43823161721229553,
-0.03961709886789322,
0.06175132840871811,
-0.45003312826156616,
-0.21608911454677582,
0.24536240100860596,
-0.4801032245159149,
0.164772480... | |
I'm a bit scared to ask this question as it may start a religous war so I want to be really clear on what I'm looking for. I'm looking for a reason(s) why you would or have jumped one way or the other and also for items to add to my lists. I'm looking for the big ticket, big bang items. Also, items specific to a produc... | [
0.7178539633750916,
0.07031923532485962,
0.08512575179338455,
0.40032753348350525,
-0.05182887613773346,
-0.09511059522628784,
-0.43605953454971313,
0.07126583904027939,
-0.38734933733940125,
-0.27671700716018677,
0.07111307978630066,
0.3950856924057007,
-0.002367835957556963,
0.1946890950... | |
- Additional features for "free" (no developer effort)
```
Hand Coded Advantages
```
- More Efficient (at runtime, maybe not at dev time?)
- Less layers of complexity
- Most ORMS seem to struggle with being retricted to sprocs only
```
In the interests of full disclosure, I really don't like the idea of "somet... | [
0.29046377539634705,
0.31966251134872437,
0.27965205907821655,
0.0899217277765274,
-0.011882743798196316,
-0.34953561425209045,
0.4817711114883423,
0.03252240642905235,
-0.2775273621082306,
-0.5218648910522461,
-0.29305389523506165,
0.583949863910675,
0.04343375563621521,
0.010475851595401... | |
the questions and reinforce the point about performance)
So, to alter my question slightly
Has any built an app using an ORM in the early stages and then gradually replaced with with a handcoded DAL? What were the pitfalls of this approach?
[Further Edit - getting to the heart of the problem now]
Having a website be... | [
0.3205326497554779,
0.07058985531330109,
0.2030463069677353,
0.13766838610172272,
-0.031845442950725555,
0.07884407043457031,
0.08298029005527496,
-0.060436349362134933,
-0.3212483525276184,
-0.2977011799812317,
0.13319215178489685,
0.14734633266925812,
-0.4007534980773926,
-0.189302995800... | |
JPA ever since the day it went into production we have regretted it. The amount of database calls being made by the ORM were astronomical, so we have now started the process of piece-meal rewriting the application using good ol' fashioned JDBC utilizing Spring's JDBC helper classes. The pitfalls of starting with an ORM... | [
0.2625582814216614,
0.34889674186706543,
-0.16751766204833984,
-0.02831881493330002,
-0.24626685678958893,
0.08183331042528152,
0.14856140315532684,
-0.09941325336694717,
-0.07338511943817139,
-0.16399411857128143,
0.09792447835206985,
0.2511046230792999,
-0.3183678090572357,
0.00482449587... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.