text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
Keys = new[] {"one", "two", "three"}
},
new MyClass {
Keys = new[] {"four", "five", "six"}
}
};
}
public void Test1() {
var list = GetMyClassList(); | [
0.36261671781539917,
-0.38266971707344055,
0.10085748881101608,
-0.18477213382720947,
0.15494020283222198,
-0.08221067488193512,
0.5813303589820862,
-0.4563702642917633,
-0.01995018683373928,
-0.5437768697738647,
-0.15709653496742249,
0.6984237432479858,
-0.29992103576660156,
0.17131382226... | |
var validTypes = new Dictionary<string, MyClass>();
foreach (var h in list) {
foreach (var key in h.Keys)
validTypes.Add(key, h);
}
}
public void Test2() {
var list = GetMyClassList();
var validPartTypes = list | [
0.421895831823349,
-0.1987755000591278,
0.38927409052848816,
-0.13273704051971436,
-0.0012532278196886182,
0.03467526286840439,
0.621369481086731,
-0.5678669214248657,
-0.04842071980237961,
-0.5558318495750427,
-0.2829705476760864,
0.6975834369659424,
-0.39590319991111755,
0.09661263227462... | |
.SelectMany(mc => mc.Keys.Select(k => new KeyValuePair<string,MyClass>(k, mc)))
.ToDictionary(x => x.Key, x => x.Value);
}
}
```
You can use an anonymous type instead of the `KeyValuePair<>` to make it a bit conciser:
```
var validPartTypes = list.SelectMany(mc => mc.Keys.Select(k => new { k, mc }))
... | [
-0.015782637521624565,
-0.07979250699281693,
0.6724660992622375,
0.00002092967406497337,
0.046257153153419495,
0.002329712500795722,
0.36075061559677124,
-0.6432816386222839,
-0.21274030208587646,
-0.589988112449646,
-0.2073717564344406,
0.6065593957901001,
-0.48216530680656433,
0.27678442... | |
clearer, it would be:
```
var validPartTypes = (from mc in list
from k in mc.Keys
select new { k, mc })
.ToDictionary(x => x.k, x => x.mc);
```
However your code is perfectly valid and I don't see any | [
0.4487432539463043,
-0.09662245959043503,
0.6722284555435181,
-0.09777110069990158,
0.1648712307214737,
-0.15288317203521729,
0.6170516014099121,
-0.35115987062454224,
-0.36143144965171814,
-0.4805426597595215,
-0.15516695380210876,
0.7589012980461121,
-0.236616313457489,
0.076211005449295... | |
much better way to accomplish that in C#. | [
0.03499662131071091,
0.1722475290298462,
0.009708085097372532,
0.12403637915849686,
-0.3115198314189911,
-0.18382610380649567,
0.12432653456926346,
0.0379975400865078,
-0.0690808892250061,
-0.46938979625701904,
-0.06928683817386627,
0.3574027121067047,
0.16785885393619537,
-0.2579240202903... | |
I've enabled ARC, In my `didFinishLaunchingWithOptions` method, I wrote the following code:
AppDelegate.h:
```
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) ViewController *viewController;
@end
```
AppDelegate.m:
```
- ... | [
0.09649832546710968,
0.042653992772102356,
0.7045280337333679,
-0.1701037734746933,
-0.1272529810667038,
-0.029748762026429176,
0.2636418342590332,
-0.6423589587211609,
0.10664068162441254,
-0.6981144547462463,
-0.2444366216659546,
0.8708469867706299,
-0.15358228981494904,
-0.0987733229994... | |
warning, the warning info is:
`file://.../AppDelegate.m: warning: Semantic Issue: Incompatible pointer types passing 'UINavigationController *__strong' to parameter of type 'ViewController *'`

How to remove the warning?
Thanks.
I assume that ViewC... | [
-0.0483892560005188,
0.06713105738162994,
0.37205204367637634,
-0.06411004066467285,
-0.13774371147155762,
-0.44342315196990967,
0.670855700969696,
0.04471372067928314,
-0.26732978224754333,
-0.2993605136871338,
-0.5381495356559753,
0.30679166316986084,
-0.5190882086753845,
0.2762645483016... | |
I need a HTML DOM event which can be bound to HTML DOM document and will be run when any HTML DOM element is inserted to DOM document?
Thank you very much!
Ok, so after analyzing thread dump we realized that somehow many threads were waiting on **awaitAvailable**() method of c3p0 library which manages DB connections i... | [
0.2851915955543518,
-0.17725376784801483,
0.4345724582672119,
0.18982109427452087,
-0.3146376609802246,
-0.3695151209831238,
0.39197665452957153,
-0.4370305836200714,
-0.20397116243839264,
-0.7095239162445068,
0.0794169008731842,
0.6834656596183777,
-0.10912173986434937,
0.1238034069538116... | |
check out new connections and results in processes to wait for connections perpetually (we had checkout timeout = 0).
But even after upgrading the library we faced this issue so we used *debugUnreturnedConnectionStackTraces* property to see what's happening to connections and why are they unavailable. After a day of l... | [
0.17905497550964355,
-0.15628404915332794,
0.27400049567222595,
0.24317635595798492,
0.02655002847313881,
-0.2827165722846985,
0.3342835605144501,
-0.07430681586265564,
-0.43333277106285095,
-0.5908356308937073,
0.27996495366096497,
0.26989510655403137,
-0.23297415673732758,
0.366902530193... | |
frequency of exception is high(more than size of pool within timeout interval) then all other process threads would pile up to get connection.
Since that code is fixed, we haven't seen any such thread pileup problems. | [
-0.08696842938661575,
-0.12007042020559311,
0.2804580330848694,
0.1722252368927002,
0.0685013085603714,
-0.0808831974864006,
0.09550850093364716,
-0.006812689360231161,
-0.8577492237091064,
-0.571841299533844,
0.16046305000782013,
0.07316119968891144,
-0.5047023296356201,
0.216275140643119... | |
I am playing around with delegates and I came to the situation where I am not sure what is going on.
In my logic, invocation list of "greetings" delegate should return 2, but it just returns 1. As you can see, I am passing the delegate reference to the object I created. I wanted to confirm that delegate can reference ... | [
0.23910246789455414,
0.09160381555557251,
0.26427772641181946,
-0.11648386716842651,
0.08281318843364716,
-0.2488810122013092,
0.4138552248477936,
-0.15377596020698547,
-0.13400112092494965,
-0.2983211874961853,
-0.07004392147064209,
0.4677080512046814,
-0.48657411336898804,
0.393688708543... | |
{
Action greetings = FirstGreeting;
Test test = new Test();
test.AddGreeting(greetings);
Console.WriteLine(greetings.GetInvocationList().Count());
greetings();
Console.ReadLine();
} | [
0.0009655976900830865,
-0.4611471891403198,
0.3845326006412506,
-0.1321398913860321,
0.10321556031703949,
0.04603077471256256,
0.5036360621452332,
-0.5220881700515747,
-0.0035752933472394943,
-0.41853150725364685,
-0.527579128742218,
0.2436089813709259,
-0.2569675147533417,
-0.125688865780... | |
static void FirstGreeting()
{
Console.WriteLine("This is the first greeting.");
}
}
class Test
{
public void AddGreeting(Action greetings)
{
greetings += new Action(SecondGreeting);
}
private | [
0.25806140899658203,
-0.5085500478744507,
0.17423570156097412,
-0.19539783895015717,
-0.07067324966192245,
-0.06998900324106216,
0.3236357867717743,
-0.35944780707359314,
0.06341025233268738,
-0.575377881526947,
-0.3869854211807251,
0.28345727920532227,
-0.3317910432815552,
-0.050059553235... | |
void SecondGreeting()
{
Console.WriteLine("This is the second greeting.");
}
}
```
> As you can see, I am passing the delegate reference to the object I created.
Yes, but you're then using:
```
greetings += new Action(SecondGreeting);
```
This creates a *new* delegate - it doesn't c... | [
0.20900188386440277,
-0.29381799697875977,
0.35596510767936707,
-0.10028783231973648,
-0.1682797521352768,
-0.12046954035758972,
0.30535638332366943,
-0.3524080514907837,
-0.18410083651542664,
-0.7586354613304138,
-0.321749210357666,
0.31930798292160034,
-0.44595909118652344,
0.11873464286... | |
+= new Action(SecondGreeting);
}
```
and call it as
```
test.AddGreeting(ref greetings);
```
(Or return a reference to the the new delegate, as shown in Peter's answer.)
See my [article on delegates and events](http://csharpindepth.com/Articles/Chapter2/Events.aspx) for more details about what `+=` does. | [
0.144473135471344,
-0.2069253772497177,
0.4266883134841919,
-0.06157698854804039,
-0.17212818562984467,
-0.22392979264259338,
0.33923014998435974,
-0.42384636402130127,
-0.47875741124153137,
-0.31178179383277893,
-0.3500327169895172,
-0.010818764567375183,
-0.12389442324638367,
0.048938896... | |
Could you please point me to an algorithm that takes a (binary) parse tree for evaluating a polynomial expression in a single variable and returns an equivalent parse tree that evaluates the polynomial according to Horner's rule.
The intended use case is in expression templates. The idea is that for a matrix `x` the p... | [
0.09631979465484619,
0.1509825885295868,
0.13917092978954315,
0.10290053486824036,
0.00413966691121459,
0.018324339762330055,
-0.13342951238155365,
-0.35279491543769836,
-0.13797566294670105,
-0.34001490473747253,
-0.10128054767847061,
0.25837936997413635,
-0.37397319078445435,
0.122329764... | |
getting an expression according to Horner's law would be [simple](http://en.wikipedia.org/wiki/Horner%27s_method).
I can give you a simple recursive function that computes these values, even though a more efficient one *may* exist.
### Theoretical stuff
First, let's formulate expressions. An expression `E`:
```
E =... | [
-0.407198965549469,
0.03857133537530899,
0.4213065803050995,
-0.3244331479072571,
-0.30145952105522156,
0.2574911415576935,
0.4056446850299835,
-0.5111303925514221,
-0.06460074335336685,
-0.37968453764915466,
-0.417343407869339,
0.38686010241508484,
-0.5084559917449951,
-0.0338853858411312... | |
(n > m)
E1 + E2 = {(a0+b0, a1+b1, ..., an+bn, b(n+1), ..., bm) (n < m)
{(a0+b0, a1+b1, ..., an+bn) (n = m)
```
that is, there are `max(n,m)+1` elements, and the `i`th element is computed by (with a C-ish syntax):
```
i<=n?ai:0 + i<=m?bi:0
```
* Multiplication: Given two expressions `E1 = ... | [
-0.4115638732910156,
0.19473128020763397,
0.3399104177951813,
-0.32769542932510376,
0.11188872903585434,
0.38541966676712036,
0.5793774127960205,
-0.5668793320655823,
0.04038647189736366,
-0.20950579643249512,
-0.46706366539001465,
0.43236473202705383,
-0.2830383777618408,
-0.1456941962242... | |
there are `n+m+1` elements, and the `i`th element is computed by
```
sigma over {ar*bs | 0<=r<=n, 0<=s<=m, r+s=i}
```
The recursive function is therefore defined as follows:
```
tuple get_monomial_coef(node)
if node == constant
return (node.value) // Note that this is a tuple
if node == variable
... | [
-0.5241823792457581,
0.05290002003312111,
0.5294780731201172,
-0.2588810324668884,
-0.2149949073791504,
-0.043158434331417084,
0.38863518834114075,
-0.27038320899009705,
-0.15018942952156067,
-0.225341334939003,
-0.6013761162757874,
0.18346789479255676,
-0.3411688506603241,
0.2751748263835... | |
return add(left_expr, right_expr)
if node == *
return mul(left_expr, right_expr)
```
where
```
tuple add(tuple one, tuple other)
n = one.size
m = other.size
for i = 0 to max(n, m)
result[i] = i<=n?one[i]:0 + i<=m?other[i]:0
return result
tuple mul(tuple one, tuple other)
n = ... | [
-0.5050157904624939,
-0.320767879486084,
0.5933634638786316,
-0.3328866958618164,
-0.08731777966022491,
0.21296721696853638,
0.12434877455234528,
-0.2470242977142334,
-0.3815920054912567,
-0.4145834445953369,
-0.5948028564453125,
0.5408125519752502,
0.006714324001222849,
-0.050140570849180... | |
result[i] = 0
for j=max(0,i-m) to min(i,n)
result[i] += one[j]*other[i-j]
return result
```
Note: in the implementation of `mul`, `j` should iterate from `0` to `i`, while the following conditions must also hold:
```
j <= n (because of one[j])
i-j <= m (because of other[i-j]) ==> j >= i-m
``... | [
-0.22652219235897064,
-0.13095465302467346,
0.3240445852279663,
-0.3852959871292114,
-0.1053166314959526,
0.045964621007442474,
0.2811954915523529,
-0.18358124792575836,
-0.055757950991392136,
-0.4916246235370636,
-0.46243199706077576,
0.7906045913696289,
-0.040642641484737396,
0.147653773... | |
a simple `std::vector` would suffice. Therefore:
```
vector<double> add(const vector<double> &one, const vector<double> &other)
{
size_t n = one.size() - 1;
size_t m = other.size() - 1;
vector<double> result((n>m?n:m) + 1);
for (size_t i = 0, size = result.size(); i < size; ++i)
result[i] = (i<... | [
-0.29982954263687134,
-0.43114185333251953,
0.395020991563797,
-0.33260488510131836,
-0.0074544004164636135,
0.35173144936561584,
0.1945631206035614,
-0.6785615086555481,
-0.33422717452049255,
-0.4165063798427582,
-0.3641951382160187,
0.5876360535621643,
-0.6063588261604309,
0.003273271722... | |
+ 1);
for (size_t i = 0, size = n + m + 1; i < size; ++i)
{
result[i] = 0.0;
for (size_t j = i>m?i-m:0; j <= n; ++j)
result[i] += one[j]*other[i-j];
}
return result;
}
vector<double> get_monomial_coef(const Node &node)
{
vector<double> result;
if (node.type == CONSTA... | [
-0.0021765879355371,
-0.6239726543426514,
0.5580548048019409,
-0.2103060483932495,
0.11407389491796494,
0.24806781113147736,
0.23506909608840942,
-0.5120264291763306,
-0.4411444664001465,
-0.2130049467086792,
-0.47297319769859314,
0.36414074897766113,
-0.5810761451721191,
0.115371197462081... | |
result.push_back(node.value);
return result;
}
if (node.type == VARIABLE)
{
result.push_back(0.0);
result.push_back(1); // be careful about floating point errors
// you might want to choose a better type than | [
-0.285401850938797,
-0.5285465121269226,
0.5517131686210632,
-0.41586923599243164,
0.22570638358592987,
0.07578710466623306,
0.0069301980547606945,
-0.236825630068779,
-0.3338479697704315,
-0.34829822182655334,
-0.15936848521232605,
0.27481773495674133,
-0.253363698720932,
0.26847633719444... | |
// double for example a class that distinguishes
// between constants and variable coefficients
// and implement + and * for it | [
0.3248353600502014,
-0.022353939712047577,
-0.06026618555188179,
0.08440595865249634,
-0.28628572821617126,
0.04469539225101471,
-0.13235005736351013,
-0.44200897216796875,
0.10219236463308334,
-0.058367688208818436,
-0.13153190910816193,
0.39519429206848145,
-0.17882966995239258,
0.080583... | |
return result;
}
vector<double> left_expr = get_monomial_coef(node.left);
vector<double> right_expr = get_monomial_coef(node.right);
if (node.type == PLUS)
return add(left_expr, right_expr);
if (node.type == MULTIPLY)
return mul(left_expr, right_expr);
// unknown node.type
}
vec... | [
-0.01946612074971199,
-0.2498253881931305,
0.4056156873703003,
-0.1552567183971405,
0.11436686664819717,
0.04861004278063774,
0.3389384150505066,
-0.49501025676727295,
-0.40610843896865845,
-0.4280466139316559,
-0.30781611800193787,
0.49856269359588623,
-0.4093940556049347,
0.2073867917060... | |
need to build an expression tree from the values this function gives you. | [
0.007437134627252817,
0.11686792224645615,
-0.1382589340209961,
0.2752779424190521,
0.2518285810947418,
-0.09109236299991608,
0.1903771311044693,
-0.27138739824295044,
0.2586953043937683,
-0.5783807635307312,
-0.09080850332975388,
0.646352231502533,
-0.19116760790348053,
-0.338090121746063... | |
I am a decent c/c++ programmer, but don't know much about web dev. I am interested in twitter/social data mining. So which is a better tool - RoR or Django? I am on level zero in both ruby and python. But python's syntax seemed easier to understand/learn. But the main Qs is that which tool has better mining related API... | [
0.4386247992515564,
0.08429683744907379,
-0.18780668079853058,
0.13121084868907928,
-0.35674038529396057,
-0.11307817697525024,
0.1098734438419342,
0.4232272207736969,
-0.3513159155845642,
-0.6220835447311401,
0.15798364579677582,
0.716653048992157,
0.04317855089902878,
-0.0330954119563102... | |
other hand for pure data mining I'd suggest python+[Pandas](http://pandas.pydata.org/) (Pandas is really well written and fast and there is no ruby equivalent as far as I know) or python + some R code called thru [rpy](http://rpy.sourceforge.net/). If in your data mining code you need to compute some symbolic math you ... | [
0.13308590650558472,
-0.06611534208059311,
-0.0978124737739563,
0.3166285455226898,
-0.48274359107017517,
-0.01774211972951889,
-0.028715217486023903,
0.055213943123817444,
-0.4323273301124573,
-0.2844269871711731,
0.05325813964009285,
0.6096699237823486,
-0.12328127771615982,
-0.269749969... | |
I'm currently writing a java program that requires some Data to run.
The data isn't particularly extensive; it's a list of all elements of the periodic table (in both symbol and full name) verse their atomic mass, up to about 7 decimal places each.
Currently, I have this data stored in a .txt file on my computer in... | [
0.43846648931503296,
0.475632905960083,
0.2241789996623993,
-0.11631110310554504,
0.08378048241138458,
0.10780398547649384,
0.19705641269683838,
-0.07436983287334442,
-0.21302232146263123,
-0.33915945887565613,
0.13563446700572968,
0.18175923824310303,
-0.18281467258930206,
0.1415118277072... | |
platforms that can support Java, such as mobile devices.
Is there any special considerations I need to make in regards to file IO to ensure the program is compatible?
I have no idea how file IO works on platforms such as Android or iPads, or even Macs.
How should I perform this data importation such that the progra... | [
0.24673575162887573,
0.21864688396453857,
0.08122171461582184,
-0.006905251648277044,
0.2892931401729584,
-0.2105337679386139,
0.06518346071243286,
-0.0698246955871582,
-0.20929867029190063,
-0.6323850154876709,
-0.03368744999170303,
0.5403770208358765,
-0.43290239572525024,
-0.19150100648... | |
Data unalterable after compilation, which I feel is bad practise).
I've also wondered whether I should be using Java ME instead of SE too.
Thanks!
---
Specs:
Java SE (jre 7) Application.
Resources in J2SE, Android and (probably) J2ME that are 'embedded application resources' can (and thereby should) be accesse... | [
0.0024979831650853157,
-0.03745269402861595,
0.5150637626647949,
0.3588886260986328,
0.3076023757457733,
-0.1132587417960167,
0.3211439847946167,
-0.012070753611624241,
-0.5552623271942139,
-0.531575083732605,
-0.39264199137687683,
0.6137807369232178,
-0.05680171400308609,
0.20882856845855... | |
The data .. (is).. a list of all elements of the periodic table (in both symbol and full name) verse their atomic mass, up to about 7 decimal places each.
As mentioned by gt\_ebuddy, a CSV might be used for this. OTOH I would tend to use XML. XML can handle more complicated structures than immediately needed here, but... | [
0.18900111317634583,
0.44131138920783997,
0.3955925703048706,
0.2991560995578766,
-0.11594653874635696,
-0.13075564801692963,
-0.04243779182434082,
-0.3736187517642975,
-0.048171333968639374,
-0.16246724128723145,
-0.1638479381799698,
0.10563667863607407,
-0.141473188996315,
-0.04742730036... | |
I need to create a web service that returns XML data to some of my clients.
Where ever I [google](http://www.google.no/search?q=php%20soap%20tutorial&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla%3anb-NO%3aofficial&client=firefox-a#hl=no&client=firefox-a&hs=mN7&rls=org.mozilla%3anb-NO%3aofficial&sclient=psy-ab&q=php%20web%... | [
0.2510303258895874,
0.016552913933992386,
0.41959765553474426,
-0.16298575699329376,
-0.3769945800304413,
0.23915840685367584,
0.341395765542984,
-0.517117440700531,
-0.06217094510793686,
-0.5381679534912109,
-0.07495297491550446,
0.4601719379425049,
-0.17137128114700317,
-0.11578223109245... | |
architecture is just a guideline where an application is considered RESTful if it meets the defined characteristics of a REST web service.
JSON is commonly used as the transport, instead of XML. The advantage is that JavaScript can instantly parse JSON, and many server side technologies have libraries for deserializin... | [
-0.00234203995205462,
0.04852216690778732,
0.20211748778820038,
0.12697692215442657,
-0.022290674969553947,
-0.08020280301570892,
0.09085105359554291,
-0.014615148305892944,
-0.15168637037277222,
-1.0139195919036865,
-0.4525223970413208,
0.5407142639160156,
-0.08508817851543427,
-0.0281534... | |
clarity only */
success: function(data) {
alert(JSON.stringify(data) ); /* output json
alert("engine = " + data.engine);
}
});
```
Insert a vehicle in the collection
```
HTTP POST http://example.com/cars/ford/f150/?vin=F14564564564&color=blue&engine=I6&...
// insert record on server.
var da... | [
0.006033190060406923,
0.03338615223765373,
0.2888649106025696,
0.3567560017108917,
0.16402043402194977,
0.21964280307292938,
-0.0815596804022789,
0.012032984755933285,
0.11536980420351028,
-0.061163030564785004,
0.11500994116067886,
1.105209469795227,
0.3051344156265259,
0.0333178229629993... | |
I am writing a service application in `Android`. In this application, I am receiving commands from Main activity using `onStartCommand` event. The `IF` block is checking a variable. As you can see in the picture(Debug mode), the value is "start" but the `IF` statement doesn't work and will redirect to `Else`. why?
 there is an description how to build the framework from scratch. How ever I want to understand how somethings work internally so I want to setup the Eclipse-IDE to make this as comfortable as possible. Has anyone a description how this can be ... | [
0.4194997549057007,
0.12899811565876007,
0.20898281037807465,
-0.17354844510555267,
-0.2419540286064148,
-0.16921257972717285,
0.21761783957481384,
-0.3880282938480377,
-0.19255411624908447,
-0.85248202085495,
0.13667891919612885,
0.6236610412597656,
-0.12912370264530182,
-0.08048845827579... | |
"0.3.0")
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.0.0")
```
Then make the normal build processes.
```
$ cd Play20/framework
$ ./build
> build-repository
> eclipse
```
Create a Scala-IDE give her enough Space, choose the 64-bit variant if you can!
Import projects from `play20/framework/sr... | [
0.3129768967628479,
-0.050819069147109985,
0.3690584897994995,
-0.12868060171604156,
-0.06039518862962723,
-0.21423178911209106,
0.12877264618873596,
-0.5268861055374146,
-0.3617916405200958,
-0.7668400406837463,
-0.1913401484489441,
0.5554512143135071,
-0.2012738585472107,
-0.221091046929... | |
```
public class Readparam
{
private static String method_name;
public static HashMap<String, Vector<String>> getParameters(String file_name)
{
HashMap temp_map = new HashMap();
String current_dir = System.getProperty("user.dir");
File new_file = new File(current_dir + "\\parameter... | [
-0.17420661449432373,
-0.13711707293987274,
0.4667763113975525,
0.019601725041866302,
0.08425374329090118,
0.027697492390871048,
0.42377638816833496,
-0.41299933195114136,
-0.12284546345472336,
-0.38228839635849,
-0.3508113920688629,
0.47214072942733765,
-0.4902721643447876,
0.278023809194... | |
try
{
input = new BufferedReader(new FileReader(new_file));
String current_line = null;
while (((current_line = input.readLine()) != null) && (current_line.length() > 0))
{
stringtok = new StringTokenizer(current_line, "("); | [
-0.1466524451971054,
-0.5611633658409119,
0.6407444477081299,
-0.19177158176898956,
0.4316512644290924,
0.34395632147789,
0.44090819358825684,
-0.5651423335075378,
0.07875554263591766,
-0.44347912073135376,
-0.313088595867157,
0.362606406211853,
-0.3749713897705078,
0.23465341329574585,
... | |
method_name = stringtok.nextToken();
String parsed_parameters = current_line.subSequence(current_line.indexOf("(") + 1, current_line.indexOf(")")).toString();
StringTokenizer paramtok = new StringTokenizer(parsed_parameters, ",");
String[] parsed_string = parsed_parame... | [
-0.32666146755218506,
-0.5384765267372131,
0.5637351274490356,
-0.03288208320736885,
0.18564189970493317,
0.20956426858901978,
0.37368664145469666,
-0.7949607372283936,
-0.32302722334861755,
0.07045511901378632,
-0.1499694287776947,
0.2656119167804718,
-0.38173964619636536,
0.2285626977682... | |
for (int i = 0; i < parsed_string.length; i++)
{
String[] temp_parse = parsed_string[i].split(" ");
if (i < parsed_string.length - 1) | [
0.12508831918239594,
-0.3855232000350952,
0.13867123425006866,
-0.39299333095550537,
0.15966778993606567,
0.07170996814966202,
0.3103492558002472,
-0.5559530258178711,
-0.03830181434750557,
-0.20627683401107788,
-0.4609953463077545,
0.5604099631309509,
-0.5227013826370239,
-0.1747455298900... | |
parsing = parsing + temp_parse[0] + ", ";
else {
parsing = parsing + temp_parse[0];
}
}
parsing = parsing + ")"; | [
-0.48220282793045044,
-0.018347924575209618,
0.3681398332118988,
-0.17919336259365082,
-0.04780237749218941,
0.27457278966903687,
0.4231453239917755,
-0.17402856051921844,
-0.37803134322166443,
-0.30928942561149597,
-0.5574840307235718,
0.6201728582382202,
-0.8044687509536743,
-0.212638780... | |
Vector temp_vector = new Vector();
for (String s : parsed_string) {
temp_vector.add(s);
}
temp_map.put(parsing, temp_vector);
}
} | [
-0.18913358449935913,
-0.6411436200141907,
0.4871644675731659,
-0.24699348211288452,
-0.313993901014328,
0.42715808749198914,
-0.007782916538417339,
-0.37429800629615784,
-0.3638579845428467,
-0.8802782893180847,
-0.33752694725990295,
0.5403110384941101,
-0.6233754754066467,
-0.16754752397... | |
catch (FileNotFoundException ex)
{
System.out.println("File not found: " + file_name);
String method_name = null;
return method_name;
}
```
any help on this is aprreciated
I have the last line "return method\_name that does not compile
i recieve an error incompatible types, expecte... | [
0.18415138125419617,
-0.3011675775051117,
0.44680118560791016,
-0.14458376169204712,
0.19891539216041565,
0.25327128171920776,
0.33368119597435,
-0.35434529185295105,
-0.304034560918808,
-0.3735661208629608,
-0.06848465651273727,
0.25475260615348816,
-0.44065988063812256,
-0.01325554214417... | |
i++) {
NSString *imageName = [NSString stringWithFormat:@"%03d.jpg", i];
[animationImages addObject:[UIImage imageNamed:imageName]];
}
Background.animationImages = animationImages;
```
The format specifier `%03d` means an integer padded with 0's to give a minimum field width of 3.
**BUT**
depending on the ... | [
-0.06263678520917892,
-0.06407923251390457,
0.5198096036911011,
-0.14169664680957794,
-0.20205803215503693,
0.31500035524368286,
0.10138343274593353,
-0.0787564367055893,
-0.25156715512275696,
-0.3716282248497009,
-0.09692839533090591,
0.5637384653091431,
-0.4205523431301117,
-0.0100625781... | |
Right, this is a very odd issue that I'm wondering how i am going to explain it succinctly.
I have a WP plugin that records rows in a mysql table like so:
```
meta_id post_id meta_key meta_value
65387 605 _likes 9
```
Then on one of my pages I was running a query to select the most liked... | [
0.2964971661567688,
0.3231799602508545,
0.699674665927887,
-0.06672749668359756,
-0.14977508783340454,
0.0779334232211113,
-0.04748133569955826,
0.36759889125823975,
-0.5306485891342163,
-0.7720562815666199,
0.31230682134628296,
0.4136209189891815,
-0.18133704364299774,
0.3412228226661682,... | |
not appear as top anymore and disappear from the query results. Odd.
I went to the database and (in PHPMyAdmin) ordered by meta\_value and it did return 9 as the top results, none of the 10's appeared!?
One thing I thought it might be is the type of field (meta\_value), these are the settings:
```
# Column T... | [
-0.1855006366968155,
-0.0917164757847786,
0.6906929612159729,
0.18554802238941193,
-0.03193517029285431,
0.13515326380729675,
0.29391661286354065,
0.3961088955402374,
-0.3821091651916504,
-0.1433403342962265,
-0.31047898530960083,
0.18626843392848969,
-0.3555394411087036,
0.221209600567817... | |
Yes NULL
```
Can anyone think of anything that might mean the ORDER BY is not working when the value is 10 or above!?
Thanks
If you can't change column datatype don't worry ... No need to do that
you need to just `cast` it's values in integers in `ORDER BY` clause.
user trick :
```
ORDER BY meta_value+0;
... | [
0.01659025251865387,
0.33900004625320435,
0.48481398820877075,
-0.06531272828578949,
-0.11487554013729095,
0.07879804074764252,
0.36046987771987915,
-0.005296177230775356,
-0.26818233728408813,
-0.37723758816719055,
-0.026447612792253494,
0.47881975769996643,
-0.5550283193588257,
0.0291079... | |
I am trying to set an integer and a string value in execSQL statement :
```
mydb.execSQL("UPDATE emptable set age=? where name=?",new int[] {emp_age},new String[] {emp_name});
```
where emp\_age is an integer and emp\_name is a String. But this is not working.How can i achieve this?
Sorry, but I'm not happy with the... | [
0.42874598503112793,
0.4239655137062073,
0.25162482261657715,
0.05252930894494057,
0.15093451738357544,
0.19002202153205872,
0.5498713850975037,
-0.14248086512088776,
0.03442031517624855,
-0.6367911100387573,
0.11866308748722076,
0.4979211688041687,
-0.21112830936908722,
0.3530448973178863... | |
given example-code) wrong. If you read the documentation, you'll notice that it says:
> Execute a single SQL statement that is **NOT** a
> SELECT/INSERT/**UPDATE**/DELETE.
on the first line. It also lists alternatives for the above mentioned operations:
> For UPDATE statements, use any of the following instead.
>
... | [
0.26144421100616455,
0.3717159628868103,
0.5538146495819092,
-0.26423290371894836,
0.30415767431259155,
0.13658852875232697,
0.5338422060012817,
-0.2624320387840271,
-0.14439657330513,
-0.6032987236976624,
-0.31171706318855286,
0.5028337240219116,
-0.3631141483783722,
0.326622873544693,
... | |
I have the following (simplified) database tables:
```
Products
- ProductID, int, PK
- Name, varchar(50)
Orders
- OrderID, int, PK
- ProductID, int, FK
- Quantity, int, not null
```
I would like to read all products and if orders are available, sum the quantity of all orders for that product.
The SQL query would l... | [
-0.23273411393165588,
0.2823970913887024,
0.5766014456748962,
-0.2094184011220932,
-0.15601041913032532,
0.5371053218841553,
-0.22421149909496307,
-0.5168516635894775,
-0.16517317295074463,
-0.4805109202861786,
-0.12549273669719696,
0.2645319104194641,
-0.1506645530462265,
0.20371375977993... | |
o.ProductID into po
from subOrder in po.DefaultIfEmpty()
group subOrder by new
{
p.ProductID,
p.Name,
}
into productGroup
select new
{
productGroup.Key.ProductID,
productGroup.Key.Name,
Quantity = productGroup.Sum(subOrder => subOrder.Quantity)
};
```
Alt... | [
-0.13885942101478577,
-0.013556868769228458,
0.3786909282207489,
-0.3684411942958832,
0.17476387321949005,
0.3481259047985077,
-0.07246865332126617,
-0.3495205044746399,
-0.10372331738471985,
-0.5129702687263489,
-0.20010659098625183,
0.33055779337882996,
-0.128505676984787,
0.155262082815... | |
type System.Int32 which is a non-nullable value type.
Can someone please tell me what's wrong with the query. Any help would be appreciated!
@HarryJohnston said in comments:
*"To do what you're asking for, write a launcher application that uses CreateProcessWithLogonW (with a known admin username and password) to sta... | [
0.2614623010158539,
0.21176667511463165,
0.4195247292518616,
-0.08388017863035202,
-0.24603085219860077,
-0.09767237305641174,
0.38185104727745056,
-0.15388840436935425,
0.051211822777986526,
-0.5131346583366394,
-0.1436886191368103,
0.3594115674495697,
-0.3372960388660431,
0.2135010212659... | |
I need to show the data programatically, but my code is showing data always the same. Same even I change the WHERE em.emp\_id=5 or 6
```
private void Form1_Load(object sender, EventArgs e)
{
try
{
SqlConnection c = frmMain.connect();
rptEmpProf cryRpt = new rptEmpProf();
TableLogOnInfo... | [
-0.041955891996622086,
0.15903843939304352,
0.8791738748550415,
0.010597595013678074,
0.19562272727489471,
0.025653425604104996,
0.30813688039779663,
-0.2961423993110657,
-0.4474535286426544,
-0.48391854763031006,
-0.19173236191272736,
0.7512009143829346,
-0.37771573662757874,
0.3485490381... | |
Tables CrTables ;
crConnectionInfo.ServerName = frmMain.dbSrvrName;
crConnectionInfo.DatabaseName = frmMain.dbName;
crConnectionInfo.UserID = frmMain.dbUsrName;
crConnectionInfo.Password = frmMain.dbPass;
CrTables = cryRpt.Database.Tables ;
foreach (CrystalDecisions.Cryst... | [
-0.4329264461994171,
0.35244059562683105,
0.657807469367981,
0.13429489731788635,
-0.1557910293340683,
0.3761014938354492,
0.2147703468799591,
-0.23110650479793549,
-0.49571946263313293,
-0.3196293115615845,
-0.16715744137763977,
0.3977614939212799,
-0.17611566185951233,
0.558695375919342,... | |
crtableLogoninfo.ConnectionInfo = crConnectionInfo;
CrTable.ApplyLogOnInfo(crtableLogoninfo);
}
string q = "SELECT em.emp_id 'Employee ID', " +
"em.emp_fname 'First Name', " +
"em.emp_lname 'Last Name', " +
"em.emp_phone 'Phone', " + | [
-0.3717838227748871,
0.3092469573020935,
0.8588584065437317,
0.17022505402565002,
0.3074379563331604,
0.31379497051239014,
-0.2090616375207901,
-0.1742018461227417,
-0.36403903365135193,
-0.40368667244911194,
-0.2698754668235779,
0.5342585444450378,
-0.3882279396057129,
0.41688159108161926... | |
"em.emp_email 'Email', " +
"em.emp_addr 'Address', " +
"em.emp_join_dt 'Join Date', " +
"em.emp_salary 'Salary'," +
"em.emp_card_no 'Card No.', " +
"ds.dsg_name 'Designation', " +
"dp.dept_name 'Department', " + | [
0.04634235054254532,
0.031428005546331406,
0.5210242867469788,
0.23131617903709412,
0.28474000096321106,
0.21250371634960175,
0.014082315377891064,
-0.29784151911735535,
-0.46747222542762756,
-0.39162543416023254,
-0.5376892685890198,
0.20746158063411713,
-0.0544973649084568,
0.41303959488... | |
"sf.sft_name 'Shift', " +
"sc.sec_name 'Section' " +
"FROM employee em INNER JOIN designations ds ON ds.dsg_id=em.emp_dsg_id " +
"INNER JOIN sections sc ON sc.sec_id = ds.dsg_sec_id " +
"INNER JOIN departments dp ON dp.dept_id = sc.sec_dept_id " +
"INNER JOIN shif... | [
0.1250312328338623,
-0.09353841096162796,
0.3783486485481262,
-0.2641519010066986,
-0.036424264311790466,
0.039627473801374435,
0.044414419680833817,
-0.18644943833351135,
-0.4852062165737152,
-0.1648615002632141,
-0.6129641532897949,
0.30475279688835144,
-0.18091246485710144,
0.1856076717... | |
ON sf.sft_id = em.emp_sft_id " +
"WHERE em.emp_id = 6;";
SqlCommand cmd = new SqlCommand(q, c);
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
DataSet ds = new DataSet();
da.Fill(ds);
cryRpt.SetDataSource(ds);
crystalReportViewer1.Repor... | [
-0.030507776886224747,
-0.4423322379589081,
0.824505090713501,
-0.0010577901266515255,
-0.2574674189090729,
0.2479419708251953,
0.12206444144248962,
-0.5450943112373352,
-0.32660582661628723,
-0.32476380467414856,
-0.3190312087535858,
0.42306092381477356,
-0.16140976548194885,
0.1616626083... | |
frmMain.disconnect(c);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
this.Close();
}
}
```
@HarryJohnston said in comments:
*"To do what you're asking for, write a launcher application that uses CreateProcessWithLogonW (with a known admin username and password) to start the rea... | [
0.3605748116970062,
0.2134019136428833,
0.6361358165740967,
-0.3172013759613037,
-0.09018450230360031,
-0.21332956850528717,
0.31641238927841187,
-0.33206430077552795,
-0.059043798595666885,
-0.16966745257377625,
-0.3827613294124603,
0.684640109539032,
-0.2731442451477051,
0.08103404194116... | |
I want to load wordpress in a smarty template. I used the code below to load wordpress in a php file and it worked. But it is not working a smarty template.
In php file:
```
<?php
include $_SERVER['DOCUMENT_ROOT'].'/wordpress/wp-load.php';
get_header();
?>
```
In smarty template file:
```
{php}
include $_SERVER['D... | [
0.07564752548933029,
-0.12435397505760193,
0.5418046712875366,
0.01467335969209671,
0.09082560241222382,
-0.06488662958145142,
0.10375398397445679,
-0.09435159713029861,
-0.18633778393268585,
-0.6700989603996277,
-0.22311805188655853,
0.5429288148880005,
-0.33551084995269775,
0.03794987127... | |
for example,
in this one,
I 'm not very understand about the this pointer,
this question is not about operator+ overload,
is about the this pointer, and its relation between the class,
\*this pointer point to what thing?
thank u very much!
```
class Integer {
int i;
public:
Integer(int ii): i(i... | [
-0.24489165842533112,
-0.04444644972681999,
0.31053364276885986,
-0.01792297326028347,
0.046690668910741806,
-0.11183233559131622,
0.2824469804763794,
-0.22236831486225128,
-0.09659039974212646,
-0.5557026267051697,
-0.24702297151088715,
0.8314509987831116,
-0.3750917613506317,
0.044185593... | |
Integer&
operator+=(const Integer& rv) {
i += rv.i;
return *this;
}
}
```
Don't use two or more `JFrames`, nor with separated and compiled `Jar files`, this is road to the hell, better would be look at [CardLayout](http://docs.oracle.com/javase/tutorial/uiswing/... | [
0.25549834966659546,
0.1571928858757019,
0.5153242945671082,
0.022991599515080452,
-0.0009554651915095747,
-0.25638073682785034,
0.22842733561992645,
-0.5781644582748413,
-0.3142104744911194,
-0.42201295495033264,
0.19947923719882965,
0.5838205218315125,
-0.12158656120300293,
0.12215236574... | |
I'm trying to think of a way to create a plugin architecture for my own framework. I've read numerous topics and post here and on other sites. And basically i've came to the following solution which seems to be the only good option in PHP (currently).
The idea is that every class extends a sort of observer like class.... | [
0.35182371735572815,
0.07704553753137589,
0.27133071422576904,
0.009405544027686119,
-0.04599820822477341,
-0.1112336739897728,
0.3151228427886963,
-0.06475555151700974,
-0.10546664148569107,
-0.6107925176620483,
0.12507618963718414,
0.516737699508667,
-0.5647541880607605,
-0.1530757397413... | |
$this->checkForEarlyHooks();
// Init some standard stuff
$this->view = new Template();
$this->baseLayout = 'layout.html';
$this->something = new Something();
// Plugin check, notify all loaded plugins
$this->checkForLateHooks();
}
}
```
So what basically happends... | [
0.3979252278804779,
-0.04498634859919548,
0.6067591309547424,
-0.3434996008872986,
0.0664907768368721,
-0.4642171561717987,
0.32157984375953674,
-0.33677342534065247,
-0.19909466803073883,
-0.8045151829719543,
-0.1456403136253357,
0.5140615701675415,
-0.45205122232437134,
0.070268779993057... | |
convenient when you want to do a some sort of login check with a plugin, before an Action method is actually invoked.
The Plugin class can resolve from what class is got called from and knows for what functions to look for in the loaded plugins.
Also note that it checks the loaded plugin list 2 times. One before anyt... | [
0.27021661400794983,
-0.3065202832221985,
0.47203871607780457,
-0.03863660246133804,
0.16164733469486237,
-0.24659956991672516,
-0.05911361053586006,
-0.24467115104198456,
0.0355084054172039,
-0.712497353553772,
0.109190434217453,
0.8333576917648315,
-0.44281986355781555,
-0.23750218749046... | |
( &$baseLayout )
{
$baseLayout = 'login.html';
}
```
Now basically my question is, is this approach any good? I know there are probably alot of other ways to do it too. But i mainly don't want to run into design problems later on. It seems like a good idea now, but you never know how things work out later on...
... | [
0.4380221962928772,
0.13725604116916656,
0.5207281112670898,
-0.029529836028814316,
-0.15340569615364075,
-0.3105705678462982,
0.3381548225879669,
0.16389364004135132,
-0.041436146944761276,
-0.8611924052238464,
0.07366866618394852,
0.5541960597038269,
-0.5099742412567139,
-0.0728059783577... | |
system and perhaps asking on <https://softwareengineering.stackexchange.com/> would give you more ideas, but I'll try to help by sharing my ideas and experience.
I'll share some of my own experiences which I've learned through a series of my own frameworks. Currently [Agile UI](http://github.com/atk4/ui) and [Agile Da... | [
0.3963228166103363,
-0.18272356688976288,
0.17729513347148895,
0.039195846766233444,
0.09187868237495422,
0.09530910849571228,
0.06996483355760574,
-0.41821742057800293,
-0.2174507975578308,
-0.5440526604652405,
-0.04141376540064812,
0.5353059768676758,
-0.06136900931596756,
-0.10082972049... | |
documented it here: <http://agile-core.readthedocs.io/en/develop/hook.html>
Host application:
```
... some code here ..
$this->hook('beforeInit');
$this->init();
$this->hook('afterInit');
... code goes on ..
```
Plugin:
```
$host_app->addHook('beforeInit', function($object) {
echo "About to execute init of $ob... | [
0.27975448966026306,
0.032610271126031876,
0.6635653972625732,
-0.03731200844049454,
0.09730976074934006,
0.18926335871219635,
0.066347137093544,
-0.3125598728656769,
-0.13356322050094604,
-0.8012715578079224,
-0.2320340871810913,
0.3299729824066162,
-0.18087966740131378,
0.095318250358104... | |
2 stages - "initialization of a render tree" and then "rendering".
Host Application:
```
$layout->menu = new \atk4\ui\Menu();
$layout->add($layout->menu, 'TopMenu');
```
The above code show how a new Component (Menu) can be initialized and inserted into the `$layou`. Furthermore the HTML output of $menu is directed... | [
-0.08341366052627563,
-0.14636117219924927,
0.44099298119544983,
-0.2381560504436493,
0.15327081084251404,
0.1263173222541809,
0.2129323035478592,
-0.3416678011417389,
0.007116254884749651,
-0.9813328385353088,
-0.54918372631073,
0.6647202372550964,
-0.2621489465236664,
-0.0535140223801136... | |
$app->layout->menu = new \plugin\SuperMenu();
$app->layout->add($app->layout->menu);
});
```
This can be used to replace standard menu with a more powerful implementation from your add-on.
My implementation of components is documented here:
<http://agile-ui.readthedocs.io/en/latest/view.html#initializing-rende... | [
0.09005414694547653,
0.1451941728591919,
0.6815395951271057,
-0.23882992565631866,
-0.07089707255363464,
0.07256864756345749,
0.2438974231481552,
-0.5755243897438049,
0.053403452038764954,
-0.9263290762901306,
-0.38126346468925476,
0.4627520442008972,
-0.4882725477218628,
-0.15086524188518... | |
gender fields
```
Demo: <http://ui.agiletoolkit.org/demos/form2.php> (2nd form)
In this approach object `User` contains enough meta-data for the Form to populate it's fields, captions perform validation and also save/load data.
Since "User" class can also be declared in an add-on it makes a pretty powerful way to ... | [
0.08404648303985596,
-0.07964830845594406,
0.011187109164893627,
0.029177485033869743,
-0.257174551486969,
0.42050397396087646,
0.17055268585681915,
-0.2979857623577118,
-0.030900191515684128,
-0.4773746132850647,
-0.09304732084274292,
0.4209944009780884,
-0.2662448585033417,
-0.2185614109... | |
Form Fields, Actions etc.
CONCLUSION
----------
I think add-on deign boils down to:
* simplicity of installation and use
* does add-on need to operate out-of-the-box?
* avoiding conflicts between add-ons
* defining different add-on types - authentication, UI, behaviour
* can add-on extend another add-on
* will add-o... | [
0.44317299127578735,
-0.018214115872979164,
0.41211655735969543,
0.17265498638153076,
-0.17548222839832306,
-0.29679521918296814,
0.16822823882102966,
-0.4705532193183899,
0.24481485784053802,
-0.5084788799285889,
-0.3739992082118988,
0.680364191532135,
-0.23139195144176483,
-0.38591837882... | |
I am using a custom TreeView class because i need drag-and-drop capabilities. I am painting lines over treeview in order to show the user where will the dragged item go. This creates a lot of visible flicker because each time a change in the "drop target" happens, i have to re-draw the treeview (to clean whatever was d... | [
0.46240681409835815,
-0.46503177285194397,
0.40719231963157654,
0.045305777341127396,
-0.12618418037891388,
0.1045524999499321,
0.029783517122268677,
-0.07639788091182709,
-0.07792647927999496,
-0.49104005098342896,
0.4308014214038849,
0.3892877995967865,
-0.4318113923072815,
-0.2245794236... | |
and thus prevent the flicker.
However, i have absolutely no clue on how to do it. I know i can set panel color to transparent, but that wont make it become click-though...
PS: I ended up going the easy way out, that is - redrawing over what i've drawn before with white color, and then drawing new selection indicator ... | [
0.32354655861854553,
-0.15562137961387634,
0.462125301361084,
0.09069445729255676,
0.043656643480062485,
0.2188969999551773,
-0.05218266323208809,
-0.3959534466266632,
-0.1874898374080658,
-0.6534945964813232,
0.10794953256845474,
0.5133554935455322,
-0.24535413086414337,
-0.06992789357900... | |
the things behind it). Perhaps there is some hack around this but every time I've run into problems with component flicker there has never been a really satisfying solution, including leveraging component (or even custom) double-buffering. When live graphical interaction like this becomes a necessary part of the applic... | [
0.32002755999565125,
-0.3510247766971588,
0.5703285932540894,
0.16948749125003815,
-0.3184247612953186,
-0.2399284690618515,
-0.020892107859253883,
0.16416160762310028,
-0.2093932032585144,
-0.7166011929512024,
-0.08029689639806747,
0.5079172849655151,
-0.28178870677948,
-0.099983043968677... | |
an example using the WPF Interoperability component in a winforms application :
1) Add a new ElementHost to your form (I called it `elementHost1` here)
2) Add a new WPF UserControl to your project (I called it `TreeCanvas`)
XAML
```
<UserControl x:Class="WindowsFormsApplication1.TreeCanvas"
xmlns="http://schemas.mi... | [
-0.07441899925470352,
-0.35400766134262085,
0.9017899036407471,
-0.11136723309755325,
-0.09141753613948822,
-0.020989911630749702,
0.04916989058256149,
-0.7151720523834229,
-0.1857760101556778,
-0.602355420589447,
-0.23885716497898102,
0.46381381154060364,
-0.06748863309621811,
-0.18053025... | |
partial class Form1 : Form
{
//make a new TreeCanvas
private TreeCanvas MyTreeCanvas = new TreeCanvas();
public Form1()
{
InitializeComponent();
//attach the TreeCanvas component to the element host
this.Width = 400; | [
-0.2536284029483795,
-0.3044511377811432,
0.4844503104686737,
-0.2890660762786865,
0.05526958778500557,
-0.020009588450193405,
0.40316489338874817,
-0.21851558983325958,
0.07745032012462616,
-0.5459381937980652,
-0.48167508840560913,
0.33504927158355713,
-0.2676337957382202,
0.183247566223... | |
this.Height = 400;
elementHost1.Child = MyTreeCanvas;
elementHost1.Location = new System.Drawing.Point(30, 30);
elementHost1.Height = 300;
elementHost1.Width = 300;
// Just adding some random stuff to the treeview
int i | [
0.008500048890709877,
-0.3677675724029541,
0.44131413102149963,
-0.16687379777431488,
0.3321816027164459,
0.23636391758918762,
0.29839155077934265,
-0.31741687655448914,
-0.15067866444587708,
-0.531379222869873,
0.027538686990737915,
0.07519146800041199,
-0.17394885420799255,
-0.0208595693... | |
= 0;
int j = 0;
for (i = 0; i <= 10; i++)
{
TreeViewItem nitm = new TreeViewItem();
nitm.Header = "Item " + Convert.ToString(i); | [
-0.11291307955980301,
-0.19869382679462433,
0.5577362179756165,
-0.18159429728984833,
-0.13122065365314484,
0.2901831865310669,
0.6414387822151184,
-0.5335893630981445,
-0.1681051254272461,
-0.49934840202331543,
-0.4077136814594269,
0.39939162135124207,
-0.13281738758087158,
0.213278278708... | |
MyTreeCanvas.TreeView1.Items.Add(nitm);
for (j = 1; j <= 3; j++)
{
TreeViewItem itm = (TreeViewItem)MyTreeCanvas.TreeView1.Items[i];
itm.Items.Add("Item " + Convert.ToString(j)); | [
-0.17138507962226868,
-0.039454344660043716,
0.6652840375900269,
-0.28639474511146545,
-0.15140242874622345,
0.26796892285346985,
0.7972273826599121,
-0.5023733973503113,
-0.1466880589723587,
-0.5511613488197327,
-0.4013558626174927,
0.5321029424667358,
-0.19478842616081238,
0.251714289188... | |
}
}
//Draw a line on the canvas with the treeview
Line myLine = new Line();
myLine.Stroke = System.Windows.Media.Brushes.Red;
myLine.X1 = 1;
myLine.X2 = 50; | [
0.14063023030757904,
-0.5130901336669922,
0.7479287385940552,
-0.30759066343307495,
0.18973273038864136,
0.34969085454940796,
0.11902810633182526,
-0.3932088017463684,
-0.06697965413331985,
-0.5686957836151123,
-0.14441078901290894,
0.5104323029518127,
-0.46566420793533325,
0.0643922835588... | |
myLine.Y1 = 1;
myLine.Y2 = 300;
myLine.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
myLine.VerticalAlignment = VerticalAlignment.Center;
myLine.StrokeThickness = 2;
MyTreeCanvas.Canvas1.Children.Add(myLine);
}
}
}
```
This give... | [
-0.1512899100780487,
-0.16298437118530273,
0.7392890453338623,
0.007398118730634451,
0.2932869493961334,
0.3292974829673767,
0.1472802311182022,
-0.012557156383991241,
-0.3041088283061981,
-0.745486319065094,
-0.21120747923851013,
0.25975993275642395,
-0.023396743461489677,
0.1154692322015... | |
you can paint on while still being able to click and operate the treeview beneath(including mouse scroll events, etc).
If you click DIRECTLY on a line the click will not go through, and likewise if the mouse is hovering DIRECTLY over a line on the canvas then things like scroll events will not go through but if you r... | [
0.4870947599411011,
-0.5479630827903748,
0.18124166131019592,
0.056954946368932724,
-0.07457687705755234,
0.07836344838142395,
0.14215116202831268,
-0.009126701392233372,
-0.2759840786457062,
-0.5856550335884094,
0.08697756379842758,
0.5575942993164062,
-0.29446089267730713,
-0.09654586762... | |
I have lots of code like this in my constructors:-
```
function __construct($params) {
$this->property = isset($params['property']) ? $params['property'] : default_val;
}
```
Some default values are taken from other properties, which was why I was doing this in the constructor. But I guess it could be done in ... | [
0.028733616694808006,
0.23271998763084412,
0.14254210889339447,
-0.02484704926609993,
-0.14373356103897095,
0.20302151143550873,
0.329150527715683,
-0.4416915774345398,
-0.29600855708122253,
-0.4734295904636383,
-0.17776192724704742,
0.4913623332977295,
-0.3261864185333252,
0.0591969378292... | |
the order in which properties are initialized matters.
This means that if I used getters and setters then it is not obvious which order to call them in because the dependencies are abstracted away in the getter instead of being in the constructer...
Create "globally available" function `array_get`.
```
public static ... | [
-0.011015476658940315,
-0.14072155952453613,
0.14552174508571625,
0.02075478434562683,
0.01068159006536007,
0.0319729745388031,
0.02413351833820343,
-0.2650317847728729,
-0.13599450886249542,
-0.4904842972755432,
-0.5044751167297363,
0.5728599429130554,
-0.3197201192378998,
0.2457072138786... | |
How does a copy constructor work in c++
Error 1 error C2064: term does not evaluate to a function taking 1 arguments c:\users\thuan\dropbox\homework\css 342\lab2\lab2\lab2\lab2.cpp 26
```
#include "intset.h"
int main() {
IntSet object1;
IntSet object2(9);
object1(object2); //error here
return 0;
}
//construct... | [
0.16621573269367218,
0.033562757074832916,
0.46261653304100037,
0.03303917869925499,
0.11723906546831131,
-0.06173231452703476,
0.34567826986312866,
-0.5172154307365417,
-0.012211116030812263,
-0.20018510520458221,
-0.22874462604522705,
0.6057664155960083,
-0.4563990831375122,
0.3203432559... | |
(int i = 0; i < size; i++)
{
if (intsetObject.arrayPtr[i])
arrayPtr[i] = intsetObject.arrayPtr[i];
}
}
```
After you declare
```
InSet object1;
```
the object named `object1` exists (created via the default constructor). Copy constructor (just like a regular constructor) creates a new object. Since the... | [
0.059863362461328506,
0.10787656903266907,
0.36424851417541504,
-0.17884162068367004,
0.173921599984169,
-0.10682497173547745,
0.38459500670433044,
-0.22095635533332825,
-0.14881139993667603,
-0.4459981620311737,
-0.2966912090778351,
0.5812740325927734,
-0.5834702849388123,
0.3361635506153... | |
expression `(object1(object2);` is a function call expression: you will need to define the *function call operator* (`void InSet::operator()(const InSet& obj)`) to make it compile (the return type could be anything else, not just `void`, depending on your need.) If you define the function call operator, you turn your o... | [
-0.0393093079328537,
0.2157057374715805,
0.22025130689144135,
-0.17267990112304688,
-0.15083205699920654,
-0.21049968898296356,
0.4541644752025604,
-0.26604244112968445,
0.12778466939926147,
-0.4111936688423157,
-0.3540217876434326,
0.7897811532020569,
-0.5437725782394409,
-0.0873511657118... | |
the expression
```
InSet object2(9);
InSet object1 = object2;
```
also results in a call to the copy constructor (instead of default-constructing the object and then calling assignment operator on it), if available -- this is a possible compiler optimization.
Note: The declarations `InSet object1;` and `InSet obje... | [
0.15060247480869293,
0.20645050704479218,
-0.041035618633031845,
-0.03733836114406586,
0.08346249163150787,
-0.3272061049938202,
0.44285786151885986,
0.06550949066877365,
-0.17191182076931,
-0.10863694548606873,
-0.7239763140678406,
0.6377570629119873,
-0.5896918773651123,
0.20582059025764... | |
I just did a fresh install of Apache server 2.2.
Everything works. When I go to localhost I get: "It Works!"
I just installed mySQL5.5 and when I go to localhost:3306 I just get gibberish:
> J���
> 5.5.22�'���4[LM{D~p�ÿ÷!�€����������6[I=4/+,9z{|�mysql\_native\_password�!��ÿ„#08S01Got
> packets out of order
I see m... | [
0.24288572371006012,
0.2312329113483429,
0.35627037286758423,
-0.1005912497639656,
0.06257310509681702,
-0.15308748185634613,
0.9401732087135315,
0.158411905169487,
-0.08613970130681992,
-0.9382753968238831,
-0.0074452562257647514,
0.6378183364868164,
-0.12829560041427612,
0.07171870768070... | |
I have a `posts` table structured this way:
```
id | title | content | tags
```
and a `tags` table
```
id | name | description
```
I put my tags in the `posts` table this way: `3,2,5,8` where the numbers are the `tags` table's corresponding row number. Now what might me a good way to select related post... | [
0.30667388439178467,
0.3707038164138794,
0.3614950478076935,
0.12335328757762909,
-0.10513831675052643,
0.072475366294384,
-0.08257561922073364,
-0.33087924122810364,
-0.14233547449111938,
-0.659760594367981,
0.2902107834815979,
0.30174320936203003,
-0.30307596921920776,
0.265762597322464,... | |
should probably create a new table `post_tags`, with structure `post_id | tag_id` to link multiple tags to a single post.
You can then execute the following query:
```
SELECT * FROM posts
INNER JOIN post_tags ON post_tags.post_id = posts.id
WHERE post_tags.tag_id IN(id1,id2,etc.)
``` | [
0.329698771238327,
-0.012253552675247192,
0.460996150970459,
0.08500614017248154,
0.043999847024679184,
-0.05980788543820381,
-0.07524266839027405,
-0.30355286598205566,
-0.18116144835948944,
-0.7816908359527588,
-0.0009932676330208778,
0.1319582462310791,
-0.3161545991897583,
0.1338728666... | |
I'm using git, then posting the commit message and other bits as a JSON payload to a server.
Currently I have:
```
MSG=`git log -n 1 --format=oneline | grep -o ' .\+'`
```
which sets MSG to something like:
```
Calendar can't go back past today
```
then
```
curl -i -X POST \
-H 'Accept: application/text' \
-... | [
0.11284822225570679,
0.23962679505348206,
0.46154510974884033,
-0.06007145345211029,
-0.16418635845184326,
0.06557789444923401,
0.2784682810306549,
0.14197838306427002,
-0.2567629814147949,
-0.8356691002845764,
-0.14530254900455475,
0.36119145154953003,
-0.2510973811149597,
0.1693531423807... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.