text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
polynomial. If you don't want to search for that yourself, it's pretty easy to find tables of known ones for almost any reasonable size (e.g., doing a quick look, the wikipedia article lists them for size up to 19 bits).
If memory serves, there's at least one irreducible polynomial of ever possible bit size. That tran... | [
-0.01695229299366474,
-0.01933901011943817,
-0.03921080008149147,
-0.038533832877874374,
-0.24336838722229004,
-0.07783779501914978,
0.12709881365299225,
-0.38621875643730164,
-0.23557132482528687,
-0.41719213128089905,
-0.15980984270572662,
0.42754802107810974,
-0.33432692289352417,
0.084... | |
still maintain quite acceptable speed. | [
0.26305466890335083,
0.01643258146941662,
0.47204452753067017,
0.271400511264801,
0.028213579207658768,
-0.2387002855539322,
0.6759998202323914,
0.06502468138933182,
-0.08045528829097748,
-0.46415916085243225,
0.3875060975551605,
0.3061178922653198,
0.28317344188690186,
-0.2193381190299987... | |
I have a button that is accessed by a keyboard shortcut but the users have to press `ALT`+`Z`. Is there anyway to let the users access the button by simply pressing `Z` (or some other key) without having to press `ALT`?
Many thanks,
```
<input style="display:none;" id='stopButton1' type="button" value="Z" onclick="st... | [
0.04111608490347862,
0.09063597768545151,
0.615606963634491,
-0.013605243526399136,
-0.04644523933529854,
-0.061017956584692,
0.23448093235492706,
-0.17867693305015564,
-0.02604003995656967,
-0.702648937702179,
-0.07960222661495209,
0.4496598541736603,
-0.13439251482486725,
0.0575762391090... | |
I have 2 models - **User** and **Teacher**. **Teacher** belongs\_to **User**, **User** has **Teacher**.
So, i use Factory girl gem:
```
Factory.define :user do |user|
user.user_login "Another User"
user.user_role "admin"
user.password "foobar"
end
Factory.sequence :user_login do |n|
"person-#{n}"
end
Factor... | [
0.07087980210781097,
-0.19040611386299133,
0.03531058505177498,
-0.2530386745929718,
-0.059678442776203156,
0.6456773281097412,
0.14251238107681274,
-0.2257295548915863,
-0.24118109047412872,
-0.7024168968200684,
0.13223548233509064,
0.5703542828559875,
0.19954217970371246,
0.3786030709743... | |
end
```
I met problem and i don't understand how to solve that. When i create user via factory i can easily write:
```
@user = Factory( :user, :user_login => Factory.next(:user_login) )
```
And this creates user with inique login.
How can i do same thing for teacher? I tried that:
```
@teacher = Factory( :teac... | [
-0.19257386028766632,
0.35257261991500854,
0.46837717294692993,
0.098568856716156,
0.03796405345201492,
0.16761547327041626,
0.5599547624588013,
-0.144619420170784,
-0.17381079494953156,
-0.5942267179489136,
-0.02341577224433422,
0.41321852803230286,
-0.37120896577835083,
0.453086048364639... | |
:user => Factory(:user, :user_login => Factory.next(:user_login)) )
``` | [
0.021602341905236244,
0.05562201514840126,
0.17293278872966766,
-0.39634475111961365,
0.26616325974464417,
0.1811535358428955,
0.17137333750724792,
-0.014896837994456291,
-0.4060524106025696,
-0.8049387335777283,
-0.29365217685699463,
0.34825605154037476,
-0.3995349705219269,
0.27350103855... | |
I have following classes: **Container**, **Element** and then couple of classes that **inherit** from Element, eg. **Button, Input**, etc ...
I have a problem when adding the elements to Container array, my main() looks like this:
```
Container c;
c.Add( Button(...) );
c.Add( Input(...) );
```
where "..." are some ... | [
-0.004656510427594185,
0.15830130875110626,
0.24367661774158478,
-0.21734268963336945,
0.10622315108776093,
0.004671051632612944,
-0.10559757798910141,
-0.24015650153160095,
-0.1724718064069748,
-0.6284204721450806,
0.12587079405784607,
0.5487002730369568,
-0.442982941865921,
0.32591319084... | |
elements[elemCnt++] = &newElement;
}
```
(the elements array is allocated: elements = new Element \* [100];)
However I am getting this compilation error:
```
main.cpp: In member function ‘Container& Container::Add(const Element&)’:
main.cpp:138:23: error: invalid conversion from ‘const Element*’ to ‘E... | [
-0.2563031315803528,
0.24983766674995422,
0.26117634773254395,
-0.1131458431482315,
0.33796313405036926,
0.045486930757761,
0.22334639728069305,
-0.47152775526046753,
-0.15256783366203308,
-0.47452807426452637,
-0.021185854449868202,
0.3897852301597595,
-0.3824378550052643,
0.2111038118600... | |
best approach on this?
PS: The main method must look the same, also don't suggest any vector or STL stuff.
`Add` should take a pointer:
```
void Add(CControl * newElement){
elements[elemCnt++] = newElement;
}
```
then you can call it like this
```
c.Add( new Button(...) )... | [
0.26091209053993225,
-0.11973647773265839,
0.5090957880020142,
-0.14653292298316956,
0.28143244981765747,
0.0015070806257426739,
-0.034549467265605927,
-0.2563023865222931,
-0.2826327979564667,
-0.819389283657074,
-0.17797629535198212,
0.5667698383331299,
-0.4949539601802826,
0.01534384023... | |
the temporary.
E.g. by implementing a virtual `Clone` method in `CControl`, `Input`, `Button` an call it in `Add`.
```
void Add(const CControl & newElement){
elements[elemCnt++] = newElement.Clone();
}
``` | [
0.20081637799739838,
-0.09667041897773743,
0.5078319311141968,
-0.13756510615348816,
0.6243448853492737,
-0.0005522870342247188,
-0.3372672498226166,
-0.05583213269710541,
-0.18074576556682587,
-0.4087241291999817,
-0.35801830887794495,
0.35193753242492676,
-0.32596972584724426,
0.50908720... | |
I have a fairly large dataset and a query that requires two joins, so efficiency of the query is very important to me. I need to retrieve 3 random rows from the database that meet a condition based on the result of a join. [Most obvious solution](https://stackoverflow.com/questions/4586858/mysql-how-to-retrieve-a-rando... | [
-0.18382889032363892,
0.14255379140377045,
0.43272167444229126,
-0.001964596565812826,
0.036548130214214325,
-0.06107788905501366,
0.0035030730068683624,
-0.5124610662460327,
-0.22267010807991028,
-0.4393668472766876,
0.0860428586602211,
0.328509658575058,
-0.05816275253891945,
0.261898726... | |
the author there (`SELECT * FROM table WHERE num_value >= RAND() * (SELECT MAX(num_value) FROM table) LIMIT 1` where num\_value is ID) doesn't work for me because some IDs might be missing (because some rows may have been been deleted by users).
So, what would be the most efficient way to retrieve 3 random rows in my ... | [
0.01435759011656046,
0.08337335288524628,
0.10806047916412354,
0.10087814927101135,
-0.048220254480838776,
0.12144865840673447,
0.24499393999576569,
-0.4053148329257965,
-0.011830133385956287,
-0.5162047147750854,
0.22269003093242645,
0.5555939078330994,
-0.25994977355003357,
-0.1600315570... | |
pointed out, your best bet may be something along these lines (utilizing PHP):
```
$result = PDO:query('SELECT MAX(id) FROM table');
$max = $result->fetchColumn();
$ids = array();
$rows = 5;
for ($i = 0; $i < $rows; $i++) {
$ids[] = rand(1, $max);
}
$ids = implode(', ', $ids);
$query = PDO::prepare... | [
0.14119675755500793,
-0.04039999097585678,
0.3839038610458374,
0.009994227439165115,
-0.04128077253699303,
0.1563979834318161,
-0.11063958704471588,
-0.5300025939941406,
-0.22625894844532013,
-0.4879729151725769,
0.147024467587471,
0.6131389737129211,
-0.0031490379478782415,
-0.15835176408... | |
the $rows var or add some logic to do another query in case you didn't receive at least 3 results back. | [
0.03614036738872528,
-0.1069658175110817,
0.3643771708011627,
0.13341443240642548,
-0.25073152780532837,
0.06399519741535187,
0.22903425991535187,
-0.16105800867080688,
-0.08576380461454391,
-0.36807385087013245,
-0.04482732340693474,
0.4556594491004944,
-0.3806735575199127,
-0.02194578386... | |
I'm trying to set up a simple application for running multiple blogs and my app/views/layouts/application.html.haml file looks like this:
```
!!!
%html
%head
%title Brimble's Blogs
= stylesheet_link_tag "application", :media => "all"
= javascript_include_tag "application"
= csrf_meta_tags
%body... | [
0.4058898687362671,
0.17675644159317017,
0.8484144806861877,
-0.16273942589759827,
-0.16019774973392487,
-0.20569533109664917,
0.02067948505282402,
-0.28007662296295166,
-0.2820225656032562,
-0.6648454666137695,
0.04532191902399063,
0.35173624753952026,
-0.11258408427238464,
0.039878722280... | |
link_to('Login', new_user_session_path)
= link_to('Register', new_user_registration_path)
= end
= yield
```
The error I get is:
```
compile error
<myapp>/app/views/layouts/application.html.haml:18: syntax error, unexpected kELSE
<myapp>/app/views/layouts/application.html.haml:22: syntax error, unexpected ... | [
-0.4287351965904236,
0.3112185299396515,
0.5587812066078186,
-0.17539653182029724,
-0.018085114657878876,
0.3454841375350952,
0.42167240381240845,
-0.6289398670196533,
-0.2613930106163025,
-0.4518522620201111,
-0.32074007391929626,
0.6941949725151062,
-0.5218396186828613,
0.097395844757556... | |
= link_to('Login', new_user_session_path)
19: = link_to('Register', new_user_registration_path)
20: = end
21:
```
I'm following a tutorial on this page:
<http://www.logansbailey.com/2011/02/27/adding-authorization-using-devise/>
The tutorial uses erb but I really like the idea of Haml so I want to give it ... | [
0.0657159760594368,
0.18378178775310516,
0.5312389135360718,
-0.19420301914215088,
-0.025775015354156494,
-0.5306267738342285,
0.44726043939590454,
-0.41420796513557434,
-0.2610999047756195,
-0.5580451488494873,
-0.2964455187320709,
0.5721629858016968,
-0.28097501397132874,
0.0810026079416... | |
new_user_session_path)
=link_to('Register', new_user_registration_path)
```
the `end` tag can be omitted in haml. | [
-0.07870162278413773,
0.1328023225069046,
0.3204587996006012,
-0.4967174232006073,
0.15012942254543304,
-0.527042031288147,
0.21830227971076965,
-0.06518544256687164,
-0.0376749113202095,
-0.2876269519329071,
-0.4780786335468292,
0.4005093276500702,
-0.14513078331947327,
0.2557673752307892... | |
I'm making a survey site with django. I am pretty newbie with django so I apologize in advance if I can not explain well. My question focuses on the following models:
```
class SurveyType(models.Model):
name = models.CharField(max_length=200)
def __unicode__(self):
return self.name
class Questio... | [
0.12198535352945328,
0.22644750773906708,
0.49273577332496643,
-0.2575148046016693,
-0.2797567546367645,
0.13673259317874908,
0.045846126973629,
-0.32291677594184875,
-0.0004611286276485771,
-0.6885366439819336,
0.13235557079315186,
0.3698607087135315,
-0.1407390832901001,
-0.1060056090354... | |
surveytype = models.ForeignKey(SurveyType)
answertype = models.CharField(max_length=1, choices=ANSWERTYPE_CHOICES)
order = models.IntegerField(default=0)
def __unicode__(self):
return self.question
class Survey(models.Model):
course = models.ForeignKey(Course)
surveytype = mode... | [
-0.3188064694404602,
0.018893646076321602,
0.26238179206848145,
-0.24650470912456512,
-0.21595312654972076,
0.5547816157341003,
0.042447593063116074,
-0.6219667196273804,
-0.23435840010643005,
-0.692420244216919,
-0.22513189911842346,
0.22407492995262146,
-0.06640107184648514,
-0.099452428... | |
return self.answer
```
Django receives survey id. With the survey id it gets the surveytype and shows questions that must be displayed.
```
def survey(request, survey_id):
survey_data = get_object_or_404(Survey, pk=survey_id)
survey_type = survey_data.surveytype
questions = Question.objects.all().filter(... | [
-0.09701398760080338,
0.4270907938480377,
0.4914051294326782,
-0.28334832191467285,
-0.546989381313324,
-0.050816264003515244,
0.20645201206207275,
-0.413131445646286,
0.12991298735141754,
-0.6599206924438477,
0.0880400612950325,
0.7392032146453857,
-0.21084237098693848,
-0.358581513166427... | |
modelforms and a foor loop.
Models.py
```
class Question(models.Model):
question = models.CharField(max_length=200)
surveytype = models.ForeignKey(SurveyType)
answertype = models.ForeignKey(ContentType,
limit_choices_to = Q(name='text answer', app_label='surveys')| \
Q(name='media answer', app_la... | [
-0.30510908365249634,
-0.10417407751083374,
0.47880879044532776,
-0.027269134297966957,
-0.046354152262210846,
0.23853251338005066,
-0.1125565692782402,
-0.49332505464553833,
-0.08175262063741684,
-0.7217803597450256,
-0.04934656247496605,
0.586043655872345,
-0.1694057583808899,
0.30048167... | |
__unicode__(self):
return u'%s'%(self.answer)
```
Forms.py
```
class RangeAnswerForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(RangeAnswerForm, self).__init__(*args, **kwargs)
self.fields['answer'].label = "Mi valoración"
class Meta:
model = RangeAnswer
... | [
-0.08819779008626938,
-0.06970389932394028,
0.8317939043045044,
0.01065609697252512,
-0.033825356513261795,
0.05392823368310928,
0.3361177146434784,
-0.5717300772666931,
0.06517067551612854,
-0.6786250472068787,
-0.3645978271961212,
0.982509195804596,
-0.13526226580142975,
0.10605889558792... | |
super(MediaAnswerForm, self).__init__(*args, **kwargs)
self.fields['answer'].label = "Medio"
class Meta:
model = MediaAnswer
MediaAnswer.form= MediaAnswerForm
class TextAnswerForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(TextAnswerForm, self).__init__(*args, **kw... | [
-0.3765532374382019,
-0.33053842186927795,
0.7467937469482422,
-0.05909854546189308,
-0.34061163663864136,
0.33935752511024475,
0.21104136109352112,
-0.36293330788612366,
-0.3878464102745056,
-0.7135550379753113,
-0.39559587836265564,
0.5148376226425171,
-0.35982656478881836,
0.32697176933... | |
I'm trying to add a 3rd tab to the tabBarController using ios5. The standard object you get when you drag it out to your storyboard has 2 tabs. Does anyone know how to do this? I searched the internet and all examples start with their tabBarController with the extra tabs without showing how to get it.
for third tab fir... | [
0.11983731389045715,
-0.18636934459209442,
0.7692467570304871,
0.21393977105617523,
-0.18513281643390656,
0.14142835140228271,
0.25387346744537354,
0.03164739906787872,
-0.3335191011428833,
-0.67784583568573,
0.03236168250441551,
0.6915907263755798,
-0.08352409303188324,
-0.014561964198946... | |
This is a newbie question from a Windows guy but when I work with Git or other software relying on (Open)SSH, should I generate a new SSH key for every workstation and then upload the public key to GitHub / BitBucket etc. or should I be reusing some previously generated one? Or does it matter at all?
You should generat... | [
0.5360632538795471,
0.15018323063850403,
0.14687420427799225,
0.39199841022491455,
0.1348973661661148,
-0.422749787569046,
0.22573168575763702,
-0.12338047474622726,
-0.2927404046058655,
-0.5340007543563843,
-0.2453346997499466,
0.5438116788864136,
-0.28372353315353394,
0.24604059755802155... | |
I'm trying to create a cube using SQL Server 2008 R2. When I tried to **process** a dimension, this error occurred:
> The project could not be deployed to the 'wasim-PC/Joker' server
> because of the following connectivity problems : A connection cannot
> be made. Ensure that the server is running. To verify or upda... | [
0.14485208690166473,
0.1339128017425537,
0.4423002600669861,
0.03001660853624344,
-0.22114011645317078,
0.15013650059700012,
0.27364009618759155,
-0.1864185333251953,
-0.3134806156158447,
-0.6395955085754395,
0.19357377290725708,
0.3890649676322937,
-0.3451198637485504,
0.19892609119415283... | |
the search bar of google.
anyways, look at this post
[Google image search: How do I construct a reverse image search URL?](https://stackoverflow.com/questions/7584808/google-image-search-how-do-i-construct-a-reverse-image-search-url) | [
0.15564915537834167,
0.27538782358169556,
0.5731120705604553,
-0.040260955691337585,
-0.3306931257247925,
0.2758134603500366,
0.15099714696407318,
0.018438244238495827,
0.07301514595746994,
-0.07101260125637054,
0.158458411693573,
0.5258488059043884,
-0.28589555621147156,
0.176143333315849... | |
I wish to split a long list of email address into lines, such as:
```
test01@testing.com; test02@testing.com; test03#testing1.com; test04@testing2.com,
```
I wish to split them into lines:
```
test01@testing.com (carriage return)
test02@testing.com (carriage return)
test03#testing1.com (carriage return)
test04@test... | [
0.5920973420143127,
0.11412534862756729,
0.2527502179145813,
0.2194794863462448,
-0.4312966763973236,
0.4143366515636444,
0.22570699453353882,
-0.28688594698905945,
0.09640630334615707,
-0.3956345021724701,
0.40338078141212463,
0.17986290156841278,
-0.3101847469806671,
0.10244361311197281,... | |
I want to know whether there is any way to debug (using gdb) both child and parent processes simultaneously. I know the command used to change processes to child one. But that is not the solution I am looking for, as this method only has control of either the child or the parent. I am looking for simultaneous execution... | [
0.12473136931657791,
0.04906473681330681,
-0.07839176058769226,
0.09023138880729675,
0.2651776373386383,
0.3391357660293579,
0.13826799392700195,
-0.23413103818893433,
-0.5071430802345276,
-0.3790273368358612,
0.13925990462303162,
0.20745593309402466,
-0.2867138683795929,
0.536858022212982... | |
necessary. Is there any way to do this, and if so, how might I go about doing it?
> I want to know whether there is any way to debug(using gdb) both child and parent processes simultaneously.
Yes, [there is](http://sourceware.org/gdb/wiki/MultiProcess). Documentation [here](http://sourceware.org/gdb/onlinedocs/gdb/Inf... | [
0.2250373214483261,
0.40126535296440125,
0.16353827714920044,
-0.03728655353188515,
0.32058313488960266,
0.12288442254066467,
-0.028767744079232216,
-0.19625146687030792,
-0.06484534591436386,
-0.6722038984298706,
-0.20339129865169525,
0.5222864747047424,
-0.09886609017848969,
0.2115608751... | |
I have a single image covering the entire background. Do sites that do this usually choose an image size via JavaScript? And if I didn't want to use JavaScript, what's a good minimum size to cover the vast majority of screens? Thanks.
There's no way to tell, an image that would fit nicely on a 10" netbook will not look... | [
0.47092926502227783,
-0.04206958785653114,
0.7114041447639465,
-0.04826284199953079,
-0.13308541476726532,
-0.011700201779603958,
-0.10014382004737854,
0.005467188078910112,
-0.4041990339756012,
-0.670379102230072,
0.028089316561818123,
0.580196738243103,
-0.10139867663383484,
-0.137559503... | |
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
```
Granted, that will only work on modern browsers. [Here](http://vegas.jaysalvat.com/) are a few more techniques to achieve this goal. | [
0.2991922199726105,
-0.06637854874134064,
0.5875593423843384,
0.07568506896495819,
0.2078772336244583,
-0.33973798155784607,
0.18606489896774292,
0.05119222402572632,
-0.22571182250976562,
-0.39800092577934265,
-0.3469732105731964,
0.8675239086151123,
-0.00992143526673317,
-0.1897982805967... | |
I'm running a foreach loop for the whole script that checks 9 things.
Let's say five of them have value "a" and four of them have value "b".
How do I write an IF condition (or something) that only returns "a" and "b" once?
Simple method (check last value)
--------------------------------
Use a variable which stores ... | [
-0.06234421953558922,
-0.034414246678352356,
0.22353994846343994,
-0.27182960510253906,
0.2556213140487671,
0.19103799760341644,
0.4256051182746887,
-0.3000901937484741,
-0.3280726373195648,
-0.4538339078426361,
-0.0691862478852272,
0.5826188325881958,
-0.2687666416168213,
0.24302332103252... | |
// do the thing
}
// Store the current thing for the next loop
$last_thing = $thing;
}
```
More robust method (store used values on an array)
--------------------------------------------------
Or, if you have complex objects, where you need to check an inner property and the like things are not sequential, sto... | [
-0.11604375392198563,
0.07011432200670242,
0.15294653177261353,
0.01274404488503933,
0.07208579778671265,
-0.1547185480594635,
0.4103575348854065,
-0.7293326258659363,
-0.028506694361567497,
-0.44536590576171875,
-0.23470081388950348,
0.7799476385116577,
-0.2894836366176605,
-0.24571500718... | |
$used[] = $thing;
}
}
```
### For example (1):
```
// Like objects are non-sequential
$things = array('a','a','a','b','b');
$last_thing = NULL;
foreach ($things as $thing) {
if ($thing != $last_thing) {
echo $thing . "\n";
}
$last_thing = $thing;
}
// Outputs
a
b
```
### For example (2)
```
$things ... | [
-0.13593921065330505,
-0.030546247959136963,
0.1873183697462082,
-0.4741394817829132,
0.017636572942137718,
0.1819734424352646,
0.45601046085357666,
-0.6007941961288452,
-0.525787889957428,
-0.09883127361536026,
-0.5864089727401733,
0.45913052558898926,
-0.5331417322158813,
0.1258679628372... | |
I have searched google and exhausted a fair bit of my time trying to figure out what is going on with my WCF and client Windows form app.
I am continuously getting the following error
```
"Unable to set field/property Ingredients on entity type Datalayer.UnitOfMeasure. See InnerException for details."
...
inner exc... | [
0.13166926801204681,
0.23046638071537018,
0.5309939384460449,
-0.07227301597595215,
0.2612653076648712,
-0.01868981495499611,
0.30184510350227356,
-0.4699431359767914,
-0.2646375596523285,
-0.4458867609500885,
-0.11427831649780273,
0.35711196064949036,
-0.312793493270874,
0.380306035280227... | |
class library, I have a windows app (test app) which references the WCF services as well as DataLayer project.
If I don't reference the DataLayer in my test app, this issues does not occur however I lose the `ICollection<Ingredient>` to simple `Ingredient[]` array. Now as you can see this becomes a coding pain to ini... | [
0.37962204217910767,
-0.144025981426239,
-0.07230115681886673,
0.46711716055870056,
-0.029512040317058563,
-0.08581994473934174,
0.28196150064468384,
-0.05660150572657585,
-0.055257659405469894,
-0.8830140233039856,
0.19273529946804047,
0.4510281980037689,
-0.0814661905169487,
0.2160929143... | |
is array, you can change it to a generic list.
In case you are using svcutil,that too allows the same thing. | [
0.19716539978981018,
-0.43449950218200684,
0.23029866814613342,
0.05470723286271095,
-0.34868600964546204,
-0.3882167935371399,
-0.011225963942706585,
0.057699259370565414,
-0.5139075517654419,
-0.5496234893798828,
-0.03425036370754242,
0.4010903239250183,
-0.5731408596038818,
0.2122307270... | |
I am using XCode 4.3.2 and trying to open an already existing project based on the Facebook SDK sample Project for XCODE and run it on a target IPhone with IOS 4.2.
Although it runs on the simulator it crashes on the IPhone printing this error on the console:
```
failed to send the qLaunchSuccess packet
```
I reall... | [
0.2819274365901947,
0.4189578890800476,
0.31979307532310486,
0.08281327039003372,
0.2006363719701767,
-0.16551794111728668,
0.5558595657348633,
0.053460493683815,
0.06947865337133408,
-0.6533427238464355,
0.02359713613986969,
0.5999808311462402,
-0.37846043705940247,
0.04738406836986542,
... | |
Be Registered To The BootStrap Server`
If all else fails, restore it from a backup. | [
0.5950881242752075,
0.4017406404018402,
0.07703470438718796,
0.01688888482749462,
0.06434916704893112,
-0.44509172439575195,
0.5802361965179443,
0.3299682140350342,
0.3566334545612335,
-0.5719499588012695,
-0.6324588060379028,
0.4704911708831787,
-0.17904499173164368,
0.14116285741329193,
... | |
I'm having some trouble parsing a JSON that I obtain from my DB to my Java (Android) Application. I hope you can help me out:
This is the Json that I have:
```
<br>
[{<br>
"ID" : "1",<br>
"name" : "Test name",<br>
"type" : "1",<br>
"Desc" : "blablabla",<br>
"minNum" : "0",<br>
"maxNum" : "12",<br>
"Num"... | [
-0.019790396094322205,
0.1137009859085083,
-0.0010011543054133654,
0.0714733749628067,
-0.3556499779224396,
0.16692045331001282,
0.37655287981033325,
-0.1293180137872696,
-0.14378847181797028,
-0.7866741418838501,
-0.11318013072013855,
0.39549732208251953,
0.020804548636078835,
0.085505858... | |
"name" : "Test name",<br>
"type" : "1",<br>
"Desc" : "blablabla",<br>
"minNum" : "0",<br>
"maxNum" : "12",<br>
"Num" : "8",<br>
"bool1" : "0",<br>
"bool2" : "1",<br>
"bool3" : "1",<br>
"date" : "2012-04-01 23:00:00",<br>
"double1" : "39.47208",<br>
"doubl2" : "-0.3556063",<br>
"someText" : "ajay... | [
-0.08313056826591492,
-0.162375345826149,
0.20947317779064178,
-0.014870965853333473,
-0.14299321174621582,
0.0780777558684349,
0.3592175543308258,
-0.07247845828533173,
-0.10649298876523972,
-0.43843168020248413,
-0.3829837739467621,
0.20598278939723969,
0.0702245905995369,
0.410487174987... | |
fails. I've tried to get it as an Object removing '[' ']', as an Array (things I achieved but then this line fails):
```
MyClassList MyClas = new Gson().fromJson(responseString, MyClassList.class);
```
The error is:
```
com.google.gson.JsonSyntaxException:
java.lang.IllegalStateException: Expected BEGIN_OBJECT but... | [
-0.09089342504739761,
0.19895243644714355,
0.4506244957447052,
-0.22421804070472717,
0.26167789101600647,
-0.0036484894808381796,
0.9525055885314941,
-0.03470078855752945,
-0.1441524773836136,
-0.630678117275238,
-0.09803784638643265,
0.6156191229820251,
-0.31251320242881775,
0.09181766957... | |
know why, booleans like "0"|"1" don't work. Like "true"|"false" yes.
The problem is that you are trying to deserialize an array into a class that is not an array, and that won't work for obvious reasons. Since you know the array type just use any instance of MyClass[] to get the class from. You can create one at any ti... | [
0.3273008465766907,
-0.09178222715854645,
0.003494006348773837,
0.1257910132408142,
-0.2334737777709961,
-0.14734046161174774,
0.4455256164073944,
-0.2695434093475342,
-0.2451053410768509,
-0.741969645023346,
-0.12892502546310425,
0.45802703499794006,
-0.6256273984909058,
0.343486785888671... | |
GsonTest {
private static Logger logger = LoggerFactory.getLogger(GsonTest.class);
static ToSerialize t1 = new ToSerialize("1", "Test 1");
static ToSerialize t2 = new ToSerialize("2", "Test 2");
static ToSerialize target[] = {t1,t2} ;
/**
* @param args
*/
public static void main(St... | [
-0.10192844271659851,
-0.18101194500923157,
0.4305739998817444,
-0.17677757143974304,
-0.0938275009393692,
0.44632261991500854,
0.5378550291061401,
-0.5630347728729248,
-0.15897376835346222,
-0.3616993725299835,
-0.41389307379722595,
0.49001431465148926,
-0.6742037534713745,
-0.05519302934... | |
jsonStr = gson.toJson(target);
logger.info(String.format("Target As String\n: %s", jsonStr));
// This will work as well --> ToSerialize test[] = gson.fromJson(jsonStr, target.getClass());
ToSerialize test[] = gson.fromJson(jsonStr, ToSerialize[].class);
for (ToSerialize deserialized: ... | [
0.022143583744764328,
-0.44306495785713196,
0.2514346241950989,
-0.02091565541923046,
0.12185381352901459,
0.14363402128219604,
0.6577457785606384,
-0.3121166229248047,
-0.31612417101860046,
-0.5700828433036804,
-0.3783591687679291,
0.44389808177948,
-0.3446819484233856,
0.0987230762839317... | |
*/
private static final long serialVersionUID = 1L;
private String iD;
private String name;
public ToSerialize() {
// TODO Auto-generated constructor stub
}
public ToSerialize(String iD, String name) {
super();
this.iD = iD;
this.name = name;
}
public ... | [
0.20851898193359375,
-0.5866318345069885,
0.48315364122390747,
-0.22941268980503082,
0.200569286942482,
0.16274963319301605,
0.6879488825798035,
-0.19403508305549622,
-0.07803771644830704,
-0.16124558448791504,
-0.2896452844142914,
0.5630121827125549,
-0.35379061102867126,
0.43247514963150... | |
return iD;
}
public void setiD(String iD) {
this.iD = iD;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public int hashCode() {
final int prime = 31; | [
-0.02140222117304802,
-0.4831966757774353,
0.10213526338338852,
-0.47814980149269104,
0.30626845359802246,
-0.10379796475172043,
0.32400599122047424,
-0.22466149926185608,
0.21050706505775452,
-0.3334941565990448,
-0.4253389835357666,
0.7402701377868652,
-0.5397993922233582,
0.157539159059... | |
int result = 1;
result = prime * result + ((iD == null) ? 0 : iD.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true; | [
-0.3058231770992279,
-0.11350814998149872,
0.4814726412296295,
-0.35662251710891724,
0.12798935174942017,
-0.03319999575614929,
0.5349339842796326,
-0.4042758345603943,
0.15419700741767883,
-0.18718086183071136,
-0.29706403613090515,
0.5424588322639465,
-0.48530313372612,
0.100342757999897... | |
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ToSerialize other = (ToSerialize) obj;
if (iD == null) {
if (other.iD != null)
return false; | [
-0.5318015217781067,
-0.27968648076057434,
-0.00567247997969389,
-0.32834941148757935,
0.3791956901550293,
0.09759993851184845,
0.6912037134170532,
-0.29630377888679504,
-0.15428927540779114,
-0.16646257042884827,
-0.5699476599693298,
0.47712528705596924,
-0.3808170557022095,
-0.0861928984... | |
} else if (!iD.equals(other.iD))
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
return true; | [
-0.32516148686408997,
-0.03399977833032608,
0.18110892176628113,
-0.25416868925094604,
0.28348371386528015,
-0.12971138954162598,
0.25964224338531494,
-0.3372817635536194,
0.11085711419582367,
-0.21468485891819,
-0.23338741064071655,
0.5892044305801392,
-0.343327134847641,
-0.0892319604754... | |
}
@Override
public String toString() {
return "ToSerialize [iD=" + iD + ", name=" + name + "]";
}
}
``` | [
-0.16397562623023987,
-0.08603005111217499,
0.2237873673439026,
-0.27640971541404724,
0.4217480719089508,
-0.3861783444881439,
0.45359471440315247,
-0.2549484074115753,
0.2498452067375183,
-0.18118739128112793,
-0.3279401957988739,
0.8764560222625732,
-0.43608081340789795,
0.24841810762882... | |
I have gone through all of the Android docs about handling multiple screen sizes but I still haven't been able to find an answer to this question or how to handle this.
If there are two phones that have the same dpi level (such as both being hdpi) I can provide one resource for them and set the layout parameters as su... | [
0.26506441831588745,
0.03148970007896423,
0.7852190136909485,
-0.16731663048267365,
-0.18016254901885986,
0.37981486320495605,
0.037398163229227066,
-0.2616040110588074,
-0.24941734969615936,
-1.046075463294983,
0.1925850510597229,
0.789101243019104,
-0.2873987555503845,
-0.262557059526443... | |
devices, however when I tested it out on a LG G2x and a HTC Sensation, the image is smaller on the Sensation. So is Android always just using a factor of 1.5x when calculating the size the hdpi image? Is there something I can do to guarantee the size will be the exact same on all hdpi devices? Thanks.
The answer was th... | [
0.061127543449401855,
-0.09208722412586212,
0.9158116579055786,
0.387321799993515,
-0.152032732963562,
0.06616796553134918,
-0.10041693598031998,
-0.2707516849040985,
-0.2799535393714905,
-0.7718710899353027,
0.3351260721683502,
0.6701027154922485,
-0.24894118309020996,
-0.0705418884754180... | |
those real values. | [
0.2912178635597229,
0.06596037745475769,
-0.1685141921043396,
0.4923820197582245,
-0.012785445898771286,
0.08456025272607803,
-0.0654919296503067,
-0.025761879980564117,
-0.1209142804145813,
-0.11639470607042313,
0.15770842134952545,
0.6910457015037537,
-0.0035739410668611526,
-0.018592994... | |
I have a working query that counts all distinct values from table LDS where STATUS = 'OK' AND DATE >= '2012' AND if there are multiple identical IDs then count the one with the newest date if this id has a status of "ok":
```
COUNT(DISTINCT lds1.ID)
FROM
LDS lds1
LEFT JOIN LDS lds2
ON lds1.ID = lds2.... | [
0.29636338353157043,
0.5062717199325562,
0.3986417353153229,
-0.04103406146168709,
-0.2353469878435135,
-0.006407144945114851,
0.0246981643140316,
-0.346395879983902,
-0.3327174782752991,
-0.2019030749797821,
0.19492387771606445,
0.13663162291049957,
0.08254040032625198,
0.4757212102413177... | |
AND lds1.Status = 'ok'
AND lds2.ID IS NUL
```
I now need to add another condition to be TRUE before the above query is run: "only consider IDs where STATUS=NULL AND DATE>= 2011". The initial ID instance with STATUS = NULL is not to be counted in the results; it just determines if an ID should even be considered.... | [
0.1160329207777977,
0.5201365351676941,
0.2129969596862793,
-0.11957883089780807,
-0.028740083798766136,
-0.05694575607776642,
0.24562063813209534,
-0.36622703075408936,
-0.052908334881067276,
-0.2207360863685608,
-0.12749065458774567,
0.27218443155288696,
-0.1811240017414093,
0.2616050243... | |
| 2013
3 | NULL | 1999
3 | ok | 2012
4 | ok | 2012
5 | NULL | 2011
5 | ok | 2012
6 | NULL | 2012
```
The expected result of the full query is ID "5".
UPDATE:
Maybe this can be solved with arrays?
1. take all IDs from table LDS where STATUS=NULL AND DATE>=2011 and put into array (... | [
-0.1890452653169632,
0.11778004467487335,
0.5226202011108398,
-0.056085675954818726,
-0.26858919858932495,
0.10665437579154968,
0.388706773519516,
-0.645741879940033,
-0.1935347467660904,
-0.22905604541301727,
-0.09603099524974823,
0.09875885397195816,
-0.09793289750814438,
0.3003546297550... | |
For each ID in the array, check all instances in the table and select the one with the largest date AND STATUS IS NOT NULL (result: ID1, ID5)
3. Count how many of these have a STATUS=OK (result: ID5)
That is a nice explanation of Krager's Min-Cut Algorithm for undirected graphs.
I think there might one detail you m... | [
-0.06925561279058456,
-0.12640830874443054,
0.22035780549049377,
-0.17959757149219513,
-0.5852168202400208,
-0.004859760869294405,
0.42240390181541443,
-0.21164801716804504,
-0.5556097030639648,
-0.6463345885276794,
-0.11508337408304214,
-0.11000341922044754,
-0.4648299813270569,
0.3530096... | |
self-loop. And they are generated frequently in process of contracting two vertices. As a first step, you can simply check the whole graph for self-loops, though there are some more sophisticated approaches.
Does that make sense? | [
0.018408754840493202,
-0.08334125578403473,
0.038810599595308304,
0.17189088463783264,
-0.30870386958122253,
-0.10143828392028809,
0.19973614811897278,
-0.000909075082745403,
-0.3676498830318451,
-0.6065283417701721,
0.14931565523147583,
0.14309625327587128,
-0.67169189453125,
0.0029779954... | |
I have this:
```
<div ><a href='#' id='my_target'>Link</a></div>
<div></div>
<div><div></div></div>
<div><div id='my_div'></div></div>
```
How can I select `#my_target`, when the event is triggered from `my_div`?
I tried things such as `prev().prev().prev().children()`, but I can't get it to work, and I want someth... | [
0.27497920393943787,
-0.16040854156017303,
0.4293725788593292,
-0.031216291710734367,
-0.11606630682945251,
0.23233133554458618,
0.07095906883478165,
-0.31376370787620544,
0.07875766605138779,
-0.8255943655967712,
-0.14713039994239807,
0.3824990689754486,
-0.2273099571466446,
0.25089108943... | |
I am an inexperienced Java developer trying to wrap my head around some fundamental middleware/SOA concepts and technologies, specifically:
* Service-Oriented Architecture (SOA)
* Message-Oriented Middleware (MOM)
* Message Queue
* Apache Camel
* Mule
* EJBs
* Endpoints & Routes
* Service Bus/ESB
* JMS
After looking ... | [
0.38393139839172363,
0.2145249992609024,
-0.09450526535511017,
-0.049701884388923645,
-0.0271914005279541,
-0.07874656468629837,
0.26413169503211975,
0.05986393988132477,
-0.19405211508274078,
-0.744543194770813,
-0.13514941930770874,
0.23725396394729614,
0.013388500548899174,
0.0186924021... | |
each of them play in the overall solution? Once I see a working example I'm sure it will help me connect most of the dots.
**Edit**: Since I added the bounty, I've had several answers that suggest reading books. Although I appreciate all feedback here, I simply can't part ways with 300 reputation points for an answer ... | [
0.6551612615585327,
0.34098541736602783,
0.22295449674129486,
0.23871831595897675,
-0.15774796903133392,
0.23153680562973022,
0.381247878074646,
-0.4555934965610504,
-0.42012038826942444,
-0.4691753685474396,
0.2267790138721466,
1.0078654289245605,
0.12155519425868988,
-0.29175618290901184... | |
be a middleware compendium!!!** Just a paragraph or two that shows how all these can be used together in harmony to produce a Java business-tier solution. Thanks again.
SOA main principles: Build systems as set of services where each service is
* Coarse-grained
* Interoperable
* Loosely coupled
A company offers a lot... | [
0.4247564375400543,
0.20192517340183258,
-0.09362442046403885,
0.05009309574961662,
0.04193875193595886,
-0.1963125467300415,
0.3688409626483917,
-0.13926881551742554,
-0.07717842608690262,
-0.7884182929992676,
-0.2270633727312088,
0.38395655155181885,
-0.07859345525503159,
-0.148190498352... | |
heterogeneous platforms, using different technologies etc.
What if you want to integrate these disparate features thus creating new solutions (For e.g. Amazon store front is a new service composed of their catalog service, shopping cart service etc)?
You have two choices:
1. Building the new feature from scratch ke... | [
0.2109525501728058,
-0.2957586944103241,
-0.0718841627240181,
0.39851412177085876,
-0.1546565443277359,
0.07400935888290405,
0.24202115833759308,
-0.22404029965400696,
-0.14730331301689148,
-0.9061800837516785,
-0.28117597103118896,
0.3584129512310028,
-0.22351542115211487,
0.0825789123773... | |
ESB's. Endpoints & Routes are the terminology used in EIP ([Enterprise Integration Patterns](http://www.enterpriseintegrationpatterns.com/toc.html)) that these ESB's implement. ESB's can take help of **MOM's** ([Message-Oriented-Middleware](https://docs.oracle.com/cd/E19316-01/820-6424/aeraq/index.html)) when they want... | [
0.029191160574555397,
-0.09244448691606522,
0.4025346040725708,
0.036383774131536484,
0.0673159584403038,
-0.16892492771148682,
0.025571180507540703,
0.003964934032410383,
-0.42820706963539124,
-0.8552921414375305,
-0.43105486035346985,
-0.08236581832170486,
-0.15718188881874084,
0.2231971... | |
MOM vendors like IBM (WebSphere MQ), open-source ActiveMQ etc. We can use **[JMS](https://en.wikipedia.org/wiki/Java_Message_Service)** to keep your code independent of the vendor.
I tried to relate all the concepts with an example. I also tried to keep it short. Please
ask follow up questions to gain more understand... | [
0.6299290657043457,
-0.06314227730035782,
0.1585780829191208,
0.1151478961110115,
0.08517498522996902,
-0.46343275904655457,
-0.04930447041988373,
0.08867307752370834,
-0.37949633598327637,
-0.6764084100723267,
0.042917829006910324,
0.31098365783691406,
-0.1483594924211502,
0.2331716567277... | |
I want to simulate our whole checkout process under load. This essentially involves running a number of POSTs in sequence, where the client is storing a unique cookie for each sequence that allows the session to be preserved. Can anyone recommend a software or service that meets these conditions?
This sort of thing cou... | [
0.6562838554382324,
-0.09513433277606964,
0.21175925433635712,
0.3971325159072876,
-0.07728523015975952,
-0.13562412559986115,
0.3331490457057953,
-0.08423877507448196,
-0.11319246143102646,
-0.7258941531181335,
0.5107895135879517,
0.3152569830417633,
-0.13280683755874634,
0.01839993707835... | |
can use a [Regular Expression Extractor](http://jmeter.apache.org/usermanual/component_reference.html#Regular_Expression_Extractor). | [
0.053496796637773514,
-0.5422596335411072,
0.47632282972335815,
0.4648606479167938,
0.08358337730169296,
-0.3174138367176056,
0.42114827036857605,
0.007235280238091946,
0.028039714321494102,
-0.13393297791481018,
-0.3636804521083832,
0.7236500978469849,
-0.17545905709266663,
-0.31081500649... | |
I want to extract the text from the table <http://www.amiriconstruction.co.uk/goodwoodgolf/scoretable.htm> into a textile in plain text without html tags from the Mac OS X command line.
I tried a lot of sed commands, but sed will only print the whole file again. What am I doing wrong?
Example of what I tried
`sed -n... | [
-0.056441955268383026,
-0.0433596596121788,
0.494751900434494,
-0.0794001966714859,
-0.18500378727912903,
0.10716534405946732,
0.38931742310523987,
-0.7009178400039673,
-0.1790478378534317,
-0.5426772832870483,
-0.1574653685092926,
0.3265262246131897,
-0.21106396615505219,
0.02403347939252... | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@(skip)
<div class="scoreTableArea">
@(collect)
<h2 class="unify">@year - @event</h2>
@ (filter brsp event)
@ (collect)
<tr>
<td class="center">@pos</td>
<td>@player</td>
<td>@company</td>
<td>@date</td>
<td class="center">@points</td>
</tr>
@ (filter nobr p... | [
-0.20428292453289032,
-0.7010760307312012,
0.723263680934906,
-0.2286347597837448,
-0.1897130310535431,
-0.2796177268028259,
-0.10909943282604218,
-0.5977817177772522,
-0.3741139769554138,
-0.5170355439186096,
-0.19101940095424652,
0.2318582683801651,
-0.17902061343193054,
0.32706558704376... | |
COMPANY
Sept 2011 1 40 John Durrant King Sumners Partnership
Sept 2011 2 34 Grahame Pettit Amiri Construction
Oct 2011 3 31 Tony Deacon Gleeds
Oct 2011 4 29 Tony Boyle Lacey Hickey Caley
Oct 2011 5 29 Richard Hemming Scott White and Hookins
Sept 2011 6 | [
0.2289467453956604,
0.29468053579330444,
0.0883425772190094,
-0.6786302924156189,
0.13721704483032227,
0.6866149306297302,
0.34670427441596985,
-0.08390504866838455,
0.26823824644088745,
-0.41866207122802734,
-0.5967994332313538,
0.3171747624874115,
-0.06704602390527725,
0.4218473732471466... | |
29 Ian McCoy Selway Joyce
June 2011 7 27 Julian Larkin C&G Properties
Sept 2011 8 25 Roque Menezes Capita Symonds
June 2011 9 22 Shawn Lambert PWP Architects
Sept 2011 10 22 Kevin Lendon Amiri Construction
Event: Ken Watson (HNW Architects) Undisputed Amiri Golf Demon of the Dow... | [
-0.5834760069847107,
0.337528258562088,
0.4550149440765381,
-0.369251549243927,
-0.05503919720649719,
0.4058806300163269,
0.5686090588569641,
0.09295479208230972,
0.12051740288734436,
-0.49396827816963196,
-0.0029494964983314276,
0.6312615871429443,
0.5056446194648743,
0.05254479870200157,... | |
COMPANY
2010 1 40 Ken Watson HNW Architects
2010 2 37 David Heda London Clancy
2010 3 34 Gordon Brown Currie & Brown
2010 4 32 Alistair Taylor Wildbrook Properties | [
0.3725181818008423,
0.4783332943916321,
0.3250896632671356,
-0.7751863598823547,
0.4549991190433502,
0.5397756695747375,
0.349862664937973,
-0.03994330018758774,
-0.14088323712348938,
-0.4159858822822571,
-0.7189894914627075,
0.31499379873275757,
-0.04542453587055206,
0.5627961158752441,
... | |
5 30 Andy Goodridge City Estates
6 25 Russ Pitman Henderson Green
7 24 Phil Piper Piper Whitlock
8 23 Kevin Miller Urban Pulse Architects
9 19 | [
0.2111354023218155,
0.1290716975927353,
0.32641342282295227,
0.09212818741798401,
-0.20284457504749298,
0.4644101560115814,
0.42222264409065247,
-0.45768609642982483,
0.2972554564476013,
-0.8248657584190369,
-0.2638067305088043,
0.40763553977012634,
-0.21457144618034363,
-0.148289561271667... | |
Simon Asquith Godsall Arnold Partnership
10 19 Shawn Lambert PWP Architects
11 18 Martin Judd Davis Langdon
``` | [
0.3092608153820038,
0.7232396006584167,
0.20376572012901306,
-0.25735947489738464,
0.10344619303941727,
0.7321029305458069,
0.38784995675086975,
-0.31242835521698,
0.04425909370183945,
-0.520648717880249,
-0.5318413376808167,
0.5278606414794922,
-0.02702770195901394,
0.21811120212078094,
... | |
I've the code:
```
#include <iostream>
using namespace std;
auto fn = ([](int x){
return [x](int y) {
return x * y;
};
});
int main() {
int i = fn(2)(4); // 8
cout << i << endl;
return 0;
}
```
This code works fine.
However, I want to call a second function later like:
```... | [
0.3571092188358307,
0.08323369920253754,
0.8554272055625916,
-0.548518180847168,
0.1397293508052826,
0.11551429331302643,
0.21654464304447174,
-0.2819545269012451,
0.06859119981527328,
-0.7460246086120605,
-0.23768556118011475,
0.6691023707389832,
-0.3967929482460022,
0.3481990098953247,
... | |
with the first call?
The following works as expected
```
#include <iostream>
using namespace std;
auto fn = [](int x){
return [x](int y) {
return x * y;
};
};
int main() {
auto i = fn(2)(4); // 8
cout << i << endl;
auto j = fn(2);
cout << j(4) << endl;
return 0;
}
``... | [
-0.07039380073547363,
-0.1227937638759613,
0.39625516533851624,
-0.5211292505264282,
0.13304610550403595,
0.13084959983825684,
0.45919230580329895,
-0.3846100866794586,
-0.14066064357757568,
-0.3702639937400818,
-0.37210291624069214,
0.9167290329933167,
-0.7418974041938782,
-0.045406267046... | |
instead of auto:
```
currying.cpp:17:17: error: cannot convert ‘<lambda(int)>::<lambda(int)>’ to ‘int’ in initialization
currying.cpp:19:16: error: ‘j’ cannot be used as a function
```
which is an "obvious" and useful information to get what's going wrong. | [
0.2534805238246918,
0.12293296307325363,
0.13089625537395477,
-0.21359996497631073,
0.021698258817195892,
0.17561568319797516,
0.489117294549942,
-0.3460284173488617,
-0.06912761926651001,
-0.5097662210464478,
-0.28959476947784424,
0.5274122357368469,
-0.2717835009098053,
-0.03924204036593... | |
In my class, I have field `int count`. I want to create a new variable according to value of `count` variable, like this: `int a = new Integer(count)`. But when I update count variable: `count++`, then variable `a` also gets updated. So how to create non-referencing int variable?
You can't do this with Java. Your close... | [
-0.23861047625541687,
-0.024287648499011993,
0.037985872477293015,
-0.06189322471618652,
-0.1429746299982071,
0.21139933168888092,
0.24513877928256989,
-0.5242649912834167,
-0.10299700498580933,
-0.6728777885437012,
0.18813222646713257,
0.7196826338768005,
-0.46265992522239685,
0.333945900... | |
7
```
But: this breaks a bunch of commonly-accepted best practices in Java. You might look for an alternative way to solve whatever your real problem is. | [
0.36355307698249817,
0.33604806661605835,
0.26669323444366455,
0.029584527015686035,
0.3115033209323883,
-0.6331610679626465,
0.19551952183246613,
0.19840946793556213,
0.07049235701560974,
-0.4462950527667999,
-0.11823303997516632,
0.7095198035240173,
-0.18747490644454956,
-0.0847285613417... | |
```
$("#mute").click(function(){
$("#audioplayer")[0].muted = $("#audioplayer")[0].muted;
$("#message").text("Volume muted");
})
```
What I need to achieve is when the users clicks again the button "mute", they will receive another message with "Volume UnMuted", instead of muted, if he clicks it ... | [
0.03714331239461899,
-0.20382340252399445,
0.46546822786331177,
-0.3924497067928314,
-0.04473495855927467,
0.03600691631436348,
0.3589131236076355,
-0.6304979920387268,
-0.20717383921146393,
-0.7056958675384521,
-0.2643558084964752,
1.0488327741622925,
-0.42267417907714844,
0.5437646508216... | |
b = a;
b.value++;
a.value++;
//since a.value is the same primitive as b.value, they are both 7
```
But: this breaks a bunch of commonly-accepted best practices in Java. You might look for an alternative way to solve whatever your real problem is. | [
0.18833386898040771,
0.3008284866809845,
-0.1955188810825348,
-0.40371137857437134,
-0.07134512066841125,
-0.2943069636821747,
0.4936935305595398,
-0.2699510157108307,
-0.0744081363081932,
-0.14552555978298187,
-0.10703989118337631,
0.5203637480735779,
-0.45152872800827026,
-0.118799202144... | |
I have a Homework Planner application which I want to create an Alarm for to remind users of the homework the night before/at a certain time. I have an Activity called AddNewHomework which is where the user creates a new homework item and it is added to the database. This code is then called.
```
Intent i = new Intent... | [
0.35709401965141296,
0.00004236484528519213,
0.509710967540741,
-0.1004909873008728,
0.05364261195063591,
-0.047314029186964035,
0.5116124749183655,
-0.6009534597396851,
-0.28045225143432617,
-0.5678790211677551,
0.10640464723110199,
0.5274588465690613,
-0.20503084361553192,
-0.17401671409... | |
contains a ListView and displays all of the homeworks stored in the database. If a user long clicks on one then they have the option to delete it, however removing it from the database will not remove the alarm.
I have looked for code I can use to remove the alarm however I have not found anything that allows me to u... | [
0.438011109828949,
0.09996774792671204,
0.3382928967475891,
0.14727894961833954,
-0.007705201860517263,
-0.3186019957065582,
0.36391857266426086,
-0.2933405041694641,
-0.1826363354921341,
-0.34896546602249146,
0.16413693130016327,
0.4380156993865967,
-0.2627306878566742,
0.1458360552787780... | |
think).
It should be like this,
```
$("#portfolioContent").load("rpc.php?o="+day+"&pagename=home");
``` | [
0.2569780945777893,
-0.02661636285483837,
0.7872110605239868,
-0.2767493724822998,
0.47095972299575806,
-0.17485614120960236,
0.04409956559538841,
-0.12716694176197052,
-0.11541782319545746,
-0.5880839824676514,
-0.04322386160492897,
0.7576135396957397,
-0.26437798142433167,
0.014792798087... | |
I have created a page with a static image positioned to the ride side of the browser at full height (with a gradient over it) and a block of text to the left. I want the image to resize with the browser window, however I do not want the image to go behind the text or to get smaller than the text. When I set a min-width... | [
0.2310691922903061,
-0.026011230424046516,
0.6344208717346191,
0.2030811309814453,
-0.24640591442584991,
-0.08581872284412384,
0.22133898735046387,
-0.08100416511297226,
-0.017826518043875694,
-0.8572279810905457,
0.1814294457435608,
0.5142917633056641,
-0.13718262314796448,
-0.09141355007... | |
height: 100%;
width: 100%;
padding: 0;
margin: 0;
min-width: 1024px;
min-height: 768px;
}
#background-image {
position: absolute;
right: 0;
top: 0;
height: 100%;
background-image: url('image.jpg');
z-index: -1;
}
#background-gradient {
position: absolute;
right: 0;
... | [
-0.37161895632743835,
-0.07926727831363678,
0.9123842120170593,
0.38129374384880066,
0.08248385041952133,
0.34379029273986816,
0.03555776923894882,
0.014883667230606079,
-0.044906601309776306,
-0.37417668104171753,
-0.5339890122413635,
0.5636292695999146,
0.16180069744586945,
-0.0651810765... | |
top: 15%;
width: 500px;
font-family: Georgia;
font-size: 16px;
}
p.dropcap:first-letter {
float: left;
font-size: 50px;
line-height: 30px;
padding-top: 2px;
padding-right: 4px;
font-family: Georgia;
}
h1 {
font-size: 55px;
}
</style>
</head>
<body>
<img id="background-image"... | [
-0.31054866313934326,
-0.20262034237384796,
0.9723588228225708,
0.24350619316101074,
-0.051181912422180176,
0.591560423374176,
0.09417406469583511,
-0.14127948880195618,
-0.08012682944536209,
-0.03602946549654007,
-0.6872997283935547,
0.2033701241016388,
-0.16807401180267334,
-0.3633899092... | |
ultrices nec auctor neque facilisis. Pellentesque commodo tellus quam. Praesent dictum sodales nisi, id tempor neque hendrerit id. Ut non mi a ante pulvinar tempor. Morbi scelerisque metus eu sem iaculis hendrerit. Integer pulvinar ipsum quis ante tincidunt gravida.</p>
<p>Nullam vel tellus sed mauris sagittis egestas ... | [
-0.5386936068534851,
-0.09877848625183105,
0.6200287938117981,
-0.06331215798854828,
-0.0018743528053164482,
0.9197638034820557,
0.15467742085456848,
-0.1474241316318512,
-0.09855860471725464,
-0.4375004768371582,
0.10407824069261551,
0.7105903625488281,
-0.0893256813287735,
-0.40772816538... | |
semper metus eget nisi varius varius elementum nisl eleifend. Nulla facilisi. Suspendisse urna sapien, pulvinar non porttitor pellentesque, laoreet id leo. Praesent sed tortor quis tellus eleifend ultricies et eu eros. Sed massa eros, hendrerit eu facilisis sed, fermentum sit amet purus. Nulla aliquam eleifend ante, ti... | [
0.4721962809562683,
-0.2911373972892761,
0.5202078223228455,
-0.024482950568199158,
0.11015043407678604,
0.06028159707784653,
0.46372362971305847,
-0.43646326661109924,
-0.1266564279794693,
0.10063407570123672,
-0.012479376047849655,
0.4526125490665436,
-0.6456294655799866,
-0.384311407804... | |
the pool is the DOM :) | [
-0.14459238946437836,
-0.05678784102201462,
0.5064769983291626,
-0.12719669938087463,
0.41132408380508423,
-0.11114837229251862,
0.1303970366716385,
0.019610226154327393,
-0.2674543857574463,
-0.38555288314819336,
-0.1611221879720688,
0.14714942872524261,
-0.10381484031677246,
0.0901658758... | |
What is the use of closed property of window?
By default closed is false.
```
window.closed
false
```
I observed that closed can be set to true, but what is the significance of closed = true?
```
window.closed = true
true
```
After this window remains open.Same behavior with chrome and firefox.
[`window.closed`]... | [
0.24601079523563385,
0.22497527301311493,
0.5711833834648132,
-0.19925284385681152,
0.03471888601779938,
-0.2761879563331604,
0.5056296586990356,
-0.10335151106119156,
-0.12465827167034149,
-0.3969181776046753,
-0.5654998421669006,
0.7009477019309998,
-0.5545186400413513,
0.279990881681442... | |
Is it possible to use AS sql statement with Django ORM:
`SELECT my_field AS something_shiny WHERE my_condition = 1`
If it is possible then how?
use [extra()](https://docs.djangoproject.com/en/1.4/ref/models/querysets/#django.db.models.query.QuerySet.extra)
```
Foo.objects.filter(cond=1).extra(select={'sth_shiny':'my... | [
0.27507755160331726,
-0.011924320831894875,
0.3144194483757019,
-0.21691063046455383,
-0.26271092891693115,
0.19027842581272125,
-0.26735803484916687,
-0.09176626056432724,
-0.35386621952056885,
-0.3978342115879059,
0.013211975805461407,
0.5366203784942627,
-0.15250644087791443,
-0.0249117... | |
I do not know why there are 2 matches found aside from the input using this regex, when I expected only 1 match.
```
preg_match(/_(\d(-\d){0,3})\./,$str,$matches);
```
on this file string format `name_A-B-C-D.ext`.
I would expect to get a single match like this:
```
Example A
[0] => name_A-B-C-D.ext
[1] => A-B-C... | [
-0.2118007093667984,
0.2945576012134552,
0.2963935136795044,
-0.13740672171115875,
-0.11577637493610382,
-0.01464065071195364,
0.14341871440410614,
-0.42536914348602295,
-0.039523668587207794,
-0.5685461163520813,
-0.12754786014556885,
0.6247872710227966,
-0.41209232807159424,
0.0925900489... | |
but I would like to know why its there. I can only assume it has something to do with my two capture groups. Where is my error ?
Yes, you get two captures because you have two capturing groups in your regular expression.
To avoid the unwanted capture you could use a non-capturing group `(?:...)`:
```
/_(\d(?:-\d){0,3... | [
0.034907933324575424,
-0.09830404818058014,
-0.1314801573753357,
-0.08583754301071167,
-0.06643260270357132,
-0.043140340596437454,
0.12508584558963776,
0.25265422463417053,
-0.19952796399593353,
-0.735480010509491,
-0.22131063044071198,
0.3447488844394684,
-0.5043608546257019,
-0.04532236... | |
I have a UITableView with several sections, and the number of sections is dynamic, that is, they can increase at any time. Reloading a section with animation on a table view where the number of sections is no big deal. I just call this:
```
[notesTableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimati... | [
0.1387692093849182,
0.025765899568796158,
0.5678844451904297,
0.0114443926140666,
-0.3062167167663574,
-0.08660808205604553,
0.11606162041425705,
0.09934324771165848,
-0.4854135513305664,
-0.7349733114242554,
-0.06696037203073502,
0.31219255924224854,
-0.07270227372646332,
0.30853042006492... | |
this might be difficult in my situation.
My number of sections is based of the size of an array. Is there anyway to reload sections with animations just automatically, as easy as calling `[tableView reloadData]`, without having to worry about inserting rows and sections manually?
(I know a cheap workaround would be ... | [
0.12179658561944962,
0.007315413095057011,
0.2187241017818451,
0.30362439155578613,
-0.24582256376743317,
-0.07598870992660522,
0.32855224609375,
0.07740483433008194,
-0.5025010108947754,
-0.6484794020652771,
-0.010138953104615211,
0.4113403558731079,
-0.14520390331745148,
0.36261564493179... | |
tableView tries to load the tableView, and looks at the delegateMethods - it shows that you have lesser sections that what is specified.
You have two options :
1. Implement the `FetchedResultsController` delegate methods and implement `objectWillChange` (or) `objectDidChange` method, and inside that say something li... | [
-0.03617434948682785,
-0.16436311602592468,
0.5574406981468201,
0.11071733385324478,
-0.16703560948371887,
-0.14814288914203644,
0.31907615065574646,
-0.22504733502864838,
-0.40364429354667664,
-0.8002656698226929,
0.04195820540189743,
0.7279921174049377,
-0.3652525842189789,
0.02469567209... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.