text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I am parsing a XML file in Java using the W3C DOM.
I am stuck at a specific problem, I can't figure out how to get the whole inner XML of a node.
The node looks like that:
```
<td><b>this</b> is a <b>test</b></td>
```
What function do I have to use to get that:
```
"<b>this</b> is a <b>test</b>"
```
You have to use... | [
0.04735764488577843,
0.1263192743062973,
0.3465976119041443,
-0.16970080137252808,
-0.19472548365592957,
-0.020288748666644096,
0.37058183550834656,
-0.2347901314496994,
-0.019458580762147903,
-0.7357450723648071,
-0.016320575028657913,
0.3903282880783081,
-0.28180015087127686,
-0.02616045... | |
What would be the valid .htaccess rules for doing something like this
```
/mypage/ --> /index.php?page=mypage
/mypage/param1/value1/ -->index.php?page=mypage¶ms=param1/value1
```
With an potentially unlimited number of parameters?
Thanks.
Best is to to pass the entire part after the /mypage/ as an param to the ... | [
-0.02515784651041031,
-0.12306098639965057,
0.8207855224609375,
0.19562993943691254,
-0.16456852853298187,
0.20916031301021576,
0.22128042578697205,
-0.6999495029449463,
-0.24668358266353607,
-0.29475730657577515,
-0.1822308897972107,
0.5129371881484985,
-0.4700160324573517,
-0.12788984179... | |
'mypage':
doMyPageStuff();
break;
case 'foo':
doFooStuff();
break;
case 'index':
default:
doIndexStuff();
break;
}
``` | [
-0.1599205732345581,
0.09063070267438889,
0.4400220811367035,
-0.28212970495224,
0.45380836725234985,
0.025454508140683174,
0.5303117036819458,
0.16627192497253418,
-0.1477697342634201,
-0.5166764259338379,
-0.5511814951896667,
0.6837092041969299,
-0.4491768479347229,
0.2829996645450592,
... | |
i try to put a lock to a static string object to access to cache,, the lock() block executes in my local,but whenever i deploy it to the server, it locks forever. i write every single step to event log to see the process and lock(object) just causes the deadlock on the server. The command right after lock() is never ex... | [
0.350204199552536,
0.009952914901077747,
0.5640411972999573,
-0.17061087489128113,
0.3538438081741333,
-0.11981985718011856,
0.6345255970954895,
-0.15176813304424286,
-0.19106285274028778,
-0.677788257598877,
-0.26424214243888855,
0.6885162591934204,
-0.3196322023868561,
0.3906055390834808... | |
{
Global.eventLogger.Write(String.Format("GetUsers() cache hit: {0}",dtUsers.Rows.Count));
return (HttpContext.Current.Cache["dtUsers"] as DataTable).Copy().DefaultView;
}
Global.eventLogger.Write("GetUsers() cache miss");
lock (CacheSyncObject)
{
Global.eventLogger.Write("GetUs... | [
-0.40781912207603455,
-0.2875139117240906,
0.39179879426956177,
-0.22622646391391754,
0.2781935930252075,
0.07839033752679825,
0.2973528802394867,
0.2643849849700928,
-0.44572949409484863,
-0.45584848523139954,
-0.4356998801231384,
0.6413218379020691,
-0.5335097312927246,
0.305384039878845... | |
return (HttpContext.Current.Cache["dtUsers"] as DataTable).Copy().DefaultView;
}
```
Global.eventLogger.Write("GetUsers() locked SyncObject"); ==> this is never written to the log, so which means to me that, lock() never executes.
You're locking on a string, which is a generally bad idea in .NET due to intern... | [
0.15280836820602417,
-0.008218180388212204,
0.2597278356552124,
-0.08992001414299011,
-0.007014329079538584,
-0.140100359916687,
0.5061869025230408,
-0.12294546514749527,
-0.2085064947605133,
-0.48308101296424866,
-0.16197620332241058,
0.4507840871810913,
-0.47285985946655273,
0.3305195569... | |
between different AppDomains. Thus you could be deadlocking between different instances of you method. | [
0.1479228138923645,
-0.1525818407535553,
0.2908869683742523,
0.4923534691333771,
0.0639505684375763,
0.3508336842060089,
0.1622830331325531,
-0.05164245888590813,
-0.2716478705406189,
-0.8150703310966492,
0.19902746379375458,
0.25348761677742004,
-0.5471567511558533,
0.3326622545719147,
... | |
I've been given a copy of a proposed site agreement in which one of the conditions is:
> ...each of us may for the Term:
> ...frame the other's site
What is meant by "framing"? I assume it might have something to do with an iframe embed or to capture part of our main page without additional logos and other such imag... | [
0.9117277264595032,
0.15894664824008942,
0.2746777832508087,
0.1236652210354805,
0.024036558344960213,
-0.17783014476299286,
-0.022853389382362366,
-0.22644789516925812,
-0.2623678147792816,
-0.292436420917511,
0.29797783493995667,
0.2838740050792694,
-0.20205000042915344,
0.17099434137344... | |
in the Washington Post v. TotalNews case that was settled a few years ago whereby several prominent news organizations, including The Washington Post, The Wall Street Journal and CNN brought a lawsuit against the Web-based news gathering site TotalNews. TotalNews was using frame technology and hyperlinking to display t... | [
0.716400146484375,
-0.22056718170642853,
0.20333389937877655,
0.14459441602230072,
-0.304157555103302,
0.24471597373485565,
-0.29571476578712463,
-0.20330564677715302,
-0.1970597356557846,
0.30444374680519104,
0.37586846947669983,
0.29819607734680176,
-0.4372512996196747,
0.835366010665893... | |
What does the word "literal" mean when used in context such as literal strings and literal values?
What is the difference between a literal value and a value?
A literal is "any notation for **representing** a value within source code" ([wikipedia](http://en.wikipedia.org/wiki/Literal))
(Contrast this with *identifier... | [
0.3204406797885895,
0.33210858702659607,
0.16028867661952972,
-0.050157707184553146,
-0.20471198856830597,
-0.11116252094507217,
0.12714308500289917,
-0.08682971447706223,
-0.04199586063623428,
-0.15820643305778503,
-0.46783652901649475,
0.44336411356925964,
-0.2903890013694763,
-0.0227109... | |
I have a multithreaded .NET Windows Service that hangs intermittently -- maybe once every two weeks of 24/7 operation. When the hangs occurs the threadpool is completely saturated because calls to our custom tracelistener start blocking for some reason. There aren't any locks in the offending code nor anything blocking... | [
0.611419677734375,
-0.12895485758781433,
0.5255979895591736,
0.11901411414146423,
-0.026005610823631287,
-0.3720049262046814,
0.2254711091518402,
0.09008846431970596,
-0.6929008364677429,
-0.531112790107727,
0.06107068061828613,
0.17311520874500275,
-0.006767195649445057,
0.448524236679077... | |
normal operation!) on the ThreadPool have a stack similar to the following:
```
0:027> !dumpstack
OS Thread Id: 0x1638 (27)
Child-SP RetAddr Call Site
000000001d34df58 0000000077d705d6 ntdll!ZwDelayExecution+0xa
000000001d34df60 000006427f88901d kernel32!SleepEx+0x96
000000001d34e000 000006427f454379 ... | [
-0.2681170701980591,
0.15962547063827515,
0.39728742837905884,
-0.23444214463233948,
0.4167032539844513,
0.16714920103549957,
0.3396187126636505,
-0.2327938973903656,
-0.3707103133201599,
-0.6091322898864746,
-0.17311356961727142,
0.597181499004364,
-0.3293820023536682,
0.18507270514965057... | |
is the fix because I can't for the life of me recreate the issue.
I had usegloballock=false and autoflush=true in the trace configuration. The flush method on the TraceListener was not thread-safe -- the listener is meant to use data buffering, so on occasion the TraceListener would get in a bad state when there was c... | [
-0.009140269830822945,
0.018315844237804413,
0.14347761869430542,
-0.020375700667500496,
0.22527509927749634,
-0.3541468381881714,
0.7390946745872498,
0.08000129461288452,
-0.042236652225255966,
-0.32241442799568176,
0.3245490789413452,
0.8925523161888123,
-0.4970354735851288,
0.0264496635... | |
Is it possible in Ruby to get a reference to methods of an object ( I would like to know if this can be done without procs/lambdas ) , for example , consider the following code :
```
class X
def initialize
@map = {}
setup_map
end
private
def setup_map
# @map["a"] = get reference to a method
#... | [
0.01749498024582863,
-0.04622581601142883,
-0.0888512134552002,
-0.11206688731908798,
-0.09720736742019653,
-0.2612147927284241,
0.34823209047317505,
-0.39914774894714355,
-0.09009061008691788,
-0.3220590054988861,
-0.1531166285276413,
0.32130807638168335,
-0.5582188963890076,
-0.080543071... | |
@map["a"](a) if a > 10
@map["b"](a) if a > 20
@map["c"](a) if a > 30
end
def a(arg)
puts "a was called with #{arg}"
end
def b(arg)
puts "b was called with #{arg}"
end
def c(arg)
puts "c was called with #{arg}"
end
end
```
Is it possible to do such thing ? I would like to avoid p... | [
-0.27074286341667175,
-0.2549592852592468,
0.5530168414115906,
-0.32013827562332153,
-0.16322912275791168,
-0.048356663435697556,
0.36736470460891724,
-0.4485371708869934,
-0.21483345329761505,
-0.6754134893417358,
-0.21372362971305847,
0.6224388480186462,
-0.42860642075538635,
-0.24842762... | |
obj.method(sym) => method
------------------------------------------------------------------------
Looks up the named method as a receiver in obj, returning a Method
object (or raising NameError). The Method object acts as a closure
in obj's object instance, so instance variables and the value of
... | [
-0.5369914174079895,
-0.21811456978321075,
0.1600005030632019,
0.22302308678627014,
-0.008942564949393272,
0.3338717520236969,
0.3327942490577698,
-0.06259199231863022,
-0.11433465778827667,
-0.6619873642921448,
-0.4514380097389221,
0.19681356847286224,
-0.26047709584236145,
0.195180788636... | |
end
def hello()
"Hello, @iv = #{@iv}"
end
end
k = Demo.new(99)
m = k.method(:hello)
m.call #=> "Hello, @iv = 99"
l = Demo.new('Fred') | [
0.02779223769903183,
-0.33603575825691223,
0.45299285650253296,
-0.1682337075471878,
0.317531943321228,
0.08377103507518768,
0.2156682312488556,
-0.5530857443809509,
-0.11685571819543839,
-0.3489105999469757,
-0.09499797224998474,
0.7276046276092529,
-0.19048550724983215,
0.159027740359306... | |
m = l.method("hello")
m.call #=> "Hello, @iv = Fred"
```
Now your code becomes:
```
private
def setup_map
@map = {
'a' => method(:a),
'b' => method(:b),
'c' => method(:c)
}
# or, more succinctly
# @map = Hash.new { |_map,name| _map[name] = method(name.to_sym) }
end
public
def call(arg)... | [
-0.17984934151172638,
0.09163045138120651,
0.6490986943244934,
-0.4621707797050476,
0.33253076672554016,
-0.09856554865837097,
0.36757269501686096,
-0.4943275451660156,
-0.4356445074081421,
-0.9121670126914978,
-0.5497759580612183,
0.7416300177574158,
-0.20113100111484528,
0.13016378879547... | |
I have a number of documents (mainly Word and Excel) that I'd like to make available to users of my Rails app. However, I've never tried something like this before and was wondering what the best way to do this was? Seeing as there will only be a small number of Word documents, and all will be uploaded by me, do I just... | [
0.4234578609466553,
0.04560032859444618,
0.1916959136724472,
0.18390749394893646,
-0.024132996797561646,
-0.08296038210391998,
0.37208059430122375,
0.0379149504005909,
-0.07932770997285843,
-0.9691823720932007,
-0.05445248261094093,
0.3592488765716553,
0.0418073795735836,
0.128045186400413... | |
I know you can't rely on equality between double or decimal type values normally, but I'm wondering if 0 is a special case.
While I can understand imprecisions between 0.00000000000001 and 0.00000000000002, 0 itself seems pretty hard to mess up since it's just nothing. If you're imprecise on nothing, it's not nothing ... | [
0.3706256151199341,
0.34642934799194336,
-0.18015222251415253,
0.02239660918712616,
-0.13247066736221313,
0.0035008909180760384,
0.32815876603126526,
-0.007588610984385014,
-0.0075471061281859875,
-0.16887974739074707,
0.026842856779694557,
0.7526562213897705,
-0.17412182688713074,
0.10961... | |
of exactly `0.0` (which in your original code snippet is, of course, the case). This is consistent with the semantics of the `==` operator. `a == b` means "`a` is equal to `b`".
It is **not safe** (because it is **not correct**) to expect that the result of some calculation will be zero in double (or more generally, f... | [
0.13412176072597504,
0.15652063488960266,
0.07946903258562088,
0.05195172503590584,
0.03745366260409355,
-0.016297288239002228,
0.1316637396812439,
-0.5182530879974365,
-0.14353309571743011,
-0.017832450568675995,
0.1025325283408165,
0.3406309485435486,
-0.16584503650665283,
0.077608093619... | |
When running the following Java code, I get very accurate and consistent results in determining if the web page I'm testing is up.
```
protected synchronized boolean checkUrl(HttpURLConnection connection){
boolean error = false;
//HttpURLConnection connection = null;
GregorianCalendar calendar = new Gregor... | [
-0.016278153285384178,
-0.3062440752983093,
0.7021284103393555,
-0.1737302541732788,
-0.03874775767326355,
-0.037883494049310684,
0.5680768489837646,
-0.26349255442619324,
-0.22931215167045593,
-0.6001075506210327,
-0.29927095770835876,
0.5360107421875,
-0.28024640679359436,
0.108320139348... | |
error = processResponseCode(connection.getResponseCode());
connection.disconnect();
} else{
error = false;
}
}catch(java.net.UnknownHostException uhe){
... }
catch(Exception e){
... }
return error;
}
```
The closest match to the Java patt... | [
-0.10394436866044998,
-0.19391004741191864,
0.1408810168504715,
-0.3235785961151123,
0.10449378192424774,
0.057296399027109146,
0.41198283433914185,
-0.45696038007736206,
-0.14842095971107483,
-0.5687770247459412,
-0.058480922132730484,
0.30570852756500244,
-0.47550109028816223,
0.12394994... | |
much higher results of false positives (mostly due to timeouts - which has a default period of 100000ms).
```
protected bool connectedToUrl = false;
response = null;
HttpWebRequest webreq = (HttpWebRequest)WebRequest.Create(this.getUri());
webreq.Credentials = CredentialCache.DefaultCredential... | [
0.02319488488137722,
-0.1347832828760147,
0.4999449849128723,
0.09433534741401672,
0.020863397046923637,
-0.20274300873279572,
1.0287551879882812,
-0.4508249759674072,
-0.1875709593296051,
-0.4720556437969208,
-0.5244055986404419,
0.6690433621406555,
-0.20648528635501862,
0.314506113529205... | |
request.Credentials = CredentialCache.DefaultCredentials;
if (request != null)
{
// Get response
res = webreq.GetResponse();
connectedToUrl = processResponseCode(res); | [
-0.07465781271457672,
-0.4825807511806488,
0.8451508283615112,
0.17248132824897766,
0.15852749347686768,
0.10018956661224365,
0.7446362972259521,
-0.5655162334442139,
-0.25881287455558777,
-0.5790615677833557,
-0.5510730743408203,
0.6834048628807068,
-0.07466395199298859,
0.334753781557083... | |
}
else
{
logger.Fatal(getFatalMessage());
string error = string.Empty;
}
}
catch (Exception e) | [
-0.034574929624795914,
-0.3841697573661804,
0.006095494609326124,
-0.14518766105175018,
0.2741578221321106,
-0.2401828020811081,
0.5249969363212585,
-0.17879937589168549,
-0.19341720640659332,
-0.20773929357528687,
-0.35046854615211487,
0.5583561658859253,
-0.5154202580451965,
0.0130386454... | |
{
throw e;
}
return connectedToUrl;
}
```
I have tried various patterns in c# to match the effectiveness of the quoted Java code, to no avail.
Any ideas?
Simply change this:
```
res = webreq.GetResponse();
connectedToUrl = processResponseCode(res);
```
to
```
using (WebResponse ... | [
0.2540353238582611,
-0.26505711674690247,
0.60206139087677,
-0.18989792466163635,
0.1520063579082489,
-0.06861817091703415,
0.38795655965805054,
-0.5596405267715454,
-0.3348638117313385,
-0.7517682909965515,
-0.4150201678276062,
0.5971166491508484,
-0.37925052642822266,
0.08884842693805695... | |
by default, I believe) of connections to any one host at a time, hence the timeouts. When you dispose the response, it allows another request to use the same connection. | [
0.062305599451065063,
-0.20901064574718475,
0.592101514339447,
0.286712646484375,
0.1815052330493927,
-0.21936847269535065,
0.21894590556621552,
0.005612900014966726,
-0.42407527565956116,
-0.6979246735572815,
-0.16991303861141205,
0.3694617748260498,
-0.13460490107536316,
0.44976061582565... | |
I'm working with CoreData in Cocoa (not document-based).
My problem is, that I want to access the SAME NSArrayController from different NIBs.
But every NIB has an own instance of this NSArrayController.
My question is now how I could generate sharedObjects (like the NSUserDefaultsController).
It would help me a lot. T... | [
0.22008870542049408,
-0.12763723731040955,
-0.19955523312091827,
0.25993654131889343,
-0.19653691351413727,
-0.27485090494155884,
0.1665848195552826,
0.12909376621246338,
-0.413216769695282,
-0.9307068586349487,
0.0048638866282999516,
0.2557772994041443,
-0.2111845463514328,
0.474082887172... | |
instantiate your custom MyAppDelegate class in MainMenu.nib and connect the NSApplication's `delegate` outlet to the instance of your MyAppDelegate class). In other NIBs, you can then bind an NSArrayController's `contentArray` binding to `Shared Application.delegate.myArray` (assuming MyAppDelegate exposes—via KVC-comp... | [
-0.1821308434009552,
-0.4499303698539734,
0.15541648864746094,
0.2612832188606262,
-0.14715830981731415,
-0.10106582194566727,
0.43729299306869507,
-0.1262480914592743,
-0.29504942893981934,
-0.8056685328483582,
-0.22661373019218445,
0.3076494038105011,
-0.18852490186691284,
0.116079755127... | |
secondary (non MainMenu.nib) NIB and bind the NSArrayControllers in those nibs to `File Owner.myArray`. You can then instantiate the NSWindowController or NSViewController, passing it an array (or array KVC-compliant object) before loading the secondary NIB. In this way, you can test the functionality of the nibs in is... | [
0.3099934160709381,
-0.3182424306869507,
0.14288105070590973,
0.24654839932918549,
-0.2852993309497833,
-0.06735748052597046,
0.3347525894641876,
-0.051481880247592926,
-0.055744171142578125,
-0.5172664523124695,
-0.25879335403442383,
0.4033634066581726,
-0.21486742794513702,
0.33563312888... | |
In Visual Basic
```
Friend Const xxx As UInt64 = 400 * 365 * 24 * 60 * 60 ''// Number of secs in 400 years
```
This fails with the error
```
constant expression not representable in type integer
```
The problem is 400 \* 365 \* 24 \* 60 \* 60 is larger than 2^32
I would have thought that by declaring the constan... | [
-0.0451023131608963,
0.06088818237185478,
0.5110958814620972,
-0.014776555821299553,
0.18161605298519135,
-0.07934069633483887,
0.7312265634536743,
0.0797254741191864,
-0.4609423279762268,
-0.232848659157753,
-0.42360755801200867,
0.6374136209487915,
-0.21264636516571045,
-0.22397726774215... | |
to make up your constant are integer literals, and therefore until you assign them to the UInt64 it's all done in integer space. Try this:
```
Friend Const xxx As UInt64 = 400UL * 365UL * 24UL * 60UL * 60UL
``` | [
0.01789144240319729,
0.19405238330364227,
0.4591803550720215,
-0.35213664174079895,
0.19178032875061035,
0.109576515853405,
0.1187102347612381,
0.02115980163216591,
-0.0848606675863266,
-0.5699576735496521,
0.03529185801744461,
0.6570073962211609,
-0.3243974447250366,
-0.10412028431892395,... | |
Is there a relatively straightforward way to get the intersection of two DataTables in .NET?
I can think of the obvious ways (iterating over both tables myself in O(n^2)), but I'd like something a little more elegant if it's available. I suspect there may be an intelligent way that I'm not seeing. Readability and main... | [
0.1439814269542694,
0.046875860542058945,
0.26145151257514954,
0.245173379778862,
-0.04366225004196167,
-0.15012994408607483,
0.1807146519422531,
-0.0054617878049612045,
-0.32451286911964417,
-0.5894357562065125,
0.038690391927957535,
0.6269730925559998,
-0.6321768760681152,
-0.13662546873... | |
public static IEnumerable<DataRow> Intersect(this DataTable table, DataTable other)
{
return table.AsEnumerable().Intersect(other.AsEnumerable());
}
public static IEnumerable<DataRow> Intersect(this DataTable table, DataTable other, IEqualityComparer<DataRow> comparer)
{
return table.As... | [
-0.3054867088794708,
-0.12871454656124115,
0.43171393871307373,
0.13446076214313507,
-0.024593880400061607,
0.06700126081705093,
0.24999214708805084,
0.005910353269428015,
-0.007902788929641247,
-0.6394556164741516,
-0.45054155588150024,
0.7247130274772644,
-0.44768694043159485,
0.13122494... | |
I have an element in my document that has a background color and image set through a regular CSS rule.
When a certain event happens, I want to animate that item, highlighting it (I'm using Scriptaculous, but this question applies to any framework that'll do the same).
```
new Effect.Highlight(elHighlight, { startcolo... | [
0.02696194313466549,
0.1140667125582695,
0.5762829184532166,
0.006976758129894733,
0.07663478702306747,
-0.04921547695994377,
0.3065224587917328,
-0.3496539294719696,
-0.13785383105278015,
-0.6364725232124329,
-0.4027591645717621,
0.2347184419631958,
-0.3147842288017273,
0.0041665220633149... | |
used to have...
What I'm trying to do is, in the callback function I'm running after the animation is done, set the style properties to a value that'll make them "go away".
```
var fnEndOfFadeOut = function() {
elHighlight.style.backgroundColor = "xxxxx";
elHighlight.style.backgroundImage = "xxxxx";
}
```
What ... | [
0.22799161076545715,
-0.13232117891311646,
0.25103527307510376,
-0.14221926033496857,
0.3758009970188141,
0.03381064534187317,
0.16494818031787872,
-0.0035135436337441206,
-0.20786167681217194,
-0.5947350263595581,
-0.2929128408432007,
0.4628870487213135,
-0.3961975574493408,
0.17227992415... | |
do to overcome this?
I know I can put a span inside the element that I'm highlighting and highlight that span instead, but I'm hoping I'll be able to avoid the extra useless markup.
Chances are you're not setting the style on the correct element. It's probably being set somewhere up the line in a parent node.
```
... | [
0.2922233045101166,
0.15800300240516663,
0.3897010087966919,
-0.08564046025276184,
0.10173163563013077,
-0.03764353320002556,
0.38216331601142883,
-0.385542631149292,
-0.11146591603755951,
-0.6704318523406982,
-0.05942506715655327,
0.6705939769744873,
-0.29592883586883545,
-0.0888720825314... | |
parentNode until you find it. | [
0.007700780872255564,
-0.21415290236473083,
0.31128981709480286,
0.202100932598114,
0.05679327994585037,
0.031435441225767136,
0.1563475877046585,
0.6257487535476685,
-0.054311662912368774,
-0.8066396117210388,
0.09170440584421158,
0.36520084738731384,
0.26482412219047546,
0.25862863659858... | |
In your experience what are some good Hibernate performance tweaks? I mean this in terms of Inserts/Updates and Querying.
Some Hibernate-specific performance tuning tips:
* Avoid join duplicates caused by parallel to-many assocation fetch-joins (hence avoid duplicate object instantiations)
* Use lazy loading with fetc... | [
-0.11225438117980957,
-0.29957178235054016,
0.31521034240722656,
0.04529315605759621,
-0.07865763455629349,
0.008926241658627987,
0.2537052035331726,
-0.2504690885543823,
-0.4537397027015686,
-0.745541512966156,
-0.15387405455112457,
0.7399709224700928,
-0.18547599017620087,
-0.27947634458... | |
I need ideas to implement a (really) high performance in-memory Database/Storage Mechanism. In the range of storing 20,000+ objects, with each object updated every 5 or so seconds. **I would like a FOSS solution**.
What is my best option? What are your experiences?
I am working primarily in Java, but I need the datas... | [
0.34284764528274536,
0.3598698675632477,
0.017155449837446213,
0.2401372343301773,
0.05214677378535271,
-0.05462849512696266,
-0.015064483508467674,
0.21641500294208527,
-0.3925785720348358,
-0.8306127190589905,
0.04632692411541939,
0.19752977788448334,
0.018390024080872536,
0.230043143033... | |
connect to `:memory:`). It has bindings for many popular programming languages. It's a traditional SQL-based relational database, but you don't run a separate server – just use it as a library in your program. It's pretty quick. Whether it's quick enough, I don't know, but it may be worth an experiment.
[Java driver](... | [
0.1419415920972824,
-0.1966187059879303,
0.059213314205408096,
0.3347848057746887,
0.24140650033950806,
-0.3239366412162781,
0.0760631337761879,
0.06942792981863022,
0.030801426619291306,
-0.7215665578842163,
0.08677353709936142,
0.5030353665351868,
-0.3944087326526642,
0.21466714143753052... | |
How do I create a unique constraint on a `varchar` field that is case sensitive (SQL Server 2005)?
Currently my constraint looks like this:
```
alter table MyTable
add constraint UK_MyTable_MyUniqueKey unique nonclustered (MyCol)
```
When I try to insert the following two values, I get a "Violation of UNIQUE KEY co... | [
-0.29310259222984314,
0.5079774856567383,
0.44474276900291443,
-0.2281779795885086,
-0.0627017468214035,
-0.022014610469341278,
-0.14004336297512054,
-0.23136228322982788,
-0.24444185197353363,
-0.6297492980957031,
0.11314893513917923,
0.44743114709854126,
-0.604061484336853,
0.29697266221... | |
column to be case sensitive. I don't think there's any change to your constraint...
```
ALTER TABLE mytable
ALTER COLUMN mycolumn VARCHAR(10)
COLLATE SQL_Latin1_General_CP1_CS_AS
```
Any selects or joins on this column will become case sensitive as a result of this operation. | [
-0.3497345745563507,
0.38235223293304443,
0.8671818971633911,
-0.13399918377399445,
0.009088455699384212,
0.1038677915930748,
-0.05985813960433006,
-0.05040436238050461,
-0.14921239018440247,
-0.5352728366851807,
0.08270055055618286,
0.35069385170936584,
-0.6173983216285706,
0.093967549502... | |
I cannot get my SelectedIndexChanged of my dropdownlist to fire. I have the following:
```
<form id="form1" runat="server">
<div>
<asp:GridView id="grdPoll" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:DropDownList ID="DropDownLis... | [
-0.06514734029769897,
0.19365130364894867,
0.43569833040237427,
-0.3347834050655365,
-0.08320420980453491,
0.2313806712627411,
0.4719495177268982,
-0.6856223940849304,
-0.0497269332408905,
-0.4143252670764923,
-0.07553182542324066,
0.5814913511276245,
-0.23559996485710144,
0.12119407206773... | |
<asp:ListItem Text="Review" Value="Review" Selected="True">Review</asp:ListItem>
<asp:ListItem Text="Level1" Value="lvl1">Send Back to Level1</asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Label ID="lbl... | [
0.17800234258174896,
-0.1769009530544281,
0.6004937291145325,
-0.039385903626680374,
-0.1762254536151886,
0.06755320727825165,
0.18166561424732208,
-0.5689846873283386,
-0.3990135192871094,
-0.6352509260177612,
-0.20364806056022644,
0.3940197825431824,
-0.238779678940773,
-0.02785701863467... | |
this.lblCity.Text = ((DropDownList)sender).SelectedValue;
}
```
If I put this same ddl outside of the gridview, it fires.
The postback is occurring and the autopostback is set to true. The event just never fires. Why can't I get my event to fire from within the gridview?
Thank you.
Well, this question was asked mor... | [
0.5747615694999695,
0.0034199708607047796,
0.5704746246337891,
-0.22508761286735535,
-0.15912693738937378,
-0.2344719022512436,
0.34394457936286926,
-0.19569575786590576,
-0.2892909348011017,
-0.4815278649330139,
0.04342729225754738,
0.6510840654373169,
-0.4100961685180664,
0.1249948516488... | |
hereafter as DDL) is a dynamic control and therefore its events need to be reattached upon Postback.
When this concept is understood, the solution becomes relatively simple :
**ASPX:**
```
<asp:DropDownList ID="DDL1" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DDL1_SelectedIndexChanged">
<asp:ListIt... | [
-0.2451610267162323,
-0.3064528703689575,
0.8566002249717712,
0.0006866843323223293,
-0.16242250800132751,
-0.0015801648842170835,
0.29641738533973694,
-0.40216538310050964,
-0.4910118877887726,
-0.6403020024299622,
-0.5890327095985413,
0.46156999468803406,
-0.2671315670013428,
0.429466426... | |
DropDownList ddl = e.Row.FindControl("DDL1") as DropDownList;
if(ddl != null)
{
ddl.SelectedIndexChanged += new EventHandler(DDL1_SelectedIndexChanged);
}
}
}
}
``` | [
-0.17094455659389496,
-0.6256688833236694,
0.40220385789871216,
-0.04208812862634659,
0.20254777371883392,
-0.04114692658185959,
0.148313969373703,
-0.1461712270975113,
-0.2988564372062683,
-0.5336030721664429,
-0.37429460883140564,
0.5189215540885925,
-0.3224097490310669,
0.11468184739351... | |
Let's say I have a database column 'grade' like this:
```
|grade|
| 1|
| 2|
| 1|
| 3|
| 4|
| 5|
```
Is there a non-trivial way in SQL to generate a histogram like this?
```
|2,1,1,1,1,0|
```
where 2 means the grade 1 occurs twice, the 1s mean grades {2..5} occur once and 0 means grade 6 does not... | [
0.4946359694004059,
0.4028938114643097,
0.3070017397403717,
0.3679015636444092,
-0.10222608596086502,
0.01619890332221985,
0.2608821392059326,
-0.0355878546833992,
0.1722186952829361,
-0.44355374574661255,
0.0480341762304306,
0.2874659299850464,
0.06132818013429642,
0.2540866434574127,
0... | |
It is okay if non-existing values (like grade 6 in the example above) do not occur as long as I can make out which histogram value belongs to which grade.
```
SELECT COUNT(grade) FROM table GROUP BY grade ORDER BY grade
```
Haven't verified it, but it should work.It will not, however, show count for 6s grade, since i... | [
0.23001018166542053,
0.28579986095428467,
0.22330397367477417,
0.021262409165501595,
0.12233547866344452,
-0.14977827668190002,
0.3243623375892639,
-0.16693015396595,
-0.13131865859031677,
-0.39476478099823,
-0.1351158767938614,
0.37192896008491516,
0.15531335771083832,
0.10424602776765823... | |
I need a simple floating point rounding function, thus:
```
double round(double);
round(0.1) = 0
round(-0.1) = 0
round(-0.9) = -1
```
I can find `ceil()` and `floor()` in the math.h - but not `round()`.
Is it present in the standard C++ library under another name, or is it missing??
It's available since C++11 in ... | [
-0.477192223072052,
0.4360908269882202,
0.7407860159873962,
-0.25700172781944275,
-0.035990964621305466,
0.2927553057670593,
-0.0235979575663805,
-0.49187690019607544,
-0.1324886679649353,
-0.4218555986881256,
-0.05532015860080719,
0.13761016726493835,
-0.12571030855178833,
0.0762090012431... | |
<< "round(-1.6):\t" << round(-1.6) << std::endl;
return 0;
}
```
Output:
```
round(0.5): 1
round(-0.5): -1
round(1.4): 1
round(-1.4): -1
round(1.6): 2
round(-1.6): -2
``` | [
-0.47119149565696716,
0.2803584337234497,
0.5803319215774536,
-0.3018696904182434,
0.019374186173081398,
0.2635297477245331,
0.024032235145568848,
-0.5451199412345886,
-0.07575584203004837,
-0.32745829224586487,
-0.31786850094795227,
0.4795864224433899,
-0.2602803707122803,
-0.043843995779... | |
Does anybody know how to programmatically update the content of any of the standard SharePoint v3 Web Parts?
As an example, put a Link Summary Web Part on a page. Add some links to it. Now, how can I update this information using the WSS API?
I have not found any direct way to do this, my only idea so far is to expor... | [
0.23556913435459137,
-0.042255617678165436,
0.37058672308921814,
0.3003634810447693,
0.0044903806410729885,
-0.3943951427936554,
0.25310537219047546,
-0.0614243745803833,
-0.26272276043891907,
-0.42738014459609985,
-0.02536153234541416,
0.43258118629455566,
-0.12894856929779053,
0.09890291... | |
instance of this class can be obtained from an SPFile object as follows:
```
using (SPSite site = new SPSite("<site url>")) // e.g. http://server/sites/asite
using (SPWeb web = site.OpenWeb())
{
SPFile file = web.GetFile("<page url>"); // e.g. /sites/asite/default.aspx
SPLimitedWebPartManager lwpm = file.Ge... | [
0.09291702508926392,
-0.12211417406797409,
0.7259153723716736,
0.043480198830366135,
-0.16164720058441162,
0.13494029641151428,
0.18833079934120178,
-0.5682448744773865,
-0.34348782896995544,
-0.43478551506996155,
-0.3232870101928711,
0.24540050327777863,
-0.29678982496261597,
0.2248371392... | |
I have a web service that I can only hit if I'm logged into the website that the web service is on. I need to test the service remotely. So I've written some code to create a fake session that is logged into the site in another browser. Then I made the HTTP Web Request and I'm attempting to set a cookie that contains t... | [
0.7200985550880432,
0.20844970643520355,
0.1962003856897354,
0.2220606505870819,
0.057499028742313385,
-0.048509880900382996,
0.431180477142334,
0.04428644850850105,
-0.1775861233472824,
-0.5283564925193787,
0.2625333070755005,
0.42725834250450134,
0.0054379855282604694,
0.1669905781745910... | |
convince it this is a valid session?
```
// used on each read operation
byte[] buf = new byte[8192];
CookieContainer myContainer = new CookieContainer();
string sessionID = SessionID;
myContainer.Add(new Cookie("ASP.NET_SessionId", sessionID, "/", WebsiteUrl));
// prepare the web page we will be asking for
HttpWe... | [
0.1580883115530014,
-0.08441023528575897,
1.1122292280197144,
0.13431641459465027,
0.11687670648097992,
-0.036067649722099304,
0.20830105245113373,
-0.18849432468414307,
0.6280274391174316,
-0.2124708890914917,
-0.15811949968338013,
0.8322287201881409,
0.033764276653528214,
-0.129189416766... | |
"<input2>string</input2>";
soaprequest += "<input3>string</input3>";
soaprequest += "<input4>string</input4>";
soaprequest += "</doneScreenScore>";
soaprequest += "</soap12:Body>";
soaprequest += "</soap12:Envelope>";
s.Write(System.Text.Encoding.ASCII.GetBytes(soaprequest), 0, soaprequest.Length);
s.Close();
// exe... | [
0.23038789629936218,
-0.07476536929607391,
0.9581555128097534,
-0.11414363235235214,
0.009152894839644432,
0.054772280156612396,
0.5518497228622437,
-0.6984714865684509,
0.062303751707077026,
-0.8076663017272949,
-0.22923649847507477,
0.6234687566757202,
-0.13224299252033234,
-0.0677270367... | |
I have an unordered list with elements and I want to append an item at the end. Here is the current code:
The initial list:
```
<ul id="all">
<li>
Some text <input type="button" class="remove" value="-" />
</li>
<li>
Some text <input type="button" class="remove" value="-" />
</li>
</ul>
```
The code... | [
-0.33536234498023987,
-0.023932581767439842,
0.838447093963623,
-0.33009713888168335,
-0.057395368814468384,
0.24960704147815704,
-0.004739772994071245,
-0.5428453087806702,
-0.21433621644973755,
-0.6568170785903931,
-0.4694603979587555,
0.4751604497432709,
-0.7199406027793884,
0.288500666... | |
add a new list item:
```
<input type="button" id="add" value="Add" />
```
When I click the button, a new list indeed is added to the list, but clicking the remove button doesn't do anything.
How do I make this work?
---
Bonus: Change "Some text" with "`<input type="text" /> <input type="text" />`" and you will s... | [
0.3386402130126953,
-0.2512449026107788,
0.5440372228622437,
-0.13576775789260864,
-0.19097211956977844,
0.014078706502914429,
0.06797312945127487,
-0.5591354370117188,
-0.5316473245620728,
-0.6454222202301025,
-0.13548098504543304,
0.8618170022964478,
-0.37501242756843567,
-0.223285779356... | |
and I have the same amount of space between the two textboxes. If you mean between the second textbox and the button, then I'd have to agree with eimaj and say whitespace is the cause. | [
0.107874795794487,
0.1171063557267189,
-0.23585546016693115,
0.11689947545528412,
-0.1402948796749115,
0.2009090632200241,
0.10115793347358704,
0.39459002017974854,
-0.24406954646110535,
-0.8625200390815735,
0.07216110080480576,
-0.076476089656353,
-0.21488232910633087,
0.3218999207019806,... | |
I have recorded a very simple test case Using the Selenium IDE integrated with Firefox. I want the test case to run continuously over a period of time. How can I make the test run continuously?
You can use [Selenium Remote Control](http://seleniumhq.org/projects/remote-control/) to launch the running of your tests from... | [
0.8169626593589783,
0.0428868792951107,
-0.029480699449777603,
-0.0007495651952922344,
0.033956799656152725,
-0.16545486450195312,
0.36296403408050537,
-0.19256407022476196,
0.158284530043602,
-0.7019820809364319,
-0.040269285440444946,
0.6225266456604004,
-0.34798723459243774,
-0.15200296... | |
into a Test Suite, and then open the suite in a text editor and copy/paste the same tests hundreds/thousands of times. I've never tried it, but assuming the IDE doesn't choke on large Suite files, this would let you run the test X number of times again and again. | [
0.9339482188224792,
0.023803818970918655,
-0.08080390095710754,
0.36419424414634705,
0.2861296236515045,
-0.08686790615320206,
0.07625998556613922,
-0.0838412418961525,
0.29220056533813477,
-0.5284340977668762,
0.1366967111825943,
0.2066398710012436,
-0.08848372846841812,
0.083282694220542... | |
Ok, I have a set of checkboxes for selecting criteria. For argument's sake, we'll say the data looks like this:
```
[] Vehicles
[] Unpowered
[] Bicycle
[] Skateboard
[] Powered
[] Two-wheeled
[] Motorcycle
[] Scooter
[] Four-wheeled
etc
```
The []s represent checkboxes... | [
0.7007912397384644,
0.08742433786392212,
0.2824299931526184,
0.4240742623806,
-0.08549036830663681,
0.011510557495057583,
-0.19138316810131073,
-0.17775441706180573,
-0.32029229402542114,
-0.42972543835639954,
0.31296423077583313,
0.5419659614562988,
-0.026082906872034073,
-0.1837520897388... | |
If the user clicks on the Vehicle checkbox is opsn up the next level (Powered, Unpowered);
* If the user selects Powered it opens up the next level (Two-wheeled, Four-wheeled);
* If the user then unchecks Powered, that level disappears.
Now this is relatively easy to set up with onclick's toggling the display CSS attr... | [
0.062002766877412796,
-0.054522376507520676,
0.7791340947151184,
0.20846012234687805,
0.07945176959037781,
0.09641153365373611,
0.06023706495761871,
-0.33731645345687866,
-0.2258252650499344,
-0.6290085911750793,
-0.12039458751678467,
0.42271655797958374,
-0.0995994582772255,
-0.2212653458... | |
checkbox was put in table cell was to control formatting. It made it easy to effectively indent since everything in the next table cell would line up.
It all works fine but the table nesting gets pretty deep. I keep thinking there has to be a better way than this. It has to be able to be easily built dynamically and h... | [
0.23331840336322784,
-0.07823165506124496,
0.2892228066921234,
0.2443065643310547,
-0.20893855392932892,
-0.21337997913360596,
0.08384724706411362,
0.26495060324668884,
-0.1982758343219757,
-0.9303317666053772,
0.15202568471431732,
0.20528188347816467,
-0.15316174924373627,
-0.315001368522... | |
solution to this, based on the responses I've gotten, as an answer below (too big to add here), just for those curious to see an example.
```
<ul>
<li><input type="checkbox" />Vehicles <ul>
<li><input type="checkbox" />Unpowered</li>
<li><input type="checkbox" />Bicycle</li>
<li><input type=... | [
0.04421969875693321,
-0.29145440459251404,
0.22910630702972412,
0.4865385890007019,
-0.12864315509796143,
0.12909698486328125,
0.27508997917175293,
-0.42259031534194946,
-0.5864177346229553,
-0.6876194477081299,
0.36538681387901306,
0.1692148745059967,
-0.11158977448940277,
-0.368895560503... | |
<li><input type="checkbox" />Scooter</li>
</ul></li>
<li><input type="checkbox" />Four-wheeled</li>
</ul></li>
</ul>
```
Edit: a little css & js to show & hide nested elements (no checkboxes)
```
li.opened ul {
display: block;
}
li.closed ul {
display: none;
}
```
and js...
```
$(documen... | [
-0.3149559497833252,
-0.2080041468143463,
0.8814826011657715,
-0.24938292801380157,
0.007085783872753382,
0.2782157063484192,
0.2325304001569748,
-0.48632773756980896,
-0.15397901833057404,
-0.7512100338935852,
-0.39856013655662537,
0.3484545350074768,
-0.5995671153068542,
-0.0585335381329... | |
width: 6px;
margin: 0 2px;
/* This makes 10px be the total "width" ofh the checkbox */
}
ul {
margin: 0 0 0 10px; /* Or whatever your total checkbox width is */
padding: 0;
}
li {
padding: 0;
}
``` | [
-0.20048482716083527,
-0.04562550038099289,
0.8580367565155029,
-0.3129519820213318,
-0.12926118075847626,
0.3046196401119232,
-0.09874095022678375,
-0.41094499826431274,
-0.25146040320396423,
-0.7551423907279968,
-0.18904206156730652,
0.40681183338165283,
-0.057171713560819626,
-0.1482888... | |
I've been reading code complete, not far in yet but one of the things it talks about is PDL - a higher level design language, which you write each routine in before coding in the language of choice.
I wondered if anyone actually did this in real life? Another thing it says is to leave each line of PDL in the code as c... | [
0.5718338489532471,
0.06052975729107857,
-0.0696469396352768,
0.047011639922857285,
-0.3262733817100525,
0.007451826706528664,
0.15286633372306824,
0.6041669249534607,
-0.09473630785942078,
-0.5090773701667786,
0.17611001431941986,
0.2663135528564453,
0.04266974702477455,
-0.27783483266830... | |
every routine/method/whatever in pseudo code first you will end up wasting a lot of time?
> Surely if you write every routine/method/whatever in pseudo code first you will end up wasting a lot of time?
Not at all - planning out what you're going to do beforehand can save time. It forces you to think things through and... | [
0.4733898341655731,
-0.1462327241897583,
0.008529420010745525,
0.121659055352211,
0.03119509667158127,
-0.03343385085463524,
0.5077404379844666,
-0.0036930374335497618,
-0.26052698493003845,
-0.6084207892417908,
0.1895669549703598,
0.5369791388511658,
-0.2092655450105667,
-0.28404614329338... | |
need.
I've never heard about PDL ([Program Design Language](http://en.wikipedia.org/wiki/Program_Design_Language)?) specifically though, and - after looking at it - it does seem to be wordy, ugly and too much effort, and I wouldn't recommend using it - stick to concise but readable pseudo-code. | [
0.29828283190727234,
0.20958085358142853,
-0.018330387771129608,
-0.035657964646816254,
-0.08673076331615448,
0.06854367256164551,
-0.04577275738120079,
0.2509450316429138,
0.02723321132361889,
-0.7956845164299011,
-0.20549610257148743,
0.5585008859634399,
-0.06703754514455795,
0.122488141... | |
I'm investigating some of the newer technologies available in SQL Server 2005/2008. Most of my applications are written in C# and generally have a database component. Most of what I find on Google are the basic, 'This is how you set up a CLR UDT'. I have a few general questions on their real-world application and use.
... | [
0.3476769030094147,
0.28325796127319336,
0.5249871611595154,
-0.032117754220962524,
-0.11554092913866043,
-0.24408912658691406,
-0.18014000356197357,
0.20140470564365387,
-0.20362873375415802,
-0.26588794589042664,
0.19462451338768005,
0.4495711028575897,
-0.3035590350627899,
0.18546937406... | |
in assuming that the actual range of problems that have simplified solutions because of their use is minimal?
I learned how to do these sort of things reading "[PRO HTML and CSS Design Patterns](http://cssdesignpatterns.com/)". The `display:block` is the default display value for the `div`, but I like to make it explic... | [
-0.09824667125940323,
-0.3641031086444855,
0.7808974385261536,
-0.003774436889216304,
-0.08259402215480804,
0.1654767245054245,
-0.18694943189620972,
0.03886173665523529,
-0.23183566331863403,
-0.54617840051651,
-0.4527658522129059,
0.349181592464447,
0.10073021054267883,
0.102433845400810... | |
> The square of the hypotenuse of a right triangle is equal to the sum of the squares on the other two sides.
This is Pythagoras's Theorem. A function to calculate the hypotenuse based on the length "a" and "b" of it's sides would return sqrt(a \* a + b \* b).
The question is, **how would you define such a function i... | [
-0.10716945677995682,
-0.20054106414318085,
0.3763599991798401,
0.09592943638563156,
-0.45685529708862305,
0.46412405371665955,
0.08437656611204147,
-0.647061288356781,
-0.13855603337287903,
-0.5624485015869141,
-0.05238926410675049,
0.24652329087257385,
-0.3568287789821625,
0.032419193536... | |
on what you are doing, and the speed, precision, accuracy and range requirements.
This only works on Scala 2.8, but it does work:
```
scala> def pythagoras[T](a: T, b: T, sqrt: T => T)(implicit n: Numeric[T]) = {
| import n.mkNumericOps
| sqrt(a*a + b*b)
| }
pythagoras: [T](a: T,b: T,sqrt: (T) => T)(imp... | [
0.0009101362084038556,
-0.13891495764255524,
0.2232998013496399,
0.0008516708621755242,
-0.01510966569185257,
0.3055804967880249,
0.22271384298801422,
-0.4926343262195587,
-0.2796843647956848,
-0.4117920696735382,
-0.224253848195076,
0.5450359582901001,
-0.33697229623794556,
-0.35597777366... | |
When you first fire up Visual Studio, or even before that (Hopefully)
What do you consider best practices when starting a new project?
Different things I have done in the past
* Consider the technology choices
* Attempt to identify the potential bottlenecks/brickwalls
* Throw away the specification
* Ask lots and lot... | [
0.9057154059410095,
0.18592996895313263,
-0.15148530900478363,
0.12176710367202759,
0.0062191844917833805,
-0.21102207899093628,
0.4130318760871887,
0.05359435826539993,
-0.2173939049243927,
-0.8470823764801025,
0.07822224497795105,
0.8772289156913757,
0.2802889943122864,
-0.19780144095420... | |
projects is that people don't get this one figured out to begin with. They either over-engineer and the project doesn't deliver on time, or they write throwaway code that later becomes too expensive to throw away. | [
0.5599208474159241,
-0.0253918319940567,
-0.3459796905517578,
0.43706732988357544,
0.2540174126625061,
0.19474658370018005,
0.2798616588115692,
0.027277309447526932,
-0.16654442250728607,
-0.6087726950645447,
0.0873979777097702,
0.13336938619613647,
-0.13282591104507446,
-0.207478672266006... | |
**Problem:** One of my favorite aspects of Vim is its flexibility. One of my least favorite is the VimL script language itself. I know everyone has his or her own preference for languages and editors, so I take it for granted that not everyone agrees with me.
**Question:** *If* you are a Vim user, and *if* you have ha... | [
0.18057654798030853,
-0.07184800505638123,
0.21749047935009003,
0.18887148797512054,
-0.28817006945610046,
0.024355003610253334,
-0.18337669968605042,
0.19002100825309753,
-0.35291779041290283,
-0.731705367565155,
0.09027939289808273,
0.5412518978118896,
0.12561212480068207,
0.038656786084... | |
recompiling vim with the add-on support for python, ruby, and perl (nice, but it does not help when I am running vim on someone else's machine without that support added in)
* never writing a line of VimL script and simply download preexisting add-ons (great, if and only if the existing stuff does exactly what you want... | [
0.5122678279876709,
-0.023055115714669228,
0.29330703616142273,
0.06554750353097916,
-0.3309646546840668,
-0.4651496112346649,
0.43052077293395996,
0.19397951662540436,
-0.20824623107910156,
-0.4896131455898285,
0.08041736483573914,
0.6464542150497437,
-0.3123612105846405,
-0.0172872953116... | |
asking those who have found a need for an alternative, and a way to fulfill that need to their satisfaction.
**Update:** This question was updated with a request for specific references to specific tools. No discussion, debate, polling or extended discussion is needed. If there exists a *specific* tool, please feel fr... | [
0.27522745728492737,
0.22511257231235504,
0.4497941732406616,
0.20002973079681396,
-0.3538506329059601,
-0.13037768006324768,
0.2874525785446167,
0.22835221886634827,
-0.08059190213680267,
-0.49005889892578125,
-0.14083319902420044,
0.508791446685791,
-0.11442399770021439,
-0.0701203793287... | |
example, `$` isn't a special line column like it is in vim — but close enough.) | [
-0.15235446393489838,
-0.1541399508714676,
0.24951811134815216,
-0.05563793331384659,
-0.13164716958999634,
-0.09453753381967545,
0.157233327627182,
0.014310061931610107,
-0.19267849624156952,
-0.5169926881790161,
-0.27087751030921936,
0.013329489156603813,
-0.31889608502388,
-0.1347508430... | |
I want to draw (via mouse drag) some rectangles onto a canvas. Normally I'd use the Graphics class and FillRectangle on mousemove.
Does anyone have any good resources for doing this in WPF?
A large list of [Markdown implementations](http://markdown.infogami.com/) at the Markdown Wiki.
* Perl
* PHP
* Python
* Ruby
* C... | [
0.6253198981285095,
-0.044026464223861694,
0.1190214455127716,
-0.03887227550148964,
-0.1274915337562561,
0.1164233461022377,
-0.033129673451185226,
-0.18488392233848572,
-0.34054064750671387,
-0.8605305552482605,
0.17258773744106293,
0.5500712394714355,
-0.05343470722436905,
-0.2769311070... | |
I have create a getDBConnection method in my Java application. This returns a connection object, and hence I haven't closed this connection in this method itself.
Now, I am invoking this method from various methods in my application at regular intervals, and closing them inside a try - finally block. I thought this s... | [
0.09854234009981155,
-0.09551481157541275,
0.4283677935600281,
0.31985294818878174,
0.25187820196151733,
-0.1778676062822342,
0.3198297917842865,
0.05031028017401695,
-0.3237154185771942,
-0.63955157995224,
-0.16682779788970947,
0.29653072357177734,
-0.14932501316070557,
0.3756107687950134... | |
Connection getDBConnection() {
//Instantiating the Properties object
PropDemo prop = new PropDemo();
Connection con = null;
// Retrieving values from the parameters.properties file
String JdbcDriver = prop.getMessage("JdbcDriver");
String JdbcUrlPrefix = prop.getMessage("JdbcUrlPrefix");
S... | [
-0.3272538483142853,
-0.30776798725128174,
0.6365265846252441,
0.005912069231271744,
-0.3029941916465759,
0.04346171021461487,
0.42435747385025024,
-0.4979437589645386,
-0.05160590633749962,
-0.5763475298881531,
-0.32888224720954895,
0.6079846620559692,
-0.6807262897491455,
0.4002086222171... | |
Class.forName(JdbcDriver).newInstance();
con = DriverManager.getConnection(JdbcUrlPrefix + DBIP + "/" + DBName, DBUser, DBPassword);
if (con.isClosed())
Logger.log("Connection cannot be established", "vm");
} catch (Exception e) {
Logger.log("Exception: " + e, "vm");
... | [
-0.013591163791716099,
-0.0030535270925611258,
0.31370434165000916,
-0.15126541256904602,
0.11711260676383972,
0.032092634588479996,
0.36457526683807373,
-0.21629701554775238,
-0.17717796564102173,
-0.6346701383590698,
-0.45697081089019775,
0.5257170796394348,
-0.35196512937545776,
0.45391... | |
closing the associated ResultSet and Statement Objects. What could be missing here?
I am planning to replace all the Statements with PreparedStatements for efficiency and security reasons. Will that help significantly? What else can be done?
EDIT:
This is just a core java application that is repeatedly quering for c... | [
0.16481271386146545,
0.057105839252471924,
0.3208256661891937,
0.2225436419248581,
-0.28283432126045227,
-0.20451879501342773,
0.5792129039764404,
-0.003782645333558321,
-0.08168314397335052,
-0.5145066976547241,
0.0472516231238842,
0.4010380208492279,
-0.3338344991207123,
0.14770501852035... | |
come from this program ? Maybe there are some others comming from your same office. To confirm this you would need to stop the program, and look again in your connection monitor.
2) Does your application uses many connection simultaneously? Probably its a peak when you're using 50 at the same time.
If you can post th... | [
0.3275373876094818,
0.1476113647222519,
0.3150765597820282,
-0.024737270548939705,
-0.09048900753259659,
-0.24215619266033173,
-0.022218333557248116,
-0.33328279852867126,
-0.584001898765564,
-0.7793586850166321,
0.12061801552772522,
0.6784533858299255,
-0.2539188861846924,
0.0476144291460... | |
I am working on a large (100s of assemblies) asp.net application and during development it can take a couple of minutes for the first page to load after a recompile.
I am told that much of the delay comes from JITing the assemblies and that this delay is proportional to the number (but not the size) of assemblies. I ... | [
0.361687034368515,
0.08910896629095078,
0.06964871287345886,
-0.14830036461353302,
-0.08309710770845413,
0.09336347877979279,
0.3499637544155121,
-0.24920187890529633,
-0.2919021248817444,
-0.842737078666687,
0.06894407421350479,
0.05334451422095299,
-0.21627628803253174,
0.104249306023120... | |
development or combining DLLs post-build.
We are using .net 3.5.
Any suggestions for me?
*sheepish*
Here's a solution that I should've tried earlier: Disabling virus protection reduces the initial load time from about a minute to less than 8 seconds. | [
0.40461015701293945,
-0.08626110106706619,
0.1517348438501358,
-0.059495482593774796,
-0.025419190526008606,
-0.1314944326877594,
0.6242381930351257,
0.022439612075686455,
-0.17064708471298218,
-0.731269359588623,
0.029491471126675606,
0.357308566570282,
-0.07582468539476395,
-0.1190623044... | |
I have the following text from an academic course I took a while ago about inorder traversal (they also call it pancaking) of a **binary tree** (not BST):
*Inorder tree traversal*
> Draw a line around the outside of the
> tree. Start to the left of the root,
> and go around the outside of the tree,
> to end up to ... | [
-0.13225369155406952,
-0.09282761067152023,
0.15515455603599548,
0.11261940747499466,
-0.13773825764656067,
0.01893049106001854,
0.5141696333885193,
-0.14149950444698334,
-0.25190287828445435,
-0.6257032155990601,
-0.19741491973400116,
-0.04279040917754173,
-0.04256350174546242,
-0.0790263... | |
of the
> nodes is the order in which this line
> passes underneath them. If you are
> unsure as to when you go “underneath”
> a node, remember that a node “to the
> left” always comes first.
Here's the example used (slightly different tree from below)
 {
int i;
char *token;
...
strcpy(sep_foo[i], token); /* sf here */
...
}
```
Then I call it like ... | [
0.13176660239696503,
0.1572583019733429,
0.30331674218177795,
-0.24874919652938843,
-0.42916139960289,
0.09627090394496918,
0.22444435954093933,
-0.25450804829597473,
-0.23485054075717926,
-0.34262529015541077,
-0.05263610929250717,
0.436291366815567,
-0.4228801131248474,
0.177176758646965... | |
sf here \*/
What is wrong in my C code?
Thanks in advance
The warning is exactly right. Your function wants an array of pointers. You're giving it an array of arrays.
Expected:
```
sep_foo:
+------+ +-----+
|char**|--> 0: |char*|-->"string1"
+------+ +-----+
1: |char*|-->"string2"
... | [
0.07692874222993851,
0.20679089426994324,
0.3533089756965637,
-0.20732147991657257,
-0.2623573839664459,
-0.15646490454673767,
-0.11559567600488663,
-0.312971293926239,
-0.24233688414096832,
-0.481998473405838,
0.010092535056173801,
0.7553269863128662,
-0.44683876633644104,
-0.370337992906... | |
sep_foo:
+--------------------------------+
0: | char[MAX_STRING_LENGTH] |
+--------------------------------+
1: | char[MAX_STRING_LENGTH] |
+--------------------------------+
MAX_QTY-1: | ... | [
-0.8204301595687866,
-0.12268568575382233,
0.5153392553329468,
-0.014578577131032944,
-0.1771223247051239,
0.07192463427782059,
0.21936458349227905,
0.1837247908115387,
-0.016248496249318123,
-0.2768900990486145,
-0.22901636362075806,
0.19623005390167236,
-0.12773099541664124,
-0.222584068... | |
|
+--------------------------------+
```
An array with elements of type `X` can "decay" into a pointer-to-`X`, or `X*`. But the value of `X` isn't allowed to change in that conversion. Only *one* decay operation is allowed. You'd need it to happen twice. In your case, `X` is array-of-`MAX_STRING_LENGTH`-ch... | [
0.08720501512289047,
0.3653925955295563,
0.06563318520784378,
-0.1975499391555786,
-0.0050072441808879375,
-0.07047078758478165,
0.32315492630004883,
0.14416180551052094,
-0.25732487440109253,
-0.4309772551059723,
-0.1327487975358963,
0.45690226554870605,
-0.4405839741230011,
0.41793242096... | |
happen.
In your function, you could write this code:
```
char* y = NULL;
*sep_foo = y;
```
That's legal code since `sep_foo` is a `char**`, so `*sep_foo` is a `char*`, and so is `y`; you can assign them. But with what you tried to do, `*sep_foo` wouldn't *really* be a `char*`; it would be pointing to an array of ch... | [
0.30476731061935425,
0.09655910730361938,
0.425742506980896,
-0.15680064260959625,
0.15829165279865265,
-0.11732210218906403,
0.3410656452178955,
-0.23635287582874298,
-0.12534384429454803,
-0.9122262001037598,
-0.3459325432777405,
0.4904705882072449,
-0.6391196250915527,
0.309883922338485... | |
and allocate `sep_foo` on the calling side so it matches what the function expects to receive:
```
char** sep_foo = calloc(MAX_QTY, sizeof(char*));
for (int i = 0; i < MAX_QTY; ++i)
sep_foo[i] = malloc(MAX_STRING_LENGTH);
```
or, equivalently
```
char* sep_foo[MAX_QTY];
for (int i = 0; i < MAX_QTY; ++i)
sep_foo... | [
-0.1837155818939209,
-0.06699656695127487,
0.6058920621871948,
-0.21017426252365112,
-0.40490832924842834,
0.38961344957351685,
0.05374239385128021,
-0.279872328042984,
-0.0049848840571939945,
-0.4377633333206177,
-0.47446390986442566,
0.4644510746002197,
-0.2851588726043701,
-0.0062913075... | |
I've just learnt a bit jQuery, and am trying to use it for a simple color-changing effect. Let's say I have two `<div`>s, #foo and #bar. #foo has a lot of URLs, and has the following CSS defined:
```
#foo a {color: blue; border-bottom: 1px dashed blue}
#foo a:hover {color: black; border-bottom: 1px solid black}
```
... | [
0.31644585728645325,
0.33012041449546814,
0.5891076326370239,
-0.4089473783969879,
-0.07983057200908661,
0.1270950883626938,
-0.005785087123513222,
0.03640976548194885,
-0.16923975944519043,
-0.6996616721153259,
-0.0012302760733291507,
0.27854496240615845,
-0.4457988739013672,
0.2876236140... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.