text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
the constructor, it works right
week = {}
```
Python follows a very simple rule: things that are written inside the `class` block belong to the class, not to individual objects. To attach something to an object named `self`, you assign to one of its `self.attributes`. In this regard, `__init__` is not special; it may... | [
-0.014401331543922424,
0.2653198540210724,
0.0026504304260015488,
-0.06022576987743378,
-0.24611419439315796,
-0.018442697823047638,
0.027947358787059784,
-0.094957634806633,
-0.2193746417760849,
-0.36752983927726746,
-0.16093692183494568,
0.3811523914337158,
-0.42081326246261597,
0.157654... | |
(since every object gets `__init__` called) that **hides** the one in the class. When attributes are **looked up**, they are looked up in the class as well as the object (if they can't be found in the object), but when they are **assigned**, they are simply assigned to the thing that you say to assign it to. (To modify... | [
-0.36193472146987915,
0.021982207894325256,
-0.19333617389202118,
0.23006531596183777,
-0.10395326465368271,
-0.07778938114643097,
0.36819326877593994,
0.03265921398997307,
-0.18840380012989044,
-0.5706274509429932,
-0.3400071859359741,
0.362539678812027,
0.05527076497673988,
0.18924804031... | |
can create new attributes of the class later.
Now, since `__init__` is not special, let's say we do the work of one of the sample functions inside `__init__`:
```
self.week["Friday"] = "gotta get down"
```
Do you see the difference? `week["Friday"]` is not an attribute name; `week` is. So we *cannot create a new at... | [
-0.027942970395088196,
-0.037945087999105453,
0.3607916831970215,
0.19189989566802979,
-0.2784080505371094,
0.11642614752054214,
0.46093127131462097,
0.10379128903150558,
-0.3189113736152649,
-0.5312469601631165,
-0.036616917699575424,
0.4517563283443451,
-0.06430434435606003,
0.2264391332... | |
only one `Song.week`.
*If we replaced `self.name = name` with something that modifies the existing object, then we would see the same behaviour*. However, we **can't** actually do that: the initial value of `self.name` is `''`, which is a string, and Python strings provide *no way to modify them in-place*. When you re... | [
-0.2034904509782791,
-0.1019865870475769,
0.29677814245224,
-0.005294767674058676,
-0.4065263569355011,
0.04391244426369667,
0.2976701557636261,
0.09030000120401382,
-0.29416772723197937,
-0.0831906720995903,
-0.16106905043125153,
0.3777676522731781,
-0.19798308610916138,
0.110804587602615... | |
explicitly refer to `Song.name`.
The simple solution is to set up the attribute in `__init__`:
```
self.week = {}
``` | [
-0.04021936282515526,
0.11221390962600708,
0.2453262209892273,
-0.007638024631887674,
-0.1349608600139618,
0.02161523513495922,
0.29610884189605713,
0.2395622581243515,
0.03240584954619408,
-0.08976075053215027,
-0.01436527632176876,
0.24940848350524902,
-0.09422542154788971,
0.08124613016... | |
Just want to do `$_SERVER['PHP_SELF']` as a link with ?logout=1 appended to it.
```
<a href="<?php echo ''$_SERVER['PHP_SELF']'.logout=1' ?>" id="add"><input type="button" value="LOGOUT" /></a>
```
gives
```
Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in F:\export\srv\www\vhosts\main\ht... | [
0.5119712352752686,
-0.03468715026974678,
0.6780574321746826,
-0.007534526754170656,
0.589130163192749,
0.02979453280568123,
0.40293455123901367,
-0.15563496947288513,
-0.13213203847408295,
-0.4697122573852539,
-0.08305848389863968,
0.5903022289276123,
-0.4283372163772583,
-0.3282386660575... | |
The project has a goal: use interface centric design. Basically we declare classes of only public pure functions and have real classes inherit from them.
One question comes up now - how to reuse the utility functions?
Here is an example:
```
class InterF1 {
public:
int f1() = 0;
int g1() = 0;
};
clas... | [
0.017234869301319122,
-0.43977630138397217,
-0.008700570091605186,
0.03716529533267021,
-0.1353905349969864,
0.3135710656642914,
0.33989018201828003,
-0.335689514875412,
-0.03237762302160263,
-0.5622856616973877,
-0.01527354959398508,
0.5204729437828064,
-0.7442758679389954,
0.231287375092... | |
int f1();
int g1();
int f2();
};
```
While I am implementing C1::f1() and C2::f1(), I see code duplication between these 2 functions. How should I remove the duplication?
Here are my thoughts:
1) I can add protected to interface class like this:
```
class InterF1 {
public:
int f1() = 0;
int g1() ... | [
-0.16244010627269745,
-0.22344818711280823,
0.357247531414032,
-0.026298779994249344,
0.05079512670636177,
0.24376416206359863,
-0.01222299039363861,
-0.3848639726638794,
-0.08347389101982117,
-0.8342896699905396,
-0.021661510691046715,
0.724611759185791,
-0.6814554333686829,
-0.1408629715... | |
int util(int in_var) = 0;
};
```
In this design, InterF1, C1 and C2 are changed to
```
class InterF1 {
public:
int f1(UtilI u) = 0;
int g1() = 0;
};
class C1: public InterF1 {
public:
int f1(UtilI u);
int g1();
};
class C2: public InterF1, InterF2 {
public:
int f1(UtilI u);
int g... | [
-0.23488739132881165,
-0.36015379428863525,
0.6253440976142883,
-0.03455208241939545,
0.0021649813279509544,
0.6053327322006226,
0.15331213176250458,
-0.24623426795005798,
0.004193601664155722,
-0.8107600808143616,
-0.30201831459999084,
0.6361773014068604,
-0.7620494365692139,
0.1713312119... | |
it does look better. But I have one concern, InterF1 and InterF2 themselves should be higher level abstraction than UtilI which is more of implementation detail, am I mixing the 2 levels? Another words, if implementation changes later, I will need to come back to update f1() and f2() signature again, that does not soun... | [
0.21828234195709229,
-0.11644916236400604,
0.22801513969898224,
0.1008656695485115,
-0.12803474068641663,
-0.043860238045454025,
0.2751566767692566,
-0.1313021034002304,
-0.05787696689367294,
-0.8371785879135132,
0.1670936793088913,
0.8386527895927429,
-0.2417595088481903,
-0.2025351971387... | |
instead I'd recommend either:
1. **Create an intermediate implementation class**
This approach is okay if every class that wants to implement `InterF2` also wants to implement `InterF1`.
The approach is to implement
```
class InterF1Impl: public InterF1 {
public:
int f1();
int g1();
}
```
Then `C1` and ... | [
-0.034815117716789246,
-0.12442951649427414,
0.07035838812589645,
0.026674816384911537,
-0.054211460053920746,
0.028948359191417694,
-0.04904074966907501,
-0.15625323355197906,
-0.16355788707733154,
-0.8831030130386353,
-0.14310328662395477,
0.6214824914932251,
-0.5342358350753784,
-0.1273... | |
include an implementation class**.
In this approach, implement `InterF1Impl: public InterF1` as above, but instead of *deriving* `C1: public InterF1Impl`, let `InterF1Impl` be one part of the `C1` class.
```
class C1: public InterF1 {
private:
InterF1Impl * f1impl;
public:
int f1();
int g1();
}
```
... | [
-0.0642487108707428,
0.03479096293449402,
0.1993597000837326,
-0.014013719744980335,
0.12354579567909241,
-0.08328091353178024,
-0.06636890023946762,
-0.3555181324481964,
-0.450087308883667,
-0.5065646767616272,
-0.40876200795173645,
0.4314057230949402,
-0.7098044753074646,
-0.088939331471... | |
* f1impl;
InterF2Impl * f2impl;
public:
int f1(); /* calls f1impl->f1() */
int g1(); /* calls f1impl->g1() */
int f2(); /* calls f2impl->f2() */
}
```
And another class could just use the implementation of `InterF2` without also implementing `InterF1` if you later needed such a class. | [
-0.27850061655044556,
-0.30688172578811646,
0.2790175974369049,
-0.19658781588077545,
-0.08341855555772781,
0.13403968513011932,
0.1721910834312439,
-0.03634786605834961,
-0.24127204716205597,
-0.6702431440353394,
-0.47801974415779114,
0.6445721983909607,
-0.6414399147033691,
-0.2478985935... | |
can someone explain the best way to get around the following,
rather curious type error. Suppose I create a list of tuples like so:
```
scala> val ys = List((1,2), (3,4), (5,6))
ys: List[(Int, Int)] = List((1,2), (3,4), (5,6))
```
Now, if I want to map this to a List(Int)
```
scala> ys.map((a: Int, b: Int) => a +... | [
-0.32342374324798584,
-0.12027100473642349,
0.5256916880607605,
-0.06095261499285698,
-0.06722106784582138,
0.1111573576927185,
0.42130473256111145,
-0.17428822815418243,
-0.16253779828548431,
-0.6436396241188049,
-0.20478945970535278,
0.43665534257888794,
-0.3600116968154907,
-0.030160492... | |
^
```
Any clues? I know I can use the for comprehension
```
scala> for ((a, b) <- ys) yield a + b
res1: List[Int] = List(3, 7, 11)
```
But it feels wrong to bust out a comprehension in this setting. Thanks!
try:
```
ys.map { case (a: Int, b: Int) => a + b }
```
or:
```
ys.map(p: (Int, Int) => p._1 + p._2)
```... | [
-0.4888651669025421,
-0.03500392660498619,
0.4029593765735626,
-0.0007055585738271475,
-0.14278164505958557,
0.04777178913354874,
0.3991924822330475,
-0.061570342630147934,
-0.43130072951316833,
-0.923983097076416,
-0.4734238386154175,
0.7806582450866699,
-0.27155381441116333,
-0.247889772... | |
is not actually a function from a single argument `(Int, Int)` to `Int`; instead it's a function of two arguments, both `Int`s, to an `Int` (a `Function2[Int,Int,Int]`). The difference is subtle, but important since Scala makes a distinction:
```
val f: Function1[(Int,Int),Int] = (p: (Int,Int)) => p._1 + p._2
ys.map(f... | [
-0.02294701710343361,
-0.5566692352294922,
0.582106351852417,
-0.22144654393196106,
-0.21034416556358337,
0.11380431801080704,
0.0935339704155922,
-0.6832974553108215,
-0.4629279673099518,
-0.6227569580078125,
-0.12052739411592484,
0.6841957569122314,
-0.3977954387664795,
0.176719188690185... | |
the function given to `map` to use `case`, which tells Scala to unpack the single `(Int,Int)` argument into its two parts. (Note also the use of curly braces instead of parentheses.) In the second example, we have a function of a single tuple argument, `p`, and we manually extract each part of the tuple.
Finally, note... | [
-0.3623235523700714,
-0.30248165130615234,
0.19474907219409943,
-0.2013145387172699,
-0.09837512671947479,
0.32671302556991577,
0.03688822314143181,
-0.4767696261405945,
-0.2599146068096161,
-0.6314051151275635,
-0.31013381481170654,
0.5057067275047302,
-0.5165183544158936,
-0.208389863371... | |
I'm having an awful time trying to use a library to parse an XML File into a hash like object, modify it, then print it back out to another XML file in Ruby. For a class I'm taking, we're supposed to use a Java JAXB like library where we convert XML into an object. We've already done SAX and DOM methods so we can't use... | [
0.4290304183959961,
0.13991129398345947,
-0.3138714134693146,
0.21332043409347534,
-0.2604629695415497,
-0.16125327348709106,
0.13363483548164368,
-0.14616376161575317,
-0.17815691232681274,
-0.6223559379577637,
0.21150819957256317,
0.37071919441223145,
-0.11262655258178711,
0.135732114315... | |
differences. Is there a Ruby library meant for doing just this? I've tried: ROXML, XML::Mapping, and ActiveSupport::CoreExt. The only one I can get to even run is ActiveSupport, and even then it starts putting element attributes as child elements in the output XML.
I'm willing to try out XmlSimple, but I'm curious has... | [
0.048560842871665955,
-0.0013209856115281582,
0.25144559144973755,
-0.00828941073268652,
-0.3998722434043884,
0.19574646651744843,
0.09079053997993469,
-0.02473648265004158,
-0.23633703589439392,
-0.6802195906639099,
0.3257446885108948,
0.374868243932724,
-0.1919337511062622,
0.05995485559... | |
a [`Stopwatch` Class](http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx), you should be able to use this to create your own control.
> A Stopwatch instance can measure elapsed time for one interval, or the total of elapsed time across multiple intervals. In a typical Stopwatch scenario, you cal... | [
0.11800896376371384,
-0.39712774753570557,
0.3154911398887634,
0.22746716439723969,
0.15387289226055145,
0.12360268086194992,
0.08756966888904572,
-0.22237622737884521,
-0.14454475045204163,
-0.3871157467365265,
-0.05453929305076599,
0.3342849910259247,
-0.3045983612537384,
0.0491623952984... | |
Here's some code:
```
OdbcConnection connection = new OdbcConnection(@"DRIVER={MySQL ODBC 5.1 Driver};SERVER=" + ip + ";DATABASE=db_name;USER=user;PASSWORD=" + dbPw + ";");
connection.Open();
string queryString = query;
OdbcCommand command = new OdbcCommand(queryString);
command.Connection = connection;
OdbcDataRead... | [
-0.22776325047016144,
-0.07522633671760559,
0.8247963190078735,
-0.328041136264801,
0.12083085626363754,
-0.18704047799110413,
0.335143506526947,
-0.13829948008060455,
-0.07840555161237717,
-0.7312725782394409,
-0.17318587005138397,
0.6198199987411499,
-0.2933672070503235,
0.23835171759128... | |
the error I get:
> Unable to cast object of type 'System.DBNull' to type 'System.String'.
This error happens somewhere in the myReader.GetString() line.
I've tried creating an if statement that checks if myReader.GetString(i) is System.DBNull to no avail. Whatever I do it always errors out. I don't understand what i... | [
0.023531747981905937,
0.3344874382019043,
0.3346973955631256,
-0.1069057509303093,
-0.14302319288253784,
-0.0536554753780365,
0.7180290222167969,
0.02912626788020134,
-0.07863759249448776,
-0.6757453680038452,
-0.03097723424434662,
0.6614397168159485,
-0.2675856947898865,
0.444436460733413... | |
I am looking for a way to remove some characters from the end of a field in my MySql database.
Say I have a table called 'items' and there is a field called 'descriptions', some of those descriptions have <br>'s at the end. There could be a single case, or there could be 2-3 <br>'s at the end of that field.
I need to... | [
0.054474908858537674,
0.2642926573753357,
0.06509644538164139,
0.28360214829444885,
-0.1512129306793213,
0.3694539964199066,
0.11739806085824966,
0.24997080862522125,
-0.19601967930793762,
-0.571700394153595,
0.006894499994814396,
-0.04584888741374016,
-0.2233327329158783,
0.48889592289924... | |
through every entry, check for that tag at the end, if it exists strip it off, and then update the DB with the new value. But this seems like the long way of doing it, and I'm not sure how to best achieve what I am trying to do.
I don't have a mysql instance to test, but something like this would probably do it:
```
U... | [
0.3310469388961792,
0.16472147405147552,
0.32180550694465637,
-0.25982752442359924,
-0.07515507936477661,
-0.2932214140892029,
0.08777045458555222,
-0.17124445736408234,
0.11953085660934448,
-0.6614047288894653,
-0.17289042472839355,
0.5983399152755737,
0.09894262999296188,
0.1387449055910... | |
I have a method that is invoked by a scheduler every minute to get a file from ftp, process and persists its records to a DB. I need to make this thread safe so that if the method has to perform multiple files at once, it acts a in a thread safe way..
```
public synchronized void processData(String data){
//do proc... | [
0.2845476269721985,
-0.009638357907533646,
0.24049484729766846,
0.06787922233343124,
0.07016783207654953,
-0.22846178710460663,
0.23323853313922882,
-0.174192413687706,
-0.34869760274887085,
-0.5376806855201721,
0.09800377488136292,
0.4449128210544586,
-0.41631266474723816,
0.5269010066986... | |
field that is manipulated or accessed in `processData(String data)` with the intention of keeping track of what's going on, then it's not thread-safe.
An example might be a class-level field called `private Boolean hasConnection;` If you need to check whether or not a connection exists with this field, then you don't ... | [
0.3160763680934906,
-0.358376145362854,
0.15938256680965424,
0.2580932676792145,
0.13984599709510803,
-0.4184953570365906,
-0.019066791981458664,
0.24784152209758759,
-0.3659270107746124,
-0.11786428093910217,
-0.26357635855674744,
0.34030765295028687,
-0.48628944158554077,
0.4054303169250... | |
whole class in order to determine whether or not it is thread-safe. | [
0.13881981372833252,
-0.3704977035522461,
0.0713849663734436,
0.2120400071144104,
0.10433773696422577,
-0.2707606554031372,
0.29041236639022827,
0.23583385348320007,
-0.3578706681728363,
-0.1331699937582016,
-0.18928220868110657,
-0.016717534512281418,
-0.2735022306442261,
0.28661108016967... | |
Here is a simplified snippet of my code:
```
<li id="work-5" class="work-5 class-B">
<div>some other stuff</div>
<div class="class-A"></div>
</li>
<li id="work-6" class="work-6 class-C">
<div class="class-A"></div>
</li>
```
I want to apply some CSS styling to the element with class-A which is under the ... | [
0.4182218015193939,
0.3703051507472992,
-0.007242842577397823,
-0.11585840582847595,
-0.03021439164876938,
0.20732900500297546,
0.10904139280319214,
-0.2816127836704254,
0.12894891202449799,
-0.8792681694030762,
0.028355034068226814,
0.5422933101654053,
0.06289747357368469,
0.0206278488039... | |
I have the following invalid XML file:
```
<?xml version="1.0" encoding="utf-8" ?>
<Page num="1" crop_box="0, 0, 595, 842" media_box="0, 0, 595, 842" rotate="0">
<Flow id="1">
<Para id="1">
<Line box="90, 754.639, 120.038, 12">
<Word box="90, 754.639, 22.6704, 12">This</Word>
... | [
-0.008386140689253807,
0.3987104892730713,
0.7385315895080566,
0.20606258511543274,
0.09295523166656494,
0.23297500610351562,
0.23972181975841522,
-0.5430933237075806,
0.04563435912132263,
-0.799135148525238,
0.051056403666734695,
0.1054101437330246,
-0.28270021080970764,
0.397712230682373... | |
595, 842" media_box="0, 0, 595, 842" rotate="0">
<Flow id="1">
<Para id="1">
<Line box="90, 754.639, 120.038, 12">
<Word box="90, 754.639, 22.6704, 12">This</Word>
</Line>
</Para>
</Flow>
</Page>
```
While it is structurally invalid (it has two root elem... | [
-0.04902220889925957,
0.05918120592832565,
0.5726061463356018,
0.48742589354515076,
-0.12471306324005127,
0.39429259300231934,
0.2374458760023117,
-0.4578729271888733,
-0.09538345783948898,
-0.5267861485481262,
-0.2899697721004486,
-0.11181323230266571,
-0.20280207693576813,
0.333382517099... | |
be correctly parsed (ie. the tags are correct and content is also correct).
So, the question is, is there a StAX (or any other streaming based) XML parser in Java that would allow me to do that? I have checked all options in **XMLInputFactory** but none of them seem to allow the parser to accept this kind of malformed... | [
0.4887753129005432,
0.2529442608356476,
-0.027054177597165108,
0.224884033203125,
-0.1642720252275467,
-0.2301209568977356,
0.4909747242927551,
-0.28170278668403625,
-0.015707509592175484,
-0.47018977999687195,
0.034260284155607224,
0.5831494927406311,
-0.31709998846054077,
-0.089820973575... | |
I am trying to implement a multiple choice quiz and will want to store all my questions and answers in a SQLite database. I will have many questions, and for each question there will 2 or more possible answers to display.
My question is, how should I store the questions and answers in a database? I have two ideas for ... | [
0.047083403915166855,
0.04907340556383133,
0.1504703313112259,
0.24168811738491058,
-0.08232616633176804,
0.18367347121238708,
0.052881769835948944,
-0.29226142168045044,
-0.10750912874937057,
-0.7780664563179016,
0.07187735289335251,
0.5113646388053894,
-0.22212913632392883,
0.13376174867... | |
would get very large and cause long retrieval times and memory problems? Then again, I assume `question_and_answers` would be indexed on the primary keys. In the second schema, `answers` would be indexed on `answerID` and not `questionID`? meaning the search times would go up as the whole table would have to be searche... | [
-0.04886465519666672,
-0.20049072802066803,
0.5000013113021851,
0.44905391335487366,
0.03703337535262108,
-0.0138007253408432,
0.23067276179790497,
-0.3451217710971832,
-0.22678931057453156,
-0.7579282522201538,
-0.2660026550292969,
0.4762722849845886,
0.14071640372276306,
0.07986843585968... | |
stored, considering the extra space required by the `questions_and_answers` table
You're second schema is the better one, because it models the actual domain: each question has a set of answers. Even if you can "compress" the data by storing duplicate answers once, it *does not match the actual domain*.
Down the road... | [
0.18790081143379211,
-0.10990332812070847,
0.11594000458717346,
0.5539280772209167,
0.07120498269796371,
-0.04548196122050285,
-0.044911086559295654,
-0.2129373699426651,
-0.37147143483161926,
-0.7726607322692871,
0.1342725157737732,
0.34819871187210083,
-0.36762675642967224,
0.03465622663... | |
other questions relied on that answer, and then either edit that answer in place or create a new answer.
Schema 1 just makes life really hard.
To answer your index questions, you would need to add an index on questionId. Once you have that index, looking up answers for a question should scale.
Now, on a completely d... | [
0.04145241528749466,
-0.11323703080415726,
-0.061404723674058914,
0.5174106955528259,
-0.3712475001811981,
-0.29435819387435913,
0.1974034458398819,
-0.1813017576932907,
-0.43173763155937195,
-0.7184184789657593,
-0.0768907442688942,
0.403052419424057,
-0.2868862450122833,
-0.0559582673013... | |
in one step.
If you then find you need more advanced storage (queries, redundancy, etc) you can move to a document database like MongoDB or CouchDB. | [
0.18887419998645782,
-0.3154890239238739,
0.2025114744901657,
0.3721219301223755,
0.2980121374130249,
-0.495427668094635,
-0.12934356927871704,
-0.0480615459382534,
-0.3156086206436157,
-0.7849946022033691,
-0.24765324592590332,
0.3463374078273773,
-0.1962038278579712,
0.2964304983615875,
... | |
I am trying to create a button that can pop up the [speech input panel](http://slides.html5rocks.com/#speech-input) (in HTML5), and I tried to use `<label>` for that:
```
<label>
<input type="text" x-webkit-speech />
<button>Speak</button>
</label>
```
<htt... | [
0.38965460658073425,
-0.03507155179977417,
0.6213892698287964,
-0.1958623081445694,
-0.34284791350364685,
-0.014160150662064552,
0.30976632237434387,
-0.02319260872900486,
-0.012721726670861244,
-0.601112961769104,
0.004820262547582388,
0.6054660677909851,
-0.09706541895866394,
0.139610692... | |
after isn't possible. The only way to trigger the speech is to click on that microphone icon in the textbox. If you are willing to use javascript then I think you might be able to cram something in. This is how I would do it.
1. Create a text input that is only large enough to contain the microphone icon
2. Use a tran... | [
0.49419018626213074,
-0.32214781641960144,
0.4472801089286804,
-0.17055410146713257,
-0.4363580346107483,
0.03341380134224892,
0.36161717772483826,
-0.32131022214889526,
0.10600914806127548,
-0.7160506248474121,
0.10646472126245499,
0.7110406756401062,
-0.13337582349777222,
-0.221594929695... | |
how I hacked it together. There are two buttons, one with the microphone overlayed completely transparent, and one with it partially transparent and a red border so that you can see the effect.
CSS
```
input.speechbutton {
position: absolute;
top: 0;
left: 0;
opacity: 0;
height: 20px;
width: 2... | [
0.24713914096355438,
-0.05474580079317093,
0.35116317868232727,
-0.32939961552619934,
-0.12296352535486221,
0.38510003685951233,
0.46411383152008057,
-0.3773726522922516,
-0.05252274125814438,
-0.5462019443511963,
0.07962822169065475,
0.9033198952674866,
-0.13846455514431,
-0.3252975344657... | |
This is a very common thing in web applications. If I have a user table and I want to keep track of all the changes made to the user table, I can use a database insert and update triggers to save those changes in the user\_history table.
But what if I have user\_products table, where I have user\_id , product\_id, cos... | [
0.45564332604408264,
0.2649120092391968,
0.37346354126930237,
-0.09923747181892395,
0.31024041771888733,
0.46986618638038635,
-0.3401965796947479,
0.0018050859216600657,
-0.3412233889102936,
-0.9434808492660522,
0.31360292434692383,
0.6096674799919128,
-0.19794443249702454,
0.3860185146331... | |
1000
2 20 2000
```
Now if I go to the edit user page and delete product 1 , add product 3 , change cost for product 2 from 2000 to 3000.
so normally I delete all records for user\_id 1 from user\_product table and then do a new insert for the new products.
So its not a regular update but a delete an... | [
0.38501399755477905,
0.2568150758743286,
0.31990715861320496,
-0.22991904616355896,
-0.06934536248445511,
0.08012181520462036,
-0.1082325205206871,
-0.647412896156311,
-0.09691455215215683,
-0.5776131749153137,
0.10481419414281845,
0.3650332987308502,
-0.10030588507652283,
0.31212961673736... | |
know that I deleted product 1 , added product 3 , changed cost for product 2 from 2000 to 3000.
**EDIT 1:-**
I am not doing a update. I am doing a delete and then insert. So I am deleting record with product id 2 and cost 2000. And then again inserting record with prod id 2 but with cost 3000. So technically its del... | [
0.665392279624939,
0.13623473048210144,
0.39880043268203735,
0.01964576356112957,
0.12426633387804031,
0.06842389702796936,
0.15835720300674438,
-0.24967677891254425,
-0.2342398464679718,
-0.4017760455608368,
0.1591256856918335,
0.660962700843811,
-0.10287760198116302,
0.387549489736557,
... | |
which are same. But I want to be able to see that the cost has chnaged from 2000 to 3000
One option would be to create a `user_product_history` table that is populated by triggers on `user_product` and then define a trigger that transforms the old 'delete' row in the history table into an `update` if the row is subsequ... | [
0.5475823879241943,
0.2158239632844925,
0.42454928159713745,
-0.15565794706344604,
0.3507848083972931,
0.327272891998291,
-0.44377365708351135,
-0.4838932454586029,
-0.31384190917015076,
-0.5284070372581482,
0.1254972368478775,
0.4988858103752136,
-0.36635351181030273,
0.26959097385406494,... | |
operation_date date
);
CREATE TRIGGER trg_user_product_history
AFTER INSERT OR UPDATE OR DELETE ON user_product
FOR EACH ROW
DECLARE
l_cnt integer;
BEGIN
IF( deleting )
THEN
insert into user_product_history( user_id, product_id, cost, operation_type, operation_date )
values( :old.user_id, :old.pr... | [
-0.004197622183710337,
-0.052683789283037186,
0.6560437679290771,
-0.6638375520706177,
0.4353887140750885,
0.5886132121086121,
-0.38386476039886475,
-0.35387122631073,
-0.11595863103866577,
-0.5662434697151184,
-0.27627798914909363,
0.4132024347782135,
-0.3526703715324402,
0.24300947785377... | |
from user_product_history
where operation_type = 'D'
and user_id = :new.user_id
and product_id = :new.product_id;
if( l_cnt > 0 )
then
update user_product_history
set operation_type = 'U',
operation_date = sysdate, | [
0.038700975477695465,
-0.06931034475564957,
0.6098179221153259,
-0.6383887529373169,
0.3332977890968323,
0.24141784012317657,
-0.33520224690437317,
-0.06526218354701996,
-0.2172471582889557,
-0.6510230898857117,
-0.5911338925361633,
0.28597068786621094,
-0.23530161380767822,
0.487166583538... | |
cost = :new.cost
where operation_type = 'D'
and user_id = :new.user_id
and product_id = :new.product_id;
else
insert into user_product_history( user_id, product_id, cost, operation_type, operation_date )
values( :new.user_id, :new.product_id, :new.cost, '... | [
0.1279488205909729,
0.23518358170986176,
0.2703861594200134,
-0.15624818205833435,
0.43479934334754944,
0.5806188583374023,
-0.4416390657424927,
-0.332315593957901,
0.1600968837738037,
-0.642822802066803,
-0.24068568646907806,
0.5570070743560791,
0.14312471449375153,
0.4014936685562134,
... | |
if;
END IF;
END;
```
From an efficiency standpoint, however, doing deletes and inserts rather than updates is going to mean that you're putting far more load on your database than is necessary. You'll do substantially more I/O than necessary. And you'll end up with much more complicated code for handling changes. Y... | [
0.14475001394748688,
0.27338650822639465,
0.3932695984840393,
-0.01604514941573143,
0.3171844482421875,
-0.2075718641281128,
-0.08262087404727936,
-0.10346220433712006,
-0.09350783377885818,
-0.96127849817276,
-0.1684732437133789,
0.7043657302856445,
-0.14857764542102814,
0.110569760203361... | |
I have read a lot about soft deletes and archive and saw all the pros and cons. I'm still confused on which approach would work best for my situation. I'll use the concept of posts and comments to see if I can explain it a bit easier
```
Post -> Comments
Post.all
Outside RSS Feeds -> Post -> Comments
RSSFeed.posts (R... | [
0.32911279797554016,
0.05286325886845589,
0.4815939962863922,
0.0865897461771965,
-0.3235822916030884,
-0.07633679360151291,
0.15650078654289246,
0.13848072290420532,
-0.30430757999420166,
-0.567400336265564,
-0.19752806425094604,
0.6447125673294067,
-0.20105485618114471,
0.286000460386276... | |
sense for my application and feel if I use Archive then I would have to run multiple queries
```
RSSFeed.posts || RSSFeed.archived_posts
```
not sure which would be more efficient or more a pain in the @$$. Thoughts or examples? I know this example sounds stupid but trying to think of multiple situations that coul... | [
0.0864979550242424,
0.22383937239646912,
0.7298140525817871,
-0.03614155948162079,
-0.14675289392471313,
-0.04019635543227196,
0.45110994577407837,
-0.18597668409347534,
-0.07151612639427185,
-0.9868707656860352,
0.23294079303741455,
0.4393863081932068,
-0.5648801922798157,
0.2406617701053... | |
self.archivated?
self.archivated = true
self.save
end
end
def dectivate
if self.archivated?
self.archivated = false
self.save
end
end
end
```
**app/models/archive.rb**
```
class Archive < Post
set_table_name :posts # make this model use the posts table
default_scope wh... | [
-0.06568078696727753,
0.08168741315603256,
0.47615543007850647,
0.036751408129930496,
-0.11819292604923248,
0.03834555670619011,
0.5126064419746399,
-0.33948439359664917,
-0.15177711844444275,
-0.5924184322357178,
0.17387424409389496,
0.638342022895813,
-0.3313061594963074,
0.3635934591293... | |
I'm just starting out in JSF, looks awesome, but I can't seem to figure out this last barrier.
I'm used to traditional Jquery AJAX function, which is perfect in my book. But I was hoping to find a way to get it to work in harmony with JSF.
Here is a scenario to explain my situation.
I have a messaging page on my w... | [
0.008521747775375843,
-0.158156156539917,
0.34488970041275024,
-0.1662510186433792,
-0.31861546635627747,
-0.38069775700569153,
0.2717945873737335,
0.22494745254516602,
-0.11098115891218185,
-0.908485472202301,
-0.048460859805345535,
0.5426324009895325,
-0.10424632579088211,
-0.23413953185... | |
it loads it in the conversation div above. But now I need to add some features.
- When user clicks, the button and textarea should get disabled to avoid interaction until the action is completed. And a loader should appear
- When the JSF finishes it's stuff, the textarea and button should get enabled and the loader s... | [
-0.17281438410282135,
-0.12415605038404465,
0.4180550277233124,
-0.12807519733905792,
-0.1648111343383789,
-0.3750191330909729,
0.15718328952789307,
0.23590537905693054,
-0.11127535998821259,
-0.6638327836990356,
-0.27220582962036133,
0.7813909649848938,
-0.44647902250289917,
-0.1866516172... | |
complete: function () {
// Do the inverse of above
}
}
```
Thanks for the help!
add the `onevent="jsFunctionName"` (no brackets) needed to your `<f:ajax`
and your `jsFunctionName` should look like
```
function openDeleteDevicesDialog(data) {
console.log(data.status); //while ,data.status can be 1)"... | [
-0.13786236941814423,
-0.22012361884117126,
0.9191088676452637,
-0.2406291514635086,
-0.04888182878494263,
-0.3790583908557892,
0.4403635859489441,
-0.4679586589336395,
0.003954511135816574,
-0.5523426532745361,
-0.37200602889060974,
0.8995835781097412,
-0.14076842367649078,
-0.32212716341... | |
your code in the when `data.status === 'success'` , its when your page is done rendering and your DOM is in its final shape/state**
[also take a look at BalusC answer over here...](https://stackoverflow.com/a/7044332/617373) | [
-0.1301206797361374,
-0.20741219818592072,
0.9734737277030945,
-0.0509311743080616,
0.1991162896156311,
-0.22114992141723633,
0.21909841895103455,
-0.19207319617271423,
-0.26440349221229553,
-0.7717705965042114,
-0.3868837356567383,
0.5173572897911072,
0.10625173151493073,
0.12980908155441... | |
I have a list like this:
```
['Ww','Aa','Bb','Cc','ww','AA','BB','CC']
```
And continuing in such a pattern, with varying capitals and lowercases.
What I want to do is join every four items in this list together. So, the resulting new list (given the one above) would look like this:
```
['WwAaBbCc', "wwAABBCC']
... | [
0.4242169260978699,
0.3885231018066406,
0.3611319959163666,
-0.27006930112838745,
-0.08383671939373016,
0.28534242510795593,
-0.06037011742591858,
-0.2584647834300995,
-0.3239709436893463,
-0.6811407208442688,
-0.05458979681134224,
0.20827250182628632,
-0.26099249720573425,
0.3298407196998... | |
I am trying to integrate Facebook to my Android app for social post. I have downloaded latest Facebook sdk from [here](https://github.com/facebook/facebook-android-sdk) and apply all setup require to post to facebook. Now i can post to facebook. But problem is that, when i run sample program from facebook sdk, a browse... | [
0.6280038952827454,
0.25611934065818787,
0.25931859016418457,
-0.08849457651376724,
-0.19028830528259277,
-0.0715826004743576,
0.36668795347213745,
0.11185629665851593,
-0.2664972245693207,
-0.7419490814208984,
0.2709527611732483,
0.5245220065116882,
-0.17562374472618103,
0.025934796780347... | |
part of message so that user can't modified it.
Thanks in Advance
**EDIT1:** this is message i got after using [this](http://jona.than.biz/projects/fbrocket/?d=bin&v=0.1a) project
```
04-10 11:44:34.691: I/dalvikvm(719): Failed resolving Lnet/xeomax/TestRocket/TestRocket;
>interface 22 'Lnet/xeomax/FBRocket/LoginL... | [
-0.29432931542396545,
-0.03720695152878761,
0.6433066725730896,
-0.12542463839054108,
0.015604731626808643,
0.18655629456043243,
0.8842886686325073,
-0.47529736161231995,
-0.015214357525110245,
-0.41791701316833496,
-0.37487468123435974,
0.6604772806167603,
-0.5219628810882568,
-0.04719584... | |
11:44:34.781: E/AndroidRuntime(719): at android.os.Handler.dispatchMessage(Handler.java:99)
>04-10 11:44:34.781: E/AndroidRuntime(719): at android.os.Looper.loop(Looper.java:130)
>04-10 11:44:34.781: E/AndroidRuntime(719): at android.app.ActivityThread.main(ActivityThread.java:3683)
>04-10 11:44:34.781: ... | [
-0.37319207191467285,
0.06952816247940063,
0.4471183121204376,
-0.49544164538383484,
0.07923469692468643,
0.47663941979408264,
0.9447454810142517,
-0.24855248630046844,
-0.4734688699245453,
-0.6953476667404175,
-0.3320036232471466,
0.5375791788101196,
-0.5240105390548706,
0.109252996742725... | |
E/AndroidRuntime(719): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
>04-10 11:44:34.781: E/AndroidRuntime(719): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
>04-10 11:44:34.781: E/AndroidRuntime(719): ... 11 more
```
**EDIT 2 :** By introducing m... | [
0.28650161623954773,
0.0030876591335982084,
0.637300968170166,
-0.02759719267487526,
0.012070580385625362,
-0.044301971793174744,
0.5382553935050964,
-0.2858707904815674,
-0.2262745499610901,
-0.8475445508956909,
-0.33211269974708557,
0.8501055240631104,
-0.34739238023757935,
-0.3060229718... | |
If you use facebook sdk to implement the post message on Facebook then it may help you. With using that you can only able to get the facebook login screen once. If user has registered with that login id and password then it will never come again and simple send varification toast message that the message is posted on f... | [
0.3408212661743164,
-0.3491281569004059,
0.5532331466674805,
-0.010080561973154545,
-0.16633836925029755,
-0.1809101402759552,
0.40878501534461975,
-0.2523114085197449,
-0.30035778880119324,
-0.7368281483650208,
0.04114234447479248,
0.6308837532997131,
-0.13404320180416107,
-0.214040786027... | |
sdk in to the project:
```
System.out.println("Message is: "+postMessage); // My static post message
facebook.authorize(MainActivityPage.this, new String[]{ "user_photos,publish_checkins,publish_actions,publish_stream"},new DialogListener() {
@O... | [
0.2929188311100006,
-0.16864651441574097,
0.615282416343689,
-0.16219016909599304,
-0.1321832239627838,
-0.055818211287260056,
0.4227602481842041,
-0.34050729870796204,
-0.08656353503465652,
-0.6388317346572876,
0.011593816801905632,
0.21364045143127441,
-0.34684431552886963,
-0.1085843294... | |
public void onComplete(Bundle values) {
Bundle params = new Bundle(); | [
0.20234163105487823,
-0.6611204743385315,
0.3583740293979645,
0.16159749031066895,
0.3147791922092438,
0.1440281718969345,
0.22687801718711853,
-0.5309293866157532,
-0.2827529311180115,
-0.4789402484893799,
-0.6965456604957581,
0.49643445014953613,
-0.651903510093689,
0.16571414470672607,
... | |
params.putString(Facebook.TOKEN, facebook.getAccessToken());
params.putString("message", postMessage); | [
-0.12991498410701752,
-0.349663645029068,
0.30264967679977417,
-0.16288508474826813,
-0.5465276837348938,
0.47830671072006226,
0.3155685067176819,
-0.048917949199676514,
-0.4983956217765808,
-0.683418333530426,
-0.6516334414482117,
-0.2875221073627472,
-0.41664713621139526,
-0.068868510425... | |
AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(facebook);
mAsyncRunner.request("me/feed", params, "POST", new SampleUploadListener(),null); | [
0.0347270630300045,
-0.23491810262203217,
0.46173328161239624,
-0.01527177169919014,
-0.296953022480011,
0.25840339064598083,
0.6957070231437683,
-0.23940593004226685,
-0.11779488623142242,
-0.7138426899909973,
-0.346168577671051,
0.30320805311203003,
-0.5151158571243286,
0.162886470556259... | |
Toast.makeText(getApplicationContext(), "Message Posted on Facebook.", Toast.LENGTH_SHORT).show();
}
@Override | [
0.4033871591091156,
0.16302864253520966,
0.31397733092308044,
-0.1748204529285431,
-0.11775504052639008,
-0.3952508270740509,
0.6848371028900146,
0.004233304876834154,
-0.18865513801574707,
-0.8728327751159668,
-0.40618956089019775,
0.16389456391334534,
-0.18866050243377686,
0.222209721803... | |
public void onFacebookError(FacebookError error) {}
@Override | [
-0.015804825350642204,
0.2220524102449417,
0.15448030829429626,
-0.1880621612071991,
0.2826250493526459,
-0.055456146597862244,
0.6897603869438171,
0.15831850469112396,
-0.043871019035577774,
-0.6078872680664062,
0.06700403243303299,
0.658942699432373,
-0.4836813509464264,
0.11785055696964... | |
public void onError(DialogError e) {}
@Override | [
-0.07135512679815292,
0.10056646168231964,
0.3717218339443207,
-0.06078777089715004,
0.2956981062889099,
-0.12924975156784058,
0.2025611400604248,
0.1098664402961731,
0.08466653525829315,
-0.46013328433036804,
-0.2633860111236572,
0.7565240859985352,
-0.5303464531898499,
0.2405832856893539... | |
public void onCancel() {}
});
``` | [
-0.010334810242056847,
-0.09917398542165756,
0.18106146156787872,
-0.06778670102357864,
0.4303511679172516,
-0.029181532561779022,
0.13871996104717255,
0.20468980073928833,
0.043347109109163284,
-0.4557291865348816,
-0.532795250415802,
0.863746702671051,
-0.4771929681301117,
0.422885566949... | |
I'm trying to use the AnyEvent::Twitter::Stream module and I want to reference a file that lists the Twitter uids I want to follow. I can put the uids in the code itself and it works as follows:
```
my $done = AnyEvent->condvar;
my $nt_filter = AnyEvent::Twitter::Stream->new(
username => $cf{accoun... | [
0.6065589189529419,
-0.036482956260442734,
0.6776894330978394,
-0.33872464299201965,
0.04700910672545433,
-0.33759528398513794,
0.047100652009248734,
0.24314482510089874,
-0.04824317246675491,
-0.8282066583633423,
0.09999994933605194,
0.5883687734603882,
-0.3246941864490509,
0.007340489886... | |
follow => '15855509,14760150,18598536',
on_tweet => sub {
#some code.....
},
on_error => sub {
my $error = shift; | [
-0.07148530334234238,
-0.24440474808216095,
0.26685842871665955,
-0.20573586225509644,
0.3609321713447571,
0.17911869287490845,
0.7244298458099365,
0.01082901656627655,
-0.1314515471458435,
-0.288078635931015,
-0.374162495136261,
0.2888445556163788,
-0.6517484188079834,
0.1729823350906372,... | |
debug "ERROR: $error";
},
timeout => 45,
);
$done->recv;
```
But when I try to do the same using a file as such:
```
my $done = AnyEvent->condvar;
my $nt_filter = AnyEvent::Twitter::Stream->new(
open UID_FILE, "/tmp/uids" or die $!;
my @uid_line = ... | [
0.23661768436431885,
-0.14927679300308228,
0.36045771837234497,
-0.4122990369796753,
0.2174902707338333,
-0.11176024377346039,
0.6474734544754028,
-0.14306877553462982,
-0.0644327774643898,
-0.720653235912323,
-0.4145945906639099,
0.47665655612945557,
-0.39971956610679626,
0.27195125818252... | |
username => $cf{account},
password => $cf{password},
method => 'filter',
follow => @uid_file,
on_tweet => sub {
#some code.... | [
-0.08156780898571014,
-0.0069766235537827015,
0.3963117003440857,
-0.12489377707242966,
0.13343429565429688,
-0.14540870487689972,
0.32910019159317017,
0.03649347275495529,
0.010356392711400986,
-0.8262341022491455,
-0.26888489723205566,
0.3279116153717041,
-0.39727678894996643,
0.10154282... | |
},
on_error => sub {
my $error = shift;
debug "ERROR: $error";
},
timeout => 45,
);
$done->recv;
```
it fails. The uids file has the | [
0.09920098632574081,
-0.19012512266635895,
0.6480854153633118,
-0.2999263107776642,
0.5034330487251282,
-0.14578326046466827,
0.45030638575553894,
-0.17089751362800598,
-0.029683643952012062,
-0.5745272040367126,
-0.42722320556640625,
0.5969964265823364,
-0.07097955793142319,
0.23980866372... | |
following contents:
```
'15855509,14760150,18598536'
```
I'm getting a 406 error from Twitter, suggesting the format is not correct. I'm guessing the quotes are not correct somehow?
The `AnyEvent::Twitter::Stream` module subclasses `AnyEvent` and you don't need to access the base module at all. All the functionality... | [
0.22586248815059662,
-0.08859188109636307,
0.7342002391815186,
0.002079773461446166,
0.1075664758682251,
-0.5061613917350769,
0.34075871109962463,
0.1520146131515503,
-0.07481829822063446,
-0.4255545139312744,
-0.2022276222705841,
0.655714213848114,
-0.28419098258018494,
0.1506847590208053... | |
of your programs, especially if you are asking for help with them. This will trap simple mistakes like this that you could otherwise overlook.
You can't in general use an array to supply a single scalar value. In this instance it may be OK as long as the file has only a single line (so there is only one element in the... | [
0.6174542307853699,
0.00025921774795278907,
0.19110117852687836,
0.11305075883865356,
-0.1542867124080658,
0.02223222702741623,
0.35400906205177307,
-0.024410512298345566,
-0.43966251611709595,
-0.19041365385055542,
0.032993197441101074,
0.4028554856777191,
-0.4590763747692108,
-0.01208401... | |
you read all decimal strings from your file like this
```
open my $uid_fh, '<', '/tmp/uids' or die $!;
my @uids;
push @uids, /\d+/g for <$uid_fh>;
```
(Note that these lines belong *before* the call to `AnyEvent::Twitter::Stream->new`)
Then you can supply the `follow` parameter by writing
```
follow => join(',', @... | [
0.1765444427728653,
0.027003875002264977,
0.6196437478065491,
-0.08982793986797333,
0.26999297738075256,
-0.12320705503225327,
0.4945065677165985,
0.020329518243670464,
0.02827809378504753,
-0.35144340991973877,
-0.2894597351551056,
0.5709716081619263,
-0.3770929276943207,
-0.1317532360553... | |
=> 'password',
);
my $nt_filter = AnyEvent::Twitter::Stream->new(
username => $cf{account},
password => $cf{password},
method => 'filter',
follow => join(',', @uids),
on_tweet => sub {
#some code....
},
on_error => sub {
my $error = shift;
debug "ERROR: $error";
},
timeout => 45,
);
``` | [
0.05695897340774536,
-0.10296311229467392,
0.5367573499679565,
-0.30926230549812317,
0.3774537444114685,
0.11072267591953278,
0.5521872043609619,
-0.09156352281570435,
-0.10080734640359879,
-0.7467588186264038,
-0.3493655025959015,
0.493466854095459,
-0.23857910931110382,
0.220854461193084... | |
I'm trying to figure out how to pass in settings to an animation plugin in the following format (I know it's bad to expect users to jump in and play with settings like this, but I'll be building a GUI to go alongside it as well):
```
$('#animationContainer').plugin({
'path':[
{'path_on_x':[ // PAT... | [
0.20847764611244202,
0.053277261555194855,
0.49462181329727173,
0.13478638231754303,
0.11338873952627182,
0.18828962743282318,
0.028588300570845604,
0.05929210036993027,
-0.029927071183919907,
-1.063966989517212,
-0.1786089986562729,
0.7134348750114441,
-0.36665427684783936,
0.032105248421... | |
{'0':'0px','1':'0px','2':'0px'}, // object 2 starting X values (0,1,2)
{'0':'150px','1':'150px','2':'150px'} // object 3 starting X values...
]},
{'path_off_x':[ // PATH_ON X IS AN ARRAY
{'0':'0px','1':'0px','2':'0px'}, | [
-0.15896224975585938,
-0.027935372665524483,
0.40740346908569336,
-0.010631602257490158,
0.0944250077009201,
0.5692277550697327,
0.14810359477996826,
-0.3208431303501129,
-0.029248494654893875,
-0.7524458169937134,
-0.2365623265504837,
0.3234405219554901,
-0.4578157365322113,
0.12985973060... | |
{'0':'0px','1':'0px','2':'0px'},
{'0':'150px','1':'150px','2':'150px'}
]},
{'path_on_y':[ // PATH_ON Y IS AN ARRAY
{'0':'0px','1':'0px','2':'0px'},
{'0':'0px','1':'0px','2':'0px'},
{'0':'0px','1':'50px','2':'200px'} | [
-0.1964668333530426,
-0.16498763859272003,
0.4495560824871063,
0.03297149017453194,
0.2000875174999237,
0.5114715695381165,
0.13337598741054535,
-0.19346106052398682,
-0.03879355639219284,
-0.74163818359375,
-0.20885053277015686,
0.15407240390777588,
-0.299312949180603,
-0.0040088729001581... | |
]},
{'path_off_y':[ // PATH_ON Y IS AN ARRAY
{'0':'0px','1':'0px','2':'0px'},
{'0':'0px','1':'0px','2':'0px'},
{'0':'200px','1':'50px','2':'0px'}
]}
]
});
```
This | [
-0.12334109097719193,
0.15149690210819244,
0.6248542666435242,
-0.20097914338111877,
0.37428152561187744,
0.2085719108581543,
0.05338074639439583,
-0.3147343695163727,
-0.16154181957244873,
-0.707207441329956,
-0.21243171393871307,
0.5514995455741882,
-0.48246318101882935,
0.13806068897247... | |
code is currently setup within the plugin and I'm referencing all of the static values. "PATH" contains all of the settings related to animating the object along a path. The path\_on\_x, path\_off\_x, path\_on\_y and path\_off\_y all contain specific sets of coordinate values for animating from point 0 to point 1 to po... | [
-0.01682053506374359,
-0.041581396013498306,
0.5804105401039124,
0.12967343628406525,
0.05770573019981384,
0.30013567209243774,
0.17310282588005066,
-0.0998249500989914,
-0.05292448773980141,
-0.9930119514465332,
0.1730831265449524,
0.5002064108848572,
-0.2809324264526367,
-0.0920625850558... | |
kind of fallback setting) in this case? I'm pretty sure the standard defaults = ... code isn't going to cut it, and simply using the above code in place of the defaults doesn't account for the fact that there may be 20 objects being animated instead of 3 shown above.
Any suggestions? Thanks!
I would suggest such a for... | [
0.31103163957595825,
-0.36431530117988586,
0.5319225192070007,
0.41379737854003906,
-0.04104514792561531,
0.14273296296596527,
0.26163792610168457,
0.11014130711555481,
-0.3531411290168762,
-0.4616583287715912,
-0.21636779606342316,
0.7333182692527771,
-0.23091745376586914,
0.1114716976881... | |
"x": [[0, 0, 0], [0, 0, 0]],
"y": [[0, 0, 0], [0, 0, 0]]
},
{
"x": [[150, 150, 150], [150, 150, 150]],
"y": [[0, 50, 200], [200, 50, 200]]
}
]
});
```
This way you have properties that belong to one object in one place, instead of having them evenly distributed. It's much easier to und... | [
0.02491682395339012,
-0.057652730494737625,
0.11328819394111633,
0.12825123965740204,
0.2540222108364105,
0.22548632323741913,
0.3860927224159241,
-0.32864442467689514,
-0.16662830114364624,
-0.7842352390289307,
-0.08738908171653748,
0.2085709571838379,
-0.20607176423072815,
0.298427492380... | |
keeping it top-level.)*
Accessing the properties would be straight-forward:
```
options.path[0].x[0] // starting values
options.path[0].x[1] // stopping values
```
and applying defaults to them becomes easy to. All it needs is a for loop
```
for(var i=0; i<options.path.length; i++) {
// merge options.path[i] wit... | [
-0.02522064559161663,
-0.34341275691986084,
0.5059133768081665,
-0.13318917155265808,
0.5146350860595703,
-0.16370922327041626,
0.2968962788581848,
-0.5826749801635742,
-0.18637168407440186,
-0.5025493502616882,
-0.1582230180501938,
0.8588553071022034,
-0.22196561098098755,
-0.059237856417... | |
I have the `.sdf` for SQL Server Compact Edition database of Northwind, I'm trying to attach it to llblgen pro but it refuses to connect, in the 'database drivers' drop down I've selected SQL Server 2000/etc, etc (there is no SQL Server CE in the drop down) and in 'server name' I've put the full path to the database:
... | [
-0.1840222030878067,
0.1301213800907135,
0.5425534248352051,
-0.01760920323431492,
-0.23669493198394775,
-0.08072170615196228,
0.2609119415283203,
-0.16955238580703735,
-0.012714271433651447,
-1.1153160333633423,
0.1145264282822609,
0.3003824055194855,
-0.24498523771762848,
0.1748484522104... | |
not accessible. Verify that the instance name is correct and that
> SQL Server is configured to allow remote connections. (provider: SQL
> Network Interfaces, error: 26 - Error Locating Server/Instance
> Specified)
>
>
> LLBLGen Pro version 3.5. Build March 23rd, 2012
> -----[Core exception]-------------------- a... | [
-0.4907514750957489,
0.161850243806839,
0.5353883504867554,
0.15856494009494781,
0.20381557941436768,
0.06034110486507416,
0.5939092040061951,
-0.33389726281166077,
-0.17557920515537262,
-0.7272644639015198,
-0.2948615252971649,
0.38341453671455383,
-0.4485681354999542,
0.441997230052948,
... | |
redirectedUserInstance,
> SqlConnection owningObject, SqlConnectionString connectionOptions,
> Int64 timerStart) at
> System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection
> owningObject, SqlConnectionString connectionOptions, String
> newPassword, Boolean redirectedUserInstance) at
> Syste... | [
-0.27393850684165955,
-0.13500717282295227,
0.6488662958145142,
0.17457327246665955,
-0.1388346254825592,
0.183115616440773,
0.31536784768104553,
-0.4946911036968231,
-0.25236254930496216,
-0.7308019995689392,
-0.12053438276052475,
0.6142728924751282,
-0.207628071308136,
0.4022845327854156... | |
to sql server management studio then adding it to llblgen but still no luck...
Turns out the version of LLBLGen Pro I was using does not support .Net Compact Framework (as of V3.0 the stopped supporting it). | [
-0.3168507218360901,
-0.10854560136795044,
0.8101650476455688,
-0.035228509455919266,
-0.05256029963493347,
-0.33943861722946167,
0.15404626727104187,
0.27591148018836975,
0.15971767902374268,
-0.5675532221794128,
-0.05281783267855644,
0.48698899149894714,
-0.4823123812675476,
0.2107259929... | |
I am trying to make the the ads at the **bottom** of the [website](http://www.apptec.net) to be aligned with the content(i.e to have the same `padding-right` as the posts have.) but even after adding the it to the same `div`, I am unable to do so,
Here is my code,
```
<script class="mcolumn-pad" type="text/javascript"... | [
0.6343960165977478,
0.1607508510351181,
0.8391140103340149,
-0.20284652709960938,
-0.1307424008846283,
-0.05531903728842735,
0.10274088382720947,
-0.28500744700431824,
-0.07708258181810379,
-0.6810386180877686,
0.18776744604110718,
0.557059645652771,
-0.7030766606330872,
-0.158519804477691... | |
> **Possible Duplicate:**
>
> [Creating multiple log files of different content with log4j](https://stackoverflow.com/questions/728295/creating-multiple-log-files-of-different-content-with-log4j)
I am working with jboss server. Is it possible to use two logs using log4j? i am successfully able to work with one , fo... | [
0.37263011932373047,
-0.08487991243600845,
0.20332786440849304,
0.0389457531273365,
-0.22186431288719177,
-0.21140052378177643,
0.2562623918056488,
-0.1893537938594818,
-0.3635616898536682,
-0.9255560636520386,
0.3060394823551178,
0.46725770831108093,
-0.4936246871948242,
-0.17995245754718... | |
In ADT r17 there have been changes to the ADT where libraries should be placed in "libs" and somehow autodetected for use in the project. Unfortunately I have found no way to set javadoc and source attachment on the auto-imported jars. [Some suggest moving jars back to lib](https://stackoverflow.com/questions/9873152/h... | [
0.08415623754262924,
0.39792823791503906,
0.3601711690425873,
-0.1812327355146408,
-0.38005319237709045,
0.03369666263461113,
0.37723132967948914,
-0.4784015715122223,
-0.10667742043733597,
-0.7050623297691345,
-0.07816408574581146,
0.5952297449111938,
-0.49170002341270447,
0.1253883987665... | |
tried to revert through the eclipse installation history. I got this:
```
An error occurred while collecting items to be installed
session context was:(profile=epp.package.java, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
No repository found containing: org.eclipse.update.feature,c... | [
0.14115524291992188,
0.030895670875906944,
0.4887801706790924,
-0.17062783241271973,
-0.1728169023990631,
0.20351432263851166,
0.6415198445320129,
-0.39596128463745117,
-0.18129634857177734,
-0.6188463568687439,
-0.15996965765953064,
0.7140530943870544,
-0.5372990369796753,
-0.173079103231... | |
I installed FDT5 and it gave me a warning about missing APIs. But [at the FAQ](http://fdt.powerflasher.com/docs/FAQ#Do_I_need_The_Flex_SDKs_to_use_haXe) it said the APIs weren't needed to use Haxe. Yet while trying to follow the Haxe FDT5 tutorial, it says to create a new FDT project. But FDT5 won't let me do this. It ... | [
0.6836515069007874,
-0.2219173014163971,
0.7521902918815613,
-0.05717776343226433,
-0.22919192910194397,
-0.2683500647544861,
0.24579209089279175,
-0.40989238023757935,
-0.25020232796669006,
-0.7268385887145996,
-0.14989705383777618,
0.8646365404129028,
-0.19653260707855225,
-0.11396305263... | |
don't need the Flex SDKs to USE Haxe & FDT, there is a bug in the scenario when someone wants to use FDT for Haxe only, doesn't setup the Flex SDKs and tries to create a new project.
The bug is that when you try to create a new project, FDT's New Project Wizard will check to make sure that Flex SDKs are linked to FDT... | [
0.3132241368293762,
-0.19047555327415466,
0.3821640908718109,
0.4329761266708374,
-0.0497271791100502,
-0.30564990639686584,
0.2934466600418091,
-0.0839913859963417,
-0.27467459440231323,
-0.736842930316925,
0.008165529929101467,
0.63021320104599,
-0.5142326354980469,
-0.053309116512537,
... | |
SDKs, FDT will not warn you about missing SDKs when you try to create a Haxe project. | [
0.6324868202209473,
0.11070019751787186,
0.26516151428222656,
0.5433047413825989,
-0.10007380694150925,
-0.6485284566879272,
0.08064640313386917,
0.3169771730899811,
-0.16080138087272644,
-0.40139952301979065,
-0.2375902384519577,
0.19646300375461578,
-0.1405639499425888,
-0.13669057190418... | |
Could someone please help me add a class to ui-dialog-buttonset.. I have 2 buttons "add" and "delete" and would like to style each appropriately.
How can I add a class to the button that reads 'Add this item'
```
$dialogContent.dialog({
modal: true,
resizable: false,
title: "New th... | [
0.08578524738550186,
-0.13554082810878754,
0.5423133969306946,
0.14752116799354553,
0.3811669647693634,
-0.14885281026363373,
0.16153976321220398,
-0.2097375988960266,
0.01880953647196293,
-0.759884774684906,
0.02828087843954563,
0.47111424803733826,
-0.13290336728096008,
0.261444211006164... | |
$dialogContent.dialog("destroy");
$dialogContent.hide();
$('#other').stuff("removeUnsavedEvents");
},
buttons: {
'Add this item' : function() { | [
0.16299518942832947,
-0.079834945499897,
0.36498555541038513,
-0.15377649664878845,
0.520036518573761,
0.1075490191578865,
0.34226804971694946,
-0.3143654465675354,
-0.15043428540229797,
-0.28129008412361145,
-0.3306540250778198,
0.47086960077285767,
-0.7048394083976746,
0.2071761339902877... | |
if(client_url.val() == '')
{
alert('client not selected');
$other.stuff("removeUnsavedEvents"); | [
0.04352669045329094,
-0.29125943779945374,
0.396724134683609,
-0.26063281297683716,
0.5186245441436768,
-0.36511221528053284,
0.4408038258552551,
-0.0814521312713623,
-0.2418661266565323,
-0.27753591537475586,
-0.6605713963508606,
0.6373206973075867,
-0.4145708680152893,
0.3567938208580017... | |
$dialogContent.dialog("close");
return;
}
$dialogContent.dialog("close");
}, | [
-0.24821920692920685,
0.20340023934841156,
0.6030856966972351,
-0.26321911811828613,
0.49116596579551697,
0.08726724237203598,
0.16541483998298645,
0.04950787127017975,
0.10037178546190262,
-0.5811074376106262,
-0.35640332102775574,
0.7446675300598145,
-0.6605525612831116,
0.25777265429496... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.