text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I want to move the form title, icon and close, and help buttons from left side to right side (change the layout).
I moved the form controls manually to keep background image but now I want to change the form title.
When I set rightToLeft property to yes and rightToLeftLayout to true in the form properties the backgro... | [
-0.19406865537166595,
0.16698741912841797,
0.8265216946601868,
-0.1277487426996231,
0.31107157468795776,
-0.06475993245840073,
0.12804445624351501,
-0.22815905511379242,
0.10879881680011749,
-0.5866163969039917,
-0.2091839760541916,
0.6026275753974915,
-0.13951270282268524,
0.1141309216618... | |
BackgroundImage, Opacity and others aren't supported when using RightToLeftLayout:
[<http://msdn.microsoft.com/en-us/library/system.windows.forms.form.righttoleftlayout(vs.80).aspx>](http://msdn.microsoft.com/en-us/library/system.windows.forms.form.righttoleftlayout(vs.80).aspx):
> Owner draw is not supported when Ri... | [
-0.27608436346054077,
-0.4356723427772522,
0.5755940079689026,
0.036018550395965576,
-0.09100434184074402,
0.18475516140460968,
-0.08987781405448914,
-0.09052817523479462,
-0.28432777523994446,
-0.716644287109375,
-0.18466037511825562,
0.7718873023986816,
-0.5041292309761047,
-0.1980089396... | |
I'm trying to create a Shared Addin using VS 2008 for Office XP (Excel to be precise). However, after creating the project in Visual studio and changing the references to Office XP (apart from Extensibility which I don't seem to be able to find a copy for office xp) and adding excel.exe to the references as well. I now... | [
0.4102244973182678,
0.31136688590049744,
0.4031776189804077,
0.039591994136571884,
-0.296852707862854,
-0.14874620735645294,
0.22715264558792114,
0.02860807441174984,
-0.007737161125987768,
-0.6608419418334961,
0.18530304729938507,
0.6031893491744995,
-0.3444046974182129,
-0.01923758536577... | |
things prior that I'm meant to have installed on the pc?
I have three test pcs, this one has office xp, 2003 and 2007 on it and I can write an addin using 2003 references that runs on this but no other box. One with just office xp on it but also office xp PIAs installed and .NET and another one just with office xp on.... | [
0.18359524011611938,
0.28844693303108215,
0.32405778765678406,
0.1494455188512802,
0.01663041301071644,
0.11646629869937897,
0.04965084791183472,
0.04019464924931526,
-0.3279103934764862,
-0.368010014295578,
0.11223305016756058,
0.5446198582649231,
-0.07815975695848465,
0.33003735542297363... | |
otherwise it won't deploy the fix and so I had glossed over this quite a few times. In the end I found an old copy of VS2005 and Office 2003 on a spare machine, installed the fix, created an installer and tried it on a machine with Office XP and everything worked fine.
There are two fixes that are needed for this to w... | [
0.07008925080299377,
0.05408206582069397,
0.5892778038978577,
0.2879366874694824,
0.3667142987251282,
-0.018269522115588188,
0.44139763712882996,
-0.20243416726589203,
-0.2087128460407257,
-0.7019582390785217,
-0.1492711305618286,
0.7319786548614502,
-0.45296692848205566,
0.069898679852485... | |
applying these fixes it was easy to use COM Addins like using VSTO and it took me less than an hour to write the actual code. I'm not looking for a way to include these in my MSI installer as prerequesites.
Any questions chuck them in a comment and I'll try and update asap. | [
0.43996912240982056,
0.20705218613147736,
0.37144169211387634,
0.2715294063091278,
0.07784990966320038,
0.2965224087238312,
0.42154085636138916,
-0.04047224670648575,
-0.03423744812607765,
-0.7382426857948303,
0.16271176934242249,
0.8645607829093933,
-0.13212993741035461,
-0.27578982710838... | |
I've faced strange problem. While user change of check box input element on form produces adequate event programmatic change don't. How should I face this challenge? Code following:
```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www... | [
0.2532169222831726,
0.2734525799751282,
0.7731929421424866,
-0.02507808245718479,
-0.060321368277072906,
-0.04349873960018158,
-0.04026741534471512,
-0.42663583159446716,
-0.13004212081432343,
-0.49333375692367554,
-0.13717812299728394,
0.4115257263183594,
-0.17162738740444183,
0.211330562... | |
alert("Changed!");
return true;
}
);
jQuery("#b").click(
function() {
var newState = !jQuery("#cb").attr('checked');
jQuery("#cb").attr('checked', newState);
});
});
</script>
</head>
<body>
<form | [
0.463564932346344,
-0.26429855823516846,
0.6126271486282349,
-0.4327721893787384,
0.324258953332901,
0.08627675473690033,
0.35656481981277466,
-0.11953788995742798,
-0.21167217195034027,
-0.5026576519012451,
-0.44200843572616577,
0.6320937871932983,
-0.736920952796936,
0.04949560388922691,... | |
action="#">
<p>
<input type="button" id="b" />
<input type="checkbox" id="cb" />
</p>
</form>
</body>
</html>
```
**Update**
I do not control element changes, I just need to handle them. It's general-propose code I write.
It's impossible to track object's state within javascript language as it c... | [
-0.12882135808467865,
-0.3043002188205719,
0.42341694235801697,
-0.09771709889173508,
-0.11129680275917053,
-0.001478206948377192,
0.4514878988265991,
-0.8560413122177124,
-0.4063347578048706,
-0.2736473083496094,
-0.17941811680793762,
0.5536133050918579,
-0.26663291454315186,
-0.353423833... | |
that only firing event every time she modifies some property. Certainly this could be encapsulated in a function as AnthonyWJones had mentioned. | [
0.2823586165904999,
-0.06590354442596436,
-0.39954838156700134,
-0.16733555495738983,
-0.09847506880760193,
0.3086901307106018,
0.5523902177810669,
-0.4527502954006195,
-0.38709601759910583,
0.23703958094120026,
0.0294229406863451,
0.4977860748767853,
0.051642436534166336,
-0.1044707149267... | |
How can i draw a box in css? I want a box like the green one used to display the number of answers to a question in stackoverflow?
CSS:
```
.answerbox
{
height: 150px; /*Specify Height*/
width: 150px; /*Specify Width*/
border: 1px solid black; /*Add 1px solid border, use any color you want*/
background-color: green; ... | [
0.03442094102501869,
0.011913792230188847,
0.41943925619125366,
0.0542476661503315,
-0.16196170449256897,
0.16167882084846497,
-0.07137313485145569,
-0.47293150424957275,
-0.25097227096557617,
-0.703378438949585,
-0.203433096408844,
0.22373166680335999,
-0.348638117313385,
-0.2623018324375... | |
I have a VB background and I'm converting to C# for my new job. I'm also trying to get better at .NET in general. I've seen the keyword "T" used a lot in samples people post. What does the "T" mean in C#? For example:
```
public class SomeBase<T> where T : SomeBase<T>, new()
```
What does `T` do? Why would I want to... | [
0.7694494724273682,
-0.03187289088964462,
-0.06246613711118698,
-0.17996445298194885,
-0.28712573647499084,
-0.18451547622680664,
0.27296099066734314,
0.4022669792175293,
-0.17371824383735657,
-0.5676789283752441,
-0.030096614733338356,
0.48968619108200073,
-0.12489969283342361,
0.39370325... | |
What's all this business about Flash, Flex, Adobe Air, Java FX and Silverlight? Why would I choose one over the other? and what happened to Java Applets and ActiveX controls?
Oh, and where does AJAX fit in to all this? and is Laszlo relevant?
Afteredit (in response to some "d'uh" type answers): the question is a bit ... | [
0.46624955534935,
0.32408130168914795,
-0.08909273147583008,
0.24889861047267914,
-0.3092710077762604,
-0.2945552468299866,
-0.15735429525375366,
0.09052902460098267,
-0.14436617493629456,
-0.19941896200180054,
0.07041323184967041,
0.33890318870544434,
0.19489885866641998,
0.02151486277580... | |
version...
1. Adobe Flex/AIR is by far the most mature RIA platform out there and it runs in FlashPlayer. You write apps using ActionScript (similar to Javascript) and MXML (markup used primarily for layout/view code). You can also deploy Flex applications easily to the desktop if the user has the AIR runtime installe... | [
0.5579901933670044,
-0.3847888112068176,
0.7636852860450745,
-0.0583125539124012,
-0.33859795331954956,
-0.3345538079738617,
-0.1934296041727066,
-0.0973297506570816,
-0.07716894149780273,
-0.7697317004203796,
-0.08016782253980637,
0.4601138234138489,
-0.33859366178512573,
-0.3935772478580... | |
but doesn't run on the desktop.
3. JavaFX is a platform, API and scripting language for building RIA on the Java platform. It's the newest entry and just recently had its 1.0 release. It can run in the browser or the desktop and can leverage any and all Java code. Given how much open source Java code exists this can be... | [
0.30944377183914185,
-0.024974381551146507,
0.6333248615264893,
0.0010917515028268099,
-0.3959667980670929,
-0.22311200201511383,
0.28205186128616333,
-0.023823624476790428,
-0.14463753998279572,
-0.7186117768287659,
0.16416142880916595,
0.3992539644241333,
-0.2715662717819214,
-0.00050602... | |
Does anyone know how to disable an ASP.NET validator using JavaScript?
I'm using javascript style.display = 'none' to disable parts of a web page. However these disabled parts have asp.net validators that are still firing and I need to disable then without doing a round trip to the server.
Thanks.
Use this snippet:
``... | [
0.23023566603660583,
0.15287309885025024,
0.45438581705093384,
0.12175208330154419,
0.19888074696063995,
-0.18288381397724152,
0.6635501384735107,
-0.23127225041389465,
-0.1121252253651619,
-0.7761688232421875,
-0.08594124019145966,
0.6925921440124512,
-0.050677619874477386,
0.073896534740... | |
I've got a simple asmx web service that just needs to log some information to a transactional database. However it is timing out for the client. The call to update the database just calls 1 stored procedure and I don't beleive it could be optimized further for better performance. I've been reduced to just logging the r... | [
0.6939930319786072,
0.24243822693824768,
-0.1646636426448822,
0.0004172832996118814,
-0.18379482626914978,
-0.319220632314682,
0.4054483473300934,
0.1426171064376831,
-0.4395698308944702,
-0.47283002734184265,
0.2615489065647125,
0.7921679615974426,
-0.38013288378715515,
0.0003388677723705... | |
bool method(...)
{
LogRun(...)
Asynchronously call method to insert transaction
return true;
}
```
You would have to use the `Read(char[], int, int)` overload (which does limit the length) and do your own end-of-line detection; shouldn't be too tricky.
For a slightly lazy version (that uses the single-chara... | [
-0.2397153079509735,
-0.297697514295578,
0.75686115026474,
-0.25514188408851624,
-0.00852794200181961,
0.024274487048387527,
0.4089895188808441,
-0.5007829070091248,
-0.04516827315092087,
-0.31538626551628113,
-0.19368961453437805,
0.558059573173523,
-0.5285360813140869,
0.3500348925590515... | |
char c = (char) i;
if(c == '\r' || c == '\n') {
yield return currentLine.ToString();
currentLine.Length = 0;
continue;
} | [
-0.35462382435798645,
-0.33424684405326843,
0.7338569164276123,
-0.44238415360450745,
0.5868130922317505,
0.3187592029571533,
0.2527906000614166,
-0.2931579351425171,
-0.0039194305427372456,
0.07352839410305023,
-0.22827671468257904,
0.47722291946411133,
0.002086116001009941,
0.48007848858... | |
currentLine.Append((char)c);
if (currentLine.Length > maxLineLength)
{
throw new InvalidOperationException("Max length exceeded");
}
}
if (currentLine.Length > 0)
{ | [
-0.14957009255886078,
-0.3914458751678467,
0.8082218170166016,
-0.2182835191488266,
0.5597107410430908,
0.007152945268899202,
0.3382074534893036,
-0.46968409419059753,
-0.2034284919500351,
0.04005731642246246,
-0.15427346527576447,
0.4374902546405792,
-0.2630669176578522,
0.444583952426910... | |
yield return currentLine.ToString();
}
}
}
``` | [
-0.1874551773071289,
-0.33356615900993347,
0.6742628216743469,
-0.4766101539134979,
0.4576342701911926,
-0.09594270586967468,
0.13356433808803558,
-0.23878085613250732,
0.08872752636671066,
-0.08923643827438354,
-0.0363210067152977,
0.7810141444206238,
-0.2251054048538208,
0.35005781054496... | |
Most dead-tree books and web tutorials address Rails 1.X. I'm wondering if they are worth using to learn Rails 2.X. If so, what sections and concepts should I avoid and what have pretty much stayed the same?
One of my favorite books is the "skateboard" book from The Pragmatic Programmers, "Agile Web Development with Ra... | [
0.5996285676956177,
0.003787273308262229,
-0.3789159953594208,
0.26684653759002686,
-0.16406214237213135,
-0.017315015196800232,
0.31945422291755676,
0.4221000373363495,
-0.41076838970184326,
-0.6785820722579956,
0.4276270270347595,
0.32386672496795654,
-0.05944593995809555,
-0.07636653631... | |
out more you can visit these links:
* <http://weblog.rubyonrails.org/2007/9/30/rails-2-0-0-preview-release>
* <http://www.infoq.com/news/2007/12/rails-20-docs>
That said, I also have "The Rails Way" by Obie Fernandez which covers Rails 2.0. However, I still find myself reaching for the Agile book more often. You can ... | [
0.19335055351257324,
-0.13436710834503174,
-0.03232797235250473,
0.11431774497032166,
-0.36337289214134216,
-0.09338858723640442,
0.3812738060951233,
0.14846311509609222,
-0.2869265675544739,
-0.46058791875839233,
0.18135489523410797,
0.5731387734413147,
0.06840920448303223,
-0.25399327278... | |
that I subscribe to (there are many, many more available than these):
* <http://weblog.rubyonrails.com/>
* <http://delicious.com/jnunemaker/railstips>
* <http://railstips.org/>
* <http://blog.hasmanythrough.com/>
* <http://ryandaigle.com/>
* <http://railspikes.com/>
* <http://www.railsontherun.com/>
* <http://agileweb... | [
0.3776192367076874,
-0.1468920260667801,
-0.008296791464090347,
-0.07059940695762634,
-0.27673596143722534,
0.08662284165620804,
0.5857844352722168,
0.1696777045726776,
-0.002153479726985097,
-0.4801402688026428,
0.07536224275827408,
0.5227117538452148,
0.07186847925186157,
0.0819755196571... | |
On a 64-bit machine is the size of an int in Java 32 bits or 64 bits?
32 bits. It's one of the Java language features that the size of the integer does not vary with the underlying computer. See [the relevant section of the spec](http://docs.oracle.com/javase/specs/jls/se7/html/jls-4.html#jls-4.2). | [
-0.013413604348897934,
0.11422237753868103,
0.04556959122419357,
-0.07964500039815903,
-0.11152190715074539,
0.30352678894996643,
0.23180176317691803,
-0.3711446225643158,
-0.4655526280403137,
-0.1331407129764557,
0.06635063886642456,
0.3025822043418884,
-0.3109239935874939,
-0.26783922314... | |
Can anyone recommend a GUI builder tool for creating DHTML web apps using AJAX to communicate with a web service backend? I'd like to avoid having to mess around with designing HTML, marshalling/unmarshalling data, checking for browser compatibility, etc. The tool should have a library of widgets that can be put into a... | [
0.4890044629573822,
0.31930437684059143,
0.07405370473861694,
0.3679150342941284,
-0.2527179419994354,
-0.3399856686592102,
0.1789063811302185,
0.006329821888357401,
-0.07419177889823914,
-0.711487889289856,
0.016608044505119324,
0.9135910272598267,
-0.008050582371652126,
-0.11577799916267... | |
would use for the backend? If the GUI is just calling a web service then I should be able to use anything on the server-side to provide that interface but maybe some gui-side tools use a proprietary data exchange format that requires some specific server-side code?
Edit: I don't need a widget that can be dragged, I wa... | [
0.5377618670463562,
-0.06513345241546631,
-0.021465983241796494,
0.31610140204429626,
-0.20920483767986298,
-0.10528615117073059,
-0.1999765783548355,
-0.022623447701334953,
-0.1089024692773819,
-0.3552743196487427,
0.26888009905815125,
0.8162550330162048,
-0.13249371945858002,
-0.11653763... | |
the annoyance of pixel pushing and making things work in multiple browsers. I also tried searching for "gwt rad tools" and came up with a couple of results:
* [Instantiations GWT Designer](http://www.instantiations.com/windowbuilder/gwtdesigner/index.html) (commercial, $59/year)
* [Wirelexsoft Vistafei](http://www.wir... | [
0.5649323463439941,
-0.36229491233825684,
0.3774227499961853,
-0.0052598705515265465,
-0.3711066246032715,
0.1496749073266983,
0.18518126010894775,
-0.03647160530090332,
-0.32404834032058716,
-0.27465924620628357,
0.20666709542274475,
0.44496825337409973,
-0.4905520975589752,
0.01985011994... | |
Has anyone had any luck running two instances of the iPhone simulator to test network code between the two?
No but you can run the Simulator and the WiTap code on your phone. I've done that and it's pretty cool.
Just provision the WiTap code for your development provisioning profile and load it on the phone. Then, mak... | [
0.4435802698135376,
0.05381692200899124,
-0.27741068601608276,
0.39933302998542786,
0.19142071902751923,
0.09818939119577408,
0.2752113342285156,
0.25134482979774475,
-0.027457695454359055,
-0.9342394471168518,
0.3627593517303467,
1.0770483016967773,
0.04874257743358612,
-0.227533131837844... | |
I'm trying to match the parts of a version number (Major.Minor.Build.Revision) with C# regular expressions. However, I'm pretty new to writing Regex and even using Expresso is proving to be a little difficult. Right now, I have this:
```
(?<Major>\d*)\.(?<Minor>\d*)\.(?<Build>\d*)\.(?<Revision>\d*)
```
This works, b... | [
-0.12788207828998566,
0.14662812650203705,
0.4483357071876526,
-0.30348625779151917,
-0.1307978332042694,
-0.04732610657811165,
0.4243977665901184,
-0.1338338553905487,
0.000443868397269398,
-0.612512469291687,
-0.0719153955578804,
0.7351606488227844,
-0.33932679891586304,
-0.0677144676446... | |
How can i convert this to a decimal in SQL? Below is the equation and i get the answer as 78 (integer) but the real answer is 78.6 (with a decimal) so i need to show this as otherwise the report won't tally up to 100%
```
(100 * [TotalVisit1]/[TotalVisits]) AS Visit1percent
```
```
convert(decimal(5,2),(100 * convert... | [
0.02731982246041298,
0.3941272795200348,
0.5801151990890503,
-0.16104310750961304,
-0.30127349495887756,
0.1171937882900238,
0.19900599122047424,
-0.32271286845207214,
0.015479027293622494,
-0.37677687406539917,
0.2716584801673889,
0.6841052770614624,
0.06840401142835617,
-0.09198209643363... | |
I'm currently trying to modify some HttpWebRequest functions, but I can't do it through inheritance because HttpWebRequest has no public constructors (besides the deserialization constructor). Is there a workaround to do this?
My objective is to code something like the example below, but this class objects must inheri... | [
-0.14910723268985748,
0.09588680416345596,
0.4507223963737488,
-0.04649940878152847,
-0.08784031122922897,
-0.0790553092956543,
0.3735097050666809,
-0.27858543395996094,
-0.02767523005604744,
-0.6268225312232971,
-0.2941373884677887,
0.6099234223365784,
-0.45301198959350586,
0.490323960781... | |
:this(new Uri(uri), getResponseCallback)
{
}
public AsyncWebRequest(Uri uri, AsyncCallback getResponseCallback):base()
{
this.uri = uri;
this.getResponseCallback = getResponseCallback;
}
private IAsyncResult BeginGetResponse()
{
request = HttpWebRequest.CreateDefaul... | [
-0.03254428878426552,
-0.08459661900997162,
0.42650455236434937,
-0.3125753104686737,
0.2164829522371292,
0.12466457486152649,
0.6897853016853333,
-0.4032778739929199,
0.027389388531446457,
-0.6053537130355835,
-0.40480512380599976,
0.3124656081199646,
-0.37422534823417664,
0.5555211305618... | |
GetResponseTimeout, null, Timeout, true);
return result;
}
private void GetResponseTimeout(object state, bool timedOut)
{
if (timedOut)
{
Retry();
}
}
private void Retry()
{
request.Abort(); | [
0.09996063262224197,
-0.5508961081504822,
0.2633309066295624,
-0.1618267148733139,
0.3014768660068512,
0.1117001622915268,
0.542386531829834,
-0.4353455603122711,
-0.17777740955352783,
-0.17550088465213776,
-0.7426401376724243,
0.6653661727905273,
-0.35735875368118286,
0.20559236407279968,... | |
bool retry = false;
lock (request)
{
if (RetriesLeft > 0)
{
Interlocked.Decrement(ref RetriesLeft);
retry = true;
} | [
0.024088576436042786,
-0.19446803629398346,
0.6398568153381348,
-0.22390076518058777,
0.17258264124393463,
0.17344391345977783,
0.7246400713920593,
-0.6282668709754944,
-0.06304781138896942,
-0.07035372406244278,
-0.4460981786251068,
0.4949647784233093,
-0.26848942041397095,
0.512795448303... | |
}
if (retry)
{
BeginGetResponse();
}
else
{
getResponseCallback(null);
}
}
private void GetResponseCallback(IAsyncResult AsyncResult)
{ | [
-0.0898982584476471,
-0.2655367851257324,
0.057292938232421875,
-0.0775739923119545,
0.3997706174850464,
0.043370239436626434,
0.6772812008857727,
-0.23539923131465912,
0.034076761454343796,
-0.2629155218601227,
-0.5571043491363525,
0.7582855820655823,
-0.4084194600582123,
0.20319452881813... | |
try
{
getResponseCallback(AsyncResult);
}
catch(WebException webException)
{
Retry();
}
}
}
```
Unless you can trick the serialization constructor to do your bidding, then no, there is no way.
The constructors of that class are internal, so you have ... | [
0.10345940291881561,
-0.19966870546340942,
0.46895453333854675,
-0.0128980353474617,
0.2812734842300415,
0.05428821220993996,
0.5069462060928345,
-0.290583074092865,
-0.2154761105775833,
-0.5985336303710938,
-0.306088387966156,
0.481390118598938,
-0.4644579291343689,
0.07826758176088333,
... | |
of calling them. | [
0.03709226846694946,
0.6162630915641785,
-0.17505767941474915,
-0.1903451383113861,
-0.50753253698349,
-0.2390279769897461,
0.24775974452495575,
-0.28561460971832275,
-0.2226058542728424,
-0.40588653087615967,
-0.020432118326425552,
0.7016344666481018,
-0.2778010666370392,
0.11172541975975... | |
Does anyone know of existing code that lets you draw fully justified text in Java2D?
For example, if I said, `drawString("sample text here", x, y, width)`, is there an existing library that could figure out how much of that text fits within the width, do some inter-character spacing to make the text look good, and aut... | [
0.42194706201553345,
0.07196308672428131,
0.30042383074760437,
0.03458893671631813,
-0.4036884307861328,
0.19277650117874146,
-0.0243210569024086,
-0.3859883248806,
-0.14097361266613007,
-0.6137369275093079,
0.03597067669034004,
0.6815637946128845,
-0.008779222145676613,
-0.238308429718017... | |
line:
```
public void drawString(Graphics g, String s, int x, int y, int width)
{
// FontMetrics gives us information about the width,
// height, etc. of the current Graphics object's Font.
FontMetrics fm = g.getFontMetrics();
int lineHeight = fm.getHeight();
int curX = x;
int curY = y;
... | [
0.037467360496520996,
-0.20185908675193787,
1.015488862991333,
-0.1566648781299591,
-0.11421043425798416,
0.436623752117157,
0.06887590885162354,
-0.2281220257282257,
0.044729627668857574,
-0.600461483001709,
-0.6024641394615173,
0.477505087852478,
-0.10623680800199509,
0.12507763504981995... | |
int wordWidth = fm.stringWidth(word + " ");
// If text exceeds the width, then move to next line.
if (curX + wordWidth >= x + width)
{
curY += lineHeight;
curX = x;
}
g.drawString(word, curX, curY); | [
-0.3628482222557068,
-0.17990802228450775,
0.9040244221687317,
-0.45625656843185425,
0.014301433227956295,
0.23039034008979797,
0.3230772614479065,
-0.3493848145008087,
-0.03740651533007622,
-0.5887237787246704,
-0.6257961392402649,
0.6846782565116882,
-0.2466602772474289,
0.13657197356224... | |
// Move over to the right for next word.
curX += wordWidth;
}
}
```
This implementation will separate the given `String` into an array of `String` by using the [`split`](http://java.sun.com/javase/6/docs/api/java/lang/String.html#split(java.lang.String)) method with a space character as the only word sepa... | [
0.06805409491062164,
-0.1488780826330185,
0.3154088854789734,
-0.14980538189411163,
-0.0237142164260149,
-0.03129386156797409,
0.0032238210551440716,
-0.17345505952835083,
-0.15241007506847382,
-0.6706196069717407,
-0.2733447253704071,
0.4365640878677368,
-0.18225859105587006,
0.1374722272... | |
another implementation would still use the methods provided by the [`FontMetrics` class](http://java.sun.com/javase/6/docs/api/java/awt/FontMetrics.html). | [
0.05059775710105896,
-0.2782815992832184,
0.3337411880493164,
-0.09168888628482819,
0.00009869414498098195,
0.12582938373088837,
0.023390157148241997,
-0.17258700728416443,
-0.06202732026576996,
-0.680377185344696,
-0.002912671072408557,
0.2426585555076599,
-0.20019586384296417,
-0.3168112... | |
Our ssl certificate recently expired, so we were issued a new one by the CA. Unfortunately, when biztalk uses this certificate to access a server, the server rejects it, giving us a 403.17 error (Expired or not yet valid).
So I checked the dates of the certificate and it seems okay. But to really check if the certifi... | [
0.496643990278244,
0.08340805768966675,
0.5041083693504333,
0.1476903110742569,
0.18229302763938904,
-0.2682616710662842,
0.5184309482574463,
0.11349421739578247,
-0.3333611786365509,
-0.4553390443325043,
0.03919211030006409,
0.069657102227211,
-0.48484328389167786,
0.17578065395355225,
... | |
server, it gets rejected?
Although not the most elegant nor robust solution, here's an method that will take the [`Font`](http://java.sun.com/javase/6/docs/api/java/awt/Font.html) of the current [`Graphics`](http://java.sun.com/javase/6/docs/api/java/awt/Graphics.html) object and obtain its [`FontMetrics`](http://java.... | [
-0.09031004458665848,
0.08812058717012405,
0.6506413817405701,
-0.03400018811225891,
-0.20849911868572235,
0.03023333102464676,
0.3981963098049164,
-0.5171685218811035,
-0.01764572411775589,
-0.4347476065158844,
-0.20214904844760895,
0.3682129681110382,
-0.42159488797187805,
0.081408917903... | |
x;
int curY = y;
String[] words = s.split(" ");
for (String word : words)
{
// Find out thw width of the word.
int wordWidth = fm.stringWidth(word + " ");
// If text exceeds the width, then move to next line.
if (curX + wordWidth >= x + width)
{ | [
-0.04986482113599777,
0.06761514395475388,
0.7772988677024841,
-0.39582961797714233,
0.032240383327007294,
0.3466007709503174,
0.42147964239120483,
-0.3146305978298187,
-0.044452421367168427,
-0.6204487681388855,
-0.592327356338501,
0.7385443449020386,
0.029348812997341156,
0.2798793613910... | |
curY += lineHeight;
curX = x;
}
g.drawString(word, curX, curY);
// Move over to the right for next word.
curX += wordWidth;
}
}
```
This implementation will separate the given `String` into an array of `String` by using the [`split`](http://java.sun.com/javase/6/docs/... | [
-0.06442420929670334,
-0.010129288770258427,
0.5589218735694885,
-0.14855311810970306,
-0.08125726878643036,
0.23963217437267303,
-0.0922965258359909,
-0.3231704831123352,
-0.13284699618816376,
-0.6635764837265015,
-0.37519213557243347,
0.2080954909324646,
-0.29042166471481323,
0.214737698... | |
it's probably not very robust. It also assumes that the word is followed by a space character and acts accordingly when moving the `curX` position.
I wouldn't recommend using this implementation if I were you, but probably the functions that are needed in order to make another implementation would still use the method... | [
-0.07557978481054306,
0.09090157598257065,
0.34444674849510193,
-0.20835702121257782,
-0.15872083604335785,
0.07771536707878113,
0.1298566311597824,
0.02124050259590149,
0.10186344385147095,
-0.6514372825622559,
0.20584441721439362,
0.6231603622436523,
-0.14505940675735474,
0.0565698482096... | |
In my work I have come across syntax like global:: (C#) or G:Loading($value) in Php, what do they mean?
In C# `::` is the namespace alias qualifier operator, and `global` indicates the global namespace. It is necessary if you have overlapping classes and namespaces.
For example, if you have class `Foo.Bar` and `Baz.Fo... | [
0.0794915109872818,
0.1788340061903,
0.2456456869840622,
-0.056000273674726486,
-0.10588274896144867,
0.04515254497528076,
-0.005953124258667231,
0.1328136920928955,
-0.14977481961250305,
-0.5109333395957947,
-0.1551310122013092,
0.47742801904678345,
-0.20231501758098602,
0.215647667646408... | |
How can I limit a result set to *n* distinct values of a given column(s), where the actual number of rows may be higher?
Input table:
```
client_id, employer_id, other_value
1, 2, abc
1, 3, defg
2, 3, dkfjh
3, 1, ldkfjkj
4, 4, dlkfjk
4, 5, 342
4, 6, dkj
5, 1, dlkfj
6, 1, 34kjf
7, 7, 34kjf
8, 6, lkjkj
8, 7, 23kj
```
... | [
-0.40472739934921265,
0.12309693545103073,
0.5095406174659729,
0.07393823564052582,
0.09691297262907028,
0.2657042443752289,
-0.07279211282730103,
-0.3194432854652405,
-0.2288312315940857,
-0.8882391452789307,
0.07116618752479553,
0.34384408593177795,
-0.3246612846851349,
0.160376757383346... | |
5)
``` | [
0.2984094023704529,
0.42734208703041077,
0.08721454441547394,
-0.08848114311695099,
0.1116020679473877,
-0.2728695571422577,
0.3692289888858795,
-0.273967444896698,
0.13662317395210266,
-0.5186997056007385,
-0.26910561323165894,
0.5467932820320129,
-0.02323114685714245,
0.3571644127368927,... | |
Is there an easy way to do a `GROUP BY DATE(timestamp)` that includes all days in a period of time, regardless of whether there are any records associated with that date?
Basically, I need to generate a report like this:
```
24 Dec - 0 orders
23 Dec - 10 orders
22 Dec - 8 orders
21 Dec - 2 orders
20 Dec - 0 orders
`... | [
0.2177550196647644,
0.08759376406669617,
0.38221609592437744,
-0.18064260482788086,
-0.13060593605041504,
0.3164985775947571,
0.0779191330075264,
-0.25562211871147156,
-0.5581074953079224,
-0.35347211360931396,
-0.1739475131034851,
-0.14062397181987762,
-0.28219613432884216,
0.254865378141... | |
I'm trying to create a UserControl that inherits from a generic class. It does not directly inherit from a generic class, but through an intermediate class that does not use generics. This compiles and works at runtime, but I get an error at design time.
Here's my generic parent class:
```
Public Class GenericParent(... | [
-0.12797461450099945,
0.07497747987508774,
0.40929368138313293,
-0.07465285062789917,
-0.23129597306251526,
-0.30196478962898254,
0.17130817472934723,
-0.24820415675640106,
-0.19727379083633423,
-0.2616351246833801,
-0.07748853415250778,
0.36421698331832886,
-0.43409615755081177,
0.3264088... | |
<Button Content="Hello"/>
</StackPanel>
</local:NonGenericParent>
```
The IntelliSense parser gives the following errors:
1. The property 'Width' was not found in type 'NonGenericParent'.
2. The property 'Height' was not found in type 'NonGenericParent'.
3. The type 'NonGenericParent' does not support direct con... | [
-0.18808826804161072,
0.13828185200691223,
0.42938995361328125,
-0.1885160356760025,
0.1680126190185547,
-0.2565317153930664,
0.5466012954711914,
-0.09414432942867279,
0.04694456234574318,
-0.516358494758606,
-0.0025508548133075237,
0.4752187430858612,
-0.37421122193336487,
0.2297030687332... | |
silence these errors I'd be eager to hear them.
**Update:** We've opened a support ticket with MSFT, I'll update this with whatever their solution is.
We've received word from Microsoft that this is not likely to be fixed in future versions. After they bounced the problem around trying to find the responsible group, i... | [
0.5302748680114746,
0.20201317965984344,
0.4571036994457245,
0.2954436242580414,
-0.10766826570034027,
-0.28759533166885376,
0.6573238372802734,
0.4938895106315613,
-0.2647605836391449,
-0.44948092103004456,
-0.21837645769119263,
0.42552003264427185,
-0.04881545156240463,
0.195763409137725... | |
I've got some shell stuff set up that dynamically defines aliases depending on what sort of VC repo the CWD contains -- so, for example, 'd' runs 'svn diff' or 'git diff', depending. (Based on [this blog post](http://muness.blogspot.com/2008/06/stop-presses-bash-said-to-embrace.html), if anybody is interested...)
I'd ... | [
0.6777815818786621,
-0.23776717483997345,
0.3293723464012146,
-0.08338066935539246,
0.006972209550440311,
-0.14443984627723694,
0.18763059377670288,
-0.16891084611415863,
-0.0647093877196312,
-0.5057555437088013,
-0.044123925268650055,
0.5280947685241699,
-0.03220590204000473,
0.1563511192... | |
svn repository was cloned with the -s or --std-layout option, in which there actually *is* a branch `trunk`.
Codelogic's answer will only work if there is an svn repository called `svn` -- there's no requirement that that is true.
The easiest way to check if there *is* an svn-remote in the config is:
```
$ git confi... | [
0.24754208326339722,
-0.17502263188362122,
0.3004554510116577,
0.26962587237358093,
0.15009452402591705,
-0.21818800270557404,
0.35028478503227234,
0.2412845492362976,
-0.18332257866859436,
-0.7087928652763367,
-0.28273651003837585,
0.5646769404411316,
-0.34132274985313416,
0.2858731150627... | |
svn repository, but uses is as a submodule or as a sub-tree merge, or even not at all. If metadata in the git-svn repository has been turned on, you can see if any svn revision has been used in the current HEAD by using something like this:
```
$ git rev-list -1 --grep='git-svn-id' HEAD
```
But that's perhaps a bit ... | [
0.1947125792503357,
0.023924540728330612,
0.5175586342811584,
0.19620168209075928,
0.03823612257838249,
-0.6095540523529053,
-0.03736340254545212,
-0.07400152087211609,
-0.30817949771881104,
-0.5538385510444641,
-0.26120394468307495,
0.6119532585144043,
-0.10528098046779633,
0.243788883090... | |
Say I have two script controls and one control has the other as a child control:
```
ParentControl : ScriptControl
{
ChildControl childControl;
}
```
The script for the Child Control:
```
ChildControl = function(element)
{
ChildControl.initializeBase(this, [element]);
}
ChildControl.prototype =
{
callMet... | [
-0.23867212235927582,
0.1689498871564865,
0.3897953927516937,
-0.18291321396827698,
0.29057735204696655,
0.30355125665664673,
0.0320536307990551,
-0.34189146757125854,
0.504958987236023,
-0.7536959648132324,
-0.020301271229982376,
0.24987675249576569,
-0.1599477082490921,
0.359814345836639... | |
want to call a method on the child control:
```
ParentControl.prototype =
{
initialize: function()
{
this._childControl = $get(this._childControlID);
this._childControl.CallMethod();
ParentControl.callBaseMethod(this, 'initialize');
},
dispose: function()
{
ParentControl... | [
-0.10067641735076904,
0.07486406713724136,
0.0001830910478020087,
0.11246202886104584,
0.5100262761116028,
0.18691611289978027,
0.2770727276802063,
-0.19662265479564667,
0.08849488943815231,
-0.6375828981399536,
-0.08293525874614716,
0.3107018768787384,
-0.3500179052352905,
0.5280376672744... | |
so that the ParentControl can see it?
**Update**
Would it be possible to "type" the this.\_childControl?
Here's the reason I ask... When I use Watch, the system knows what the ChildControl class is, and I can call methods off the class itself, however, I can't call the same methods off the this.\_childControl object... | [
0.38285520672798157,
-0.22485777735710144,
0.20393627882003784,
0.11736288666725159,
0.3269636929035187,
0.0062902397476136684,
-0.007899695076048374,
0.08220937848091125,
-0.0668388158082962,
-0.6005892753601074,
0.14134152233600616,
0.5778117775917053,
-0.10573243349790573,
0.23375824093... | |
\_childControlID get set? I would guess by adding it as a property in the parent control's descriptor on the server, but you don't show that code and you don't show a property on the client-side parent control class.
2. $get returns element references--not controls. So even if \_childControlID was set to a valid elemen... | [
0.24064451456069946,
-0.16123448312282562,
0.2426409274339676,
0.14468365907669067,
0.4581311345100403,
-0.06550237536430359,
0.19384491443634033,
-0.1660010665655136,
0.2562558054924011,
-0.619415819644928,
-0.06333892047405243,
0.4836767315864563,
-0.25415629148483276,
0.2328591197729110... | |
if the child control initialized before the parent control, of course. | [
-0.002870673080906272,
-0.18015465140342712,
-0.007102231495082378,
0.2528402805328369,
0.1364414244890213,
0.112045519053936,
-0.031111087650060654,
0.01055225171148777,
-0.06639975309371948,
-0.3406798839569092,
-0.1157272458076477,
0.15310941636562347,
0.05389202758669853,
0.20235861837... | |
A simple expression like
```
(x) - y
```
is interpreted differently depending on whether `x` is a type name or not. If `x` is not a type name, `(x) - y` just subtracts `y` from `x`. But if `x` is a type name, `(x) - y` computes the negative of `y` and casts the resulting value to type `x`.
In a typical C or C++ com... | [
0.17269128561019897,
0.20958387851715088,
0.02679063193500042,
-0.01775471121072769,
-0.24449186027050018,
-0.1557091921567917,
0.2536056637763977,
-0.11282848566770554,
0.24077600240707397,
-0.23276489973068237,
-0.563642680644989,
0.5755018591880798,
-0.4315575957298279,
0.01357639115303... | |
levels was the nastiest part of the design of C.)
But in Java, `x` may not be defined until later in the source code. How does a Java compiler disambiguate such an expression?
It's clear that a Java compiler needs multiple passes, since Java doesn't require declaration-before-use. But that seems to imply that the fi... | [
0.4425457715988159,
0.3307306468486786,
0.1661878079175949,
0.2912009060382843,
-0.03673935309052467,
-0.15460112690925598,
0.6180680394172668,
-0.16520865261554718,
-0.035570889711380005,
-0.5310118794441223,
0.05700171738862991,
0.5690051913261414,
-0.18387189507484436,
-0.04691565036773... | |
needed to check the formal spec of the syntax for type casts.
The ambiguity is caused by `+` and `-` being both unary and binary operators. Java solves the problem by this grammar:
```
CastExpression:
( PrimitiveType Dimsopt ) UnaryExpression
( ReferenceType ) UnaryExpressionNotPlusMinus
```
(see <h... | [
0.13763654232025146,
0.38275301456451416,
0.1835692822933197,
-0.414605051279068,
-0.1434199959039688,
-0.07743930071592331,
0.31175100803375244,
-0.30904558300971985,
0.13070887327194214,
-0.1720520406961441,
-0.41559895873069763,
0.39189088344573975,
-0.4207707345485687,
0.01573645323514... | |
I'm trying to deserialize an array of an type unknown at compile time. At runtime I've discovered the type, but I don't know how to create an instance.
Something like:
```
Object o = Activator.CreateInstance(type);
```
which doesn't work because there is no parameterless constructor, Array doesn't seem to have any ... | [
0.271041601896286,
0.1412661224603653,
0.04036542400717735,
-0.09776704013347626,
-0.14382506906986237,
-0.08765522390604019,
0.29289665818214417,
-0.25926873087882996,
-0.2514709234237671,
-0.7967240214347839,
0.012850827537477016,
0.34978556632995605,
-0.5875846147537231,
0.3238696455955... | |
I'm having a rather perplexing problem with the Escape key handler on a dialog box in Borland C++ Builder 5. Are there any other requirements for the Escape key to fire a cancel event (other than those I've listed below)?
1. The "Cancel" button (a TBitBtn) has its Cancel property set to true.
2. The "Cancel" button ha... | [
0.25246402621269226,
0.08590631186962128,
0.18038399517536163,
-0.12175223976373672,
0.07034827023744583,
-0.28076985478401184,
0.607459306716919,
-0.37984681129455566,
0.0371689647436142,
-0.33628758788108826,
-0.19430358707904816,
0.7897328734397888,
-0.5073593854904175,
-0.1621738523244... | |
of life maintenance.
**Update**
Four months later I've finally stopped scratching my head...it turns out that the parent form for the application had a run-time OnShortCut handler defined. I just needed to disable that for the Esc handler to work on the child dialog.
You should check all possible ways the cancel even... | [
0.5382646322250366,
0.21052011847496033,
0.8576856851577759,
0.03059869445860386,
0.4140169024467468,
-0.14919650554656982,
0.6477831602096558,
0.019569816067814827,
-0.13020065426826477,
-0.3219815194606781,
0.02130160480737686,
0.6344422698020935,
-0.07943505793809891,
0.1980224847793579... | |
If you still don't find the problem, check if another component has its ShortCut property set to handle the escape key.
5. Also check if there are any keyboard hooks active. | [
0.08073468506336212,
-0.27554255723953247,
0.1932358294725418,
0.06090383976697922,
0.29305195808410645,
-0.06337832659482956,
0.5510637760162354,
-0.2725081145763397,
-0.21951924264431,
-0.48923826217651367,
-0.1721210479736328,
0.9908692836761475,
0.07164640724658966,
-0.2704669833183288... | |
I would like to customize both the background and the border color of a grouped-style UITableView.
I was able to customize the background color by using the following:
```
tableView.contentView.backgroundColor = [UIColor greenColor];
```
But the border color is still something I don't know how to change.
How do I ... | [
0.19026467204093933,
-0.17954131960868835,
0.6623581647872925,
-0.10127879679203033,
0.03617384284734726,
-0.014469928108155727,
0.16999951004981995,
-0.02868352271616459,
-0.31206777691841125,
-0.5158808827400208,
0.05747811496257782,
0.6880547404289246,
-0.2671354413032532,
-0.2744752466... | |
how I did this when I had to do it:
You need to set the UITableViewCell's backgroundView property to a custom UIView that draws the border and background itself in the appropriate colors. This view needs to be able to draw the borders in 4 different modes, rounded on the top for the first cell in a section, rounded on... | [
0.3530345559120178,
-0.20403382182121277,
0.8142186999320984,
0.0998099148273468,
0.028853001073002815,
0.1025283932685852,
0.17322313785552979,
-0.22314244508743286,
-0.176009401679039,
-0.8242393732070923,
0.2013268917798996,
0.08480618894100189,
-0.2892613708972931,
0.18579904735088348,... | |
set automatically, so I had to set it in the UITableViewDataSource's -cellForRowAtIndexPath method.
It's a real PITA but I've confirmed with Apple engineers that this is currently the only way.
**Update** Here's the code for that custom bg view. There's a drawing bug that makes the rounded corners look a little funny... | [
0.5083783268928528,
0.0420074537396431,
0.39723604917526245,
0.07014405727386475,
-0.0552758052945137,
0.1666497141122818,
0.1796683520078659,
-0.16481533646583557,
-0.35150885581970215,
-0.8398462533950806,
-0.197423055768013,
0.2987399101257324,
-0.4816839396953583,
-0.12241768091917038,... | |
CustomCellBackgroundViewPositionTop,
CustomCellBackgroundViewPositionMiddle,
CustomCellBackgroundViewPositionBottom,
CustomCellBackgroundViewPositionSingle
} CustomCellBackgroundViewPosition;
@interface CustomCellBackgroundView : UIView {
UIColor *borderColor;
UIColor *fillColor;
CustomCellBa... | [
0.2341976761817932,
-0.2941698729991913,
0.7637069821357727,
0.0854467824101448,
0.045556388795375824,
0.32666298747062683,
0.23198750615119934,
-0.5936895608901978,
-0.38224396109580994,
-0.5288690328598022,
0.019182877615094185,
0.639647364616394,
-0.10212721675634384,
0.3865549862384796... | |
float ovalWidth,float ovalHeight);
@implementation CustomCellBackgroundView
@synthesize borderColor, fillColor, position;
- (BOOL) isOpaque {
return NO;
}
- (id)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
// Initialization code
}
return self;
}
- (void)drawRect:(C... | [
0.07385838776826859,
-0.21415330469608307,
0.8974044322967529,
-0.1512744277715683,
0.013992588967084885,
0.29699066281318665,
0.08023109287023544,
-0.7144315242767334,
-0.12935635447502136,
-0.45114150643348694,
0.11860313266515732,
0.6062883138656616,
-0.2303089052438736,
0.0393339991569... | |
CGContextBeginPath(c);
CGContextMoveToPoint(c, 0.0f, rect.size.height - 10.0f);
CGContextAddLineToPoint(c, 0.0f, rect.size.height);
CGContextAddLineToPoint(c, rect.size.width, rect.size.height);
CGContextAddLineToPoint(c, rect.size.width, rect.size.height - 10.0f);
CGContextStrok... | [
0.007236307021230459,
-0.2724020481109619,
0.8396633863449097,
-0.06260696798563004,
0.2631353437900543,
0.12815263867378235,
0.07752716541290283,
0.03581800311803818,
-0.21704885363578796,
-0.35151323676109314,
-0.16291505098342896,
0.6364306807518005,
0.03578777238726616,
0.2896441221237... | |
CGContextBeginPath(c);
CGContextMoveToPoint(c, 0.0f, 10.0f);
CGContextAddLineToPoint(c, 0.0f, 0.0f);
CGContextStrokePath(c);
CGContextBeginPath(c);
CGContextMoveToPoint(c, rect.size.width, 0.0f);
CGContextAddLineToPoint(c, rect.size.width, 10.0f);
CGContextStrokeP... | [
0.025673819705843925,
-0.30330362915992737,
0.7818387150764465,
-0.14455363154411316,
0.2629927098751068,
0.24920308589935303,
0.05510339513421059,
-0.051869265735149384,
-0.2642655074596405,
-0.3872087597846985,
-0.1406523585319519,
0.6910547018051147,
0.0036355480551719666,
0.22328412532... | |
CGContextBeginPath(c);
CGContextMoveToPoint(c, 0.0f, 0.0f);
CGContextAddLineToPoint(c, 0.0f, rect.size.height);
CGContextAddLineToPoint(c, rect.size.width, rect.size.height);
CGContextAddLineToPoint(c, rect.size.width, 0.0f);
CGContextStrokePath(c);
return; // no need to ... | [
0.11873742192983627,
-0.050482213497161865,
0.9854442477226257,
0.0008708458626642823,
0.0866977795958519,
0.18193520605564117,
-0.278751403093338,
-0.06606511771678925,
-0.13716436922550201,
-0.4551142454147339,
0.08438142389059067,
0.8189213871955872,
0.15777629613876343,
-0.011211477220... | |
we fill and stroke a rounded rect taking the entire rect
CGContextBeginPath(c);
addRoundedRectToPath(c, rect, 10.0f, 10.0f);
CGContextFillPath(c);
CGContextSetLineWidth(c, 1);
CGContextBeginPath(c);
addRoundedRectToPath(c, rect, 10.0f, 10.0f);
CGContextStrokePath(c);
}
- (void)deal... | [
0.0913025289773941,
-0.2929828464984894,
1.183930516242981,
-0.2565028667449951,
0.1972988396883011,
0.18189333379268646,
-0.04650988429784775,
-0.3929726183414459,
0.09836886078119278,
-0.48778921365737915,
-0.14107994735240936,
0.7510970234870911,
-0.3739693760871887,
-0.1019476950168609... | |
float ovalWidth,float ovalHeight)
{
float fw, fh;
if (ovalWidth == 0 || ovalHeight == 0) {// 1
CGContextAddRect(context, rect);
return;
}
CGContextSaveGState(context);// 2
CGContextTranslateCTM (context, CGRectGetMinX(rect),// 3
CGRectGetMinY(rect));
... | [
-0.09730171412229538,
-0.17865808308124542,
0.7879343032836914,
-0.0026424978859722614,
0.16945502161979675,
0.265537828207016,
-0.20036272704601288,
-0.4957767128944397,
0.030385509133338928,
-0.2018308937549591,
-0.03601302206516266,
0.6305989623069763,
-0.12191879004240036,
0.1877991408... | |
= CGRectGetWidth (rect) / ovalWidth;// 5
fh = CGRectGetHeight (rect) / ovalHeight;// 6
CGContextMoveToPoint(context, fw, fh/2); // 7
CGContextAddArcToPoint(context, fw, fh, fw/2, fh, 1);// 8
CGContextAddArcToPoint(context, 0, fh, 0, fh/2, 1);// 9
CGContextAddArcToPoint(context, 0, 0, fw/2, 0, 1);//... | [
-0.1109582930803299,
0.22973878681659698,
0.8044425249099731,
-0.06839815527200699,
0.12169045954942703,
0.22190077602863312,
-0.08597033470869064,
-0.14879602193832397,
-0.3021072447299957,
-0.4974781274795532,
-0.14055582880973816,
0.6613739132881165,
0.031359218060970306,
0.231720507144... | |
I want all buttons to perform an action before and after their normal onclick event. So I came up with the "brilliant" idea of looping through all those elements and creating a wrapper function.
This appeared to work pretty well when I tested it, but when I integrated it into our app, it fell apart. I traced it down t... | [
0.31217315793037415,
-0.4155808985233307,
0.3405138850212097,
-0.1491849273443222,
0.332998663187027,
0.2171170711517334,
-0.049919866025447845,
-0.3621174395084381,
-0.25702768564224243,
-0.07599557936191559,
0.16412028670310974,
0.3674828112125397,
-0.4304857552051544,
-0.022391829639673... | |
'Form1' if you run it from within a form.
Does anybody know either a better way to do the same thing? Or a good way to maintain the originally intended 'this' values?
As you can imagine, I don't want to modify any of the existing event handler code in the target buttons.
Thanks in advance.
PS-The target browser is ... | [
0.27712658047676086,
-0.4407077133655548,
0.7669529914855957,
-0.29001274704933167,
-0.10943719744682312,
-0.46508562564849854,
0.08946099132299423,
-0.2744399607181549,
-0.2930474281311035,
-0.7511746883392334,
-0.5321709513664246,
0.23720233142375946,
-0.5375039577484131,
-0.433755517005... | |
var i = 0; i < btns.length; i++)
{
var btn = btns[i];
// handle wrap button differerntly
if( "btnWrap" == btn.id)
{
btn.disabled = true; | [
0.22347521781921387,
-0.21021458506584167,
0.3553057312965393,
-0.4571077227592468,
0.15930849313735962,
0.3064632713794708,
0.3823128342628479,
-0.7390022277832031,
-0.12442692369222641,
-0.28711551427841187,
-0.4015151262283325,
0.3916695713996887,
-0.20244139432907104,
0.255378365516662... | |
continue; // skip this button
}
// wrap it
var originalEventHandler = btn.onclick;
btn.onclick = function()
{
alert("Starting event handler"); | [
0.28161734342575073,
-0.5664116144180298,
0.45824703574180603,
-0.30279916524887085,
0.6618337631225586,
-0.04124406352639198,
0.5566155910491943,
-0.20595677196979523,
-0.23483993113040924,
-0.08478352427482605,
-0.6194169521331787,
0.28325673937797546,
-0.3776206970214844,
0.139929875731... | |
originalEventHandler();
alert("Finished event handler");
}
}
alert("Buttons wrapped successfully");
}
</script>
<body>
<p>
<button id="TestButton1" onclick="alert(this.id);">TestButton1</button>
<button id="TestButton2" onclick="alert(this.id);">TestButton2</... | [
0.3010757267475128,
-0.2972647249698639,
0.16511660814285278,
-0.09578268975019455,
0.11512871831655502,
0.20421600341796875,
0.3209676444530487,
-0.703855037689209,
-0.44203391671180725,
-0.43644848465919495,
-0.3310605585575104,
0.17932577431201935,
-0.43067431449890137,
-0.0754998922348... | |
but I suggest you use [apply](http://msdn.microsoft.com/en-us/library/4zc42wh1(VS.85).aspx) instead.
However, the reason I am answering is that I found a disturbing bug: **You are actually replacing all your event handlers with the event handler of the last button.** I don't think that was what you intended, was it? (... | [
0.42657798528671265,
0.012052805162966251,
0.41690099239349365,
-0.15597334504127502,
0.19125588238239288,
-0.13495460152626038,
0.530204713344574,
-0.2750870883464813,
-0.2999107241630554,
-0.7501986622810364,
-0.36447176337242126,
0.4508105218410492,
-0.5850428342819214,
0.12523111701011... | |
btns[i];
// handle wrap button differerntly
if( "btnWrap" == btn.id)
{
btn.disabled = true;
continue; // skip this button
}
// wrap it
var newOnClick = function()
{ | [
0.23597626388072968,
-0.34546488523483276,
0.4428177773952484,
-0.38131213188171387,
0.20619696378707886,
0.27319619059562683,
0.381974995136261,
-0.6236424446105957,
-0.3200117349624634,
-0.37209635972976685,
-0.19573718309402466,
0.22671851515769958,
-0.31639212369918823,
0.2283352166414... | |
alert("Starting event handler");
var src=arguments.callee;
src.original.apply(src.source,arguments);
alert("Finished event handler");
}
newOnClick.original = btn.onclick; // Save original onClick
newOnClick.source = btn; // Save source for "this"
btn.o... | [
-0.04772067442536354,
-0.20141810178756714,
0.37989598512649536,
-0.37141066789627075,
0.24616998434066772,
0.07293641567230225,
0.24320775270462036,
-0.2482520341873169,
-0.2683957815170288,
-0.293992280960083,
-0.6161038875579834,
0.4096386730670929,
-0.38409802317619324,
0.1237651407718... | |
new handler
}
alert("Buttons wrapped successfully");
}
```
First I create a new anonymous function and store that in the variable *newOnClick*. Since a function is an object I can create properties on the function object like any other object. I use this to create the property *original* that is the original oncl... | [
0.2774325907230377,
-0.20185165107250214,
0.24717411398887634,
-0.1173243299126625,
0.019243905320763588,
-0.12233944982290268,
0.11331780254840851,
-0.47428134083747864,
-0.15724122524261475,
-0.7113272547721863,
0.0287006925791502,
0.6782659292221069,
-0.49074676632881165,
0.113922223448... | |
have a name I use use [arguments.callee](http://msdn.microsoft.com/en-us/library/s4esdbwz(VS.85).aspx) (that has been supported since MSIE5.5) to get that reference and store it in variable src.
Then I use the method *apply* to execute the original onclick handler. *apply* takes two parameters: the first is going to b... | [
0.289878249168396,
-0.01809524931013584,
0.6980898380279541,
-0.38765695691108704,
0.02745499461889267,
-0.19971595704555511,
0.29135197401046753,
-0.48016396164894104,
0.21995295584201813,
-0.25902408361434937,
-0.08299161493778229,
0.37977442145347595,
-0.4602595567703247,
0.409802645444... | |
don't have any parameters specified, but if it is called with some parameters anyway, they will be found in the *arguments* property).
The reason I use *apply* is that I can forward all the arguments that the anonymous function was called with, and this makes this function transparent and cross-browser. (Microsoft put... | [
0.3199182152748108,
0.04782178997993469,
0.3105359673500061,
-0.1991422474384308,
-0.32352879643440247,
-0.09111195057630539,
0.31846487522125244,
-0.13762754201889038,
-0.13299737870693207,
-0.6211549639701843,
0.048530202358961105,
0.6524300575256348,
-0.3642246723175049,
-0.007970239035... | |
I have a sublayer on a layer-backed view. The sublayer's contents are set to an Image Ref and is a 25x25 rect.
I perform a hit test on the super layer when the touchesBegan and touchesMoved methods are invoked. The hit test method does, in fact, return the sublayer if it is touched, BUT only if the bottom half of th... | [
-0.009734286926686764,
-0.0771406888961792,
0.8114767074584961,
-0.03710271790623665,
-0.15624181926250458,
0.14437606930732727,
0.3780893087387085,
-0.300939679145813,
-0.040078792721033096,
-0.686650276184082,
-0.018297716975212097,
0.5105152726173401,
-0.06263744086027145,
-0.0600371249... | |
the sublayer to a larger size, 50x50, it exhibits the same behavior.
Any thoughts?
Thanks Kevin...
I ended up just redoing my code with UIViews. It was too much trouble just trying to figure out why the UIView didn't know what layer was being touched. My whole reasoning behind the idea was that I will have a 100+ ite... | [
0.6688094139099121,
-0.20791742205619812,
0.5519109964370728,
0.26066237688064575,
-0.13026300072669983,
0.06187048554420471,
0.19477830827236176,
-0.1563611924648285,
-0.4071422219276428,
-0.853287398815155,
0.31087714433670044,
0.457002729177475,
-0.13875152170658112,
-0.0032225982286036... | |
possible, it makes the code much simpler | [
0.35974863171577454,
0.26816675066947937,
-0.062256865203380585,
0.30010369420051575,
0.003558480180799961,
0.010189399123191833,
0.297785222530365,
-0.021825814619660378,
-0.09852299094200134,
-0.5504869222640991,
-0.23676328361034393,
0.3231743574142456,
-0.04442805051803589,
-0.17180557... | |
Is there a difference between "GO" and "BEGIN...END" in SQL Scripts/Stored Procedures? More specifically, does BEGIN...END specify batches just as GO does?
GO is not actually a command understood by the server. It is simply a delimiter used by the client tool, e.g. Query Analyzer, to split the SQL up into batches. Each... | [
0.3101150691509247,
-0.18453742563724518,
0.11355528980493546,
-0.10963909327983856,
-0.17971362173557281,
0.010321574285626411,
-0.03399377688765526,
-0.006615140940994024,
-0.21551382541656494,
-0.2878693640232086,
-0.33106693625450134,
0.14783106744289398,
-0.2677576541900635,
0.2111330... | |
languages. | [
0.37265193462371826,
0.20164823532104492,
-0.02911103144288063,
-0.3852114975452423,
0.3268015384674072,
0.6537594199180603,
0.09886165708303452,
0.5009925365447998,
-0.1839192509651184,
-0.7462358474731445,
-0.25929126143455505,
0.5009007453918457,
0.06343168020248413,
-0.0337859578430652... | |
I want to split up the jQuery .js file into two, but I have noticed some of the features arent working when I split it up. Is it because I have two external scripts that start with:
$(document).ready(function(){
Is that not possible?
Yes, you can have two scripts that both set `$(document).ready(...).` | [
0.34154805541038513,
-0.21190328896045685,
0.053119055926799774,
-0.010275562293827534,
0.3100743889808655,
-0.009764805436134338,
-0.008707906119525433,
-0.14036749303340912,
-0.033935174345970154,
-0.688434362411499,
-0.16042883694171906,
0.7285769581794739,
-0.3073933720588684,
-0.03888... | |
What's the best method for handling a situation where you have an ASP.Net Dropdownlist that is used to link to another URL
*edited for clarity*
Here's the basic scenario:
Dropdownlist with 5 cities bound to it
Selecting one of the cities should send me to a URL based on the city
Right now I am posting back using t... | [
-0.19161656498908997,
-0.28944268822669983,
0.5587967038154602,
0.27199655771255493,
-0.2982611060142517,
-0.06635262072086334,
0.3377379775047302,
-0.0032443522941321135,
-0.13195864856243134,
-0.848779022693634,
0.12829433381557465,
0.17306092381477356,
-0.08064936846494675,
-0.264587640... | |
option?
You can add a client-side handler for the selection changed event and then redirect to the desired page based on the selected value:
```
<asp:DropDownList ID="ddl" runat="server"
onchange="document.location.href = this.value;" >
<asp:ListItem Text="a" Value="http://url1"></asp:ListItem>
<asp:ListItem... | [
0.02220487967133522,
-0.6144589185714722,
0.5086970329284668,
0.12170962989330292,
0.07613218575716019,
0.29537302255630493,
0.06590209901332855,
-0.1967082917690277,
-0.3340761065483093,
-0.569528341293335,
-0.423540323972702,
0.6489109396934509,
-0.33218517899513245,
-0.13535308837890625... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.