text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
public string DetailMessage { get; set; }
}
```
View Code:
```
@model RadixMVC.ViewModels.SupportViewModel
@{
ViewBag.Title = "Create New Support Ticket";
}
<h2>Radix Support: Create New Support Ticket</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script... | [
-0.2580660283565521,
-0.26450714468955994,
0.7100294828414917,
0.15680335462093353,
0.024409793317317963,
0.17333200573921204,
0.09225601702928543,
-0.6114698648452759,
-0.10640483349561691,
-0.40423908829689026,
-0.19786345958709717,
0.4934171438217163,
-0.1511351466178894,
-0.16381852328... | |
@Html.EditorFor(model => model.TicketSubject)
@Html.ValidationMessageFor(model => model.TicketSubject)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.SupportIssueID)
</div>
<div class="editor-field">
@Html.DropDownList("SupportIssueID... | [
-0.1305941492319107,
-0.21019089221954346,
0.7950469851493835,
0.1839750111103058,
0.03196440264582634,
0.18598735332489014,
0.09998878091573715,
-0.5299654603004456,
-0.28038230538368225,
-0.36964502930641174,
-0.22143015265464783,
0.20306462049484253,
-0.33566978573799133,
-0.30428621172... | |
</div>
<div class="editor-label">
@Html.LabelFor(model => model.TicketPriorityID)
</div>
<div class="editor-field">
@Html.DropDownList("TicketPriorityID", string.Empty)
@Html.ValidationMessageFor(model => model.TicketPriorityID)
</div>
<div c... | [
-0.4009905457496643,
-0.38931044936180115,
0.5812521576881409,
0.3957715332508087,
-0.1344756931066513,
0.03137720748782158,
-0.11840102076530457,
-0.4529275894165039,
-0.36476007103919983,
-0.42980456352233887,
-0.0816754549741745,
-0.007041814737021923,
-0.28383326530456543,
-0.041095770... | |
model.IsClosed)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.IsClosed)
@Html.ValidationMessageFor(model => model.IsClosed)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.DetailMessage)
</div>
<div c... | [
-0.3384774327278137,
-0.07202966511249542,
0.5940818786621094,
0.23871152102947235,
0.03773453086614609,
0.20660577714443207,
0.08218074589967728,
-0.7313292026519775,
-0.1723681539297104,
-0.37747499346733093,
-0.16542445123195648,
0.3286196291446686,
-0.024661270901560783,
0.030971830710... | |
@*@Html.EditorFor(model => model.DetailMessage)*@
@Html.ValidationMessageFor(model => model.DetailMessage)
<br />
@{ Html.Telerik().EditorFor(model => model.DetailMessage)
.Name("DetailMessageEditor")
.HtmlAttributes(new { style = "height: 200p... | [
0.23963087797164917,
-0.22001223266124725,
0.6005166172981262,
-0.0796704888343811,
-0.036566585302352905,
0.2280864119529724,
0.2536115348339081,
-0.6329413056373596,
-0.47883880138397217,
-0.6199437975883484,
0.015619675628840923,
0.3648195266723633,
0.37396928668022156,
0.01389845553785... | |
.Encode(false)
.Render();
}
</div>
<div>
<br />
<input type="submit" value="Create Ticket" title="Submits a new support ticket" /> | [
0.2128986418247223,
-0.25753316283226013,
0.42414143681526184,
0.30507519841194153,
0.08565464615821838,
0.07189718633890152,
0.12538029253482819,
-0.44784966111183167,
0.08058405667543411,
-0.9681635499000549,
-0.24136222898960114,
0.16420745849609375,
-0.3414655029773712,
0.1817330121994... | |
<input type="submit" onclick="parent.location='@Url.Action("Index", "Support", "Index")'" value="Cancel" title="Return to Support Home" />
</div>
</fieldset>
}
```
And finally, Controller Code:
```
[HttpPost]
public ActionResult Create(SupportViewModel vm)
{
if (ModelState.IsValid)
... | [
0.1996537297964096,
-0.5947858095169067,
0.9260919690132141,
0.030303850769996643,
0.35992029309272766,
-0.0296902135014534,
0.16364559531211853,
-0.6078980565071106,
-0.32892879843711853,
-0.3822961151599884,
-0.2220304161310196,
0.6259822845458984,
-0.18928760290145874,
0.097420796751976... | |
SupportTicketID = Guid.NewGuid(),
EmployeeID = "123456",
TicketOpenDate = DateTime.Now,
TicketModifiedDate = DateTime.Now,
IsClosed = vm.IsClosed,
TicketSubject | [
-0.021206161007285118,
-0.39364901185035706,
0.4681767225265503,
0.4629964530467987,
0.1628381758928299,
0.0202930960804224,
0.3761286735534668,
0.14149178564548492,
-0.20772770047187805,
-0.4892125129699707,
-0.19798319041728973,
0.20959731936454773,
-0.3161896765232086,
0.044472608715295... | |
= vm.TicketSubject,
SupportIssueID = vm.SupportIssueID,
TicketPriorityID = vm.TicketPriorityID
};
TicketDetail TicketDetail = new TicketDetail()
{
TicketDetailID = Guid.NewGuid(), | [
-0.044488582760095596,
-0.6710493564605713,
0.8624970316886902,
0.39988598227500916,
0.039877284318208694,
-0.06007177755236626,
0.31879329681396484,
-0.1911637783050537,
0.01301328744739294,
-0.7698973417282104,
-0.09984007477760315,
0.4017002284526825,
-0.3615057170391083,
0.039858747273... | |
SupportTicketID = SupportTicket.SupportTicketID,
TicketOrder = 1,
EmployeeID = "123456",
DetailDate = DateTime.Now,
DetailMessage = vm.DetailMessage
}; | [
0.12963351607322693,
-0.32093775272369385,
0.3883334994316101,
0.19234372675418854,
0.36408761143684387,
0.16287852823734283,
0.44516614079475403,
-0.13472095131874084,
-0.026435190811753273,
-0.4519474506378174,
-0.13874222338199615,
0.41818302869796753,
-0.16278888285160065,
-0.054686471... | |
SupportTicket.TicketDetails.Add(TicketDetail);
db.SupportTickets.Add(SupportTicket);
db.SaveChanges();
return RedirectToAction("Index");
}
ViewBag.SupportIssueID = new SelectList(db.SupportIssues, "SupportIssueID", "Name", vm.SupportIssueID);
ViewBag.Ticket... | [
0.042168088257312775,
-0.25419604778289795,
0.9033414721488953,
0.1324189305305481,
-0.0077703846618533134,
0.3033120334148407,
0.44930264353752136,
-0.27647969126701355,
0.019630810245871544,
-0.5718252658843994,
-0.15056318044662476,
0.32411062717437744,
-0.46757739782333374,
0.099801428... | |
to get this working. The documentation is either very outdated or just doesn't explain how to do this very well (probably both). But I was able to get this working by making the following change to my Razor syntax:
```
<div class="editor-label">
@Html.LabelFor(model => model.DetailMessage)
</div>
... | [
0.17942164838314056,
-0.24069809913635254,
0.5544576644897461,
-0.15541332960128784,
-0.11012720316648483,
-0.12787263095378876,
0.40547704696655273,
-0.5941430926322937,
-0.007621283642947674,
-0.5571432113647461,
0.2503090798854828,
0.8788871765136719,
-0.019836293533444405,
-0.088790632... | |
@{ Html.Telerik().EditorFor(model => model.DetailMessage)
//.Name("DetailMessageEditor")
.HtmlAttributes(new { style = "height: 200px" })
.Encode(true)
.Render();
}
</div>
```
Removing the "Name" property from the control solved the problem of n... | [
0.19944746792316437,
-0.30590584874153137,
0.6393077969551086,
0.10542185604572296,
0.24480463564395905,
0.09509285539388657,
0.4524528682231903,
-0.6256169676780701,
-0.029725756496191025,
-0.45975247025489807,
-0.16192954778671265,
0.5000009536743164,
0.08788246661424637,
0.1374630182981... | |
anything back, but when I tried to save, I immediately got an error (something to do with XSS, cross-site scripting), and I assumed it was because the HTML wasn't being encoded. I changed the Encode property to true, and now all is good. | [
0.47045281529426575,
0.22974810004234314,
0.5639393329620361,
0.04793654754757881,
0.21639972925186157,
-0.38808757066726685,
0.4756627380847931,
0.17865988612174988,
0.07976771146059036,
-0.20990224182605743,
-0.17771612107753754,
0.37127193808555603,
-0.047357227653265,
0.331305712461471... | |
Given a JVM connecting to a PostgreSQL database (on Linux), is there a way to find out which thread in Java is responsible for a process in the database?
NB: I'm debugging a resource-leak bug, which shows up as some idle-in-transaction processes in the database. It would be useful to match these up with the thread res... | [
-0.11072240769863129,
0.027142733335494995,
0.08948380500078201,
-0.17021147906780243,
-0.19104231894016266,
-0.2621747851371765,
0.08473363518714905,
-0.14983849227428436,
-0.4565970301628113,
-0.34045830368995667,
-0.1376601755619049,
0.2819274067878723,
-0.5712575316429138,
0.1982996165... | |
and class `060150090605`, since the class name comes after the dot.
To make the random number, use, say, `Math.floor(Math.random()*5000)` instead.
A better option would be to use an incrementing global variable (eg, `_global_counter++` each time you use it), then you would not have a chance of getting two elements wi... | [
-0.05618446320295334,
-0.2506183385848999,
0.29225674271583557,
0.18694201111793518,
0.06558962166309357,
-0.05504988506436348,
0.08507879078388214,
-0.2648122310638428,
-0.4013897180557251,
-0.600501537322998,
-0.12099611759185791,
0.3051961064338684,
-0.19477182626724243,
0.0323621071875... | |
I am trying to figure out the purpose of what the .parent property achieves in this method and the "get[ClassNameHere]" methods in general that feature this property being called.
```
-(HudLayer*) getHud
{
return (HudLayer*)[self.parent.parent.parent getChildByTag:kTagHudLayer];
}
```
It's not possible to know the de... | [
0.14594663679599762,
0.224252849817276,
0.08873138576745987,
0.2533930242061615,
0.02237127348780632,
-0.08110473304986954,
0.08936677128076553,
-0.03380882367491722,
-0.14874829351902008,
-0.6894327998161316,
-0.3495562970638275,
-0.008092724718153477,
-0.17226585745811462,
0.707407176494... | |
up the stream is, and then get a new child from that parent.
Personally it seems pretty sloppy to me. I'd never code that way myself. Hard to read (as you can see) and having so many parent properties strung together like this is opening a lot of room for bugs. It would be wiser if the top parent did what it needs to ... | [
0.6339731812477112,
-0.33059731125831604,
-0.05638715252280235,
0.33086109161376953,
0.4654357135295868,
0.14037224650382996,
0.24535395205020905,
-0.08943291008472443,
0.08664634078741074,
-0.29450541734695435,
0.3943338990211487,
0.3156222701072693,
0.04620404541492462,
0.210679695010185... | |
I have an assembly I would like to load from a sub-folder of the appbase. I set that sub-folder in the PrivateBinPath during AppDomain creation.
The issue is that I have another version of the same DLL in the appbase. From the way it looks, the resolver detects the wrong version first, says that there is a mismatch an... | [
0.0922897607088089,
0.1183897852897644,
0.4758460819721222,
-0.3314836323261261,
-0.06190669536590576,
0.11913813650608063,
0.35944414138793945,
-0.03791692480444908,
-0.2649063766002655,
-0.7526905536651611,
-0.22397921979427338,
0.5392513275146484,
-0.7497264742851257,
0.1422939896583557... | |
is found?
You can use `AppDomainSetup.PrivateBinPathProbe`:
```
AppDomainSetup.PrivateBinPathProbe = "x"
```
**Edit:** Just setting this to another value than `null` is enough, see also this MSDN entry:
<http://msdn.microsoft.com/en-us/library/system.appdomainsetup.privatebinpathprobe.aspx> | [
-0.08558063209056854,
-0.04644244164228439,
0.22190025448799133,
0.19054792821407318,
0.4561401903629303,
-0.10402523726224899,
0.3192835748195648,
0.11338392645120621,
-0.2852669060230255,
-0.8287184238433838,
-0.27428725361824036,
0.5227161049842834,
-0.41064929962158203,
0.1391189992427... | |
**Update**: Added simple test example <http://jsfiddle.net/7UhrW/1/> using normalize.css.
Chrome/WebKit and Firefox have different rendering engines which render fonts differently, in particular with differing dimensions. This isn't too surprising, but what's surprising is the magnitude of some of the differences.
I ... | [
0.3227744400501251,
0.10988283157348633,
0.4298049211502075,
-0.0008678023004904389,
-0.20390945672988892,
0.21679523587226868,
0.5859445929527283,
-0.117540143430233,
-0.30867448449134827,
-1.0868858098983765,
0.0591740608215332,
0.6245121955871582,
-0.1723271608352661,
-0.201249077916145... | |
instance, if I take the reset package from <http://html5reset.org/>, I can show pretty big differences (note the layout dimensions shown in the inspectors). [The images below are actually higher res than shown/resized in this answer - eg in Chrome you can right-click and Open Image in New Tab.]
```
<h1 style="font-siz... | [
-0.005246039945632219,
0.18574897944927216,
0.5883182883262634,
-0.17376993596553802,
-0.29213082790374756,
0.27328556776046753,
0.23118151724338531,
-0.6035459041595459,
-0.33812034130096436,
-0.8004986047744751,
-0.0741802453994751,
0.7178412079811096,
-0.14015749096870422,
-0.1643945425... | |
"MyriadProRegular";
src: url("fonts/myriadpro-regular-webfont.eot");
src: local("?"), url("fonts/myriadpro-regular-webfont.woff") format("woff"), url("fonts/myriadpro-regular-webfont.ttf") format("truetype"), url("fonts/myriadpro-regular-webfont.svg#webfonteknRmz0m") format("svg");
font-weight: normal;
font-sty... | [
0.3099159896373749,
-0.11570143699645996,
1.0087531805038452,
-0.32423290610313416,
0.14800620079040527,
0.2400592714548111,
0.008295904844999313,
-0.1409575343132019,
-0.23820291459560394,
-0.265652596950531,
-0.5488641858100891,
0.5512763857841492,
-0.20175838470458984,
0.073362439870834... | |
heights, the vertical offsets are different, as are other elements on the page:

I've tried a few resets/normalize packages to no avail. I just wanted to confirm here that this is indeed a fact of life (even omitting the more glaring offenders like I... | [
0.5628378987312317,
-0.0950712189078331,
0.7033427953720093,
0.19816681742668152,
-0.04106999188661575,
0.08576344698667526,
0.35193145275115967,
0.01855110190808773,
-0.2815530598163605,
-0.5264074802398682,
-0.21568270027637482,
0.19779939949512482,
0.10364019870758057,
0.107136078178882... | |
**EDIT:** The question morphed into how to optimize a massive CSS change to 700 or more divs. I'm leaving the old question below to describe my original approach.
I have the following jQuery but it is not behaving as I expect. There are around 700 divs with class gr so hiding them takes a noticeable time. I am trying ... | [
0.10313490778207779,
-0.22602567076683044,
0.5669382810592651,
-0.2957461178302765,
-0.15995623171329498,
0.279013454914093,
0.4426226317882538,
-0.34602829813957214,
-0.1409800946712494,
-0.7659507989883423,
-0.2019473910331726,
0.650119423866272,
-0.18531344830989838,
-0.2047651708126068... | |
class="pronlink" id="togglePron">Show/hide P</div>
<div class="gr">hai</div><div class="zi">A</div>
<div class="gr">nao</div><div class="zi">B</div>
etc.
```
Thanks to Mike Lentini [there's a jsfiddle for this question.](http://jsfiddle.net/SVf5k/4/)
**[This is the full page I'm working on](http://freezoo.alwaysd... | [
0.07663983851671219,
-0.2389577031135559,
0.4093468487262726,
-0.30540868639945984,
-0.21052972972393036,
-0.10656221956014633,
0.2409052848815918,
-0.3338789939880371,
-0.2831119894981384,
-0.6103813052177429,
-0.13790316879749298,
0.5418448448181152,
-0.40820059180259705,
-0.301135748624... | |
in Chrome happen? Or a better way to do what I am describing?
One way would be to dynamically modify your css styles directly (not per element) using javascript.
In your page, all of the text divs in each `<td>` have a `class='gr'` in them WITH an inline `style="display:block;"`. First I'd move the `display:block;` i... | [
0.3980816900730133,
0.2435242384672165,
0.5593998432159424,
-0.16469018161296844,
-0.2661457061767578,
-0.040738824754953384,
0.13271161913871765,
-0.2187359482049942,
0.00583458598703146,
-0.6944164633750916,
0.010104693472385406,
0.5672364234924316,
-0.28021663427352905,
-0.1582767814397... | |
this). Remove the display block (which is a simple `stylesheet.deleteRule(<index>)` index will be zero because you put it first in .css). Add a new `display:none;`.
This will essentially change the whole css for the page vs changing them individually PER element as you're forced to do with JQuery.
Maybe not the most ... | [
0.2269188016653061,
-0.2584691643714905,
0.36742889881134033,
0.07314525544643402,
-0.23734910786151886,
-0.21105432510375977,
0.301605224609375,
-0.029277261346578598,
-0.5603464841842651,
-0.6290995478630066,
-0.44527366757392883,
0.364796906709671,
-0.329129695892334,
-0.076225183904170... | |
here for posterity :) )
On a side note, someone should make a feature request to JQuery to be able to do something like this with ease. :)
---
**Follow Up 2:** *just realized someone else posted solution this before me*
Another way you can do this is to remove the 'gr' class and add another 'grHide' class.
Check ou... | [
0.123223677277565,
-0.11127860099077225,
0.478304386138916,
0.029651973396539688,
-0.2414337396621704,
-0.14087866246700287,
0.20632866024971008,
-0.2592972218990326,
-0.5606276392936707,
-0.7185288667678833,
0.2128673493862152,
0.4204203486442566,
0.09861684590578079,
0.027935683727264404... | |
have it be very quick. The fiddle is quick anyways. | [
-0.03016572631895542,
0.007286413107067347,
-0.43137127161026,
0.08307337015867233,
-0.10132399946451187,
0.2563323378562927,
0.26734763383865356,
0.20586355030536652,
0.13571204245090485,
-0.3963744044303894,
0.4201098084449768,
0.7073474526405334,
0.3012010455131531,
-0.42659130692481995... | |
There are a lot of former Java developers at my company who use camel casing in C# for both of these. What casing is most widely accepted / used for C#?
[Here is the Microsoft Conventions](http://msdn.microsoft.com/en-us/library/ms229043.aspx)
[:
File "./run", line 27, in <module>
mail.login("xxx@dddd.com", "xxxxx123")
File "/usr/lib/python2.6/imaplib.py", line 498, in login
typ, dat = self._simp... | [
0.0019938675686717033,
0.39859193563461304,
0.590923547744751,
-0.2306728959083557,
0.0552670881152153,
0.18528038263320923,
0.6255818605422974,
-0.13223959505558014,
-0.12118875235319138,
-0.7774868011474609,
-0.1913880854845047,
0.7967537045478821,
-0.3587208688259125,
0.2723909616470337... | |
True:
try:
print 'Connecting to Inbox..'
mail.select("inbox") # connect to inbox.
result, data = mail.uid('search', None, 'UNSEEN')
uid_list = data[0].split()
print len(uid_list), 'Unseen emails.'
if len(uid_list) > 20:
os.system('heroku restart --app xxx-xx-... | [
0.056624636054039,
-0.22457443177700043,
0.46599382162094116,
-0.033287402242422104,
0.3080679178237915,
0.07622850686311722,
0.7808747291564941,
-0.3025834262371063,
-0.4240163564682007,
-0.43997421860694885,
-0.3959464430809021,
0.7326798439025879,
-0.08125349879264832,
-0.12758034467697... | |
print 'Error'
time.sleep(120)
imap_host = 'imap.gmail.com'
mail = imaplib.IMAP4_SSL(imap_host, 993)
mail.login("xxx@xxx.com", "xxxx")
pass
```
And I also get this error a lot:
```
Traceback (most recent call last):
File "./run", line 10, in <module>
mail.login("xxx@xxx.c... | [
0.08810698240995407,
0.40501609444618225,
0.3463761806488037,
-0.11210273206233978,
0.22302934527397156,
0.18979929387569427,
0.7032214403152466,
-0.12000758945941925,
-0.2650841474533081,
-0.7488535642623901,
-0.1351262480020523,
0.8181023597717285,
-0.48639774322509766,
0.013895698823034... | |
return self._command_complete(name, self._command(name, *args))
File "/usr/lib/python2.6/imaplib.py", line 893, in _command_complete
self._check_bye()
File "/usr/lib/python2.6/imaplib.py", line 808, in _check_bye
raise self.abort(bye[-1])
imaplib.abort: [UNAVAILABLE] Temporary System Error
```
[Here is the... | [
-0.19750671088695526,
0.2858688235282898,
0.4105771780014038,
-0.386865496635437,
-0.017290588468313217,
0.016334524378180504,
0.2898446023464203,
-0.522892415523529,
-0.19804976880550385,
-0.3562358319759369,
-0.2310895323753357,
0.9077807664871216,
-0.14110319316387177,
-0.26920956373214... | |
On a current Android project, I pass some data between a couple activities. I was just curious if there is a best practice on sending data between activities. I have a string that will be updated/appended based on the results of one activity, then used for a Facebook share two activities later. Should this string be se... | [
0.6175222992897034,
-0.3070184886455536,
0.37613022327423096,
0.10985913872718811,
0.08432681858539581,
-0.016809796914458275,
0.0895003229379654,
0.0016860748874023557,
-0.2593592405319214,
-0.6972639560699463,
0.12868447601795197,
0.417988121509552,
-0.3568277359008789,
-0.27857342362403... | |
Either way will work, just would like to know if one is preferred above another.
In my view, only the Intent will work. On Android your application has to be prepared for the event it is killed (for example, an incoming video call puts it into background and also consumes a lot of memory so the background apps are kill... | [
0.17192192375659943,
-0.14097018539905548,
0.2811441719532013,
0.08425174653530121,
0.18441738188266754,
0.0483870767056942,
0.3956376612186432,
-0.04850592091679573,
-0.1309691220521927,
-0.6863294839859009,
-0.08351779729127884,
0.7629849314689636,
-0.3778128921985626,
-0.148285403847694... | |
you don't save them, is lost/reset. | [
0.5201366543769836,
-0.12001708894968033,
-0.16151246428489685,
0.4052284061908722,
0.450493723154068,
0.4424571096897125,
0.41998159885406494,
0.16507846117019653,
-0.31746378540992737,
-0.5914196968078613,
-0.323831170797348,
0.413451224565506,
-0.12062270194292068,
0.10378805547952652,
... | |
I have been looking at TLS recently, and I am unsure as to why it is so secure, but probably thanks to a misunderstanding of how it works. But if the entire handshake is recorded, either using a man in the middle attack or a packet sniffer on the target computer, then any of the remaining communication can be decrypted... | [
0.1977992206811905,
-0.10902164876461029,
0.3482193648815155,
0.34709078073501587,
0.08435577899217606,
-0.49605968594551086,
0.13831426203250885,
0.07139135897159576,
-0.15529894828796387,
-0.34370923042297363,
-0.15927807986736298,
0.26363852620124817,
-0.1708836555480957,
0.097222127020... | |
sent by the client to the server in the TLS handshake is encrypted using the server's [public key](http://en.wikipedia.org/wiki/Public-key_cryptography). So even if the packets are captured on the wire, it would require the private key (which is assumed to be known only to the server) to decrypt the packets. | [
0.05987677723169327,
-0.3302987813949585,
0.4570225775241852,
0.20340496301651,
0.02563229575753212,
-0.22481556236743927,
0.25373169779777527,
-0.027270637452602386,
-0.07515797764062881,
-0.25977563858032227,
-0.5253399014472961,
0.04750216379761696,
-0.23741044104099274,
0.1427745223045... | |
in Php, I want to print **Düsseldorf** using
```
echo 'Düsseldorf';
```
However it turns out to be something like this **D�sseldorf**
Please suggest what should I do to print european characters mostly non-english.
If you are able to specify it as a constant, do the following.
```
$echo 'Düsseldorf';
```
... | [
0.08095847815275192,
0.19445860385894775,
0.5128592252731323,
-0.07803210616111755,
-0.21339082717895508,
0.18806758522987366,
-0.005060836672782898,
0.03773516044020653,
-0.14471535384655,
-0.4372866153717041,
0.05640218034386635,
-0.07910078763961792,
-0.41935211420059204,
-0.17452506721... | |
My program takes a measurement once per loop and sleeps for a specified amount, in this case 10 seconds. It also measures time. It measures the time in two ways. Once with time.strftime, and another with time.clock(). On most of my computers, these results are totally consistent and I have no problems. On one computer,... | [
0.5406580567359924,
0.16751328110694885,
0.0982162207365036,
-0.15181680023670197,
-0.0656234547495842,
0.4184989333152771,
0.3048705756664276,
-0.35628175735473633,
-0.5279482007026672,
-0.515036404132843,
0.43097931146621704,
0.41143593192100525,
-0.23680727183818817,
0.14297035336494446... | |
time.clock()
while(blah)
cycleBeginTime = time.clock()
...
t = time.strftime("%Y-%m-%d %H:%M:%S")
...
cycles += 1
cycleEndTime = time.clock()
wakeUp = startTime + cycles * self.delay
if cycleEndTime > wakeUp: #we overslept | [
0.4903113842010498,
-0.04870609939098358,
0.6137685775756836,
-0.3680300712585449,
0.17121119797229767,
0.21091586351394653,
0.5137487649917603,
-0.3359103500843048,
-0.48811545968055725,
-0.7724756598472595,
-0.0971992015838623,
0.5564097762107849,
-0.2869933843612671,
0.40403497219085693... | |
continue
else:
#not guaranteed to sleep for the exact specified amount of time
time.sleep(float(wakeUp - cycleEndTime))
afterSleepTime = time.clock()
print ("sleep(" + str(wakeUp - cycleEndTime) + ") lasted " +
str(afterSleepTime - cycleEndTime) +" seconds\... | [
0.4114336669445038,
-0.2427280992269516,
0.6179171800613403,
-0.2427457571029663,
0.5867063999176025,
-0.3233984112739563,
0.58905029296875,
-0.1516604870557785,
-0.38837316632270813,
-0.35504594445228577,
-0.32936716079711914,
0.7519620060920715,
-0.20125572383403778,
-0.05605615675449371... | |
"Total time for this cycle: " +
str(afterSleepTime - cycleBeginTime) +
"\ntime from start of cycle to sleep " +
str(cycleEndTime-cycleBeginTime) )
```
Here's the results on the console for the time as measured with time.clock. Skip ahead to the next part for a summary.
``... | [
0.3348509669303894,
-0.0886576771736145,
0.6776854991912842,
-0.3717358410358429,
0.08970562368631363,
0.16499225795269012,
0.450971394777298,
-0.36504459381103516,
-0.5799254775047302,
-0.6739616990089417,
0.17659372091293335,
0.5656296610832214,
0.022136442363262177,
0.07096770405769348,... | |
4.50274184753
time from start of cycle to sleep 0.189196719463
sleep(9.83803382537) lasted 4.35964227608 seconds
Total time for this cycle: 4.5216022856
time from start of cycle to sleep 0.161960009523
sleep(9.83973893539) lasted 4.36409510551 seconds
Total time for this cycle: 4.52435043356
time from start of cycle to... | [
0.13320934772491455,
-0.1037185788154602,
0.5166457295417786,
-0.3259066343307495,
-0.1761210709810257,
0.32839301228523254,
0.9242669343948364,
-0.42985638976097107,
-0.7471871972084045,
-0.727961003780365,
0.03643321990966797,
0.6732248663902283,
-0.2678573727607727,
0.23767441511154175,... | |
seconds
Total time for this cycle: 2.81505236078
time from start of cycle to sleep 0.198989581976
sleep(19.7569903213) lasted 2.64424758408 seconds
Total time for this cycle: 2.8228942459
time from start of cycle to sleep 0.178646661821
sleep(26.8608515814) lasted 3.1923968974 seconds
Total time for this cycle: 3.4404... | [
-0.016802361235022545,
-0.028792593628168106,
0.4162837564945221,
-0.33783647418022156,
-0.3302365243434906,
0.3498535454273224,
0.9468110799789429,
-0.28495246171951294,
-0.7571488618850708,
-0.7802991271018982,
0.20267224311828613,
0.5559071898460388,
-0.3625863492488861,
0.2437808215618... | |
to sleep 0.157254922059
sleep(30.5384771841) lasted 11.3943939803 seconds
Total time for this cycle: 11.5739287254
time from start of cycle to sleep 0.179534745126
sleep(29.032023896) lasted 9.57638019147 seconds
Total time for this cycle: 9.6907935091
time from start of cycle to sleep 0.114413317628
sleep(28.99974370... | [
0.05712274834513664,
-0.08803803473711014,
0.485007107257843,
-0.36235275864601135,
-0.06272152066230774,
0.2794314920902252,
0.9962763786315918,
-0.3461717665195465,
-0.566203236579895,
-0.7130200862884521,
-0.11875654011964798,
0.8230500221252441,
-0.30258670449256897,
0.1082647666335105... | |
11.7081641622
time from start of cycle to sleep 0.168606525989
```
Here's a summary of the timestamps taken with time.strftime, as compared with the measurements from time.clock and the attempted sleep time.
```
2012-04-04 17:22:07
2012-04-04 17:22:17 (diff 10s. Attempted sleep time 10s time.clock says 4.5s)
2012-... | [
0.20516259968280792,
0.2739914357662201,
0.5609671473503113,
-0.3538602888584137,
0.10236481577157974,
0.39518964290618896,
1.0062055587768555,
-0.6734597682952881,
-0.5017949938774109,
-0.6018604636192322,
-0.045036736875772476,
0.5304573178291321,
-0.009649647399783134,
-0.00857941620051... | |
time 29.4s time.clock says 11.7s)
```
As you can see, time.strftime agrees with sleep most, but not all of the time (they disagree on 2012-04-04 17:23:46), while time.clock gives completely bogus nonsense all the time. Is there something that would cause these two functions to give complete nonsense results?
EDIT: t... | [
0.4484706521034241,
0.24995847046375275,
0.6352673172950745,
-0.15941216051578522,
0.18168780207633972,
-0.2589987814426422,
0.4915419816970825,
-0.08214448392391205,
-0.4677828550338745,
-0.6171291470527649,
-0.14696486294269562,
0.43840286135673523,
-0.12000972032546997,
0.40979912877082... | |
he may be correct in spite of the docs. When I replaced all my calls to time.clock() with calls to time.time(), my program now works even on the problem computer.
If you are able to specify it as a constant, do the following.
```
$echo 'Düsseldorf';
```
For further information refer to the chart here: <http://w... | [
0.27618977427482605,
0.33023014664649963,
0.41280603408813477,
-0.03971659019589424,
0.3542965054512024,
0.21980305016040802,
0.008826510049402714,
-0.07485648989677429,
-0.09567476809024811,
-0.5749934911727905,
-0.04557991027832031,
0.24368084967136383,
-0.32719820737838745,
0.2627613842... | |
I am trying to restrict signups to a Devise admin. If possible, I would like to avoid using CanCan for now. I have created a separate Devise Admin model as described in option #1 here: <https://github.com/plataformatec/devise/wiki/How-To:-Add-an-Admin-Role>.
Next, I set up a CRUD interface for users as described here:... | [
0.16629958152770996,
0.14893771708011627,
0.8044565916061401,
-0.05851081386208534,
-0.07769349217414856,
-0.049959853291511536,
-0.19570881128311157,
-0.21513988077640533,
0.05436258018016815,
-0.9293794631958008,
0.43164587020874023,
0.48031824827194214,
-0.2750380039215088,
0.2213677614... | |
can't use `before_filter :authenticate_admin!` in Users controller because admin and user are two different models in your app.
I don't know if I fully understand what you mean, but you can do this if you don't want to accept new registrations for User (or Admin):
```
# in your User(Admin) model
devise :registerable... | [
0.15963365137577057,
0.013671825639903545,
0.364585280418396,
0.2014647275209427,
0.10361043363809586,
-0.15687555074691772,
0.24640654027462006,
-0.06158570945262909,
-0.13176092505455017,
-0.7433655858039856,
-0.06368045508861542,
0.38614824414253235,
-0.4733993709087372,
0.2437558472156... | |
I found a very strange bug with Firebreath today. I was trying to compile my project, doing a `make` over my build directory. I got a [huge output](http://pastebin.com/Pr76ffZe) with a lot errors. I tried running a new project from the scratch and I got these errors:
```
alucard@hell ~/Documentos/sc/build
> make
[ 1%... | [
-0.19866076111793518,
0.3888729512691498,
0.27791884541511536,
-0.10646989196538925,
-0.01360453013330698,
0.21336045861244202,
0.17275817692279816,
-0.20854555070400238,
0.012558208778500557,
-0.42817994952201843,
0.08520980179309845,
0.6491715908050537,
-0.5073677897453308,
0.07017572224... | |
unavaliable: it has been explicitly disabled with BOOST_DISABLE_THREADS"
In file included from /home/alucard/Documentos/sc/firebreath/src/3rdParty/boost/boost/thread/detail/config.hpp:20:0,
from /home/alucard/Documentos/sc/firebreath/src/3rdParty/boost/libs/thread/src/tss_null.cpp:7:
/home/alucard/Do... | [
-0.5337153077125549,
0.2712637782096863,
0.4314024746417999,
-0.13981102406978607,
0.2663542926311493,
0.05769379809498787,
0.47187340259552,
-0.06057490035891533,
-0.29257431626319885,
-0.3593401312828064,
-0.21826407313346863,
0.7206438779830933,
-0.39306384325027466,
0.0646577998995781,... | |
patch to my `libstdcpp3.hpp` file located in `src/3rdParty/boost/boost/config/stdlib`.
2. Delete my build directory and rerun the `prepmake.sh`.
Thanks to @taxilian again for the fast and useful answer. | [
0.10341788828372955,
0.06594028323888779,
0.16177566349506378,
0.041460275650024414,
0.03959153965115547,
0.026176607236266136,
0.7021915912628174,
0.1925455629825592,
-0.004031944088637829,
-0.8609251379966736,
-0.3468564450740814,
0.7306456565856934,
-0.30429530143737793,
-0.068857438862... | |
In Excel VBA, `Range("A1").Value` should return the underlying value of the range A1 on the worksheet. But I'm getting a different value if the cell is formatted as Accounting.
How do I get the actual underlying value of the cell?
**Worksheet**
Make a new document, enter the following values in cells:
* A1: 0.00001... | [
0.0126222288236022,
0.5043851733207703,
0.4357319176197052,
-0.5915883183479309,
-0.23303288221359253,
0.27987515926361084,
0.2841077148914337,
-0.6447950005531311,
-0.14464804530143738,
-0.10760455578565598,
-0.08387787640094757,
0.6617077589035034,
-0.2479996234178543,
-0.411885380744934... | |
String)
f = Range(addr).Value
End Function
```
As you can see, this just gets the value of a range using the `Value` method of the `Range` object.
**Worksheet**
Back to the worksheet. Enter the following values:
* B1: =f("A1")
* B2: =f("A2")
* B3: =B1=B2
`A1` and `A2` have the same underlying value, but `B1` ... | [
0.06588941812515259,
0.05461201071739197,
0.45082926750183105,
-0.4367773234844208,
0.02414860762655735,
0.07193416357040405,
0.34824010729789734,
-0.3831383287906647,
-0.09841153025627136,
-0.12332440912723541,
-0.12909458577632904,
0.4833053648471832,
-0.37922751903533936,
0.050424329936... | |
after I entered the formulas.
To repro - re-edit B2.
To get the underlying value you need to use the VALUE2 property which seems to ignore the formatting:
```
Function f(addr As String)
f = Range(addr).Value2
End Function
``` | [
0.1323382705450058,
0.12526212632656097,
0.5500962138175964,
-0.5223895907402039,
-0.009265709668397903,
-0.1749533712863922,
0.31651344895362854,
-0.49305659532546997,
0.15538835525512695,
-0.1528550535440445,
-0.13982830941677094,
0.5295690894126892,
-0.34346261620521545,
0.0844738930463... | |
Is there an easy way to unroll the stack in Tcl?
I have this strange problem where I have to get back to a particular stack frame, literally. I can get all the frame information using `info` command, but to actually get to a particular frame I will have to set some local variables in the each procedure and check them ... | [
0.3717871904373169,
-0.10704085230827332,
0.3742774426937103,
-0.0019205078715458512,
-0.11588852107524872,
-0.31937679648399353,
0.24016359448432922,
0.06935667246580124,
-0.362821102142334,
-0.3615054786205292,
0.03225986659526825,
0.5898143649101257,
-0.3411159813404083,
0.1793993711471... | |
this example:
```
proc foo-a {} {
puts a-in
foo-b
puts a-out
}
proc foo-b {} {
puts b-in
foo-c
puts b-out
}
proc foo-c {} {
puts c-in
foo-d
puts c-out
}
proc foo-d {} {
puts d-in
bar
puts d-out
}
proc bar {} {
puts bar-in
return -level 3
puts bar-out
}
foo-a
... | [
-0.28746071457862854,
0.3977009952068329,
0.10709220916032791,
-0.3725861608982086,
0.1847030073404312,
0.13786162436008453,
-0.0036475954111665487,
-0.4071575701236725,
-0.2835828959941864,
-0.48772719502449036,
-0.418212890625,
0.13367018103599548,
-0.24255238473415375,
-0.09091552346944... | |
quite hidden. Alternatively, you can also use `try` and `throw` if you've got 8.6 or a scripted implementation of them (see the [Tcler's Wiki](http://wiki.tcl.tk/21608#pagetocb8310c43) for Tcl code that was used during the discussion of the code in 8.6).
With older Tcl versions, the simplest mechanism is to use `retur... | [
0.05132819712162018,
-0.16129595041275024,
-0.12673524022102356,
0.03242919221520424,
-0.02055482007563114,
-0.21266621351242065,
0.5060785412788391,
-0.18497955799102783,
-0.17225396633148193,
-0.21364720165729523,
-0.10104458034038544,
0.5270604491233826,
-0.23589345812797546,
-0.1216423... | |
that are easier to use. | [
0.5040644407272339,
0.37669646739959717,
-0.1632164567708969,
0.31489434838294983,
0.09776207059621811,
-0.038026634603738785,
-0.09792036563158035,
-0.04834051430225372,
-0.07805579155683517,
-0.4395703375339508,
-0.02645978145301342,
0.5231063961982727,
0.11086684465408325,
-0.0568769499... | |
I need to be able to convert case in strings, so that `"Hello"` becomes `"hello"`. Ultimately, I need to compare them.
How would I convert:
```
char *string = "HEllO";
```
to the string `"hello"`?
First, your string is not declared properly, it should be:
```
char *string = "Hello";
```
Now, to convert to lowerc... | [
-0.1350124627351761,
0.04298057779669762,
0.5321208238601685,
-0.48632514476776123,
-0.18853725492954254,
0.36834824085235596,
0.3581925332546234,
-0.5436270833015442,
0.10818252712488174,
-0.6846562623977661,
-0.34934401512145996,
0.47926846146583557,
-0.13930648565292358,
-0.020346729084... | |
}
return dup; // remember to free when done!
}
``` | [
0.09544236958026886,
0.01001983042806387,
-0.11308995634317398,
-0.226482555270195,
0.3120538890361786,
-0.33269527554512024,
0.3368223011493683,
-0.030876338481903076,
-0.0913885310292244,
-0.4342879354953766,
-0.38341793417930603,
0.7397032380104065,
-0.4773687422275543,
0.17168873548507... | |
I have a method with this signature:
```
IEnumerable<string> GetCombinations(string s, int length)
```
And I am trying to use it with `string.Join` like this:
```
var combinations = GetCombinations(text, 2);
string result = string.Join(", ", combinations);
```
But I get the following compiler error:
`cannot conv... | [
-0.12483890354633331,
0.02780066803097725,
0.4120420217514038,
-0.13013125956058502,
0.09417010843753815,
-0.19382606446743011,
0.47155168652534485,
-0.3998475968837738,
-0.3938019275665283,
-0.6067755818367004,
-0.43385401368141174,
0.3728479743003845,
-0.43764805793762207,
0.059635668992... | |
I'm creating a tool for displaying Python project as an UML diagram (+ displaying some code error detection using GUI).
I scan some project using Pyreverse and I have all data I need for drawing UML diagram.
The problem is positioning of the class boxes on the canvas.
For a start, I decided to use already implemented... | [
0.01804238185286522,
-0.12497378885746002,
0.29355135560035706,
-0.031865496188402176,
-0.49831774830818176,
0.27370405197143555,
-0.12599509954452515,
-0.32656413316726685,
-0.19167953729629517,
-0.7751201391220093,
0.15487603843212128,
0.3501732647418976,
-0.27104711532592773,
0.06398218... | |
like to have some enhancements, for instance if 2 classes extend one superclass, I'd expect them to be at the same level in the graph like in [graphs generated by dot program](http://umldot.sourceforge.net/demo.gif).
It seems that the main enhancement you are missing is transforming your graph to a [layered graph.](htt... | [
0.5492805242538452,
-0.29375430941581726,
0.2933987081050873,
0.3067159652709961,
-0.15985803306102753,
-0.09729565680027008,
0.05619891732931137,
0.010649548843502998,
-0.45786532759666443,
-0.9691892862319946,
0.18412843346595764,
0.24583107233047485,
-0.33973589539527893,
0.163643732666... | |
then to draw the graph. (you can find python code to do a real topological sort online ([example](http://code.activestate.com/recipes/577413-topological-sort/)), but real TS will just produces a long line-like graph, and we want something a little different)
So I'll try to describe an algorithm to transform a given gr... | [
0.06497269868850708,
-0.42628413438796997,
0.4921422302722931,
0.02320701815187931,
-0.47966861724853516,
-0.001128642470575869,
-0.13621242344379425,
-0.02691596746444702,
-0.456102579832077,
-0.9376183152198792,
-0.0832393616437912,
-0.11156286299228668,
-0.5328271985054016,
0.1229578480... | |
layered graph, but that will brake the layering and make the graph less pretty :). Since Finding the smallest possible set of edges you can remove is NP-complete (very hard) - I think you'll have to do some shortcuts here, and not necessarily find the minimal set of edges, but do it in reasonable time.
2. Brake the gra... | [
0.217357337474823,
-0.1852240264415741,
0.3683403730392456,
0.18535514175891876,
-0.2668672800064087,
-0.0551043301820755,
0.23590967059135437,
-0.15186861157417297,
-0.32136309146881104,
-0.8851255178451538,
0.11002970486879349,
0.46749067306518555,
-0.4855412244796753,
-0.211817756295204... | |
a line-like graph in some simple cases, but it suits quite well in the case of UML graphs.
3. A good graph is one that has the smallest number of edges [crossing each other](http://en.wikipedia.org/wiki/Crossing_number_%28graph_theory%29), It doesn't sound important but this fact contributes greatly to the overall look... | [
-0.09441405534744263,
-0.32519230246543884,
0.4803968667984009,
0.19530780613422394,
-0.463311105966568,
-0.034297868609428406,
0.7083420157432556,
-0.03061165101826191,
-0.2559620141983032,
-1.024685025215149,
-0.014552637003362179,
-0.24850469827651978,
-0.5932602882385254,
-0.1155070960... | |
position determined by finding the average or median of the positions of its neighbors on the previous level and then swapping adjacent pairs as long as that improves the number of crossings."
4. The edges removed (or reversed) in the first step of the algorithm are returned to their original position.
And there you h... | [
-0.07767174392938614,
-0.33661797642707825,
0.6412963271141052,
0.25228196382522583,
-0.051006268709897995,
0.09296193718910217,
-0.2652150094509125,
0.21839360892772675,
-0.4016138017177582,
-0.899228036403656,
0.18360570073127747,
0.04638512432575226,
0.02589346095919609,
0.1739138513803... | |
optimizations can be made to better handle your specific case.
* If you want more ideas for features for your UML tool, look at the wonderful work done by Jetbrains for their [IntelliJ UML tool](http://www.jetbrains.com/idea/training/demos/uml-class-diagrams.html)
Hope that my comments here are helpful in any way.
**... | [
-0.3200477063655853,
0.021638229489326477,
0.2814602255821228,
0.2783496379852295,
-0.18662448227405548,
0.30029910802841187,
-0.2700612246990204,
-0.20484291017055511,
-0.41131842136383057,
-0.7286767959594727,
-0.005200824700295925,
0.5427971482276917,
-0.34236764907836914,
-0.3177836537... | |
an iterative heuristic incorporating a novel weight function and local transpositions to reduce crossings. The third pass finds optimal coordinates for nodes by constructing and ranking an auxiliary graph. The fourth pass makes splines to draw edges. The algorithm makes good drawings and runs fast."
<http://www.graphviz... | [
-0.2319835126399994,
-0.14991040527820587,
0.747744619846344,
0.30309921503067017,
-0.15996071696281433,
0.17642547190189362,
-0.07977225631475449,
-0.5941088795661926,
-0.2884639799594879,
-0.8499221801757812,
0.048985790461301804,
0.013526102527976036,
-0.07545928657054901,
-0.3526665568... | |
I am getting this error, but it isn't very helpful in that it doesn't point me near where the error is happening. What do the numbers after the error mean? I have been looking at the error for the last few hours, but I don't really get where the error is coming from. My code is:
```
val str = "(and x y)";
def stringP... | [
0.3016105890274048,
0.24461768567562103,
0.5016413927078247,
-0.41543489694595337,
0.031110579147934914,
0.01848839409649372,
0.7197177410125732,
-0.2006140649318695,
-0.09930513054132462,
-0.4420475959777832,
0.014063972048461437,
0.7947106957435608,
-0.2541959285736084,
0.137398213148117... | |
= expreshHolder; //holder of expressions without parens
if(temp == 0) b = 0; else {b = temp(temp.length-1).toInt; temp.remove(temp.length-1)} //this sets the position of wherever the string was read last plus removes that check from the end of the ArrayBuffer
var arrayCounter = temp.length; //just counts to mak... | [
0.15868468582630157,
-0.1686590313911438,
0.41680416464805603,
-0.42897483706474304,
0.023899922147393227,
0.17782793939113617,
0.4735211730003357,
-0.49601081013679504,
-0.24137546122074127,
-0.13678066432476044,
-0.10847842693328857,
0.37233585119247437,
-0.47829315066337585,
-0.08605639... | |
1;} //point of this is to just skip any spaces between paren and start of expression type
if(exp(b) == 'a') {
//first create the 'and', 'or', 'not' expression types to figure out
temp += exp(b).toString;
b = b+1;
temp(arrayCounter) = temp(arrayCounter) + exp(b)... | [
-0.17639237642288208,
-0.32262060046195984,
0.09020697325468063,
-0.40291550755500793,
0.1311236321926117,
0.16969209909439087,
0.4153507947921753,
-0.31074297428131104,
0.05812784284353256,
-0.24210186302661896,
-0.4118969440460205,
0.33534786105155945,
-0.6553629636764526,
-0.22471483051... | |
letter
b = b+1;
temp(arrayCounter) = temp(arrayCounter) + exp(b).toString; //concatenates the last letter for the expression type
arrayCounter+=1
//this part now takes the symbols and puts them in an array
b+=1;
while(exp(b) == | [
0.01816822588443756,
-0.059740860015153885,
0.4772399067878723,
-0.6396095752716064,
-0.10787796974182129,
0.26466479897499084,
0.36609503626823425,
-0.47590985894203186,
0.05251866206526756,
-0.07066337019205093,
-0.341610848903656,
0.23836299777030945,
-0.5829868316650391,
-0.15744519233... | |
' ') {b+=1;} //just skips any spaces until it reaches the first symbol
if(exp(b) == '(') { temp += b.toString; temp = stringParse(exp, temp);
b = temp(temp.length-1).toInt;
temp.remove(temp.length-1);
arrayCounter = temp.length
} else { | [
0.13612578809261322,
-0.17866434156894684,
0.6490815281867981,
-0.5028059482574463,
0.011776142753660679,
0.23412486910820007,
0.44978177547454834,
-0.6323698163032532,
-0.19022849202156067,
-0.23744913935661316,
-0.34765276312828064,
0.04876633733510971,
-0.5164937376976013,
0.00547788664... | |
temp += exp(b).toString;
arrayCounter+=1; b+=1; }
while(exp(b) == ' ') {b+=1;} //just skips any spaces until it reaches the second symbol
if(exp(b) == '(') { temp += b.toString; temp = stringParse(exp, temp);
b = temp(temp.length-1).toInt; | [
-0.0023899876978248358,
-0.3213209807872772,
0.6329874396324158,
-0.43627962470054626,
-0.08409672975540161,
0.24423567950725555,
0.5637384057044983,
-0.588394045829773,
-0.15600921213626862,
-0.3457552492618561,
-0.21650834381580353,
0.13945335149765015,
-0.5198162198066711,
-0.0132641391... | |
temp.remove(temp.length-1);
arrayCounter = temp.length } else {temp += exp(b).toString; arrayCounter+=1; b+=1; }
}
temp;
} else {
temp(arrayCounter) +="failed"; temp;} //this | [
0.17298050224781036,
-0.12500862777233124,
0.14218054711818695,
-0.39702439308166504,
0.12035071849822998,
0.1018548533320427,
0.7987825274467468,
-0.595632016658783,
-0.005646629258990288,
-0.19898654520511627,
-0.13198302686214447,
0.30915555357933044,
-0.5145588517189026,
-0.05273174121... | |
is just incase it fails and I should probably check this incase it fails when it doesnt encounter an opening paren
}//end of while loop
hold = stringParse(str, ho );
for(test <- hold) println(test);
```
Sorry for the amount of code, but from what I can tell it is correct. The point of this code is to read this the f... | [
0.08588990569114685,
0.0903785452246666,
0.3646945059299469,
-0.23910339176654816,
0.26041293144226074,
-0.2231009602546692,
0.7400978803634644,
-0.06679350882768631,
-0.11063426733016968,
-0.3989546298980713,
-0.12491483241319656,
0.5257008671760559,
-0.3048335313796997,
-0.10921996831893... | |
is:
```
java.lang.ArrayIndexOutOfBoundsException: -1
at scala.collection.mutable.ResizableArray$class.apply(ResizableArray.scala:45)
at scala.collection.mutable.ArrayBuffer.apply(ArrayBuffer.scala:44)
at Driver$.stringParse$1(Driver.scala:19)
at Driver$.main(Driver.scala:60)
at Driver.main(Driver.scala)
at sun.reflect... | [
-0.4026038646697998,
0.10320352762937546,
0.4723852276802063,
-0.2540986239910126,
0.004470529966056347,
0.28402113914489746,
0.13552534580230713,
-0.6820775866508484,
-0.37042945623397827,
-0.7631306052207947,
-0.39596986770629883,
0.40478894114494324,
-0.40050363540649414,
0.138016998767... | |
I have been trying to get this bit of code to work without success. gdb tells me that there is a segfault somewhere in the void Compiler::GenerateCode\_ToFile(char\* filename) function, and I have manually traced the problem to somewhere in the line:
```
std::string tempfile = this->code->CodeGen( temp, AST_TYPE_UNDE... | [
0.1535666584968567,
0.20570838451385498,
0.10805434733629227,
-0.021424980834126472,
0.12920984625816345,
-0.1567573845386505,
0.40772417187690735,
0.17240360379219055,
-0.1940593272447586,
-0.6312605142593384,
-0.00823938101530075,
0.6985276937484741,
-0.36709529161453247,
0.2046950310468... | |
full path.
strcpy( directory, this->cwd.c_str());
strcat( directory, filename);
if(this->isVerboseMode)
std::cout << "Source Output: " << directory << '\n';
std::fstream file( directory, std::ios::out);
int* temp = new int;
Symtable* symtab = new Symtable;
file << emit_core_code();
file << "\n\n";
std::string te... | [
-0.09835243225097656,
-0.4631339907646179,
0.7347412705421448,
-0.09435991942882538,
0.13971872627735138,
0.15741677582263947,
0.35570859909057617,
-0.22293494641780853,
-0.2390267699956894,
-0.7626239657402039,
-0.42405766248703003,
0.5333128571510315,
-0.49196603894233704,
-0.06782730668... | |
expression nodes.
class ExprAST {
public:
virtual ~ExprAST() {}
virtual std::string CodeGen(int* GeneratedCodeOpType,int WantOpType,Symtable* symtab, int depth) {return std::string("");};
virtual void DebugPrint(int level){return;};
virtual int GetType(void){return AST_TYPE_UNDEF;};
virtual void* GetCollectio... | [
0.16867849230766296,
-0.3935248553752899,
0.7508248090744019,
0.05862213298678398,
0.44610142707824707,
-0.007499664090573788,
0.4773438274860382,
0.038648974150419235,
0.030766688287258148,
-0.796194314956665,
-0.40030375123023987,
0.38956522941589355,
-0.08849416673183441,
0.405395239591... | |
crashes before it is run because the Sleep() never gets run.
Can anyone see the bug that is causing this mysterious segfault?
Thanks in advance.
Check out the project from SVN to local file system first:
```
svn checkout URL /Users/Home/myproject
```
Then create an Android project and import it as existing source ... | [
0.36315110325813293,
0.134603351354599,
0.03698967397212982,
0.28044894337654114,
0.15126369893550873,
-0.11293118447065353,
0.33999454975128174,
0.16578108072280884,
-0.30133041739463806,
-0.7127857804298401,
-0.35125982761383057,
0.6539149880409241,
-0.14871780574321747,
0.01280816178768... | |
There are similar questions for C#, but we didn't see any for JavaScript.
Is it accepted practice to declare variables inside a loop?
Assume a loop of 200 iterations.
Is there a performance imperative (memory and speed) to using sample 2 over sample 1? We're using jQuery to loop. It improves code readability for us ... | [
0.3179287910461426,
-0.18627411127090454,
-0.09167780727148056,
-0.28128257393836975,
-0.14549705386161804,
0.2157609909772873,
0.40543246269226074,
-0.7319965362548828,
-0.05694643780589104,
-0.2735947072505951,
0.26690927147865295,
0.32430779933929443,
-0.5556612610816956,
-0.06615398079... | |
i = null;
*** edit i ***
$(this).each( function() {
i = $(some_div).clone();
$(another_div).append( i );
});
```
Sample 1 (variable inside) is faster:
<http://jsperf.com/variable-outside-faster>
But the difference is not worth enough to care about. | [
0.3183581829071045,
-0.22146838903427124,
0.34955930709838867,
-0.2800791561603546,
-0.07816226780414581,
0.010340150445699692,
0.4513976573944092,
-0.5017556548118591,
-0.06836055964231491,
-0.48370999097824097,
0.09125560522079468,
0.3022642433643341,
-0.41190865635871887,
0.225663423538... | |
I have two tables, one for English category names, and another for Spanish category names.
I am attempting to write a small interface which allows an admin to see for which English categories a translation must still be provided.
I will write it assuming that when you create a Spanish category, it inherits the ID o... | [
-0.05569993704557419,
0.37498822808265686,
0.41328713297843933,
-0.043392013758420944,
-0.18866318464279175,
0.1959935575723648,
0.01361545454710722,
-0.1463116854429245,
-0.16612158715724945,
-0.6602481603622437,
-0.0038093519397079945,
0.6222050189971924,
-0.11912012100219727,
0.24525283... | |
entries:

This serves my purpose well, but there is one deficiency. If there is no row in the Spanish table, it does not return a derived row at all.
How could I change my query so that, if there is a row in the English table but not the Spanish one... | [
-0.25673413276672363,
0.3369486331939697,
0.4980519711971283,
0.20137082040309906,
-0.22829949855804443,
-0.12098610401153564,
0.4191409647464752,
-0.005391059909015894,
-0.09469592571258545,
-0.662224292755127,
-0.37608852982521057,
0.5355365872383118,
0.03655378893017769,
0.2435764521360... | |
es_name
FROM tbl_cms_categories_en AS en
LEFT JOIN tbl_cms_categories_es AS es
ON tbl_cms_categories_en.id = tbl_cms_categories_es.id
``` | [
-0.13145945966243744,
0.38080358505249023,
0.471418172121048,
-0.032198842614889145,
-0.28160715103149414,
0.2495565116405487,
0.1942964792251587,
-0.2105574607849121,
-0.3304208219051361,
-0.6893048286437988,
-0.15810436010360718,
0.39237725734710693,
-0.10286939144134521,
0.3370362818241... | |
So, poking through the n869 draft of the C99 standard I stumbled across this section:
> **6.10.7 Null directive Semantics**
>
>
> A preprocessing directive of the form
>
>
>
> ```
> # new-line
>
> ```
>
> has no effect.
So, I wrote this program to test it out:
```
#
#include <stdio.h>
#
int main(void)
{
pu... | [
0.2676476836204529,
0.0921061635017395,
0.07949043810367584,
-0.31073054671287537,
-0.19910486042499542,
-0.21098078787326813,
0.5471637845039368,
0.2030930370092392,
0.019269613549113274,
-0.4384998381137848,
-0.03700024634599686,
0.4180009067058563,
-0.46231529116630554,
0.29631587862968... | |
a purpose (e.g. simplifies writing a code generator).
However, I don't see how this one is useful. Can anyone think of a reasonable use case / rationale for having it at all?
```
var sum = lstDouble.Sum();
var result = lstDouble.Select(d => d / sum);
```
* [Enumerable.Sum Method](http://msdn.microsoft.com/en-us/libr... | [
-0.01992153562605381,
0.03058810718357563,
0.2765207290649414,
-0.22416368126869202,
0.010073970071971416,
-0.06992924213409424,
0.1212189793586731,
-0.5066046714782715,
-0.11768411844968796,
-0.4186253249645233,
-0.2054445743560791,
0.31789353489875793,
-0.2947120666503906,
-0.00864981487... | |
I'm making an application that requires the use of multiple textFields with number pads as there first responder. I have created an image to use as a negative button that will be an addition to the number pad.
I am wondering if there is a way to check which textField the number pad is typing to.
Any help would be app... | [
0.17824874818325043,
-0.2867608070373535,
0.4860048294067383,
0.29259541630744934,
-0.2875673472881317,
-0.14223027229309082,
-0.0089920898899436,
-0.10479691624641418,
-0.17418651282787323,
-0.7337459325790405,
-0.15168467164039612,
0.48635658621788025,
-0.20823171734809875,
0.04383213818... | |
.h:
```
MyController : NSObject <UITextFieldDelegate> //Might often be a UIViewController rather than an NSObject subclass...
```
Define a property:
```
@property (weak, nonatomic) UITextField *editingField;
```
Then synthesize in your .m:
```
@synthesize editingField = __editingField
```
Then implement:
```... | [
-0.3708408772945404,
-0.05464443936944008,
0.33207449316978455,
-0.14211507141590118,
-0.16144436597824097,
-0.19961944222450256,
0.3125315308570862,
-0.47489768266677856,
0.048051804304122925,
-0.770806610584259,
-0.7110907435417175,
0.6601740717887878,
-0.2261362373828888,
0.122378669679... | |
I saved group of points on my panel to `List<MyVector> savedPoints`, then I calculated the the point with lowest coordinate y :
```
public void searchLowest()
{
MyVector temp;
double ylon = savedPoints[0].getY();
for (int i = 0; i < savedPoints.Count; i++)
{
if (save... | [
-0.10142604261636734,
-0.107032909989357,
0.8771165013313293,
-0.20162712037563324,
0.0912461057305336,
0.369660884141922,
0.1617755889892578,
-0.1148354560136795,
-0.06734246760606766,
-0.45457255840301514,
-0.2659511864185333,
0.3426351547241211,
-0.032016571611166,
-0.026289822533726692... | |
{
ylon = savedPoints[i].getY();
lowest = i;
}
}
temp = savedPoints[lowest];
}
```
after this I made a method to calculate polar angles :
```
public static double angle(MyVector vec1, MyVector vec2)
{ | [
0.10607573390007019,
-0.08170151710510254,
0.8820610642433167,
-0.04319437965750694,
-0.2625945508480072,
0.198597714304924,
-0.023024270310997963,
-0.18540841341018677,
0.002971177687868476,
-0.3835545480251312,
-0.07159311324357986,
0.5237933993339539,
-0.2087840586900711,
-0.02487453445... | |
double angle = Math.Atan2(vec1.getY() - vec2.getY(), vec1.getX() - vec2.getX());
return angle;
}
```
now don't know how to use Gift wrapping algorithm in my case. The pseudocode on WikiPedia [link](http://en.wikipedia.org/wiki/Gift_wrapping_algorithm) is not really understandable for me, so I'm as... | [
0.40807798504829407,
0.09308043122291565,
0.4157971441745758,
-0.0884280875325203,
-0.2571934759616852,
0.04442474618554115,
0.09878691285848618,
-0.39152753353118896,
-0.03564243018627167,
-0.3435421884059906,
-0.13628926873207092,
0.47854337096214294,
-0.03944180905818939,
-0.09124039858... | |
System.Collections.Generic;
using System.Linq;
using System.Text;
class Program
{
static void Main(string[] args)
{
List<Point> test = new List<Point>(
new Point[]
{ | [
0.1591939926147461,
-0.1573057770729065,
0.2484741061925888,
-0.10813505947589874,
0.10116466879844666,
0.30877548456192017,
0.28359466791152954,
-0.17532233893871307,
-0.28965407609939575,
-0.29867246747016907,
-0.4154317378997803,
0.05513244867324829,
-0.4520217478275299,
0.4901610910892... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.