text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
false)]
public virtual DateTime SavedAt { get; set; }
```
And finally:
```
@Html.EditorFor(x => x.SavedAt)
``` | [
0.20248983800411224,
-0.2855982780456543,
0.675171971321106,
-0.16502772271633148,
0.4087693393230438,
-0.04919315502047539,
0.3001924753189087,
0.06016986444592476,
-0.13391004502773285,
-0.3858632743358612,
-0.2582644820213318,
0.632558286190033,
-0.3404630422592163,
0.14917027950286865,... | |
I have this image:

What I want to do is turn it into a slider for iPhone users to move their finger side to side and change the channel.
Would a slider do this? I understand the slider knob moving but not the other way around.
If you prefer JQuery Ui, you will also ne... | [
-0.08039908856153488,
-0.1382693350315094,
0.8651553988456726,
-0.07125508040189743,
-0.15329565107822418,
0.07811679691076279,
-0.052655331790447235,
-0.3285585641860962,
-0.19677115976810455,
-0.5342500805854797,
0.17902478575706482,
0.7439599633216858,
-0.016333051025867462,
0.093607753... | |
I have the following code:
```
import libxml2
import sys
def xpath_grep(query, file):
doc = libxml2.parseDoc(file)
for matched_region in doc.xpathEval(query):
matched_region.saveTo(sys.stdout, format = True) # add match to stdout
if __name__ == '__main__':
if len(sys.argv) <= 1:
# default... | [
-0.10255098342895508,
0.14578412473201752,
0.6452537775039673,
-0.2761651873588562,
0.05880887061357498,
0.08359671384096146,
0.06944955140352249,
-0.4597413241863251,
0.13905295729637146,
-0.7889987230300903,
0.04997417703270912,
0.46647927165031433,
-0.3940812051296234,
0.234543606638908... | |
= sys.argv[2:]
for xml_file in files:
xpath_grep(query, file(xml_file).read())
```
While I believe the "data" function should retrieve the value of the XML attribute, it does not. Instead, it gives me an error:
```
xmlXPathCompOpEval: function data not found
Unregistered function
...
libxml2.xpathError... | [
0.26669543981552124,
0.32030540704727173,
0.26197803020477295,
-0.1259888857603073,
0.04311560466885567,
0.05048248544335365,
0.587811291217804,
-0.25857266783714294,
-0.15177610516548157,
-0.2479933351278305,
0.028943493962287903,
0.7304543256759644,
-0.386692613363266,
-0.005087604280561... | |
value of the `name` attribute:
```
>>> doc = libxml2.parseDoc(open('input.xml').read())
>>> str(doc.xpathEval('//person/@name')[0].children)
'bob'
```
I've never used the `libxml2` module before so there may be a better way of doing it. I always use the `lxml` `etree` module, using which we could accomplish the same... | [
0.04096420109272003,
0.2098623514175415,
0.36348944902420044,
-0.19875192642211914,
-0.09950419515371323,
-0.051934614777565,
0.10856886953115463,
-0.253184050321579,
-0.010362446308135986,
-0.4343443512916565,
-0.18294166028499603,
0.6981958746910095,
-0.34567952156066895,
0.1405810713768... | |
How can i bind a expressjs server to a specific IP
Something like
```
app.listen(8888, '192.168.0.101');
```
Equivalent to nodejs:
```
http.createServer(onRequest).listen(8888,'192.168.0.101');
```
ExpressJS just [passes your parameters down](https://github.com/strongloop/express/blob/531f024e486c13eb6d7e2bc0966e... | [
-0.06189985200762749,
-0.09412430971860886,
0.5160311460494995,
-0.08503847569227219,
-0.143932044506073,
-0.2973078489303589,
0.7015090584754944,
-0.3503435552120209,
-0.08988569676876068,
-0.8391311764717102,
-0.1267428696155548,
0.3893252909183502,
-0.5301186442375183,
-0.13385888934135... | |
Can anyone assist me?
I'm making a game on XNA.
I have a GameObject class that acts as a base class for `Character.class` or `Object.class`
There's also `Game.class`
I just wanted to ask, I have a subclass of `GameObject` which has a public variable called `canJump`.
For some reason I can't even access the variabl... | [
0.32172197103500366,
-0.0033628016244620085,
-0.01664009876549244,
0.31813231110572815,
0.1904742568731308,
-0.21776948869228363,
0.13833554089069366,
0.19072464108467102,
-0.05066994950175285,
-0.8879753351211548,
0.08383065462112427,
0.573223352432251,
-0.27031391859054565,
0.24257495999... | |
32-bit version instead of 64. Try to use another JRE version (not 6.0\_27-b07). | [
-0.21975445747375488,
-0.20707184076309204,
0.1966656595468521,
-0.01917465776205063,
0.27240774035453796,
-0.033020079135894775,
0.4918760061264038,
0.07822799682617188,
-0.09796518087387085,
-0.5982147455215454,
-0.2853143811225891,
0.5685871839523315,
-0.6370940804481506,
-0.21249599754... | |
How do i do that?
Actually my main goal is to get which checkbox in the `QTreeWidget` is checked. But this I can do if you guys help me out with that one.
Well, I cannot find a method that gives me the `QList<QTreeWidgetItem *>` again so I could go all over the list and check if the checkboxes are checked(weird sentenc... | [
0.4053577184677124,
-0.08115706592798233,
0.13353082537651062,
0.3325120210647583,
-0.1881636530160904,
-0.15922965109348297,
0.3922625184059143,
0.08047030121088028,
-0.1298885941505432,
-0.6202638745307922,
0.1437067836523056,
0.27550771832466125,
-0.16564372181892395,
0.1397119164466858... | |
being able to do whatever I want with the items of it.
Thanks in advance.
Since you're dealing with a tree, the API is designed to give you access to the `QTreeWidgetItem`s in a tree-structure. Thus there is no direct way to simply get access to every single `QTreeWidgetItem` directly through Qt's API. There are, howe... | [
-0.04193304106593132,
-0.27215293049812317,
0.34035515785217285,
0.3143700063228607,
-0.03304453566670418,
-0.19433918595314026,
0.3291908800601959,
-0.3732748329639435,
-0.17828042805194855,
-0.5863557457923889,
-0.3508561849594116,
0.5304310321807861,
-0.15183041989803314,
0.006500092800... | |
// Do something with item ...
}
```
2) If you need to access every item in the tree, along with that item's children, then a recursive approach may be in order:
```
doStuffWithEveryItemInMyTree( tree->invisibleRootItem() );
void doStuffWithEveryItemInMyTree( QTreeWidgetItem *item )
{
// Do something with item .... | [
-0.1732349544763565,
-0.056184664368629456,
0.15699221193790436,
-0.0859653502702713,
0.24847333133220673,
0.18963246047496796,
0.5882715582847595,
-0.44024723768234253,
-0.21956022083759308,
-0.5788671970367432,
-0.33290281891822815,
0.3833919167518616,
-0.23542897403240204,
0.07063494622... | |
I'd like to do something like this
```
String.concat '\n' [str1; str2 ... strn]
```
so I can print in a file. But ocaml doesn't allow me to do that. What can I do?
```
String.concat "\n" [str1; str2 ... strn]
```
works fine. The problem is that you used `'\n'`, which is a character literal, not a string. Example:
... | [
0.09537877887487411,
0.346063494682312,
0.13580575585365295,
-0.204551562666893,
0.12865079939365387,
-0.05367619916796684,
0.331368625164032,
-0.036872316151857376,
-0.02496035397052765,
-0.5377033352851868,
-0.046669524163007736,
0.45647844672203064,
-0.5566200613975525,
0.10363242775201... | |
I have the following scope, which I know is not optimal:
```
scope :event_stream_for, lambda{ |user|
where("target_id in (?) and target_type = ?", user.events.collect(&:id), "Event")
}
```
This creates 3 queries. How can I optimize it?
Alternatively, how do I put the whole sql statement in lambda of the scope, li... | [
0.06102391704916954,
0.11382690817117691,
0.39341264963150024,
-0.001876943395473063,
0.09300494939088821,
-0.16428610682487488,
0.2601938545703888,
-0.29139891266822815,
-0.052246131002902985,
-0.6456937789916992,
0.08167294412851334,
0.6414969563484192,
-0.49573832750320435,
0.1961579769... | |
one query. Haven't tested my code with your table, but it should work similarly.
----------------------- based on your edited question -------------------
SELECT \* FROM activities WHERE target\_type =='Event' AND target\_id IN (SELECT DISTINCT id FROM events WHERE (host\_id == user.id OR invitee\_id == user.id))
It... | [
-0.11288126558065414,
-0.40899068117141724,
0.44733402132987976,
0.06275033205747604,
-0.15458931028842926,
-0.21732480823993683,
0.09496800601482391,
-0.09564072638750076,
-0.31697580218315125,
-0.993329644203186,
-0.03348546102643013,
0.6720346212387085,
-0.31555503606796265,
0.042803652... | |
Can anyone suggest a way to modify JSONParser's getQuestionJSONFromUrl() method so that it stores each question as its own object in Android? Reading multiple results via PHP JSON return from a SQL table that looks like this in a browser:
```
{"category":"elections","id":"0","title":"Who will you vote for in November'... | [
0.029275864362716675,
0.10349664092063904,
0.5351330637931824,
0.33780017495155334,
-0.337818443775177,
0.27548956871032715,
0.04924977570772171,
-0.2823699712753296,
-0.23415768146514893,
0.0012943240581080317,
0.06122922524809837,
0.020471341907978058,
-0.20685887336730957,
-0.1716093719... | |
now. Eventually there'll be real content in that SQL table.
I want to be able to break these rows down into objects (probably to my local SQLite db I suppose?) so that I can use them to display each as a tablerow on the screen in a fragment. I'm not too worried about the screen aspect, but getting the data to workabl... | [
0.11216424405574799,
0.16078408062458038,
0.35488495230674744,
-0.07512529194355011,
-0.017262356355786324,
-0.015340139158070087,
0.3739858567714691,
-0.12090463936328888,
-0.3282298743724823,
-0.7949656844139099,
-0.23801280558109283,
0.43149858713150024,
-0.29432743787765503,
-0.0834915... | |
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("tag", question_tag));
params.add(new BasicNameValuePair("category", category));
JSONObject json = jsonParser.getQuestionJSONFromUrl(questionURL, params);
return json;
}
public class JSONParser {
static ... | [
-0.3414531648159027,
-0.21234841644763947,
0.4255368113517761,
-0.22303855419158936,
-0.2550934851169586,
0.31067678332328796,
0.4557609260082245,
-0.8265571594238281,
-0.47206804156303406,
-0.2366991639137268,
-0.7110567092895508,
0.6276781558990479,
-0.4875431954860687,
-0.14063410460948... | |
Making HTTP request
try {
// defaultHttpClient
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(url);
httpPost.setEntity(new UrlEncodedFormEntity(params));
HttpResponse httpResponse = httpClient.execute(httpPost);
... | [
-0.062152571976184845,
-0.3750968277454376,
0.6959877014160156,
-0.1681593507528305,
-0.1634809374809265,
-0.01157310139387846,
0.6755034923553467,
-0.5175763964653015,
0.03809008374810219,
-0.7063390016555786,
-0.7060308456420898,
0.34685903787612915,
-0.4570562243461609,
0.06145742535591... | |
is = httpEntity.getContent();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
try { | [
-0.20722919702529907,
-0.6130561232566833,
0.4016707241535187,
-0.17363107204437256,
0.31824973225593567,
0.0005855397903360426,
0.4034654200077057,
-0.2709670960903168,
-0.022273827344179153,
-0.6219260096549988,
-0.28671324253082275,
0.42403459548950195,
-0.5187025666236877,
-0.077478691... | |
BufferedReader reader = new BufferedReader(new InputStreamReader(
is, "iso-8859-1"), 8);
StringBuilder sb = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null) { | [
-0.3713257312774658,
-0.41005632281303406,
0.739391565322876,
-0.30118808150291443,
-0.05173509940505028,
0.45576801896095276,
0.4169604182243347,
-0.45065197348594666,
-0.12666833400726318,
-0.6172309517860413,
-0.4619944393634796,
0.1643936038017273,
-0.5247054100036621,
0.28044635057449... | |
Log.v("while", line);
sb.append(line + "\n");
//Log.v("err", line);
}
is.close();
json = sb.toString();
} catch (Exception e) { | [
0.022170957177877426,
-0.2694113850593567,
0.5398818850517273,
-0.6089975833892822,
0.16614046692848206,
0.11988241225481033,
0.6403645277023315,
-0.5245808362960815,
-0.20861653983592987,
-0.2356971949338913,
-0.5550746917724609,
0.2648557126522064,
-0.5019680261611938,
-0.038088042289018... | |
Log.e("Buffer Error", "Error converting result " + e.toString());
}
// try parse the string to a JSON object
try {
jObj = new JSONObject(json);
} catch (JSONException e) {
Log.e("JSON Parser", "Error parsing data " + e.toString());
} | [
-0.13390538096427917,
-0.2994787096977234,
0.05188751220703125,
-0.2851731777191162,
0.1959816962480545,
0.1789543628692627,
0.30428993701934814,
-0.13095241785049438,
-0.05746835097670555,
-0.2807523310184479,
-0.4885977804660797,
0.4993020296096802,
-0.6989082098007202,
-0.26021558046340... | |
// return JSON String
return jObj;
}
```
Can anyone suggest a way to modify JSONParser's getQuestionJSONFromUrl() method so that it stores each question as its own object in Android? I do have a local SQLite DB in which I could add a method or two to add a second table etc:
```
package library;
import ... | [
0.08994307368993759,
0.1694788783788681,
0.4617992341518402,
-0.11884276568889618,
-0.09931649267673492,
0.1418451964855194,
0.49863702058792114,
-0.43667465448379517,
0.024698903784155846,
-0.721615195274353,
-0.3278006911277771,
0.5990721583366394,
-0.685513973236084,
-0.0551528185606002... | |
// Database Name
private static final String DATABASE_NAME = "android_api";
// Login table name
private static final String TABLE_LOGIN = "login";
// Login Table Columns names
private static final String KEY_ID = "id";
private static final String KEY_NAME = "name";
public static final Stri... | [
-0.07805319875478745,
0.06803635507822037,
0.5408278703689575,
-0.15762066841125488,
0.13461197912693024,
0.6154009699821472,
0.11571475863456726,
-0.11003196984529495,
-0.1445184051990509,
-0.4455605447292328,
-0.5571615695953369,
0.6767874360084534,
-0.331956684589386,
0.5419507622718811... | |
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
// Creating Tables
@Override
public void onCreate(SQLiteDatabase db) {
String CREATE_LOGIN_TABLE = "CREATE TABLE " + TABLE_LOGIN + "("
+ KEY_ID + " INTEGER PRIMARY KEY,"
+ KEY_NAME + " TEXT," | [
0.16903170943260193,
-0.02452743798494339,
0.538228452205658,
-0.18507999181747437,
0.09127980470657349,
0.015858270227909088,
0.3104185461997986,
-0.27760621905326843,
-0.11986438930034637,
-0.5306572914123535,
-0.3004033863544464,
0.3233795166015625,
-0.6427859663963318,
0.31852215528488... | |
+ KEY_EMAIL + " TEXT UNIQUE,"
+ KEY_UID + " TEXT,"
+ KEY_CREATED_AT + " TEXT" + ")";
db.execSQL(CREATE_LOGIN_TABLE);
}
// Upgrading database
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
// Drop older table if existe... | [
-0.07016657292842865,
0.04066804051399231,
0.4368205964565277,
-0.10592453926801682,
0.1602630615234375,
0.19708934426307678,
0.2607675790786743,
-0.2522696256637573,
0.06379643082618713,
-0.6986619830131531,
-0.2230081409215927,
0.5068514347076416,
-0.3575800061225891,
0.5752707719802856,... | |
db.execSQL("DROP TABLE IF EXISTS " + TABLE_LOGIN);
// Create tables again
onCreate(db);
}
/**
* Storing user details in database
* */
public void addUser(String name, String email, String uid, String created_at) {
SQLiteDatabase db = this.getWritableDatabase();
C... | [
0.31020259857177734,
0.018229391425848007,
0.5536634922027588,
-0.286265105009079,
-0.2991984188556671,
-0.14072109758853912,
0.49935704469680786,
-0.29550063610076904,
0.3111051917076111,
-0.8711552023887634,
-0.08700931072235107,
0.2464548647403717,
-0.4803796112537384,
0.445717483758926... | |
// Name
values.put(KEY_EMAIL, email); // Email
values.put(KEY_UID, uid); // Email
values.put(KEY_CREATED_AT, created_at); // Created At
// Inserting Row
db.insert(TABLE_LOGIN, null, values);
db.close(); // Closing database connection
}
/**
* Getting user da... | [
-0.1548910140991211,
0.019999992102384567,
0.4884212017059326,
-0.34359556436538696,
0.16735617816448212,
0.0908031016588211,
0.3020489811897278,
-0.4425713121891022,
-0.04830295965075493,
-0.7150312066078186,
-0.13774201273918152,
0.31363004446029663,
-0.43615806102752686,
0.3954476416110... | |
HashMap<String,String> user = new HashMap<String,String>();
String selectQuery = "SELECT * FROM " + TABLE_LOGIN;
SQLiteDatabase db = this.getReadableDatabase();
Cursor cursor = db.rawQuery(selectQuery, null);
// Move to first row
cursor.moveToFirst();
if(cursor.getCount... | [
-0.4476414918899536,
-0.1694071888923645,
0.5515276193618774,
-0.5683742761611938,
-0.07915015518665314,
0.23007424175739288,
0.040521491318941116,
-0.35588860511779785,
0.08968833088874817,
-0.7177832722663879,
-0.26920557022094727,
0.3090161681175232,
-0.31751397252082825,
0.221990600228... | |
user.put("email", cursor.getString(2));
user.put("uid", cursor.getString(3));
user.put("created_at", cursor.getString(4));
}
cursor.close();
db.close();
// return user
return user;
}
/**
* Getting user login status
* return true | [
-0.029072480276226997,
0.09624136984348297,
0.2476116269826889,
-0.4373462200164795,
-0.09467950463294983,
0.1771513968706131,
0.5222766995429993,
-0.3084700107574463,
0.12949976325035095,
-0.9470282196998596,
-0.5224271416664124,
0.4417937397956848,
-0.4579800069332123,
0.3758100867271423... | |
if rows are there in table
* */
public int getRowCount() {
String countQuery = "SELECT * FROM " + TABLE_LOGIN;
SQLiteDatabase db = this.getReadableDatabase();
Cursor cursor = db.rawQuery(countQuery, null);
int rowCount = cursor.getCount();
db.close();
cursor.clo... | [
-0.30036571621894836,
-0.013034186325967312,
0.6120225191116333,
-0.3511230945587158,
-0.04001826047897339,
0.16578245162963867,
0.18774595856666565,
-0.4570056200027466,
0.08630158752202988,
-0.44426873326301575,
-0.2542189955711365,
0.40190714597702026,
-0.3803546726703644,
0.18576112389... | |
return rowCount;
}
/**
* Re crate database
* Delete all tables and create them again
* */
public void resetTables(){
SQLiteDatabase db = this.getWritableDatabase();
// Delete All Rows
db.delete(TABLE_LOGIN, null, null);
db.close();
}
}
```
Here is the so... | [
-0.023711148649454117,
0.18434949219226837,
0.4670265316963196,
-0.3089195787906647,
-0.14636918902397156,
0.011829104274511337,
0.4985591173171997,
-0.39688220620155334,
-0.05397148057818413,
-0.560096025466919,
-0.034644514322280884,
0.5718099474906921,
-0.35990315675735474,
0.1148080080... | |
encoded JSON data. I am currently still working on how to get Android to parse it out into a JSONArray: <https://stackoverflow.com/a/10019165/1231943> | [
-0.14311429858207703,
-0.0631556510925293,
0.013184390030801296,
-0.0365816131234169,
-0.07136698812246323,
0.323855459690094,
0.08207118511199951,
-0.12425187230110168,
-0.30590730905532837,
-0.7354824542999268,
-0.21349160373210907,
0.32647550106048584,
-0.373503714799881,
-0.27332508563... | |
I'm trying to use Google's SDK Tutorial for Android using Eclipse. I was able to get the first two projects to work, but when running the third R.java disappeared so I gave up on that.
I made a brand new package out of the solution set for exercise 3. It was full of errors, like files being in src/com/android... inste... | [
0.3115396201610565,
0.232213094830513,
0.21777494251728058,
-0.09936530143022537,
-0.07888137549161911,
0.0808558240532875,
0.5200773477554321,
-0.19950224459171295,
-0.06213555485010147,
-0.7366073727607727,
0.21689951419830322,
0.5554536581039429,
-0.30565717816352844,
-0.049951881170272... | |
am I doing wrong? How can I import this project properly?
Please check your `Window>Preference>Android>sdk` location --- is set to be the path of android sdk and if it not works then please go with new eclipse software delete previous check jdk is install and after that set correct android sdk location to above path.
... | [
0.3640293776988983,
0.22564518451690674,
0.1788034290075302,
0.22161360085010529,
-0.13885922729969025,
-0.19607055187225342,
0.49818870425224304,
-0.2288353145122528,
0.0699819028377533,
-0.6674874424934387,
-0.07428915053606033,
0.7019749879837036,
-0.1687246859073639,
-0.099713847041130... | |
I would like to look up the database table for people whose registered date equals 4-22.
My sql would look something similar like this
```
function GetUsers($dreg)
{
$dt=(new DateTime($dreg))->format('Y-m-d');
$result=$this->query("SELECT * FROM tablex WHERE dreg='$dt'");
return ($this->getNumRows()>0)?$r... | [
0.27413854002952576,
0.12947139143943787,
0.6811577081680298,
-0.10569325089454651,
-0.07858316600322723,
0.13981857895851135,
0.16212841868400574,
-0.26208946108818054,
-0.23011521995067596,
-0.578153669834137,
-0.08104551583528519,
0.3953086733818054,
-0.13193628191947937,
0.313975065946... | |
I have an array of buttons that contain the id's of the buttons. I am then looping through them and adding a click listener. Seems I should be able to do this without the for loop using `.each()`or something, but I could not get it to work with `.each()`
```
var settingScreenButtons = ["btn_1","btn_2","btn_3","btn_4"]... | [
0.26008981466293335,
-0.029179470613598824,
0.6295896768569946,
-0.27293485403060913,
-0.002318032318726182,
0.144774928689003,
0.30394747853279114,
-0.662717342376709,
-0.13155224919319153,
-0.601878821849823,
0.008447728119790554,
0.5419363379478455,
-0.4855932891368866,
0.02167871221899... | |
#btn_2, #btn_3, #btn_4").click(function() {
alert(this.id);
});
```
Although it's better if you have less event listeners. Say your HTML looked like this:
```
<div id="container">
<a href="#" id="btn_1" class="btn">Button 1</a>
<a href="#" id="btn_2" class="btn">Button 2</a>
<a href="#" id="btn_3" cl... | [
0.3198682963848114,
-0.20021216571331024,
0.39158308506011963,
-0.2966831922531128,
-0.23994435369968414,
0.09133898466825485,
0.5098583698272705,
-0.37438952922821045,
-0.2633473575115204,
-0.6216662526130676,
-0.5236181616783142,
0.7221719622612,
-0.40278002619743347,
-0.1637666076421737... | |
alert(this.id);
});
});
``` | [
0.23119649291038513,
-0.1474420726299286,
0.47708821296691895,
-0.4146181344985962,
0.47017937898635864,
-0.4927791953086853,
0.44676515460014343,
0.02839534357190132,
-0.0374789834022522,
-0.521332323551178,
-0.7471453547477722,
0.8361896872520447,
-0.6724622845649719,
0.1768805831670761,... | |
I've faced a problem that can not solve by myself, thus, I'm asking for your help. The problem is following:
We have to upgrade persistence layer. Previously project used JDBC to access data, but now it should use JPA. It means that now data is retrieved in new objects, but system works with old ones. Thus, we should w... | [
0.026051077991724014,
0.31686335802078247,
0.20694862306118011,
0.22615467011928558,
0.13426831364631653,
-0.14992478489875793,
0.30726534128189087,
-0.09095322340726852,
-0.271038681268692,
-0.8910407423973083,
0.11740241199731827,
0.7365325093269348,
-0.11585677415132523,
0.5214770436286... | |
foreign key
private int otherEntityId;
...
}
class NewEntity{
private int id;
// new entity contains object that associated with foreign key
private OtherEntity otherEntity;
...
}
```
We want to add some general interface to all converters, but if we convert from old entity to new one, firstl... | [
-0.2590251564979553,
-0.1683574914932251,
0.3954976797103882,
0.005415984429419041,
0.2941458821296692,
-0.28770896792411804,
-0.05897791311144829,
-0.1360594630241394,
-0.05638688802719116,
-0.37493789196014404,
-0.18386007845401764,
0.4180793762207031,
-0.3337100148200989,
0.410475581884... | |
is there any good architecture solution for such problem?
You can select multiple elements in one jQuery object and bind to them all at once:
```
$("#btn_1, #btn_2, #btn_3, #btn_4").click(function() {
alert(this.id);
});
```
Although it's better if you have less event listeners. Say your HTML looked like this:
... | [
-0.1775367110967636,
-0.13930709660053253,
0.20844300091266632,
-0.011911250650882721,
-0.39087286591529846,
0.12721402943134308,
0.26290127635002136,
-0.3228076696395874,
-0.31718480587005615,
-0.773923933506012,
-0.26875990629196167,
0.36897358298301697,
-0.31868311762809753,
0.034068834... | |
that form in your question, you *can* use `each`, but it must be [`$.each`](http://api.jquery.com/jQuery.each):
```
$.each(settingScreenButtons, function(index, id) {
$('#' + id).click(function() {
alert(this.id);
});
});
``` | [
0.4612886309623718,
0.008926884271204472,
0.7286137938499451,
-0.28879523277282715,
0.08075982332229614,
0.11849267035722733,
0.08988813310861588,
-0.1548917591571808,
-0.11314356327056885,
-0.5324247479438782,
-0.36201784014701843,
0.5883967280387878,
-0.4339681565761566,
-0.0353377498686... | |
I'm trying to write function to do the `number_format()` job for the non-ascii numbers , specifically perso-arabic numbers.
First i have to exchange the numbers which leaves me with a string of non-ascii characters:
```
$n = 133;
$n = exchange($n);
echo $n ;
//result : ١٣٣
```
The problem is when I add the commas t... | [
-0.017595507204532623,
0.3750872015953064,
0.3121536672115326,
-0.3825327754020691,
-0.22726768255233765,
0.2941991686820984,
0.0674331784248352,
-0.33430925011634827,
-0.04057996720075607,
-0.40653422474861145,
-0.23239848017692566,
0.38492199778556824,
-0.5742517709732056,
0.071124814450... | |
for($i ; $i >= 0 ; $i--){
$c++;
if($c == 1 )
$y =mb_substr($number, $i, 1);
else
$y .= mb_substr($number, $i, 1);
if($c%3 == 0 && $i != 0 )
$y .=',';
}
$y = strrev($y);
return $y;
}
```
And this is the result for `$n = ١٣٣`:
٣,٣�,�١
you can create the arraylist as
``... | [
0.037959177047014236,
-0.0327465683221817,
0.5628218054771423,
-0.43078747391700745,
0.0019966564141213894,
0.12131089717149734,
0.3082520067691803,
-0.4475463032722473,
-0.20368242263793945,
-0.2501392066478729,
-0.3256106972694397,
0.6414872407913208,
-0.43521958589553833,
0.137144938111... | |
[jsFiddle](http://jsfiddle.net/v9PhM/) of the problem here. When I have an image with `align="left"` inside a collapsible div, it doesn't size correctly, and overflows the div.
Is there a different way I should be doing this? If not, how can I workaround this? Is it a bug?
Screenshot:
![enter image description here]... | [
-0.07636480033397675,
-0.03200047090649605,
0.6390233039855957,
-0.32294294238090515,
-0.1045101061463356,
-0.1714283525943756,
0.2784866392612457,
-0.2813689708709717,
-0.33149558305740356,
-0.7066989541053772,
-0.20254024863243103,
0.31208139657974243,
-0.40709638595581055,
-0.0247623603... | |
I have a database based around a library system and I am trying to enhance my knowledge of MYSQL querys.
I want to try and list the names of borrowers that have borrowed all of the book titles in the database.
The request that I need to strip down is
```
SELECT b.BorName
FROM Borrower b
JOIN Loan l ON l.BorId = b.Bor... | [
0.4418576657772064,
0.3797259032726288,
0.28163808584213257,
-0.14649565517902374,
-0.06876013427972794,
-0.017871033400297165,
-0.037019871175289154,
-0.14832022786140442,
0.07804641127586365,
-0.4529627561569214,
-0.23064643144607544,
0.1233014166355133,
-0.34608495235443115,
0.393888503... | |
don't any words or queries to do this with the entire list.
I need to compare the first table with every row in the second query but am yet to find a way to do so.
After collecting unique borrower-title combinations (with `DISTINCT`), you can identify those borrowers with the number of booktitles equivalent to the tot... | [
0.3202870786190033,
0.10887841880321503,
0.41634246706962585,
0.12330876290798187,
-0.13328306376934052,
0.056334614753723145,
0.1099461242556572,
-0.2912950813770294,
0.02566448040306568,
-0.5204803347587585,
-0.40645191073417664,
0.19140666723251343,
-0.1760461926460266,
0.29709959030151... | |
bc.BtId
) borrowers_titles
GROUP BY BorName
HAVING Count(*) IN (SELECT Count(*) FROM BookTitle)
``` | [
0.40579843521118164,
0.47253480553627014,
0.33142876625061035,
0.20395374298095703,
0.3759632110595703,
-0.2377578169107437,
-0.12244737148284912,
-0.2967176139354706,
-0.09270061552524567,
-0.2808235287666321,
-0.3556734025478363,
0.2815403342247009,
0.17720577120780945,
0.386535048484802... | |
What's the shortest xamly way to make a `ToggleButton` contents depend on its checked state?
In WPF I'd probably go for a `DataTrigger` which doesn't exist in Silverlight.
I tried the following, but it doesn't work, as soon as I include the triggers, the binding to the source is broken. The triggers won't work anyway... | [
-0.1625109314918518,
-0.08144742250442505,
0.6939467787742615,
-0.07118186354637146,
-0.21744775772094727,
-0.2054162621498108,
0.1688464730978012,
-0.31755247712135315,
-0.1496056765317917,
-0.40477752685546875,
-0.14443333446979523,
0.3186107575893402,
-0.6625064015388489,
0.082942776381... | |
<i:EventTrigger EventName="Unchecked">
<ei:ChangePropertyAction
TargetObject="{Binding
RelativeSource={RelativeSource AncestorType=ToggleButton}}"
PropertyName="Content" Value="Archive project"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</ToggleButton>
```
```
<ToggleButton Width=... | [
-0.25685152411460876,
-0.11480061709880829,
0.6377072930335999,
-0.4372313916683197,
-0.023155689239501953,
0.14452813565731049,
0.0355566032230854,
-0.7592335939407349,
-0.28082624077796936,
-0.5208376049995422,
-0.13387785851955414,
0.17293642461299896,
-0.3742569386959076,
-0.0325688943... | |
EventName="Unchecked">
<ei:ChangePropertyAction PropertyName="Text" Value="Off" TargetName="obj"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</ToggleButton>
``` | [
-0.49290597438812256,
-0.199215367436409,
0.3973727822303772,
-0.3441806733608246,
0.08026409894227982,
-0.10104446858167648,
0.0990038588643074,
-0.1773020327091217,
-0.27119749784469604,
-0.4975910186767578,
-0.3246917426586151,
0.5165955424308777,
-0.407875657081604,
0.12274684011936188... | |
The android documentation has the following options below but does not explain what circumstances each is best for. What are the pros and cons of each method? e.g. Under what conditions would SQL be better than Shared Preferences?
* Shared Preferences
* Internal Storage
* External Storage
* SQLite Databases
* Network ... | [
-0.033966049551963806,
0.20664824545383453,
0.4494796097278595,
0.1488271951675415,
0.24915818870067596,
0.29284676909446716,
0.0043221889063715935,
-0.46315905451774597,
-0.10656827688217163,
-0.8218094110488892,
-0.20458102226257324,
0.6087306141853333,
-0.3027569055557251,
-0.1565403342... | |
as a city, the applications in it are the
houses in the city, people in the houses(application) are the data.
Now content provider is like an broker in the city(android device).
This broker provide access for the people in the city for finding
different houses referring as the content provider in the android
device pro... | [
0.5449438095092773,
-0.06921431422233582,
0.6772430539131165,
0.14252710342407227,
-0.19650410115718842,
0.13363364338874817,
0.20759586989879608,
0.01184055581688881,
-0.48080089688301086,
-0.8178059458732605,
-0.29961535334587097,
0.17738895118236542,
-0.24975991249084473,
0.180970892310... | |
out of the application an hour later
again I use the same Face book App to login again to my application.
* I have to enter username and password again to login to my account
and I set a theme to my application and other settings on how my app
looks in my current phone
* This is un-necessary because consider I am using... | [
0.2940742075443268,
0.203751802444458,
0.6861929893493652,
-0.050431739538908005,
-0.052165426313877106,
-0.12355834245681763,
0.7094814777374268,
-0.06503895670175552,
-0.3671340346336365,
-0.6891321539878845,
0.049542952328920364,
0.5971685647964478,
-0.08658213168382645,
0.0727759599685... | |
where I can use
its feature to share my data in a xml file Which physically exists in
the Android app installed in my phone which is not destroyed even if
the app is closed. Here we can save user preferences data of the
current application.
* As a result next time I open my app in my phone I can see the data
automatica... | [
0.341829776763916,
0.013333791866898537,
0.52118980884552,
0.10190720856189728,
-0.006300967652350664,
0.3411760628223419,
0.040513258427381516,
-0.21298561990261078,
-0.29233402013778687,
-0.9498319029808044,
-0.033298857510089874,
0.728210985660553,
-0.20232471823692322,
-0.1231017634272... | |
file, video file, audio file etc.
* As seen in the figure as we can see that there are two places we can
do this. One way is to write the raw files into primary /secondary
storage. Another way is to write the cache files into the
primary/secondary storage.
* There is also difference between storing raw data and the cac... | [
0.16142216324806213,
0.06740762293338776,
0.17698393762111664,
0.4086238145828247,
0.33587002754211426,
-0.009469044394791126,
0.22505010664463043,
-0.11883562803268433,
-0.3932861387729645,
-0.7222293615341187,
-0.2108670175075531,
0.5431765913963318,
-0.09630712121725082,
0.5499451160430... | |
image description here](https://i.stack.imgur.com/nsDjn.png)
**Internal Storage:**
* Consider a user in an application has stored data in internal
storage, then only that user of that application has access to that
data on the mobile and that data is automatically deleted when the
user uninstalls the application. Spe... | [
0.20021989941596985,
0.37573131918907166,
0.5656658411026001,
-0.0424153134226799,
0.13431905210018158,
0.3025135397911072,
0.07457875460386276,
-0.21567517518997192,
-0.4844290614128113,
-0.7957170605659485,
-0.36669424176216125,
0.4993930757045746,
-0.34752386808395386,
-0.09724085777997... | |
here](https://i.stack.imgur.com/oq6D1.png)
---
SQLite
------

* Sqlite is used to store more structured data locally in a mobile
where the android app is running. Structured data involves as of
which shown in the figure like a student’s information... | [
0.1937800496816635,
0.040060095489025116,
0.45574718713760376,
0.40616390109062195,
-0.10264860838651657,
-0.052889641374349594,
-0.12250979244709015,
0.11587562412023544,
-0.2510044574737549,
-0.7213280200958252,
-0.11016499996185303,
0.35363444685935974,
0.12582820653915405,
0.0761148333... | |
application
is running. When the application is closed the sqlite database is
also destroyed.
---
Putting all the pieces together
-------------------------------
 | [
0.09573542326688766,
0.02733321115374565,
0.7306418418884277,
0.16112005710601807,
0.1544146090745926,
-0.19365990161895752,
0.6252329349517822,
-0.26053673028945923,
-0.4527694582939148,
-0.6337234973907471,
-0.19894954562187195,
0.33928215503692627,
-0.29550349712371826,
0.14229838550090... | |
Here is my code. For some reason, if I submit the form without placing and passwords in, it still creates the database entry. There are some comments scattered throughout the code, but the code is fairly straightforward. Any ideas?
```
<?php
//signup.php
include 'connect.php';
include 'header.php';
echo '<h3>Sign up<... | [
0.4504270553588867,
0.30392545461654663,
0.47795528173446655,
-0.27371862530708313,
0.08494128286838531,
-0.29819226264953613,
0.3919870853424072,
-0.3264216184616089,
-0.012378515675663948,
-0.5930105447769165,
0.20041817426681519,
0.11235532909631729,
-0.21257348358631134,
0.145538315176... | |
Password: <input type="password" name="user_pass" /><br />
Password again: <input type="password" name="user_pass_check" /><br />
E-mail: <input type="email" name="user_email" /><br />
<input type="submit" value="Add category" />
</form>';
}
else
{
/* so, the form has been posted, we... | [
0.061207130551338196,
0.02258777804672718,
0.863267719745636,
-0.04170741140842438,
0.04889749363064766,
-0.171910360455513,
0.2111712545156479,
-0.364441841840744,
-0.07769865542650223,
-0.8147602081298828,
-0.3038274347782135,
0.5023798942565918,
-0.019441474229097366,
-0.113265007734298... | |
refill the wrong fields (if necessary)
3. Save the data
*/
$errors = array(); /* declare the array for later use */
if(isset($_POST['user_name']))
{
//the user name exists
if(!ctype_alnum($_POST['user_name']))
{
$errors[] = 'The username can only contain let... | [
-0.017415810376405716,
0.1991286277770996,
0.3531324565410614,
-0.37219515442848206,
0.14382071793079376,
0.16088533401489258,
0.406659334897995,
-0.2054338902235031,
0.026654038578271866,
-0.4133776128292084,
-0.20724841952323914,
0.44604822993278503,
-0.43867403268814087,
-0.077222503721... | |
if(strlen($_POST['user_name']) > 30)
{
$errors[] = 'The username cannot be longer than 30 characters.';
}
}
else
{
$errors[] = 'The username field must not be empty.';
}
if(isset($_POST['user_pass']))
{
if($_POST['user_pass'] != $_POST['user_pass_chec... | [
-0.384065181016922,
-0.11525140702724457,
0.19660089910030365,
-0.3320367932319641,
0.12394537031650543,
0.32960623502731323,
0.3454302251338959,
-0.26935383677482605,
0.05202539265155792,
-0.5290675759315491,
-0.6168496012687683,
0.32058754563331604,
-0.3687613606452942,
-0.40566429495811... | |
{
$errors[] = 'The two passwords did not match.';
}
}
else
{
$errors[] = 'The password field cannot be empty.';
}
if(!empty($errors))
{
echo 'Uh-oh.. a couple of fields are not filled in correctly..';
echo '<ul>'; | [
0.006035711150616407,
0.0024568799417465925,
0.2650343179702759,
-0.11916755139827728,
0.2744945287704468,
0.14433375000953674,
0.48371854424476624,
-0.2758684754371643,
-0.0065705301240086555,
-0.1400872766971588,
-0.34654107689857483,
0.5921565294265747,
-0.330791175365448,
0.23051878809... | |
foreach($errors as $key => $value)
{
echo '<li>'.$value.'</li>';
}
echo '</ul>';
}
else
{
//the form has been posted without errors, so save it
//notice the use of mysql_real_escape_string, keep everything safe.
//also | [
0.06594543904066086,
0.16859132051467896,
0.3348570168018341,
-0.35044631361961365,
0.2037578523159027,
0.21881172060966492,
0.6768556833267212,
-0.5231079459190369,
-0.08267518877983093,
-0.5424212217330933,
-0.24241073429584503,
0.5571108460426331,
-0.5379452705383301,
-0.060358919203281... | |
notice the sha1 function which hashes the password
$sql = "INSERT INTO
users(user_name, user_pass, user_email, user_date, user_level)
VALUES('" . mysql_real_escape_string($_POST['user_name']) . "',
'" . sha1($_POST['user_pass']) . "', | [
-0.3563566207885742,
0.18797874450683594,
0.1187731996178627,
-0.3183770775794983,
0.007958302274346352,
0.05720996484160423,
0.1852361559867859,
-0.009471328929066658,
-0.14006122946739197,
-0.421469122171402,
-0.09859831631183624,
-0.09962420910596848,
-0.29654237627983093,
0.34197404980... | |
'" . mysql_real_escape_string($_POST['user_email']) . "',
NOW(),
0)";
$result = mysql_query($sql);
if(!$result)
{ | [
-0.29114091396331787,
-0.013066420331597328,
0.707511842250824,
-0.36003753542900085,
0.23799727857112885,
0.005480702500790358,
0.45790404081344604,
-0.2267342507839203,
0.04147689417004585,
-0.19044753909111023,
-0.40661895275115967,
0.3870483636856079,
-0.39175713062286377,
0.3143419027... | |
//something went wrong, display the error
echo 'Something went wrong while registering. Please try again later.';
//echo mysql_error(); //debugging purposes, uncomment when needed
}
else
{
echo 'Successfully registered. You can now <a href="signin.php">sign in... | [
0.36395931243896484,
0.081480473279953,
0.20451882481575012,
-0.24008509516716003,
0.08416212350130081,
-0.04411519318819046,
0.9253638982772827,
-0.49670976400375366,
-0.2860259711742401,
-0.12338129431009293,
0.1871834099292755,
0.2599460184574127,
-0.3274784982204437,
-0.055918864905834... | |
and start posting!';
}
}
}
include 'footer.php';
?>
```
Null and/or empty strings are still set if the variable is declared. Try this:
`if(isset($_POST['user_pass']) && $_POST['user_pass'] != "")` | [
0.03535805642604828,
-0.1263209581375122,
0.3701658248901367,
-0.1897479146718979,
-0.17142222821712494,
-0.12645690143108368,
0.3117230534553528,
-0.02589912712574005,
-0.12752175331115723,
-0.7323339581489563,
-0.11653078347444534,
0.174782395362854,
-0.4120926260948181,
-0.0115406783297... | |
i'm using the kendo ui grid on my backbone application. i used this codes.
<https://github.com/telerik/kendo-backbone>
But i'm having this error on firebug.
```
invalid 'instanceof' operand backboneModel
if (!(model instanceof backboneModel)) {
```
I have this code.
cartlistview.js
```
define([
'jquery',
'... | [
-0.17457471787929535,
-0.1292533278465271,
0.4784730076789856,
0.02118941955268383,
-0.05750972405076027,
0.16530847549438477,
0.31915611028671265,
-0.34544023871421814,
-0.41594162583351135,
-0.6808934211730957,
-0.01794421300292015,
0.6701478362083435,
-0.19658489525318146,
0.17889222502... | |
function(model) {
if (!(model instanceof backboneModel)) {
model = new backboneModel(model);
}
Model.fn.init.call(this, model.toJSON());
this.backbone = model;
},
set: function(field, value) { | [
-0.08184437453746796,
-0.5903995037078857,
0.6781706809997559,
-0.2118353396654129,
0.07105360180139542,
0.2670256793498993,
0.3008957803249359,
-0.3613520562648773,
-0.3750030994415283,
-0.6283912658691406,
-0.31965717673301697,
0.43458670377731323,
-0.31569144129753113,
0.305254340171813... | |
Model.fn.set.call(this, field, value);
this.backbone.set(field, value);
}
});
}
function wrapBackboneCollection(model) {
return ObservableArray.extend( {
init: function(collection) {
ObservableArray.fn.init.call(this, collection.models, model);
this.collect... | [
-0.10701064020395279,
-0.44017931818962097,
0.7260429263114929,
-0.08387750387191772,
0.16521859169006348,
0.1483609974384308,
0.12129321694374084,
-0.44707363843917847,
-0.47734546661376953,
-0.4348022937774658,
-0.23253777623176575,
0.7673400640487671,
-0.28727230429649353,
0.31057953834... | |
var itemsToInsert, removedItemx, idx, length;
itemsToInsert = Array.prototype.slice.call(arguments, 2);
removedItems = kendo.data.ObservableArray.fn.splice.apply(this, arguments);
if (removedItems.length) {
for (idx = 0, length = removedItems.length; idx < length; ... | [
-0.08594948053359985,
-0.2992311120033264,
0.39139658212661743,
-0.26904165744781494,
-0.12749949097633362,
0.40250247716903687,
0.45972028374671936,
-0.5950239300727844,
-0.25533825159072876,
-0.3138100802898407,
-0.18154968321323395,
0.3367820382118225,
-0.3501797318458557,
0.34415346384... | |
this.collection.remove(removedItems[idx].backbone);
}
}
if (itemsToInsert.length) {
for (idx = 0, length = itemsToInsert.length; idx < length; idx++) {
this.collection.unshift(itemsToInsert[idx].backbone); | [
-0.17980888485908508,
-0.3985116183757782,
0.3877951502799988,
-0.23106808960437775,
0.0004670901980716735,
-0.07979679852724075,
0.2690134048461914,
-0.4813191592693329,
-0.43822741508483887,
-0.427708238363266,
-0.39000803232192993,
0.13781747221946716,
-0.3618311882019043,
0.48861691355... | |
}
}
return removedItems;
}
});
}
kendobackboneCollection = wrapBackboneCollection;
kendobackboneModel = wrapBackboneModel;
var CartListView = Backbone.View.extend({
el: $("#cartContainer"),
events:{
"click .k-grid-save-changes" : "save"
},
initialize: function(... | [
-0.16168302297592163,
-0.3486306667327881,
0.840487539768219,
-0.23941589891910553,
-0.06521744281053543,
0.35832008719444275,
0.2760721445083618,
-0.28757235407829285,
-0.03586282581090927,
-0.45251721143722534,
-0.33167922496795654,
0.744396448135376,
-0.30412402749061584,
0.002906304318... | |
CartWrapper = kendobackboneModel(cart, {
ItemCode: { type: "string" },
ItemDescription: { type: "string" },
RetailPrice: { type: "string" },
Qty: { type: "string" },
});
var CartCollectionWrapper = kendobackboneCollection(CartWrapper);
this.$("#grid").kendoGrid({
editable: true,
toolba... | [
0.049619756639003754,
-0.0397503562271595,
0.8197395205497742,
0.10554061084985733,
0.007233566604554653,
0.499351441860199,
-0.0834505632519722,
-0.063132643699646,
0.15795759856700897,
0.032619647681713104,
-0.33790481090545654,
0.8476060628890991,
-0.11558584868907928,
0.233502134680747... | |
title: "UnitPrice"},
{field: "ExtPriceRate", title: "ExtPrice"}
],
dataSource: {
schema: {model: CartWrapper},
data: new CartCollectionWrapper(cartcollection),
}
});
},
save: function(){
var input = new Input();
var invoicecollection = new InvoiceCollection();
var invoice... | [
-0.40447595715522766,
-0.3064868450164795,
1.023163080215454,
0.0349574089050293,
0.14195658266544342,
0.3416678011417389,
-0.034722600132226944,
-0.44757968187332153,
-0.11213929206132889,
-0.3520749509334564,
-0.40706926584243774,
0.6990730166435242,
-0.25778213143348694,
0.2896879315376... | |
"InvoiceDetails": invoicedetail });
if( invoicedetail.length === 0){
alert("Shopping Cart is Empty");
}else{
alert(JSON.stringify(input));
input.save(input, {success: function(model, result){
var InvoiceCode = result.InvoiceCode;
alert("Transaction Complete., I... | [
-0.1321520358324051,
-0.4412648379802704,
0.8671517372131348,
-0.3260090947151184,
0.24867872893810272,
0.22267289459705353,
0.30979129672050476,
-0.18225623667240143,
-0.17637155950069427,
-0.2572941184043884,
-0.5030519962310791,
0.8651893138885498,
-0.48802781105041504,
-0.1219953969120... | |
this.render();
}
}
});
return new CartListView;
});
```
my Cart Collection
```
define([
'underscore',
'backbone',
'model/cart_model'
],function(_, Backbone, Cart){
var CartCollection = Backbone.Collection.extend({
model: Cart,
initialize: function(){
}
});
return CartCollection;
});
```
Null and/or e... | [
-0.1872759312391281,
-0.32083117961883545,
0.7901486158370972,
0.03208744153380394,
-0.16992361843585968,
0.16252541542053223,
0.07442373782396317,
-0.16744264960289001,
-0.2748543322086334,
-0.49232038855552673,
-0.4649791419506073,
0.5307247042655945,
-0.45824044942855835,
0.096456959843... | |
**Objective:** Detect / determine human actions, s.a. picking / lifting items to read label and keeping it back on rack (in a store), sitting-on, mounting/climbing-atom objects s.a. chair, bench, ladder etc.
**Environment:** Store / shop, which is mostly well lit. Cameras (VGA -> 1MP), fixed (i.e. not PTZ).
**Constra... | [
0.5409463047981262,
-0.10552012175321579,
0.16696356236934662,
0.21571406722068787,
0.19012275338172913,
0.21965648233890533,
0.5348863005638123,
-0.35378724336624146,
-0.3515281081199646,
-0.5040482878684998,
-0.3594002425670624,
0.46094024181365967,
-0.20186862349510193,
-0.3978189229965... | |
can be switched-on.
**Question:**
1. While I understand that OpenCV is great for face-detection and usable for face-recognition, can it be used for analyzing "actions", s.a. the act of sitting, the act of lifting an object off the shelf ? If so, what are some of these algorithms I should dig deeper into ?
2. Since ca... | [
0.6337921619415283,
-0.17767749726772308,
0.6566382646560669,
0.30056875944137573,
0.03563499078154564,
-0.181086465716362,
-0.017131024971604347,
-0.2291007786989212,
-0.47198057174682617,
-0.17722372710704803,
0.10765604674816132,
0.42382386326789856,
-0.17812158167362213,
-0.42717260122... | |
OpenCV) which need to be used for such tasks ? Are there open-source libraries for the same ?
From time to time some people come here and ask for help (or better, code) to solve some of the most difficult research problems in computer vision. Problems that were not solved by the most regarded academics and scientists. ... | [
0.4129277467727661,
0.024201378226280212,
0.297781378030777,
0.41193342208862305,
-0.24711497128009796,
-0.5925291180610657,
-0.04404521733522415,
0.1315712183713913,
-0.37819957733154297,
-0.2851661443710327,
-0.36394041776657104,
0.44877052307128906,
-0.08580010384321213,
-0.096486531198... | |
you aren't, the chance to do it is really low.
What you can do with reasonable resources and accuracy is to track people in the store: Use a moving-average background subtractor(available in OpenCV) to determine how the empty store looks like, and subtract that background from each frame, to see objects that come and... | [
0.38225311040878296,
-0.14966464042663574,
0.3298876881599426,
0.09718998521566391,
0.32430681586265564,
0.06063118949532509,
0.1313549131155014,
0.015546859242022038,
-0.4177531898021698,
-0.611480712890625,
-0.21202608942985535,
0.4629700183868408,
0.07887297868728638,
-0.142109259963035... | |
This is my first post and I have to admit, I am terrible at programming. I am that guy in the class that works his tail off, but can never seem to grasp programming as well as the rest of my classmates. So please be nice, I will try to explain my problem below.
I have the following code (comments removed), but when I... | [
0.1686110943555832,
0.22303488850593567,
0.25886282324790955,
0.11192091554403305,
-0.1491016298532486,
-0.4334638714790344,
0.3415522873401642,
0.6532962918281555,
-0.028002597391605377,
-0.489792138338089,
0.0704825296998024,
-0.05930260568857193,
-0.3411079943180084,
0.35744017362594604... | |
of the program, not allowing me to input the values for the other variables (e.g. the variable "beta"). I have an image of the output (<http://i.stack.imgur.com/yc3jq.jpg>) and you can see that I enter alpha, but then the program runs to the end. Any thoughts?
Thank You so very much for your help!
-Spencer
----------... | [
-0.16817522048950195,
0.05011296272277832,
0.4068331718444824,
-0.18235528469085693,
0.13464193046092987,
0.23670683801174164,
0.43625277280807495,
-0.2648959755897522,
0.09629012644290924,
-0.5116956830024719,
-0.24892288446426392,
0.4120822250843048,
-0.4253576695919037,
-0.0211975798010... | |
FILE *out_file;
float *time_out, *s_out, *i_out, *r_out;
printf("Enter the value of the rate constant for infection (alpha) \n");
scanf("&f", &alpha);
printf("Enter the value of the rate constant for recovery or death (beta) \n");
scanf("&f", &beta);
printf("Enter the value of number of persons susceptible to the gi... | [
0.03615965694189072,
-0.19428744912147522,
0.2808068096637726,
-0.32505959272384644,
0.25707364082336426,
0.3328990340232849,
0.35212740302085876,
-0.2720789909362793,
-0.12578468024730682,
-0.6008525490760803,
-0.41425594687461853,
0.37526217103004456,
-0.7257917523384094,
0.2808400988578... | |
[i.e. R(t) = R(0) = ?] \n");
scanf("&f", &R0);
printf("Enter the final time for solution \n");
scanf("&f", &tf);
printf("Enter the solution step size (H) \n");
scanf("&f", &h);
N = (int)(tf/h);
printf("Enter file solution to store solution to simulation \n");
scanf("&s", sim_file);
out_file = fopen(sim_file, "w")... | [
-0.8751662969589233,
-0.2652222514152527,
0.9899057745933533,
-0.4381648302078247,
0.519533634185791,
0.5550020337104797,
0.22790493071079254,
-1.0019829273223877,
-0.07176578789949417,
-0.6903951168060303,
-0.5773230791091919,
0.34644392132759094,
-0.106462761759758,
0.22790685296058655,
... | |
s_out[i]+(k1/2), i_out[i]+(q1/2), r_out[i]+(p1/2));
k3 = h*slope_k(time_out[i]+(h/2), s_out[i]+(k2/2), i_out[i]+(q2/2), r_out[i]+(p2/2));
q3 = h*slope_q(time_out[i]+(h/2), s_out[i]+(k2/2), i_out[i]+(q2/2), r_out[i]+(p2/2));
p3 = h*slope_p(time_out[i]+(h/2), s_out[i]+(k2/2), i_out[i]+(q2/2), r_out[i]+(p2/2));
k4 = h*s... | [
-0.7296784520149231,
0.14947955310344696,
0.6642512083053589,
-0.4025525450706482,
-0.0329914316534996,
0.7187750339508057,
0.4415055811405182,
-0.9327000379562378,
-0.3965955972671509,
-0.6733080744743347,
-0.40998274087905884,
0.19010420143604279,
-0.016050055623054504,
0.154310569167137... | |
float r)
{
float slope_p_out;
slope_p_out = beta*i;
return slope_p_out;
}
```
---
Example warning:
```
warning C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
```
What the compiler is telling ... | [
-0.16373689472675323,
0.10047929733991623,
0.4134451150894165,
-0.30886539816856384,
0.12092296779155731,
-0.04537303373217583,
0.3665321171283722,
-0.3867509961128235,
-0.1258610635995865,
-0.3026498556137085,
-0.22337272763252258,
0.6342780590057373,
-0.35620632767677307,
0.1597415804862... | |
is usually the null character `'\0'`. However, if one leaves off `'\0'` from a string, `scanf` will continue reading until it finds that byte -- usually, `scanf` will reach a memory location that is outside of its own virtual memory space. This action will cause the OS to send your program a segmentation fault (seg fau... | [
-0.0917591005563736,
-0.445844829082489,
0.43136006593704224,
-0.028487110510468483,
0.17798593640327454,
0.10299774259328842,
0.2524935007095337,
0.1594274789094925,
-0.41584664583206177,
-0.6037202477455139,
-0.34498903155326843,
0.04605253040790558,
-0.25178253650665283,
0.2520594894886... | |
is, you can leave `scanf` there. However, to get rid of the compilier warning AND try and become a better programmer, fix it! Use `sscanf_s` and have a global variable (or something...) that determines maximum input size (e.g. int `SCANF_INPUT_SIZE = 1000` ).
Good luck!
EDIT -- Change those `"&f"` to `"%f"` that's th... | [
-0.2270715981721878,
-0.06335126608610153,
0.3049580156803131,
0.010791526176035404,
0.16516928374767303,
-0.08408211916685104,
0.22180014848709106,
0.29804274439811707,
-0.3521841764450073,
-0.7711611986160278,
-0.012753738090395927,
0.6660205125808716,
-0.1397833675146103,
-0.19667373597... | |
I write this function, but what's its return value.
```
(defn read-data [file]
(let [code (subs (.getName file) 0 3)]
(with-open [rdr (clojure.java.io/reader file)]
(drop 1 (line-seq rdr)))))
(def d (read-data "data.db"))
```
It's OK til now. But when I want print this out.
```
(clojure.pprint/pprint d... | [
-0.13160821795463562,
0.2207581102848053,
0.7920463681221008,
-0.21547280251979828,
-0.10217354446649551,
-0.22666676342487335,
0.6355275511741638,
0.15456832945346832,
-0.30127787590026855,
-0.47076883912086487,
-0.30176326632499695,
0.47342613339424133,
-0.5027111172676086,
0.16643832623... | |
need to be read within the scope of your `with-open`. One option is to force the full evaluation of `line-seq` by using `doall`, as shown below.
```
(drop 1 (doall (line-seq rdr)))
```
A potential problem with this approach is that you'll get an OutOfMemoryError if the file is larger than the available memory. So, d... | [
0.019352000206708908,
0.06644069403409958,
0.2143629640340805,
-0.11974437534809113,
-0.08650635182857513,
-0.3124523460865021,
0.37302038073539734,
-0.1946413815021515,
-0.23604902625083923,
-0.36518076062202454,
-0.34853771328926086,
0.6477593779563904,
-0.28877198696136475,
-0.074055492... | |
I'm using the following view code in my Ruby (1.9.3) on Rails (3.1) application to edit who a task is owned by.
```
=simple_form_for task do |f|
=f.input :owner, collection: task.list.collaborators
```
Which produces the following selection dropdown.
 findViewById(R.id.... | [
0.5071267485618591,
-0.01652984693646431,
0.46476370096206665,
-0.13979396224021912,
0.017247512936592102,
-0.1279781311750412,
0.3759603798389435,
-0.603070080280304,
-0.1768042892217636,
-0.6041646003723145,
0.07957245409488678,
0.657477617263794,
-0.4301167130470276,
0.01792072877287864... | |
I have an html table with an ID of `thetable`. It has (according to FireBug), an unnamed TBODY tag, and an unnamed TR tag. The three TD tags inside that I want to access are unnamed. Is there any CSS selector that I can use to reference these unnamed tr tags?
I've tried:
`table#thetable:nth-child(1)`
But this does ... | [
0.3260357677936554,
0.1089591383934021,
0.16399617493152618,
-0.02451457642018795,
0.00793834775686264,
0.36263492703437805,
0.11164277791976929,
-0.20959360897541046,
-0.061408285051584244,
-0.6745004057884216,
0.11771082878112793,
0.42278820276260376,
-0.3516045808792114,
0.0868254676461... | |
TDs into an array
Elements strings = doc.select("table#thetable: children");
```
If you're simply looking to get all your `td` elements, this should be enough:
```
Elements elems = doc.select("table#thetable td");
```
Then iterate `elems`, retrieve the text from your `td`s and put them in your array.
Also, you sho... | [
0.29706230759620667,
-0.035856377333402634,
0.2706143856048584,
-0.29860609769821167,
-0.01481937151402235,
0.20579008758068085,
0.2714402973651886,
-0.867293119430542,
0.05907629057765007,
-0.49979880452156067,
-0.09997661411762238,
0.7889161109924316,
-0.44929447770118713,
-0.27515092492... | |
I've never used php before and am trying to connect to a SQL Server 2008 instance on a Windows machine running IIS7 and PHP5.3.
I have downloaded and installed `SQLSRV30.EXE` from [here](http://www.microsoft.com/download/en/details.aspx?id=20098) in `C:\Program Files (x86)\PHP\ext` added this to `C:\Program Files (x86... | [
-0.13170164823532104,
0.4047156870365143,
0.24589969217777252,
-0.08851253986358643,
-0.04776398092508316,
-0.1082981526851654,
0.5181314945220947,
0.027259662747383118,
-0.26290374994277954,
-0.6063372492790222,
0.14454385638237,
0.5200082063674927,
-0.14535044133663177,
0.343927621841430... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.