text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
protected override void CreateChildControls()
{
Controls.Clear();
Controls.Add(button);
}
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
StringBuilder _text = new StringBuilder(); | [
-0.12213311344385147,
-0.25106480717658997,
0.5307161808013916,
-0.24783207476139069,
0.610304057598114,
-0.10850115865468979,
0.596947431564331,
-0.6117373704910278,
0.11858183145523071,
-0.3613840639591217,
-0.6579498648643494,
0.6317576766014099,
-0.2448776364326477,
0.13269685208797455... | |
_text.Append("var prm = Sys.WebForms.PageRequestManager.getInstance();");
_text.Append("prm.add_pageLoaded(function() { alert('Page Loaded'); });");
if (null != System.Web.UI.ScriptManager.GetCurrent(Page) && System.Web.UI.ScriptManager.GetCurrent(Page).IsInAsyncPostBack)
System... | [
-0.3000296950340271,
-0.21677756309509277,
1.00981605052948,
-0.24846212565898895,
0.06144315376877785,
0.22664017975330353,
0.3938177227973938,
-0.5421423316001892,
-0.37044546008110046,
-0.6564474105834961,
-0.585516631603241,
0.5424720048904419,
-0.5318178534507751,
0.04671868681907654,... | |
}
}
}
```
Because the sign is a descendant element of the heading, not a sibling, use [`find`](http://api.jquery.com/find/) instead of [`next`](http://api.jquery.com/next/):
```
var sign = jQuery(this).find(".sign");
sign.text(sign.text() === "[+]" ? "[−]" : "[+]");
// Note: A minus sign (−) has the same width as... | [
0.09933158755302429,
0.09171785414218903,
0.7186044454574585,
-0.3736651837825775,
0.12436513602733612,
-0.08806656301021576,
0.045150406658649445,
-0.16790737211704254,
-0.019528985023498535,
-0.6355897188186646,
-0.3070429861545563,
0.5057986378669739,
-0.14919498562812805,
-0.0270938966... | |
I have `ConcurrentMap<Integer, MyObj>` in my program.
Can I modify `MyObj` if I know a key? Without deleting and putting a new `MyObj`?
Not only that, but if you keep the original reference to the object, you can still modify it.
```
MyObject o = new MyObject();
myMap.put("key", o);
o.setName("foo");
myMap.get("key")... | [
0.033900387585163116,
0.2857038378715515,
0.8667870759963989,
-0.14109370112419128,
0.2899453938007355,
0.005991680081933737,
0.4431317448616028,
-0.08193238824605942,
-0.3728480339050293,
-0.5727200508117676,
-0.20025281608104706,
0.5376708507537842,
-0.5779076814651489,
0.341239005327224... | |
I would like to find out if a scrollView is scrolled up or down. Ideally, I'd like to have only one call if the scrollView is scrolled up or down. I tried this but it will obviously not tell me anything about the direction:
```
-(void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
NSLog(@"%.2f", scrollVi... | [
0.28131431341171265,
-0.1251906454563141,
0.9426831603050232,
-0.028387367725372314,
-0.16016732156276703,
-0.14587953686714172,
0.1937197595834732,
-0.1848306804895401,
-0.035450808703899384,
-0.8195584416389465,
0.12824499607086182,
0.8754037022590637,
-0.09907092154026031,
0.10295160859... | |
there something like scrollViewDidBeginDragging? I didn't find anything in the docs. Any smart workaround?
Create a declared property to let us know that the tableview is starting to scroll. Let's use a BOOL called `scrollViewJustStartedScrolling`.
In `scrollViewWillBeginDragging` set it to true:
```
self.scrollView... | [
0.2536197602748871,
-0.07449225336313248,
0.7504764199256897,
0.014155209995806217,
-0.18875376880168915,
-0.6272424459457397,
0.18439140915870667,
-0.14792825281620026,
0.1747744232416153,
-0.7348521947860718,
0.0982854813337326,
0.8985894322395325,
0.02388489805161953,
0.3282557725906372... | |
I'm translating the jMonkey tutorials to JRuby, and currently on the [8th](http://jmonkeyengine.org/wiki/doku.php/jme3%3abeginner%3ahello_picking) beginner. But when I run it, it keeps complaining about how there is no `settings` method or local variable defined. Is `settings` supposed to be an instance variable, metho... | [
-0.054149940609931946,
0.00030740024521946907,
0.33396586775779724,
-0.19768650829792023,
-0.2017066925764084,
-0.005741251166909933,
0.29356279969215393,
-0.15262746810913086,
-0.25827592611312866,
-0.5219361782073975,
-0.1118471771478653,
0.7446584105491638,
-0.2929361164569855,
-0.13754... | |
# argv[1] has your filename
filename = sys.argv[1]
print (filename)
# Output...
# new-host:~ yanwchan$ python3.2 test.py text.txt
# text.txt
```
`argv[0]` has `test.py`
`argv[1]` has `text.txt`
**Edit:** However, I do some more research on this topic and found out this: <https://stackoverflow.com/a/4188500... | [
0.13902337849140167,
0.17944304645061493,
0.19978424906730652,
-0.18282611668109894,
-0.38485029339790344,
-0.2920810282230377,
0.1584949493408203,
-0.43673524260520935,
-0.36573711037635803,
-0.4126697778701782,
0.07462946325540543,
0.5610640048980713,
-0.46273359656333923,
-0.13787859678... | |
Is there a javascript script that returns the *current html* of the window? I mean the content of the *webinspector* or *Firebug* html tab.
Yes -- this has been discussed previously here on StackOverflow:
[How to get the entire document HTML as a string?](https://stackoverflow.com/questions/817218/get-entire-document-... | [
0.12366548925638199,
-0.05139840021729469,
0.5046929121017456,
-0.09706000983715057,
-0.005766349378973246,
-0.2406923472881317,
0.023013832047581673,
-0.06889458000659943,
-0.5388320684432983,
-0.3982270658016205,
-0.4569739103317261,
0.5213478803634644,
-0.29608601331710815,
-0.086723186... | |
Say I have a mysql table, and I have a column of type `enum` and that column has defined set of values like `enum('a','b','c','d')`.
How would i add a value of `'e'` to this set using alter table statement?
And I want to append the new value to the end of it using `CONCAT`.
Unfortunately, you need to re-list all the ... | [
0.060356855392456055,
0.41241464018821716,
0.5557605624198914,
0.16632334887981415,
-0.09299266338348389,
-0.0732804611325264,
-0.29123151302337646,
-0.004566284362226725,
0.030211415141820908,
-0.6825966835021973,
-0.07383529841899872,
0.3074166178703308,
-0.2917250394821167,
0.2464440464... | |
I am trying to create a Rest web service running on iPhone; I've done my initial research and found
CocoaHttpServer and TouchCode json parser, is there any library / sample code which binds these together into a Rest endpoint?
If it does not exist, how do I go about writing one? Any reference to some kind of design d... | [
-0.14005088806152344,
0.12412721663713455,
0.3993355631828308,
0.04063209891319275,
0.07993537187576294,
0.0540081150829792,
0.3010219633579254,
0.2209720015525818,
-0.18040700256824493,
-0.5350151658058167,
-0.015673397108912468,
0.6218447089195251,
-0.4370232820510864,
-0.143616348505020... | |
I wrote a more generic Connection class that routes HTTP requests to different blocks for different URLs and different HTTP methods. The URL can contain parameters (with : as prefix), that get parsed. That's not a generic REST service per se, but I added (for example) a block for the url "/rest/:entityname" that fetche... | [
-0.02894381247460842,
0.10986900329589844,
0.31881096959114075,
0.13717588782310486,
-0.23159314692020416,
0.027774246409535408,
0.30561262369155884,
-0.05323461443185806,
-0.2882022559642792,
-0.601672351360321,
-0.1136903464794159,
0.060944393277168274,
-0.393422931432724,
0.402835905551... | |
I am trying to produce true random number in c++ with C++ TR1.
However, when run my program again, it produces same random numbers.The code is below.
I need true random number for each run as random as possible.
```
std::tr1::mt19937 eng;
std::tr1::uniform_real<double> unif(0, 1);
unif(eng);
```
You have to initi... | [
-0.04977792128920555,
-0.02729523740708828,
0.15965595841407776,
0.1154656782746315,
-0.21432693302631378,
-0.03876105323433876,
0.047785043716430664,
-0.2438267022371292,
-0.14613431692123413,
-0.5361738204956055,
0.18559576570987701,
0.553253173828125,
-0.45091113448143005,
0.29391801357... | |
period of 219937-1 iterations. True randomness is hard to achieve, as you would have to monitor something that doesn't seem deterministic (user input, atmospheric noise). See [Jerry's](https://stackoverflow.com/a/10047328/1139697) and [Handprint's answer](https://stackoverflow.com/a/10047398/1139697).
If you don't wan... | [
0.07410179078578949,
-0.4993743300437927,
0.41813722252845764,
0.17858539521694183,
-0.07159827649593353,
0.044807277619838715,
0.026670673862099648,
-0.4259140193462372,
-0.3308106064796448,
-0.1574411392211914,
0.18082058429718018,
0.08554592728614807,
0.13330723345279694,
0.296096146106... | |
I have SQL Server 2005 and Visual Studio 2005 installed on my desktop.
Every time I run SQL Server 2005, I have to go for "***RUN AS ADMINISTRATOR***" manually. I have tried changing the settings but no go. So I do it that way only.
But anyways, that's not the actual issue.
Now when I am making a connection string in ... | [
0.22184449434280396,
0.35494810342788696,
0.35020262002944946,
-0.426332950592041,
-0.24203307926654816,
-0.1291973739862442,
0.623958170413971,
-0.009703453630208969,
-0.1313522756099701,
-0.7558448910713196,
0.19504129886627197,
0.7576013207435608,
-0.1696678102016449,
0.4541051089763641... | |
Console.WriteLine("Hello World!!!");
SqlConnection con = new SqlConnection("Data Source=.; Initial Catalog=VinOne; Integrated Security=True");
SqlCommand cmd = new SqlCommand("select * from Prod", con);
con.Open();
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
... | [
-0.25633296370506287,
-0.14732767641544342,
0.8694148063659668,
-0.004252490121871233,
0.23131000995635986,
-0.05348372831940651,
0.2936348021030426,
0.052253786474466324,
-0.02552921511232853,
-0.5395233035087585,
-0.3280544877052307,
0.4842386543750763,
-0.20070117712020874,
0.3711700737... | |
Console.Read();
}
}
```
Ok,
So after pulling my hair out, I finally figured out.
I have to change the build configuration to release in VS do a rebuild and then do publish because apparently the **azure project does not do rebuild on the project when you publish it.** | [
0.4631989002227783,
0.11249671876430511,
0.36321038007736206,
0.1048477366566658,
0.1685556024312973,
-0.0826769545674324,
0.5344191193580627,
-0.14986461400985718,
0.15078522264957428,
-0.8757264018058777,
-0.050504419952631,
0.7597476243972778,
-0.0075491988100111485,
0.28051498532295227... | |
My app runs on localhost:3000 on my mac
My mac has its own local address eee.local
Other computers in the office, including other windows machines
can connect to eee.local:3000 and use the the rails app.
However we had once case where one person's windows7 machine
could not connect. I brought a brand new windows7 mac... | [
0.44428184628486633,
0.3369602859020233,
0.34704649448394775,
0.01111073698848486,
0.08322183787822723,
0.4657861888408661,
0.7901817560195923,
0.15063966810703278,
-0.14141999185085297,
-1.2474536895751953,
0.16601599752902985,
0.8302407264709473,
-0.1463271528482437,
0.07790106534957886,... | |
silly at first but installing iTunes gives your Windows machine Bonjour service discovery (enabled by default on Macs and Ubuntu desktops) which would let you resolve .local addresses.
Accessing via the IP really should have worked but if you've already turned off firewalls and the machines are on the same network the... | [
0.018733244389295578,
-0.02241242118179798,
0.26506519317626953,
0.31604376435279846,
0.11039505153894424,
-0.02169114723801613,
0.46565738320350647,
0.297260046005249,
-0.32629823684692383,
-0.363054096698761,
-0.0556555837392807,
0.44083714485168457,
-0.15915438532829285,
-0.056219253689... | |
I'm using node with mocha and winston. Is there a way to set it up so it only shows logs for failing tests?
If you run with the min reporter you will only get full output on failed tests: `mocha -R min` or, if you prefer the verbose option, `mocha --reporter min`. | [
-0.084275022149086,
-0.019097009673714638,
0.10023368149995804,
0.3350445032119751,
0.09250836074352264,
0.25259914994239807,
0.24037525057792664,
0.3193269670009613,
-0.03916803002357483,
-0.6109384894371033,
-0.10811188071966171,
0.7530927062034607,
-0.10151498764753342,
0.11775516718626... | |
When I create say a div container with a say 100px width and place 2 div elements one floating to the left and the other to the right with a border of 2px and a width of 46px each they should be drawn on the same line side by side covering the whole width of the parent container. This happens in Firefox and Chrome but ... | [
0.43212929368019104,
0.06021583080291748,
0.7942240834236145,
-0.15958921611309052,
-0.22956633567810059,
0.09639444202184677,
-0.0636012926697731,
-0.21139685809612274,
-0.04765975847840309,
-0.9176506400108337,
0.057136017829179764,
0.0614471398293972,
-0.2822834253311157,
-0.00919213239... | |
{
margin:0;
padding:0;
}
</style>
</head>
<body>
<div style="border: 5px solid;width:100px;height:100px">
<div style='border:2px solid green;width:46px;height:46px;float:left'></div>
<div style='border:2px solid
green;width:46px;height:46px;float:right'></div>
<div>
</body>
</html>
```
I have a vague recollec... | [
-0.13228839635849,
-0.06555168330669403,
0.7627358436584473,
0.12235070019960403,
-0.18021492660045624,
-0.18256555497646332,
0.2892801761627197,
-0.2965312898159027,
-0.342210978269577,
-0.7699111700057983,
-0.11253902316093445,
0.29464465379714966,
-0.0536319762468338,
0.3152530491352081... | |
This recently working perfectly code no longer works properly when in usage with FB JS API:
```
placeOrder : function(order_info) {
var onOrderPlaced = function(data) {
if (data['order_id'] && data['status'] == 'settled') {
window.FLASH.flashObject.artifactAdded(order_info);
return true;
} else... | [
-0.024137752130627632,
-0.14428135752677917,
0.6419670581817627,
-0.3089677691459656,
0.40188977122306824,
0.12881708145141602,
0.2257446050643921,
-0.2715190649032593,
-0.1288820505142212,
-0.6870348453521729,
-0.3372046649456024,
0.6622921228408813,
-0.20801857113838196,
-0.0952515304088... | |
order_info : order_info,
purchase_type : 'item',
dev_purchase_params : {
'oscif' : false
}
}, onOrderPlaced);
} catch (err) {
// TODO handle payment error
}
}
```
The order takes place and is processed perfectly, but what does not happen afterwards, for like several days, the cal... | [
-0.06130005791783333,
-0.03398320451378822,
0.5855246186256409,
-0.2821674048900604,
0.3849760890007019,
0.19775250554084778,
0.10092023015022278,
-0.342979371547699,
-0.24083364009857178,
-0.4766812026500702,
-0.3831354081630707,
0.79399573802948,
-0.12138810753822327,
0.08734531700611115... | |
is prompting FB.ui with stream.publish method. All I see is the iframe and the loading animation within and it takes forever. Another functionality that worked flawlessly several days ago. And now it's not working. Anyone experiencing the same issues?
Officially, IANA (keepers of the [official MIME type registry](http:... | [
-0.14319190382957458,
-0.17954106628894806,
0.6082173585891724,
-0.050838202238082886,
-0.34291794896125793,
0.017042912542819977,
0.3799133896827698,
0.09679915010929108,
-0.0014561840798705816,
-0.5425717830657959,
-0.12488429993391037,
0.4957917034626007,
-0.3592386245727539,
0.07784020... | |
skip the `type` attribute of `<script>` tags entirely. Every browser will run your JS just fine without. (You still need to serve .js files with a HTTP `Content-Type` of `text/javascript`, though.) | [
0.5258885025978088,
-0.027439678087830544,
0.09632974863052368,
-0.16332389414310455,
-0.20837107300758362,
-0.36015641689300537,
0.3590182960033417,
0.24861110746860504,
-0.15670709311962128,
-0.722776472568512,
-0.39997977018356323,
0.4395146369934082,
-0.3022833466529846,
-0.21851687133... | |
I have the following code in settings.py
```
#EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'sender@gmail.com'
EMAIL_HOST_PASSWORD = 'password'
EMAIL_PORT = 687
```
(I tried using TLS = True and ports using Ports 25, 567, 465, 687 and also tried smtp.gmail.com and other HOSTS from MX records, ... | [
0.36751097440719604,
0.5159012079238892,
0.3310309648513794,
-0.1243937686085701,
-0.12439000606536865,
-0.0633246898651123,
0.6337339878082275,
-0.1831197738647461,
-0.09974193572998047,
-0.7043659090995789,
0.08130697906017303,
0.5641659498214722,
-0.2583116888999939,
0.21808139979839325... | |
you haven't specified any recipients (to, bcc, cc). If you have no recipients the EmailMessage.send returns 0.
Also, Googles default smtp port is 587. | [
-0.12915721535682678,
-0.2997160851955414,
0.3444071114063263,
0.007999722845852375,
-0.06412848830223083,
0.06125981733202934,
0.6355538368225098,
0.6209437251091003,
-0.27996236085891724,
-0.7772861123085022,
-0.26654189825057983,
0.07187163829803467,
-0.5211740136146545,
0.4276185333728... | |
Anyone know of a handy function to search through column\_names in Vertica? From the documentation, it seems like \d only queries table\_names. I'm looking for something like MySQL's information\_schema.columns, but can't find any information about a similar table of meta-data.
Thanks!
In 5.1 if you have enough permis... | [
0.2404160052537918,
0.16652724146842957,
0.3703469932079315,
0.3492256700992584,
0.13079454004764557,
-0.10768391937017441,
0.1498882919549942,
0.26883384585380554,
-0.4597000181674957,
-0.7175093293190002,
0.15070895850658417,
0.6181541681289673,
-0.27616825699806213,
0.21784554421901703,... | |
In order to show the input field for a cc: adress I am trying to automatically click the "Add Cc" span in gmail from a chrome extension.
The span looks like this:
```
<span id=":25j" class="el" role="link" tabindex="2">Add Cc</span>
```
It has no event listeners/onclick defined as far as I can tell.
I tried
```
... | [
0.5267606973648071,
0.07657810300588608,
1.0678356885910034,
-0.0034602838568389416,
-0.2751132547855377,
-0.327669233083725,
-0.1224268302321434,
-0.3610743284225464,
-0.5055586695671082,
-0.42432406544685364,
-0.04578012228012085,
0.8167669773101807,
-0.4421923756599426,
-0.0646739006042... | |
I could observe/record what events get fired when I manually click on the link?
**UPDATE:** Thanks @veeTrain for pointing out how to set breakpoints in Chrome Dev Tools
In 5.1 if you have enough permissions you can do
```
SELECT * FROM v_catalog.columns;
```
to access columns's info, for some things you'll need to... | [
0.6570940613746643,
-0.041008636355400085,
0.19342511892318726,
0.2512294352054596,
-0.2470071017742157,
-0.39898285269737244,
0.38271695375442505,
-0.0018057950073853135,
-0.4247726500034332,
-0.7556435465812683,
-0.16032162308692932,
0.7432267069816589,
-0.20655110478401184,
-0.164387062... | |
I am trying to create a 2 dimensional array but am getting this error.
I loop an object and try to assign them but it won't let me assign a value to the second dimension.
This is what I have:
```
//this is globally set
var gcollision = new Array();
function create() {
for (var X in sdata) {
X = parseInt... | [
0.23269851505756378,
-0.17545239627361298,
0.2982306480407715,
-0.26529279351234436,
-0.21662187576293945,
0.053867701441049576,
0.31922128796577454,
-0.20626161992549896,
-0.11542020738124847,
-0.5428802371025085,
-0.13977505266666412,
0.3980342447757721,
-0.523176908493042,
0.37052404880... | |
width = parseInt(sdata[X][Y][2]);
height = parseInt(sdata[X][Y][3]);
for (i = X; i != X + width; i++) {
//error occurs here "Uncaught TypeError: Cannot set property '3' of undefined"
gcollision[i][Y] = 1 | [
-0.12269114702939987,
-0.055816736072301865,
0.3493765592575073,
-0.38045305013656616,
-0.09612742066383362,
0.18910931050777435,
0.4174853265285492,
-0.6575158834457397,
-0.2360009402036667,
-0.27023032307624817,
-0.2944437563419342,
0.5750136375427246,
-0.10123135149478912,
0.09913241863... | |
for (j = Y; j != Y + height; j++) {
gcollision[X][j] = 1
}
}
}
}
```
How do I make it set the value of properly?
EDIT sdata looks like this:
```
var sdata = {"4":{"7":["1","7","3","3"]},"3":{"3":["2","8","1","1"]}};
```
```
//this is globally set
var gcol... | [
0.3408699929714203,
-0.1651466190814972,
0.6833779811859131,
-0.4053827226161957,
-0.25748154520988464,
0.17811773717403412,
0.38848116993904114,
-0.5796056389808655,
-0.0994267538189888,
-0.5167867541313171,
0.0033030053600668907,
0.6664800047874451,
-0.16443860530853271,
-0.0719691365957... | |
for (var X in sdata) {
X = parseInt(X);
for (var Y in sdata[X]) {
Y = parseInt(Y);
width = parseInt(sdata[X][Y][2]);
height = parseInt(sdata[X][Y][3]);
for (i=X; i!= X+width; i++) {
if( typeof gcollision[i] == 'undefined' ) | [
-0.12338648736476898,
-0.24387690424919128,
0.387924462556839,
-0.3080706298351288,
-0.2984229624271393,
0.48250675201416016,
0.2942376434803009,
-0.39216119050979614,
-0.08313770592212677,
-0.3772273659706116,
-0.37275445461273193,
0.2481646090745926,
-0.0962928906083107,
0.12374725937843... | |
gcollision[i] = new Array();
gcollision[i][Y] = 1
for (j=Y; j!=Y+height; j++) {
if( typeof gcollision[X] == 'undefined' ) gcollision[X] = new Array();
gcollision[X][j] = 1
}
} | [
-0.19875891506671906,
-0.3751232326030731,
0.8463005423545837,
-0.48794659972190857,
-0.26082396507263184,
0.47839590907096863,
0.18607193231582642,
-0.3049953579902649,
-0.3771415948867798,
-0.5491477847099304,
-0.2809580862522125,
0.6382986903190613,
-0.4465782344341278,
0.03485156223177... | |
}
}
```
Basically, even though you created your array, those indices do not exist yet, so you cannot reference them *as arrays* until after you define them as such.
If you set up your for loops a bit more optimally, you don't have to do isset and can just create the `gcol[index] = Array();` the right before the ... | [
0.10777401924133301,
-0.13265849649906158,
0.1783600151538849,
-0.05694170296192169,
0.19306153059005737,
-0.2030181884765625,
-0.102315254509449,
0.17888961732387543,
-0.05234115570783615,
-0.6714911460876465,
-0.05909300595521927,
0.37815526127815247,
-0.630600094795227,
0.04894864559173... | |
I want to build a semi-natural language interface for a data warehouse. A simple data model looks for example like this:
```
Company
- attribute 'name'
- reference to 'Departments'
Department
- attribute 'type'
- reference to 'Employees'
Employee
- attribute 'age'
- attribute 'salary'
```
And I would like to make... | [
0.27412188053131104,
0.37505263090133667,
-0.028727056458592415,
0.06122618541121483,
0.18060582876205444,
0.22402317821979523,
-0.11541427671909332,
0.09394637495279312,
-0.10705141723155975,
-0.20137478411197662,
0.19396746158599854,
0.5711463093757629,
-0.3335506319999695,
0.41088670492... | |
Prolog still the way to go in this case?
Thanks
Even, better, I now use DCG with embedded Prolog rules.
So, for a model that has classes and attributes like this:
```
c(company, class(company)) --> [company].
a(company, attribute(name)) --> [name].
```
I can ask for attributes of a class of a class:
```
q(q(A,C... | [
-0.371050089597702,
0.06057184189558029,
0.2931307852268219,
0.014078875072300434,
-0.10473982989788055,
0.33809179067611694,
-0.05504472926259041,
-0.002134075853973627,
-0.15930135548114777,
-0.29059186577796936,
-0.09838102012872696,
0.6483844518661499,
-0.31928905844688416,
-0.07285022... | |
Is there a magic method that when a certain method is called from an object, that a magic method is called first. Kinda like the \_\_call method, but this only gets triggered when the method isn't found.
So in my case i'd like something like this:
```
class MyClass
{
public function __startMethod ( $method, $arg... | [
-0.05223725736141205,
-0.26156511902809143,
-0.1672031432390213,
-0.19197075068950653,
-0.08987096697092056,
-0.3166756331920624,
0.09639909863471985,
-0.08479879796504974,
-0.2173703908920288,
-0.2157863825559616,
-0.11558292806148529,
0.48188653588294983,
-0.34426239132881165,
0.04298437... | |
helloWorld ( )
{
echo ' [Hello] ';
}
}
$obj = new MyClass();
$obj->helloWorld();
//Output:
[start] [Hello]
```
Does something like this exist in PHP??
There isn't a direct way to do this but it looks to me like your trying to implement a form of Aspect Oriented programming. There are several ways o... | [
-0.22891923785209656,
-0.10962270945310593,
0.5524453520774841,
-0.195744127035141,
-0.13624541461467743,
-0.15683536231517792,
0.18046236038208008,
0.13981425762176514,
0.015555694699287415,
-0.4833246171474457,
0.13807237148284912,
0.4236029088497162,
-0.5593262910842896,
0.1569505035877... | |
a method just got called, so this is called first
echo ' [start] ';
}
public function _helloWorld ( )
{
echo ' [Hello] ';
}
public function __call($method, $args)
{
_startMethod($method, $args);
$actualMethod = '_'.$method;
call_user_func_array(array($t... | [
-0.03500431030988693,
-0.1693260371685028,
0.5068730711936951,
-0.4728929400444031,
0.08249044418334961,
-0.09962024539709091,
0.34734028577804565,
-0.2000676393508911,
-0.19061119854450226,
-0.3349655568599701,
-0.1642187237739563,
0.2920372188091278,
-0.4851888120174408,
0.29808607697486... | |
up other ways of implementing AOP in PHP to see what works best for you (I'll see if I can find a link somewhere).
EDIT: here's a document for you <http://www.liacs.nl/assets/Bachelorscripties/07-MFAPouw.pdf> | [
0.3204863965511322,
-0.1097206175327301,
0.3845391273498535,
0.0019305608002468944,
-0.012347709387540817,
-0.11022957414388657,
0.25085628032684326,
-0.25232550501823425,
-0.4098648130893707,
-0.2817596197128296,
-0.18553920090198517,
0.38664910197257996,
-0.01511586457490921,
-0.27267405... | |
I've been trying to use "copytree(src,dst)", however I couldn't since the destination folder should exists at all.Here you can see the small piece of code I wrote:
```
def copy_dir(src,dest):
import shutil
shutil.copytree(src,dest)
copy_dir('C:/crap/chrome/','C:/test/')
```
and this is the error I m gettin... | [
0.2120300829410553,
0.4882146418094635,
0.28728732466697693,
0.01453869417309761,
0.35306426882743835,
-0.2731058895587921,
0.43732330203056335,
-0.1132732704281807,
-0.3300682008266449,
-0.5454961061477661,
-0.24067360162734985,
0.6779101490974426,
-0.21856728196144104,
0.3126954436302185... | |
'C:/test/'
```
Here is my question is there a way I could achieve the same result without creating my own copytree function?
Thank you in advance.
Look at [`errno`](http://docs.python.org/library/errno.html) for possible errors. You can use `.copytree()` first, and then when there is error, use `shutil.copy`.
From:... | [
0.40222877264022827,
0.21083377301692963,
0.16615527868270874,
-0.01664840430021286,
0.14180287718772888,
-0.21402831375598907,
0.22127783298492432,
-0.2872487008571625,
-0.11849431693553925,
-0.5023422241210938,
-0.20435583591461182,
0.8852154016494751,
-0.5399429798126221,
-0.28850430250... | |
problem
except OSError as exc:
# File already exist
if exc.errno == errno.EEXIST:
shutil.copy(src, dst)
# The dirtory does not exist
if exc.errno == errno.ENOENT:
shutil.copy(src, dst)
else: | [
-0.27909955382347107,
0.12635189294815063,
0.42822200059890747,
0.2801755666732788,
0.44963809847831726,
-0.35297784209251404,
0.19484438002109528,
0.06938540935516357,
-0.4283253252506256,
-0.43490928411483765,
-0.2342492640018463,
0.7749121785163879,
-0.033476341515779495,
0.220954373478... | |
raise
```
About `.copy()`: <http://docs.python.org/library/shutil.html#shutil.copy>
> Copy the file src to the file or directory dst. If dst is a directory,
> a file with the same basename as src is created (or overwritten) in
> the directory specified. Permission bits are copied. src and dst are
> path names giv... | [
0.4401528835296631,
0.1996578425168991,
0.5537093281745911,
0.10696408152580261,
-0.053075071424245834,
-0.236380472779274,
-0.10623165965080261,
-0.6917824745178223,
-0.3941265046596527,
-0.48183009028434753,
-0.3591107428073883,
0.336691677570343,
-0.20609453320503235,
0.2585280239582062... | |
Short version: I want a way to start a time-based counter on an onTouchEvent, and test to see if a certain amount of time has passed before responding, as a manual LongTouch detection.
Explanation:
I have a custom imageView that slides in/out of screen on two-fingered flings. I want to add drag events to it, but these... | [
0.4047195315361023,
-0.37127548456192017,
0.8178567290306091,
0.2182263731956482,
-0.15542826056480408,
0.04387471079826355,
0.13670942187309265,
-0.1639387011528015,
-0.3794632852077484,
-0.1522677093744278,
0.27637559175491333,
0.5173161029815674,
-0.035920385271310806,
-0.38002568483352... | |
can I create a time-based counter, an Activity level field that's incremented 60 times a second or somesuch?
Answer: Use system clock (elapsedRealtime()) and measure milliseconds since the press was initiated. Easy once you start to get the hang of it. | [
0.6064210534095764,
-0.08809258788824081,
0.47314271330833435,
0.20070090889930725,
0.09756194800138474,
0.21984334290027618,
0.17369893193244934,
-0.3122355043888092,
-0.1078602746129036,
-0.49478504061698914,
0.16383978724479675,
0.3093366026878357,
0.09039317071437836,
-0.05418685078620... | |
I am working on my SQL, and I have the following statement:
```
1 SELECT c.credit_display, t.title, t.provider
2 FROM credits c
3 INNER JOIN title t
4 ON c.vendor_id = t.vendor_id
5 WHERE c.position = 'Director' and t.provider = 'Premiere'
6 INTO OUTFILE '/var/tmp/file.csv... | [
0.43740779161453247,
0.45054933428764343,
0.5343979597091675,
-0.1387636661529541,
0.22117628157138824,
-0.20545510947704315,
-0.35785675048828125,
-0.0858762115240097,
-0.08218317478895187,
-0.38146835565567017,
-0.25337064266204834,
0.474995493888855,
0.10250608623027802,
0.4135524928569... | |
what the correct formatting would be with regards to tabs. What is the suggested practice for when to indent (for example, should the third line be two tabs or three?).
**This is all highly subjective**.
Since the `INTO OUTFILE` and `FIELDS` options belong to the entire `SELECT` statement, I probably wouldn't indent t... | [
0.1654432713985443,
0.016329659149050713,
0.38021257519721985,
-0.24202018976211548,
-0.061569686979055405,
0.06805723905563354,
0.03743278235197067,
-0.06667548418045044,
-0.09854771941900253,
-0.6010292172431946,
-0.3121924102306366,
0.36900457739830017,
-0.288476824760437,
-0.0392950139... | |
applies to.
```
SELECT
/* each column on its own line */
/* unless it is only 1 column */
c.credit_display,
t.title,
t.provider
FROM
credits c
INNER JOIN title t
/* ON clause indented beneath the join */
ON c.vendor_id = t.vendor_id
WHERE
/* each condition on its own line */
... | [
0.3063110113143921,
0.05246755853295326,
0.3840400278568268,
-0.030433043837547302,
0.4877476990222931,
-0.1489172726869583,
-0.24294479191303253,
-0.03440595418214798,
0.10119760781526566,
-0.30081769824028015,
-0.31524819135665894,
0.31823402643203735,
-0.07787767052650452,
0.30101358890... | |
OUTFILE '/var/tmp/file.csv'
/* You might indent this and other LINES TERMINATED BY options
beneath the OUTFILE line */
FIELDS TERMINATED BY ','
```
Indentation is a very subjective matter, and the best thing to do is come to agreement with your team on how you are all indenting code. | [
0.2577095329761505,
0.3863585889339447,
0.14713294804096222,
-0.0787687674164772,
-0.21698342263698578,
-0.09013844281435013,
0.20823901891708374,
-0.006314325146377087,
0.12865427136421204,
-0.524179220199585,
-0.22589896619319916,
0.35213831067085266,
-0.3556506633758545,
0.0411950126290... | |
I know that we can use `onPause()` event to stop the MediaPlayer using `reset()` method. But I want to know why media player is still playing when I press back button?
I believe your media player is being run by a Service. So when you press *back* key, it only destroys the Activity, not the Service. So you need to stop... | [
0.42684367299079895,
-0.09531673043966293,
0.3711482286453247,
0.12500494718551636,
0.011812197975814342,
-0.5051012635231018,
0.38592401146888733,
-0.011104115284979343,
-0.48993709683418274,
-0.43694454431533813,
-0.21300435066223145,
0.844416081905365,
-0.38930708169937134,
0.3508034348... | |
I'm making a swing based application where I have a JList that periodically get's updated with different orderings of the same data, gets infrequently updated with new items, and also infrequently updated with less items. I'm trying to figure out the best way to make this look good. Right now, I just call
```
JList.s... | [
0.6628618836402893,
-0.12776491045951843,
0.3682604432106018,
-0.00650689797475934,
-0.16416503489017487,
-0.22145245969295502,
0.060090307146310806,
-0.2070329785346985,
-0.5852693319320679,
-0.5712921619415283,
-0.016537178307771683,
0.3689011037349701,
-0.47452372312545776,
0.1085881739... | |
into keeping track of which indexs are selected and then setting the selected items after changing the data but that sounds horrible. I also looked at ListModels and keeping track of my own but it seems that which items are selected is kept in the JList itself so that wouldn't work perfectly either.
I'd really appreci... | [
0.35922178626060486,
-0.21305648982524872,
0.4103803038597107,
0.2472732961177826,
-0.037379514425992966,
-0.13214576244354248,
0.24567855894565582,
0.031190859153866768,
-0.3316999673843384,
-0.5411792397499084,
0.1493447721004486,
0.4588088095188141,
-0.048608746379613876,
0.138049483299... | |
I'm creating a JSON object like
```
tags = {"jon":["beef","pork"],"jane":["chicken","lamb"]};
```
which was generated using php from an array like
```
$arr = array(
'jon' => array('beef', 'pork'),
'jane' => array('chicken', 'lamb')
);
$tags = json_encode($arr);
```
And I want to check if so... | [
0.09787854552268982,
0.14114432036876678,
0.19481661915779114,
-0.3501169681549072,
0.06824737042188644,
0.11660201847553253,
0.3629129230976105,
-0.21420329809188843,
0.02600718103349209,
-0.45206981897354126,
-0.04859154298901558,
0.24098803102970123,
-0.3329651951789856,
0.1176509335637... | |
writes **NO** to the console
so looking at
```
typeof(tags.jane);
```
it shows it's an `"object"` but
```
console.log(tags);
```
shows the following:
```
Object
jane: Array[2]
0: "chicken"
1: "lamb"
length: 2
__proto__: Array[0]
jon: Array[2]
0: "beef"
1: "pork"
length: 2
__proto... | [
0.007767004892230034,
0.2959859371185303,
0.1430869847536087,
-0.4827379584312439,
0.15263187885284424,
0.36623528599739075,
0.19620713591575623,
-0.5478649735450745,
-0.2551117241382599,
-0.38042017817497253,
0.18656224012374878,
0.37051287293434143,
-0.35150161385536194,
0.08410058170557... | |
to the console.
Am I incorrectly building the JSON Object? Not targeting the value(s) properly? Any advice is greatly appreciated. If this would be easier as an array instead of an object, I have full control to change it. I'm just a bit stumped at how I should treat this.
[jQuery.inArray](http://api.jquery.com/jQuery... | [
-0.12470384687185287,
0.017185060307383537,
0.2586161196231842,
-0.12821230292320251,
0.09495735913515091,
-0.11971109360456467,
0.38138890266418457,
-0.11507026851177216,
0.0798158198595047,
-0.4118271470069885,
-0.157405823469162,
0.6965466141700745,
-0.3981455862522125,
0.24365890026092... | |
Hi I have been trying to learn Javascript using codeacademy.com and I have reached an exercise that doesn't seem to make any sense when why the exercise I have written.This is my code:
```
(function(){
var bob = {
firstName: "Bob",
lastName: "Jones",
phoneNumber: "(650) 777 - 7777",
... | [
0.030177293345332146,
0.36871811747550964,
0.5599295496940613,
-0.5854259729385376,
0.18242304027080536,
0.3647732138633728,
0.6316365599632263,
-0.19701501727104187,
-0.22176703810691833,
-0.4014466106891632,
0.05325077474117279,
0.6521003842353821,
-0.35222798585891724,
0.282648563385009... | |
lastName: "Johnson",
phoneNumber: "(650) 888 - 8888",
email: "mary.johnson@example.com"
};
var contacts = [bob, mary];
var printPerson = function(person){
console.log(person.firstName + " " + person.lastName);
}
var list = function(){
var i = contacts.length;
... | [
-0.3495361804962158,
0.12650303542613983,
0.5117852687835693,
-0.2574273943901062,
0.36923763155937195,
0.7164978981018066,
0.4255540370941162,
0.047424111515283585,
-0.4476287364959717,
-0.5285134315490723,
-0.2346763163805008,
0.5479490756988525,
-0.19952736794948578,
0.4127144515514374,... | |
printPerson(contacts[i]);
}
};
list();
})();
```
The problem is in the list function when I try to call the printPerson() function I get that person is undefined but if I write instead of the list() function this:
```
printPerson(contacts[0]);
printPerson(contacts[1]);
```
Everything w... | [
-0.08170046657323837,
0.22338104248046875,
0.4825578033924103,
-0.31299152970314026,
0.2488144338130951,
0.0615849643945694,
0.42179325222969055,
-0.42386311292648315,
-0.4397839605808258,
-0.40637513995170593,
-0.14617623388767242,
1.0568857192993164,
-0.6687358021736145,
-0.1467297673225... | |
i ; j++){
printPerson(contacts[i]);
}
};
```
`i` here is a constant. If you replace it:
```
var list = function(){
var i = contacts.length;
for(var j= 0; j < contacts.length ; j++){
printPerson(contacts[contacts.length]);
}
};
```
For all arrays `arr`, `arr[arr.length]` will always ... | [
-0.22790326178073883,
0.1215125024318695,
0.8878480195999146,
-0.5836565494537354,
0.10773956030607224,
0.17733754217624664,
0.0260598324239254,
-0.33170822262763977,
-0.257855087518692,
-0.4206802248954773,
-0.18765634298324585,
0.8191139101982117,
-0.5574504137039185,
0.06778661906719208... | |
What I am trying to do, is return a ForwardIterator(or even a pair of begin and end iterators), so that the uderlying implementation can be kept hidden from a client class.
I was not able find any such example.
if underlying implementation is vector, the iterator is vector::iterator.. Even if you templatize the output... | [
-0.15919220447540283,
-0.12210342288017273,
0.12894117832183838,
-0.11498719453811646,
-0.26794692873954773,
0.10617709904909134,
0.22250740230083466,
-0.07011144608259201,
-0.12102792412042618,
-0.45803841948509216,
0.087742879986763,
0.5009580254554749,
-0.3524457812309265,
0.32962435483... | |
like this:
```
template<typename T>
class Cursor
{
public:
typedef T value_type;
virtual ~Cursor () {}
virtual bool has_result () = 0;
virtual value_type get_result () = 0;
};
// implements cursor interface for any sequence
// described as a pair of forward iterators.
template<typename I>
class Forwar... | [
-0.42651087045669556,
-0.08171673864126205,
0.7553179264068604,
-0.15392151474952698,
-0.2843383848667145,
0.33751773834228516,
-0.07170632481575012,
-0.3870829939842224,
-0.30289560556411743,
-0.5908679962158203,
0.010110081173479557,
0.32396990060806274,
-0.33288002014160156,
0.375346988... | |
return myCurrent != myEnd;
}
virtual value_type get_result () {
return *myCurrent++;
}
};
```
Then, you can return any forward sequence as:
```
class Foo
{
std::vector<int> myValues;
public:
std::unique_ptr< Cursor<int> > values () {
return std::unique_ptr< Cursor<int> >(
... | [
-0.4821869432926178,
-0.02474321611225605,
0.965696394443512,
-0.24261124432086945,
-0.06654608994722366,
0.42622262239456177,
-0.10819604247808456,
-0.21930214762687683,
-0.3007236421108246,
-0.586125910282135,
-0.057159680873155594,
0.3843904435634613,
-0.16742917895317078,
0.30106112360... | |
myValues.begin(), myValues.end()
)
);
}
};
```
And use it like so:
```
std::unique_ptr< Cursor<int> > cursor = foo.values();
while (cursor->has_result()) {
std::cout << cursor->get_result() << std::endl;
}
``` | [
-0.41148415207862854,
0.16732731461524963,
1.0122838020324707,
-0.23556004464626312,
0.21872363984584808,
-0.0389464907348156,
0.017740339040756226,
-0.2708742022514343,
-0.26059824228286743,
-0.6182123422622681,
-0.35797157883644104,
0.3472613990306854,
-0.3674428164958954,
0.136208057403... | |
I'm fairly new to using MSSQL and have run into a weird problem. Given the first record id from the last query, I need to find the 50 rows before that that meet the same criteria as the first query and return them in descending order. This is for an ASP.NET site, and I'm pretty sure the ASP side is correct but it gives... | [
0.09713401645421982,
0.1961667835712433,
0.28546854853630066,
-0.09025099128484726,
-0.05111849308013916,
-0.000028479953471105546,
0.19925087690353394,
0.0747419223189354,
-0.2820699214935303,
-0.6346333622932434,
0.21358083188533783,
0.20342858135700226,
-0.04414309933781624,
0.205276802... | |
(A_1STNAME LIKE '(variable)%')
AND A_RECID < '(lastPost)'
)
SELECT TOP 50 * FROM PreviousPosts
ORDER BY A_RECID ASC
```
where "(variable)" and "(lastPost)" are actually filled in with the correct parameters with my C#
I'm no longer receiving errors but now I'm getting the same results no matter what is provided... | [
-0.08465033024549484,
0.08416076004505157,
0.3947722315788269,
0.07236559689044952,
0.1305006891489029,
0.09566182643175125,
0.3552336096763611,
-0.11821971833705902,
-0.038058966398239136,
-0.6553956270217896,
-0.17586129903793335,
0.40893155336380005,
0.05441684275865555,
-0.014879806898... | |
be right as is:
```
;WITH RankedRecords AS
(
SELECT
ROW_NUMBER() OVER(ORDER BY A_RECID DESC) Row
, A_RECID
FROM [database]..[table]
WHERE A_1STNAME LIKE '(variable)%')
AND CAST(LEFT(A_RECID, 8) AS DATE) < CAST(LEFT('(lastPost)', 8) AS DATE)
)
SELECT TOP 50
T.*
FROM[database]..[t... | [
-0.12190154939889908,
-0.24064448475837708,
0.6755070090293884,
-0.3359341323375702,
0.3493744730949402,
0.40937429666519165,
-0.011208046227693558,
-0.5341662764549255,
-0.08946596086025238,
-0.49745622277259827,
-0.38735339045524597,
0.6792382597923279,
-0.0015401297714561224,
0.07927846... | |
I am using named placeholders like so:
```
$job['services_flag'] = 0;
$SQL = "INSERT INTO jobs (
services_flag
)
VALUES ( | [
0.19323702156543732,
0.22333012521266937,
0.14895489811897278,
-0.3150750398635864,
0.5024371147155762,
-0.13876907527446747,
0.06919275224208832,
0.058162007480859756,
0.09405280649662018,
-0.4914223551750183,
-0.04465044289827347,
0.2489820122718811,
-0.17619599401950836,
0.2750232219696... | |
:services_flag
)";
$STH = $DBH->prepare($SQL);
$STH->execute($job);
```
However, this insists on inserting `1`.
If I don't use named placeholders:
```
$SQL = "INSERT INTO jobs (
services_flag | [
0.07063494622707367,
0.10546483099460602,
0.07292704284191132,
-0.4605632424354553,
0.3137242794036865,
0.04903809726238251,
0.2840512692928314,
-0.3075868785381317,
-0.041051264852285385,
-0.6017677783966064,
-0.3077826499938965,
0.23544536530971527,
-0.391648530960083,
0.0421037785708904... | |
)
VALUES (
0
)";
$STH = $DBH->prepare($SQL);
$STH->execute();
```
Then it inserts `0`. Eh?
**Update:**
The data type of the `services_flag` field in my SQL database is `BIT`. I don't know if that | [
0.6083758473396301,
0.08907026797533035,
0.6125824451446533,
-0.33897292613983154,
0.28931787610054016,
-0.04349144920706749,
0.45311081409454346,
-0.3739794194698334,
0.142986461520195,
-0.49919572472572327,
-0.22889792919158936,
0.48770666122436523,
-0.2689453661441803,
0.425286352634429... | |
makes any difference.
This is a [known bug](https://bugs.php.net/bug.php?id=50757) with `BIT` type, you should use `bindParam` for it | [
0.3729720711708069,
-0.09009568393230438,
0.20909319818019867,
0.16970302164554596,
0.26657935976982117,
-0.29647374153137207,
0.36044204235076904,
-0.0828210785984993,
-0.3774268329143524,
-0.5291383266448975,
-0.0028058579191565514,
0.2761354148387909,
-0.6386194825172424,
0.202139362692... | |
In Java, it's taught that variables should be kept private to enable better encapsulation, but what about static constants? This:
```
public static final int FOO = 5;
```
Would be equivalent in result to this:
```
private static final int FOO = 5;
...
public static getFoo() { return FOO; }
```
But which is better... | [
0.13235987722873688,
0.10060594230890274,
0.04875365272164345,
-0.3073621690273285,
-0.22441643476486206,
-0.30201852321624756,
0.4035542905330658,
-0.09279128909111023,
-0.2702540457248688,
-0.3054773509502411,
-0.271301805973053,
0.5144007802009583,
-0.6272973418235779,
0.006605185102671... | |
Foo above into the calling code, i.e. `someFunc(FooClass.FOO);` becomes `someFunc(5);`. Now if you recompile your library but not the calling code you can end up in surprising situations. That's avoided if you use a function - the JIT will still optimize it just fine, so no real performance hit there. | [
0.05939395725727081,
0.018940500915050507,
0.1142750158905983,
-0.22298084199428558,
-0.05598356947302818,
-0.2606686055660248,
0.38333114981651306,
-0.1915813535451889,
-0.2512410879135132,
-0.3147445619106293,
-0.06702913343906403,
0.7675948739051819,
-0.054973263293504715,
0.06861846148... | |
In VB6, textboxes have their CausesValidation property set to True by default. In this case, is there some autogenerated validation code as well when the Validate Event fires? I suppose that such autogenerated code would check, at a minimum, whether the field is non-empty.
To answer your question, no there is no autoge... | [
0.19088469445705414,
0.08021632581949234,
0.3403812348842621,
-0.15555554628372192,
-0.15931165218353271,
-0.1679573953151703,
0.40614578127861023,
-0.4299349784851074,
-0.067633718252182,
-0.2831723988056183,
-0.24027472734451294,
0.7948856353759766,
-0.363142192363739,
-0.038279190659523... | |
verify that a TextBox is 'non-empty' you might use the following validation event example from the link:
```
Private Sub txtRequired_Validate(Cancel As Boolean)
' Check that field is not empty.
If txtRequired.Text = "" Then
MsgBox "Please enter something here", vbExclamation
Cancel = True
... | [
0.2665765881538391,
-0.1563294678926468,
0.2591964900493622,
-0.04747191444039345,
0.29518455266952515,
-0.2822038531303406,
0.4744631350040436,
-0.0408305861055851,
-0.17736050486564636,
0.03222208097577095,
-0.3795047700405121,
0.6930602788925171,
-0.30388346314430237,
0.0501350350677967... | |
I'm not finding any question specifically with the odd problem I have. Basically I've got a form set up for inputting a users phone number and extension. I've made an Add button so I can add more phone/extensions to the form. I've got the adding working fine in the form and also for the SQL code. The problem is removin... | [
0.57244473695755,
0.2767660915851593,
0.5837439894676208,
-0.09534633904695511,
0.020618490874767303,
-0.03928298503160477,
0.08775167912244797,
-0.10773709416389465,
-0.09701067954301834,
-0.5358121395111084,
0.13880547881126404,
0.3861665725708008,
-0.3215668201446533,
0.2728593349456787... | |
one out. It works fine for the form, but it doesn't do anything for the SQL code. I've created something similar for the SQL code so I have a function that will remove it. And just to test I put in the same "Remove" href as the forms, and if I click the link for the SQL portion it does remove it.
So I'm trying to find ... | [
0.23463933169841766,
0.30276384949684143,
0.3852611780166626,
-0.08143436163663864,
-0.10223957151174545,
-0.20107869803905487,
-0.09029161185026169,
-0.08631809800863266,
-0.009111045859754086,
-0.33807748556137085,
0.07114335894584656,
0.4006335735321045,
-0.5419326424598694,
0.272268205... | |
from the form DIV which matches the DIV name of the SQL portion, but I can't seem to get that to work.
```
////
//-------------Add Phone Form----------------
////
function addElement() {
var ni = document.getElementById('phoneDiv');
var numi = document.getElementById('theValue');
var n... | [
0.0937645211815834,
-0.10976539552211761,
0.5009534955024719,
-0.09277033805847168,
-0.01138621661812067,
0.03289317712187767,
0.1225850060582161,
-0.4792942404747009,
0.09404119849205017,
-0.5988795757293701,
-0.4581902325153351,
0.5360402464866638,
-0.04586150869727135,
0.519415616989135... | |
newdiv.setAttribute('id',divIdName);
newdiv.innerHTML = '<input type=hidden id=' + num + ' name='+sqlDivIdName+' value=' + num + '><a href="javascript:remove('+divIdName+')">Remove</a> <tr><td>Phone Number:</td> <td> <input type="text" name="phone' + num + '" maxlength="10"> </td></tr> <tr> <td>Extension:... | [
-0.18598367273807526,
-0.4358759820461273,
0.5625702738761902,
-0.12464510649442673,
0.14480140805244446,
0.12029466032981873,
0.07211697101593018,
-0.5746033191680908,
-0.14138340950012207,
-0.8356198072433472,
-0.5500946044921875,
0.40711694955825806,
-0.2284814417362213,
0.1047880426049... | |
= document.getElementById('theValue2');
var num = (document.getElementById('theValue2').value -1 + 2);
numi.value = num;
var newdiv = document.createElement('div');
var divIdName = 'SQLphoneDiv'+num+'';
newdiv.setAttribute('id',divIdName);
newdiv.innerHTML = '<input type=hidden id=' +num+ ... | [
-0.26871204376220703,
-0.16097551584243774,
0.5508731007575989,
-0.22248463332653046,
0.30163753032684326,
0.05038900673389435,
0.32717135548591614,
-0.4700353741645813,
0.0994950607419014,
-0.5953588485717773,
-0.6654441952705383,
0.6566210985183716,
-0.2613069415092468,
0.070180773735046... | |
////
function remove(xy) {
var ni = document.getElementById('phoneDiv');
ni.removeChild(xy);
}
////
//-------------Remove Phone SQL----------------
////
function removeSQL(yz) {
var ni = document.getElementById('SQLphoneDiv');
ni.removeChild(yz);
}
```
I've tried to... | [
0.27082929015159607,
-0.007289777975529432,
0.34144458174705505,
-0.1958600878715515,
0.3298676609992981,
-0.03406522795557976,
0.23908470571041107,
-0.3037241995334625,
0.07481467723846436,
-0.4808012843132019,
-0.341239869594574,
0.6431006789207458,
-0.49458393454551697,
0.17009665071964... | |
child I'm trying to remove.
I'm very new to JavaScript so I'm sure jQuery has a very simple way to do this, but jQuery is confusing to me right now since I'm still trying to grasp most of the concepts in JavaScript alone.
Thanks for any tips I can get.
Also, I know the SQL isn't really correct but I'm not worried abo... | [
0.002665997948497534,
0.40529486536979675,
0.11699701100587845,
0.09103846549987793,
0.2000446617603302,
0.43210524320602417,
-0.01768188737332821,
-0.2623679041862488,
0.3784874677658081,
-0.6855189800262451,
0.23245590925216675,
0.6574253439903259,
-0.28413060307502747,
0.296239823102951... | |
do
```
var sqlDiv = document.getElementById(xy.sqlDivId);
var sqlNi = document.getElementById('SQLphoneDiv');
sqlNi.removeChild(sqlDiv);
``` | [
0.10478818416595459,
0.04302467405796051,
0.2745042145252228,
-0.1732165515422821,
0.06182301789522171,
-0.21763554215431213,
0.2889038324356079,
-0.22386565804481506,
-0.061849478632211685,
-0.4347858726978302,
-0.2731950283050537,
0.4780758023262024,
-0.4284423291683197,
0.35558915138244... | |
I have just installed the newest google chrome and just trying to test GWT 2.3 code with DialogBox; For some reason the option like `setGlassEnabled(true);` works in a strange way :(
If chrome's scroll pane **(y position is 0)** the glass is painted correct
but if
chrome's scroll pane **(y position is > 0)** then t... | [
0.548692524433136,
0.07110026478767395,
0.9234328269958496,
-0.0316600501537323,
-0.026239393278956413,
-0.015343531966209412,
0.5822152495384216,
-0.1857498735189438,
0.2241557240486145,
-0.9620385766029358,
0.13204388320446014,
0.832188606262207,
-0.04358609393239021,
0.18200694024562836... | |
this.setModal(true);
this.setPreviewingAllNativeEvents(true);
...
```
I am not pretty sure what makes the bug or something because the code works fine in IE and FF :S
So I guess in the chrome the glass position is always static or something and its location is always
> x,y{0,0} w,h{firstInitedWidth,firstI... | [
0.4242931008338928,
-0.16346648335456848,
0.7359384298324585,
-0.15522342920303345,
-0.17306570708751678,
-0.24890762567520142,
0.4065723121166229,
0.07627317309379578,
-0.18732424080371857,
-0.8775479793548584,
-0.13294006884098053,
0.791593611240387,
-0.5452664494514465,
-0.0517949014902... | |
Element glass = getGlassElement();
if (glass != null) {
glass.getStyle().setPosition(Position.FIXED);
}
}
```
This simply sets the position of the glass panel to fixed instead of absolute. This makes the panel not move with the scroll. | [
-0.10093174874782562,
-0.23554939031600952,
0.9119776487350464,
-0.26196157932281494,
0.043925125151872635,
0.10581115633249283,
0.09238655865192413,
-0.5689688920974731,
-0.02916664443910122,
-0.514428973197937,
-0.2675509750843048,
0.5976152420043945,
-0.20562270283699036,
0.022366989403... | |
I have tried, with no avail, to create a nestedForm inside of another nestedForm using the SheepIt! plugin. Is this even possible?
Extending [Demo 7](http://www.mdelrosso.com/sheepit/index.php?lng=en_GB&sec=demo7) on the SheepIt! website, I tried to add an additional nested form in [JSFiddle](http://jsfiddle.net/YWZ8K... | [
0.2724034786224365,
-0.05661635473370552,
0.3309703469276428,
-0.4597465395927429,
-0.30701377987861633,
0.1413266658782959,
0.5118205547332764,
-0.3895699083805084,
-0.06666616350412369,
-0.7538248300552368,
0.007675714325159788,
0.30283161997795105,
-0.3810604512691498,
-0.10686036199331... | |
options: {
indexFormat: '#index_tests#'
}
}
]
```
Solved:
Make your own class that extends PopupPanel and add this:
```
@Override
public void setGlassEnabled(boolean enabled) {
super.setGlassEnabled(enabled);
Element glass = getGlassElement(); | [
0.07022754848003387,
-0.412380576133728,
0.6325997710227966,
-0.03870941326022148,
0.16395145654678345,
0.10457804799079895,
0.25166991353034973,
-0.3036150336265564,
-0.22996149957180023,
-0.5198860168457031,
-0.4445391297340393,
0.5960997343063354,
-0.407708078622818,
-0.1667445152997970... | |
if (glass != null) {
glass.getStyle().setPosition(Position.FIXED);
}
}
```
This simply sets the position of the glass panel to fixed instead of absolute. This makes the panel not move with the scroll. | [
-0.05230896919965744,
-0.0822940394282341,
0.944019079208374,
-0.2209104597568512,
0.051418665796518326,
0.08671814203262329,
0.18213815987110138,
-0.35121479630470276,
-0.03392014652490616,
-0.6411631107330322,
-0.21609050035476685,
0.7310599684715271,
-0.08899063616991043,
0.214430302381... | |
I'm using XmlWriterSettings to write Xml to file. I have elements with only attributes, no children. I want them to output as:
```
<element a="1" />
```
instead of
```
<element a="1"></element>
```
Can i do it with XmlWriterSettings?
EDIT:
Code is as follows:
```
private void Mission_Save(string fileName)
... | [
0.2634592056274414,
-0.2238713949918747,
0.49635958671569824,
-0.1923399716615677,
0.40790075063705444,
-0.04177682846784592,
0.14924606680870056,
-0.3571329712867737,
0.05912243574857712,
-0.8113672137260437,
-0.15697671473026276,
0.9101213812828064,
-0.2273058295249939,
-0.05158904939889... | |
XmlDocument xDoc;
XmlElement root;
XmlAttribute xAtt;
xDoc = new XmlDocument();
foreach (string item in _MissionCommentsBefore)
xDoc.AppendChild(xDoc.CreateComment(item));
root = xDoc.CreateElement("mission_data");
xAtt = xDoc.CreateAttribute("version");
... | [
-0.07900283485651016,
-0.15286584198474884,
0.44304126501083374,
-0.12288716435432434,
-0.16225364804267883,
0.15749235451221466,
0.1158430278301239,
-0.393076092004776,
-0.11348129063844681,
-0.42714089155197144,
-0.7464911937713623,
0.4683551490306854,
-0.27443721890449524,
0.22341462969... | |
xDoc.AppendChild(root);
//Out the xml's!
foreach (TreeNode node in _FM_tve_Mission.Nodes)
Mission_ToXml_private_RecursivelyOut(root, xDoc, node);
foreach (string item in _MissionCommentsAfter)
xDoc.AppendChild(xDoc.CreateComment(item));
//Make this look good
... | [
0.008127020671963692,
-0.01659628376364708,
0.5834741592407227,
-0.14530497789382935,
-0.08046773821115494,
-0.178286612033844,
0.3994654715061188,
-0.5595806837081909,
-0.2735918462276459,
-0.5879395008087158,
-0.4369242787361145,
0.38203346729278564,
-0.30237850546836853,
0.0380905158817... | |
settings = new XmlWriterSettings();
settings.Indent = true;
settings.IndentChars = " ";
settings.NewLineChars = "\r\n";
settings.NewLineHandling = NewLineHandling.Replace;
settings.OmitXmlDeclaration = true;
using (XmlWriter writer = XmlWriter.Create(sb, settings))
... | [
-0.0024349275045096874,
-0.22644822299480438,
0.8279104232788086,
-0.29782137274742126,
0.455573171377182,
0.2766430974006653,
0.5338556170463562,
-0.5823089480400085,
-0.038587797433137894,
-0.584958016872406,
-0.2158220410346985,
0.49985671043395996,
-0.46789616346359253,
0.1275562345981... | |
return sb.ToString();
}
private void Mission_ToXml_private_RecursivelyOut(XmlNode root, XmlDocument xDoc, TreeNode tNode)
{
root.AppendChild(((MissionNode)tNode.Tag).ToXml(xDoc));
foreach (TreeNode node in tNode.Nodes)
Mission_ToXml_private_RecursivelyOut(root, xDoc, node);
}
`... | [
-0.23683860898017883,
-0.27007195353507996,
0.4543144404888153,
-0.19942830502986908,
0.17001581192016602,
-0.04026758298277855,
0.26738879084587097,
-0.3384123146533966,
-0.37048786878585815,
-0.6666079163551331,
-0.45543932914733887,
0.6313313841819763,
-0.5454256534576416,
0.04198538511... | |
output.writeStartElement("element");
output.writeAttributeString("a", "1");
output.writeEndElement();
```
That will give you an output of `<element a="1" />` (Just tested it in an application I am working on writing xml for)
Basically if you dont add any data before you write the end element it will just close it ... | [
0.1784362643957138,
0.0543050616979599,
0.6317364573478699,
-0.196088969707489,
-0.04512781277298927,
-0.2142621874809265,
0.2684713304042816,
-0.632159948348999,
0.02495921030640602,
-0.6674278378486633,
-0.0439855121076107,
0.5332573652267456,
-0.3228582441806793,
-0.09785063564777374,
... | |
I got a SQL Server table with columns `ResolvedDate` and `ResolvedBy`.
Now I want to select those two columns and count their results, which I thought I'd implement like that:
```
_dataContext.Activities
.Where(a => a.IsResolved && a.ResolvedBy == userId)
.Select(a => new { a.ResolvedDate, ***COUNT*** });
``... | [
-0.3078186511993408,
-0.07688971608877182,
0.4735683798789978,
-0.11945337802171707,
0.003294367343187332,
0.02407401241362095,
-0.08004704862833023,
-0.43279531598091125,
-0.499166339635849,
-0.5701475143432617,
-0.021506905555725098,
0.473638653755188,
-0.3351704478263855,
0.061530724167... | |
There reason I ask is that I had been using the strongly typed version, but ran into the issue of it not being flexible enough, so I switched over to the AdvancedQuery.Luncene which did provide the flexibility but at a loss in performance. I was thinking that the lower level query engine would be faster than than it co... | [
0.05071578174829483,
-0.18451444804668427,
0.4337174892425537,
0.08721419423818588,
0.04611538350582123,
0.07389508932828903,
-0.17824476957321167,
0.04508103057742119,
-0.36219263076782227,
-0.5166465640068054,
0.26146450638771057,
0.34963458776474,
-0.06144040450453758,
-0.11673540621995... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.