text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I have this drop-down list of countries:
```
<select name="country">
<option value="">Country...</option>
<option value="Afganistan">Afghanistan</option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
<!-- Removed several options as they are not needed for questio... | [
0.25090476870536804,
-0.0856800451874733,
0.06849579513072968,
0.052408743649721146,
0.10726308822631836,
0.3500664532184601,
-0.11085254698991776,
-0.15003691613674164,
-0.37367749214172363,
-0.45903539657592773,
-0.2546279728412628,
-0.06171397119760513,
-0.5403844118118286,
0.3005790114... | |
default (until changed).
Simply add the `selected` attribute to the `option` the user chose when creating an account.
Basic Idea
----------
### Foreach
```
<?php
$country_list = '<select name="country">';
$selected_country = $user_info['country'];
foreach($countries as $country){
$is_selected = ($country===$selecte... | [
-0.2638230621814728,
-0.021046539768576622,
0.5152059197425842,
-0.015895234420895576,
0.6367823481559753,
-0.07298833876848221,
0.2445417046546936,
0.20267091691493988,
-0.5349142551422119,
-0.4511581361293793,
-0.38313379883766174,
0.29944416880607605,
-0.15286216139793396,
0.26526069641... | |
of a country (e.g., USSR to Russia), you won't have to update it for each user as well (since they'd be linked to the `id` in the `countries` table). I'd suggest database or array due to the fact that sooner or later you'll probably change the markup of the `option` list at some point in time, and having the list in an... | [
0.2836487591266632,
-0.2869430482387543,
0.16314366459846497,
0.20592015981674194,
0.16322965919971466,
0.012645079754292965,
-0.0991620272397995,
0.36019057035446167,
-0.6100580096244812,
-0.5453035235404968,
-0.5519266128540039,
-0.38749223947525024,
-0.45440006256103516,
0.2718481123447... | |
I'm trying to develop a program that convert 6 bytes into a hexadecimal representation (like 00:65:36:21:A5:BC)
with this method :
```
public static String toHexString(byte[] bytes) {
StringBuilder sb = new StringBuilder(18);
for (byte b : bytes) {
if (sb.length() > 0)
sb.a... | [
0.25248053669929504,
0.07503380626440048,
0.5644397139549255,
-0.35334154963493347,
-0.020154403522610664,
0.20502693951129913,
0.4132414162158966,
-0.6002196073532104,
-0.14919395744800568,
-0.40455859899520874,
-0.17421068251132965,
0.3854881227016449,
-0.4249584674835205,
0.301701724529... | |
}
return sb.toString();
}
```
I'm obtaining a good format, but now I have to reverse the digits two by two.
what I obtain 00:65:36:21:A5:BC
what I should get BC:A5:21:36:65:00
Can anybody help me on that final step ?? I'm struggling to take each pair of digits and reverse its position (putting BC at ... | [
0.09186385571956635,
0.15821398794651031,
0.4676259160041809,
-0.4146946668624878,
0.13218924403190613,
0.12731081247329712,
0.3720654249191284,
-0.6168071627616882,
-0.23090052604675293,
-0.34639909863471985,
0.06379619985818863,
0.45243707299232483,
-0.2628841996192932,
0.001198668614961... | |
= bytes.length - 1; i >= 0; i--) {
if (sb.length() > 0)
sb.append(':');
sb.append(String.format("%02x", bytes[i]));
}
return sb.toString();
}
``` | [
0.12804608047008514,
0.15553712844848633,
0.538432240486145,
-0.6033586263656616,
0.10281463712453842,
0.23296606540679932,
0.5641762018203735,
-0.8703204989433289,
-0.1860695630311966,
-0.4593184292316437,
-0.3872900903224945,
0.21592919528484344,
-0.5324450731277466,
0.20950299501419067,... | |
I am using `apache.commons.net.telnet`.
I have `char[] array`. I am calling `TelnetClient.getOutputStream().write(array[i]).`
I expected that my data will be sent by one character at a time, but Wireshark shows that first character is sent alone, and remaining characters are sent together.
Why do I get this situation... | [
0.5179758071899414,
-0.12857015430927277,
0.4100773334503174,
0.07752939313650131,
-0.13973191380500793,
-0.17419134080410004,
0.5068955421447754,
-0.4778241515159607,
-0.17382295429706573,
-0.6698862910270691,
0.03157418593764305,
0.55940842628479,
-0.4858916103839874,
0.02091712877154350... | |
much faster.
Call flush() after your write.
This is the fastest way to send the data, and it is also the way which will create the least latency. That is: Sending the bytes one at a time will NOT ensure that the server will receive them any faster.
Sending the data one byte at a time will slow you down, not speed th... | [
0.20440220832824707,
-0.24366171658039093,
0.5371941924095154,
0.09357081353664398,
-0.020536962896585464,
0.04421008378267288,
0.1928170770406723,
-0.012550911866128445,
-0.2932257354259491,
-0.8429660201072693,
-0.02239798568189144,
0.6825856566429138,
-0.1393166184425354,
-0.13570986688... | |
How can replace values as array by replace in javascript.
I want done replace numbers (for example) together. how is it?
`1` -replace whit-> `11`
`2` -replace whit-> `22`
**DEMO:** <http://jsfiddle.net/ygxfy/>
```
<script type="text/javascript">
var array = {"1":"11", "2":"22"}
var str="13332";
docum... | [
0.32244157791137695,
-0.010146011598408222,
0.37356483936309814,
-0.19347375631332397,
0.06870213896036148,
-0.09208232164382935,
0.25077807903289795,
-0.5766645669937134,
-0.26607605814933777,
-0.7228091359138489,
-0.26771771907806396,
0.4541455805301666,
-0.27573031187057495,
-0.35566720... | |
for (var name in obj_replace_dictionary) {
if (obj_replace_dictionary.hasOwnProperty(name)) {
// Escape characters
pattern.push(name.replace(/([[^$.|?*+(){}\\])/g, '\\$1'));
}
}
// Concatenate keys, and create a Regular expression:
pattern = new RegExp( pattern.join(... | [
-0.21370822191238403,
-0.31175488233566284,
0.6132033467292786,
-0.4371849000453949,
0.30252909660339355,
0.24969133734703064,
0.2273084968328476,
-0.4425266981124878,
-0.11547014117240906,
-0.6127728819847107,
-0.4436419606208801,
0.5859196782112122,
-0.6974107027053833,
-0.12744510173797... | |
return obj_replace_dictionary[match];
});
}
``` | [
-0.2423575222492218,
0.15764276683330536,
0.2845323383808136,
-0.6367208957672119,
0.23141516745090485,
-0.14726243913173676,
0.39703673124313354,
0.11263470351696014,
0.14439533650875092,
-0.5094762444496155,
-0.5192917585372925,
0.9721192121505737,
-0.5538418292999268,
0.1103155240416526... | |
I'm doing a homework assignment for my course in C (first programming course).
Part of the assignment is to write code so that a user inputs a number up to 9 digits long, and the program needs to determine whether this number is "increasing"/"truly increasing"/"decreasing"/"truly decreasing"/"increasing and decreasing... | [
-0.07900753617286682,
-0.02286529168486595,
0.20986853539943695,
0.0881824716925621,
0.1588948518037796,
0.4214611053466797,
0.2816355526447296,
-0.037574898451566696,
-0.4046114683151245,
-0.20584315061569214,
0.14171013236045837,
0.44803500175476074,
-0.11676503717899323,
0.0468048676848... | |
arrays or `getchar` or any of that stuff. The only function I can use to receive input from the user is `scanf`.
So far I've already written the algorithm with a flowchart and everything, but I need to separate the user's input into it's distinct digits.
For example, if the user inputs "1234..." i want to save 1 in... | [
0.19736552238464355,
-0.0442940816283226,
0.4716721475124359,
-0.04666322097182274,
-0.23401455581188202,
0.216994971036911,
-0.07137630134820938,
-0.2620674967765808,
-0.20143988728523254,
-0.6605159640312195,
0.13424183428287506,
0.5661336183547974,
-0.4136023223400116,
-0.02656476572155... | |
to separate each digit by using the % and / operator, but I can't figure out how to "save" these values in a variable that I can later use for the comparisons.
This is what I have so far:
```
printf("Enter a positive number : ");
do {
scanf ("%ld", &number);
if (number < 0) {
printf ("invalid input..... | [
0.1698857843875885,
-0.2084677517414093,
0.1654100865125656,
-0.30893248319625854,
0.2204083800315857,
0.22347579896450043,
0.36554792523384094,
-0.4326046407222748,
-0.0928245484828949,
-0.22038927674293518,
-0.10929606109857559,
0.43773695826530457,
-0.3580321669578552,
0.103073142468929... | |
number % 10;
number = number - a;
number = number / 10;
b = a;
}
```
Why not scan them as characters (string)? Then you can access them via an array offset, by subtracting the offset of 48 from the ASCII character code. You can verify that the character is a digit using `isdigit` from ctype.h.
---
**EDIT... | [
0.338870108127594,
0.11123568564653397,
0.41881391406059265,
0.04840591549873352,
0.14082756638526917,
0.34103721380233765,
0.07208619266748428,
-0.31700006127357483,
-0.20339052379131317,
-0.4753507375717163,
-0.19119103252887726,
0.32671797275543213,
-0.21443958580493927,
0.1619083881378... | |
(number < 0)
{
printf ("invalid input...enter a positive integer: ");
continue;
}
else break;
} while (1);
int a = -1;
int b = -1;
int c = -1;
int d = -1;
int e = -1;
int f = -1;
int g = -1;
int h = -1;
int i = -1;
while (number > 0)
{
if (a < 0) a = number | [
0.009020098485052586,
-0.1538146734237671,
0.1710556149482727,
-0.09961564838886261,
0.2773576080799103,
0.04996873438358307,
0.49164247512817383,
-0.438262939453125,
-0.25519323348999023,
0.101023830473423,
-0.751261293888092,
0.38220348954200745,
-0.36345601081848145,
0.06216999143362045... | |
% 10;
else if (b < 0) b = number % 10;
else if (c < 0) c = number % 10;
else if (d < 0) d = number % 10;
else if (e < 0) e = number % 10;
else if (f < 0) f = number % 10;
else if (g < 0) g = number % 10;
else if (h < 0) h = number % 10;
else if (i < | [
0.014581704512238503,
-0.014550669118762016,
0.35062164068222046,
-0.21606633067131042,
0.15436014533042908,
0.5140573978424072,
0.4039001166820526,
-0.30138251185417175,
0.01087362039834261,
-0.1776946783065796,
-0.6684011220932007,
0.6448916792869568,
-0.37823325395584106,
-0.22289685904... | |
0) i = number % 10;
number /= 10;
}
/* Printing for verification. */
printf("%i", a);
printf("%i", b);
printf("%i", c);
printf("%i", d);
printf("%i", e);
printf("%i", f);
printf("%i", g);
printf("%i", h);
printf("%i", i);
return 0;
}
```
The valid numbers at the end will be positive, s... | [
0.2804184556007385,
0.40120425820350647,
0.45668816566467285,
-0.22675804793834686,
0.2025519460439682,
0.17956088483333588,
0.31975215673446655,
-0.4756862223148346,
0.13422812521457672,
-0.2600240409374237,
-0.5605335831642151,
0.6571592092514038,
-0.3666743040084839,
0.10008176416158676... | |
I am getting an IOException while trying to write to the Google store
The stack trace is attached
> java.io.IOException
> at com.google.appengine.api.files.FileServiceImpl.translateException(FileServiceImpl.java:601)
> at com.google.appengine.api.files.FileServiceImpl.makeSyncCall(FileServiceImpl.java:574)
> at co... | [
-0.1848672479391098,
0.3138187825679779,
0.7681105732917786,
-0.2700599133968353,
-0.01474782358855009,
0.43494242429733276,
0.623137891292572,
-0.3083791136741638,
-0.010226557962596416,
-0.8902416229248047,
-0.41639623045921326,
0.1838235855102539,
-0.07101953774690628,
0.080423258244991... | |
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
> at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:135)
> at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:446)
> at com.google.tracing.TraceContext$Trace... | [
-0.23574863374233246,
0.25383618474006653,
0.40542224049568176,
-0.21040262281894684,
0.19071519374847412,
0.3389778137207031,
0.5518688559532166,
-0.4564364552497864,
-0.5448445677757263,
-0.7257871627807617,
-0.2850807011127472,
0.2946866750717163,
-0.42357757687568665,
0.167836651206016... | |
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:325)
> at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:453)
> at com.google.net.rpc3.client.RpcStub$RpcCallbackDispatcher.rpcFinished(RpcStub.java:828)
> at com.google.net.rpc3.client... | [
-0.17299126088619232,
-0.20411813259124756,
0.5621285438537598,
-0.027379874140024185,
-0.0501236617565155,
0.4006706476211548,
0.48033419251441956,
-0.586142897605896,
-0.47337889671325684,
-0.6996504664421082,
-0.16036714613437653,
0.4065393805503845,
-0.22995509207248688,
0.014945242553... | |
new GSFileOptionsBuilder()
.setBucket("mybucket")
.setKey(key)
.setMimeType("text/html")
.setAcl("public-read")
.addUserMetadata("myfield1", "my field value");
try {
AppEngineFile writableFile = fileService.createNewGSFile(optionsBuilder.build());
// Open a channel for ... | [
-0.049373283982276917,
-0.21294324100017548,
0.9583399891853333,
-0.37643155455589294,
-0.07927919179201126,
0.39638015627861023,
0.5974482893943787,
-0.6444376111030579,
-0.07715911418199539,
-0.7118876576423645,
-0.5622866749763489,
0.6727036237716675,
-0.49358946084976196,
-0.0318091735... | |
out.println(value);
out.close();
writeChannel.closeFinally();
} catch (IOException e) {
// TODO Auto-generated catch block
}
```
I am using App Engine SDK 1.6.4
Thanks
There is a Win32 API `GetTokenInformation` that can be used to check the current token. If the returned token is a sp... | [
0.06086711212992668,
-0.0675433948636055,
0.37266233563423157,
-0.02473670057952404,
-0.11981088668107986,
-0.006838085595518351,
0.36728307604789734,
-0.3306981325149536,
-0.21264265477657318,
-0.4726075530052185,
-0.07829567044973373,
0.3716219365596771,
-0.23148520290851593,
-0.05130094... | |
TokenElevationTypeDefault = 1
* TokenElevationTypeFull = 2
* TokenElevationTypeLimited = 3
A value of TokenElevantionTypeLimited indicates that the user is running with a split token with limited privileges. When elevated the TokenElevationTypeFull value is returned. Non-admin user has a value of TokenElevationTypeDef... | [
-0.16524738073349,
-0.1797541230916977,
0.36645954847335815,
-0.11783573031425476,
-0.07588735967874527,
-0.21308721601963043,
0.4372107684612274,
-0.10976233333349228,
-0.15593594312667847,
-0.41517403721809387,
-0.06924489140510559,
0.1984485238790512,
-0.10211675614118576,
0.18104185163... | |
Lets say i have 2 Entities, User and Address. Each User has to have an Address so there is an one-to-one relation between the tables.
Now i want to generate a user and it should automatically create an address row without data and just mark their relation.
Is this possible in the Entity or in the EntityRepository C... | [
0.2703992426395416,
0.018860826268792152,
0.5077306032180786,
-0.15718379616737366,
-0.09618410468101501,
-0.09032077342271805,
-0.027381978929042816,
-0.22123341262340546,
-0.12258381396532059,
-1.0998374223709106,
0.07409791648387909,
0.4370114803314209,
-0.34203848242759705,
0.397584199... | |
Address);
}
}
```
And set [cascade persist](http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/working-with-associations.html#transitive-persistence-cascade-operations):
```
* @OneToOne(targetEntity="Address", cascade={"persist"})
``` | [
0.0809120312333107,
-0.061696607619524,
0.5706430077552795,
-0.03428437188267708,
0.2096187174320221,
-0.03923727571964264,
0.543383777141571,
-0.2720426619052887,
-0.4646196961402893,
-0.1056196317076683,
-0.1076427772641182,
0.47036612033843994,
-0.23929934203624725,
0.2510834038257599,
... | |
Normally I would set the pool size as
```
development:
adapter: postgresql
encoding: unicode
database: openkitchen_development
username: rails
host: localhost
pool: 10
password:
```
in database.yml. However heroku replaces the config file. I'm using girl\_friday to
do background db work and need to inc... | [
-0.036565884947776794,
-0.11671922355890274,
0.2861015200614929,
0.09790711104869843,
-0.24671867489814758,
0.18036314845085144,
0.27717915177345276,
-0.1612509936094284,
-0.2790965437889099,
-0.5670122504234314,
-0.01596784219145775,
0.5269237756729126,
-0.12179108709096909,
-0.1542573422... | |
I am trying to simulate a ListView in a LinearLayout in order to show three rows with identical layout. This single View is composed by a ratingbar and a content. It is very strange, but all ratingBars receive the last assigned value. First of all this is my custom Component that extends LinearLayout just adding these ... | [
0.5986546874046326,
-0.11984734237194061,
0.8401151895523071,
-0.15151728689670563,
-0.19601887464523315,
0.11724967509508133,
0.24173447489738464,
-0.5883634686470032,
0.01709425076842308,
-0.757504940032959,
0.12067920714616776,
0.5696219801902771,
-0.23823262751102448,
0.486689716577529... | |
vi.setId(i);
addView(vi);
}
}
private View buildElementView(Item itemElement) {
View view = inflater.inflate(R.layout.element_list_item, null, true);
// set values
View header = view.findViewById(R.id.header);
RatingBar ratingInItem = (RatingBar) header.findViewById(R.id.ratingBarInItem);
... | [
0.3047981560230255,
-0.07290179282426834,
1.0529248714447021,
-0.29120519757270813,
-0.30889925360679626,
0.3599899709224701,
0.38417476415634155,
-0.8338498473167419,
-0.08166782557964325,
-0.6533367037773132,
-0.14726100862026215,
0.7323618531227112,
-0.29127660393714905,
0.2056864500045... | |
android:minHeight="60.0dp"
android:orientation="vertical"
android:paddingBottom="8.0dp"
android:paddingLeft="5.0dp"
android:paddingRight="5.0dp"
android:paddingTop="8.0dp" >
<RelativeLayout
android:id="@+id/header"
android:layout_width="fill_parent"
android:layout_height... | [
-0.20753388106822968,
-0.368051141500473,
0.774390459060669,
-0.21968771517276764,
0.012063676491379738,
0.23570093512535095,
-0.07454859465360641,
-0.4660326838493347,
-0.17252440750598907,
-0.680587887763977,
-0.2874143123626709,
0.5308752059936523,
0.01733310893177986,
-0.31154137849807... | |
android:isIndicator="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:numStars="5"
android:stepSize="0.1" />
</RelativeLayout>
<TextView
android:id="@+id/content"
s... | [
-0.37913963198661804,
-0.40963366627693176,
0.5556018948554993,
-0.2641136050224304,
0.11936969310045242,
0.2760007679462433,
0.1353311389684677,
-0.44263002276420593,
-0.08229928463697433,
-0.7896365523338318,
-0.2647331953048706,
0.5029003620147705,
0.06849132478237152,
-0.14784668385982... | |
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:layout_marginRight="3dp"
android:layout_marginTop="3dp"
android:textColor="@color/dark_brown"
android:textSize="@dimen/text_size_small" />
</LinearLayout>
```
I call the setElements method inside on... | [
-0.04345734417438507,
-0.06028810515999794,
0.8138198852539062,
-0.15560956299304962,
0.02589402347803116,
0.1713935285806656,
0.05614548176527023,
-0.5907083749771118,
-0.052498579025268555,
-0.6823706030845642,
-0.11916102468967438,
0.5405043959617615,
0.022131431847810745,
-0.2294417023... | |
a bug?
EDIT: this is my onSaveInstanceMethod:
```
@Override
public void onSaveInstanceState(Bundle outState) {
if (elements != null) {
outState.putSerializable("elements", elements);
}
super.onSaveInstanceState(outState);
}
```
Thanks
Simply add a `pool` query parameter to the `DATABASE_UR... | [
0.14745540916919708,
-0.29465633630752563,
0.298599511384964,
0.22542604804039001,
0.30040860176086426,
0.18989403545856476,
0.10879762470722198,
-0.22560954093933105,
-0.2923606038093567,
-0.42952483892440796,
0.009134773164987564,
0.5453176498413086,
-0.6098282933235168,
-0.0579373352229... | |
Right now I havae a menu, that I'm using jquery to do a fade in and out on mouseenter and leave
this is super basic jsfiddle of the function (loos like hell i know, but you ge the idea)
<http://jsfiddle.net/A26d9/2/>
So..right now only the text is clickable. How can I make it so the entire div is clickable. I've trie... | [
0.09003008902072906,
0.19810549914836884,
0.5104900598526001,
-0.3857337534427643,
0.1977379024028778,
-0.10777673125267029,
0.4603791832923889,
-0.02355896681547165,
-0.22336582839488983,
-0.6942269802093506,
-0.10524771362543106,
0.6438820958137512,
-0.21384143829345703,
0.15480999648571... | |
`#home` div, and send the browser there on click.
```
$(document).ready(function() {
$('#home')
.mouseenter(function() {
$('.home_hover', $(this)).fadeIn()
})
.mouseleave(function() {
$('.home_hover', $(this)).fadeOut();
})
.click(function() {
... | [
0.054886627942323685,
0.1918349713087082,
0.7079444527626038,
-0.7141785025596619,
0.6016860008239746,
0.015285944566130638,
0.39061012864112854,
-0.14226216077804565,
0.23888835310935974,
-0.862959086894989,
-0.4757096469402313,
0.5787338018417358,
-0.4888240694999695,
0.6253055334091187,... | |
if (link.length) {
window.location.assign(link.attr("href"));
}
});
});
```
[**Example fiddle**](http://jsfiddle.net/A26d9/11/) | [
-0.23095987737178802,
0.04078729823231697,
0.6949959397315979,
-0.3272269368171692,
0.18044137954711914,
-0.11588244140148163,
0.3290027678012848,
-0.3233063519001007,
-0.25631287693977356,
-0.48019593954086304,
-0.305288165807724,
0.44133129715919495,
-0.02490122802555561,
0.3108646273612... | |
I want to make a website where the (dynamic in height) header and footer have a fixed position. The content should start directly beneath the header. I made a quick [example](http://www.braemhof.be/fixed.html). (Yellow and red top positions are the same, I want the yellow DIV to start beneath the red DIV.)
If you set ... | [
0.44730013608932495,
-0.18983091413974762,
0.7174741625785828,
0.04603786766529083,
-0.059902384877204895,
-0.18043343722820282,
0.03480986878275871,
0.1570286899805069,
-0.1920645833015442,
-0.5459904074668884,
-0.20284625887870789,
0.3177250623703003,
-0.17812703549861908,
-0.03200606629... | |
the header takes up at the top of the screen:
* `padding-top:`
* `margin-top:`
* `position:relative + top:`
Then have a separate CSS style sheet to change `height` for regular `viewport`s versus mobile `viewport`s.
*(Or see below for JavaScript solution to set the `height` attribute dynamically.)*
* [jsFiddle](http... | [
-0.031238596886396408,
-0.10311315953731537,
0.8655716180801392,
0.09757575392723083,
-0.1911090612411499,
-0.19095759093761444,
-0.5338108539581299,
-0.2393633872270584,
-0.2011033147573471,
-0.6385033130645752,
-0.09274160861968994,
0.16318348050117493,
-0.12320458143949509,
-0.141936063... | |
position:fixed;
height:100px;
width:100%;
background-color:green;
color:white;
}
#wrapper {
position:relative;
top:101px;
}
```
CSS (mobile version):
```
#header {
height:50px;
}
#wrapper {
top:51px;
}
```
---
**JavaScript Solution**
HTML *(copy-and-paste-able)*:
```
<head>
<style>
#header... | [
-0.2927370071411133,
-0.12098270654678345,
0.7616665363311768,
-0.10681348294019699,
0.18586504459381104,
0.3271733224391937,
-0.03370968997478485,
-0.1188952773809433,
-0.2882457673549652,
-0.5333296060562134,
-0.5885255932807922,
0.35879161953926086,
-0.10431503504514694,
-0.232570499181... | |
<div id="header">
Header
</div>
<div id="wrapper">
<p>First Row</p>
<p>Next row</p>
<p>...</p>
<p>Last row</p>
<div>
<script language="javascript">
document.getElementById('wrapper').style.top = String(document.getElementById("header").offsetHeight + 1);
</script>... | [
0.2759450376033783,
-0.07934418320655823,
0.47269779443740845,
-0.07978958636522293,
-0.06430815905332565,
-0.034388281404972076,
-0.18787936866283417,
-0.6379479765892029,
0.0022676929365843534,
-0.6373355388641357,
-0.3263019323348999,
0.3283969759941101,
-0.1875300109386444,
-0.17506252... | |
My query takes about 3-5 seconds to run. When I run the report, a simple summary of a few columns it takes 25-30 minutes!! It is a Group Left report. I've tried playing around with the query, and I've tried handling the grouping in the query with no luck. Any ideas what might be causing this?
This is actually more or l... | [
0.07111731171607971,
0.14134415984153748,
0.6800422072410583,
-0.2234448939561844,
-0.11964773386716843,
-0.13787804543972015,
0.5899769067764282,
-0.24714286625385284,
-0.11449988931417465,
-0.7356698513031006,
-0.17999500036239624,
0.3465692102909088,
-0.13830503821372986,
0.192978233098... | |
"day time is hour 6 to hour 21 but *not including* hour 21".
edit: here is a generic (and sadly much less pithy) solution:
```
class TimeRange
private
def coerce(time)
time.is_a? String and return time
return time.strftime("%H:%M")
end
public
def initialize(start,finish)
... | [
0.38685348629951477,
0.02178165689110756,
0.25717633962631226,
-0.21015433967113495,
0.297282338142395,
0.1535232812166214,
0.45035797357559204,
-0.302065372467041,
-0.24552364647388458,
-0.7700642347335815,
-0.32494959235191345,
0.4144448935985565,
-0.3536469042301178,
0.4144463539123535,... | |
time = coerce(time)
@start < @finish and return (@start..@finish).include?(time)
return !(@finish..@start).include?(time)
end
end
```
You can use it almost like a normal Range:
```
irb(main):013:0> TimeRange.new("02:00","01:00").include?(Time.mktime(2010,04,01,02,30))
=> true
irb(main):014:0> Tim... | [
0.037993233650922775,
-0.1972772628068924,
0.33079633116722107,
-0.15605686604976654,
0.32057273387908936,
0.15839482843875885,
0.516571581363678,
-0.6389591097831726,
-0.187642440199852,
-0.6035523414611816,
-0.14812636375427246,
0.3503168225288391,
-0.37415164709091187,
0.287049680948257... | |
I'm calling system command
```
system("tftp -m binary 192.168.1.1 -c get myfile > /dev/null") ;
```
it works fine when tftp server is running but it makes my c program crashed when tftp server is off.
Is there a way to check whether the server is available or not in c source code ?
I think your problem lies not i... | [
0.23384132981300354,
0.3109482228755951,
0.2606119215488434,
-0.0401897169649601,
0.06793606281280518,
-0.20892764627933502,
0.14487019181251526,
0.2663571238517761,
-0.12135234475135803,
-0.5119427442550659,
-0.31569212675094604,
0.46886903047561646,
-0.4542098939418793,
0.547796964645385... | |
you could try piping commands into tftp (simulating an interactive session), like so:
```
system( "echo -e \"binary\\nget myfile\\nquit\" | tftp 192.168.1.1" );
```
If the server isn't available, it'll time out after a few seconds and return control to your program. | [
-0.07786812633275986,
-0.49827075004577637,
0.2687556743621826,
-0.016648178920149803,
0.16557124257087708,
-0.024297716096043587,
0.44694459438323975,
0.06619778275489807,
-0.42979422211647034,
-0.3644930422306061,
-0.30648669600486755,
0.4265527129173279,
-0.4726557731628418,
0.081596471... | |
Having read this question [Immutable or not immutable?](https://stackoverflow.com/questions/9009627/immutable-or-not-immutable) and reading answers to my previous questions on immutability, I am still a bit puzzled about efficient implementation of simple LinkedList that is immutable. In terms of array tha seems to be ... | [
0.3330208957195282,
0.24487623572349548,
0.2362465113401413,
0.06018201634287834,
-0.03436241298913956,
-0.3826694190502167,
0.10366225987672806,
-0.116730697453022,
-0.09768041223287582,
-0.510406494140625,
-0.06956936419010162,
0.5219515562057495,
-0.6766862869262695,
0.47443947196006775... | |
the list when we insert an element?
I am also curious about answers in [Immutable or not immutable?](https://stackoverflow.com/questions/9009627/immutable-or-not-immutable) that mention cerain optimization leading to log(n) time and space with a help of a binary tree. Also, I read somewhere that adding an elem to the ... | [
0.30535781383514404,
0.19899435341358185,
0.38145875930786133,
0.29980018734931946,
0.022598261013627052,
0.16082681715488434,
0.0020614671520888805,
-0.26551419496536255,
-0.30724141001701355,
-0.4787560701370239,
-0.12784330546855927,
0.5013663172721863,
-0.051382746547460556,
0.14687821... | |
in advance for your help.
> Supposedly we have a general class of Node and class LinkedList based on the above allowing the user to add, remove etc. Now, how would we ensure immutability?
You ensure immutability by making every field of the object readonly, and ensuring that every object referred to by one of those re... | [
0.45221051573753357,
-0.0745839849114418,
0.30198851227760315,
0.4527016282081604,
0.08463488519191742,
-0.3010115921497345,
0.13453064858913422,
-0.047152113169431686,
-0.1665830910205841,
-0.658178448677063,
0.008852733299136162,
0.6756328344345093,
-0.35729292035102844,
0.30049398541450... | |
are getting at here is the difference between *immutable* and *persistent*. An immutable data structure cannot be changed. A *persistent* data structure takes advantage of the fact that a data structure is immutable in order to re-use its parts.
A persistent immutable linked list is particularly easy:
```cs
abstract ... | [
0.08009594678878784,
-0.12572035193443298,
0.6453769207000732,
-0.12586301565170288,
0.0165939312428236,
-0.03031803108751774,
0.1389816403388977,
-0.10603123903274536,
-0.3229885697364807,
-0.6200206279754639,
-0.3235316872596741,
0.619204580783844,
-0.7783222198486328,
0.2462888509035110... | |
ImmutableList Add(int head);
private sealed class EmptyList : ImmutableList
{
public override int Head { get { throw new Exception(); } }
public override ImmutableList Tail { get { throw new Exception(); } }
public override bool IsEmpty { get { return true; } }
public override I... | [
-0.03644877299666405,
-0.14986735582351685,
0.4063904881477356,
-0.3191971778869629,
0.12199815362691879,
-0.34747233986854553,
0.3255956172943115,
-0.3361144959926605,
-0.07123320549726486,
-0.3489150106906891,
-0.3778832256793976,
0.4588507115840912,
-0.6677519083023071,
0.38942322134971... | |
return new List(head, this);
}
}
private sealed class List : ImmutableList
{
private readonly int head;
private readonly ImmutableList tail;
public override int Head { get { return head; } }
public override ImmutableList Tail { get { return tail; } }
public o... | [
-0.2493429332971573,
-0.3273293375968933,
0.5843451023101807,
-0.18823669850826263,
0.2983574867248535,
-0.21693852543830872,
0.22615253925323486,
-0.26155149936676025,
0.03151964396238327,
-0.35300976037979126,
-0.4341101050376892,
0.5189653038978577,
-0.6160625219345093,
0.57453364133834... | |
bool IsEmpty { get { return false; } }
public override ImmutableList Add(int head)
{
return new List(head, this);
}
}
}
...
ImmutableList list1 = ImmutableList.Empty;
ImmutableList list2 = list1.Add(100);
ImmutableList list3 = list2.Add(400);
```
And there you go. Of course you... | [
-0.09783267974853516,
-0.004003405105322599,
0.3854399621486664,
-0.3225574791431427,
0.11668231338262558,
-0.3546605706214905,
0.4330366253852844,
-0.3990294933319092,
-0.1879616230726242,
-0.47027865052223206,
-0.30242687463760376,
0.5287357568740845,
-0.5511980056762695,
0.2319253683090... | |
the contents of an existing immutable list; list3 re-uses the contents of list2, which it can do safely because list2 is never going to change.
> Would any of your answers also work on doubly-linked lists?
You can of course easily make a doubly-linked list that does a full copy of the entire data structure every tim... | [
0.10589810460805893,
-0.005110112018883228,
0.30181270837783813,
0.3927361071109772,
-0.12898270785808563,
-0.06890971213579178,
0.29615625739097595,
-0.1704488843679428,
-0.4116336405277252,
-0.5497954487800598,
0.015596956945955753,
0.5316416621208191,
-0.3830784857273102,
0.063129685819... | |
direction. Rather than saying "can I make a persistent doubly-linked list?" ask yourself "what are the properties of a doubly-linked list that I find attractive?" List those properties and then see if you can come up with a persistent data structure that has those properties.
For example, if the property you like is t... | [
-0.020246857777237892,
-0.2687414288520813,
0.7291816473007202,
0.3797271251678467,
-0.03535836562514305,
0.09242459386587143,
-0.20616228878498077,
0.08704021573066711,
-0.41231992840766907,
-0.7189083099365234,
-0.054496705532073975,
0.608828604221344,
-0.22615155577659607,
0.14895205199... | |
deque here:
<http://blogs.msdn.com/b/ericlippert/archive/2008/02/12/immutability-in-c-part-eleven-a-working-double-ended-queue.aspx>
Extending it to be a catenable deque is left as an exercise; the paper I link to on finger trees is a good one to read.
UPDATE:
> according to the above we need to copy prefix up to ... | [
-0.09670140594244003,
-0.1575564742088318,
0.34891846776008606,
0.14761176705360413,
-0.15741845965385437,
0.32925549149513245,
0.10007116198539734,
-0.3251643776893616,
-0.3612533509731293,
-0.622461199760437,
-0.15311668813228607,
0.22793444991111755,
-0.1487244814634323,
0.1952990889549... | |
25, 30, 40).
What parts can we reuse? The tails we have in hand are (20, 30, 40), (30, 40) and (40). Clearly we can re-use (30, 40).
Drawing a diagram might help. We have:
```
10 ----> 20 ----> 30 -----> 40 -----> Empty
```
and we want
```
10 ----> 20 ----> 25 -----> 30 -----> 40 -----> Empty
```
so let's make
... | [
0.1504393368959427,
0.28088635206222534,
0.5578112006187439,
0.0823742225766182,
0.03079267218708992,
0.4569498598575592,
-0.12116918712854385,
-0.784231424331665,
-0.2722761929035187,
-0.44234058260917664,
0.1723647564649582,
0.4951469302177429,
-0.1201266199350357,
0.06539061665534973,
... | |
that part is in common to both lists.
UPDATE:
> Would it be possible to provide the code for random insertion and deletion as well?
Here's a *recursive* solution:
```cs
ImmutableList InsertAt(int value, int position)
{
if (position < 0)
throw new Exception();
else if (position == 0)
retu... | [
-0.017605669796466827,
-0.13607361912727356,
0.16260360181331635,
-0.30347517132759094,
0.1056264117360115,
-0.15793438255786896,
0.2480500042438507,
-0.38267943263053894,
-0.32136937975883484,
-0.474163293838501,
-0.1790076047182083,
0.46037718653678894,
-0.49935081601142883,
-0.072066061... | |
write a *non-recursive* InsertAt and DeleteAt. Remember, *you have an immutable linked list at your disposal*, so you can use one in your iterative solution! | [
-0.03986557573080063,
-0.09200198948383331,
-0.12952634692192078,
-0.094037726521492,
-0.06417321413755417,
-0.11577550321817398,
0.5386906862258911,
0.13002200424671173,
-0.17643488943576813,
-0.7513476014137268,
-0.16572770476341248,
0.46499842405319214,
-0.3661482632160187,
0.0214410442... | |
Since mongo isn't relational I'm wondering how to find a particular type on a has\_many polymorphic association.
I have 3 models, [Place, City, & Country] all 3 can have reviews (polymorphic)
How can I return all reviews with a particular model association? I know how to do it on a simple has\_many association but no... | [
-0.10766550153493881,
0.19048182666301727,
0.16878411173820496,
-0.03285115584731102,
-0.319111168384552,
0.2890206575393677,
0.1839112639427185,
-0.3924897313117981,
-0.5931066274642944,
-0.43389108777046204,
0.06445180624723434,
0.6062279343605042,
-0.6500582695007324,
0.1715422868728637... | |
your polymorphic relationship was named `reviewable` You can query your reviews by their association type like this:
```
Review.where(:reviewable_type => "Place") # Returns all reviews for 'places'
Review.where(:reviewable_type => "City") # Returns all reviews for 'cities'
Review.where(:reviewable_type => "Country") #... | [
0.17452217638492584,
0.0012268649879842997,
0.5167866349220276,
0.31241199374198914,
0.0709211602807045,
0.165095254778862,
0.16248808801174164,
0.08336036652326584,
-0.20282664895057678,
-0.19257892668247223,
-0.05898981913924217,
0.17295445501804352,
-0.557783305644989,
0.235841661691665... | |
When i started my Android project i had a misunderstanding that every screen that's shown in the application must be a new activity. Now i am finished with the project , i have checked it on my emulator as well as on a couple of android phones. So far i am not witnessing any problems, but recently i read somewhere that... | [
0.7211147546768188,
0.059895552694797516,
0.38392552733421326,
-0.0823989287018776,
0.04429499804973602,
0.042954206466674805,
0.6362594366073608,
0.21532145142555237,
-0.6053438186645508,
-0.6863019466400146,
0.18601886928081512,
0.5827202796936035,
-0.04314601421356201,
-0.01468694489449... | |
done it's part is enough?
While creating complex applications you definite need to create many activities. So it depends on your application how many activities you need. No of activities in a project do not affect the performance.
The effect is produced by the number of activities in the stack of your android. So it ... | [
0.5076212286949158,
-0.36579638719558716,
0.3136131167411804,
0.1733211874961853,
-0.1316799521446228,
0.20455099642276764,
0.561085045337677,
-0.4739237129688263,
-0.5995451807975769,
-0.3572517931461334,
0.1568792164325714,
0.8012849688529968,
-0.19824446737766266,
-0.2206782102584839,
... | |
The Github wikis are backed by a separate git repository then the main project repository.
[This post](https://github.com/blog/699-making-github-more-open-git-backed-wikis) by the Github team makes it sound like you should be able to link to images stored in the wiki repository inside the wiki markup.
> **Images and ... | [
0.5699590444564819,
0.15076889097690582,
0.31046417355537415,
0.07767485827207565,
-0.3138097822666168,
-0.1572665423154831,
0.14521841704845428,
0.10708630084991455,
-0.2566975951194763,
-0.813120424747467,
-0.3084437847137451,
0.37525781989097595,
0.03389695659279823,
0.08983487635850906... | |
page on images](https://github.com/mojombo/gollum-demo/blob/master/Mordor/Eye-Of-Sauron.md). | [
-0.1019790843129158,
0.30045196413993835,
0.1631162315607071,
-0.32744133472442627,
0.10900066047906876,
-0.11960157752037048,
0.024707812815904617,
0.24173134565353394,
-0.9146720170974731,
-0.07679075002670288,
-0.745541512966156,
0.3102859854698181,
-0.017801014706492424,
0.128467395901... | |
**What I would like to achieve:**
I have two different fragments. I would like them both to show the same data in two forms (in a list and on a map). I would like them to share one Loader (`AsyncTaskLoader` in particular). Everything works fine, but the Loader isn't re-used. Another one is created and the data is load... | [
0.11879423260688782,
-0.11379818618297577,
0.10590464621782303,
-0.11951172351837158,
-0.27693232893943787,
-0.06811735779047012,
0.07748261094093323,
-0.46758729219436646,
-0.19884848594665527,
-0.7434702515602112,
-0.14223803579807281,
0.5435903668403625,
-0.13177832961082458,
-0.0316186... | |
the data is downloaded twice.
**How to re-connect to the same Loader from a different Activity/Fragment than the one it was started in?**
It should be possible since the context is attached to the Loader anyway on every `onCreate()`, e.g. on configuration change.
> How to re-connect to the same Loader from a differen... | [
0.30758947134017944,
-0.046430595219135284,
0.28673091530799866,
0.4425825774669647,
-0.05284829065203667,
-0.24303320050239563,
0.31193017959594727,
-0.2021595537662506,
-0.5017348527908325,
-0.6220697164535522,
-0.3796656131744385,
0.473771333694458,
-0.2073477804660797,
0.28481653332710... | |
you are in another `Activity`.
From the documentation:
> LoaderManager.LoaderCallbacks is a callback interface that lets a
> client interact with the LoaderManager.
>
>
> Loaders, in particular CursorLoader, are expected to retain their data
> after being stopped. This allows applications to keep their data
> ac... | [
-0.03798361495137215,
-0.31846028566360474,
0.4652000069618225,
0.13635535538196564,
-0.1600981056690216,
-0.3155796527862549,
0.2454500049352646,
-0.10949740558862686,
-0.4171314537525177,
-0.42374640703201294,
-0.06912893056869507,
0.6157328486442566,
-0.2508789598941803,
-0.029144123196... | |
stop using a loader's data.
In other words, it is often the case that your `Loader`s will be specific to some Activity (or Fragment). When you have your `Activity` implement the `LoaderManager.LoaderCallbacks` interface, your Activity is given type `LoaderManager.LoaderCallbacks`. Each time you call `initLoader(int ID... | [
0.24539704620838165,
-0.3563472628593445,
0.14779698848724365,
0.039538007229566574,
-0.08638586103916168,
-0.4167047142982483,
0.35466840863227844,
0.006482560653239489,
-0.49721965193748474,
-0.5110142230987549,
-0.3717174530029297,
0.37727656960487366,
-0.6708275079727173,
0.02360197156... | |
can find a way to have your two separate Activitys share the same callback methods, I doubt there is a clean way to do this (i.e. having an Activity and a Fragment share the same callbacks sounds like it would be tricky, if not impossible). I wouldn't worry about it too much though. In all of the sample code I have eve... | [
0.6081598997116089,
-0.09989465773105621,
-0.29333531856536865,
0.36994609236717224,
-0.07782115787267685,
-0.4785122573375702,
0.4598528742790222,
0.01537257619202137,
-0.3943791091442108,
-0.6844392418861389,
0.19231624901294708,
0.3166937828063965,
-0.4065147340297699,
0.185817286372184... | |
would be encouraged. | [
0.331608384847641,
-0.036075469106435776,
0.048736341297626495,
0.15935885906219482,
0.015009082853794098,
-0.023033028468489647,
0.04096008837223053,
0.07649391889572144,
0.0570109523832798,
-0.3218029737472534,
0.013833710923790932,
0.3383098244667053,
0.15940630435943604,
-0.01250084862... | |
My sed only works if the input file last entry is 'in', how would I get it to work if file has 'in' or 'out'? I've tried different variations with no success.
```
egrep -w 'TCP|UDP' denied.txt | sed 's/:[^:]* in/ in/'
egrep -w 'TCP|UDP' denied.txt | sed 's/:[^:]* in/ in/ out/ out/'
egrep -w 'TCP|UDP' denied.txt | sed ... | [
-0.1344301849603653,
0.19085238873958588,
0.4355263113975525,
-0.22624796628952026,
0.19349312782287598,
-0.16914187371730804,
0.4619024097919464,
-0.19483010470867157,
0.0065286848694086075,
-0.864607572555542,
-0.25268709659576416,
0.47070571780204773,
-0.282821387052536,
0.2266547977924... | |
What is the diffrence between...
```
execute as user = 'testuser'
```
AND
```
execute as login = 'testuser'
```
I am executing a cross database procedure under these logins and it works with the exececute as login but not the execute as user. It is saying the server principal "testuser" is nt able to access the ... | [
0.24132391810417175,
0.25150951743125916,
0.2518502473831177,
-0.010138553567230701,
0.17361249029636383,
0.06543421745300293,
0.3825121819972992,
0.08965595066547394,
-0.12420084327459335,
-0.5005009174346924,
-0.19437658786773682,
0.3366684913635254,
-0.37837761640548706,
0.4733591079711... | |
database, which is why you see the error when you cross databases. | [
0.2665533721446991,
0.19527722895145416,
-0.1266557276248932,
0.7356667518615723,
0.1399216502904892,
-0.12130095064640045,
0.05017215013504028,
0.31676414608955383,
-0.3090483546257019,
-0.706333339214325,
0.1757931113243103,
0.4768957197666168,
-0.3947179317474365,
0.18639083206653595,
... | |
I start a iPad game using cocos2d..
When I add a full screen image as its background, the frame decreases to 30..
Is there any way to improve it?
Did iOS Simulator cause this?
```
CCSprite *background = [CCSprite spriteWithFile:@"demoBackground.png"];
background.position = CGPointMake(winSize.width/2, winSize.height/2... | [
-0.014048831537365913,
-0.08210863173007965,
0.4150375723838806,
0.22195687890052795,
0.20361103117465973,
0.05640996992588043,
0.27600395679473877,
-0.005680637434124947,
-0.3318468928337097,
-0.7250052094459534,
0.21449878811836243,
0.56523197889328,
-0.17337587475776672,
-0.283700615167... | |
I know that to instantiate a new OLEDbCommand object you do this:
```
OleDbCommand command = new OleDbCommand(queryString, connection);
```
However, I am confused as to what this line of code is doing:
```
OleDbCommand cmd = aConnection.CreateCommand();
```
I know that aConnection is an OleDbConnection object whi... | [
-0.16430194675922394,
0.004940529353916645,
0.45360067486763,
0.13774342834949493,
-0.02236124314367771,
-0.4818696975708008,
-0.030568309128284454,
0.06332429498434067,
-0.35092806816101074,
-0.44107046723365784,
-0.21299295127391815,
0.531832754611969,
-0.5229718685150146,
0.422381043434... | |
order to be able to use SQL commands? I infer this because further on in the code there is the following:
```
cmd.CommandText = "SELECT * FROM Team where typeOfSport = '" + typeOfSport + "'";
```
It is just creating a command from the connection object. The command will be associated with the connection it was create... | [
0.1524614840745926,
-0.053089749068021774,
0.5100240111351013,
0.03447236865758896,
0.07359029352664948,
-0.4059377908706665,
0.24018827080726624,
-0.17715834081172943,
-0.28165528178215027,
-0.77266925573349,
-0.08406959474086761,
0.6148928999900818,
-0.43387505412101746,
0.05419048666954... | |
I'm curious, is the standard "Share" dialog you see throughout a lot of iOS apps a standard SDK dialog or is everyone just mimicking the ones that Apple created for their apps like Safari? Or perhaps everyone is using ShareKit?
For instance, on iPhone you get a nice 3/4 modal dialog which does a vertical cover appeara... | [
0.49824318289756775,
0.0011295662261545658,
0.11920981854200363,
0.10032665729522705,
-0.13938544690608978,
0.05239174887537956,
0.13918860256671906,
0.09243378043174744,
-0.4936542212963104,
-0.5510767698287964,
0.009505672380328178,
0.5961954593658447,
-0.4599882662296295,
-0.04467716440... | |
by the fact that on iPad, the UIActionSheet is always presented within a popover controller, and on the iPhone it displays as in your example, withouth a Popover Controller (which is only available on the iPad) | [
-0.13841623067855835,
-0.09786819666624069,
0.7186133861541748,
0.21242277324199677,
0.1787443459033966,
0.052306752651929855,
-0.0932762622833252,
0.20069943368434906,
-0.4353082478046417,
-0.6615142822265625,
-0.38964593410491943,
-0.07108669728040695,
-0.2534541189670563,
-0.09599308669... | |
I have the following problem with inheritance and templates:
```
class Base {};
class Deriv : public Base {};
template <class T> class X{};
void f(X<Base>& inst) {}
int main()
{
X<Base> xb;
f(xb);
X<Deriv> xd;
f(xd);
return 0;
}
```
The program doesn't compile because there is not relation between `X<Ba... | [
0.38367709517478943,
0.1286333054304123,
-0.06213001534342766,
-0.008490847423672676,
-0.09181713312864304,
-0.18709595501422882,
0.20214280486106873,
-0.29212212562561035,
0.06975890696048737,
-0.6079792976379395,
0.11794880032539368,
0.6450121402740479,
-0.36814460158348083,
0.5517124533... | |
T>
class X;
template<>
class X<Base> {
int x;
};
template<>
class X<Deriv> {
double d;
};
```
They're definitely not interchangeable. So no, there is no relation between those classes and you can't pass one to a function expecting the other. You'll have to do something like make both types inherit from anot... | [
0.3240906298160553,
-0.17142245173454285,
0.05530409514904022,
-0.13665901124477386,
-0.3344952464103699,
0.0849708765745163,
0.17679110169410706,
-0.33680325746536255,
0.06679598242044449,
-0.6921408772468567,
-0.17895090579986572,
0.6754672527313232,
-0.5465006828308105,
0.21065466105937... | |
I'm trying to change the background image for all my xaml pages in the app.xaml, unsuccessfully.
I'm trying the following, in the App constructor:
```
var imageBrush = new ImageBrush
{
ImageSource = new BitmapImage(new Uri("/Images/SomeBackgroundImage.png", UriKind.Relative))
};
RootFrame.Background = imageBrush... | [
0.07839839905500412,
0.08229523152112961,
0.8063817620277405,
-0.16428275406360626,
-0.015329772606492043,
0.22621722519397736,
0.40118634700775146,
-0.058646753430366516,
-0.19154135882854462,
-0.9288728833198547,
-0.184003084897995,
0.6441183686256409,
-0.5049829483032227,
0.184931516647... | |
if ((Visibility)App.Current.Resources["PhoneLightThemeVisibility"] == Visibility.Visible)
{
imageBrush = new ImageBrush
{
ImageSource = new BitmapImage(new Uri("/Images/Background1.png", UriKind.Relative))
};
}
else
{
imageBrush = new ImageBrush
{
... | [
-0.03205300495028496,
-0.5469446182250977,
1.047021746635437,
0.019600728526711464,
-0.051131993532180786,
0.32374152541160583,
0.3166500926017761,
-0.5312793254852295,
0.1366094946861267,
-0.7363944053649902,
-0.12984082102775574,
0.7181352972984314,
-0.18773114681243896,
0.05572762712836... | |
BitmapImage(new Uri("/Images/Background2.png", UriKind.Relative))
};
}
return imageBrush;
}
```
And in each page I set the background image.
```
LayoutRoot.Background = Utils.GetBackground();
``` | [
-0.06429097801446915,
-0.3444887399673462,
0.7625294327735901,
-0.1998264491558075,
0.12232491374015808,
0.2692527174949646,
0.16562359035015106,
-0.32375290989875793,
-0.04798094555735588,
-0.7413471341133118,
-0.23067674040794373,
0.6939471364021301,
-0.40159061551094055,
-0.146732926368... | |
I'm working on the datafeed script for my Affiliate program and really thought I was "doin' it" but when I run the script it creates the CSV file with only 7 of 28 products. Prior to testing I made all the products meet the conditions of the query so they all should be included.I even removed the stock level and price ... | [
0.5780054330825806,
0.2412024289369583,
0.37932288646698,
0.03894362971186638,
0.03581904619932175,
0.31844326853752136,
0.08098679780960083,
-0.22285941243171692,
-0.24060483276844025,
-0.24139706790447235,
0.13215143978595734,
0.07475811243057251,
-0.2267354279756546,
0.6667952537536621,... | |
of the 23 in the second category are returned.
**The Goal** is to get the specific data for all products from the categories in the query and dump them into a csv file.
This is my first time trying to write a more complex sql query (for a beginner anyway).
Using print\_r I found the problem is my query. I thought I ... | [
-0.005750250071287155,
0.03945733979344368,
0.42097988724708557,
0.08046945929527283,
-0.173770472407341,
0.08683544397354126,
0.08183130621910095,
-0.24278227984905243,
-0.1586976945400238,
-0.5087003707885742,
-0.02314150705933571,
0.33283212780952454,
-0.46351754665374756,
0.24877013266... | |
have thought it was working before on my larger database of products but perhaps it actually wasn't returning all of the products but because there were so many I thought they were.
The full script is pretty long but I created a new script below just to see if the query is even grabbing all of the records... it's not.... | [
0.3408506214618683,
0.1428181231021881,
0.37808719277381897,
0.035056620836257935,
-0.14590993523597717,
-0.05869141221046448,
0.04519841820001602,
0.08885211497545242,
-0.4239962100982666,
-0.2386292964220047,
0.010766380466520786,
0.30668675899505615,
0.01266839075833559,
0.3526155650615... | |
if I remove the Where clause altogether, only the 7 products are grabbed.
I also ran the query directly within the database and got the same thing:
```
Showing rows 0 - 6 ( 7 total, Query took 0.0029 sec)
SELECT isc_products.productid, isc_products.prodcode, isc_products.prodname, isc_products.produrl, isc_products.... | [
-0.1606215536594391,
0.07241351902484894,
0.757515013217926,
-0.1995290219783783,
-0.04585709795355797,
0.4007289409637451,
0.06207466498017311,
-0.3562043309211731,
-0.18853697180747986,
-0.4876449704170227,
-0.2832445204257965,
0.3485657572746277,
-0.06074361503124237,
0.4517937004566192... | |
"mypassword") or die(mysql_error());
mysql_select_db("mydatabase") or die(mysql_error());
$result = mysql_query("SELECT isc_products.productid,
isc_products.prodcode,
isc_products.prodname,
isc_products.produrl,
isc_products.prodcalculatedprice,
isc_products.proddesc,
isc_products.prodcurrentinv,
isc_products.upc,
is... | [
-0.12342743575572968,
0.13499145209789276,
0.6449018716812134,
-0.07450887560844421,
0.02417229302227497,
0.18097858130931854,
0.4782327115535736,
-0.6201218366622925,
-0.12869498133659363,
-0.7291259765625,
-0.20471499860286713,
0.42020201683044434,
-0.03710578382015228,
0.330647885799407... | |
about it. :) One day, my friend... one day I will. hahahaha
Thank you!
Try replacing the inner join with LEFT JOIN, then look at the results. Do you see the 28 you expect? If so (or you see more), the join is incorrect in some way. | [
0.5069077610969543,
0.1630229651927948,
0.2585788369178772,
0.00690979091450572,
0.13885338604450226,
0.004363075830042362,
0.34078240394592285,
0.02800741419196129,
-0.038212988525629044,
-0.6661586761474609,
0.1817072182893753,
0.4092831015586853,
-0.027102913707494736,
-0.09620330482721... | |
I have an asp.net application containing pages that lie in multiple folder. I have my .js files also in one "JS" folder and I have added their reference in head of master page like:
```
<script type="text/javascript" src="JS/jquery.min.js"></script>
```
Now when I am on home page, the script loads fine. But when ... | [
0.33125871419906616,
0.18253785371780396,
0.4592186212539673,
0.04527442529797554,
-0.2812848389148712,
-0.10335055738687515,
0.3192148804664612,
-0.28608378767967224,
-0.43590113520622253,
-1.0493239164352417,
-0.007102873641997576,
0.36441901326179504,
0.01757836528122425,
0.088581003248... | |
also.
Now I want to give paths with respect to root path something like:
```
~/JS/VerticalMenu.js
```
But this `~` is not taking me to the root of my application. Do I need to set where `~` should lead to? And if yes then where and how??
Try this:
```
<script type="text/javascript"
src="<%=Page.ResolveUrl("~... | [
-0.20892898738384247,
-0.016293298453092575,
0.6645832061767578,
-0.004193976055830717,
0.1582314372062683,
-0.17968837916851044,
0.315360426902771,
-0.13861195743083954,
-0.17240531742572784,
-0.8196991682052612,
-0.07955892384052277,
0.30304962396621704,
-0.12244601547718048,
-0.06301094... | |
I'm using Selenium for work and I have extract some data from "//ul", unfortunately this data contains a newline, I tried to use chomp() function to remove this (because I need to write in a CSV's file) but it's not working, the portion of code is:
```
open (INFO, '>>file.csv') or die "$!";
print INFO ("codice\;desc... | [
0.3915744125843048,
0.18027377128601074,
0.4372112452983856,
-0.15482540428638458,
0.24868331849575043,
-0.04301147162914276,
0.3711037337779999,
-0.1120317131280899,
-0.2016633301973343,
-1.032673954963684,
-0.12166105210781097,
0.18771708011627197,
-0.3348642587661743,
0.4142149686813354... | |
browser => "*chrome",
browser_url => "http://www.example.com/page.htm" );
$sel->open_ok("/page.htm");
$sel->click_ok("//table[2]/tbody/tr/td/a/img");
$sel->wait_for_page_to_load_ok("30000");
my $descrizione = $sel->get_text("//ul");
my $prezzo = $sel->get_text("//p/font");
my $codic... | [
-0.2252575159072876,
0.13618476688861847,
0.9707053303718567,
-0.3964173495769501,
-0.02695736102759838,
0.30469727516174316,
0.3181574046611786,
-0.27959296107292175,
-0.19804005324840546,
-0.7463106513023376,
-0.8710656762123108,
0.6484107971191406,
-0.3472074270248413,
-0.03468361124396... | |
is:
```
Art. S500 Set Yoga "Siddhartha";Idea regalo ?SET YOGA Siddhartha? Elegante scatola in cartone lucido contenente:
2 mattoni in legno naturale mis. cm 20 x 12,5 x 7
1 cinghia in cotone mis. cm 4 x 235
1 stuoia in cotone mis. cm 70 x 170
1 manuale di introduzione allo yoga stampato
Tutto rigorosa... | [
0.19327661395072937,
-0.1980602741241455,
0.504172146320343,
0.2424270361661911,
0.029502538964152336,
0.5619306564331055,
-0.008933493867516518,
-0.5773885846138,
-0.3310885727405548,
-0.25760942697525024,
-0.11725656688213348,
0.11404084414243698,
0.11670233309268951,
-0.1342414319515228... | |
you probably want to replace any sequence of possible line endings with something else, let's say a single space character. In that case, you'd do:
```
$descrizione =~ s/[\r\n]+/ /g;
``` | [
-0.15924601256847382,
-0.14423099160194397,
0.02636297605931759,
0.07119479775428772,
0.005766886752098799,
0.317499577999115,
0.258768767118454,
0.23189124464988708,
0.0012027053162455559,
-0.6912449598312378,
-0.654985785484314,
0.3526785373687744,
-0.2775031626224518,
0.1194086521863937... | |
I'm having problems wrapping text within my container. I've already searched and all answers were to put in `word-wrap: break-word;` but it doesn't work for me. I'm must be doing *something* wrong but I'm having trouble finding what.
Here is the website so you may search through the source code: <http://www.simplistic... | [
0.2308858186006546,
0.04019360616803169,
0.47474348545074463,
0.004915514029562473,
0.12026188522577286,
0.11978992819786072,
0.2294352650642395,
0.14089663326740265,
-0.37193119525909424,
-0.7014939785003662,
0.03122197650372982,
0.38688889145851135,
-0.06858760863542557,
-0.0834963917732... | |
as above. You could do something like.
```
#container p {
width:65%;
}
```
This way only the p tags inside that specified container are affected.
By default a p tag will stretch 100% of its container.Also keep in mind that word-break and Word Wrap are CSS3 properties and only work on certain browsers by default. <h... | [
0.025446154177188873,
-0.2750568091869354,
0.46061891317367554,
-0.11100276559591293,
0.10286995023488998,
-0.14538535475730896,
0.40405410528182983,
-0.22551491856575012,
-0.6671164035797119,
-0.6387414932250977,
-0.4076509475708008,
0.3125796318054199,
0.05724046751856804,
-0.10772632062... | |
Is there any corresponding method for 3D array allocation and copy like **`cudaMallocPitch()`** and **`cudaMemcpy2D()`**?
Thanks!
```
cudaMalloc3D()
cudaMalloc3DArray()
cudaMemcpy3D()
``` | [
-0.16173230111598969,
0.17117758095264435,
0.42582905292510986,
0.19897346198558807,
-0.21571844816207886,
-0.2104414999485016,
0.12001356482505798,
0.005854928400367498,
-0.24924059212207794,
-0.6606874465942383,
-0.25121375918388367,
0.6788321137428284,
-0.1287114918231964,
0.01696582324... | |
I need the ability to download our application at specific tags, but I am unable to find a working solution for this. Downloading tarballs based on git tag seems promising but I am unable to get it working using Curl. I have tried the following but all I get back is the source for the github 404 page.
```
curl -sL htt... | [
0.22981694340705872,
-0.02604588493704796,
0.464872807264328,
0.03849470242857933,
-0.18895834684371948,
0.08434604853391647,
0.331169068813324,
-0.05973878502845764,
-0.2947057783603668,
-0.40507060289382935,
-0.3415450155735016,
0.761246383190155,
-0.3365817964076996,
-0.1208362653851509... | |
equivalent to `svn export` or github workaround](https://stackoverflow.com/a/9329607/6309)", also explained in great details in:
"[**A curl tutorial using GitHub's API**](https://gist.github.com/2288960)".
---
The [OP Steven Jp](https://stackoverflow.com/users/1317806/steven-jp) reports having made the `curl` comm... | [
-0.06959442794322968,
-0.013619971461594105,
0.5550277829170227,
-0.2945065200328827,
-0.36446982622146606,
-0.15985822677612305,
0.25962817668914795,
-0.38296377658843994,
-0.14450505375862122,
-0.2649610638618469,
-0.40213707089424133,
0.5793868899345398,
-0.3581666648387909,
-0.13105747... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.