text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I'm having a really difficult time debugging this problem. Whenever I try to establish a connection with postgres, it takes a whole minute. After the connection is established, everything is fine. I've tried disabling all the mappings and not loading any, but still the connection takes a long time to aquire. I've also ... | [
0.19100114703178406,
0.1456937938928604,
0.26248061656951904,
-0.08661668747663498,
-0.2888871431350708,
-0.3192096948623657,
0.4873855412006378,
0.2290419191122055,
-0.22089040279388428,
-0.8679648041725159,
-0.11452159285545349,
0.7611823081970215,
-0.21774372458457947,
0.150890037417411... | |
<!-- properties -->
<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property name="connection.driver_class">org.postgresql.Driver</property>
<property name="connection.url">jdbc:postgresql://xxxx.com:5432/xxxxx</property>
<property name="connection.username"... | [
-0.02510562725365162,
0.08308660984039307,
0.5905351042747498,
-0.13583527505397797,
0.03947019949555397,
0.39641284942626953,
0.3593929409980774,
-0.3184552490711212,
-0.16423071920871735,
-0.8486906290054321,
-0.57229083776474,
0.5749563574790955,
-0.3220708966255188,
0.2325459122657776,... | |
"true");
config.setProperty("hibernate.connection.provider_class", "org.hibernate.connection.C3P0ConnectionProvider");
config.setProperty("hibernate.c3p0.acquire_increment", "1");
config.setProperty("hibernate.c3p0.idle_test_period", "0");
config.setProperty("hibernate.c3p0.min_size", "1");
config.... | [
0.24329298734664917,
-0.1270851343870163,
0.7563126683235168,
-0.3277847170829773,
0.2521514892578125,
0.1642512083053589,
0.7840924263000488,
-0.39037200808525085,
-0.08788105100393295,
-0.5780834555625916,
-0.6290273666381836,
0.5442122220993042,
-0.13139449059963226,
0.2774261236190796,... | |
return sessionFactory;
}
```
Here's the log results:
```
[main] 2012-04-09 10:40:32,823 110391 INFO C3P0ConnectionProvider - HHH000046:
Connection properties: {user=hgaidb_test, password=****}
[main] 2012-04-09 10:40:32,823 110391 INFO C3P0ConnectionProvider - HHH000006:
Autocommit mode: false
[main] 2012-04... | [
-0.646045982837677,
0.35455068945884705,
0.4361347258090973,
-0.15966863930225372,
-0.24900422990322113,
0.23565013706684113,
0.8594282865524292,
-0.1453864872455597,
-0.31029629707336426,
-0.6171433925628662,
-0.12383651733398438,
0.7394824028015137,
-0.41978657245635986,
0.50154805183410... | |
: PostgreSQL 9.1 JDBC4 (build 901)
major : 9
minor : 1
*******************************************************************************
// 1 MINUTE DELAY
*******************************************************************************
[main] 2012-04-09 10:40:34,102 111670 DEBUG JdbcServicesImpl - JDBC version... | [
-0.8543844223022461,
0.20818157494068146,
0.5381228923797607,
0.018497740849852562,
-0.3214658796787262,
0.2849799394607544,
0.4561428427696228,
-0.11351421475410461,
-0.03358756750822067,
-0.5516454577445984,
-0.4259529113769531,
0.6984472274780273,
-0.1567620187997818,
-0.076521396636962... | |
2012-04-09 10:41:21,816 159384 DEBUG SettingsFactory - JDBC batch updates
for versioned data: disabled
[main] 2012-04-09 10:41:21,816 159384 DEBUG SettingsFactory - Scrollable result
sets: enabled
[main] 2012-04-09 10:41:21,817 159385 DEBUG SettingsFactory - Wrap result sets:
disabled
[main] 2012-04-09 10:41:21,818 ... | [
-0.5996681451797485,
0.4233863055706024,
0.440200537443161,
-0.10010886192321777,
-0.3711997866630554,
0.5014441609382629,
0.7606182098388672,
-0.4957669675350189,
-0.22319811582565308,
-0.6270949244499207,
-0.5204922556877136,
0.4555681645870209,
-0.30497539043426514,
0.1236548200249672,
... | |
disabled
[main] 2012-04-09 10:41:21,845 159413 DEBUG SettingsFactory - Order SQL updates
by primary key: disabled
[main] 2012-04-09 10:41:21,846 159414 DEBUG SettingsFactory - Order SQL inserts
for batching: disabled
[main] 2012-04-09 10:41:21,846 159414 DEBUG SettingsFactory - Query translator:
org.hibernate.hql.in... | [
-0.6659803986549377,
0.2912849485874176,
0.37822771072387695,
-0.02076900377869606,
-0.15205301344394684,
0.5294751524925232,
0.7141970992088318,
0.01921643130481243,
-0.30478131771087646,
-0.48040667176246643,
-0.6084740161895752,
0.2868066430091858,
-0.32842469215393066,
0.18157657980918... | |
org.hibernate.cach
e.internal.NoCachingRegionFactory did not provide constructor accepting java.uti
l.Properties; attempting no-arg constructor.
[main] 2012-04-09 10:41:21,873 159441 DEBUG SettingsFactory - Optimize cache for
minimal puts: disabled
[main] 2012-04-09 10:41:21,873 159441 DEBUG SettingsFactory - Structur... | [
-0.49589577317237854,
0.13719186186790466,
0.2070131152868271,
0.019708096981048584,
-0.2225489318370819,
0.30739301443099976,
0.8023623824119568,
-0.3062286376953125,
-0.09663382917642593,
-0.7202554941177368,
-0.3881482183933258,
0.19339901208877563,
-0.3373703062534332,
0.11839510500431... | |
: NONE
```
I've done a little more research on this, stepping through the debugger. I don't have all the source in my classpath, but i can still see the variables. Durring that one minute wait, Hibernate is querying the pg\_catalog.pg\_type table:
```
[SELECT typname FROM pg_catalog.pg_type WHERE oid = , ]
```
Her... | [
0.12610922753810883,
0.3719693124294281,
0.3923169672489166,
0.21402128040790558,
-0.026053594425320625,
-0.10067304968833923,
0.17728866636753082,
-0.1510157287120819,
-0.2928112745285034,
-0.4166111350059509,
0.006380167324095964,
0.5334550738334656,
-0.36967703700065613,
0.1674909889698... | |
why this is on by default but you should definitely turn this feature off unless you explicitly need it:
```
config.setProperty("hibernate.temp.use_jdbc_metadata_defaults","false");
```
Instant connection now!
The only info I could find on this is in code:
```
107 // 'hibernate.temp.use_jdbc_metadata_defaults'... | [
0.33302366733551025,
0.11229021847248077,
0.6597976684570312,
0.08023397624492645,
0.13172119855880737,
-0.46625688672065735,
0.3900269567966461,
0.07248460501432419,
-0.26236066222190857,
-0.43074527382850647,
-0.10076459497213364,
0.536937952041626,
-0.4041045606136322,
0.190439492464065... | |
// certain Settings default values; it is useful to *not* do this when the database
113 // may not be available (mainly in tools usage).
114 boolean useJdbcMetadata = ConfigurationHelper.getBoolean( "hibernate.temp.use_jdbc_metadata_defaults", configValues, true );
```
<http://grepcode.com/file/repo1.maven.or... | [
0.08400940150022507,
0.08150235563516617,
0.578447163105011,
-0.16226795315742493,
0.046872783452272415,
0.1640908271074295,
0.378527969121933,
-0.468381404876709,
-0.32798752188682556,
-0.5227617025375366,
-0.3321521282196045,
0.46509307622909546,
-0.30952173471450806,
-0.0436634458601474... | |
I have the file delimit by comma (,)
```
word1,word2,word3,word4
word80,word81,word82
```
This is what I want
```
word1,word2
word80,word81
```
So, I need only two words per line and I don't care the rest including second comma (,)
word3 word4 word82 can be delete OR In easy way, deleting the line with con... | [
-0.2873048782348633,
-0.08458936959505081,
0.5137909650802612,
-0.14343366026878357,
-0.08078958094120026,
0.6035556793212891,
0.398154079914093,
-0.1190243512392044,
-0.20647558569908142,
-0.6077389121055603,
-0.42353901267051697,
0.43790334463119507,
-0.3084850311279297,
0.04766905680298... | |
I'm looking to use exiftool to scan the EXIF tags from my photos and videos. It's a perl executable. What's the best way to inferface with this? Are there any Python libraries to do this already? Or should I directly call the executable and parse the output? (The latter seems dirty.) Thanks.
The reason I ask is this b... | [
0.527959942817688,
0.009597165510058403,
0.5938814282417297,
-0.054617710411548615,
-0.28019946813583374,
-0.21141298115253448,
-0.04542144015431404,
0.00470154220238328,
-0.25059452652931213,
-0.3977813124656677,
-0.006053465884178877,
0.44621261954307556,
-0.5866676568984985,
-0.33685225... | |
[`-stay_open`](http://www.sno.phy.queensu.ca/~phil/exiftool/exiftool_pod.html#item__2dstay_open_flag) flag. You can then send commands to the process via stdin, and read the output on stdout. ExifTool supports JSON output, which is probably the best option for reading the metadata.
Here's a simple class that launches ... | [
0.05170092359185219,
0.07540297508239746,
0.5542832016944885,
-0.23463311791419983,
-0.11289633065462112,
-0.08526736497879028,
0.18968011438846588,
-0.35257306694984436,
-0.230160653591156,
-0.5057587623596191,
-0.4023842215538025,
0.6453789472579956,
-0.39298558235168457,
0.0794495195150... | |
self.process = subprocess.Popen(
[self.executable, "-stay_open", "True", "-@", "-"],
stdin=subprocess.PIPE, stdout=subprocess.PIPE)
return self
def __exit__(self, exc_type, exc_value, traceback):
self.process.stdin.write("-stay_open\nFalse\n")
self.process.stdin.fl... | [
-0.31531402468681335,
0.06512583792209625,
0.4450235068798065,
-0.49279123544692993,
0.2531532347202301,
0.32777076959609985,
0.5215168595314026,
-0.3438410460948944,
-0.2967733144760132,
-0.6731857061386108,
-0.10757442563772202,
0.491160124540329,
-0.449741929769516,
0.07394446432590485,... | |
self.process.stdin.flush()
output = ""
fd = self.process.stdout.fileno()
while not output.endswith(self.sentinel):
output += os.read(fd, 4096)
return output[:-len(self.sentinel)]
def get_metadata(self, *filenames):
return json.loads(self.execute("-G", "-j", "-n",... | [
0.08088625222444534,
-0.15169961750507355,
0.4823897182941437,
-0.1903078705072403,
0.06443306803703308,
0.08537838608026505,
0.5031569004058838,
-0.4798199236392975,
-0.4637989103794098,
-0.4926934242248535,
-0.020630598068237305,
0.7186993360519409,
-0.2740476727485657,
0.241897881031036... | |
metadata = e.get_metadata(*filenames)
```
EDIT for python 3:
To get this to work in python 3 two small changes are needed. The first is an additional argument to `subprocess.Popen`:
```
self.process = subprocess.Popen(
[self.executable, "-stay_open", "True", "-@", "-"],
universal_newlines=True,
... | [
0.03605093061923981,
0.12721502780914307,
0.5392333269119263,
0.14755737781524658,
0.0895160511136055,
-0.023977430537343025,
0.18021288514137268,
-0.41188740730285645,
-0.3604375422000885,
-0.5350850820541382,
0.007945707067847252,
0.6736168265342712,
-0.2594023644924164,
0.35287725925445... | |
will hang because the while loop inside execute() won't stop | [
0.4615654945373535,
-0.3741077482700348,
0.5700187683105469,
0.08021064102649689,
0.24010002613067627,
-0.34118881821632385,
0.3571104109287262,
-0.4663257896900177,
-0.3286454379558563,
-0.1439259946346283,
-0.20940320193767548,
0.24621111154556274,
-0.26751792430877686,
0.105844072997570... | |
We're on Rails 3.0.6.
Will the following code persist across page loads and users in Rails? Or does it get redefined with every request? The code lives at the top of a controller.
```
@@list = []
hero = {}
hero['name'] = 'so'
hero['superpowers'] = ['coding', 'qa', 'spec_writing']
@@list.push hero
hero2 = {}
hero2['... | [
0.30372855067253113,
-0.4684673249721527,
0.8173552751541138,
0.19856123626232147,
-0.08026091009378433,
-0.19585447013378143,
0.5217999815940857,
-0.4856600761413574,
-0.15046001970767975,
-0.7293224334716797,
0.05497274920344353,
0.3990005552768707,
-0.190195232629776,
-0.461313456296920... | |
behavior is for the class to be reloaded on each request, thereby resetting your class variable. In production, however, the class is initialized once and so the class variable will persist across multiple requests and multiple sessions.
You should move to a proper caching technique as soon as you can. You cannot, obv... | [
0.11609731614589691,
-0.1330723762512207,
0.153107687830925,
-0.010424249805510044,
-0.11679434776306152,
-0.10084117203950882,
0.5550384521484375,
-0.10562295466661453,
-0.6183881759643555,
-0.49057456851005554,
-0.20809882879257202,
0.5223194360733032,
-0.3888864517211914,
0.410809934139... | |
inconsistencies between requests. | [
-0.12430087476968765,
0.2333136349916458,
-0.037021540105342865,
0.3747762441635132,
-0.05367660894989967,
0.22039760649204254,
0.10015369951725006,
0.1616545468568802,
-0.06971807032823563,
-0.5979846119880676,
-0.14481322467327118,
0.18518559634685516,
-0.12836752831935883,
-0.1425985097... | |
How can it possible to get all names of some remote origin branches?
I started from `--remote --list` options, but got redundant `origin/HEAD -> origin/master` message and branches from the another origin.
```
$> git branch --remote --list
origin/HEAD -> origin/master
origin1/develop
origin1/feature/1
origin1... | [
0.3546072542667389,
-0.32563596963882446,
0.18905046582221985,
0.3326364755630493,
0.19710323214530945,
0.33853521943092346,
-0.02112911082804203,
0.06384947896003723,
-0.2356494665145874,
-0.6343686580657959,
-0.1989012509584427,
0.029113035649061203,
-0.09973877668380737,
0.5116172432899... | |
origin1/HEAD -> origin/master
origin1/develop
origin1/feature/1
origin1/feature/2
origin1/feature/3
origin1/master
```
What am I looking for is a list of branch names of `origin1`, any of them I could use for `git checkout` command. Something like that:
```
develop
feature/1
feature/2
feature/3
master
```... | [
0.049711573868989944,
0.09713391959667206,
-0.0428202822804451,
0.02887704223394394,
-0.017143402248620987,
0.2922597825527191,
-0.13068383932113647,
-0.012803145684301853,
-0.006195716094225645,
-0.5575734376907349,
-0.24791266024112701,
0.18411874771118164,
-0.19106899201869965,
0.093135... | |
"[What does the term porcelain mean in Git?](https://stackoverflow.com/questions/6976473/what-does-the-term-porcelain-mean-in-git/6978402#6978402)")
Use the plumbing command **[ls-remote](http://linux.die.net/man/1/git-ls-remote)**, and then you will be able to filter its output.
ls-remote without parameter would sti... | [
-0.23742890357971191,
0.42033666372299194,
0.6891282200813293,
0.057143885642290115,
-0.04895666241645813,
0.5915356278419495,
0.18520814180374146,
-0.29053613543510437,
-0.021830229088664055,
-0.6800439357757568,
-0.2697352468967438,
0.2446291595697403,
0.18258480727672577,
0.181873574852... | |
which documents an example](https://stackoverflow.com/a/56979330/6309):
```
git branch -r -l '<remote>/<pattern>'
git for-each-ref 'refs/remotes/<remote>/<pattern>'
``` | [
0.13732962310314178,
0.19404511153697968,
0.3800410032272339,
-0.006779583171010017,
0.20212700963020325,
-0.038761019706726074,
-0.09321539849042892,
-0.042276088148355484,
-0.5291476845741272,
-0.25364282727241516,
-0.4577309489250183,
0.2114422470331192,
-0.09782619774341583,
0.24013999... | |
So I have a WPF application using the MVVM pattern (Caliburn.Micro). I got the views and view-models wired up and basicly what is missing is the data. The data is to be retrieved "on-demand" either from a WCF service, local storage or from memory/cache - reason being to allow for offline-mode and to avoid uneccessary s... | [
0.26620492339134216,
-0.2318955957889557,
0.5936481952667236,
-0.1242336705327034,
-0.09321580082178116,
-0.14931505918502808,
0.0528491735458374,
-0.2710384726524353,
-0.23947779834270477,
-0.6350690126419067,
-0.04612640663981438,
0.6471514701843262,
-0.10472241044044495,
0.0568085908889... | |
few different problems though. If the same asset is requested at (roughly) the same time by different view-models, how do we ensure that we don't do unecessary work and that they both get the same objects that we can bind against?
Not sure I'm having the right approach. I've been glancing a bit at Reactive Framework ... | [
0.28679531812667847,
0.1386088877916336,
0.15218061208724976,
0.27427148818969727,
0.07706818729639053,
-0.022634027525782585,
-0.059134721755981445,
-0.3548508584499359,
-0.12847454845905304,
-0.9666144251823425,
-0.17725642025470734,
0.7907816767692566,
-0.2731054723262787,
-0.3122060596... | |
request just get the
// existing one
lock(inflightRequests) {
if inflightRequests.ContainsKey(id) {
return inflightRequests[id];
}
}
// Create a new IObservable and put in the dictionary
lock(inflightRequests) { inflightRequests[id] = ret; }
// Actually do the reque... | [
0.10074873268604279,
-0.27012431621551514,
0.840309202671051,
0.2858339250087738,
0.3117155432701111,
-0.16695863008499146,
0.10655535012483597,
-0.293869286775589,
0.05712617561221123,
-0.7105618715286255,
-0.1093243956565857,
0.9091442227363586,
-0.26504772901535034,
-0.04403975978493690... | |
=> {
ret.OnNext(id);
ret.OnCompleted();
// We're not inflight anymore, remove the item
lock(inflightRequests) { inflightRequests.Remove(id); }
})
return ret;
}
``` | [
0.27235057950019836,
-0.014507648535072803,
0.9637333750724792,
0.012064487673342228,
0.6530076265335083,
-0.014033677987754345,
0.3540961444377899,
-0.3542822599411011,
0.0006857889238744974,
-0.3698480725288391,
-0.6863528490066528,
0.6648727059364319,
-0.4373791217803955,
0.172237187623... | |
Let's say I have a User\_RegistrationController from with I want to extend in another module like so:
```
class Clinic_RegisterController extends User_RegisterController
```
but I've PHP error for that:
```
( ! ) Fatal error: Class 'User_RegisterController' not found /application/modules/clinic/controllers/Register... | [
-0.008000952191650867,
0.18723537027835846,
0.6024056673049927,
-0.06854408234357834,
0.10725361108779907,
0.05173821747303009,
-0.043992772698402405,
-0.6525799036026001,
-0.34520915150642395,
-0.6929084658622742,
-0.09934352338314056,
0.5169016718864441,
-0.46574667096138,
0.321795761585... | |
members/methods
}
```
Don't forget the add `App_` as an `autoloadernamespace`. | [
0.2353183925151825,
0.18626709282398224,
0.0674874559044838,
0.06354988366365433,
-0.04825986549258232,
-0.2853754460811615,
0.2512035369873047,
0.16284127533435822,
-0.34807926416397095,
-0.5971443057060242,
-0.3743680417537689,
0.5272935032844543,
-0.27779895067214966,
-0.039036117494106... | |
I have compiled and built openssl to my iOS project,
but struggling in objective-c with writing an equivalent code to this command line:
```
openssl rsautl -encrypt -inkey publicKey.pem -pubin -in textfile.txt -out encrypted.bin
```
How can I achieve this?
So I resolved my problem, here is the function to my quest... | [
-0.4850406348705292,
0.2600461542606354,
0.6255682110786438,
-0.127585306763649,
0.09972845762968063,
0.0033566197380423546,
0.4204755425453186,
-0.24774476885795593,
-0.2137611359357834,
-0.7198811769485474,
-0.5310994386672974,
0.5194454193115234,
-0.5367137789726257,
-0.3464198112487793... | |
*pubkey = fopen([path cStringUsingEncoding:1], "r");
if (pubkey == NULL) {
NSLog(@"duh: %@", [path stringByAppendingString:@" not found"]);
return NULL;
}
RSA *rsa = PEM_read_RSA_PUBKEY(pubkey, NULL, NULL, NULL);
if (rsa == NULL) {
NSLog(@"Error reading RSA public key.");
return NULL;
}
const char *ms... | [
-0.1700907200574875,
-0.05061320215463638,
0.5200615525245667,
-0.37601494789123535,
0.11854815483093262,
0.4367349147796631,
0.5696598291397095,
-0.361344575881958,
-0.3744891881942749,
-0.3571104109287262,
-0.4022992253303528,
0.4708162248134613,
-0.5122323632240295,
0.03528165817260742,... | |
this length
NSString *result = [QSStrings encodeBase64WithData:data];
free(rsa);
fclose(pubkey);
free(encrypted);
return result;
``` | [
0.1465383768081665,
-0.2449452131986618,
0.5557700395584106,
-0.1861979365348816,
0.04326856881380081,
-0.11066415160894394,
0.3637232482433319,
-0.651983916759491,
-0.39349615573883057,
-0.1402939409017563,
-0.4099392294883728,
0.24235603213310242,
-0.6297416090965271,
0.2598083019256592,... | |
I'm storing JodaTime `DateTime` field to `timestamptz` column by using `org.jadira.usertype:usertype.jodatime:1.9`. App server has +4 time zone. DB server +9 time zone. `new DateTime()` results in `${currentTime+1hour}+9` where +9 is time zone (correct value is `${currentTime+5hours)+9`).
I haven't found any related ... | [
-0.10424335300922394,
0.09012479335069656,
0.8071024417877197,
-0.19073431193828583,
0.08744463324546814,
-0.016493847593665123,
0.2895955741405487,
0.07175871729850769,
-0.2996711730957031,
-0.6953527331352234,
-0.11396489292383194,
0.5731377601623535,
-0.1709652841091156,
0.2855581641197... | |
But it's better to use [official hibernate support](http://joda-time.sourceforge.net/contrib/hibernate/index.html). It solves the problem out of the box because it uses `java.utl.Date` to persist `DateTime` and `java.util.Date` correctly persisted by default | [
0.13579770922660828,
-0.15386399626731873,
0.5091900825500488,
-0.11662116646766663,
0.11381550878286362,
-0.4748070538043976,
0.477263480424881,
0.11119717359542847,
-0.14416658878326416,
-0.256215900182724,
-0.1346760094165802,
0.18534904718399048,
-0.2628186345100403,
0.0503451675176620... | |
I'm working on a Java project using Eclipse as IDE and tortoiseGit as Git client.
I don't really want to commit the bin directory of the Eclipse project (containing \*.class files) but I want to ensure that one is able to run a freshly cloned project right from Eclipse.
If I remove the class files then I do only chec... | [
0.5181582570075989,
0.12465211004018784,
-0.12816786766052246,
-0.03980996832251549,
-0.34650662541389465,
-0.00920092687010765,
0.15374432504177094,
0.10831716656684875,
-0.1775612086057663,
-0.8588848114013672,
0.25589701533317566,
0.7071287035942078,
-0.16657055914402008,
0.463671654462... | |
files from \*.java source files. Would that do the trick anyway? Or do I have do something else to achieve what I want (runnable repository, no class files in it)?
Ok. I have spend 8 hours to solve the problem. If your are using [usertype](http://usertype.sourceforge.net/) project to persist JodaTime, you have to set `... | [
0.10862944275140762,
0.0011389036662876606,
0.7774480581283569,
-0.02818586863577366,
0.15378816425800323,
-0.3065527081489563,
0.6007700562477112,
0.012061831541359425,
-0.28283917903900146,
-0.48602592945098877,
-0.032419353723526,
0.48670998215675354,
-0.20993901789188385,
0.23305454850... | |
I am extracting the icon from .exes, but want to have a fallback generic icon if for some reason *Icon.ExtractAssociatedIcon(sPathOfExe)* fails.
Is there one I can resort to like so that would be safer than what I'm currently using:
```
private const string defaultIcon = @"C:\WINDOWS\ServicePackFiles\i386\msnms.ico";... | [
-0.17111681401729584,
-0.17316296696662903,
0.5047998428344727,
-0.16057884693145752,
0.10366498678922653,
0.3550315797328949,
0.4118000268936157,
-0.010210425592958927,
-0.3064667582511902,
-0.5574752688407898,
0.182087704539299,
0.6254637241363525,
-0.5590192079544067,
0.1639575064182281... | |
1. New -> Android project for testing the problem
2. Code for **Test.java**:
package test.density.yeah;
```
import android.app.Activity;
import android.os.Bundle;
public class TestActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInst... | [
0.15083329379558563,
-0.23857031762599945,
0.7966381907463074,
0.08406268805265427,
0.002874573227018118,
0.06411775201559067,
0.4287312626838684,
-0.8294282555580139,
-0.1076979786157608,
-0.7524486780166626,
-0.07280067354440689,
0.7175977826118469,
-0.3034815192222595,
-0.36979991197586... | |
and second is the same as the HTC Sensation XL is. When running this test app on them
it is the same problem. **HD2 (480x800, 190dpi) - small image**, **Sensation (480x800, 240dpi) - huge image**.
So why "**density independent pixels**" do not work?
It works fine, but there's a twist you need to know about.
You're us... | [
-0.0037158371414989233,
-0.5266202688217163,
0.44559767842292786,
0.30938905477523804,
-0.31651026010513306,
-0.055774156004190445,
0.07951080054044724,
-0.28697308897972107,
-0.16249501705169678,
-0.8820942640304565,
0.22491738200187683,
0.45575782656669617,
-0.18349267542362213,
0.006069... | |
bitmap size and use the layout\_width and layout\_height values to force the size, you need to use the background attribute, not src.
```
<ImageButton
android:background="@drawable/icon"
android:layout_width="200dp"
android:layout_height="200dp">
</ImageButton>
``` | [
-0.0594535693526268,
-0.5012430548667908,
0.6043915152549744,
0.021779509261250496,
-0.01968538947403431,
0.3166658580303192,
-0.022688675671815872,
-0.46546441316604614,
-0.2885752320289612,
-0.633633017539978,
-0.3218879997730255,
0.610403299331665,
-0.3370177447795868,
-0.29386806488037... | |
Hi guys could anyone tell me where im going wrong?
The basic aim of this class is to define a favourite items arraylist which in this case is about cars. The cars objects have a car name and a rating for car 1-5.
how do you see if a string is equal to the car objects rating.
im messing up the part where you compare ... | [
0.12751221656799316,
0.1202479898929596,
0.4235764741897583,
0.3126524090766907,
-0.4724033772945404,
-0.07992900907993317,
0.31672918796539307,
-0.0277821384370327,
-0.14443401992321014,
-0.24759797751903534,
0.31961145997047424,
0.6002839803695679,
-0.08592475205659866,
0.106510452926158... | |
the no cars with the rating. the searchForItems method checks if String description specified matches the cars name in array list, and hence returns the car in arraylist.
here is a glimpse of my two methods with constructors and variables:
```
public class FavouriteItems
{
private ArrayList<Item> cars;
/*... | [
0.21617740392684937,
-0.005455313716083765,
0.5015773177146912,
0.23332980275154114,
-0.12123826146125793,
0.41692671179771423,
0.05310048162937164,
-0.035194337368011475,
-0.40100061893463135,
-0.13493163883686066,
-0.0661546140909195,
0.6206040978431702,
0.04649340733885765,
0.3407653570... | |
* Add a new Item to your collection
* @param newItem The Item object to be added to the collection.
*/
public void addToFavourites(Item newItem)
{
cars.add(newItem);
}
/**
* Count the number of Items with a given rating
* @return The number of Items (Item objects)
* | [
0.46475449204444885,
-0.0335196889936924,
0.34594815969467163,
0.27654707431793213,
0.13459861278533936,
0.3794414699077606,
0.07271486520767212,
-0.31199386715888977,
-0.6439783573150635,
-0.3758307993412018,
-0.33893701434135437,
0.5343431234359741,
-0.049105916172266006,
0.2208541184663... | |
whose rating is rating (could be 0).
* If the rating parameter is outside the valid
* range 1..5 then print an error message and return 0.
*/
public int numberOfItemsOfRating(int rating)
{
int counter = 0;
if(rating >= 1 && rating <=5) | [
0.48699870705604553,
-0.18290597200393677,
0.4600624442100525,
-0.15985003113746643,
0.12075279653072357,
-0.008786242455244064,
0.5471644997596741,
-0.7297402024269104,
-0.07302438467741013,
-0.32728487253189087,
-0.01321395207196474,
0.5424769520759583,
-0.05110402777791023,
0.4227809607... | |
{
for ( int i =0; i < cars.size(); i++)
{
int num = rating;
String al = Integer.toString(rating);
if(cars.get(i).equals(al)) | [
0.11272862553596497,
-0.027551747858524323,
0.5576445460319519,
-0.0734262689948082,
0.13532283902168274,
0.4215010404586792,
0.05658202990889549,
-0.5433400273323059,
0.06444249302148819,
-0.2372889220714569,
-0.024485154077410698,
0.9327481985092163,
0.10755118727684021,
0.29051068425178... | |
{
counter++;
}
}
}
else
{
System.out.println("No cars match your ratings"); | [
0.21289575099945068,
-0.04535369202494621,
0.44211268424987793,
-0.05682016536593437,
0.03779347613453865,
0.03425002470612526,
0.26380977034568787,
-0.07636172324419022,
0.10300158709287643,
-0.24407528340816498,
-0.22542785108089447,
0.885902464389801,
-0.027503199875354767,
0.2713915407... | |
counter = 0;
}
return counter;
}
/**
* Find the details of a Item given its description
* @return Item object if its description is in the collection
* or null if there is no item with that description
*/
public Item searchForItem(String description)
{ | [
0.005302084144204855,
-0.27922412753105164,
0.1778951734304428,
-0.04312589019536972,
-0.029820391908288002,
0.19778509438037872,
0.28089046478271484,
-0.28782418370246887,
-0.3339259624481201,
-0.4556600749492645,
-0.30848896503448486,
0.38121962547302246,
-0.2726653814315796,
0.592643260... | |
for(int i=0; i<cars.size(); i++)
{
if(cars.equals(description))
{
return cars.get(i);
}
else
{ | [
0.2222396433353424,
-0.005747930612415075,
0.40444326400756836,
0.10111689567565918,
0.2593814730644226,
0.4875888526439667,
0.11792862415313721,
-0.31085067987442017,
-0.13134774565696716,
-0.4653174877166748,
-0.18639717996120453,
0.9875319004058838,
0.09512069821357727,
0.23138171434402... | |
return null;
}
}
}
}
```
This is not the way you should use the equals method, instead I suggest you use or implement `Item#getRating()` and `Item#getDescription()`. Use `cars.get(i).getDescription().equals(description)` to check for the description. To check for the rating use `cars.get(i... | [
0.14546307921409607,
0.26933953166007996,
0.34080177545547485,
0.05223580449819565,
-0.13037490844726562,
-0.02718455344438553,
0.0916113629937172,
-0.4661320149898529,
0.04499571770429611,
-0.5008137822151184,
0.07197699695825577,
0.7782211303710938,
-0.39311546087265015,
0.13649500906467... | |
I am making an email application which is giving the error in this question's title. How can I fix this problem? I am giving my codes screenshot if it is helps to find solution.

Seems to be something they intentionally broke in ADT r17. See <http://c... | [
0.38684725761413574,
0.16588149964809418,
0.2732037901878357,
0.07491978257894516,
0.013495967723429203,
0.19479645788669586,
0.4831814467906952,
-0.04823073372244835,
-0.33161887526512146,
-0.5140621662139893,
0.15325744450092316,
0.3701302111148834,
-0.08810919523239136,
0.00318488641642... | |
Hi i manage to make the icon center same line with the text in linear view, but I wanna add in a arrow image at the right side so i have to switch to relative view. As shown in the image, I can't manage to set the relative view left icon look like linear view.
**EDIT**
I want to arrow icon stay on the right.

(scenario - I'm importing data from a file, if I import the same file ... | [
0.1495313048362732,
0.0847216472029686,
0.17862781882286072,
0.24122211337089539,
0.2637168765068054,
0.11498995125293732,
0.2561819851398468,
-0.44846832752227783,
-0.26586776971817017,
-0.5661163926124573,
0.042150821536779404,
0.4725766181945801,
-0.13117098808288574,
0.1864297986030578... | |
add - I need to use AddObject, if I want to modify - I need to use attach and ChangeObjectState).
is there a way to avoid the search - than do one of the 2 options ?
(looking for "Add or Update" way....)
Thanks.
No. In EF you must know if you want to insert or update the entity => if you don't know it you must firs... | [
0.14711174368858337,
0.14205513894557953,
0.4707602262496948,
0.19138415157794952,
0.013172397390007973,
-0.2218262404203415,
-0.15518295764923096,
-0.2885572910308838,
-0.1570064127445221,
-0.6124314069747925,
0.011355238035321236,
0.8049055933952332,
-0.527111828327179,
-0.10760780423879... | |
of direct SQL this whole can be done in the single database roundtrip (SQL Server 2008 offers special command `MERGE` this) whereas EF needs separate roundtrip for search and separate roundtrip for update or insert.
Edit: Another solution with better performance would be to fetch all data to database by some quick way... | [
0.11220961809158325,
-0.044280797243118286,
0.4886026680469513,
0.22561711072921753,
-0.3129833936691284,
-0.24257919192314148,
-0.12315962463617325,
-0.2631455957889557,
-0.1318795084953308,
-0.5043747425079346,
-0.10398799926042557,
0.46525922417640686,
-0.5064619779586792,
0.25312331318... | |
I am using VS2010, i want to create a snippet to do the following:
When I press `{` or `(` then press tab the snippet writes `)` or `}`. I created the snippets but when I write `{` or `(` which are specified as the snippets shortcuts they does not work
Please help
You just can't use these characters for the snippet s... | [
0.50218266248703,
-0.019610842689871788,
0.4560094177722931,
0.12092791497707367,
-0.08192338049411774,
0.27129465341567993,
0.15126213431358337,
0.10317176580429077,
-0.30185288190841675,
-0.6348481774330139,
-0.22558850049972534,
0.25481116771698,
-0.18382374942302704,
-0.118459291756153... | |
tilde character (~), the underscore character (\_), and the en dash character (-). | [
-0.19947105646133423,
-0.4900585412979126,
0.3040689527988434,
-0.11404306441545486,
-0.22028180956840515,
0.3693452775478363,
-0.04033822566270828,
0.092962346971035,
0.05510171130299568,
-0.6866109371185303,
-0.3255878686904907,
0.4317602813243866,
-0.0920504778623581,
-0.165569335222244... | |
I can never seem to be able to create MySQL tables with columns of the type TEXT. Here's my MySQL:
```
CREATE TABLE factions(id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), name VARCHAR(16) NOT NULL, desc TEXT NOT NULL, admins TEXT NOT NULL, mods TEXT, members TEXT, land TEXT, enemies TEXT, allies TEXT)
```
When it... | [
0.006927561014890671,
0.3126058280467987,
0.4866200387477875,
-0.000527518626768142,
-0.21055617928504944,
-0.026943987235426903,
0.3494085669517517,
-0.2082529217004776,
-0.22680696845054626,
-0.8986529111862183,
-0.009409741498529911,
0.5464110970497131,
-0.1393069475889206,
0.1463323086... | |
what's wrong! I'm using Java if it makes any difference.
`desc` is a reserved word and **shouldn't** be used as a name of a column. You **can** use `desc` as a name of a column, but if you do, you must always wrap it in back-ticks.
```
CREATE TABLE factions(
id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY(id),
n... | [
0.09850949048995972,
0.24469797313213348,
0.37796708941459656,
0.10100583732128143,
-0.043087176978588104,
-0.07348784059286118,
0.34465137124061584,
-0.14777646958827972,
-0.5168875455856323,
-0.781989336013794,
-0.15945905447006226,
0.42281025648117065,
-0.31105297803878784,
0.4083641469... | |
land TEXT,
enemies TEXT,
allies TEXT
);
```
The above is tested and works, but since you'll always have to wrap it in back-ticks (in every `INSERT`, `UPDATE` and `DELETE`) you may want to change the name, or just get in the habit of wrapping all fields in back-ticks, which has other advantages. | [
-0.09125587344169617,
-0.10699775069952011,
0.37690335512161255,
-0.003866263898089528,
-0.1364574283361435,
-0.17036356031894684,
0.2858087718486786,
-0.10349325835704803,
-0.02257508784532547,
-0.4186275601387024,
-0.49948033690452576,
0.48109692335128784,
0.05342787876725197,
-0.1100446... | |
I have a problem with top 20px behind status bar, specifically I cannot put anything there.
When I created the UI I used the storyboard approach and set status bar style to translucent black. But when do the layout in Xcode my views' height is fixed to 460px (grayed out).
Please help.
---
Got an answer from a frien... | [
0.10001200437545776,
-0.19438929855823517,
0.939407229423523,
-0.11988720297813416,
-0.15589570999145508,
0.1447179913520813,
0.12158425152301788,
-0.016063617542386055,
-0.22804073989391327,
-0.8679628372192383,
0.13026703894138336,
0.7448734641075134,
0.026315703988075256,
0.159571081399... | |
height to 480px: <http://cl.ly/1p1b0e060p1Y37393D08>
3. Ensure status bar style is translucent black in the Info.plist: <http://cl.ly/153Y391S1b0G3J3z3Y1O>
4. Get satisfactory result: <http://cl.ly/0Q1M390i3A3h2F3u2T19>
Here's solution without single line of code.
1. In Interface Builder set up the view controller as ... | [
-0.12254412472248077,
-0.3371116816997528,
1.0865468978881836,
0.018214546144008636,
-0.10337436199188232,
0.24484902620315552,
0.03968515619635582,
-0.42166668176651,
-0.18879950046539307,
-0.7261505722999573,
-0.11181370913982391,
0.7135598659515381,
0.19101235270500183,
-0.1102163344621... | |
I often save `:w` and commit to SVN `svn commit -m "Ticket 351"` as two operations. Is there a way to combine them into a single operation so that I might just `:``⇑``Enter` when the need arises? I don't want to map a key as I will sometimes have to change the commit message.
Thanks.
Use `|` as a command separator (se... | [
0.1318681687116623,
0.09373660385608673,
0.09750610589981079,
-0.010618269443511963,
0.07883084565401077,
-0.05900535732507706,
0.3282404839992523,
-0.2055319994688034,
0.011312207207083702,
-0.6755476593971252,
0.06615617126226425,
0.6435886025428772,
-0.254848450422287,
-0.05983397737145... | |
I need hide tooltip on mouseout of link, BUT not if mouseover on tooltip (both have different parents)
For example: we can see it on Facebook when hover on names or avatars friends
I try this but every time i get FALSE
```
$('a').bind('mouseleave', function () {
var i = $('div.tooltip').is('hover');
i... | [
0.09654141962528229,
-0.27455174922943115,
0.503411591053009,
-0.2540813386440277,
0.13410182297229767,
-0.1940523087978363,
0.5524055361747742,
-0.12356685101985931,
0.21568821370601654,
-0.9318812489509583,
0.24299970269203186,
0.6522337794303894,
-0.25962626934051514,
0.1060613617300987... | |
});
```
How i can check both condition?
Use `|` as a command separator (see `:help :bar`):
```
:w|!svn commit -m foo
``` | [
-0.20491766929626465,
0.35357967019081116,
0.4666476547718048,
-0.3654419481754303,
0.19400554895401,
-0.013147391378879547,
0.3625866174697876,
-0.33187174797058105,
0.017652826383709908,
-0.1730552762746811,
-0.42760908603668213,
0.8071939945220947,
-0.46373799443244934,
0.21219186484813... | |
Here is what I have so far:

**Javascript:**
```
$(document).ready(function() {
$(".thumb_wrapper").click(function() {
$(this).addClass("active");
});
});
```
So this is working, it is adding the class but I want only one item to be... | [
0.012977967970073223,
-0.08571439981460571,
0.5294443368911743,
-0.030617142096161842,
0.08960799127817154,
-0.23133128881454468,
0.3100135922431946,
-0.24817334115505219,
-0.2868880033493042,
-0.8592004776000977,
-0.11021732538938522,
0.7683931589126587,
-0.4202459454536438,
0.16558405756... | |
Try this:
```
$(".thumb_wrapper").click(function() {
$(".thumb_wrapper").removeClass("active");
$(this).addClass("active");
});
``` | [
-0.11439456045627594,
-0.365673691034317,
0.266946941614151,
-0.4890120327472687,
0.4353496730327606,
-0.22915667295455933,
0.33062687516212463,
-0.16868159174919128,
-0.08095674216747284,
-0.46706387400627136,
-0.3459978997707367,
0.8493948578834534,
-0.5810524821281433,
0.083689875900745... | |
```
try
{ // `count()` throws exception
connect(thread, SIGNAL(started()), engine, SLOT(count()));
}
catch(const X& e)
{}
```
As of Qt-5, I get following error:
> Qt has caught an exception thrown from an event handler. Throwing
> exceptions from an event handler is not supported in Qt.
> You must not let any... | [
0.16701637208461761,
0.1782408207654953,
0.26720643043518066,
-0.08433917909860611,
0.12171351164579391,
-0.3444977402687073,
0.6059733033180237,
-0.3022657334804535,
-0.1426214575767517,
-0.5523027181625366,
-0.1602020561695099,
0.46724480390548706,
-0.3653795123100281,
0.2785798907279968... | |
catch it?
This is exactly why Qt does not support throwing exceptions across signal/slot connections. If you try it, you'll see this message:
> Qt has caught an exception thrown from an event handler. Throwing
> exceptions from an event handler is not supported in Qt. You must
> reimplement QApplication::notify() a... | [
0.3807809054851532,
-0.35363584756851196,
-0.13560029864311218,
-0.004492943175137043,
-0.2033160924911499,
-0.39257878065109253,
0.5554598569869995,
-0.082237608730793,
-0.2611576020717621,
-0.3138159513473511,
0.08519297093153,
0.24725934863090515,
-0.4992791712284088,
0.1008530035614967... | |
part of a function in a 3rd-party library that you're using?
No slot in any official Qt library throws, so if you're using a third-party library with a slot that throws, it's probably a sign that it's not a good library. If you want to use it anyway, I recommend that rather than catching it in `QApplication::notify`, ... | [
0.15726295113563538,
-0.1996733546257019,
-0.2908657491207123,
0.2708486020565033,
-0.015570378862321377,
-0.19053368270397186,
0.24519109725952148,
-0.062208980321884155,
-0.09732113033533096,
-0.5214969515800476,
-0.034385763108730316,
0.30431392788887024,
-0.37537890672683716,
0.0526003... | |
to the sketchy third-party object's slot, connect to your newly create object's slot.
Doing the exception catching this way keeps related code together, and prevents `QApplication::notify` from filling up with a bunch of unrelated try/catch blocks if you encounter more than one of these problematic functions.
For exa... | [
0.07876933366060257,
-0.29036059975624084,
0.24472247064113617,
-0.055375538766384125,
0.16794806718826294,
0.1484450101852417,
0.20584119856357574,
-0.4616742432117462,
-0.14041019976139069,
-0.5985855460166931,
-0.26888546347618103,
0.33749324083328247,
-0.6052859425544739,
0.24816571176... | |
std::cerr << e.what() << std::endl;
}
}
};
int main() {
BadCounter engine;
CounterAdaptor adaptor(&engine);
QThread* thread = new QThread();
connect(thread,SIGNAL(started()),&adaptor,SLOT(count()));
thread.start();
... // etc...
delete thread;
}
```
---
**What if you want to handle something th... | [
-0.030655547976493835,
-0.2338314801454544,
0.12570379674434662,
-0.1270609200000763,
0.06289797276258469,
-0.05328051373362541,
0.5167537927627563,
-0.17009344696998596,
-0.5593176484107971,
-0.573326826095581,
-0.3601837456226349,
0.4253104627132416,
-0.4506525993347168,
0.39070808887481... | |
`QApplication::notify` in your own subclass as shown in [jichi's answer](https://stackoverflow.com/a/14804711/331041). Using a global handler for global concerns is quite reasonable. | [
-0.15254361927509308,
-0.25605204701423645,
-0.1721998006105423,
-0.05325498804450035,
-0.13637235760688782,
-0.27962836623191833,
0.3533468246459961,
-0.41496899724006653,
-0.183548241853714,
-0.16957829892635345,
-0.17838287353515625,
0.26651498675346375,
-0.5399479866027832,
-0.00069018... | |
```
public class IRock
{
public List<IMineral> getMinerals();
}
public class IMineral { ... }
public class SedimentaryMineral implements IMineral { ... }
public class SedimentaryRock implements IRock
{
private List<SedimentaryMineral> minerals;
@Override
public List<SedimentaryMineral> getMinerals()... | [
0.4670134484767914,
0.3189910054206848,
0.30959320068359375,
-0.026226000860333443,
0.11594545841217041,
0.28273338079452515,
0.19954867660999298,
-0.17009204626083374,
-0.05337076634168625,
-0.33340105414390564,
0.058448225259780884,
0.9025848507881165,
-0.21777518093585968,
0.58953785896... | |
Shouldn't Java honor the fact that `SedimentaryMineral` is an impl of `IMineral` and allow this?!?
Along with an explanation as to why I'm getting this compiler error, perhaps someone could point out why my approach here is "bad design" and what I should do to correct it. Thanks in advance!
Imagine if this compiled:
... | [
0.26548489928245544,
0.19762170314788818,
0.47042301297187805,
-0.23457656800746918,
0.16055193543434143,
-0.21156741678714752,
0.3397364914417267,
-0.297210156917572,
-0.07481039315462112,
-0.5947613716125488,
-0.149758443236351,
0.5841918587684631,
-0.29149243235588074,
0.477494478225708... | |
might be an easy question but i'm fairly new to regular expressions.
given a paragraph, i would like to locate a particular sentence that begins with the specified word and replace the entire sentence with something else.
how can i build a regexp to search for a sentence that begins with a particular word, which can ... | [
-0.12038659304380417,
0.02862302027642727,
0.2480514645576477,
-0.13670426607131958,
-0.07153098285198212,
0.19802795350551605,
0.13028180599212646,
-0.009075634181499481,
-0.24476982653141022,
-0.45285454392433167,
-0.3928406536579132,
0.1354491412639618,
0.003233618102967739,
-0.04457710... | |
the previous sentence (or the beginning of the string in the case of the first sentence), followed by spaces, then the start character sequence (in this case, `foo3`), followed by all non-period characters leading up to the period ending that sentence.
Demo: <http://www.rubular.com/r/ROl2odiDn5>
---
Here's how repla... | [
-0.21251711249351501,
-0.13047608733177185,
0.517646849155426,
-0.3075024485588074,
0.1956942230463028,
0.29235655069351196,
0.37488502264022827,
-0.18627358973026276,
-0.26791006326675415,
-0.35938358306884766,
-0.8674255013465881,
0.6540328860282898,
-0.2770765423774719,
-0.1817476749420... | |
that the state of the other sentences in the paragraph remains unchanged. Note also that this example will update all matching sentences, since I use the `/g`(global) flag. If you only want to change the first sentence, remove the `g`, or make your sentence matching more specific by including more beginning words.
Dem... | [
0.00655147060751915,
-0.17695409059524536,
0.18600182235240936,
-0.01743708923459053,
-0.1674743890762329,
0.01195433083921671,
0.4691672921180725,
0.06319696456193924,
-0.20680709183216095,
-0.8188385963439941,
-0.3272539973258972,
0.613379955291748,
-0.3049094080924988,
-0.33649411797523... | |
I wonder what is the difference between them. Are they describing the same thing?
Is Google App Engine Service [Task Queue](https://developers.google.com/appengine/docs/java/taskqueue/overview) is an implementation of Message Queue?
I asked a similar question on some Developer Community Groups on Facebook. It was not ... | [
0.4007295072078705,
0.05892179161310196,
0.10891010612249374,
-0.021705245599150658,
-0.4715213179588318,
0.5336093306541443,
-0.07274249941110611,
0.16030281782150269,
-0.5654610991477966,
-0.49679601192474365,
0.24875408411026,
0.1864292323589325,
-0.4200107157230377,
0.13972395658493042... | |
which takes away the complexity of having
> to manage the internal queueManagement/queueAdministration activities
> etc"?
>
>
> I understand the book language which says "Celery is a task queue" and
> "RabbitMQ is a message broker". However, it seems a little confusing
> as a first-time celery user because we ha... | [
0.05052127689123154,
0.09596027433872223,
0.3852072060108185,
0.036466438323259354,
-0.2860981523990631,
0.4767411947250366,
-0.009413660503923893,
0.06950759887695312,
-0.4414984881877899,
-0.5398808717727661,
-0.2412237524986267,
-0.10956640541553497,
-0.5843757390975952,
0.0614349730312... | |
>
> Celery is a Task Queue. It receives tasks with their related data,
> runs them and delivers the results.
>
>
> Let's forget Celery for a moment. Let's talk about RabbitMQ. What
> would we usually do? Our Django/Flask app would send a message to a
> queue. We will have some workers running which will be waiti... | [
0.3607049286365509,
0.18730111420154572,
0.31572043895721436,
0.3348572850227356,
-0.24889861047267914,
0.21443593502044678,
-0.2158462107181549,
0.2376062572002411,
-0.606688916683197,
-0.6683480739593506,
0.13173457980155945,
-0.0770525187253952,
-0.24071812629699707,
0.03037425130605697... | |
the details of AMQP or RabbitMQ. We can use Redis
> or even a database (MySQL for example) as a message broker. Celery
> allows us to define "Tasks" with our worker codes. When we need to do
> something in the background (or even foreground), we can just call
> this task (for instant execution) or schedule this tas... | [
0.16644413769245148,
-0.17418602108955383,
0.13489995896816254,
0.3358251750469208,
-0.0910460352897644,
0.04754665493965149,
-0.02863393910229206,
-0.08187495172023773,
-0.26063331961631775,
-0.9916362166404724,
0.040734369307756424,
0.3050149083137512,
-0.4477531611919403,
-0.09888330101... | |
result or even task progress when needed.
>
>
> You can use Celery as an alternative for cron job too (though I don't
> really like it)!
[Another response](https://www.facebook.com/groups/pxperts/permalink/1086383271372982/?comment_id=1086408768037099&offset=0&total_comments=2&comment_tracking=%7B%22tn%22%3A%22R%2... | [
0.08033270388841629,
-0.06852135807275772,
0.5598516464233398,
0.3292461037635803,
-0.39459410309791565,
0.31377917528152466,
-0.23194219172000885,
0.16298425197601318,
-0.5291317701339722,
-0.4042346179485321,
-0.11127377301454544,
0.06007227301597595,
-0.04393480345606804,
0.018915975466... | |
with such
> events without having to write the producer / consumer from scratch.
Eventually, here is what I took home as my final learning:
> Celery is a queue Wrapper/Framework which takes away the complexity of
> having to manage the underlying AMQP mechanisms/architecture that come
> with operating RabbitMQ dir... | [
0.5048359632492065,
0.2375148981809616,
0.04759367182850838,
0.16207556426525116,
0.032524146139621735,
-0.058174289762973785,
0.12503565847873688,
0.07601521164178848,
0.019488748162984848,
-0.513761579990387,
0.1086595207452774,
0.3014611601829529,
-0.12264273315668106,
-0.05285091325640... | |
Ever since I updated my projects for VS 11 I can't get my @Model intellisense to work in either version of Visual Studio (2010 or 11). I've tried reverting the .csproj file to remove the VS 11 references, but to no avail. Other MVC 3 Razor project are working just fine. Anyone experience this?
I asked a similar questio... | [
0.6229375600814819,
-0.11021935194730759,
0.11473006010055542,
0.028984367847442627,
-0.618402361869812,
0.08668128401041031,
0.3818491995334625,
0.14334876835346222,
-0.3189981281757355,
-0.4989449083805084,
0.39378678798675537,
0.6022559404373169,
-0.1642809957265854,
-0.0751799046993255... | |
the topic and fairly clarifies the difference between a message queue and a task queue.
I asked:
> Will it be appropriate to say that "Celery is a
> QueueWrapper/QueueFramework which takes away the complexity of having
> to manage the internal queueManagement/queueAdministration activities
> etc"?
>
>
> I under... | [
0.07418684661388397,
-0.02745433710515499,
0.09065159410238266,
0.10743480175733566,
-0.37447354197502136,
0.17438621819019318,
-0.22825583815574646,
0.26143917441368103,
-0.40716737508773804,
-0.6414111852645874,
0.09125594049692154,
0.050412409007549286,
-0.09079410880804062,
0.075463898... | |
constrast with
> rabbitMQ
[A response](https://www.facebook.com/groups/pythonbd/permalink/677928095641944/?comment_id=677936985641055&offset=0&total_comments=2&comment_tracking=%7B%22tn%22%3A%22R%22%7D) I got from ***Abu Ashraf Masnun***
> Task Queue and Message Queue. RabbitMQ is a "MQ". It receives messages
> and... | [
0.15850356221199036,
-0.004502507857978344,
0.5508251786231995,
0.1431739181280136,
-0.29543134570121765,
0.3195497393608093,
0.13598033785820007,
-0.06762467324733734,
-0.5491852164268494,
-0.4932832717895508,
-0.23825758695602417,
0.09893577545881271,
-0.6874012351036072,
0.0539685003459... | |
arrives, it starts
> working and processes the tasks.
>
>
> Celery manages this entire process beautifully. We no longer need to
> learn or worry about the details of AMQP or RabbitMQ. We can use Redis
> or even a database (MySQL for example) as a message broker. Celery
> allows us to define "Tasks" with our wor... | [
-0.10846798866987228,
-0.22065304219722748,
0.4470573365688324,
0.106516994535923,
-0.08920665085315704,
0.19165441393852234,
-0.062244120985269547,
-0.07697493582963943,
-0.2526467442512512,
-1.2881966829299927,
-0.1973036676645279,
0.027564460411667824,
-0.19915153086185455,
0.0214812569... | |
the
> tasks. It would launch workers which would know how to run your
> defined tasks and store the results. So you can later query the task
> result or even task progress when needed.
>
>
> You can use Celery as an alternative for cron job too (though I don't
> really like it)!
[Another response](https://www.f... | [
0.07376831024885178,
0.11594870686531067,
0.5194350481033325,
0.45719286799430847,
-0.4887760579586029,
0.3028222322463989,
-0.09994897246360779,
0.20959807932376862,
-0.2510544955730438,
-0.4993044435977936,
-0.06055223196744919,
0.39966917037963867,
-0.17542995512485504,
0.06387668848037... | |
for example with
> rabbitmq. Celery itself is not the queue. The events queues are stored
> in the system of your choice, celery helps you to work with such
> events without having to write the producer / consumer from scratch.
Eventually, here is what I took home as my final learning:
> Celery is a queue Wrapper/... | [
0.28924667835235596,
0.021570153534412384,
0.14637497067451477,
0.25066426396369934,
-0.10344011336565018,
0.07305961102247238,
-0.11107838898897171,
0.04690505936741829,
-0.1499047875404358,
-0.6998141407966614,
0.09919454157352448,
0.10044332593679428,
-0.2691528797149658,
-0.05255473777... | |
I have an image width a width of 75% and a p-box with a width of 25%, but they won't fit in their parent container!
<http://jsfiddle.net/bmBnF/4/>
I'd try adjusting this a bit:
```
.flexslider .slides img {
float: left; /* leave other properties */
}
.flex-caption {
width: 16%; /* leave others - width is 16%... | [
0.29807916283607483,
-0.06531575322151184,
0.9260842204093933,
-0.1878606379032135,
-0.11458443105220795,
0.25466281175613403,
0.03204027935862541,
-0.5368801355361938,
-0.4097132086753845,
-0.898467481136322,
0.17646904289722443,
0.539021372795105,
0.007146145217120647,
-0.074553720653057... | |
I need `$('.mk[value=x]')` to work, but it does Not while `$('.mk[value=1]')` does.
Please someone help
```
<body>
<span class="mk" value="1">1</span>
<span class="mk" value="1">1</span>
<span class="mk" value="3">3</span>
<input id="update" type="button" value="1" />
</body>
<script type="text/javascript">
$('#updat... | [
0.072557233273983,
0.11691351979970932,
0.983034610748291,
-0.282589316368103,
0.020973315462470055,
0.022537386044859886,
0.45445820689201355,
-0.8587179183959961,
0.08126325905323029,
-0.7564957141876221,
-0.3714102804660797,
0.7637244462966919,
-0.20471100509166718,
-0.09215797483921051... | |
is not a valid attribute of `span`, so this code will cause validation issues. | [
0.40239977836608887,
0.138825923204422,
0.36225342750549316,
0.084380604326725,
0.027718907222151756,
-0.314557820558548,
0.2858354449272156,
-0.18837279081344604,
-0.12258235365152359,
0.023798275738954544,
-0.28979405760765076,
0.4440170228481293,
-0.09486494958400726,
0.0031579548958688... | |
Is there any one who can explain this code to me?
This is an old exam question and i can't find an answer on the net.
> ```
> void (*x)();
> x=0xFFFF0000;
> printf("1"); x();
> printf("2"); x();
> printf("3"); x();
>
> ```
On classic real-mode x86 architectures, you could trigger a system boot by doing an uncond... | [
0.13314051926136017,
-0.09702660143375397,
0.2500503659248352,
-0.1627131849527359,
-0.03069809451699257,
-0.2579733431339264,
0.4570600390434265,
-0.21956712007522583,
-0.036943744868040085,
-0.35622018575668335,
-0.2410828024148941,
0.7251269817352295,
-0.5607268214225769,
0.185652405023... | |
code, triggering a system reboot. | [
0.29893729090690613,
0.023306025192141533,
-0.4101108908653259,
0.2526487112045288,
-0.10353397578001022,
-0.07766412198543549,
0.3583258092403412,
0.09199841320514679,
-0.0997677594423294,
-0.3119356632232666,
-0.3516543507575989,
0.5471355319023132,
-0.5303168892860413,
0.063852019608020... | |
within powershell I'd like to learn the best way to call a variable to a start job so I don't have to edit the script for each server as it will be specific based on the client I've placed my script on.
```
$Servername = 'Server1'
$pingblock = {
pathping $servername | Out-File C:\client\PS\ServerPing.TXT
... | [
-0.014499813318252563,
-0.054426658898591995,
0.553112804889679,
0.08427239954471588,
0.2459433674812317,
-0.20371495187282562,
-0.0867534801363945,
-0.4510766863822937,
-0.13418959081172943,
-0.6336076259613037,
-0.32391294836997986,
0.5985701084136963,
-0.4148475229740143,
-0.02150928415... | |
$p"} -Arg 'Server1'
```
In your case:
```
$pingblock = {param($servername) pathping $servername | Out-File C:\...\ServerPing.txt}
Start-Job $pingblock -Arg Server1
``` | [
-0.37692853808403015,
0.15068495273590088,
0.6078558564186096,
-0.24166525900363922,
0.05453166738152504,
-0.028677253052592278,
0.0393456369638443,
-0.27212634682655334,
-0.48176971077919006,
-0.5052379965782166,
-0.3244507312774658,
0.36423173546791077,
-0.4817943871021271,
-0.1401241123... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.