text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
bash? I'm not familiar with the language, so am not sure where to start. Replacing `'` with `\'` would do the job at minimum I suspect.
OK, found out what to do. Bash supports this natively as expected, though as always, the syntax isn't really very guessable!
Essentially `${string//substring/replacement}` returns wha... | [
0.12285877019166946,
0.2927478849887848,
0.26934894919395447,
-0.3092332184314728,
-0.08927957713603973,
-0.13142621517181396,
0.2610822319984436,
-0.14386744797229767,
-0.3007458746433258,
-0.5471109747886658,
-0.0657847598195076,
0.9566059708595276,
-0.33519986271858215,
-0.2321723550558... | |
you learn something every day. | [
0.6077974438667297,
-0.11438051611185074,
-0.3944007456302643,
0.34398365020751953,
-0.00909058004617691,
-0.14327937364578247,
0.27284857630729675,
0.29926663637161255,
-0.16891808807849884,
-0.8230757713317871,
0.3384566605091095,
0.25041308999061584,
0.35528847575187683,
0.0833984985947... | |
I'm trying to pass the item clicked to another activity i.e from A to B using a custom itemsAdapter with sqlite.
How can I achieve the following?
1)Get the item clicked position using cursor
2)Pass the item clicked to another activity
I'm trying to do similar to [this](http://coenraets.org/blog/android-samples/andro... | [
0.1697864979505539,
-0.2106303721666336,
0.738694965839386,
-0.19752958416938782,
-0.008414282463490963,
0.13741327822208405,
0.4921426475048065,
-0.5470569729804993,
-0.17314057052135468,
-0.8643245697021484,
-0.2462293803691864,
0.6246446967124939,
-0.5244039297103882,
-0.033499646931886... | |
Cursor cursor = db
.rawQuery("SELECT * from my_table WHERE pro._id = ?",
new String[] { "" + propertyId });
```
Added the Adapter
```
private void getItemId(int position) {
// TODO Auto-generated method stub
}
private void getDataAndPopulate() {
// TODO Auto-generated method... | [
-0.09250865876674652,
-0.15366163849830627,
0.6505446434020996,
-0.21669195592403412,
-0.09666053205728531,
0.39494267106056213,
0.23807959258556366,
-0.5089952349662781,
0.031881388276815414,
-0.3792303800582886,
-0.3376544713973999,
0.665104866027832,
-0.42315974831581116,
0.239418670535... | |
address= new ArrayList<String>();
propType= new ArrayList<String>();
Cursor cursor = getEvents(" gall,properties where properties._id = gall._id " );
while (cursor.moveToNext()) {
//String temp_id = cursor.getString(0);
byte[] temp_image = cursor.getBlob(2);
String temp_identifie... | [
-0.1009126603603363,
-0.31394055485725403,
0.6637569665908813,
-0.17971980571746826,
-0.11936779320240021,
0.4371110200881958,
-0.1203211098909378,
-0.7932013273239136,
-0.4019884169101715,
-0.5956185460090637,
-0.4746968448162079,
0.5726284980773926,
-0.23244774341583252,
0.15731269121170... | |
String temp_propType = cursor.getString(6);
image.add(temp_image);
//System.out.println(image);
bedrooms.add(temp_bedrooms);
address.add(temp_address);
propType.add(temp_propType);
}
String[] identifierArray = (String[]) bedrooms.toArray(new String[bedrooms | [
0.43732884526252747,
-0.2357194572687149,
0.6235372424125671,
-0.04867427796125412,
0.3150113523006439,
0.45147278904914856,
0.2433711141347885,
-0.7163701057434082,
-0.29675352573394775,
-0.6389169692993164,
-0.33015066385269165,
0.3656986355781555,
-0.42560330033302307,
0.499601721763610... | |
.size()]);
itemsAdapter = new ItemsAdapter(PropertyResult.this,
cursor, R.layout.activity_f9, identifierArray);
setListAdapter(itemsAdapter);
}
private class ItemsAdapter extends BaseAdapter {
String[] items;
public ItemsAdapter(Context context, Cursor cursor,int textViewResourceId,
Stri... | [
-0.18036779761314392,
-0.2793259620666504,
0.6457887887954712,
-0.2694481611251831,
-0.03547300025820732,
0.3750772476196289,
0.3545486629009247,
-0.35352492332458496,
-0.14400333166122437,
-0.6716249585151672,
-0.6004142165184021,
0.48165008425712585,
-0.24312566220760345,
0.3696324825286... | |
ViewGroup parent) {
TextView desc;
TextView cap;
TextView ident;
TextView pric;
TextView bedroom;
TextView addres;
TextView propertytyp;
View view = convertView;
ImageView img; | [
0.17541971802711487,
-0.2015903890132904,
0.5965428948402405,
-0.398241251707077,
-0.37252581119537354,
0.21233175694942474,
0.1323835253715515,
-0.24935054779052734,
0.21565455198287964,
-0.6385526657104492,
-0.5941385626792908,
0.5964292287826538,
-0.255669504404068,
0.31845521926879883,... | |
if (view == null) {
LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = vi.inflate(R.layout.activity_f9, null);
}
img = (ImageView) view.findViewById(R.id.image);
bedroom = (TextView) view.findViewById(R.id.bedrooms);
... | [
0.1836392879486084,
-0.14299695193767548,
0.8447842001914978,
-0.19944381713867188,
0.12265932559967041,
0.3484979569911957,
0.42134395241737366,
-0.8812494874000549,
-0.09740294516086578,
-0.8808236122131348,
-0.4790785014629364,
0.5280768871307373,
-0.16919642686843872,
0.564766049385070... | |
bedroom.setText("£"+bedrooms.get(POSITION));
addres.setText(address.get(POSITION));
propertytyp.setText(propType.get(POSITION));
img.setImageBitmap(BitmapFactory.decodeByteArray(
image.get(POSITION), 0, image.get(POSITION).length));
return view;
}
public int getCount(... | [
0.23953624069690704,
-0.2794775366783142,
0.4505625069141388,
-0.12880225479602814,
0.21706168353557587,
0.30443865060806274,
0.3564431369304657,
-0.4567136764526367,
-0.24337716400623322,
-0.5824070572853088,
-0.7980890870094299,
0.32861778140068054,
-0.2251279652118683,
0.315864711999893... | |
}
public long getItemId(int position) {
return position;
}
}
```
Please kindly give me a solution.
when you call a model method in your controller, the Request and Response objects are carrying the same value or outputting to the same source. the "page" is what matters there for these objects.
And ... | [
-0.007874091155827045,
-0.24752002954483032,
0.3601558804512024,
0.314398854970932,
0.23166897892951965,
-0.026334034278988838,
0.03723526746034622,
0.01382041722536087,
-0.11631394177675247,
-0.7152494192123413,
-0.05557482689619064,
0.41215503215789795,
-0.40760284662246704,
0.3574792742... | |
to be as a bridge between views and models**, and **models should work even if there isn't any Response or Request value in these objects**, so I would use these objects' values as usual **parameters to model methods** instead of referencing them inside the model. It's the right usage of the MVC concept. | [
0.38259658217430115,
-0.020168986171483994,
0.5122680068016052,
0.08593493700027466,
-0.06592012196779251,
0.09903596341609955,
-0.1495179831981659,
-0.07187045365571976,
-0.21023783087730408,
-0.463824063539505,
0.2271386831998825,
0.773890495300293,
-0.21925784647464752,
0.06857450306415... | |
The websites I've designed had no problem before but now I see DOCTYPE line red in Firefox 11. There is no problem in validation. I changed encoding to UTF-8 without BOM but problem still exists.
<http://validator.w3.org/check?uri=genelvana.com>
```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http... | [
0.41970837116241455,
0.26649752259254456,
0.44547128677368164,
-0.27076461911201477,
-0.23600976169109344,
-0.24899311363697052,
0.12098801881074905,
-0.11940974742174149,
-0.2550146281719208,
-1.1482834815979004,
-0.1860380619764328,
0.4705007076263428,
-0.41359442472457886,
-0.0026383970... | |
```
gcc (GCC) 4.6.3
c89
```
I am trying to use `usleep`. However, I keep getting the following warning:
> implicit declaration of function usleep
I have included the `unistd.h` header file.
The man pages mentions something about this. But I am not sure I understand by it:
```
usleep():
Since glibc 2.12:
... | [
0.15145163238048553,
0.0418747216463089,
0.4612763524055481,
-0.40812668204307556,
-0.3527112305164337,
-0.5396957397460938,
0.1590607613325119,
0.04515426978468895,
0.14645203948020935,
-0.6835177540779114,
-0.10569752007722855,
0.6437350511550903,
-0.5060135722160339,
0.09844459593296051... | |
_XOPEN_SOURCE >= 700)
Before glibc 2.12:
_BSD_SOURCE || _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
```
But not sure what I a to do with the above?
That list is the pre-conditions for having `usleep` defined. It's basically a C-like expression involving `#define` variables which has to b... | [
0.38628295063972473,
0.17716056108474731,
0.5109404921531677,
-0.3451167643070221,
-0.2093048393726349,
-0.4038330316543579,
0.1061229407787323,
-0.07718567550182343,
0.09898924082517624,
-0.590164065361023,
0.15890048444271088,
0.5347352623939514,
-0.30641844868659973,
0.07542209327220917... | |
to figure it out yourself :-)
Assuming you're using a `glibc` 2.12 or better, it means you either have to:
* declare \_BSD\_SOURCE; or
* declare a complicated combination of three other things, which I won't bother to decode.
Probably the easiest fix is to simply compile with `gcc -D _BSD_SOURCE` or put:
```
#defin... | [
0.3820171356201172,
0.16055050492286682,
0.07729814201593399,
-0.012562163174152374,
0.17461827397346497,
-0.4293379485607147,
0.006563844159245491,
0.2499915212392807,
0.02198641747236252,
-0.7309795618057251,
-0.06356824189424515,
0.7750334739685059,
-0.4450088441371918,
0.13058719038963... | |
I have the following code:
```
/**
* [...]
*
* @see #setShowOn(T, Device)
*/
public static <T extends HasStyle> void setHideOn(T widget, Device device) {
[...]
}
```
`setShowOn` has the same signature as `setHideOn`. Javadoc complains:
```
Tag @see: can't find setHideOn(T, Device) in com.github.[...]
``... | [
0.11910071223974228,
0.34480908513069153,
0.5867720246315002,
-0.00913994386792183,
-0.07803193479776382,
-0.051753558218479156,
0.01678805612027645,
-0.36676648259162903,
-0.39831268787384033,
-0.47712114453315735,
-0.1652216911315918,
0.6199941635131836,
-0.3073635399341583,
0.1391063779... | |
you have two LinkedHashMaps
```
Map m1 = new LinkedHashMap();
m1.put("1","One");
m1.put("3","Three");
Map m2 = new LinkedHashMap();
m2.put("2","Two");
m2.put("4","Four");
```
Find keys from both the Linked HashMap and store it in a list alternatively.
The list should contain 1,2,3,4.
This is solution:
```
... | [
-0.22975823283195496,
-0.18628552556037903,
0.5706250667572021,
-0.27707281708717346,
0.053692761808633804,
0.0549139529466629,
0.2568678557872772,
-0.5297238826751709,
-0.5802000164985657,
-0.865081250667572,
-0.516246497631073,
0.6240369081497192,
-0.31426355242729187,
-0.220753192901611... | |
I played with different XPath queries with XPather (works only with older firefox versions) and notice a difference between the results from the following queries
This one shows some results
```
//div[descendant::table/descendant::td[4]]
```
This one lists empty list
```
//div[//table//td[4]]
```
Are they dif... | [
-0.13372543454170227,
-0.19320426881313324,
0.33218932151794434,
0.07773900032043457,
-0.2971241772174835,
-0.12314202636480331,
-0.0831202045083046,
-0.1308138370513916,
-0.01744263619184494,
-0.5204983949661255,
0.18321338295936584,
0.6810489892959595,
-0.2944449484348297,
0.098364986479... | |
look down for descendants relative to the `div` element while in the second predicate you look down for descendants from the root node `/` (also called the document node).
You might want `//div[.//table//td[4]]` for the second path expression to come closer to the first one.
[edit]
Here is a sample:
```
<html>
<bod... | [
-0.01977505534887314,
-0.3678143620491028,
0.17421020567417145,
-0.11438646167516708,
-0.12398647516965866,
0.287583589553833,
0.047321345657110214,
-0.4357839524745941,
-0.06054360046982765,
-0.7407739162445068,
-0.23091816902160645,
0.19985611736774445,
-0.23096072673797607,
-0.173066079... | |
<tr>
<td>2</td>
</tr>
<tr>
<td>3</td>
</tr>
<tr>
<td>4</td>
</tr> | [
-0.04843302071094513,
-0.1758916676044464,
0.29678744077682495,
-0.031747978180646896,
-0.09003492444753647,
0.2167883664369583,
0.005534494295716286,
-0.7973954677581787,
-0.15943945944309235,
-0.2881634533405304,
-0.547601044178009,
0.5062414407730103,
-0.41184043884277344,
-0.2896556854... | |
</tbody>
</table>
</div>
</body>
</html>
```
With that sample the path `//div[descendant::table/descendant::td[4]]` selects the `div` element as it has a `table` child which has a fourth `td` descendant.
However with `//div[.//table//td[4]]` we look for `//div[./descendant-or-self::node()/table/descendan... | [
0.09611799567937851,
-0.04176156595349312,
0.3174455165863037,
-0.14907768368721008,
-0.12419290840625763,
0.36509034037590027,
0.21020768582820892,
-0.564394474029541,
0.017827052623033524,
-0.6734815239906311,
-0.1553153693675995,
0.15378256142139435,
-0.1974429488182068,
0.1096963435411... | |
I am making a simple retail commerce solution, where there are **prices** in a few different models. These prices contribute to a **total price**. Imagine paying $0.30 more for selecting a topping for your yogurt.
When I set the `price` field to
```
t.decimal :price, precision:8, scale:2
```
The database stores... | [
0.5274934768676758,
0.23847021162509918,
0.5544323921203613,
0.20931169390678406,
-0.014792213216423988,
0.30041977763175964,
-0.2776881158351898,
0.3237830698490143,
-0.1369384378194809,
-0.5089255571365356,
0.07718052715063095,
0.9592540264129639,
0.12867183983325958,
0.3273949921131134,... | |
simple (no currency conversion etc), I prefer to have the price formatted universally in the model without repeated calling number\_to\_currency in views.
Is there a good way I can modify my getter for price such that it always returns two decimal place with a dollar sign, i.e. $6.50 when it's called?
Thanks in adva... | [
0.327450156211853,
0.14863592386245728,
0.7167391180992126,
0.03631126135587692,
-0.03299149125814438,
0.06888002902269363,
-0.07287083566188812,
-0.21534454822540283,
-0.17174428701400757,
-0.5331457257270813,
0.07572892308235168,
0.8109877109527588,
-0.03555336222052574,
0.10985056310892... | |
end
```
Cheers.
**UPDATE 2**
Caveat Emptor. Once you do this, you lose the ability to do operations to the number because it's now a string.
Please beware if anyone is facing the same problem as me.
Just add a method in your model which is named like your attribute in the database like:
```
def price
"$%.2f"... | [
0.17025984823703766,
0.02838301844894886,
0.5924614071846008,
-0.11959857493638992,
0.02340994030237198,
0.0026890006847679615,
0.2679937481880188,
-0.30808213353157043,
-0.3399995267391205,
-0.4217403531074524,
-0.17044763267040253,
0.9396637082099915,
-0.10579327493906021,
-0.04167893156... | |
I want to create custom page for admin panel without model. For first i copy index.html to project folder:
```
mysite/
templates/
admin/
index.html
```
Then add to apps block my code:
```
<div class="module">
<table summary="{% blocktrans with name="preferences" %}Models available in the... | [
0.22019198536872864,
0.051198810338974,
0.8336548209190369,
-0.14440082013607025,
0.11418373882770538,
0.4491328299045563,
0.018091915175318718,
-0.4308842718601227,
-0.15630963444709778,
-0.8448349833488464,
0.11840375512838364,
0.5372174382209778,
-0.3295721411705017,
0.11266874521970749... | |
<th scope="row"><a href="preferences">Preferences</a></th>
<td><a href="preferences" class="changelink">{% trans 'Change' %}</a></td>
</tr>
</table>
</div>
```
This works good, then I create new page /templates/admin/preferences/preferences.html and
add to urls.py:
```
url(r'^admin/pr... | [
0.3737923204898834,
0.3006456196308136,
0.8721123933792114,
0.09443147480487823,
0.06167522445321083,
0.13993391394615173,
0.39275145530700684,
-0.5031574964523315,
0.19866874814033508,
-0.7473392486572266,
-0.10378949344158173,
0.513498842716217,
-0.3108370304107666,
0.1902320683002472,
... | |
patterns of the admin itself:
```
urlpatterns = patterns('',
url(r'^admin/preferences/$', TemplateView.as_view(template_name='admin/preferences/preferences.html')),
url(r'^admin/', include('django.contrib.admin.urls')),
)
```
This way the URL won't be processed by Django's admin. | [
0.12704171240329742,
0.3427538275718689,
0.5042438507080078,
-0.059320513159036636,
-0.1047392338514328,
-0.10670343041419983,
-0.02183741144835949,
-0.1790286898612976,
-0.057093966752290726,
-0.6145596504211426,
-0.3453214764595032,
0.3089177906513214,
-0.6582902669906616,
-0.07037071138... | |
I have created an anchor with an onclick event which calls a JavaScript function. The JavaScript function returns some value. I want to use that value in another JS function.
e.g
`loading()` will return some value which will get passed to another js function. How do I capture and store the return value, and then pass ... | [
0.5092859268188477,
-0.17444287240505219,
0.27190136909484863,
-0.35904717445373535,
0.1643637865781784,
0.04299478977918625,
0.3323478400707245,
-0.5403580665588379,
-0.12091926485300064,
-0.34320083260536194,
-0.3104892671108246,
0.6777095794677734,
-0.5990142822265625,
-0.12271148711442... | |
return retval;
}
onclick="return innerFunc();"
```
In someother onclick event
```
onclick="return outerFunc();"
``` | [
-0.07515975832939148,
-0.3508436381816864,
0.5237167477607727,
-0.19443514943122864,
0.2826867997646332,
-0.20330969989299774,
0.4713623523712158,
-0.3645641505718231,
0.005975020583719015,
-0.16618391871452332,
-0.42235517501831055,
0.8787782192230225,
-0.37025919556617737,
0.023773659020... | |
I have the model:
```
class Action
include Mongoid::Document
field :name, type: String
field :assignment_date, type: Date
...
index(
[
[ :name, Mongo::ASCENDING ],
[ :assignment_date, Mongo::ASCENDING ]
],
unique: true
)
validates_uniqueness_of [ :name, :assignment_date ]
... | [
-0.2938881516456604,
0.3089052140712738,
0.20040003955364227,
0.09075097739696503,
0.10981418192386627,
0.1447458565235138,
0.09634771943092346,
-0.24016521871089935,
-0.14819908142089844,
-0.4680103063583374,
-0.11997749656438828,
0.7251331210136414,
-0.2263035625219345,
0.296529144048690... | |
tryed both versions:
```
validates_uniqueness_of [ :name, :assignment_date ]
```
and
```
validates_uniqueness_of :name, :assignment_date
```
If I'll comment this line all works fine.
Mongoid:
```
validates_uniqueness_of :name, :scope => :assignment_date
```
From the docs: Note that for embedded documents,... | [
0.201665461063385,
0.057339251041412354,
0.30301424860954285,
-0.11348656564950943,
0.05307436361908913,
-0.27672079205513,
0.12791264057159424,
-0.2733466625213623,
-0.03691275417804718,
-0.40573254227638245,
-0.22327207028865814,
0.6880490779876709,
-0.15602760016918182,
-0.0797799602150... | |
I have a UITableView with a C++ object being the datasource, so there isn't any kind of NSArray. I'm getting a crash whenever I want to insert a row to the end of the existing list
```
Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 5 beyond bounds [0 .. 4... | [
-0.3318428099155426,
0.19089201092720032,
0.4800628423690796,
0.1054191067814827,
0.007095718756318092,
-0.19653476774692535,
0.34497401118278503,
0.2558281123638153,
-0.1371891051530838,
-0.6830451488494873,
-0.04096914827823639,
0.38272392749786377,
-0.40781664848327637,
0.50328582525253... | |
correct and therefor fully synch.
In the logs I see, [tableView endUpdates] calls to numberOfRowsInSection which correctly returns a count of the previous count plus one. However, it never calls to cellForRowAtIndexPath again and unable to get past [tableView endUpdates];
```
-(UITableViewCell *) tableView:(UITableVi... | [
-0.1872010976076126,
-0.07016777247190475,
0.7050024271011353,
-0.09216037392616272,
0.28837743401527405,
-0.0862112045288086,
0.47915199398994446,
-0.3471952974796295,
-0.04464198648929596,
-0.6886920928955078,
-0.18320173025131226,
0.5015017986297607,
-0.3162221312522888,
0.1856954842805... | |
[tableView endUpdates];
```
}
```
-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
int i = _reader->allRead() ? _reader->getWindowCount() : _reader->getWindowCount() + 30;
return i;
}
-(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView
{
ret... | [
0.06777827441692352,
0.09667706489562988,
0.690682590007782,
-0.03491619601845741,
-0.32349833846092224,
0.012846870347857475,
0.17923882603645325,
-0.584456741809845,
-0.36090534925460815,
-0.6237662434577942,
-0.014797477051615715,
0.2132928967475891,
-0.08906948566436768,
0.177003800868... | |
example you can create a class which will have a [Bitmap](http://msdn.microsoft.com/en-us/library/system.drawing.bitmap.aspx)(1) property for the image, and a string for the file's path.
```
class LocalBitmap
{
public Bitmap Bitmap { get; set; }
public String Path { get; set; }
public LocalBitmap(String p... | [
0.20580802857875824,
-0.3079736530780792,
0.381624698638916,
0.2431269735097885,
-0.001314352499321103,
-0.19253681600093842,
0.12861847877502441,
-0.11153090000152588,
-0.444595605134964,
-0.8493391275405884,
-0.2217061072587967,
0.6591839790344238,
-0.42042121291160583,
-0.13745103776454... | |
sure which one to use ask yourself if your class requires an image or an image of that exact format (that is, bitmap). | [
0.27397421002388,
-0.42508742213249207,
0.0397636815905571,
0.5845186114311218,
0.15945552289485931,
-0.22062772512435913,
-0.19308993220329285,
0.05600455030798912,
-0.1500127762556076,
-0.37675267457962036,
0.11321087926626205,
0.3610263764858246,
-0.06827729195356369,
-0.419767588376998... | |
I have encountered something unexpected working with Stage3D. I have made two different shader programs for my objects. One of the programs is for using textured bitmaps and uv data. The other simply uses color data. The two objects are very different because eventually, I will display some things (like directional lin... | [
0.09033618122339249,
-0.011840005405247211,
0.5459104776382446,
-0.1078779324889183,
-0.19490523636341095,
-0.08269134163856506,
-0.10734330117702484,
-0.1374988704919815,
0.21158365905284882,
-0.9516429901123047,
0.260555624961853,
0.5140261054039001,
-0.044493820518255234,
0.195184648036... | |
color-only objects appear or all my texture-only objects appear. Obviously, I want both to appear.
Here is my agal code for the textured objects:
vertex shader:
```
//4x4 matrix multiply to get camera angle
"m44 op, va0, vc0\n" +
//tell fragment shader about xyz
"mov v0, va0\n" +
//tell frament shader about uv
"mo... | [
-0.41421911120414734,
0.0599578395485878,
0.9393006563186646,
-0.3206811547279358,
-0.1448228657245636,
0.3970578908920288,
0.10125803202390671,
-0.17135658860206604,
-0.09774476289749146,
-0.8503301739692688,
-0.19779862463474274,
0.7298794984817505,
-0.2131953239440918,
-0.19399693608283... | |
renderMatrix, true);
context3D.setTextureAt(0, texture);
// vertex position to attribute register 0
context3D.setVertexBufferAt(0, vertexBuffer, 0, Context3DVertexBufferFormat.FLOAT_3);
context3D.setVertexBufferAt(1, uvBuffer, 0, Context3DVertexBufferFormat.FLOAT_2);
context3D.setVertexBufferAt(2, colorsBuffer, 0, Con... | [
-0.15489216148853302,
0.04706401005387306,
0.7880216836929321,
-0.437161922454834,
-0.265733540058136,
0.5600612759590149,
0.4362804591655731,
-0.4814215898513794,
-0.010691623203456402,
-0.8805438280105591,
-0.15187053382396698,
0.7629798650741577,
-0.19335421919822693,
-0.038587871938943... | |
of the render procedures to fail. If I render a texture object first in my texture loop, all my colored objects disappear and vice-versa. The objects will appear correctly for the very first frame. But as soon as the render loop plays a second time, this unexpected behavior occurs.
I discovered that if I modify the co... | [
0.0749930813908577,
0.16563576459884644,
0.5159351229667664,
-0.23123705387115479,
-0.14934849739074707,
0.08284491300582886,
0.46069392561912537,
-0.18595772981643677,
0.06725141406059265,
-0.7053737044334412,
-0.011588390916585922,
0.7551437020301819,
-0.4679268002510071,
0.1696425527334... | |
needs less than n, I have to set all those unused va to null. Also, if I make a new shader program for some object (for example a glowing object) that now needs a 4th va, now I have to go back and modify all my other shader programs to set va4 to null so that everything will render. Is this for real? Surely I am missin... | [
0.4518582820892334,
0.13703660666942596,
0.5555412769317627,
-0.065595842897892,
-0.11852990835905075,
0.3411651849746704,
0.2957717776298523,
-0.03026461973786354,
-0.6222136616706848,
-0.5303651094436646,
0.23724323511123657,
0.4145228862762451,
-0.1283998340368271,
0.19249242544174194,
... | |
not completely sure it's possible, nor do I how to do it.
What I *do* suggest is make a type.
So for example you can create a class which will have a [Bitmap](http://msdn.microsoft.com/en-us/library/system.drawing.bitmap.aspx)(1) property for the image, and a string for the file's path.
```
class LocalBitmap
{
... | [
0.15221141278743744,
-0.26858818531036377,
0.4010283350944519,
0.25048938393592834,
0.07988815009593964,
-0.1567215919494629,
0.22454553842544556,
-0.12100028246641159,
-0.09060120582580566,
-0.7803918123245239,
-0.11152303963899612,
0.5501333475112915,
-0.4247778356075287,
-0.081614531576... | |
use it like so:
```
LocalBitmapimage = new LocalBitmap(@"C:\myImage.bmp");
```
---
(1) Consider using the [Image](http://msdn.microsoft.com/en-us/library/system.drawing.image.aspx) class instead. It's the base class of [Bitmap](http://msdn.microsoft.com/en-us/library/system.drawing.bitmap.aspx). If you're not sure ... | [
0.16068919003009796,
-0.4438675045967102,
0.2927011251449585,
0.1026143878698349,
-0.09492623805999756,
-0.22319479286670685,
-0.16341246664524078,
0.1215604692697525,
-0.3119015693664551,
-0.8726411461830139,
-0.07918848842382431,
0.543002188205719,
-0.4130048453807831,
0.0079532498493790... | |
I am using Ruby on Rails 3.2.1 and Kaminari gem 0.13.0.
I have added `gem 'kaminari'` in my gemfile, then ran `Bundle install`.
In controller I have `@posts = Post.order("name").page(params[:page])`
In view:
```
<%= paginate @posts%>
<% @posts.each{|posts| %>
<h1 class="title"><%= link_to posts.... | [
0.09097317606210709,
-0.2549649178981781,
0.3472495675086975,
-0.04410085454583168,
-0.2932840883731842,
-0.0012085252674296498,
0.21660315990447998,
-0.44085270166397095,
-0.09884020686149597,
-0.8223841786384583,
0.08141251653432846,
0.5881767868995667,
-0.06573721766471863,
0.2942837178... | |
<p><%= posts.content %></p>
</div>
<p class="meta"><a href="#" class="more">Read More</a> <a href="#" class="comments">Comments</a> (33)</p>
<% } %>
<%= paginate @posts%>
```
But in result I have `undefined method 'paginate' for #<... | [
-0.1209552139043808,
-0.04215090349316597,
0.20423831045627594,
0.24540778994560242,
-0.09162264317274094,
0.2662164270877838,
0.40696144104003906,
-0.27443793416023254,
-0.05897577106952667,
-0.71734219789505,
0.07499656826257706,
0.3939296007156372,
0.049241553992033005,
0.15399836003780... | |
class PostsController < ApplicationController
# GET /posts
# GET /posts.json
def index
@posts = Post.order(:name).page(params[:page]).per(2)
@posts = Post.order('posts.id DESC')
respond_to do |format|
format.html #index.html.erb
format.json { render json: @posts }
e... | [
-0.3411119878292084,
-0.06840701401233673,
0.5095027089118958,
0.016289014369249344,
-0.3360685408115387,
0.38927990198135376,
0.40232548117637634,
-0.552806556224823,
-0.09914086759090424,
-0.8593472838401794,
-0.41901400685310364,
0.29180678725242615,
-0.2724077105522156,
0.0133259734138... | |
json: @posts }
end
end
``` | [
-0.10455743223428726,
0.3119824528694153,
0.12249696254730225,
-0.164088636636734,
-0.21881815791130066,
-0.21971012651920319,
0.534788966178894,
0.44031858444213867,
0.019699782133102417,
-0.627303421497345,
-0.3768719732761383,
0.16126613318920135,
-0.3199610710144043,
0.4126485884189605... | |
My application creates resque jobs that must be processed sequentially per user, and they should be processed as fast as possible (1 second maximum delay).
An example: job1 and job2 is created for user1 und job3 for user2. Resque can process job1 and job3 in parallel, but job1 and job2 should be processed sequentially... | [
0.0412464514374733,
-0.24479259550571442,
0.6256541013717651,
0.10493668168783188,
-0.03275714069604874,
0.5229737162590027,
0.14496418833732605,
-0.18984733521938324,
-0.30909544229507446,
-0.7548897862434387,
0.06065015867352486,
0.6679858565330505,
-0.11674215644598007,
0.43716698884963... | |
queues" (e.g. queue\_#{user.id}) and try to extend resque that only 1 worker can process a queue at a time (as asked in [Resque: one worker per queue](https://stackoverflow.com/questions/9266415/resque-one-worker-per-queue))
* I could put the jobs in a non-resque queue and use a "per-user meta job" with resque-lock (<h... | [
0.09332588315010071,
-0.16783586144447327,
0.3999178409576416,
0.23879176378250122,
0.008714045397937298,
0.5609066486358643,
0.03297654166817665,
-0.12945370376110077,
-0.6333177089691162,
-0.5637492537498474,
0.04207814484834671,
0.196279376745224,
-0.41014009714126587,
0.190820708870887... | |
MyJob
extend Resque::Plugins::Retry
# directly enqueue job when lock occurred
@retry_delay = 0
# we don't need the limit because sometimes the lock should be cleared
@retry_limit = 10000
# just catch lock timeouts
@retry_exceptions = [Redis::Lock::LockTimeout]
def self.perform(user_id, ...)
# Lo... | [
0.025271819904446602,
-0.006446405313909054,
0.9106363654136658,
-0.5170093774795532,
0.2281978875398636,
-0.2236623615026474,
0.5306494235992432,
-0.30915459990501404,
-0.15206901729106903,
-0.5837799310684204,
-0.27741575241088867,
0.7023316621780396,
-0.1827622950077057,
-0.049144234508... | |
=> 1,
# We don't want to wait for the lock, just requeue the job as fast as possible
:timeout => 0.1
).lock do
# do your stuff here ...
end
end
end
```
I am using here Redis::Lock from <https://github.com/nateware/redis-objects> (it encapsulates the pattern from <http://redis.io/commands/... | [
0.6008505821228027,
0.058651216328144073,
0.4798441231250763,
-0.24780519306659698,
0.3360965847969055,
-0.27654531598091125,
0.5380637645721436,
-0.4580906927585602,
-0.07512889802455902,
-0.6564962863922119,
-0.21847613155841827,
0.5320690870285034,
-0.4049476087093353,
-0.16856694221496... | |
When I run the following piece of code, the `engine` variable is set to `null` when I'm using OpenJDK 7 (`java-7-openjdk-i386`).
```
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
public class TestRhino {
/**
* @param args
*/
public ... | [
0.2248389571905136,
0.17263633012771606,
0.17324574291706085,
-0.5083132386207581,
-0.057503312826156616,
0.39851170778274536,
0.7012651562690735,
-0.6393422484397888,
-0.21269865334033966,
-0.44213855266571045,
-0.03903874754905701,
0.49044492840766907,
-0.540844202041626,
0.1777403652667... | |
System.out.println(engine.eval("1+1"));
} catch (ScriptException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
```
It runs fine with `java-6-openjdk` and Oracle's `jre1.7.0`. Any idea why?
I'm using Ubuntu 11.10. All JVMs are installed under `/usr/lib... | [
-0.04895424470305443,
-0.0571838915348053,
0.4152366518974304,
-0.11496198922395706,
0.05585039407014847,
-0.283928781747818,
0.2852727770805359,
-0.08192885667085648,
-0.4456062316894531,
-0.5361617803573608,
-0.285173624753952,
0.5321864485740662,
-0.4226608872413635,
0.03014973364770412... | |
not compiled into `rt.jar`1 (though I found references to this being a merging issue between Sun and Mozilla, and I know there have been namespace issues, they do exist in the OpenJDK 7 source and are referenced in the makefile), and they're missing from `resources.jar`'s `META-INF/services` as well. This is not the ca... | [
0.18531084060668945,
0.29048091173171997,
0.33072662353515625,
-0.2945890724658966,
0.12854944169521332,
-0.25635582208633423,
0.5946401357650757,
-0.4714944362640381,
-0.13900204002857208,
-0.7756693363189697,
-0.21553689241409302,
0.9520155787467957,
-0.6372251510620117,
-0.0091202091425... | |
according to [this thread](http://mail.openjdk.java.net/pipermail/macosx-port-dev/2011-August/000780.html),
> I had heard somewhere that Mozilla didn't accept Suns changes into their
> mainline branch for reasons unknown but that was prior to being opensourced.
There have also been some collision issues caused by c... | [
-0.05865408480167389,
0.13526982069015503,
0.28848788142204285,
-0.040949806571006775,
-0.09135609865188599,
-0.20243705809116364,
0.190724179148674,
-0.09179355949163437,
-0.47215041518211365,
-0.6566798686981201,
-0.28504350781440735,
0.47174790501594543,
-0.44606485962867737,
0.27431762... | |
it is up to the distros to add it.
Somewhat in contrast to the fact that they're checked in to the OpenJDK mercurial, but I think the idea is that Rhino is not in the JDK spec. | [
0.48810872435569763,
0.1423400640487671,
0.3195708394050598,
0.29880014061927795,
-0.013514291495084763,
-0.0751086100935936,
-0.2598530054092407,
0.2677163779735565,
-0.16161112487316132,
-0.21627958118915558,
0.38979822397232056,
0.6519408822059631,
0.10673286020755768,
0.134016469120979... | |
I'm not getting any error messages, simply my vector is not populating. Looking at the vector in the watch list, nothing is being copied. Why is this?
I've tried two ways.
The first
```
std::vector<Point3D*> hitpoints;
local_hit_point = sr.local_hit_point; //local_hit_point class Point3D
hitpoints.push_back(local_... | [
-0.1764134168624878,
0.06410538405179977,
0.5996795296669006,
-0.25699976086616516,
-0.38511425256729126,
0.19812624156475067,
0.024991441518068314,
-0.20853577554225922,
-0.4156770408153534,
-0.6989783048629761,
-0.025875747203826904,
0.4939817488193512,
-0.3400251865386963,
0.03539608791... | |
*temp;
/* ... */
name = temp;
```
In the `name = temp` assignment, the value of `name` is converted to a pointer to `char`. The value is converted, **not** the object. The object is still an array and arrays are not modifiable lvalues. As the constraints of the assignment operand require the left operand of the assig... | [
-0.27001988887786865,
-0.16125527024269104,
0.07974808663129807,
-0.22790463268756866,
0.024197135120630264,
0.22830748558044434,
0.3072351813316345,
-0.1328519582748413,
-0.10994315892457962,
-0.39037278294563293,
-0.17790067195892334,
0.5642707943916321,
-0.5063862800598145,
0.1138612553... | |
```
this.update = function() {
if (state == "game") {
if (jaws.pressed("p") && !jaws.paused) {
jaws.paused = true;
setTimeout(function() {
var unpause_interval_id = setInterval(function() {
if (jaws.pressed("p") && jaws.paused) {
jaws.paused = false; | [
0.3125755190849304,
-0.11738817393779755,
0.35830944776535034,
-0.4934244751930237,
0.5846325159072876,
0.20550741255283356,
0.2316698133945465,
-0.09877137094736099,
-0.10845240950584412,
-0.4213833808898926,
-0.217854306101799,
0.8321720361709595,
-0.2743847966194153,
0.5035808682441711,... | |
clearInterval(unpause_interval_id);
}
});
}, 5000);
}
```
That is my attempt at pausing a game I'm working on. Basically, when the player pauses, I set a timeout of 5 seconds to a function that checks if the player wants to unpause.
However, I am not being successful at clearing t... | [
0.043330878019332886,
-0.09772481769323349,
0.5449687242507935,
-0.17136415839195251,
0.47654879093170166,
-0.07450077682733536,
0.35123834013938904,
0.0491066500544548,
-0.14510862529277802,
-0.36323729157447815,
-0.14226186275482178,
0.5892911553382874,
-0.2509273290634155,
0.16062310338... | |
doing wrong?
Thank you!
How about:
```
function p_unp()
{
jaws.paused = !jaws.paused;
}
jaws.on_keypress("p", p_unp);
``` | [
0.1006036177277565,
0.36510831117630005,
0.35100114345550537,
-0.19817852973937988,
0.3269137740135193,
0.22630608081817627,
0.19810302555561066,
-0.03169499710202217,
-0.3169735074043274,
-0.17951051890850067,
-0.07881084829568863,
0.3950885534286499,
-0.44359254837036133,
0.2501763403415... | |
I've got two tables: **products** and **news** - news are about products so news table has row pid (for product id), news have different dates so it can be ordered by date.
And i need a query to show some data from products table joined with ONE and LATEST news title and date attached to it - i am trying to use query ... | [
0.4489857852458954,
0.3516755998134613,
0.5001600384712219,
-0.16475269198417664,
0.2480344921350479,
0.19814079999923706,
-0.42726778984069824,
-0.07299674302339554,
-0.16307333111763,
-0.5982096195220947,
-0.1358301341533661,
0.37135159969329834,
0.13609468936920166,
0.5531520247459412,
... | |
instead of subquery?
You need to include the current directory in the classpath like so:
```
java -cp .:selenium-server-standalone-2.20.0.jar Example
```
Also since you did not actually put the `Example.java` in `org.openqa.selenium.example`, you probably want to delete the `package org.openqa.selenium.example` in t... | [
0.0005130028584972024,
0.012890655547380447,
0.08598901331424713,
-0.09832154959440231,
-0.02551868185400963,
-0.2683338224887848,
0.3064947724342346,
0.039480939507484436,
-0.03715264052152634,
-0.6342864632606506,
-0.04380236566066742,
0.2695145606994629,
-0.35448157787323,
0.27063119411... | |
Up to Android 2.2 I know I can use reflection and terminate the call through getITelephony.
However, as of 2.3 this no longer works because even if you grant the MODIFY\_PHONE\_STATE permission to your app, it's now a system app only permission:
<https://stackoverflow.com/a/5095956/821423>
That said, it's possible s... | [
0.36639171838760376,
-0.005574198439717293,
0.8187039494514465,
-0.14439202845096588,
-0.032691590487957,
0.018514515832066536,
0.4167543947696686,
-0.26239150762557983,
-0.1897387057542801,
-0.5823403000831604,
-0.20186085999011993,
0.8062107563018799,
-0.43306848406791687,
-0.22340624034... | |
much soul-searching I realize something really, really, really dumb. On the plus side no one on StackOverflow seems to have noticed it either. MODIFY\_PHONE\_STATE is no longer working on silenceRinger() since 2.3+, but endCall is just fine.
So the solution is to comment out the call to silenceRinger().
Can't believ... | [
0.3843208849430084,
0.12467468529939651,
0.5788294672966003,
-0.11080214381217957,
-0.15499760210514069,
-0.04861096665263176,
0.6814787983894348,
0.36539727449417114,
-0.2746398150920868,
-0.6187094449996948,
0.15915447473526,
0.6848931908607483,
-0.11445559561252594,
0.41158103942871094,... | |
Is there a way to get the count of different facets in solr?
This is an example facet:
* Camera: 20
* Computer: 80
* Monitor: 40
* Laptop: 120
* Tablet: 30
What I need to get here is "5" as in 5 different electronic items. Of course I can count the facet but some of them have many items inside and fetching and count... | [
0.10157596319913864,
0.20550011098384857,
0.5824601650238037,
0.013768463395535946,
-0.14612147212028503,
0.2353258728981018,
0.40161827206611633,
-0.30864888429641724,
-0.6471563577651978,
-0.6779847145080566,
-0.06840114295482635,
0.46446770429611206,
0.27708935737609863,
0.0595113746821... | |
I have a CSV with one column that I like to save all my hash values on it. I am using nokogiri sax to parse a xml document and then save it to a CSV. I am getting the xml-value like this: `@infodata[:academic] = @content.inspect` The hash have the following keys:
```
@infodata = {}
@infodata[:titles] = Array.new([])
@... | [
0.25443774461746216,
0.37127017974853516,
0.4928114116191864,
0.23697529733181,
-0.0423973985016346,
-0.3099382221698761,
0.06745456904172897,
-0.27150803804397583,
-0.006811072584241629,
-0.6302491426467896,
-0.19027207791805267,
0.4864373505115509,
-0.11749248951673508,
0.268773466348648... | |
output that I get is:
```
"""avancerad"""
"""Ingen examen"""
"""uh"""
"""Arkivvetenskap""""Archival science"""
"""HIA80D"""
"""10.300"""
"""uoh"""
"""Arkivvetenskap rör villkoren för befintliga arkiv och modern arkivbildning med fokus på arkivarieyrkets arbetsuppgifter: bevara, tillgängliggöra och styra information. U... | [
0.04941926896572113,
0.3984231650829315,
0.46123218536376953,
-0.11943162232637405,
-0.4759361147880554,
0.24741704761981964,
0.04118271917104721,
-0.1955089122056961,
-0.14533734321594238,
-0.3687783479690552,
-0.19718554615974426,
0.6218097805976868,
0.17995473742485046,
-0.0908105745911... | |
arkivteori. I kursen ingår praktik, där man under handledning får arbeta med olika arkivarieuppgifter.", "statlig", 60
```
The join method that @joelparkerhenderson talks about just takes the two array value and joins them togheter.
You can use `flatten` to separate and create a new array like this:
```
# Open the... | [
-0.2600354552268982,
0.3376767933368683,
0.45282697677612305,
-0.11721053719520569,
-0.4196358919143677,
0.34597864747047424,
0.32669901847839355,
-0.4665616452693939,
-0.16259926557540894,
-0.44704705476760864,
-0.1398295909166336,
0.34506356716156006,
-0.20001621544361115,
0.023943599313... | |
According to Fowler ([here](http://martinfowler.com/eaaCatalog/repository.html)), a repository "mediates between the domain and data mapping layers, acting like an in-memory domain object collection." So, for example, in my Courier Service application, when a new run is submitted, my application service creates a new R... | [
0.32258325815200806,
0.1354065239429474,
0.16742892563343048,
-0.06824011355638504,
0.1345120370388031,
0.3465358316898346,
0.14724573493003845,
-0.19063769280910492,
-0.24586182832717896,
-0.48201853036880493,
0.07615197449922562,
0.27089959383010864,
-0.2645493447780609,
0.43164604902267... | |
query would not hit the same repository. Instead, it would perhaps go directly against the data store and always be denormalized. And my command side would evolve to a NewRunCommand and Handler that would create and populate a NewRun domain object then persist the information to the data store.
*So the first question ... | [
0.12187865376472473,
-0.05637383088469505,
0.5213207006454468,
0.2856900095939636,
-0.05945378169417381,
0.10124377906322479,
0.09185167402029037,
-0.15996606647968292,
-0.1840008944272995,
-0.6431743502616882,
0.111948162317276,
0.4978097677230835,
-0.1306823194026947,
0.44974395632743835... | |
to build the domain object. For example, the request contains the ID # of the courier assigned to the run. The service must lookup the actual Courier object based on the ID value and assign the object to the NewRun using the AssignCourier method (which validates the courier and performs other business logic).
*The oth... | [
0.2730398178100586,
0.04885371774435043,
0.4301997423171997,
0.24745267629623413,
0.09102693200111389,
0.05161406472325325,
0.3125607371330261,
-0.210970938205719,
-0.1131359338760376,
-0.5991643667221069,
-0.0731506198644638,
0.4933386445045471,
-0.29932937026023865,
0.1335170865058899,
... | |
that are merely facades over the data access and data storage mechanisms. They give the "appearance" of a collection (like Fowler describes) but are not managing the entities in-memory (as Dennis pointed out). This means that every operation on the repository is pass-through, yes?
*How does a Unit of Work fit into thi... | [
0.28622788190841675,
0.18854175508022308,
-0.04697049781680107,
0.1127910390496254,
0.047392040491104126,
0.075360506772995,
0.07632274925708771,
-0.17447109520435333,
-0.3010859489440918,
-0.4026857316493988,
-0.30976593494415283,
0.44951510429382324,
-0.16472768783569336,
0.2622244060039... | |
repository or perhaps a UoW instead of a repository?*
I've read about CQRS systems that maintain a simple key value store on the command side to represent an application's state, and others that merely correlate messages (using some sort of saga) and utilise the query store to represent an applications state instead. E... | [
-0.02618585154414177,
-0.0762343555688858,
-0.0510009340941906,
0.3500276505947113,
-0.21818144619464874,
-0.09506736695766449,
0.145009383559227,
0.15459810197353363,
-0.31374871730804443,
-0.382746160030365,
-0.08365174382925034,
0.34625887870788574,
-0.09082259237766266,
0.3050931990146... | |
that encapsulate and enforce business logic and invariants. In this case the repository pattern is a familiar abstraction that can provide a simpler way of retrieving any of these aggregates.
With regards to the query side I'd recommend getting as close to the data store as possible, by this I mean avoid any repositor... | [
0.017044955864548683,
0.07614253461360931,
0.23025310039520264,
0.24812017381191254,
-0.068241648375988,
-0.12197781354188919,
0.15179917216300964,
-0.33061710000038147,
-0.20702366530895233,
-0.5765300989151001,
-0.4211013615131378,
0.2551652193069458,
-0.1401439905166626,
0.0979767218232... | |
a familiar interface for adding and reading aggregates directly to and from the unit of work.
Some more links that might help:
* [CQRS Examples and Screencasts](https://stackoverflow.com/questions/5043513/cqrs-examples-and-screencasts)
* [Event Sourcing Resources](https://stackoverflow.com/questions/5779351/event-sou... | [
0.0705605298280716,
-0.006411805283278227,
-0.015872007235884666,
0.48590168356895447,
-0.06893844902515411,
-0.09428369998931885,
-0.11873331665992737,
-0.07318937033414841,
-0.539277195930481,
-0.6625248193740845,
0.0597589910030365,
0.3176511824131012,
0.06877079606056213,
-0.1049095839... | |
Now I am doing an Android application. Now I am facing a problem in json parsing.My json page structure is like this.
```
[
{
"id":3,
"name":"dd"
},
{
"id":4,
"name":"ggg"
}
]
```
I tried with the following code.
```
URL website = new URL("url");
InputStream in = website.openStream();
BufferedReader reader ... | [
-0.36264654994010925,
0.24736513197422028,
0.6144107580184937,
-0.2404470294713974,
-0.18093398213386536,
-0.02359982579946518,
0.39063236117362976,
-0.047478318214416504,
-0.25665727257728577,
-0.7173523902893066,
-0.3211517035961151,
0.5521884560585022,
-0.5051189661026001,
0.18648828566... | |
BufferedReader reader = new BufferedReader(new InputStreamReader(json));
StringBuilder sb = new StringBuilder();
String line = reader.readLine();
while (line != null) {
sb.append(line);
line = reader.readLine();
}
reader.close();
JSONArray jsonRepl... | [
-0.5483209490776062,
-0.602921187877655,
1.0217926502227783,
-0.4586726725101471,
-0.10807402431964874,
0.5366629958152771,
0.4571973383426666,
-0.5561656951904297,
-0.21000181138515472,
-0.710540771484375,
-0.6431149840354919,
0.15982365608215332,
-0.553335964679718,
0.14162519574165344,
... | |
System.out.println("length is"+jsonReply.length());
ArrayList<String> id=new ArrayList<String>();
for (int i = 0; i < jsonReply.length(); i++) {
JSONObject jsonMovie = jsonReply.getJSONObject(0);
id.add(jsonMovie.getString("id"));
}
}
``` | [
-0.17783157527446747,
-0.5872272253036499,
0.702610969543457,
-0.4123884439468384,
0.2410767376422882,
0.0837312564253807,
0.32465657591819763,
-0.45553699135780334,
-0.472415953874588,
-0.5194504261016846,
-0.2533010244369507,
0.4349623918533325,
-0.3190429210662842,
0.032291267067193985,... | |
When I have some blocks I want to collapse like that:
```
<region 123>
</region>
```
is there something like that?
have a look at this. it is VS 2010 extension.
<http://visualstudiogallery.msdn.microsoft.com/3c534623-bb05-417f-afc0-c9e26bf0e177> | [
0.22995305061340332,
-0.2595022916793823,
0.5605128407478333,
0.14798587560653687,
-0.1106233224272728,
-0.09815943241119385,
0.4483118951320648,
0.02714022435247898,
-0.5443392395973206,
-0.69211745262146,
-0.18064799904823303,
0.20806923508644104,
-0.1446351557970047,
0.1546480357646942,... | |
I can't start my site on port 80, but only on 3000. Nginx shows standard index page.
Nginx config:
```
http {
passenger_root /home/my_user_name/.rvm/gems/ruby-1.9.3-p125/gems/passenger-3.0.11;
passenger_ruby /home/my_user_name/.rvm/wrappers/ruby-1.9.3-p125/ruby;
include mime.types;
default_type applic... | [
-0.4192640781402588,
0.5630356073379517,
0.6401626467704773,
-0.19374993443489075,
0.09017171710729599,
0.13872015476226807,
0.7574803829193115,
0.04219437018036842,
-0.12048356235027313,
-0.6775807738304138,
-0.25323086977005005,
0.38515183329582214,
0.07105382531881332,
0.545585453510284... | |
address 0.0.0.0:80 is already in use by another process, perhaps another
Phusion Passenger Standalone instance.
If you want to run this Phusion Passenger Standalone instance on another port,
use the -p option, like this:
passenger start -p 81
```
Thanks for any help!
<http://caniuse.com/#feat=css-animation>
IE10... | [
-0.35229358077049255,
-0.1840900480747223,
0.19614973664283752,
0.14335685968399048,
0.19060572981834412,
0.11349638551473618,
0.20276784896850586,
0.26709219813346863,
-0.11138070374727249,
-0.9131876230239868,
-0.3879457414150238,
0.185733824968338,
-0.1988731026649475,
-0.35291871428489... | |
I want to learn how to be able to use the Win32 API, since recently I've got a lot of tasks I need to do which requires functions from `user32.dll`, so I'm trying to learn and I Googled but the thing is: every tutorial there is about it, just tells you how to do a certain thing. like show a `MessageBox` through the Win... | [
0.15321029722690582,
-0.05044509097933769,
0.06928624212741852,
0.20098862051963806,
-0.07666261494159698,
-0.17181727290153503,
0.09014354646205902,
0.1699897199869156,
-0.0194281954318285,
-0.8011008501052856,
-0.03558730334043503,
0.7769553661346436,
-0.13131746649742126,
-0.15078988671... | |
Browser etc. but the Win32 API is so messy (at least from a C# developer standpoint).
The way I've been using it until now is just searching on Google for a task and seeing that it can be done with the Win32 API (I had no idea) and just copy the function and use it (and it's horrible for me, I feel I'm missing a lot o... | [
0.4909172058105469,
0.22881194949150085,
0.14798006415367126,
0.07135403901338577,
-0.024182850494980812,
-0.3720816373825073,
0.42597484588623047,
0.3496014475822449,
-0.1550126075744629,
-0.8668572306632996,
0.10015822947025299,
0.5765022039413452,
-0.16768765449523926,
-0.02049843780696... | |
invest in a book. I did get my answer although.
Thank you all.
From MSDN you can find the WinAPI list:
The following is a list of the reference content for the Windows application programming interface (API).
<http://msdn.microsoft.com/en-us/library/ff818516(v=vs.85).aspx>
You can learn some stuff via Visual Basic ... | [
0.4549403488636017,
0.14814923703670502,
0.031326714903116226,
0.2711625099182129,
-0.034380313009023666,
0.2462834119796753,
0.09927797317504883,
-0.1352967917919159,
0.0019153137691318989,
-0.5658960342407227,
-0.1806853860616684,
0.8418769836425781,
0.06633125245571136,
-0.1345616430044... | |
I am new to html5. I have written a small code that add a rectangle on canvas. When I double click on canvas, some how it is not working can any one guide me where am I doing wrong?
```
<script>
function init() {
var canvas2 = document.getElementById("canvas2");
canvas2.ondblclick = doubleclickhandler;
}
func... | [
0.548738420009613,
-0.1594625860452652,
0.8726003766059875,
-0.2963202893733978,
-0.03227732330560684,
-0.01305110938847065,
0.5882875323295593,
-0.4306541085243225,
-0.17857763171195984,
-0.9416552186012268,
-0.08060788363218307,
0.259537011384964,
-0.32319819927215576,
0.0133974896743893... | |
height:150px;
margin:10px;
border:1px solid #aaaaaa;
}
</style>
<body onLoad="init()">
<div id= "div2">
<canvas id="canvas2" width="100" height="150" ></canvas>
</div>
</body>
```
based on your table info :
```
while ($row = mysql_fetch_assoc($query)){
mysql_query("insert into aanwezigheid set... | [
-0.03875800967216492,
-0.1724194437265396,
0.9783218502998352,
-0.07997875660657883,
-0.23509952425956726,
0.2400658130645752,
-0.026582006365060806,
-0.6156343817710876,
-0.2921597361564636,
-0.7529691457748413,
-0.13585633039474487,
0.33301201462745667,
0.016531258821487427,
0.0007593503... | |
been having this problem for a while! anyway i have downloaded Maxminds GEOIP php module and uploaded it to my server then I put this section of code into my index.php page
```
<?php
require_once("geoip/geoip.inc");
$gi = geoip_open("geoip/GeoIP.dat",GEOIP_STANDARD);
$country = geoip_country_code_by_addr($gi, $_SERVER... | [
-0.027255184948444366,
0.22849485278129578,
1.2679932117462158,
0.12376129627227783,
0.15966464579105377,
-0.08607654273509979,
0.19259941577911377,
0.047188326716423035,
-0.5902702212333679,
-0.5432964563369751,
-0.504203736782074,
0.10823935270309448,
-0.47231292724609375,
0.200851619243... | |
loop
```
The web page at https://www.website.com/index.php has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.
```
same as in firefox! Anyone got any Idea... | [
0.20696158707141876,
0.3198024332523346,
0.5060897469520569,
0.013001305982470512,
0.12055322527885437,
-0.1194436177611351,
0.7072347402572632,
-0.16913752257823944,
-0.2807554304599762,
-0.4038757085800171,
-0.6392914056777954,
-0.08135775476694107,
-0.6996052861213684,
0.172588437795639... | |
Of World
RewriteEngine on
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^AD$
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^AE$
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^AF$
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^AG$
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^AI$
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^AL$
RewriteRule ^(.*)$ https://www.Websi... | [
0.012451538816094398,
0.3626488447189331,
0.6731661558151245,
0.05277519300580025,
-0.056517913937568665,
0.2615778148174286,
0.4989263713359833,
-0.14708340167999268,
-0.20434731245040894,
-0.8366931080818176,
-0.15775462985038757,
0.4464512765407562,
-0.4056216776371002,
0.11881402134895... | |
only to find it will not work! many thanks again!
-Phillip
Check this [post](http://www.webupd8.org/2009/12/key-mon-displays-keyboard-and-mouse.html) about the *key-mon* tool.
<http://www.webupd8.org/2009/12/key-mon-displays-keyboard-and-mouse.html>
As far as I know there is also a CLI command to check the status in... | [
0.4460866153240204,
-0.08772452920675278,
0.3059810996055603,
0.11264606565237045,
0.20816172659397125,
-0.12333548069000244,
0.5680660605430603,
-0.008517158217728138,
-0.3088056445121765,
-0.23884908854961395,
-0.04407576844096184,
0.9906339645385742,
-0.07653940469026566,
0.036507058888... | |
I am reading data from XML file using from..select linq query, the data is huge. the biggest set of data I can read is 1100 lines, each line consists of 100s of characters. This causes my phone to hang and application crashes. On Emulator, it works fine,although it takes considerable amount of time to load.
Now what I... | [
0.04868943616747856,
0.15860320627689362,
0.6561282277107239,
0.059663861989974976,
0.09078480303287506,
0.08980387449264526,
0.201438307762146,
-0.3022536635398865,
-0.0323779471218586,
-0.6661123037338257,
0.021137479692697525,
0.364828497171402,
-0.13180503249168396,
0.07419818639755249... | |
select new dictChapter{
Name = r.Attribute("Name").Value,
Desc1 = r.Attribute("Description1").Value,
Desc2 = r.Attribute("Description2").Value,
Desc3 = r.Attribute("Description3").Value | [
-0.19740939140319824,
-0.3199126124382019,
0.41307398676872253,
0.014948556199669838,
-0.05804697796702385,
0.26798343658447266,
0.3118881583213806,
-0.5996851921081543,
0.130219504237175,
-0.8471387624740601,
-0.30771273374557495,
0.6509867906570435,
-0.31331726908683777,
0.41898646950721... | |
};
ListBox.DataContext = dataSet;
```
But I want to select the Descriptions based on the settings. I want something like (I know it doesn't work, but I want explain what I want to do)
```
var dataSet = from r in something.Elements("chapter")
select new dictChapter{
Name = r.Attribu... | [
-0.10793084651231766,
-0.037579018622636795,
0.3538540303707123,
-0.18057756125926971,
0.27654799818992615,
-0.049013178795576096,
0.4445514380931854,
-0.5643795132637024,
0.09619023650884628,
-0.5074988603591919,
-0.39911776781082153,
0.7014955878257751,
-0.37008076906204224,
0.0968256145... | |
Desc1 = r.Attribute("Description1").Value,
if (ShowDesc2 == true)
Desc2 = r.Attribute("Description2").Value,
if (ShowDesc3 == true) | [
0.02477916143834591,
-0.07201498746871948,
0.09685271233320236,
0.10174678266048431,
-0.19580794870853424,
-0.002478735987097025,
0.4485357105731964,
-0.6155086755752563,
-0.15525947511196136,
-0.6331924200057983,
-0.33609405159950256,
0.7701885104179382,
-0.163657084107399,
0.383524000644... | |
Desc3 = r.Attribute("Description3").Value
};
ListBox.DataContext = dataSet;
```
1. How can I achieve this in C Sharp?
2. Is there any better solution to my problem?
Thanks very much
Check this [post](http://www.webupd8.org/2009/12/key-mon-displays-keyboard-and-mouse.html) about the *key-mon* tool.
<h... | [
0.024673685431480408,
-0.001600588788278401,
0.4321786165237427,
-0.022381789982318878,
-0.07508651912212372,
-0.15435926616191864,
0.6438277959823608,
-0.3204730451107025,
-0.27594947814941406,
-0.8182388544082642,
-0.044495999813079834,
1.1751630306243896,
-0.000054593900131294504,
0.069... | |
I am looking to enumerate a random permutation of the numbers 1..N in fixed space. This means that I cannot store all numbers in a list. The reason for that is that N can be very large, more than available memory. I still want to be able to walk through such a permutation of numbers one at a time, visiting each number ... | [
0.5229041576385498,
0.08973446488380432,
0.0011908755404874682,
0.008253186009824276,
-0.22115826606750488,
0.1480727642774582,
0.24285417795181274,
-0.0600397102534771,
-0.5564565658569336,
-0.603425920009613,
0.161529541015625,
0.12318077683448792,
-0.31058910489082336,
0.453122735023498... | |
of the numbers 0..(2^32)-1. Every number exactly once.
I want to get to pick N to be any number at all and not be constrained to powers of 2 for example. Is there an algorithm for this?
The easiest way is probably to just create a full-range PRNG for a larger range than you care about, and when it generates a number l... | [
0.13303136825561523,
-0.1354948878288269,
0.1753433495759964,
-0.02278827875852585,
-0.09850463271141052,
0.2860061228275299,
-0.09502290934324265,
-0.2820286452770233,
-0.4302455186843872,
-0.4771406948566437,
0.06274070590734482,
0.3928060829639435,
-0.401606023311615,
0.1627779901027679... | |
This has a couple of advantages: first of all, an LFSR is probably a bit faster than most PRNGs. Second, it is (I believe) a bit easier to engineer an LFSR that produces numbers close to the range you want, and still be sure it cycles through the numbers in its range in (pseudo)random order, without any repetitions.
W... | [
0.14945001900196075,
-0.3049065172672272,
0.36408451199531555,
-0.057964883744716644,
-0.050192590802907944,
-0.07817357778549194,
0.04789123311638832,
-0.43432140350341797,
-0.3179355561733246,
-0.659308910369873,
0.1037319228053093,
0.45615512132644653,
-0.2625963091850281,
-0.1674422770... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.