text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
When I create a `hibernate.cfg.xml` (located at the root of my classpath, the same level as META-INF), Hibernate doesn't read it at all (it's completely ignored).
What I'm trying to do is configure Hibernate second level cache by inserting the cache properties in `hibernate.cfg.xml`:
```
<cache
usage="transactio... | [
-0.02078956924378872,
0.249627023935318,
0.6312595009803772,
-0.201833114027977,
-0.10592012107372284,
-0.24925559759140015,
0.3453911542892456,
-0.14096878468990326,
0.057512763887643814,
-1.0078779458999634,
-0.21088899672031403,
0.17607802152633667,
-0.3399650752544403,
0.19535440206527... | |
</value>
</property>
<property name="hibernateProperties">
<props>
...
</props>
</property>
</bean>
``` | [
0.3487832546234131,
0.19621585309505463,
0.1463962346315384,
-0.1254463642835617,
-0.13838046789169312,
0.04153917357325554,
0.3134918808937073,
-0.0980498269200325,
-0.28291964530944824,
-0.5700743794441223,
-0.4509269893169403,
0.12035961449146271,
-0.09252417087554932,
0.260015755891799... | |
I need to set a single property in a jQuery command using a value that is calculated in the code-behind. My initial thought was to just use `<%= %>` to access it like this:
.aspx
```
<script type="text/javascript" language="javascript">
$('.sparklines').sparkline('html', {
fillColor: 'transparent',
normalRang... | [
0.2532220184803009,
-0.07435426115989685,
0.3643653690814972,
-0.06251352280378342,
-0.15307959914207458,
-0.07361116260290146,
0.1482868790626526,
-0.35007670521736145,
-0.023836476728320122,
-0.6531543135643005,
-0.019397785887122154,
0.4758603870868683,
-0.27772730588912964,
-0.15222246... | |
alternative would be to create the entire `<script>` block in the code-behind using `clientScriptManager.RegisterClientScriptBlock`. But I really don't like putting entire chunks of JavaScript in the code-behind since its, well, JavaScript.
Maybe if I end up having many of these methods I can just put then in a partia... | [
0.276166707277298,
0.3197278082370758,
0.019220659509301186,
-0.010945755988359451,
-0.16394266486167908,
-0.08153695613145828,
0.37481167912483215,
0.0030845922883599997,
-0.0010995481861755252,
-0.642951488494873,
0.19217252731323242,
0.45709723234176636,
-0.19826173782348633,
0.03451828... | |
to extract that value), this is nice because I can change that hidden field via javascript and when/if the page posts back I can get that new value from code behind as well.
If you need to call the method on demand, you could do an jQuery AJAX call to a ASP.NET WebMethod to grab the data and re-populate the various op... | [
0.09539259970188141,
-0.16039378941059113,
0.3099425733089447,
0.14819665253162384,
-0.2873408794403076,
-0.14865100383758545,
0.11330793797969818,
-0.12450011819601059,
-0.19335918128490448,
-0.44913557171821594,
0.13835173845291138,
0.5034371018409729,
-0.11465659737586975,
-0.2594740092... | |
"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="txtCalendar" runat="server" />
... | [
-0.1613471508026123,
-0.3751075565814972,
0.9497050046920776,
-0.1720924973487854,
-0.1783505082130432,
0.07791167497634888,
-0.22603006660938263,
-0.37639695405960083,
-0.2694939970970154,
-0.3080960512161255,
-0.3856517970561981,
0.13819389045238495,
-0.04045502841472626,
0.1069095134735... | |
$("#<%= txtCalendar.ClientID %>")
.datepicker({
minDate: dateMinimum
});
});
</script>
</body>
```
And the code behind Page\_Load method:
```
protected void Page_Load(object sender, EventArgs e)
{
// Set Value of Hidden Field to the first day of the current month.
... | [
0.0738137736916542,
-0.06925243884325027,
0.8968972563743591,
-0.18195107579231262,
0.34151798486709595,
0.10445868968963623,
0.1511489301919937,
-0.07238871604204178,
-0.2225477248430252,
-0.4262407124042511,
-0.41822510957717896,
0.5054032206535339,
-0.34602591395378113,
0.33806699514389... | |
> **Possible Duplicate:**
>
> [Converting XML to JSON using Python?](https://stackoverflow.com/questions/191536/converting-xml-to-json-using-python)
I'm doing some work on App Engine and I need to convert an XML document being retrieved from a remote server into an equivalent JSON object.
I'm using `xml.dom.minido... | [
0.36266571283340454,
0.14244621992111206,
0.2452506273984909,
-0.15113189816474915,
-0.2271183431148529,
-0.1704520732164383,
0.22131125628948212,
-0.1078542172908783,
-0.2414630800485611,
-0.4376026690006256,
-0.07186426222324371,
0.5348488688468933,
-0.45833054184913635,
0.06069596111774... | |
remote server.
result = urlfetch.fetch(url,'','get');
dom = minidom.parseString(result.content)
json = simplejson.load(dom)
self.response.out.write(json)
```
Soviut's advice for lxml objectify is good. With a specially subclassed simplejson, you can turn an lxml objectify result into json.
```
import simplejson as... | [
-0.2502560615539551,
-0.28792548179626465,
0.7951919436454773,
-0.24040226638317108,
-0.28188157081604004,
0.008866928517818451,
0.3648379147052765,
-0.23710229992866516,
-0.07554760575294495,
-0.5534361004829407,
-0.2406577318906784,
0.46002113819122314,
-0.255653977394104,
0.468784898519... | |
def default(self,o):
if isinstance(o, lxml.objectify.IntElement):
return int(o)
if isinstance(o, lxml.objectify.NumberElement) or isinstance(o, lxml.objectify.FloatElement):
return float(o)
if isinstance(o, lxml.objectify.ObjectifiedDataElement):
return str(o)... | [
-0.09544836729764938,
-0.19602146744728088,
0.35567834973335266,
-0.2184089720249176,
-0.0635833889245987,
0.3702647089958191,
0.19157624244689941,
-0.263937383890152,
-0.3515259921550751,
-0.5377106070518494,
-0.34195125102996826,
0.5518835186958313,
-0.22568996250629425,
-0.1503562927246... | |
__dict__, return the encoding of the __dict__
return o.__dict__
return json.JSONEncoder.default(self, o)
```
See the docstring for example of usage, essentially you pass the result of lxml `objectify` to the encode method of an instance of `objectJSONEncoder`
Note that Koen's point is very valid ... | [
-0.23433206975460052,
0.16084499657154083,
0.3175171911716461,
-0.15611396729946136,
0.00724800955504179,
-0.02342129871249199,
0.1124500259757042,
-0.21982654929161072,
0.014201183803379536,
-0.6075772047042847,
-0.2617119550704956,
0.4993177056312561,
-0.1449393630027771,
-0.107061631977... | |
How do I generate 30 random numbers between 1-9, that all add up to 200 (or some arbitrary N), in C#?
I'm trying to generate a string of digits that can add together to be N.
I'm not sure what the statistics are on this but, the issue here is that you don't want to randomly select a number that makes it impossible to ... | [
0.17433200776576996,
-0.17494569718837738,
0.2370007336139679,
-0.23722420632839203,
0.03901189938187599,
0.0569474957883358,
0.025522533804178238,
-0.427963525056839,
-0.3776879906654358,
-0.30915483832359314,
-0.04444021359086037,
0.5242677927017212,
-0.5192216634750366,
0.18645264208316... | |
for (int index = 0; index < count; index++)
{
Console.Write(numbers[index]);
if ((index + 1) % 10 == 0)
Console.WriteLine("");
else if (index != count - 1)
Console.Write(",");
}
Console.ReadKey();
}
static int[] getNumbers(int count, int total)
{
const int... | [
-0.30031618475914,
-0.29125943779945374,
0.751767635345459,
-0.25323668122291565,
0.3049890995025635,
0.1555035263299942,
0.22052694857120514,
-0.4777311682701111,
-0.0578635036945343,
-0.4441026449203491,
-0.4899234473705292,
0.5804716348648071,
-0.28294241428375244,
-0.00894104689359665,... | |
UPPERBOUND = 9;
int[] result = new int[count];
int currentsum = 0;
int low, high, calc;
if((UPPERBOUND * count) < total ||
(LOWERBOUND * count) > total ||
UPPERBOUND < LOWERBOUND)
throw new Exception("Not possible.");
Random rnd = new Random();
for (int index = 0; ind... | [
-0.17013508081436157,
-0.4426597058773041,
0.3316674828529358,
-0.2052180916070938,
0.31498122215270996,
0.19707880914211273,
0.10808558017015457,
-0.4000483751296997,
-0.28522989153862,
-0.20586389303207397,
-0.2678269147872925,
0.2164865881204605,
-0.32002511620521545,
0.2127629220485687... | |
= (total - currentsum) - (UPPERBOUND * (count - 1 - index));
low = calc < LOWERBOUND ? LOWERBOUND : calc;
calc = (total - currentsum) - (LOWERBOUND * (count - 1 - index));
high = calc > UPPERBOUND ? UPPERBOUND : calc;
result[index] = rnd.Next(low, high + 1);
currentsum += resul... | [
-0.048653945326805115,
-0.3971037268638611,
0.9946902990341187,
-0.11825130134820938,
0.19260375201702118,
0.1091943085193634,
-0.1352643072605133,
-0.4618382155895233,
-0.01336776651442051,
-0.2905882000923157,
-0.17253448069095612,
0.21635019779205322,
-0.33271467685699463,
0.22161613404... | |
to drift higher or lower so we should shuffle to compensate somewhat.
int shuffleCount = rnd.Next(count * 5, count * 10);
while (shuffleCount-- > 0)
swap(ref result[rnd.Next(0, count)], ref result[rnd.Next(0, count)]);
return result;
}
public static void swap(ref int item1, ref int item2)
{
in... | [
0.027252960950136185,
-0.30841994285583496,
0.5290642976760864,
0.019663287326693535,
0.1313866674900055,
0.17468872666358948,
0.19903188943862915,
-0.5405517220497131,
-0.3512871265411377,
-0.2907695174217224,
-0.17315898835659027,
0.3637390732765198,
0.05676020309329033,
0.02982256375253... | |
everything seems solid. If you want a nice pretty spread it looks like you want something along the lines of `Total = Count * ((UPPER + LOWER) / 2)`. Although I'm fairly certain that as the difference between `UPPER` and `LOWER` increases the more flexible this becomes. | [
0.5997628569602966,
-0.27996930480003357,
0.41035106778144836,
-0.042340707033872604,
-0.06898918002843857,
-0.2932746410369873,
-0.008370675146579742,
-0.026501568034291267,
-0.49178043007850647,
-0.2502222955226898,
0.02193732000887394,
0.2295701652765274,
0.05082838982343674,
0.00250587... | |
Is there a way to use the `new` keyword to allocate on the stack (ala `alloca`) instead of heap (`malloc`) ?
I know I could hack up my own but I'd rather not.
To allocate on the stack, either declare your object as a local variable *by value*, or you can actually use alloca to obtain a pointer and then use the in-plac... | [
-0.0013478120090439916,
-0.043636858463287354,
0.13534899055957794,
-0.009319594129920006,
0.2675758898258209,
0.12659236788749695,
-0.09683650732040405,
-0.17083801329135895,
-0.34138187766075134,
-0.40885722637176514,
-0.36755460500717163,
0.6119653582572937,
-0.22783195972442627,
0.0786... | |
exit from the scope, consider using `std::auto_ptr<T>` or some other smart pointer type. | [
0.08206680417060852,
-0.11779586970806122,
0.1260235607624054,
-0.0722024217247963,
0.26224300265312195,
-0.4280352294445038,
0.21121549606323242,
0.1883859932422638,
0.08789603412151337,
-0.48435598611831665,
-0.481280654668808,
0.5349599123001099,
-0.26917198300361633,
-0.062431845813989... | |
I've been struggling with this for the past couple hours now and I really don't know what could be wrong. I'm simply trying to get Javascript to communicate text with Flash. I found this great example with this source
<http://blog.circlecube.com/wp-content/uploads/2008/02/ActionscriptJavascriptCommunication.zip>
I ra... | [
0.41621896624565125,
0.15017877519130707,
0.17636460065841675,
-0.046380698680877686,
-0.5101991891860962,
-0.18294107913970947,
0.47720468044281006,
-0.09373433142900467,
-0.12226684391498566,
-0.5801307559013367,
0.43825387954711914,
0.5842723846435547,
-0.08740541338920593,
0.1017533540... | |
a million!
I do not see a call to the allowDomain function in your code. With out that the security sandbox will not allow your flash application to communicate with flash and vice versa on the server. Add a call to `System.security.allowDomain("mydomain.com", "mySecondDomain.com", "etc.com")` for every domain the flas... | [
0.43813884258270264,
-0.1391763538122177,
0.6241946816444397,
0.284684419631958,
0.05990583822131157,
-0.24881209433078766,
0.5425563454627991,
-0.06077119708061218,
-0.2444983422756195,
-0.46693575382232666,
-0.1901106983423233,
0.6170116066932678,
-0.33259159326553345,
0.0430502220988273... | |
I'm looking for a practical application to use a genetic algorithm for. Some things that have thought of are:
* Website interface optimization
* Vehicle optimization with a physics simulator
* Genetic programming
* Automatic test case generation
But none have really popped out at me. So if you had some free time (a f... | [
0.43452373147010803,
0.11206123232841492,
-0.5656979084014893,
0.1067969799041748,
-0.003454749006778002,
-0.10697489976882935,
-0.04669104143977165,
0.29066118597984314,
-0.23661011457443237,
-0.9170012474060059,
0.4127534031867981,
0.3649326264858246,
-0.19244129955768585,
0.029628971591... | |
genetic programming to evolve bots for [Robocode](http://robocode.sourceforge.net/).
I recently posted an [introductory article](http://blog.uncommons.org/2009/01/20/practical-evolutionary-computation-an-introduction/) about evolutionary computation. It includes details of some of the things evolutionary algorithms ha... | [
0.43933162093162537,
-0.25069934129714966,
-0.44291552901268005,
0.22606612741947174,
-0.04482148215174675,
0.03543717786669731,
-0.027468718588352203,
0.0430920235812664,
-0.15290960669517517,
-0.5373521447181702,
0.148821622133255,
0.5975118279457092,
-0.5815505981445312,
-0.007054358255... | |
problem, such as attempting to predict sports results based on form. | [
-0.0868353545665741,
0.13226567208766937,
-0.19226978719234467,
0.42493829131126404,
-0.24278344213962555,
-0.06811315566301346,
0.2314067929983139,
-0.10319742560386658,
-0.07034356147050858,
-0.8689008355140686,
-0.2752687633037567,
0.47949957847595215,
-0.25316116213798523,
-0.202644199... | |
I have a benchmarking application to test out the performance of some APIs that I have written. In this benchmarking application, I am basically using the QueryPerformanceCounter and getting the timing by dividing the difference of QPC values after and before calling into the API, by the frequency. But the benchmarking... | [
0.35423341393470764,
0.11417596787214279,
0.21869517862796783,
0.042281292378902435,
-0.20595307648181915,
-0.17361438274383545,
0.22470156848430634,
-0.22118215262889862,
-0.20459268987178802,
-0.6350991725921631,
0.2979046702384949,
0.7152228355407715,
-0.2580001950263977,
0.320992499589... | |
Am I missing something here?
Some more useful information:
The behavior is like this: Run the application, close it and rerun it again, the benchmarking results seems to improve on the 2nd run and thereafter remains same. This behavior more prominent in case of running from C drive.
I would also like to mention that... | [
0.37520596385002136,
0.12628459930419922,
0.28588831424713135,
0.0744696632027626,
-0.14050015807151794,
-0.18754054605960846,
0.6203041076660156,
0.15608438849449158,
-0.37150174379348755,
-0.3593827188014984,
0.07042691111564636,
0.6545526385307312,
-0.14409275352954865,
0.10242854803800... | |
the app, the performance stabilizes after a couple of runs, then when you close and rerun the same test, the performance seems to improve.
Also, how do you account for the performance change when run from different drives?
**[INFORMATION UPDATE]**
I did an **ngen** and now the performance difference between the dif... | [
0.40747490525245667,
0.039665449410676956,
0.5227946043014526,
0.20032650232315063,
0.0817800760269165,
0.007159236818552017,
0.2940347194671631,
-0.20187881588935852,
-0.16731464862823486,
-0.732690155506134,
0.1121218353509903,
0.9930843710899353,
-0.02827315405011177,
-0.121586576104164... | |
of iterations of APIs within the same launch of benchmark prog), and then from the 3rd iteration onwards, the performance of all APIs seems to fall by around 20%. Then If you close and relaunch the app and run it, for first 2 iterations, it gives correct values (same value as that obtained from C), then again performan... | [
0.16314125061035156,
0.054643332958221436,
0.6865969300270081,
-0.04835766553878784,
0.1266302913427353,
0.10758791118860245,
0.6260859966278076,
-0.15144789218902588,
-0.17066580057144165,
-0.6382231712341309,
0.08442314714193344,
0.6034564971923828,
-0.3129899501800537,
-0.19509719312191... | |
GC would kick in inbetween the tests so I am calling GC.Collect() & GC.WaitForPendingFinalizers() explictly before and after each test. So I dont think it has anything to do with GC.
I tried using AQ time to know whats happening from 3rd iteration onwards, but funny thing is that When I run the application with AQ tim... | [
0.42405152320861816,
0.004626167006790638,
0.20302167534828186,
0.19505152106285095,
-0.3717542290687561,
-0.21966110169887543,
0.23069576919078827,
-0.07714097201824188,
-0.16355852782726288,
-0.3964877128601074,
0.06431252509355545,
0.667000949382782,
-0.33464062213897705,
-0.15911048650... | |
will likely improve because:
* JIT compilation will optimise the code that is run most frequently to improve performance (as [mentioned already](https://stackoverflow.com/questions/472040/running-a-managed-application-2nd-time-shows-different-performance-than-1st#472044) by Cory Foy)
* The program code will be in the ... | [
-0.07169128209352493,
0.010072775185108185,
-0.02675700932741165,
0.12154165655374527,
0.07314823567867279,
0.19241614639759064,
0.28985917568206787,
-0.08308535814285278,
-0.13233941793441772,
-0.8319517970085144,
-0.17938540875911713,
0.6270161271095276,
-0.05766387656331062,
-0.19630530... | |
yes, even if two 'drives' are on the same physical disk, they will have different performance: data can be read faster from the outside of the disk platter than the inside. If they are different physical disks, then the performance difference would seem quite likely. Also, one disk may be more fragmented than the other... | [
0.09449596703052521,
0.06552159786224365,
0.1167081668972969,
0.5480043292045593,
0.033052023500204086,
0.08729510009288788,
-0.15161387622356415,
-0.04114539921283722,
-0.22096914052963257,
-0.7531140446662903,
-0.16843527555465698,
0.7362237572669983,
0.21269556879997253,
0.3200707733631... | |
Here is the domain that I wish to have:
```
public class Person
{
public int Id { get; set; }
public IList<AcquiredCertificate> AcquiredCertificates { get; set; }
}
public class AcquiredCertificate
{
public Person Acquirer { get; set; }
public Certificate Certificate { get; set; }
public DateTime ... | [
-0.20965240895748138,
-0.32424652576446533,
0.44822078943252563,
0.020981496199965477,
0.4020693898200989,
-0.13758336007595062,
-0.289497435092926,
-0.08575736731290817,
-0.22619378566741943,
-0.5828576683998108,
-0.21286554634571075,
0.23014125227928162,
0.09382990747690201,
0.3791922330... | |
INT PRIMARY KEY
);
CREATE TABLE CertificatesAcquiredByPeople (
PersonId INT,
CertificatedId INT,
DateAcquired DATETIME
);
```
It's a contrived schema and domain but it's pretty much the same as something that I am working with. I currently have it working by writing a 3rd domain entity to represent the C... | [
-0.0326501689851284,
0.04011094197630882,
0.5466806888580322,
0.07913529872894287,
-0.2478601336479187,
-0.19430549442768097,
0.16933616995811462,
-0.16737480461597443,
-0.15091034770011902,
-0.6700620651245117,
0.1779002845287323,
0.22939039766788483,
-0.05010198801755905,
0.4990659058094... | |
on my Certificate class? The date really is only a concern of a Person that has a certificate.
**[Edit]**
I've altered the domain model now to reflect that a new entity is needed. Now for the mapping do I need 3 (for each entity) mappings or can I do it with 2 (for Person and Certificate)?
By design, NHibernate only... | [
-0.07719684392213821,
0.13110701739788055,
0.38887524604797363,
0.031401339918375015,
-0.30789682269096375,
-0.05379713326692581,
0.30737003684043884,
-0.074931301176548,
-0.1895279735326767,
-0.5617181658744812,
0.33987027406692505,
0.4347904324531555,
-0.1367846131324768,
0.3630335032939... | |
BY DESIGN)...
<http://devlicio.us/blogs/billy_mccafferty/archive/2008/07/11/when-to-use-many-to-one-s-vs-many-to-many-with-nhibernate.aspx> | [
0.17721104621887207,
0.0748797133564949,
0.13135002553462982,
-0.2076335847377777,
0.09128908812999725,
-0.19335731863975525,
0.19774089753627777,
-0.3973010778427124,
-0.2055020034313202,
-0.33218201994895935,
0.20435455441474915,
0.38113704323768616,
-0.45615023374557495,
0.1021055281162... | |
I know this is a common convention, but what does the "k" in variable names signify? (i.e. kMaxImageViewSize) I looked in the Apple documentation on Variable names and found no mention of it.
Thanks for answering
That's a general programming notation not specific to Objective-C (i.e. Hungarian Notation) and the "k" st... | [
0.2605251967906952,
0.3045024573802948,
-0.11062106490135193,
0.12818077206611633,
-0.12011485546827316,
-0.024883806705474854,
0.1555582582950592,
0.593095600605011,
-0.4731189012527466,
0.19669879972934723,
0.04818733036518097,
0.36584538221359253,
-0.49085721373558044,
0.368469834327697... | |
This always forces us to return a single parameter in case I need to return multiple, say a List and a String. This restriction is not there in function arguments.
This problem is what functional languages such as F#, haskell etc. attempt to address. The problem is that in hardware, a function's return value was origin... | [
-0.0533127523958683,
0.014745615422725677,
0.24322985112667084,
-0.12647223472595215,
-0.30251553654670715,
-0.06722252815961838,
0.12939146161079407,
-0.09063098579645157,
-0.12600493431091309,
-0.334102988243103,
-0.06167067214846611,
0.5559123158454895,
-0.38023629784584045,
0.220248982... | |
I've a dictionary object:
```
Dictionary<string, string[]> dictCompanies = new Dictionary<string, string[]>();
```
How do sort this object on its key?
I tried using OrderBy like below, but it does no seem to work
```
dictCompanies .OrderByDescending(c=> c.Key);
```
I'm binding this dictionary object to a checkb... | [
0.23931926488876343,
0.1584390252828598,
0.4741765856742859,
0.04408496618270874,
0.038687825202941895,
-0.006234537810087204,
0.18772892653942108,
-0.04477176070213318,
-0.2844163179397583,
-0.7299296259880066,
0.02438758872449398,
0.2532283365726471,
0.06224438175559044,
0.38651227951049... | |
You can specify your own `IComparer<T>` if you want to order by the keys in a particular way.
Another option (depending on your situation) would be to stick with the dictionary right up until you need it - then copy it into a list and sort that before binding to the control. Obviously at that point you'd need to refre... | [
0.3548385798931122,
-0.17150919139385223,
0.2394154965877533,
0.17849013209342957,
0.08289086818695068,
-0.06060760095715523,
-0.09721212834119797,
-0.1815357208251953,
-0.24817588925361633,
-0.36054661870002747,
-0.2747272849082947,
0.5169784426689148,
-0.4668215215206146,
0.0299888085573... | |
sequence and return a different sequence (or an aggregate result) - they never modify the sequence in-place. Indeed, they can't as `IEnumerable<T>` is a read-only interface. | [
0.060014981776475906,
0.11959332227706909,
0.14160260558128357,
0.06621912121772766,
0.14262838661670685,
-0.10724252462387085,
0.1614631712436676,
0.05149546265602112,
0.09768042713403702,
-0.7198421359062195,
-0.2550691068172455,
0.4678397476673126,
-0.333517849445343,
0.3044082224369049... | |
I am using the `Picker` controller with `UIImagePickerControllerSourceTypePhotoLibrary`.
In the delegate `didFinishPickingImage` is called, but when I click on the cancel button it doesn't enter:
```
(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
```
This happens even though the controller ... | [
0.14781707525253296,
-0.11051324009895325,
0.3439064919948578,
-0.09772560000419617,
-0.2623867392539978,
-0.243943452835083,
0.02598230168223381,
0.018836749717593193,
-0.17008255422115326,
-0.516619086265564,
-0.05577534809708595,
0.4327287971973419,
-0.2815057635307312,
0.31841292977333... | |
How do I read the response headers returned from a PyCurl request?
There are several solutions (by default, they are dropped). Here is an
example using the option HEADERFUNCTION which lets you indicate a
function to handle them.
Other solutions are options WRITEHEADER (not compatible with
WRITEFUNCTION) or setting HEA... | [
0.1093405932188034,
-0.18525837361812592,
0.5188518166542053,
0.009082038886845112,
-0.09158091247081757,
0.1474839150905609,
0.21442002058029175,
-0.3583611249923706,
0.08036798983812332,
-0.5542684197425842,
-0.14801572263240814,
0.7452305555343628,
-0.21936216950416565,
-0.0515298061072... | |
self.contents = "%s%i: %s" % (self.contents, self.line, buf)
def __str__(self):
return self.contents
retrieved_body = Storage()
retrieved_headers = Storage()
c = pycurl.Curl()
c.setopt(c.URL, 'http://www.demaziere.fr/eve/')
c.setopt(c.WRITEFUNCTION, retrieved_body.store)
c.setopt(c.HEADERFUNCTION, retriev... | [
0.11246643960475922,
0.16001766920089722,
0.36095303297042847,
-0.19479955732822418,
-0.0271147433668375,
0.2733287811279297,
0.31349483132362366,
-0.5366272926330566,
0.007256109733134508,
-0.4723684787750244,
-0.21536122262477875,
0.5082043409347534,
-0.2234213948249817,
-0.1017390936613... | |
I've made a very simple MEF sample which runs on .NET,
but doesn't work properly on Mono.
```
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel.Composition;
namespace Vialis
{
class Program
{
[Import(typeof(ILedController))]
public List<ILedControll... | [
0.7993599772453308,
-0.1420372873544693,
0.362809956073761,
0.08787350356578827,
0.14153654873371124,
0.2728995382785797,
0.1913437396287918,
-0.5617783069610596,
0.21224074065685272,
-0.6126052141189575,
0.3617948293685913,
0.3779042363166809,
-0.45069584250450134,
0.4317277669906616,
0... | |
{
new Program();
}
public Program()
{
compose();
selectController();
Console.ReadLine();
}
private void compose() | [
-0.19964604079723358,
-0.09961899369955063,
0.27034857869148254,
-0.35128048062324524,
0.26720690727233887,
0.134182870388031,
0.3831212520599365,
-0.5976330637931824,
0.11483446508646011,
-0.38744208216667175,
-0.6282626986503601,
0.3370158076286316,
-0.3263300955295563,
-0.05232457816600... | |
{
var catalog = new DirectoryPartCatalog("controllers");
var container = new CompositionContainer(catalog);
container.AddPart(this);
container.Compose();
}
private void selectController()
{ | [
-0.09697502106428146,
-0.39710533618927,
0.44878265261650085,
0.02286253683269024,
0.4072035849094391,
0.09471156448125839,
-0.019098926335573196,
-0.26470184326171875,
-0.2683383524417877,
-0.34167030453681946,
-0.4356975555419922,
0.3854561150074005,
-0.29635414481163025,
0.3965101838111... | |
Console.Clear();
Console.WriteLine("Please select the controller to use\n");
byte i = 0;
foreach (var controller in Controllers)
{
Console.WriteLine("\t{0}) {1}", i, controller.ToString());
i++; | [
-0.6122470498085022,
-0.4089925289154053,
0.7500504851341248,
-0.28702154755592346,
0.4842259883880615,
0.05987650156021118,
-0.18396316468715668,
-0.15468329191207886,
0.21988190710544586,
-0.634773850440979,
-0.47440144419670105,
0.3992067277431488,
-0.29357364773750305,
0.26133948564529... | |
}
Console.Write("\nYour selection: ");
var input = Convert.ToInt32(Console.ReadLine());
Controllers[input].DisplayText(10, 10, "Hello World");
}
}
}
```
This is the interface:
```
using System;
using System.Collections.Generic;
using System.Text;
namespace Vialis
{
... | [
0.15016621351242065,
-0.27572742104530334,
0.7982682585716248,
0.12863339483737946,
0.2358221709728241,
0.26113542914390564,
0.03234349936246872,
-0.23923389613628387,
0.33158472180366516,
-1.061572551727295,
0.056379031389951706,
0.5764076113700867,
-0.6003538966178894,
0.5060089230537415... | |
the first implementation:
```
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel.Composition;
namespace Vialis
{
[Export(typeof(ILedController))]
public class LyanController : ILedController
{
public void DisplayText(int x, int y, string text)
{
... | [
0.11697939783334732,
-0.39801540970802307,
0.5614749789237976,
-0.09669803082942963,
0.0030294875614345074,
0.5139580965042114,
0.048623375594615936,
-0.4434071481227875,
0.11236520856618881,
-0.6710993051528931,
-0.009488621726632118,
0.53376704454422,
-0.8093522787094116,
0.1887439638376... | |
System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel.Composition;
namespace Vialis
{
[Export(typeof(ILedController))]
public class VialisController : ILedController
{
public void DisplayText(int x, int y, string text)
{
Console.SetCursorPositi... | [
0.18120025098323822,
-0.34920939803123474,
0.6923844814300537,
0.009273741394281387,
0.18955735862255096,
0.24700336158275604,
0.26331156492233276,
-0.280463308095932,
0.018774932250380516,
-0.8149341344833374,
0.03772829473018646,
0.43431758880615234,
-0.5835384726524353,
0.44198989868164... | |
(Windows):
[.NET http://lh5.ggpht.com/\_GWubgra2SwM/SXl-yoSRLtI/AAAAAAAADwI/sGR0FjLfg8Q/controller-selection-windows.jpg](http://lh5.ggpht.com/_GWubgra2SwM/SXl-yoSRLtI/AAAAAAAADwI/sGR0FjLfg8Q/controller-selection-windows.jpg)
Selecting the controllers:
[.NET 1 http://lh3.ggpht.com/\_GWubgra2SwM/SXl-yYzs-aI/AAAAAAAAD... | [
-0.04578607901930809,
-0.10382663458585739,
0.1833226978778839,
0.35582417249679565,
0.020704997703433037,
-0.1463204026222229,
0.1457248032093048,
-0.4651581943035126,
-0.4958705008029938,
-0.430279016494751,
-0.24234814941883087,
0.42943066358566284,
-0.36459335684776306,
0.2923816740512... | |
I have a .NET 2.0 WinForms application with a ToolStrip on my main form. Sometimes, the ToolStrip icons don't respond to the first mouse click, so I have to click the icon twice. It's just a standard ToolStrip with several icons and tooltip texts, I don't do anything special. Is this common?
If the application window h... | [
0.521644651889801,
-0.09664969146251678,
0.19994395971298218,
-0.08374188095331192,
-0.3447282314300537,
-0.15739083290100098,
0.2869788408279419,
0.19425198435783386,
-0.011940030381083488,
-0.8220148086547852,
-0.097039133310318,
0.8303219079971313,
-0.1289663165807724,
-0.05681281536817... | |
the .NET ToolStrip is not the same control). | [
0.03773469477891922,
-0.4608932137489319,
0.2372007817029953,
0.3668215274810791,
-0.051487457007169724,
-0.4899981915950775,
0.06403330713510513,
-0.26854172348976135,
-0.11913780868053436,
-0.6106521487236023,
-0.20200133323669434,
0.6683412790298462,
-0.3131818175315857,
0.0168879739940... | |
I am just starting with coding some JSP, which I find isn't all that different from asp.net or any other "real" web-language / web-gateway. I found this question; [Structure JSP/Java code where logic is not in the JSP file](https://stackoverflow.com/questions/299666/structure-jsp-java-code-where-logic-is-not-in-the-jsp... | [
0.4585167467594147,
0.21473123133182526,
-0.05981786921620369,
-0.029861537739634514,
-0.31011632084846497,
-0.4044971764087677,
0.07502676546573639,
0.03791823610663414,
-0.299191951751709,
-0.5454289317131042,
-0.18156501650810242,
0.4396452009677887,
-0.41767454147338867,
-0.03157670050... | |
it's fine if i pass some jars with my release, however they have to be free of use and open source.
If there aren't any good MVCs out there, how do you mainly go if you want to separate Code from Design? Very much like the Code Behind in C# ?
[Spring](http://www.springframework.org)'s web MVC is very good, in my opini... | [
0.6238409280776978,
0.10754147917032242,
-0.1450863629579544,
-0.11317511647939682,
-0.3397364616394043,
-0.12005701661109924,
0.21004818379878998,
-0.04400952532887459,
-0.45401546359062195,
-0.40046367049217224,
0.263194739818573,
0.1918480545282364,
-0.006900663487613201,
-0.02803923934... | |
keep scriptlets out of your pages, [CSS](http://www.w3schools.com/css/) for separation of content from style, and [SiteMesh](http://www.opensymphony.com/sitemesh/) for composing pages using the Composite and Decorator patterns.
[3]: [http://www.amazon.com/JavaServer-Pages-3rd-Hans-Bergsten/dp/0596005636/ref=sr\_1\_1?i... | [
0.0210781991481781,
0.28882601857185364,
0.4011012017726898,
0.13005250692367554,
-0.029430292546749115,
-0.05237327516078949,
0.12724849581718445,
-0.5442501306533813,
-0.4979509711265564,
-0.9884385466575623,
-0.47588050365448,
-0.057614099234342575,
0.08546831458806992,
-0.6146634817123... | |
Here's the thing: I have two applications, written in C++ and running on two machines with different OS (one Linux and one Windows). One of this process is in charge of updating an XML file on a NAS (Network Attached Storage) while the other one reads this file.
Is it possible to synchronize these two processes in or... | [
0.356227844953537,
0.13342998921871185,
0.2196439951658249,
0.08820000290870667,
0.31974297761917114,
-0.19153515994548798,
-0.10247794538736343,
-0.039647676050662994,
-0.15547601878643036,
-0.5998626351356506,
0.12374451756477356,
0.4392649829387665,
-0.16548603773117065,
0.3808987736701... | |
the token before reading the file.
**Edit**: To address the comments, you can implement a double-checked locking type pattern. Have both reader and writer have a locking file and double check before you do work, something like:
Reader: Check for write lock file, create read lock file, check for write lock file, if ex... | [
0.09534376859664917,
-0.09435928612947464,
0.16796846687793732,
0.2875479459762573,
-0.1761215776205063,
0.042848117649555206,
0.31026336550712585,
-0.22115254402160645,
-0.15482217073440552,
-0.7366437315940857,
0.2677063047885895,
0.35841676592826843,
-0.11327748745679855,
0.134009182453... | |
have both processes check, create then recheck simultaneously though this will not cause the data to be read in an inconsistent state but will cause both read and write processes to abort for your specified delay | [
0.2703606188297272,
-0.035358697175979614,
0.17164652049541473,
0.3712538480758667,
0.2417019158601761,
-0.0031121440697461367,
0.2254515439271927,
-0.28383466601371765,
-0.28401002287864685,
-0.6241321563720703,
0.1765473484992981,
0.4118198752403259,
-0.09535137563943863,
0.3318687081336... | |
Our current automated build consists of 1 master box and 4 core-2-duo pizza boxed (at around 2.5Ghz), with 3 GB memory each, all running Ubuntu Linux. (Using [bamboo](http://www.atlassian.com/software/bamboo/))
I have been asked to recalibrate this for running on one or more Solaris boxes. Our current build consists o... | [
0.4452912509441376,
0.3282095789909363,
-0.06596648693084717,
0.06562655419111252,
0.043892960995435715,
0.5307925343513489,
0.08955994248390198,
-0.20821617543697357,
-0.18419082462787628,
-0.7261899709701538,
-0.28682783246040344,
0.1378318965435028,
-0.10378488898277283,
-0.079878501594... | |
choose). Or maybe several 4 CPU machines ?
Can I expect behaviour to scale in a fairly linear manner within a single box? I am looking for actual experiences here; "theoretical" observations about how
IO may become a problem are not very interesting.
Actually I find that builds spend most of their time doing IO of som... | [
0.6396850347518921,
-0.0842939019203186,
0.21252112090587616,
0.29422760009765625,
-0.03257114440202713,
0.42543336749076843,
0.10351822525262833,
-0.3465683162212372,
-0.5503085255622864,
-0.7140315175056458,
0.11745119839906693,
0.6782249212265015,
-0.2173028439283371,
0.0091329002752900... | |
builds you you typically have running at once? If you typically have 2 builds queued now (and 2 running) then having four builds running at once is an improvement. But more than that isn't going to make much difference.
Eight core machines with 64 GB of memory are surprisingly standard for a new server these days. In ... | [
0.5496788024902344,
0.1297796219587326,
0.3219922184944153,
0.26369646191596985,
-0.11651720851659775,
0.27477920055389404,
0.1918496936559677,
-0.09521100670099258,
-0.7333034873008728,
-0.6232594847679138,
0.08857766538858414,
0.6853997111320496,
-0.13530845940113068,
0.0933263823390007,... | |
I'm trying to convert an Enum array to an int array:
```
public enum TestEnum
{
Item1,
Item2
}
int[] result = Array.ConvertAll<TestEnum, int>(enumArray, new Converter<TestEnum, int>(Convert.ToInt32));
```
For some reason Convert.ToInt32 doesn't work when used in Array.ConvertAll, so I had to make some changes:
```... | [
0.19998764991760254,
-0.1411079615354538,
0.06895056366920471,
-0.06230313330888748,
-0.07296451926231384,
0.21560080349445343,
0.5728723406791687,
-0.6255006790161133,
0.17995834350585938,
-0.6317921876907349,
0.07133389264345169,
0.5965935587882996,
-0.37275826930999756,
0.23146511614322... | |
I have a DataGridView, and I'm listening to its Scroll event. This gives me a ScrollEventArgs object whose Type member is supposed to tell me the type of scroll event that has occurred. On [the MSDN documentation page](http://msdn.microsoft.com/en-us/library/system.windows.forms.scrolleventtype.aspx) it says I should b... | [
0.10394244641065598,
-0.04151969030499458,
0.8142545223236084,
-0.2172376960515976,
-0.07771680504083633,
-0.14951209723949432,
0.378107488155365,
-0.30661460757255554,
-0.12175814807415009,
-0.8814661502838135,
-0.053732980042696,
0.6887775659561157,
0.034618478268384933,
0.22472015023231... | |
= false;
Type t = dgv.GetType();
PropertyInfo pi = t.GetProperty("VerticalScrollBar", BindingFlags.Instance | BindingFlags.NonPublic);
ScrollBar s = null;
if (pi != null)
s = pi.GetValue(dgv, null) as ScrollBar;
if (s != null)
{
s.Scroll += new ScrollEventHandler(s_Scroll);
... | [
-0.1566195785999298,
-0.22348390519618988,
1.055099368095398,
-0.17358939349651337,
-0.13717889785766602,
0.11587143689393997,
0.5862977504730225,
-0.7110447287559509,
-0.03412783518433571,
-0.6372063159942627,
-0.4855731427669525,
0.5939352512359619,
-0.19232277572155,
0.43828871846199036... | |
if you want to listen to horizontal scroll events, you change "VerticalScrollBar" to "HorizontalScrollBar" | [
0.18739886581897736,
0.03125804662704468,
0.6994524002075195,
-0.08551578223705292,
-0.32076001167297363,
0.12654167413711548,
0.22134023904800415,
0.01879381202161312,
-0.3348015546798706,
-0.5975126624107361,
-0.1898469775915146,
0.4511584937572479,
-0.05329912528395653,
0.01272982824593... | |
I'm getting back into .NET development after a couple years and it seems that now, especially with LINQ, the way you access your data has changed and become much easier. For instance, in a ASP.NET MVC website, I can:
* Add Item
* add LINQ-to-SQL classes
* drag on database tables onto the LINQ-to-SQL Object Relational ... | [
0.3683329224586487,
-0.007465483155101538,
0.3320733308792114,
0.11123193055391312,
0.05095161125063896,
-0.2131493091583252,
0.05735502019524574,
0.10885504633188248,
-0.5522823333740234,
-0.7863486409187317,
0.13612841069698334,
0.28098103404045105,
0.10935232788324356,
0.163560152053833... | |
you start adding, removing fields and tables in your database, how do the LINQ-to-SQL classes stay in sync?
And how do I make sense of all the new technologies in this space, e.g.
* Where does Subsonic fit in?
* Where does Astoria (ADO.NET Data Services) fit in?
* Where does NHibernate fit in?
* How can I use other d... | [
0.02077203243970871,
-0.06534416228532791,
0.43008673191070557,
0.36972248554229736,
-0.32011863589286804,
-0.4285157322883606,
-0.011221273802220821,
-0.436475932598114,
-0.0585218109190464,
-0.3920805752277374,
0.19165104627609253,
0.2561400532722473,
-0.3940802216529846,
0.1368246674537... | |
them with LINQ, or do I need to write my own code for this?
* does LINQ-to-Entities work like LINQ-to-SQL i.e. automatically generated classes but just with more options?
* is ADO.NET with its DataTables and DataSets an old technology now that we have LINQ? Does LINQ-to-ADO.NET make sense?
* where does Azure fit in whe... | [
0.38212451338768005,
0.15434680879116058,
0.4360167682170868,
0.5149551630020142,
-0.34152719378471375,
-0.18466557562351227,
-0.11422515660524368,
-0.08499984443187714,
-0.4114712178707123,
-0.6507157683372498,
0.04640696570277214,
0.4737163186073303,
-0.23242835700511932,
0.0326078720390... | |
and why?**
Initial responses (mostly on the LINQ stuff):
* LINQ to SQL is something you can use in real projects; I have done. We tended to have all our Data Access code in the partial class that is generated when you right click on the design surface and select "View Code", rather than scattered as one-liners through... | [
0.47656726837158203,
0.060328274965286255,
0.264601469039917,
0.17607654631137848,
-0.08388843387365341,
-0.19882342219352722,
-0.05255755037069321,
-0.13149333000183105,
-0.10244262218475342,
-0.3804367780685425,
0.18475452065467834,
0.6314371824264526,
-0.30041757225990295,
-0.1320303827... | |
have been called LINQ to MSSQL Server - it is tied directly to SQL Server. If you want to use similar tooling with other data sources, you could have a look at the Entity Framework - however this currently has other limitations - LINQ to SQL was as much as anything a proof of concept that this could work.
* ADO.NET Dat... | [
0.1720091551542282,
0.021607976406812668,
0.6589647531509399,
0.2705952525138855,
-0.15842583775520325,
-0.34159985184669495,
-0.19420979917049408,
-0.14577078819274902,
-0.20454342663288116,
-0.38756826519966125,
0.047953322529792786,
0.29548415541648865,
-0.1722550243139267,
-0.044057000... | |
I guess someone could do something with an XSD though, that would be interesting ;)
* You could think of Azure as "An operating system in the cloud", it has a database for storage, although as you state, it's not relational, there's no joins, but you're still going to be querying it for results.
To answer your final q... | [
0.5598522424697876,
0.11771345883607864,
0.1556755155324936,
0.5585590600967407,
-0.19311465322971344,
-0.24266798794269562,
-0.15948353707790375,
0.35463324189186096,
-0.19922290742397308,
-0.5389411449432373,
0.21554477512836456,
0.24045002460479736,
0.06220857426524162,
0.18925923109054... | |
I like the pretty pictures. | [
0.4213322401046753,
0.35489919781684875,
-0.252368688583374,
0.07252763211727142,
0.1731242686510086,
-0.06548545509576797,
-0.08154960721731186,
0.5415099859237671,
-0.5133991241455078,
-0.546012282371521,
0.13007600605487823,
0.20221616327762604,
0.2593950927257538,
-0.00797975156456232,... | |
I've just come across a database where all the character based columns have their size specified in multiples of 8 (e.g. Username = varchar(32), Forename = nvarchar(128) etc.) Would this have any bearing on the performance of the database or is it completely pointless?
Thanks.
N.B. This is in a SQL 2000 database.
Sin... | [
0.24543973803520203,
0.32688626646995544,
0.08263621479272842,
-0.1451282799243927,
-0.01446824986487627,
-0.029225565493106842,
0.23297742009162903,
-0.20232348144054413,
-0.42400267720222473,
-0.46914705634117126,
0.20319019258022308,
0.4458630084991455,
-0.22295010089874268,
0.222982481... | |
I'm writing an .NET 3.5 web application that is using LinqToSql for the basic database stuff. I'd like to use the nLog library for logging. This library can log to a database using good ol' fashioned stored procedures (not that there is anything wrong with that..) but I'd like to use the LingToSql DataContext to log to... | [
0.6778955459594727,
0.12853090465068817,
0.3479633927345276,
-0.09308300167322159,
-0.14657044410705566,
-0.2911463677883148,
-0.08169445395469666,
0.18122534453868866,
-0.14381805062294006,
-1.1340159177780151,
0.44715258479118347,
0.4180140197277069,
-0.35991111397743225,
-0.117063850164... | |
I don't see why if you have SProcs though, the fastest possible way to write messages using C# to a database (bar a bulk load) is via the native SQL api and calling a stored proc. Plus if someone has already written a DB target for you... | [
0.3883431553840637,
0.21003741025924683,
0.17683298885822296,
-0.05993073433637619,
-0.470210999250412,
-0.18469369411468506,
0.31617122888565063,
0.058475345373153687,
-0.1279183328151703,
-0.4896503984928131,
0.05568290501832962,
0.40269067883491516,
-0.3935747444629669,
-0.1359278410673... | |
On the iPhone, when your phone is locked and screen off, if a SMS message comes in, the screen turns on and an alert shows up.
Currently I am using UIAlertView to create the alert dialog (with 2 buttons).
If the phone is off/locked, nothing shows up until I turn it back on and unlock it.
Is there any way to simulate t... | [
-0.08306512236595154,
0.08218412101268768,
0.47814854979515076,
-0.08186821639537811,
-0.0022545873653143644,
-0.08587618917226791,
0.42900943756103516,
0.1386900097131729,
-0.3119494616985321,
-0.5699097514152527,
0.23688945174217224,
0.7471399307250977,
-0.26064082980155945,
-0.261179149... | |
the yet-to-come SDK, an Apple evangelist/chief saying that the SDK would include exactly the same API as used internally by Apple... Pfff...
/John | [
0.4227316081523895,
-0.11899206787347794,
0.37664639949798584,
0.1703740656375885,
0.14180471003055573,
0.051478952169418335,
0.07417917996644974,
-0.13519547879695892,
0.12110979110002518,
-0.4600212574005127,
-0.206787571310997,
0.27182966470718384,
0.1315259039402008,
-0.123350456357002... | |
All I need is to be able to detect when text is dropped into a Textarea. I then take that text and do stuff with it and clear the textarea. There may be many of these textareas and very high UI expectations, so polling is a last resort.
For IE, "onfocus" does the trick, since this event is fired after the user drops s... | [
0.13452328741550446,
-0.031573131680488586,
0.5723350644111633,
0.1079026460647583,
-0.10131620615720749,
-0.19774529337882996,
0.36275625228881836,
-0.13487733900547028,
0.017936108633875847,
-0.7346182465553284,
-0.13339848816394806,
0.6209782958030701,
-0.16539998352527618,
-0.260049521... | |
Thanks.
Edit: For clarification, "dropped" means the user selects text (usually) from the page, but it doesn't matter where, drags it, and drops it into the textarea. This is not the same as Ctrl+V, or right click pasting (which take two different methods of detection, BTW), or (obviously) typing into the textarea. Sp... | [
0.2647213935852051,
-0.05342605710029602,
0.39337295293807983,
0.217641681432724,
-0.12403573095798492,
-0.0812603160738945,
0.05048901215195656,
0.08995982259511948,
-0.3002223074436188,
-0.33431267738342285,
-0.24592849612236023,
0.20378026366233826,
-0.11257099360227585,
-0.300229072570... | |
I meant "pasting", don't you think I would have mentioned *something* about pasting in the title or content of my question? Same goes for *typing* in a textarea. But, perhaps, you all just don't know me well enough to know that I type what I mean, rather than mistakingly typing things only somewhat related to what I me... | [
0.6061999201774597,
0.03337430953979492,
0.288280725479126,
0.3125997483730316,
-0.37720730900764465,
0.07406916469335556,
-0.0479862242937088,
0.09276878088712692,
-0.04359293356537819,
-0.211515873670578,
0.24872374534606934,
0.08780721575021744,
-0.056059688329696655,
0.0517880469560623... | |
DnD operation and dragging over it. The events will not fire.
It seems only a coincidence of how the browser internally handles "drag and drop" that it causes onfocus() to be fired for the textarea in IE and Safari. I doubt there is much defined in the W3 specification... not that it matters, W3 is crap, and besides n... | [
0.14278709888458252,
0.18083536624908447,
0.481955349445343,
-0.1992667019367218,
-0.3202562928199768,
-0.30615296959877014,
0.43136757612228394,
-0.05529123172163963,
-0.14124955236911774,
-0.48407959938049316,
-0.18192824721336365,
0.6791159510612488,
-0.13849256932735443,
0.122962400317... | |
do with dropping content into a textarea.
Down-mod away to sooth your pain. | [
0.15996122360229492,
0.12398983538150787,
-0.0572429895401001,
0.096184141933918,
-0.08470753580331802,
-0.12461487203836441,
0.10082373023033142,
0.23025940358638763,
0.27068209648132324,
-0.43279626965522766,
-0.17174246907234192,
0.6503012180328369,
-0.1527867317199707,
-0.2573353350162... | |
When data binding two elements together, how can I include the binding information AND text as in the case below where I want my label to say:
The font size is 8.5
```
<Grid>
<StackPanel>
<Slider Name="theSlider" Margin="5" Minimum="8" Maximum="14"></Slider>
<Label Content="The font size is: {Bind... | [
-0.38925203680992126,
-0.09112909436225891,
1.0450350046157837,
-0.2682879567146301,
-0.2756854295730591,
0.12562750279903412,
-0.169180765748024,
-0.7032701969146729,
-0.3210841417312622,
-0.7105677723884583,
0.1316175013780594,
0.255561500787735,
-0.16190257668495178,
-0.2624891400337219... | |
<Label Content="{Binding ElementName=theSlider, Path=Value}" ContentStringFormat="The font size is {0}."/>
</StackPanel>
</Grid>
```
Something i learned only a couple of days ago here on stackoverflow :)
If you're using 3.5 SP1 you can use the StringFormat property in your Binding:
<http://blogs.msdn.com/llobo/ar... | [
0.023313555866479874,
-0.1070529893040657,
0.910987913608551,
-0.31286075711250305,
-0.07247168570756912,
-0.10816636681556702,
0.1593996286392212,
-0.48348167538642883,
-0.34409791231155396,
-0.669227659702301,
-0.24411161243915558,
0.42067256569862366,
-0.10717887431383133,
-0.1727192252... | |
I have two webservices that have exactly the same methods and signatures but point at different servers (specifically the Virtual Earth production and staging environments). I wish to switch between using the production and staging services on the basis of a config setting and don't want to repeat myself and replicate ... | [
0.7873677015304565,
0.1856602430343628,
0.046441834419965744,
0.1999702900648117,
0.17979151010513306,
0.14442044496536255,
-0.2737613916397095,
0.11952268332242966,
-0.1516738384962082,
-0.7092329859733582,
0.2422092854976654,
0.35895997285842896,
0.005468965973705053,
0.17735469341278076... | |
the services and switch the url property depending on whether I want to use the production or staging environment?
If I understand you right, you have ONE webservice which is deployed in production and staging environments. In this case the only thing you have to do is to switch between them via the Url property. | [
0.7030907869338989,
-0.10175007581710815,
0.39635011553764343,
0.32107195258140564,
-0.0069587635807693005,
0.017960993573069572,
-0.17634503543376923,
0.22716441750526428,
-0.04555331543087959,
-0.6829013228416443,
-0.009361538104712963,
0.6937313079833984,
-0.02821889892220497,
0.3325523... | |
How can I garble JavaScript code before sending it to client-side? I don't want to expose functionalities. The code is already compressed using `jsmin`.
You could try some online obfuscator like this:
<http://www.javascriptobfuscator.com/Default.aspx> | [
0.27366456389427185,
0.00881257839500904,
-0.03281679004430771,
-0.09099976718425751,
-0.15417008101940155,
-0.16986262798309326,
0.23163075745105743,
0.22689086198806763,
-0.24870498478412628,
-0.7866737842559814,
0.0458512157201767,
0.7527486681938171,
-0.20706024765968323,
-0.1540383994... | |
What options are there in [ASP Classic](http://en.wikipedia.org/wiki/Active_Server_Pages) for error handling?
For example:
I'm using the `Mail.SendMail` function but when switching on the testing server it doesn't work, which is normal. I want to test if mailing is possible, if not then continue and/or show a message... | [
0.33442458510398865,
-0.06676891446113586,
0.10947330296039581,
-0.04921512305736542,
-0.33680635690689087,
0.06257017701864243,
0.42431017756462097,
-0.07963573187589645,
-0.03802695497870445,
-0.7262501120567322,
0.13721436262130737,
0.4369044303894043,
-0.2858370244503021,
-0.1146481856... | |
it by using on error resume next at the point you'd have a try and checking err.Number at the point of a catch like:
```vbs
<%
' Turn off error Handling
On Error Resume Next
'Code here that you want to catch errors from
' Error Handler
If Err.Number <> 0 Then
' Error Occurred - Trap it
On Error Goto 0 ' Turn e... | [
0.010424203239381313,
-0.035005152225494385,
0.3436693251132965,
0.01817081682384014,
-0.041992999613285065,
0.09729264676570892,
0.33524274826049805,
-0.14992007613182068,
-0.20904488861560822,
-0.3594287931919098,
0.10740123689174652,
0.8544118404388428,
-0.045354608446359634,
-0.1615371... | |
I want to use the FTP task in ant, and I have found the appropriate jar files and got everything working fine. I have put the jar files in a "libs" directory alongside the other files used in the build. The only problem is that the user must run "ant -lib commons-net-ftp-2.0.jar" to make a build; I would really prefer ... | [
0.4884650409221649,
0.21956564486026764,
0.04227378964424133,
-0.2812705338001251,
-0.2517196238040924,
-0.011609364300966263,
0.41084766387939453,
-0.22667638957500458,
-0.2475738376379013,
-0.856205403804779,
0.2360428422689438,
0.6237897872924805,
-0.2213345617055893,
-0.005295127164572... | |
looking for. I do not want to force the user to make any modifications to their system to run this task; it should be possible to just load it from the "libs" directory inside of our product's source folder. So that means setting the global CLASSPATH is also out (which is a bad idea anyways).
The last option, as noted... | [
0.1495889127254486,
0.006410408299416304,
0.25842416286468506,
-0.030256064608693123,
0.008038056083023548,
-0.12391184270381927,
0.22557595372200012,
0.10761283338069916,
-0.11252746731042862,
-0.9575658440589905,
0.0015863549197092652,
0.7365564703941345,
-0.30616044998168945,
-0.0948805... | |
I can accomplish this. The FTP task doesn't support a nested classpath element, and I don't know the XML resource I would need to load this library via a taskdef. How can I load the libraries from within ant?
**Edit:** In response to the answers and questions which have been posted here so far, I'm using ant 1.7.1. Ma... | [
0.09235483407974243,
-0.08405327051877975,
0.31335917115211487,
-0.02434789016842842,
-0.02966902405023575,
-0.06426551192998886,
0.6424909830093384,
-0.21734844148159027,
-0.34310436248779297,
-0.8466355204582214,
0.0198825616389513,
0.5541260838508606,
-0.3581431806087494,
-0.08976197987... | |
jarfile? It's not documented anywhere, and I couldn't find anything in the jar itself resembling that path.
The problem you are having is due to the different class-loaders in use. The Commons Net classes must be loaded by the same class-loader that loads the FTP task. Because the FTP task is loaded by Ant on start-up,... | [
0.335478276014328,
-0.10513749718666077,
0.20779526233673096,
0.07786886394023895,
-0.1762981116771698,
-0.010677162557840347,
0.2192319631576538,
0.07742276787757874,
-0.3858247697353363,
-0.6547086238861084,
0.3902066946029663,
0.6602572798728943,
-0.5962119102478027,
-0.0238219108432531... | |
One way around this is to supply a shell script with your project that invokes Ant and passes the apporpriate -lib argument. You then get people to use this rather than invoking Ant directly. In fact, you could deviously name it 'ant' so that it gets run instead of the existing 'ant' on the path (this only works if the... | [
0.15139082074165344,
-0.2852407991886139,
0.09071938693523407,
0.14850611984729767,
-0.08882717043161392,
-0.02131369151175022,
0.4616364538669586,
0.11525588482618332,
-0.24925555288791656,
-0.6628079414367676,
0.036013733595609665,
0.7764396071434021,
-0.378098726272583,
0.04101251810789... | |
You could try submitting an enhancement request, but this won't help in the short term.
There is one other option, which isn't any better than the others. Instead of making sure that the Commons Net classes are loaded by the class-loader that loads the FTP task, you could make sure that the FTP task is loaded by the c... | [
0.23181429505348206,
-0.14866921305656433,
0.13819143176078796,
0.1606283336877823,
-0.22045965492725372,
-0.17260435223579407,
0.11511699110269547,
-0.0552210696041584,
-0.2697829008102417,
-0.7218093276023865,
0.03547284007072449,
0.7056734561920166,
-0.3969573378562927,
0.06760597229003... | |
are broken up into so many separate JARs - so that they can be individually removed. Put this JAR file alongside the Commons Net JAR file so that it can be loaded at the same time. Then you can do something like this (I tried this and it works):
```
<taskdef name="ftp"
classname="org.apache.tools.ant.taskdefs... | [
0.18277190625667572,
0.10821527987718582,
0.3339138925075531,
-0.04761325567960739,
-0.15964490175247192,
-0.093726746737957,
0.29538220167160034,
-0.5325431227684021,
-0.2928025722503662,
-0.9184511303901672,
0.23862777650356293,
0.36578768491744995,
-0.25178611278533936,
0.16379147768020... | |
or without a wrapper script). The only other thing I can think of is to try to find a third-party FTP task to use instead of the default one. | [
0.2561512887477875,
-0.11273445934057236,
0.13442158699035645,
0.24070130288600922,
0.04553283378481865,
-0.05822625756263733,
0.2959471642971039,
0.0761459693312645,
-0.24967838823795319,
-0.5083016753196716,
-0.10898590087890625,
0.6160133481025696,
-0.07322895526885986,
-0.1765499562025... | |
I have a winform in vs2008 that contains a DataGridView. The datagrid contains a list with several columns. These are fixed width, exept one that I have set up to take whatever space is left and fill the width of the view. The winform is resizeable in all directions.
The issue I am trying to solve is that when I incre... | [
0.0733722373843193,
-0.39026421308517456,
0.9233490228652954,
-0.022992154583334923,
-0.3118204176425934,
0.20851686596870422,
0.18330419063568115,
0.04600878804922104,
-0.15554694831371307,
-0.8768735527992249,
0.3137151896953583,
0.7050017714500427,
-0.048062171787023544,
0.0456144176423... | |
properties of the DataGridView does not do this.
Is this at all possible to achieve? And, if so, how do I get the vertical scrollbar to always be visible?
Try subclassing the DataGridView and handling the VerticalScrollBar's VisibleChanged event. You should be able to set the Visible property to True in there, overrid... | [
0.04269244521856308,
-0.3471243679523468,
0.6440829634666443,
-0.1178416833281517,
-0.07611320167779922,
-0.09482797235250473,
0.246792271733284,
-0.1328904926776886,
-0.15293526649475098,
-0.6647369265556335,
0.08945418149232864,
0.6029170751571655,
-0.2582593858242035,
0.1133179366588592... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.