text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
So i read a lot about *why* this implementation isn't thread-safe. But I didn't find the answer how to make it thread safe and fast? The variant of make it thread safe is to add mutex(or in some cases just critical section will be enough), but it will make this method much more slower. So is there a variant to make thi... | [
0.1696765422821045,
-0.16267579793930054,
0.17180988192558289,
0.07918990403413773,
-0.09867831319570541,
0.049999408423900604,
0.21624068915843964,
-0.15720444917678833,
-0.4140048027038574,
-0.6011960506439209,
0.09772670269012451,
0.5353328585624695,
-0.42745378613471985,
-0.05544991418... | |
about thread safe Singletom implementation when we use Singleton pointer as a member of the class, the question is about this particular implementation of Singleton, without pointers and new and using lazy evaluation.
So seems the answer to my question best expressed Fred Larson in his comment:
"Fast, thread-safe, laz... | [
0.18790054321289062,
-0.3552810549736023,
-0.5790663957595825,
-0.05133399739861488,
-0.19890061020851135,
-0.25025519728660583,
0.1717904657125473,
0.1400756537914276,
-0.40380796790122986,
-0.3340868055820465,
-0.027335889637470245,
0.33980587124824524,
-0.6706639528274536,
0.06315332651... | |
I've been researching my question, rewording it in many ways but I still can't seem to find an answer. It could also be that it can't be done, hopefully someone can help me. I'm pretty new to .htaccess files but I've been creating a mobile website for my company's corporate site.
What I want it to do is when you go t... | [
0.6938753128051758,
0.2443244308233261,
0.4494272470474243,
0.14528672397136688,
0.11577318608760834,
-0.2590135633945465,
0.3483666479587555,
0.1750079244375229,
-0.22969983518123627,
-0.5298846960067749,
0.33421608805656433,
0.3857019543647766,
0.1812031865119934,
0.24365930259227753,
... | |
will redirect you back to the same page, instead of seeing the full site. I have the mobile site in a subdirectory "www.companysite.com/mobile". Can I have it so that when you choose the option to view the full site it won't keep redirecting you to the mobile site? Here is my code right now:
```
RewriteEngine On
... | [
0.1415669023990631,
0.3488772511482239,
0.6334397792816162,
-0.2968900799751282,
0.17076309025287628,
0.13715599477291107,
0.43070900440216064,
-0.1452517807483673,
-0.1805853694677353,
-0.6872406005859375,
0.04492642357945442,
0.5982135534286499,
-0.2851754426956177,
-0.1910908967256546,
... | |
solution would be:
```
## Setting a cookie and variable for mobile users
RewriteRule .* - [E=IsMobile:false]
RewriteRule .* - [E=MobileCookie:false]
# Mobile Redirection
# Blackberry
#RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} "blackberry" [NC]
RewriteRule ^$ http://mobile.websit... | [
-0.38370195031166077,
0.014348379336297512,
0.8088870644569397,
0.01898706890642643,
0.32483595609664917,
0.34180885553359985,
0.5066362023353577,
-0.27865490317344666,
-0.10098424553871155,
-0.4771285653114319,
-0.17453722655773163,
0.5548478960990906,
-0.4336545169353485,
-0.007981291972... | |
Mobile Redirection for other Mobile
RewriteCond %{HTTP_USER_AGENT} "android|palmos|webos" [NC]
RewriteRule ^$ http://mobile.website/ [L,R=302]
# Set isMobile variable to true
RewriteRule .* - [E=IsMobile:true]
# End other Mobile
## Assume the mobile cookie is not set:
RewriteRule .* - [E=M... | [
-0.1604081243276596,
-0.0725129172205925,
0.9990836381912231,
0.005476842168718576,
0.18075008690357208,
0.1633094996213913,
0.5762978792190552,
-0.6303433775901794,
-0.21691472828388214,
-0.4903130829334259,
-0.10965435951948166,
0.6939679384231567,
-0.5827752351760864,
0.1998520195484161... | |
RewriteCond %{ENV:IsMobile} ^true$
RewriteCond %{ENV:MobileCookie} !^true$
RewriteRule .* - [E=ShowMobile:true]
########## End - Custom redirects
```
Of course you would need to change mobile.website in the code above and use js or some other method to inject a mobilecookie.
Personally, I like the HTTP\_... | [
-0.025336645543575287,
0.16257980465888977,
0.8873529434204102,
-0.1758812516927719,
0.17253544926643372,
-0.025381168350577354,
0.5259257555007935,
0.011321918107569218,
-0.11286207288503647,
-0.7768266201019287,
-0.23873284459114075,
0.6827827095985413,
-0.23460735380649567,
0.1792357414... | |
If I load a txt file into my flash movie using the following...
```
var myTextLoader:URLLoader = new URLLoader();
myTextLoader.addEventListener(Event.COMPLETE, onLoaded);
function onLoaded(e:Event):void {
var myArrayOfLines:Array = e.target.data.split("a")
trace(myArrayOfLines);
}
myTextLoader.load(new URL... | [
0.5364262461662292,
-0.2633804678916931,
0.2814468741416931,
-0.4020542502403259,
0.010594183579087257,
-0.054294273257255554,
0.1318967342376709,
-0.23690536618232727,
-0.22567540407180786,
-0.5453041195869446,
-0.3273760676383972,
0.7206471562385559,
-0.436549574136734,
-0.04412018135190... | |
letter is featured in the test is the length of `str.split`'s result array - 1.
```
var res:Array = "a".split('a');
trace (res.length) // 2
trace (res) // , -- empty string on either side of the split
var count:int = res.length - 1 // 1
res = "aa".split('a');
trace (res.length) // 3
trace (res) // , , -- empty string... | [
0.21358390152454376,
-0.23234595358371735,
0.07617145031690598,
-0.26550254225730896,
-0.024931808933615685,
0.2162921130657196,
0.38656529784202576,
-0.8562700748443604,
-0.033008404076099396,
-0.52433180809021,
0.032428935170173645,
0.5324897766113281,
-0.17636162042617798,
-0.1137685999... | |
-Hello, looking for some help.
We currently have a winform app used to do approvals in our company. The app sends html emails to the "approvers" who read the relevant info in the email and click on a hyperlink which launches the app so they can do their approval.
Currently this is done by including the following in ... | [
0.596190869808197,
0.4563576877117157,
0.6692093014717102,
0.11438963562250137,
0.02079354040324688,
0.0034054138232022524,
-0.014005276374518871,
0.02971743978559971,
0.12571395933628082,
-0.2722107172012329,
0.00996618065983057,
0.5032844543457031,
0.04636656120419502,
0.0667287707328796... | |
app. This works correctly if I pass the argument from, say, a windows shortcut, however, **I cannot find a way to pass the argument to the exe in the href attribute** in order to do it from the email. I looked everywhere, and found nothing except questions.
I have tried the following to no avail:
`<a href=file:///C:... | [
0.1871994286775589,
0.4361235499382019,
0.5823624134063721,
-0.10673210769891739,
-0.1463930457830429,
0.1211579293012619,
0.28810787200927734,
-0.5983293652534485,
-0.008157514035701752,
-0.6902902126312256,
-0.17930394411087036,
0.78964763879776,
-0.57981276512146,
-0.528428852558136,
... | |
is not possible, but if I can successfully from an email run an exe, why can I not run an exe with parameters? It doesnt make sense.
Thank you for your help.
Leo
after not getting any suitable responses and after continuing my research for this without success, I will temporarily conclude that what I am looking for ... | [
0.5176883339881897,
0.26524800062179565,
0.08238928765058517,
0.5752723217010498,
0.2640920877456665,
-0.39726391434669495,
0.665457546710968,
-0.16288985311985016,
0.02964208833873272,
-0.4529595375061035,
-0.11231935769319534,
0.5227423906326294,
-0.4817318022251129,
0.1817653328180313,
... | |
require parameters to be harmful. If anyone would care to elaborate on this, it would be educational for me, thank you.
Nevertheless, I have thought of an alternative to my problem, which is not as elegant as would otherwise be stating parameters in href, but it serves my purpose. Because our app is run from a network... | [
0.43410444259643555,
0.27029189467430115,
0.31962114572525024,
0.2751789391040802,
0.1989855021238327,
-0.13124701380729675,
0.2792220115661621,
-0.16809938848018646,
0.030978461727499962,
-0.3840665817260742,
0.04822343960404396,
0.8847793936729431,
-0.6550785899162292,
0.0367783419787883... | |
the correct parameters and as the cmd files are very light and quickly written, this is OK.
I am closing this as "answered", but it is not.
Thanks for taking your time to read.
Leo | [
0.42233580350875854,
0.2537674009799957,
0.5055888295173645,
0.3515082895755768,
0.053731922060251236,
-0.6988518834114075,
0.06485676020383835,
-4.429673197137163e-7,
-0.027382241562008858,
-0.4029023349285126,
-0.29015710949897766,
0.7008920311927795,
-0.11646196246147156,
0.085558615624... | |
Sometimes we encounter some devices which have two or more SIM cards. So my question is:
How can I determine the number of SIM cards on the device?
Actually, I am developing a field test app and for example, if I have 2 SIM cards on the device, the user can choose between them to launch measurements.
There is current... | [
0.5318384766578674,
0.07105030119419098,
0.26054832339286804,
0.3905804753303528,
0.3385385274887085,
0.048568639904260635,
0.05420619249343872,
-0.16302527487277985,
-0.42191192507743835,
-0.5283440947532654,
-0.03958475589752197,
0.30981218814849854,
-0.30728647112846375,
-0.155660271644... | |
will be on a case by case basis. | [
0.22562941908836365,
0.0767553523182869,
0.43486279249191284,
-0.1398431360721588,
0.5662974715232849,
-0.13250845670700073,
-0.2976183593273163,
-0.27009251713752747,
0.3144359886646271,
-0.6391550302505493,
-0.2291538566350937,
0.6097790002822876,
0.16980843245983124,
-0.1071083098649978... | |
I am just about to issue my client with a beta version of my app and have come to adding their UDID to my provisioning profile so I can send it them and found this notice on the iOS Provisioning Portal:
> Your iOS Developer Program membership can be terminated if you provide
> pre-release Apple Software to anyone oth... | [
0.5633903741836548,
0.28609499335289,
0.06479892134666443,
-0.23650257289409637,
0.4674931466579437,
-0.2101348340511322,
0.23564891517162323,
0.08346673101186752,
-0.3012780249118805,
-0.37448757886886597,
-0.4289805591106415,
0.33448779582977295,
-0.4817676544189453,
0.19200202822685242,... | |
of Apple Confidential Information (including
> pre-release Apple Software) is prohibited and may subject you to both
> civil and criminal liability.
Firstly, does my client HAVE to be an Apple Developer themself? Also, do I risk my licence by issuing it to them?
This legal wording seems very odd...
What does every... | [
0.5904704928398132,
0.5028110146522522,
0.07967860251665115,
-0.14708109200000763,
0.35903674364089966,
-0.3947359621524811,
0.24258235096931458,
0.2340175360441208,
-0.043564323335886,
0.07737656682729721,
-0.4393840730190277,
0.3755357563495636,
-0.42931559681892395,
0.12590652704238892,... | |
here's my problems : I tried to create a simple interface from where I can click on several buttons that call differents functions, and show the result (which always is text) in a jlabel.I tried to have 2 separates parts (north/south or east/west) The first area would contain a gridlayout or flowlayout of all my button... | [
-0.006914055906236172,
-0.13115893304347992,
0.3699289858341217,
-0.4196724593639374,
-0.15834712982177734,
0.3869430720806122,
0.3403318524360657,
-0.3718130588531494,
-0.19910676777362823,
-0.41745397448539734,
-0.27184194326400757,
0.42910078167915344,
-0.6787058711051941,
-0.1554353982... | |
JButton b14 = new JButton("Help");
private static JFrame windows = new JFrame();
private static JPanel container = new JPanel();
private static JLabel res = new JLabel();
```
and here is how i added them to the JFrame (which is really awfull to see) :
```
container.add(b0);
container.add(b1);
container.add(b2);
...
... | [
0.3177536129951477,
-0.040825847536325455,
0.6319157481193542,
-0.18548348546028137,
-0.1094406247138977,
0.28221479058265686,
0.43326520919799805,
-0.19502103328704834,
-0.29135915637016296,
-0.7398756146430969,
-0.18854889273643494,
0.4134208559989929,
-0.43918925523757935,
0.26747173070... | |
take
The clause restricts your ability to distribute Apple's software, not yours. It prevents you, for example, from giving iOS betas to all and sundry. It does not affect your ability to use provisioning profiles for distributing your own betas. | [
0.681098997592926,
-0.23190392553806305,
-0.07006121426820755,
-0.0026685367338359356,
0.5013331770896912,
-0.4068441092967987,
0.08900240808725357,
-0.040312524884939194,
-0.011131146922707558,
-0.16296562552452087,
-0.23745107650756836,
0.24646541476249695,
-0.6794241070747375,
0.0680304... | |
I want to load an external website in an iframe. But faced issues due to Same-Origin-Same-domain policy. So for solving this I used the proxy solution in which we send our request to a proxy file (I wrote in java) and then it requests the server and return back the response. This is working perfectly fine.
But using t... | [
0.17593081295490265,
0.2229013741016388,
0.5326007008552551,
-0.13058574497699738,
-0.18591195344924927,
0.026100018993020058,
0.3875279426574707,
0.22884081304073334,
-0.26458850502967834,
-0.9754544496536255,
-0.0125036695972085,
0.33710700273513794,
-0.35754260420799255,
0.1625398993492... | |
http://localhost:8080/extern_js/f/CgJlbhICaW4gACswRTgALCswWjgALCswDjgALCswFzgALCswPDgALCswUTgALCswCjgAmgICaGUsKzCYATgALCswFjgALCswGTgBLCswQTgALCswTTgALCswTjgALCswVDgALCswaTgALCswkAE4ACwrMJIBOAAsKzDVATgALCsw2AE4ACwrMBg4ACwrMCY4ACyAAlCQAnA/Q4V9Cbp7fuo.js 404 (Not Found)
```
These errors are coming because relative path... | [
-0.034632984548807144,
-0.10904103517532349,
0.41517412662506104,
0.05900881811976433,
0.1355116367340088,
-0.10347923636436462,
0.43554407358169556,
0.018751265481114388,
-0.2865351736545563,
-0.7202746272087097,
0.005878011230379343,
0.747960090637207,
-0.34919169545173645,
0.00949285179... | |
the right place in the page (in the `<head>` section) like this to properly set the base href:
```
<base href="http://www.google.com">
```
See this article for more info: <http://www.drostdesigns.com/base-href-tag/>
This solution is not foolproof though because if the site is already using a `<base href="xxx">` tag... | [
0.14598378539085388,
0.15779653191566467,
0.5728416442871094,
0.21428996324539185,
-0.03535683825612068,
-0.3743543326854706,
0.4903770387172699,
-0.15511982142925262,
-0.056580834090709686,
-0.7402945756912231,
-0.17367562651634216,
0.4656184911727905,
-0.24077703058719635,
-0.23521158099... | |
destined for the other host, but requested from you is proxied appropriately. This would be more foolproof. | [
0.26647695899009705,
-0.23225335776805878,
0.23451538383960724,
0.4647339880466461,
0.06873218715190887,
0.0906541645526886,
-0.14820638298988342,
0.045489102602005005,
0.14335419237613678,
-0.6502569913864136,
-0.27693334221839905,
0.28886473178863525,
-0.17254364490509033,
0.312098205089... | |
ok here is my code :
```
For i = 0 To 10
Dim tTemp As Threading.Thread = New Threading.Thread(AddressOf dwnld)
tTemp.IsBackground = True
'tTemp.Start(geturl)
lThreads.Add(tTemp)
'MsgBox(lThreads.Item(i).ThreadState)
Next
```
I create a list of threads with 10 threads, a... | [
-0.06221461668610573,
0.1379568874835968,
0.7572035193443298,
-0.25685662031173706,
0.17960470914840698,
0.06769661605358124,
0.3873036205768585,
-0.23798516392707825,
-0.4334537982940674,
-0.7563707828521729,
-0.13310229778289795,
0.5448461771011353,
-0.1501467525959015,
0.190599873661994... | |
To lThreads.Count - 1
If (lThreads.Item(i).ThreadState = 12) Then
If (ListBox2.Items.Count > 0) Then
lThreads.Item(i).Start(geturl)
If (i = lThreads.Count - 1) Then
i = 0 | [
0.04369277134537697,
-0.4674670696258545,
0.5453774929046631,
-0.3800039291381836,
0.19986166059970856,
0.14162002503871918,
0.38507258892059326,
-0.32496678829193115,
-0.40415245294570923,
-0.7894616723060608,
-0.22873681783676147,
0.3368026316165924,
-0.45674315094947815,
0.4870989918708... | |
End If
Else
Exit For
End If
'MsgBox(lThreads.Item(i).ThreadState)
ElseIf (lThreads.Item(i).ThreadState = 16) Then
lThreads.RemoveAt(i)
Dim tTemp | [
-0.2132297307252884,
-0.2002773880958557,
0.6033668518066406,
-0.5120193362236023,
0.2967524826526642,
0.23791669309139252,
0.5814551711082458,
-0.2757294178009033,
-0.31855952739715576,
-0.46896252036094666,
-0.2569536864757538,
0.23337341845035553,
-0.5033116340637207,
0.4282564520835876... | |
As Threading.Thread = New Threading.Thread(AddressOf dwnld)
tTemp.IsBackground = True
lThreads.Add(tTemp)
If (i = lThreads.Count - 1) Then
i = 0
End If
End If
Next
```
What's happening is, i see the threads | [
0.21722042560577393,
-0.0844835415482521,
0.780739426612854,
-0.2730381190776825,
0.08252228796482086,
-0.05425163358449936,
0.4240838587284088,
-0.235123410820961,
-0.5762202739715576,
-0.7011595964431763,
-0.08653482049703598,
0.39164674282073975,
-0.11664015054702759,
0.5536760687828064... | |
stop after the function dwnld is completed. So i first check for the state (12 means background and unstarted). On case 12 start the thread and in case 16 (stopped) remove that particular thread and add a different thread like i add 10 above.
Also there is a check when the i counter reaches last number, restart the wh... | [
0.33128321170806885,
-0.16097350418567657,
0.633121907711029,
-0.28013357520103455,
0.03445855528116226,
-0.07421238720417023,
0.6287240982055664,
0.10120242089033127,
-0.3762572407722473,
-0.43886464834213257,
-0.5037379860877991,
0.6437487006187439,
-0.3924974799156189,
0.406995624303817... | |
is running for only 11 times and it does not restart. I tried using a lable and goto but it simple hangs.
Can anyone tell me what to do?
What i want is to maintain 10 threads to keep downloading the web pages and when the list is empty, exit the function.
Trying to manually manage your own custom pool of threads is p... | [
0.6323071718215942,
-0.172121062874794,
0.40974873304367065,
0.002262997906655073,
0.17638859152793884,
-0.02086663618683815,
0.6622386574745178,
0.25681790709495544,
-0.6158925890922546,
-0.5606671571731567,
0.2976798415184021,
0.6839066743850708,
-0.1141161173582077,
0.16399259865283966,... | |
If you run into problems implementing either of these techniques then post a more specific question. | [
0.520164430141449,
-0.015956025570631027,
-0.24097701907157898,
0.24407826364040375,
-0.11958465725183487,
-0.5243099927902222,
0.10620483011007309,
0.4343580901622772,
-0.008950470946729183,
-0.5133857131004333,
-0.12971456348896027,
0.2375938892364502,
0.12454384565353394,
-0.30142530798... | |
i want to convert `int to char`\* in C without using `itoa()` function.
Because on my Linux Systems i `itoa` function is not there. i am using this code which i found from [here](http://www.java2s.com/Code/C/Data-Type/Convertintegertostringhowtouseitoa.htm)
I want to run this function on Embedded devices also which a... | [
0.16625356674194336,
-0.05685058608651161,
0.08876847475767136,
-0.16270819306373596,
-0.11230526864528656,
0.00995168648660183,
0.07723408192396164,
-0.1948566436767578,
-0.15018296241760254,
-0.5453518629074097,
0.08172743022441864,
0.6488678455352783,
-0.5235946178436279,
-0.08808591961... | |
i_to_a(4567);
printf("%s",str);
free(str);
str = NULL;
return 0;
}
int no_of_digits(int num)
{
int digit_count = 0;
while(num > 0)
{
digit_count++;
num /= 10;
}
return digit_count;
}
char *i_to_a(int num)
{
char *str;
int digit_count = 0;
if(num < 0)
... | [
-0.10937568545341492,
0.02799813821911812,
0.19807511568069458,
-0.577003002166748,
0.0946493148803711,
0.4407992959022522,
0.40656718611717224,
-0.3715376555919647,
-0.07832535356283188,
-0.24876263737678528,
-0.6115784645080566,
0.34407296776771545,
-0.12755900621414185,
0.17242121696472... | |
digit_count++;
}
digit_count += no_of_digits(num);
str = malloc(sizeof(char)*(digit_count+1));
str[digit_count] = '\0';
while(num > 0)
{
str[digit_count-1] = num%10 + '0';
num = num/10;
digit_count--;
}
if(digit_count == 1)
str[0] = '-';
return... | [
-0.2505332827568054,
-0.014875585213303566,
0.4282122552394867,
-0.4718136489391327,
0.10020370781421661,
0.27275362610816956,
0.23190094530582428,
-0.3584556579589844,
-0.2771892547607422,
-0.26231488585472107,
-0.5788883566856384,
0.5312632918357849,
-0.11729399859905243,
0.2070644646883... | |
I have a LAN composed of 3 PC. Installed in PC1 is the MS SQL database. This computer will act as the server.
The PC2 and PC3 will each have a desktop application that will display the data from PC1.
My problem here is how to make each PC (PC2 and PC3) have the same copy of data.
Suppose in PC2 employee 0001 first na... | [
-0.05031648650765419,
0.2615489661693573,
0.6295680999755859,
0.0178381334990263,
0.3325888216495514,
0.3420684039592743,
-0.11997420340776443,
0.16094174981117249,
-0.36760470271110535,
-0.6607537865638733,
0.012916301377117634,
0.2754497230052948,
-0.20859503746032715,
0.3412439823150635... | |
that good, but I'm open to all suggestions/concepts/example/etc..
Thanks.
If you want immediate update on all clients right after data changes then you need some sort of notification system either in a polled or pushed manner.
You can implement push mechanism using for example WCF with callback contract. Your client... | [
0.054032012820243835,
-0.24080416560173035,
0.5861419439315796,
0.02630659006536007,
-0.38036754727363586,
-0.07319846749305725,
-0.0878278836607933,
-0.3399812877178192,
-0.3925453722476959,
-0.4837757349014282,
0.06870875507593155,
0.6709381341934204,
-0.15790590643882751,
0.032649096101... | |
WCF callback.
Pull mechanism would require a background thread on all client applications checking the server for changes. You can use a separate database table with a version counter that would get incremented each time anything changes on the server. Client applications would poll that counter, compare with latest v... | [
0.3042523264884949,
-0.376083105802536,
0.8718896508216858,
0.0868060514330864,
-0.31087663769721985,
-0.310311496257782,
0.07148145884275436,
-0.6071110963821411,
-0.2150525599718094,
-0.6607334017753601,
0.43765392899513245,
0.5498167276382446,
-0.4261951446533203,
0.28623080253601074,
... | |
can get complicated quickly with multiple clients. Overall it does not scale very well. It is generally simpler than push though and for simple applications with not too much data it would be enough. | [
-0.1880655735731125,
-0.3568253815174103,
0.2956361472606659,
0.37435007095336914,
-0.043048370629549026,
-0.05017431080341339,
0.0784270316362381,
-0.19706641137599945,
-0.19617174565792084,
-0.615475594997406,
0.2350660264492035,
0.43592020869255066,
-0.13802260160446167,
0.1117257624864... | |
I need to alternate a date and a phrase within a `<table>` cell without using fixed width.
```
<table>
<thead>
<tr><th>Date</th></tr>
</thead>
<tbody>
<tr><td id='changethis'>Wed Dec 21 2011</td></tr>
</tbody>
</table>
var hold = $('#changethis').text();
setInterval(function () {
if ($('#ch... | [
-0.047350749373435974,
0.06449389457702637,
0.8740389347076416,
-0.3622968792915344,
-0.07912211120128632,
0.46310532093048096,
0.3485795557498932,
-0.564719021320343,
-0.16666477918624878,
-0.4211372435092926,
-0.008750181645154953,
0.18837593495845795,
-0.18146787583827972,
0.41069188714... | |
time the text alternates. Is it possible to calculate rendered text width and adjust the alternating text accorrdingly?? [JSbin Here](http://jsbin.com/ozunan/)
you could try adding the width to the element
```
$('#changethis').width($('#changethis').width());
```
<http://jsbin.com/ozunan/3/edit> | [
-0.005411373917013407,
-0.3352186679840088,
0.34121567010879517,
0.057195160537958145,
-0.25063252449035645,
0.3957759439945221,
0.17653128504753113,
-0.18714144825935364,
-0.20813924074172974,
-0.6966848373413086,
-0.006443808786571026,
0.560224711894989,
-0.027084320783615112,
-0.1805202... | |
I'm using git and TeamCity v6.0 in a Windows environment.
I have just switched over from server side checkouts to checkout on agents because of IO issues, however...
Initial checkout has become exceeding slow from ~ a minute to >45 minutes. Once the repo is cloned everything is OK. Is there some configuration on the... | [
0.24696141481399536,
-0.23942992091178894,
0.32556647062301636,
0.02319040708243847,
-0.1692441701889038,
-0.053163882344961166,
0.4571726620197296,
0.10475258529186249,
-0.14686286449432373,
-1.0886133909225464,
0.23355869948863983,
0.4980345666408539,
-0.04230758547782898,
-0.21914802491... | |
that git appears to be doing very little and there is no obvious source of throttling.
One thing that can cause a slowdown is java ssh implementation used with agent-side checkout, to turn it off set an [agent property](http://confluence.jetbrains.net/display/TCD65/Build+Agent+Configuration) `teamcity.git.use.native.ss... | [
0.057599987834692,
-0.12386813014745712,
0.29817408323287964,
0.2569305896759033,
0.041584789752960205,
-0.3939198851585388,
0.47154542803764343,
0.06316496431827545,
-0.07903474569320679,
-0.7598556280136108,
-0.039805371314287186,
0.20482377707958221,
-0.14908629655838013,
0.082706488668... | |
I `setTextFilterEnabled` for text filtering a `ListView`. Filtering is working fine, but a popup window showing the filter text appears when I type. See image:

How can I hide this popup or change its position on the screen?
Filter.publishResults(CharS... | [
0.13591961562633514,
-0.24180816113948822,
0.6060329079627991,
-0.16496215760707855,
-0.1766490340232849,
-0.3494023382663727,
0.5663715600967407,
-0.07027152180671692,
-0.17277640104293823,
-0.8484922647476196,
-0.11582451313734055,
0.4522659182548523,
-0.45207542181015015,
-0.02760162018... | |
I am trying to do the following with an ordinary Windows Metro style application:
```
public class MyButton : Button
{
public Duration Duration { get; set; }
}
```
```
<Grid>
<local:MyButton Duration="0:0:0.2" />
</Grid>
```
But I receive the error: *Value Type Duration is not allowed on property Duration ... | [
0.27573642134666443,
-0.23234905302524567,
0.23937979340553284,
-0.22475506365299225,
-0.2637317478656769,
-0.2915499210357666,
0.28413426876068115,
0.0909070074558258,
-0.40922781825065613,
-0.6403072476387024,
-0.02455168031156063,
0.6085679531097412,
-0.28260233998298645,
0.243596062064... | |
Seems like a pretty standard thing to want to do, but I can’t find any easy way of doing it?
In zsh, you can try something like this:
```
for site (`heroku list`); do echo `heroku domains --app $site`; done;
```
which will dump out the info for each app. It's not pretty, but it's a start. | [
0.40244612097740173,
0.10371191799640656,
0.1665942519903183,
0.2001577764749527,
-0.19681911170482635,
-0.27081671357154846,
0.09587541967630386,
0.06313930451869965,
-0.21830925345420837,
-0.5547629594802856,
-0.17418363690376282,
0.21001499891281128,
0.015112830325961113,
0.088225953280... | |
This may have been answered before, and if so, point me to the answer. Otherwise, here goes.
You have x number of objects in space, which have bounding coordinates p0 and p1. p0 and p1 are each 3 dimensional coordinates and p0 always has the lower values - whether negative or positive, and p1 always has the higher val... | [
0.3619050979614258,
0.02481645904481411,
0.7562986016273499,
0.14792126417160034,
0.0033179970923811197,
0.19108177721500397,
-0.38963422179222107,
-0.19997477531433105,
-0.4721415936946869,
-0.22335711121559143,
-0.06504019349813461,
0.1404258757829666,
-0.2733374834060669,
0.215245649218... | |
and pitch and extending unto the furthest defined bounds in the space.
Because I do not permit more than 180 degrees FOV, anything which lies completely behind the camera (behind the plane of exclusion) must be excluded.
Is there a simple way to do this? For this question, I do not treat the issue of having to check ... | [
0.36572644114494324,
0.172511026263237,
0.14750464260578156,
0.03482768312096596,
0.008735203184187412,
-0.34924110770225525,
-0.07794848084449768,
-0.3007418215274811,
-0.28307202458381653,
-0.31860876083374023,
-0.23484118282794952,
0.18610318005084991,
-0.010765732266008854,
-0.04564854... | |
mind that because these are not points but pairs of points representing 3d bounding cubes, it is not enough for a point to lie on this or that side of the plane.
I get the feeling there is a simple way to do this, but not having taken Computer Graphics I was never introduced to the math.
In zsh, you can try something ... | [
0.2910606861114502,
0.238162562251091,
0.4586202800273895,
0.3026140332221985,
-0.2859640419483185,
-0.11829203367233276,
-0.06647168099880219,
-0.028157562017440796,
-0.19168473780155182,
-0.6689296960830688,
-0.010043812915682793,
0.18928612768650055,
0.01048331893980503,
0.1095035150647... | |
I've run into a problem with a SplitViewController app. When I select a row from the table in the master view I'm replacing the detail view with a replace segue. The problem is each time this happens it creates a new instance/reloads the detail view controller. Is there any way I can have it so it will replace the deta... | [
0.12561771273612976,
-0.20776009559631348,
0.5959083437919617,
0.09580694139003754,
0.08013978600502014,
-0.06966773420572281,
0.263226181268692,
0.025373321026563644,
-0.31337493658065796,
-0.8263155221939087,
-0.030623452737927437,
0.6691117286682129,
-0.43266400694847107,
0.348785191774... | |
Beside A\*, BFS, DFS and the like, what are other good path-finding algorithms/heuristics popularly used in Pacman? I don't think the ones I mentioned will work if there're more than one fruits for pacman to find.
I need some good path-finding algorithms that PacMan can use to finish the maze with the least possible s... | [
0.24414858222007751,
0.14452825486660004,
-0.16333815455436707,
0.46082109212875366,
-0.1839980036020279,
0.0964207723736763,
0.3386879861354828,
0.3501146137714386,
-0.43365269899368286,
-0.5602184534072876,
0.462274432182312,
0.2881815433502197,
-0.06660483777523041,
-0.00140558707062155... | |
that there're no ghosts around.
Some examples from the original PacMan problems:
[First](https://code.google.com/p/pacman-search/source/browse/trunk/+pacman-search+--username+hnly228078@gmail.com/src/layouts/bigSearch.lay?r=2), [Second](https://code.google.com/p/pacman-search/source/browse/trunk/+pacman-search+--usern... | [
-0.3784298002719879,
0.1478012204170227,
0.3784860074520111,
0.18598672747612,
-0.011152983643114567,
0.033328596502542496,
0.5280918478965759,
-0.1626744121313095,
-0.5393557548522949,
-0.46295735239982605,
0.14486593008041382,
0.42042189836502075,
-0.5814456343650818,
0.1445106565952301,... | |
permutations of fruits**, and check the total distance you need to travel. This solution is **factorial in the number of fruits**, and if it is greater then 20 - with naive bruteforce - it will take too long. You can somehow make it better by **reducing the problem to TSP**, and use dynamic-programming solution, which ... | [
-0.13387899100780487,
-0.09618263691663742,
0.5328572988510132,
0.08619903028011322,
0.0875982865691185,
0.2807495892047882,
0.144788920879364,
-0.04790937155485153,
-0.7022464275360107,
-0.8900154829025269,
-0.0255671925842762,
0.43734294176101685,
-0.04758919030427933,
-0.064023859798908... | |
`m > 1`. This guarantees that at some point, your heuristic function `h` will be admissible - and the solution found will be optimal. However, each iteration is expected to take much longer then the previous one [exponentially longer..] | [
-0.18917928636074066,
-0.033260442316532135,
0.48816433548927307,
0.01428441796451807,
0.36221006512641907,
0.11521453410387039,
0.3615710437297821,
-0.633242666721344,
-0.005754269193857908,
-0.6158960461616516,
-0.2935865521430969,
0.4402657747268677,
-0.14315272867679596,
-0.00542664621... | |
I have a Style declared within a UserControl. I then placed that UserControl in a Window. How can I access the UserControl's style from the Window's XAML ???
Resources are resolved by going up through the visual tree. This is not a usually way to work with styles.
You can do it by code behind :
```
Style style = (Sty... | [
0.3186790347099304,
0.22202248871326447,
0.47634220123291016,
-0.017530491575598717,
0.0921841561794281,
-0.0130400275811553,
0.2262638658285141,
-0.06250384449958801,
-0.0964328795671463,
-0.7674227356910706,
-0.004644563887268305,
0.5907151699066162,
0.003249142086133361,
0.0581211596727... | |
I spent past week on a jQuery implementation. And retrospectively, though I know how to code, I have to admit I do not know how to *organize* my code.
There are lots of tutorials explaining how to perform one single operation with jQuery, but what I lack is best practices. The design patterns I use in PHP do not handl... | [
0.3131931722164154,
0.10489469021558762,
-0.09301616996526718,
0.3012978434562683,
-0.255114883184433,
-0.21806150674819946,
0.3502543270587921,
0.016962863504886627,
-0.2146987020969391,
-0.5110877752304077,
0.01994376629590988,
0.5090492367744446,
0.05301986262202263,
-0.0214466657489538... | |
in advance !
Resources are resolved by going up through the visual tree. This is not a usually way to work with styles.
You can do it by code behind :
```
Style style = (Style)yourUserControl.Resources[YourKeyStyle];
``` | [
0.33916354179382324,
-0.03900590538978577,
0.3042408227920532,
-0.02559289149940014,
0.20064550638198853,
0.04843132942914963,
0.20942546427249908,
-0.21966180205345154,
-0.23391401767730713,
-0.6897590756416321,
-0.30762648582458496,
0.829184889793396,
0.024864574894309044,
-0.12644645571... | |
On hover I want my div to scroll down.
I know i can use the `.animate({left: 0}, "slow");` but this doesnt go down but what else does jquery have to offer?
Here is my jsfiddle: <http://jsfiddle.net/WZvPk/4/>
hover over the sectors box and you will see the "view project" move down. I need it to move down in a slow fa... | [
-0.06428438425064087,
-0.21842913329601288,
1.0691074132919312,
-0.17821793258190155,
-0.16797637939453125,
0.35267508029937744,
-0.2406442016363144,
0.11808590590953827,
0.09729406982660294,
-0.9220017790794373,
0.12731309235095978,
0.5950616598129272,
0.10675507038831711,
0.1056376770138... | |
}
);
```
You probably want jQuery slideDown, see: <http://api.jquery.com/slideDown/>
Edit:
So something like this:
```
$(".sectorGrid").hover(
function () {
$(this).children(".sectorImage")
.children(".showme")
.css("display", "block")
.css("margin-top", "-5px")
.slideDown("slow");
},
function (... | [
-0.17530788481235504,
-0.22957803308963776,
0.6079595685005188,
0.05752546712756157,
0.1822299063205719,
0.20828498899936676,
-0.02196921966969967,
-0.014198225922882557,
-0.3343678414821625,
-0.761503279209137,
-0.4849589467048645,
0.4254187345504761,
-0.07522953301668167,
0.1990112215280... | |
$("div.sectorImage div.showme").hide();
}
);
``` | [
0.2957307696342468,
-0.14726266264915466,
0.2260344922542572,
-0.3980594873428345,
0.29476845264434814,
-0.07862772047519684,
0.40201064944267273,
-0.07927417010068893,
0.1855074018239975,
-0.2349771410226822,
-0.3038654029369354,
0.6960709095001221,
-0.409117192029953,
0.4946094751358032,... | |
I have been trying to figure out why and how to use performSelector.
I did come across [Apple Docs](https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Protocols/NSObject_Protocol/Reference/NSObject.html). However, I am not able to fully understand it.
Would anyone be able to help me out... | [
0.18343323469161987,
-0.03375900164246559,
0.12658245861530304,
0.10954920947551727,
-0.2983643412590027,
-0.03114960715174675,
0.44476762413978577,
-0.2598738670349121,
-0.2844873070716858,
-0.5964820384979248,
-0.049166977405548096,
-0.042751435190439224,
-0.20636937022209167,
-0.0918768... | |
I have a class that may have a parent, or list of children of the same type of it's own. The following code snippet should explain my scenario.
```
public abstract class X{
public virtual List<X> ChildItems { get; set; }
public virtual X ParentItem { get; set; }
}
```
I would like to know if there is a part... | [
0.04703781381249428,
0.12188790738582611,
0.08413273841142654,
0.265825480222702,
0.3804948627948761,
0.2075546383857727,
0.18593721091747284,
0.3088976740837097,
-0.15422222018241882,
-0.7766882181167603,
-0.11513914912939072,
0.3480067253112793,
-0.0593608096241951,
0.3720565438270569,
... | |
here
}
```
Any help is appreciated.
What you are dealing with is a tree structure (or possibly many disconnected tree structures). A tree structure has a root element. Usually, a tree structure is traversed starting from the root. If you want to start from any element in the tree, I suggest you to first get the root ... | [
-0.17385601997375488,
0.15371443331241608,
0.09111612290143967,
0.4313358962535858,
0.083577960729599,
0.01760125160217285,
0.10888034105300903,
0.33229389786720276,
-0.33803048729896545,
-0.9436987042427063,
-0.23489703238010406,
0.03871675208210945,
-0.20769761502742767,
0.31778126955032... | |
ParentItem { get; set; }
// Method for traversing from top to bottom
public void Traverse(Action<X> action)
{
action(this);
foreach (X item in ChildItems) {
item.Traverse(action);
}
}
// Get the root (the top) of the tree starting at any item.
public X GetRo... | [
-0.3565327823162079,
-0.26252976059913635,
0.5368087887763977,
0.034287452697753906,
0.2773014008998871,
0.34292811155319214,
0.5136021971702576,
-0.13161681592464447,
-0.6138325333595276,
-0.50921231508255,
-0.4499405026435852,
-0.07720966637134552,
-0.3053535521030426,
0.2299268990755081... | |
X root = this;
while (root.ParentItem != null) {
root = root.ParentItem;
}
return root;
}
}
```
Now you can save the setup with
```
X root = item.GetRootItem();
root.Traverse(SaveSetup);
```
Example with lambda expression. Prints every item of the tree assuming that `ToStrin... | [
-0.27696236968040466,
0.03510637953877449,
0.37106990814208984,
-0.10992267727851868,
0.40775662660598755,
0.09062886983156204,
0.6605382561683655,
-0.33147159218788147,
-0.3588198721408844,
-0.5950815081596375,
-0.27391529083251953,
0.550536036491394,
-0.3462538421154022,
0.07291874289512... | |
I have a check box list which I fill it with data from my table.Here is the code:
```
<?php
mysql_connect("localhost","root","");
mysql_select_db("erp");
$a="Select * from magazine";
$b=mysql_query($a);
$c=mysql_fetch_array($b);
while($c=mysql_fetch_array($b))
{
print '<input type="checkbox"/>'.$c... | [
0.2622043788433075,
0.2435411810874939,
0.6386153697967529,
-0.36894914507865906,
-0.18896041810512543,
0.11971893906593323,
0.16070745885372162,
-0.498446524143219,
-0.13985781371593475,
-0.4533570408821106,
-0.0007536284392699599,
0.43595683574676514,
-0.3930492103099823,
0.1847705990076... | |
press a checkbox the value of that checkbox to be shown in a table.So if I have check1 with value a , check2 with value b and I check check1 the value a to be outputted to a table row.How can I achieve that? how cand I get which checkbox is checked?
A few notes:
* Try to avoid using `SELECT *` queries. Select the fiel... | [
0.20267070829868317,
0.2202194482088089,
0.5502788424491882,
-0.06829311698675156,
0.05522049963474274,
0.1701255887746811,
0.024780265986919403,
-0.2973158359527588,
-0.19428782165050507,
-0.5230588316917419,
0.13265065848827362,
0.6774369478225708,
-0.30752694606781006,
-0.22948063910007... | |
a later time. Use more descriptive variable names like `$query_object` and `$row`. Your code should read almost like an essay describing what you're doing.
* In your form, use an array of elements. By giving the input a name like `selected_magazines[]`, you will end up with an array in your post data, which is what you... | [
0.20892803370952606,
-0.13076014816761017,
0.4300945997238159,
0.29430902004241943,
-0.06120743229985237,
0.0948510468006134,
0.1678207814693451,
-0.17309390008449554,
-0.007193158846348524,
-0.7656688690185547,
-0.01638343743979931,
0.36879873275756836,
-0.26049619913101196,
-0.1432315260... | |
should take care of all logic and decisions. At the bottom, output your HTML and avoid making logical decisions. It makes for a script that is easier to follow and maintain, as well as debug.
Here is a sample script incorporating these ideas with the details you've given:
```
<?php
// FILE: myfile.php
mysql_... | [
0.10670832544565201,
-0.05005182325839996,
0.3999340534210205,
0.1553262174129486,
-0.058137815445661545,
0.042736705392599106,
-0.031595803797245026,
-0.254514217376709,
0.017221126705408096,
-0.6673536896705627,
-0.17451375722885132,
0.4861164689064026,
-0.4257282614707947,
-0.0551762953... | |
die();
}
$sql= '
SELECT
`id`,
`den_mag`
FROM
`magazine`
';
$query_object=mysql_query($sql);
$checkboxes = array();
while($row = mysql_fetch_array($query_object)) {
$checkboxes[] | [
0.3153771758079529,
0.15552033483982086,
0.23755982518196106,
-0.09071400761604309,
-0.0018909835489466786,
0.06780412048101425,
-0.052763957530260086,
-0.5818841457366943,
0.05807005241513252,
-0.04958115145564079,
-0.12895841896533966,
0.5830049514770508,
-0.41569745540618896,
0.31152063... | |
= '<input name="selected_magazine[]" value="'.$row['id'].'" type="checkbox" /> '.$row['den_mag'];
}
?>
<form action="myfile.php" method="post">
<?php print implode('<br>', $checkboxes); ?>
<input type="submit" value="Submit" />
</form>
``` | [
0.3697691857814789,
-0.018236476927995682,
0.41484543681144714,
-0.07337529212236404,
-0.18627223372459412,
0.2586936056613922,
0.008456473238766193,
-0.11391226947307587,
-0.18728402256965637,
-0.27040261030197144,
-0.2824804186820984,
0.43040674924850464,
-0.553287148475647,
0.2506338059... | |
I encountered this problem when doing my MCQ Game app testing.
I'm using ARC & Storyboard custom segue and `[self performSegueWithIdentifier:@"VC" sender:self];` to push from `ViewController1` to `ViewController2` but very seldom popping back the `ViewController1` due to the naturals of the app, moving forward from qu... | [
-0.38858601450920105,
0.0011602487647905946,
0.8152166604995728,
-0.10922034084796906,
-0.07163627445697784,
0.17094452679157257,
0.6357121467590332,
-0.36263537406921387,
-0.10500875115394592,
-0.769171953201294,
-0.17137514054775238,
1.0220999717712402,
-0.03916153311729431,
-0.043073002... | |
options:UIViewAnimationOptionTransitionCrossDissolve
animations:^{
[sourceVC.navigationController pushViewController:destinationVC animated:NO]; | [
-0.34695005416870117,
-0.5631751418113708,
0.496669203042984,
0.43096745014190674,
0.17432592809200287,
0.28460320830345154,
0.3009490370750427,
0.1213088408112526,
-0.0813177153468132,
-0.8900746703147888,
-0.48315006494522095,
0.7108926177024841,
-0.11673711985349655,
0.07701103389263153... | |
}
completion:^(BOOL completed)
{
//[sourceVC.navigationController pushViewController:destinationVC animated:NO];
} | [
-0.4381658732891083,
-0.3230733871459961,
0.7947267889976501,
-0.23448871076107025,
0.41529858112335205,
0.30773627758026123,
0.44675666093826294,
0.06209207698702812,
-0.12680670619010925,
-0.7157086730003357,
-0.5039573311805725,
0.35045140981674194,
-0.1089131087064743,
0.16323535144329... | |
];
}
```
> * **demo:** <http://jsbin.com/oruxip>
because on click event your calling `slider_animate()` directly your not calling your plugin
in chrome when you do that the `slide_widths` var is 0 because you defined and executed the assignment logic outside of the event function so its static
you have 2 options p... | [
0.036645084619522095,
-0.21387791633605957,
0.5611109733581543,
-0.23413704335689545,
-0.1175151839852333,
-0.036643367260694504,
-0.03211989626288414,
-0.6073307991027832,
-0.24141398072242737,
-0.6174752116203308,
-0.15072467923164368,
0.8471792936325073,
-0.37643590569496155,
-0.1774656... | |
name accordingly
```
or call the plugin function itself which is `imgSlider` | [
-0.030995791777968407,
0.02324247919023037,
0.5250016450881958,
-0.35551825165748596,
-0.4430387020111084,
-0.3803085684776306,
0.17536677420139313,
0.28915509581565857,
0.012347981333732605,
-0.336709588766098,
-0.5511078834533691,
0.5078256130218506,
-0.4010615944862366,
0.14374667406082... | |
i have a TreeView that once the user drops the item to the desired position, it displays a dialog box and asks for confirmation, if the user selects cancel, how would i also cancel the placement of the item so it goes back to its original position? my current code is below but isnt working:
```
var newDiv = $(document... | [
0.23508663475513458,
-0.19500136375427246,
0.8443156480789185,
-0.02170768566429615,
0.5085629820823669,
0.09860018640756607,
0.19925175607204437,
-0.3815366327762604,
-0.48424336314201355,
-0.35990777611732483,
-0.16038969159126282,
0.4107167422771454,
-0.12519879639148712,
0.178664758801... | |
$(this).dialog("close");
},
"Cancel": function () {
$(this).dialog("close");
e.setValid = false;
}
}
});
```
I have also tried doing the same kind of code on the dragend event and using `e.preventDefault();` with no more luck
The `drop` event handler provides the ... | [
0.26586100459098816,
-0.39911624789237976,
0.4258248507976532,
-0.2692328989505768,
0.3916250467300415,
-0.19339214265346527,
0.40937867760658264,
-0.13302050530910492,
-0.16458408534526825,
-0.1827283501625061,
-0.39690154790878296,
0.8453226685523987,
-0.563609778881073,
0.11728189140558... | |
example:
```
function onDrop(e) {
e.setValid(confirm('Do you wish to move this item here?'));
}
$("#treeView").kendoTreeView({
// ...
dragAndDrop: true,
drop: onDrop
});
```
I've written a [fiddle](http://jsfiddle.net/jbristowe/q97MF/) which demonstrates how this works. | [
0.18438056111335754,
-0.04823656752705574,
0.5581074357032776,
-0.019092852249741554,
-0.020902788266539574,
-0.014120465144515038,
0.2284311056137085,
-0.3855263888835907,
-0.3086110055446625,
-0.507337212562561,
-0.02971375733613968,
0.33266568183898926,
0.06230277568101883,
0.0236953552... | |
Using XE2 VCL styles, I'd like to disable the skinning for TLabel (or property sfTextLabelNormal)
I've tried all kind of solutions from other questions, like using Engine.UnRegisterStyleHook, but it has no effect.
The [TLabel](http://docwiki.embarcadero.com/Libraries/en/Vcl.StdCtrls.TLabel) component doesn't use style... | [
0.1476648449897766,
-0.10206592082977295,
0.587165892124176,
0.06391219794750214,
-0.2596716284751892,
-0.16428489983081818,
-0.014342369511723518,
-0.39165109395980835,
0.052044980227947235,
-0.6532073020935059,
-0.011779051274061203,
0.8468214869499207,
-0.3743138313293457,
0.29267889261... | |
end;
{ TLabelHelper }
procedure TLabelHelper.DrawNormalText(DC: HDC; const Text: UnicodeString;
var TextRect: TRect; TextFlags: Cardinal);
begin
Self.DoDrawNormalText(DC, Text, TextRect, TextFlags);
end;
{ TLabel }
procedure TLabel.DoDrawText(var Rect: TRect; Flags: Integer);
const
EllipsisStr = '...';
Elli... | [
-0.6364738941192627,
-0.11097626388072968,
0.7679993510246277,
-0.23547644913196564,
-0.045656468719244,
0.33766260743141174,
0.2930697798728943,
-0.5102885961532593,
0.025256138294935226,
-0.278127521276474,
-0.6853171586990356,
0.5548921227455139,
-0.23644106090068817,
-0.063023671507835... | |
if not ShowAccelChar then Flags := Flags or DT_NOPREFIX;
Flags := DrawTextBiDiModeFlags(Flags);
Canvas.Font := Font;
if (EllipsisPosition <> epNone) and not AutoSize then
begin
DText := Text;
Flags := Flags and not DT_EXPANDTABS;
Flags := Flags or Ellipsis[EllipsisPosition];
if W... | [
-0.01623309962451458,
-0.27007994055747986,
0.6464393138885498,
-0.4116334617137909,
-0.032943107187747955,
0.36334848403930664,
0.4427156150341034,
-0.21499821543693542,
-0.17220783233642578,
-0.6617944240570068,
-0.6026692390441895,
0.6249217391014099,
-0.4702175557613373,
-0.19347663223... | |
NewRect := Rect;
Dec(NewRect.Right, Canvas.TextWidth(EllipsisStr));
DrawNormalText(Canvas.Handle, DText, NewRect, Flags or DT_CALCRECT);
Height := NewRect.Bottom - NewRect.Top;
if (Height > ClientHeight) and (Height > Canvas.Font.Height) then
begin
Delim := ... | [
-0.33928367495536804,
-0.5200428366661072,
0.9513834714889526,
-0.3088480234146118,
-0.0693027451634407,
0.45554837584495544,
0.1287255585193634,
-0.3455200791358948,
-0.35148295760154724,
-0.6714973449707031,
-0.7383989095687866,
0.5323489904403687,
0.019394559785723686,
0.042192254215478... | |
if Delim = 0 then
Delim := Length(Text);
Dec(Delim);
if ByteType(Text, Delim) = mbLeadByte then
Dec(Delim);
Text := Copy(Text, 1, Delim);
DText := Text + EllipsisStr; | [
-0.07868637144565582,
-0.11974383890628815,
0.828294575214386,
-0.13086456060409546,
-0.04539037495851517,
0.33016958832740784,
0.10381227731704712,
-0.2868882417678833,
-0.1755886971950531,
-0.4169933795928955,
-0.5401630401611328,
0.5399571657180786,
-0.25747019052505493,
0.4571838080883... | |
if Text = '' then
Break;
end else
Break;
until False;
end;
if Text <> '' then
Text := DText;
end;
if Enabled or StyleServices.Enabled then | [
-0.04100467264652252,
-0.28285032510757446,
0.6843547821044922,
-0.23992204666137695,
0.0019904908258467913,
0.1299620419740677,
0.6739435195922852,
0.09771176427602768,
0.062339480966329575,
-0.5273593664169312,
-0.8057180643081665,
0.6473947167396545,
-0.28335267305374146,
0.005998454522... | |
DrawNormalText(Canvas.Handle, Text, Rect, Flags)
else
begin
OffsetRect(Rect, 1, 1);
Canvas.Font.Color := clBtnHighlight;
DrawNormalText(Canvas.Handle, Text, Rect, Flags);
OffsetRect(Rect, -1, -1);
Canvas.Font.Color := clBtnShadow;
DrawNormalText(Canvas.Handle, Text, Rect, Fla... | [
-0.25441989302635193,
-0.2792387306690216,
0.7772578597068787,
-0.24437442421913147,
-0.13460882008075714,
0.26831796765327454,
0.035285986959934235,
-0.6688480377197266,
-0.11050792038440704,
-0.40970173478126526,
-0.38772937655448914,
0.5759592652320862,
-0.3162756562232971,
-0.019025655... | |
result
 | [
-0.11853767931461334,
-0.3280918598175049,
0.5016495585441589,
0.014226780273020267,
-0.07559434324502945,
0.1005338579416275,
0.18485230207443237,
-0.3412741422653198,
-0.5904451608657837,
-0.16924798488616943,
-0.34434518218040466,
0.340442031621933,
0.04776531085371971,
0.04578045010566... | |
I have two arrays sd[16][16] and gd[16][16] in javascript. I need to compare the values of the arrays.
```
var score=0;
document.write("<table>");
for(c1=0; c1<16; c1++)
{ document.write("<tr>");
for(c2=0; c2<16; c2++)
document.write("<td onClick='changeColor(this);'>" + gd[c1][c2] + "</td>");
docume... | [
0.11104224622249603,
-0.1534995585680008,
0.47253018617630005,
-0.4130989909172058,
-0.09109839051961899,
0.32532021403312683,
0.15848803520202637,
-0.9703137278556824,
-0.006354277953505516,
-0.5688326954841614,
0.001821368234232068,
0.49416953325271606,
-0.3231649398803711,
-0.0075235618... | |
score-=2;
}
else
{
tdd.bgColor='white';
}
}
```
However, when I try to display the score later, the score is not displayed.
```
function scc()
{
document.getElementById('scf').innerHTML = score;
}
</script>
<br><br><center><button type='button' onclick='scc()'> Click to see current scor... | [
-0.09457278996706009,
-0.25609132647514343,
0.7437635660171509,
0.22282937169075012,
0.12238205969333649,
-0.5120347142219543,
0.041805848479270935,
-0.3427354693412781,
-0.29346248507499695,
-0.3755524754524231,
0.1757102906703949,
0.19037461280822754,
-0.05787267908453941,
0.602775096893... | |
override the Paint [`DoDrawText`](http://docwiki.embarcadero.com/Libraries/en/Vcl.StdCtrls.TCustomLabel.DoDrawText) method.
**UPDATE**
Here you have a sample of how override the paint process of a TLabel.
```
//declare this code in the implementation part
uses
Vcl.Themes,
Vcl.Styles;
type
TLabelHelper= class h... | [
-0.26100337505340576,
0.012310630641877651,
0.8552089929580688,
0.14141418039798737,
0.08489184826612473,
0.17112840712070465,
0.3034837245941162,
-0.6581496000289917,
0.1322157084941864,
-0.29155611991882324,
-0.4342004656791687,
0.6629922986030579,
-0.48718830943107605,
0.091939829289913... | |
Text := GetLabelText;
if (Flags and DT_CALCRECT <> 0) and
((Text = '') or ShowAccelChar and (Text[1] = '&') and (Length(Text) = 1)) then
Text := Text + ' ';
if Text <> '' then
begin
if not ShowAccelChar then Flags := Flags or DT_NOPREFIX;
Flags := DrawTextBiDiModeFlags(Flags);
Canvas.Font :=... | [
-0.11187433451414108,
-0.1979960799217224,
0.9372563362121582,
-0.25874975323677063,
-0.11922851949930191,
0.20026423037052155,
0.42177993059158325,
-0.5479689836502075,
-0.1114441528916359,
-0.724845290184021,
-0.8118796348571777,
0.6705607771873474,
-0.28330400586128235,
-0.4119787216186... | |
Flags and not DT_EXPANDTABS;
Flags := Flags or Ellipsis[EllipsisPosition];
if WordWrap and (EllipsisPosition in [epEndEllipsis, epWordEllipsis]) then
begin
repeat
NewRect := Rect;
Dec(NewRect.Right, Canvas.TextWidth(EllipsisStr));
DrawNormalText(Canvas.Handle, DTe... | [
-0.16215261816978455,
-0.4669211208820343,
0.7400826811790466,
-0.2553290128707886,
-0.0513775534927845,
0.22506143152713776,
0.27558085322380066,
-0.2459595501422882,
-0.3374079465866089,
-0.6740750074386597,
-0.7028785943984985,
0.4967940151691437,
0.0627683475613594,
-0.0376122556626796... | |
if (Height > ClientHeight) and (Height > Canvas.Font.Height) then
begin
Delim := LastDelimiter(' '#9, Text);
if Delim = 0 then
Delim := Length(Text);
Dec(Delim);
if ByteType(Text, Delim) = mbLeadByte then | [
-0.04019273817539215,
-0.36217376589775085,
0.9014957547187805,
-0.3823026716709137,
-0.054794032126665115,
0.34418874979019165,
0.0358588881790638,
-0.30921128392219543,
-0.3273322284221649,
-0.7276700735092163,
-0.4770212769508362,
0.5032755136489868,
0.06632648408412933,
0.1588207632303... | |
Dec(Delim);
Text := Copy(Text, 1, Delim);
DText := Text + EllipsisStr;
if Text = '' then
Break;
end else
Break; | [
-0.22690634429454803,
-0.022190559655427933,
0.5545962452888489,
0.06812962144613266,
0.06032317131757736,
0.19272266328334808,
0.2853538691997528,
-0.004860203247517347,
-0.301294207572937,
-0.25904184579849243,
-0.6933084726333618,
0.48480382561683655,
-0.2538437843322754,
0.304741561412... | |
until False;
end;
if Text <> '' then
Text := DText;
end;
if Enabled or StyleServices.Enabled then
DrawNormalText(Canvas.Handle, Text, Rect, Flags)
else
begin
OffsetRect(Rect, 1, 1);
Canvas.Font.Color := clBtnHighlight;
DrawNormalText(Canvas.Handle, Text, Rect... | [
-0.11739418655633926,
-0.4329628646373749,
0.8965750932693481,
-0.2947777211666107,
0.06850527226924896,
0.3388543725013733,
0.20991502702236176,
-0.5231168866157532,
0.01348742377012968,
-0.6222419142723083,
-0.5608457922935486,
0.6971050500869751,
-0.11490678042173386,
-0.171063691377639... | |
:= clBtnShadow;
DrawNormalText(Canvas.Handle, Text, Rect, Flags);
end;
end;
end;
```
before to use it declare an *interposer class* in this way
```
TLabel = class (Vcl.StdCtrls.TLabel)
procedure DoDrawText(var Rect: TRect; Flags: Longint); override;
end;
```
And this is the result
![enter imag... | [
0.04816677048802376,
-0.24198003113269806,
0.882683515548706,
-0.09546619653701782,
0.06945283710956573,
0.04208194464445114,
0.23697829246520996,
-0.752118706703186,
-0.3719867467880249,
-0.4428979456424713,
-0.2882159948348999,
0.58865886926651,
-0.17784444987773895,
0.25369298458099365,... | |
I understand that there are multiple ways to create an object in javascript and I have been reading that object literal syntax is generally preferred. (Correct?)
What I haven't been able to figure out is if there is ever a reason to use any of the other ways to create objects, such as a custom constructor function (`v... | [
0.6063356995582581,
0.21783429384231567,
-0.19378910958766937,
0.034543100744485855,
-0.10424299538135529,
-0.08264315873384476,
0.3849185109138489,
-0.055272024124860764,
-0.24735786020755768,
-0.42808109521865845,
-0.09514281153678894,
0.5341406464576721,
-0.23830172419548035,
-0.0130209... | |
function when you want to create instances of objects, similar to Java.
For example:
```
function MyObj(x){
this.x = x;
}
MyObj.prototype.printX = function(){
alert(this.x);
}
var obj1 = new MyObj("hello");
var obj2 = new MyObj("hello2");
obj1.printX();//prints hello
obj2.printX();//prints hello2
```
Now I ... | [
-0.3407210111618042,
-0.054684288799762726,
0.3368346691131592,
-0.44555291533470154,
-0.025858528912067413,
0.37504059076309204,
0.2969092130661011,
-0.05096788704395294,
-0.2813360393047333,
-0.7521448135375977,
-0.14190690219402313,
0.4615458548069,
-0.7997879385948181,
0.18070687353610... | |
I need to know (in JS) when my model (using knockout.js) or rather a propery has changed.
How do I do that?
Here some code:
```
function DrawingToolViewModel() {
var self = this;
self.drawMode = ko.observable('Line');
}
model = new DrawingToolViewModel();
ko.applyBindings(model);
```
Now the assigned HTML ... | [
0.12902632355690002,
-0.17335405945777893,
0.6863757967948914,
-0.26097309589385986,
-0.024754496291279793,
-0.11757703125476837,
0.28920549154281616,
-0.3733970522880554,
-0.149549201130867,
-0.799822211265564,
0.0122684882953763,
0.5880489349365234,
-0.2427380084991455,
0.096218943595886... | |
me if something in the model has changed"
If you want to register your own subscriptions to be notified of changes to observables, you can call their subscribe function, for example:
```
myViewModel.personName.subscribe(function(newValue) {
alert("The person's new name is " + newValue);
});
```
More details @ [k... | [
0.440057635307312,
-0.20671334862709045,
0.2559777498245239,
-0.09808902442455292,
-0.044703785330057144,
-0.13324850797653198,
0.003920136019587517,
0.028315136209130287,
-0.29108232259750366,
-0.61436927318573,
-0.003614397719502449,
0.18681028485298157,
-0.3011952340602875,
0.1866581290... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.