text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
= c.TABLE_CATALOG AND t.TABLE_SCHEMA = c.TABLE_SCHEMA AND t.TABLE_NAME = c.TABLE_NAME
[ -0.3082002103328705, 0.444560706615448, 0.2775129973888397, -0.10228937864303589, 0.11015617847442627, 0.013696893118321896, -0.2716941833496094, -0.15289455652236938, -0.4580034017562866, -0.4684734046459198, -0.31393489241600037, 0.22774744033813477, -0.22373101115226746, 0.0805324390530...
WHERE t.TABLE_TYPE = 'BASE TABLE' AND c.DATA_TYPE IN ('char','nchar','varchar','nvarchar') GROUP
[ -0.41211143136024475, 0.13563895225524902, 0.1412080079317093, -0.018248040229082108, 0.10973239690065384, 0.2262682467699051, -0.040893591940402985, -0.35027962923049927, 0.04384627565741539, -0.17835083603858948, -0.2619118392467499, 0.18089507520198822, -0.33648356795310974, 0.219734430...
BY t.TABLE_CATALOG , t.TABLE_SCHEMA ,
[ -0.25183528661727905, 0.392062783241272, 0.12396226078271866, 0.04325221851468086, 0.3549502491950989, 0.06886816769838333, -0.26863688230514526, -0.11192700266838074, -0.7271531820297241, -0.6083738207817078, -0.3348881006240845, -0.07216086238622665, -0.309269517660141, 0.052303034812211...
t.TABLE_NAME ) x JOIN ( SELECT t.TABLE_CATALOG ,
[ -0.23338766396045685, 0.008273830637335777, 0.25198894739151, 0.1910979300737381, 0.23029740154743195, -0.11772886663675308, -0.19087594747543335, 0.021687479689717293, -0.3148185610771179, -0.6754693388938904, -0.28184714913368225, 0.06781161576509476, -0.5221502184867859, 0.3745905160903...
t.TABLE_SCHEMA , t.TABLE_NAME , c.COLUMN_NAME
[ -0.2767524719238281, 0.3107621967792511, 0.46531274914741516, 0.03631632402539253, 0.01508653536438942, 0.18832510709762573, -0.3083932101726532, -0.024713218212127686, -0.46846604347229004, -0.5106679201126099, -0.16554175317287445, -0.04879168048501015, -0.4393167495727539, 0.30707210302...
, QUOTENAME(c.COLUMN_NAME) + ' = LTRIM(RTRIM(' + QUOTENAME(c.COLUMN_NAME) + '))' SQL FROM INFORMATION_SCHEMA.TABLES t
[ 0.11224059015512466, -0.1346816122531891, 0.6824347972869873, -0.15084359049797058, 0.03210809454321861, -0.014431875199079514, 0.015967631712555885, -0.352285236120224, -0.1716548651456833, -0.16089487075805664, -0.25025174021720886, 0.7729812264442444, -0.3151848018169403, 0.043337117880...
JOIN INFORMATION_SCHEMA.COLUMNS c ON t.TABLE_CATALOG = c.TABLE_CATALOG AND t.TABLE_SCHEMA = c.TABLE_SCHEMA
[ -0.19477029144763947, 0.32936957478523254, 0.5710664391517639, -0.005939382128417492, 0.08993290364742279, 0.09752033650875092, -0.16402903199195862, -0.28956639766693115, -0.32358163595199585, -0.5802014470100403, -0.12659858167171478, -0.058050088584423065, -0.6454645395278931, 0.2292207...
AND t.TABLE_NAME = c.TABLE_NAME WHERE t.TABLE_TYPE = 'BASE TABLE'
[ -0.1602930724620819, 0.3824560046195984, 0.29482585191726685, -0.12801241874694824, 0.22185641527175903, -0.05211935192346573, -0.3859311044216156, -0.08262603729963303, -0.273006796836853, -0.29867735505104065, -0.26668766140937805, 0.12476722151041031, -0.3563128113746643, 0.159744948148...
AND c.DATA_TYPE IN ('char','nchar','varchar','nvarchar') ) y ON x.TABLE_CATALOG = y.TABLE_CATALOG AND x.TABLE_SCHEMA = y.TABLE_SCHEMA
[ -0.43122532963752747, 0.3494570255279541, 0.34477320313453674, 0.028071971610188484, 0.08980614691972733, 0.22726121544837952, -0.16228900849819183, -0.19623269140720367, -0.11188285052776337, -0.19414447247982025, -0.3423962891101837, 0.16760268807411194, -0.3338206708431244, 0.1823917329...
AND x.TABLE_NAME = y.TABLE_NAME ) x ORDER BY x.TABLE_CATALOG , x.TABLE_SCHEMA , x.TABLE_NAME , x.SORT ,
[ -0.5240517854690552, 0.3946872055530548, 0.6376129388809204, -0.028153279796242714, -0.010061467066407204, 0.14335770905017853, -0.09371118247509003, -0.32430702447891235, -0.42229771614074707, -0.4532375931739807, -0.5361971855163574, 0.01968790777027607, -0.42174506187438965, 0.291892975...
x.SQL ```
[ 0.2684336304664612, 0.4617249071598053, 0.2731670141220093, 0.22889405488967896, -0.2800767719745636, -0.5468826293945312, -0.048720575869083405, 0.2784368097782135, 0.29259002208709717, -0.5038920640945435, -0.16320784389972687, 0.42593666911125183, -0.5433507561683655, 0.2919166982173919...
For instance. I have some structure: ``` s_Some{ std::string lable; s_some_junk some_junk; }; ``` And a vector: ``` std::vector<s_Some> mSome; ``` And then I fill this vector with a lot of s\_Somes. I need to find an iterator for a single s\_Some in this vector, which has a specific lable. So far I just ite...
[ 0.041501209139823914, -0.06462706625461578, 0.13438095152378082, 0.06700979173183441, -0.03208264335989952, 0.15627722442150116, -0.02588508464396, 0.09660003334283829, -0.4003979563713074, -0.8213992714881897, -0.03750362992286682, 0.35836026072502136, -0.3743457496166229, 0.1703016459941...
and use the binary search. The only cost would be the sorting then and there will be no additional overhead. Searching time is logarithmic O(logN). Option 2) If you have the freedom and can choose different data structure, then consider using the map (also logarithmic) or unordered\_map ( expected O(1), worst O(n) ). ...
[ -0.19169022142887115, -0.23931246995925903, 0.14012399315834045, 0.17720620334148407, 0.0951869934797287, -0.044678691774606705, 0.09835340827703476, -0.2755512297153473, -0.4458005130290985, -0.9229407906532288, -0.3061639368534088, 0.49757492542266846, -0.26732301712036133, 0.10437700897...
In .NET why is `String.Empty` read only instead of a constant? I'm just wondering if anyone knows what the reasoning was behind that decision. The reason that `static readonly` is used instead of `const` is due to use with unmanaged code, as indicated by Microsoft here in the [Shared Source Common Language Infrastructu...
[ 0.1217643991112709, -0.20092016458511353, 0.10282783955335617, -0.0005210114177316427, -0.14822307229042053, -0.43828147649765015, 0.241709366440773, 0.21860212087631226, -0.22866378724575043, -0.5903551578521729, -0.1819368153810501, 0.24014097452163696, -0.5272071957588196, 0.06517853587...
that it doesn't show up as a field > which we can access from native. I found this information from [this handy article at CodeProject](http://www.codeproject.com/KB/dotnet/StringEmpty.aspx).
[ 0.3558807075023651, -0.2033345103263855, -0.03482730686664581, 0.03931417688727379, 0.09709882736206055, -0.04248126596212387, 0.12647104263305664, 0.3301975131034851, -0.2745070159435272, -0.2940230071544647, -0.2037610560655594, 0.2334289848804474, -0.2494497001171112, 0.0787782818078994...
If I have an array in Javascript that has been filled sporadically, how do I determine the number of non-nothing elements in the array? for example: ``` var zipCodes = []; zipCodes[10006] = 'New York, NY'; zipCodes[90210] = 'Los Angeles, CA'; ``` zipCodes.length returns 90,211 here and I really don't want to loop t...
[ 0.494182825088501, -0.19375386834144592, 0.016636157408356667, -0.10572944581508636, 0.1506829559803009, 0.07586217671632767, 0.39431577920913696, -0.1966829150915146, -0.46083515882492065, -0.6637306809425354, -0.06880971044301987, -0.15558382868766785, -0.3710979223251343, 0.082332462072...
elements? You would need an object with key-value pairs (kind of like an associative array / hashtable) instead of an array: ``` var zipCodes = {}; zipCodes[10006] = 'New York, NY'; zipCodes[90210] = 'Los Angeles, CA'; for(var zipCode in zipCodes) { if(zipCodes.hasOwnProperty(zipCode)) {//makes sure prototypes ar...
[ 0.4657267928123474, -0.21577809751033783, 0.2753240168094635, 0.09239412844181061, 0.3568214774131775, 0.3177981674671173, 0.0486082062125206, -0.4776831269264221, -0.3306303322315216, -0.5572518706321716, -0.06701873987913132, -0.19421449303627014, -0.5175340175628662, -0.0172726474702358...
How do you do a query of an LDAP store by sAMAccountName and Domain? What is the "domain" property named in Active Directory or LDAP terms? This is what I have for the filter so far. I'd like to be able to add in the domain: ``` (&(objectCategory=Person)(sAMAccountName=BTYNDALL)) ``` First, modify your search filter...
[ 0.08752337843179703, 0.07960361987352371, 0.41960638761520386, 0.0528571642935276, -0.07796464115381241, -0.14331409335136414, 0.20812129974365234, -0.24600963294506073, -0.30417314171791077, -0.7719679474830627, 0.09434645622968674, 0.5213770866394043, -0.567286491394043, -0.0601588040590...
past: ``` Set objRootDSE = GetObject("LDAP://RootDSE") AdComm.Properties("Sort on") = "name" AdComm.CommandText = "<LDAP://cn=Partitions," & _ objRootDSE.Get("ConfigurationNamingContext") & ">;" & _ "(&(objectcategory=crossRef)(systemFlags=3));" & _ "name,nCName,dnsRoot;onelevel" set AdRs = AdC...
[ -0.3110138773918152, -0.08532208949327469, 0.7768404483795166, -0.13777002692222595, 0.2370305359363556, 0.07359355688095093, 0.2239730954170227, -0.46436676383018494, -0.3205392062664032, -0.7542445659637451, -0.4548845887184143, 0.3078452944755554, -0.2798481285572052, 0.6015797853469849...
Wend End With ```
[ 0.047469522804021835, 0.44368237257003784, 0.35023295879364014, -0.07380696386098862, -0.5833978652954102, -0.06488365679979324, 0.15821227431297302, 0.1961107850074768, 0.11637815088033676, -0.475650817155838, -0.30540725588798523, 0.3226359784603119, 0.24246013164520264, 0.16440790891647...
How can I configure JPA/Hibernate to store a date/time in the database as UTC (GMT) time zone? Consider this annotated JPA entity: ``` public class Event { @Id public int id; @Temporal(TemporalType.TIMESTAMP) public java.util.Date date; } ``` If the date is 2008-Feb-03 9:30am Pacific Standard Time (...
[ 0.27249935269355774, -0.2408827394247055, 0.36790040135383606, 0.21290706098079681, -0.013178911060094833, 0.013608011417090893, 0.22412489354610443, 0.16536203026771545, -0.2564159631729126, -0.3316099941730499, -0.11351753026247025, 0.33922868967056274, 0.18896043300628662, 0.32239678502...
Hibernate 5.2, you can now force the UTC time zone by adding the following configuration property into the `properties.xml` JPA configuration file: ``` <property name="hibernate.jdbc.time_zone" value="UTC"/> ``` If you're using Spring Boot, then add this property to your `application.properties` file: ``` spring.jp...
[ 0.04845762997865677, -0.24078784883022308, 0.7072838544845581, -0.1989239752292633, 0.06622704118490219, -0.2739872932434082, 0.4031756520271301, -0.27599525451660156, -0.046138446778059006, -0.5909783244132996, -0.3729456067085266, 0.3891376852989197, -0.137727752327919, 0.274518907070159...
Is it possible on a web server to determine the users local time and timezone when they sent the request? Could it be done using javascript to capture it and post it back to the server? My company want to track how many users use our site outside of office hours (no I dont really know why either!). Thanks. You need...
[ 0.16228702664375305, 0.2613056004047394, 0.8631091117858887, 0.2389564961194992, 0.20715834200382233, 0.03342944011092186, 0.342984139919281, 0.0694899782538414, -0.3141273856163025, -0.6733179092407227, 0.20633019506931305, 0.34525540471076965, 0.27442243695259094, 0.13743367791175842, ...
I'm afraid that I already know the answer to my question, but I'll ask it anyway: When there are two MySQL DB servers, can I access data that is stored on the other server? In other words: Can I somehow do this: ``` INSERT INTO table (x, y, z) SELECT x, y, x+y FROM [otherserver].[database].[table] ``` Is...
[ 0.2986519932746887, -0.08061878383159637, 0.36329758167266846, -0.01086908858269453, -0.29635143280029297, 0.03710092976689339, -0.21356788277626038, -0.11846983432769775, -0.1809261292219162, -0.4002312123775482, 0.049204397946596146, 0.29713138937950134, -0.32881397008895874, 0.130033999...
Below is a sample implementation of overriding Object.Equals() for an entity base class from which all other entities in an application derive. All entity classes have the property Id, which is a nullable int. (It's the primary key of whatever table the entity class corresponds to.) ``` public override bool Equals(ob...
[ -0.2594693601131439, 0.1409800797700882, 0.42592746019363403, -0.07729700952768326, 0.14893493056297302, -0.22195160388946533, 0.43842339515686035, -0.4787628948688507, 0.23625950515270233, -0.29949143528938293, -0.22097180783748627, 0.6275871396064758, -0.5521373152732849, 0.1693292856216...
if (base.Equals(obj)) return true; return Id.HasValue && ((EntityBase) obj).Id.HasValue && Id.Value == ((EntityBase) obj).Id.Value; } ``` Given this implementation of Equals(), how do you correctly implement GetHashCode()? If you're deriving from something that ...
[ -0.09229613840579987, 0.13148324191570282, 0.6106851696968079, -0.2467229664325714, -0.002276445971801877, -0.2182052880525589, 0.34902992844581604, -0.7243672013282776, 0.27063503861427307, -0.3401087820529938, -0.10800424218177795, 0.41878706216812134, -0.3680044412612915, -0.01631368137...
{ int hash = 37; hash = hash * 23 + base.GetHashCode(); hash = hash * 23 + Id.GetHashCode(); return hash; } } ``` A null value of Id will return 0 for Id.GetHashCode(). If your class just derives from Object, I'd just return `Id.GetHashCode()` - you do *not* want to include the `o...
[ -0.03787419572472572, 0.07305777817964554, 0.20288170874118805, -0.12079238146543503, 0.05184854567050934, -0.1253596395254135, 0.490870863199234, -0.4155060350894928, -0.06584664434194565, -0.44970473647117615, -0.14327631890773773, 0.2764537036418915, -0.431627482175827, 0.10596581548452...
*won't* return `true` if neither entity has an Id, but the same hashcode will be returned from both objects. You may wish to consider changing your Equals implementation.
[ 0.30163338780403137, -0.030248230323195457, 0.0816478356719017, -0.058731406927108765, -0.03459201008081436, -0.169266015291214, 0.5216878056526184, -0.026017867028713226, 0.09387098997831345, -0.5126139521598816, -0.2116980403661728, 0.5028457045555115, -0.2774491608142853, 0.089534923434...
This isn't, I don't think, a standard svn ignore question. I have a repository with a huge directory in it that I don't want. Because others using the repository *do*, I can't just delete it from the tree. BUT, I don't want to redownload this directory every time I do a svn up. I can understand that ignore will preven...
[ 0.44082847237586975, 0.48301517963409424, 0.2428065985441208, -0.034097474068403244, -0.04908004030585289, -0.33793285489082336, -0.002462218515574932, -0.016986940056085587, -0.2970753312110901, -0.3162129819393158, 0.00996173731982708, 0.4340377151966095, -0.3705161213874817, 0.522573113...
I want to prevent that. Thanks! edit: OK. I was hoping that SVN had a built in option that I just hadn't noticed yet. I was hoping to avoid having to "hack" around subversion's inadequacies, but the options below seem like acceptable alternatives. edit again to address a couple of comments: > Is there particular re...
[ 0.4497738778591156, 0.15211018919944763, 0.05145811662077904, 0.04949157312512398, -0.08215785771608353, -0.25150033831596375, 0.5319081544876099, 0.10391099750995636, -0.4484596848487854, -0.44918832182884216, 0.05638986453413963, 0.5261127948760986, -0.29361820220947266, 0.11428632587194...
directory. Basically, some other people who have control over the repository (and therefore get to decide what goes in there) put a directory in there that really didn't need to be in there. I didn't mean for this to be a question about policy and the "proper & right" ways to use svn. I was just wondering if there was ...
[ 0.20509867370128632, 0.19167953729629517, 0.16806381940841675, 0.25710710883140564, 0.23745962977409363, -0.2633870840072632, 0.022759897634387016, 0.2054613083600998, -0.2369324415922165, -0.27386823296546936, -0.15529707074165344, 0.5076016783714294, -0.27460357546806335, 0.2450589388608...
dir 1 - plenty of subdirs in all of these directories - good dir 2 - good dir X - bad dir 1 - bad dir 2 - bad dir X - good file 1 - good file 2 - good file X ``` So I just came up with what I think is about the fastest answer to the question. Since SVN doesn't have a way to autoignore directories that I d...
[ -0.1809796392917633, 0.2583312392234802, 0.27894583344459534, -0.08338070660829544, -0.05323493853211403, 0.06181340292096138, 0.21510151028633118, 0.07245080173015594, 0.11259888112545013, -0.5189346075057983, -0.023921377956867218, 0.9469849467277527, -0.3751850426197052, 0.0108274770900...
up' from the root directory, because it tries to recheck out the bad directories. But, the following command works nicely: ``` ls | xargs svn up ``` Short, sweet, simple, and easy to remember.
[ 0.013283045962452888, 0.5126162767410278, 0.6021216511726379, -0.1874127984046936, -0.02168845385313034, 0.050482816994190216, 0.15940308570861816, 0.4556632936000824, -0.34820103645324707, -0.5134871006011963, -0.5670240521430969, 0.18302065134048462, -0.25718382000923157, 0.2360668182373...
I have a listview with 4 columns - Name, Extension, Size and Location. I have a method that takes the file size in bytes and converts to KB, MB, GB, etc as needed. An example output would be a 1024 byte file which is printed as "1KB". This value is then placed in the listview. What I need to do is sort the size column...
[ 0.13878384232521057, 0.27112916111946106, 0.5564691424369812, -0.15493319928646088, -0.2888510227203369, 0.2983655333518982, 0.0817464143037796, -0.21420486271381378, -0.49916893243789673, -0.8483612537384033, 0.11335236579179764, 0.13802379369735718, -0.05888233333826065, 0.30672320723533...
my code that generates the file size text: ``` public static string getDynamicFileSize(string fileName) { FileInfo fi = new FileInfo(fileName); long sizeInBytes = fi.Length; if (sizeInBytes >= 1073741824) { double sizeInGB = sizeInBytes / Math.Pow(1024, 3); ...
[ 0.22456903755664825, 0.030330225825309753, 0.8643325567245483, -0.18552044034004211, 0.3681890666484833, 0.15025115013122559, 0.21886830031871796, -0.3777361214160919, -0.1830068677663803, -0.49485260248184204, -0.31181764602661133, 0.7204358577728271, -0.0496133416891098, 0.25621005892753...
GB"; } if (sizeInBytes >= 1048576) { double sizeInMB = sizeInBytes / Math.Pow(1024, 2); return Math.Round(sizeInMB, 2) + " MB"; } if (sizeInBytes >= 1024) {
[ -0.2989674508571625, 0.28346797823905945, 0.5974782109260559, -0.47620680928230286, 0.08153046667575836, 0.45559072494506836, 0.20104247331619263, -0.2937226891517639, -0.554165244102478, -0.14031623303890228, -0.44955167174339294, 0.5936914682388306, -0.22775493562221527, 0.09828311204910...
double sizeInKB = sizeInBytes / Math.Pow(1024,1); return Math.Round(sizeInKB, 2) + " KB"; } //No conversion needed return sizeInBytes + " bytes"; } ``` Thank you. Most every object in .NET has a Tag member. This is a place where you can stuff anything extra you need to. In you...
[ 0.15726378560066223, -0.006432265508919954, 0.2723817527294159, -0.17552992701530457, -0.17446407675743103, -0.08592220395803452, 0.19585566222667694, -0.2182750701904297, -0.5581343770027161, -0.7023923397064209, -0.1069602370262146, 0.35641175508499146, -0.22302991151809692, 0.0511084869...
use that to sort by instead of the column text.
[ 0.11035427451133728, 0.3650936782360077, -0.28806203603744507, 0.1256095916032791, -0.011442582122981548, -0.1832144856452942, -0.1406778246164322, 0.1589018702507019, -0.17378394305706024, -0.5401708483695984, -0.16612689197063446, 0.11213639378547668, -0.20339177548885345, -0.19618609547...
How should I go about creating a UI similar to the Springboard (home screen) on the iPhone? I'd like a grid of evenly spaced buttons with images where I can respond to the button tap. Is the UITable a good fit? Should I use a plain UIView and position the icons manually in DrawRect? Is there an alternative that will a...
[ 0.30901575088500977, 0.06994076818227768, 0.517880916595459, -0.07929231971502304, 0.04724183306097984, 0.4701213836669922, 0.021643275395035744, -0.09436158835887909, -0.11485064029693604, -0.820546567440033, 0.20282882452011108, 0.6570739150047302, 0.007062068674713373, -0.16506600379943...
are UIViews of some sort) as subviews of your "Springboard" view. No custom drawing needed, and a UITable is thh absolute wrong way to go. You just need to do the math to place them correctly (by setting their frame).
[ 0.30794909596443176, -0.2420194298028946, 0.5051528811454773, 0.46573472023010254, -0.13166429102420807, -0.016282955184578896, 0.1274741142988205, -0.2075754702091217, -0.15506498515605927, -0.7595801949501038, 0.10256443917751312, 0.3490602970123291, 0.08723921328783035, -0.0943678840994...
I am new to Python and it seems to have a lot of nice functions that I don't know about. What function can I use to get the root site name? For example, how would I get *faqs.org* if I gave the function the URL "[http://www.faqs.org/docs/diveintopython/kgp\_commandline.html](http://ttp://www.faqs.org/docs/diveintopytho...
[ 0.30099958181381226, 0.20391549170017242, 0.34953293204307556, -0.25658944249153137, -0.22073429822921753, -0.29784122109413147, 0.25986436009407043, 0.14289328455924988, -0.3032662868499756, -0.547644853591919, -0.13388612866401672, 0.47030699253082275, -0.10350047796964645, 0.17057627439...
Given this C API declaration how would it be imported to C#? ``` const char* _stdcall z4LLkGetKeySTD(void); ``` I've been able to get this far: ``` [DllImport("zip4_w32.dll", CallingConvention = CallingConvention.StdCall, EntryPoint = "z4LLkGetKeySTD", ExactSpelling = false)] private exte...
[ 0.09732027351856232, -0.15017135441303253, 0.5802236795425415, -0.3201424479484558, 0.11817114055156708, -0.021545395255088806, 0.23631508648395538, -0.35431593656539917, 0.07386143505573273, -0.4861293435096741, -0.22475388646125793, 0.7973487973213196, -0.3997159004211426, 0.162030175328...
the result to a String by using Marshal.PtrToStringAnsi(). You will still need to free the memory for the IntPtr using the appropriate Marshal.Free\* method.
[ 0.03871285170316696, -0.07439883053302765, 0.24546176195144653, 0.17554855346679688, 0.3628486692905426, -0.37585893273353577, 0.49110665917396545, -0.5724905133247375, -0.08714421838521957, -0.3929094672203064, -0.27456486225128174, 0.5144791603088379, -0.17129716277122498, 0.053676832467...
Full disclosure: I'm very new to Ruby. The following code seems like it should update the para's text with the app's current dimensions as you resize it. ``` Shoes.app do stack do @para = para end animate 1 do @para.text = "%d x %d" % [ app.width, app.height] end end ...
[ 0.5984529256820679, 0.14107629656791687, 0.4584500789642334, -0.04497852548956871, -0.3808910548686981, 0.321226567029953, 0.6235083937644958, -0.817020833492279, -0.20429836213588715, -0.6713106632232666, 0.17041674256324768, 0.4773391783237457, -0.22650815546512604, -0.10273472964763641,...
the actual resize operation, but when you let go of the mouse it catches up. So, am I doing something wrong or is this just not implemented on OS X yet? I don't know Shoes well, but it looks like it's a problem with changing the app's dimensions. Your animation does update, but the width and height of the app don't upd...
[ 0.6355454325675964, -0.27878642082214355, 0.43382760882377625, -0.017223656177520752, 0.15092909336090088, 0.16854871809482574, 0.5438590049743652, -0.8662973642349243, -0.4898868203163147, -0.6304488182067871, 0.03283107653260231, 0.9143646359443665, -0.3827607035636902, -0.15997262299060...
|f| @para.text = "%d x %d #{f}" % [ app.width, app.height] end end ``` It further appears that other sample programs that come with Shoes don't work when you resize the window. simple-bounce.rb, which animates a bouncing ball with the Shoes logo, sticks to bouncing around in the original box, even upon re...
[ 0.8211361765861511, -0.03058941848576069, 0.253839910030365, -0.09278199821710587, 0.08345191925764084, -0.048573315143585205, 0.4309491217136383, -0.3247779905796051, -0.18101005256175995, -0.4793628454208374, -0.08006002008914948, 0.7709747552871704, -0.5954527854919434, 0.06854557991027...
Is there a character in JavaScript to break up a line of code so that it is read as continuous despite being on a new line? Something like.... ``` 1. alert ( "Please Select file 2. \ to delete" ); ``` In your example, you can break the string into two pieces: ``` alert ( "Please Select file" + " to delete"); ...
[ -0.10856340825557709, -0.3128305673599243, -0.009351401589810848, -0.1461411416530609, -0.1687367558479309, -0.11927174776792526, 0.13857360184192657, 0.01923133246600628, -0.5770359039306641, -0.12470421195030212, -0.3631366193294525, 0.39353877305984497, -0.4345073997974396, 0.1156792193...
It is *not* in the [ECMA 5.1 spec](http://www.ecma-international.org/ecma-262/5.1/#sec-7.8.4). When working with other code (not in quotes), line breaks are ignored, and perfectly acceptable. For example: ``` if(SuperLongConditionWhyIsThisSoLong && SuperLongConditionOnAnotherLine && SuperLongConditionOnThirdLineS...
[ -0.12721292674541473, -0.13948014378547668, 0.9853676557540894, 0.07270854711532593, 0.3163258731365204, -0.43608275055885315, 0.008283860981464386, 0.08945360034704208, -0.33792176842689514, -0.1146523654460907, -0.6233076453208923, 0.24160154163837433, -0.009488596580922604, -0.021740300...
My office is cursed with a very unreliable network. From time to time things just seem to stop working - the servers are all fine. We think the fault lies in the wires and routers between our computers. My team looks after a large number of Windows servers and workstations. Each PC runs a number of distributed applic...
[ 0.41391393542289734, 0.46092379093170166, 0.46796050667762756, 0.07772766053676605, 0.4223504662513733, -0.04552875831723213, 0.5013169050216675, 0.3869592547416687, -0.10996607691049576, -0.43776825070381165, 0.034112345427274704, 0.4734552502632141, -0.300961971282959, 0.2369474172592163...
that will let us judge the health of the network that connects all our servers together. Is there some application that would allow us to monitor the health of the network? Preferably this would be distributed amongst our machines so that we can look at the network from more than one perspective. I'd like to be able...
[ 0.5064387917518616, -0.18781782686710358, 0.1852148026227951, 0.29168713092803955, 0.3026576340198517, -0.13316963613033295, -0.17589524388313293, -0.03695126622915268, -0.2781374156475067, -0.6356649398803711, 0.18548832833766937, 0.6567643880844116, -0.25774237513542175, -0.0413683503866...
a string, as in your case, you can use a [backslash](http://www.nczonline.net/blog/2006/12/26/interesting-javascript-string-capability/) as @Gumbo suggested: ``` alert ( "Please Select file\ to delete"); ``` Note that this backslash approach is [not necessarily preferred](http://davidwalsh.name/multiline-javascript...
[ -0.019350508227944374, -0.13226822018623352, 0.6613594889640808, -0.15258339047431946, -0.09922744333744049, -0.39843565225601196, 0.3258018493652344, -0.009350648149847984, -0.5521938800811768, -0.07296895980834961, -0.6115534901618958, 0.3377159833908081, -0.32665786147117615, 0.01804747...
I have a query where i want to get a distinct description by the latest date entered and the descriptions ID. I can get the disctinct part but i run into trouble with trying to get the ID since im using MAX on the date. Here is the query: ``` SELECT DISTINCT Resource.Description, MAX(arq.DateReferred) AS DateReferred,...
[ -0.1070580706000328, -0.002841752488166094, 0.4515354335308075, -0.1312154084444046, -0.005683261901140213, 0.41860300302505493, 0.06050223857164383, -0.6941299438476562, -0.14714792370796204, -0.832371711730957, 0.02258792705833912, 0.36961829662323, 0.13902145624160767, 0.218868806958198...
Resource.Description, arq.AssessmentResourceID ORDER BY Resource.Description ``` Im sure its simple but im not seeing it. ``` SELECT Resource.Description, arq.DateReferred AS DateReferred, arq.AssessmentResourceID FROM Resource INNER JOIN AssessmentXResource AS arq ON arq.ResourceID = Res...
[ -0.33885303139686584, 0.29774096608161926, 0.16411073505878448, -0.2155510038137436, 0.20947708189487457, 0.4611159563064575, 0.3139035701751709, -0.32365238666534424, 0.02440309338271618, -0.9028968214988708, -0.17695312201976776, 0.7010270357131958, 0.1108972504734993, -0.046107731759548...
MAX(DateReferred) FROM AssessmentXResource
[ 0.16979274153709412, -0.21298697590827942, 0.3170493543148041, 0.21774448454380035, 0.14858439564704895, 0.2248055636882782, 0.3552808463573456, -0.1685527265071869, -0.347275972366333, -0.13181859254837036, -0.21418708562850952, 0.04305783659219742, 0.45602694153785706, 0.1908753961324691...
WHERE ResourceID = Resource.ResourceID ) INNER JOIN
[ -0.5115811824798584, -0.40879786014556885, -0.044034428894519806, -0.35143861174583435, 0.20807869732379913, 0.1556883454322815, 0.38094043731689453, -0.010974871926009655, -0.06990572810173035, -0.895861804485321, 0.08408278226852417, 0.3830415606498718, -0.21835628151893616, 0.0797437131...
Assessment AS aq ON arq.AssessmentID = aq.AssessmentID INNER JOIN [Case] AS cq ON aq.CaseID = cq.CaseID INNER JOIN [Plan] AS pq ON cq.CaseID = pq.CaseID WHERE (pq.PlanID = 22) ORDER BY Resource.Description ```
[ 0.19548451900482178, 0.20601381361484528, 0.23115310072898865, -0.10252625495195389, -0.06956236809492111, 0.4914630055427551, 0.2099328339099884, -0.8380197882652283, 0.01532665640115738, -0.8643398284912109, -0.2171747088432312, 0.6720966696739197, 0.09361964464187622, -0.025729583576321...
I have my editor setup to be textmate but when I do a git diff it uses vi to show me the diff output, is there any way to set it to show the diff in textmate? I normally pipe the contents to mate like this: ``` git diff | mate - ```
[ 0.5982262492179871, 0.3696632385253906, 0.5801557898521423, -0.1961815357208252, -0.26429325342178345, -0.1951369345188141, 0.3582482635974884, -0.3219536244869232, 0.3532833456993103, -0.5427311062812805, -0.01498333364725113, 0.5638085603713989, -0.5653380155563354, 0.2664680778980255, ...
I have a large result set assembled in a parent/child relationship. I need to walk the tree and display the results to the user. I've done this before using recursion, but because my result set may be large, I want to avoid the possibility of receiving a StackOverflowException. I found the following [example](http:/...
[ 0.05218721553683281, 0.14297260344028473, 0.17664943635463715, -0.09413251280784607, 0.17389079928398132, 0.0600866861641407, 0.03303844854235649, -0.38268840312957764, -0.2900193929672241, -0.5142363905906677, -0.015013990923762321, 0.35176190733909607, -0.23692582547664642, 0.24822694063...
Level 1.2.1 Level 1.1 Level 1.1.2 Level 1.1.1 ``` Any ideas? Here is an example of my code. Assuming the `DataTable dt` has the following columns: ID, ParentID, and Text ``` private struct Item { public string Text; public int ID; public int ParentID; } private void Buil...
[ 0.2056860774755478, -0.19215820729732513, 0.48228880763053894, -0.12240106612443924, -0.0758775994181633, 0.13020439445972443, 0.13001079857349396, -0.40134114027023315, -0.1817966103553772, -0.7512258887290955, -0.24331529438495636, 0.5548663139343262, -0.24401643872261047, 0.130235239863...
//Get All Parent Nodes DataView dv = new DataView(dt); dv.RowFilter = "ParentID = 0"; //Add the parent nodes to the stack foreach (DataRowView drv in dv) { Item item = new Item(); item.Text = drv["Text"].ToString();
[ -0.29448172450065613, -0.47488290071487427, 0.9660450220108032, -0.21735908091068268, 0.05259675905108452, 0.3057968318462372, 0.11677224189043045, -0.35647135972976685, -0.20280449092388153, -0.5945371389389038, -0.4450805187225342, 0.3787423074245453, -0.1659138947725296, 0.4182665944099...
item.ID = drv["ID"].ToString(); item.ParentID = drv["ParentID"].ToString(); itemTree.Push(item); } //Go through the stack one node at a time while (itemTree.Count > 0) { Item currentItem = itemTree.Pop();
[ -0.3619435131549835, -0.6299050450325012, 0.7504846453666687, -0.18039833009243011, 0.366497278213501, 0.26581841707229614, 0.38033390045166016, -0.43168577551841736, -0.6298953294754028, -0.23540258407592773, -0.4145034849643707, 0.12641306221485138, -0.34023159742355347, 0.54848915338516...
Debug.WriteLine(currentItem.Text); //Get children of current node dv.RowFilter = String.Format("ParentID = {0}", currentItem.ID); if (dv.Count > 0) { //Add child nodes to the stack foreach
[ -0.38516202569007874, -0.11963474005460739, 0.30332767963409424, -0.07625427097082138, 0.46629300713539124, 0.2510453164577484, 0.34919625520706177, -0.34096646308898926, -0.04488489404320717, -0.4428964853286743, -0.2752555310726166, 0.17435164749622345, -0.27883386611938477, 0.2976321280...
(DataRowView drvChild in dv) { Item item = new Item(); item.Text = drvChild["Text"].ToString(); item.ID = drvChild["ID"].ToString();
[ -0.2996518611907959, -0.4349652826786041, 0.9727135300636292, -0.19649150967597961, -0.0736301839351654, 0.1910034865140915, 0.3378249704837799, -0.4407167136669159, -0.2328980267047882, -0.3210444450378418, -0.47126197814941406, 0.6300615072250366, -0.15353189408779144, 0.4806065559387207...
item.ParentID = drvChild["ParentID"].ToString(); itemTree.Push(item); } } } } ``` Push your items onto the stack in the reverse order, i.e. 2 before 1. Example: ``` // suppose I want to push children[] onto the stack for (int i = children.Length - 1; i
[ -0.24311445653438568, -0.21228526532649994, 0.4491351842880249, -0.2418248951435089, 0.2573578953742981, 0.4417935311794281, 0.04598763585090637, -0.49688416719436646, -0.5792085528373718, -0.679459273815155, -0.24449321627616882, 0.31339916586875916, -0.20248501002788544, 0.31594350934028...
>= 0; i--) { stack.Push(children[i]); } ``` To do this in your code, try the following `for-each` statement: ``` foreach (DataRowView drvChild in dv.Reverse()) ```
[ 0.05068791285157204, -0.024975886568427086, 0.6029758453369141, -0.39041781425476074, 0.2610861659049988, 0.12457818537950516, 0.35302555561065674, -0.42836490273475647, 0.020422210916876793, -0.7042602896690369, -0.2098870575428009, 0.48209643363952637, -0.10755686461925507, 0.23344603180...
I have perl, v5.6.1 built for MSWin32-x86-multi-thread Binary build 638 provided by ActiveState. I am working on a Perl script where I have declared constants that are used later for comparison purposes. For some reason, I am getting an error that states something along the line of Constant name has invalid character...
[ 0.21128955483436584, 0.04080381616950035, 0.401315838098526, -0.18849563598632812, -0.10981016606092453, 0.0191167201846838, 0.33825498819351196, 0.3705887794494629, -0.2400600016117096, -0.39765405654907227, 0.2054620087146759, 0.4646259546279907, -0.49012860655784607, 0.39690497517585754...
I got the same error. I am not sure what I am doing wrong. Anyone know why the compiler does not like this? Thanks! Here is the Code: ``` use constant { MIN_NET_DLR => 0.00, MAX_NET_DLR => 99.99, MIN_SUM_DLR => 0.00, MAX_SUM_DLR => 999.99, MIN_UNITS => 0, MAX_UNITS => 99, MIN_SUM_UNITS => 0, MAX_SUM_UNITS => 999, PC...
[ 0.0819421336054802, -0.03273775428533554, 0.7298734784126282, 0.0036344225518405437, -0.14118055999279022, 0.19930656254291534, 0.0985495075583458, -0.1428275853395462, -0.30330100655555725, -0.3738522529602051, 0.05844511091709137, 0.6763997077941895, -0.35034823417663574, 0.3249467313289...
=> 99; use constant MIN_SUM_UNITS => 0; use constant MAX_SUM_UNITS => 999; use constant PCT_THRES_AO => 1; use constant PCT_THRES_TRANS_CUST_BI => 20; use constant PCT_THRES_CUST => 3; ``` Thanks @leon for the solution as well as others who chimed in with their inputs. UPDATE: Another (more elegant) solution is t...
[ 0.1529049128293991, -0.051119085401296616, 0.6587985754013062, 0.013660620898008347, -0.22666151821613312, 0.34630197286605835, 0.23785445094108582, -0.028724458068609238, -0.2416611760854721, -0.5056541562080383, 0.09204628318548203, 0.4899847209453583, -0.37145423889160156, 0.21161422133...
Just like [Carl's question over here](https://stackoverflow.com/questions/235250/what-are-the-benefits-of-maintaining-a-clean-list-of-using-directives-in-c) I would like to ask you (because I couldn't find it out on my own :( ) if there is any benefit by removing an assembly reference that is not statically nor dynamic...
[ 0.5849168300628662, 0.07914573699235916, 0.14326249063014984, -0.13129247725009918, -0.056171078234910965, -0.18258412182331085, 0.250994473695755, -0.20001932978630066, -0.39651575684547424, -0.5066630840301514, 0.06653992086648941, 0.4422297775745392, -0.3586812913417816, 0.2982383966445...
static void Main() { Console.WriteLine("Hi there."); } } ``` the compiler would only reference the mandatory mscorlib.dll
[ -0.28573742508888245, -0.2377556413412094, 0.7459133863449097, -0.17202167212963104, 0.13174977898597717, -0.3875943124294281, 0.28342556953430176, 0.07767532020807266, -0.11398632079362869, -0.05392063036561012, -0.4520481824874878, 0.6449949741363525, -0.597423255443573, 0.26738184690475...
Originaly posted a while back on a different forum, hope I can find a bit more help here :) Hi Guys, I'm sure this is a pretty basic question, but I'm new to much programming and C#. I find I need to clear databindings on several controls and currently have: ``` lblTableValue1.DataBindings.Clear(); ...
[ 0.07547308504581451, -0.3156591057777405, 0.3814678490161896, 0.0316157229244709, 0.027614274993538857, -0.052104927599430084, 0.12385672330856323, -0.26491737365722656, -0.23961272835731506, -0.563874363899231, -0.22044162452220917, 0.3490944504737854, -0.34426259994506836, 0.355394631624...
lblTableValue5.DataBindings.Clear(); lblTableValue6.DataBindings.Clear(); lblTableValue7.DataBindings.Clear(); ``` This can't be the best way of doing this can it? I also need to set all these text values to "", can I group them in someway and call clear on the whole group? Many Thanks in adv...
[ -0.026784369722008705, -0.13508263230323792, 0.44307756423950195, -0.2520308792591095, 0.24531470239162445, -0.07216493040323257, 0.2958565056324005, -0.2431611865758896, -0.08771400153636932, -0.4176517426967621, -0.3852781057357788, 0.7192090749740601, -0.27158278226852417, 0.02485750615...
of a purist: ``` foreach(Control c in new Control[] { lblTableValue1, lblTableValue2, etc }) { c.DataBindings.Clear(); } ```
[ -0.31037306785583496, -0.2829881012439728, 0.35368070006370544, -0.1363857090473175, 0.2544572353363037, -0.005784276872873306, -0.014125366695225239, 0.013482763431966305, 0.21230515837669373, -0.1743069291114807, -0.4868357479572296, 0.5984507203102112, -0.4392106235027313, 0.32704553008...
I'm starting a new C# project that uses a database, but I want it all to be version controlled. I'm thinking about a SQL server database (If I make a mdf file, will I be able to use it in a computer without SQL Server installed?) and LINQ to SQL. How do you usually start a project like this? Do you create a .sql file ...
[ 0.583683431148529, 0.2622160017490387, 0.3052762746810913, 0.28179752826690674, 0.1400953233242035, -0.2767375707626343, -0.26944997906684875, -0.1320803463459015, -0.40412652492523193, -0.4092426896095276, 0.28794065117836, 0.4801463186740875, -0.26248520612716675, 0.13948647677898407, ...
model first (programmers will tell you that) and then there are those that are going to tell you to design your data model first (the database admins). In the end, the right way is the way that you feel most comfortable with. If you feel that you are going to do most of the manipulation of the data in code, then it mi...
[ 0.4212067723274231, 0.03603067249059677, 0.09609213471412659, 0.5469497442245483, 0.21933458745479584, 0.07509422302246094, -0.05694849044084549, 0.043098222464323044, -0.2790306806564331, -0.7449017763137817, 0.10312902927398682, 0.9752278327941895, -0.04613208398222923, -0.06006916239857...
control, if you want to version everything, then you are going to have to generate a sql file which will have what you need to create your db from scratch. Then, every time you change or update the database schema or data, you should place that file into source control as well. I also recommend a naming convention whic...
[ 0.5003599524497986, 0.1457117795944214, 0.12307938188314438, 0.2664937376976013, -0.04776204004883766, -0.30037227272987366, 0.017862193286418915, 0.019897401332855225, 0.011196626350283623, -0.42104220390319824, 0.024907901883125305, 0.21722666919231415, -0.30330386757850647, 0.4880798757...
version your source code as well, but that should go without saying.
[ 0.5704510807991028, 0.05785594880580902, 0.15487928688526154, 0.249739870429039, -0.017834676429629326, -0.4614604413509369, 0.26877570152282715, 0.44772952795028687, 0.05245598405599594, -0.6880031824111938, -0.1616584211587906, 0.6071773767471313, -0.06200564652681351, -0.029473828151822...
I want to know whether the below is an acceptable use of the visitor pattern. I feel a little uncomfortable returning from an Accept() or Visit() call - is this an appropriate usage of this pattern and if not, why not? **Note:** Apologies for the long code sample, seems necessary to get across what I'm doing as visito...
[ 0.2202908992767334, -0.0371357724070549, 0.36073368787765503, -0.25575560331344604, 0.06537968665361404, 0.2986363470554352, 0.2719976007938385, -0.3148171603679657, -0.265215665102005, -0.6210365295410156, 0.03121008910238743, 0.5370770692825317, -0.468900203704834, 0.35379132628440857, ...
set; } } class Lion : Animal, IAnimalElement<int> { public Lion(int age) { Age = age; } public int Accept(IAnimalVisitor<int> visitor) { return visitor.Visit(this); } } class Peacock : Animal, IAnimalElement<int> { public Peacock(int age) { Age = age; } ...
[ 0.10775428265333176, -0.1504509299993515, 0.08094196766614914, -0.28800252079963684, 0.1768653839826584, 0.502290666103363, 0.3196450471878052, -0.31501656770706177, -0.5231695771217346, -0.4501045048236847, -0.3494977355003357, 0.2624988555908203, -0.5435168147087097, 0.4162205159664154, ...
return visitor.Visit(this); } } class AnimalAgeVisitor : IAnimalVisitor<int> { public int TotalAge { get; private set; } int IAnimalVisitor<int>.Visit(Lion lion) { TotalAge += lion.Age; return lion.Age; } int IAnimalVisitor<int>.Visit(Peacock peacock) { TotalAge +=...
[ 0.014026754535734653, -0.528512716293335, 0.27409058809280396, -0.2179248332977295, -0.10672936588525772, 0.5159630179405212, 0.37091776728630066, -0.09833718091249466, -0.572454571723938, -0.35581251978874207, -0.14499004185199738, 0.2385987937450409, -0.402749627828598, 0.252701044082641...
public int VisitZoo(List<Animal> animals) { // Calculate average animal age. int sum = 0; int count = 0; foreach (IAnimalElement<int> animal in animals) { sum += animal.Accept(this); ++count; }
[ 0.07668086141347885, -0.02294844202697277, 0.3775959312915802, -0.3259730637073517, 0.33628085255622864, 0.45228514075279236, 0.4120655655860901, -0.19560472667217255, -0.2420174479484558, -0.5672951340675354, -0.025953812524676323, 0.44648483395576477, -0.32700812816619873, 0.264648258686...
return count == 0 ? 0 : sum / count; } } class Program { static void Main(string[] args) { List<Animal> animals = new List<Animal>() { new Lion(10), new Lion(15), new Peacock(3), new Lion(2), new Peacock(9) }; AnimalAgeVisitor visitor = new AnimalAgeVisitor(); Console.W...
[ 0.15307344496250153, -0.25220856070518494, 0.28627073764801025, -0.3476403057575226, 0.22708465158939362, 0.5025667548179626, 0.3672569692134857, -0.30863749980926514, -0.47994059324264526, -0.333476185798645, -0.1960648149251938, 0.35613584518432617, -0.4650813639163971, 0.377826005220413...
visitor.VisitZoo(animals), visitor.TotalAge); } } ``` Well to me this feels like the implementation is a little bit on the fence. Either have your Visit and Accept methods return void and track all the state in the Visitor object. Interrogate it at the end. or ... Have Visit and Accept return an in-progress s...
[ -0.06686815619468689, -0.10963471233844757, 0.2477012425661087, -0.02111503854393959, 0.09411121904850006, -0.15172967314720154, 0.17572668194770813, 0.15760257840156555, -0.4022907614707947, -0.8001320958137512, -0.18187232315540314, 0.8555877804756165, -0.5537509322166443, 0.435041934251...
Can anyone suggest a suitable way of figuring out a pieces allowable moves on a grid similar to the one in the image below. ![grid layout](https://farm4.static.flickr.com/3534/3250436085_c91b07c7fd.jpg) Assuming piece1 is at position a1 and piece2 is at position c3, how can I figure out which grid squares are allowab...
[ 0.13909727334976196, 0.0627463236451149, 0.21159783005714417, 0.05498996004462242, -0.1413450837135315, 0.08744761347770691, 0.28280121088027954, -0.40277859568595886, -0.5311441421508789, -0.844711422920227, 0.03549580276012421, 0.34239479899406433, -0.07020953297615051, 0.043714195489883...
in javascript, but to be perfectly honest I think my failure here is a failure to conceptualise properly - not a failure in language comprehension. **Update - I'm adding the first round of code written after the below responses were posted. I thought it might be useful to people in a similar situation as me to see the...
[ 0.25076109170913696, 0.2767806947231293, 0.20532158017158508, 0.04357412829995155, -0.20365218818187714, -0.09555639326572418, 0.4244883060455322, -0.2858937978744507, -0.28866255283355713, -0.615181028842926, -0.16154219210147858, 0.3564055263996124, -0.22786392271518707, -0.5057721734046...
using numeric x axis and y axis - it's because an id in HTML can't start with a number. In fact pretending I *could* use numbers to start ids helped a great deal in making sense of the functionality and concepts described by the fantastic answers I got. ``` <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "htt...
[ 0.10436579585075378, -0.1385151892900467, 0.5823860764503479, 0.3601079285144806, -0.26752492785453796, -0.12004999071359634, -0.05633007735013962, -0.5433366298675537, -0.36879435181617737, -0.5316267013549805, 0.08399692922830582, 0.13901755213737488, -0.15535613894462585, 0.087050750851...
} #chessboard .row { overflow: auto; clear: both; } #chessboard .row span { display: block; height: 80px; width: 80px; float: left; border:solid 1px black; } .allowable { background: blue; } </style> <script type="text/javascript" src="http://www.goo...
[ -0.2531323730945587, -0.062182195484638214, 0.4837966859340668, -0.20323416590690613, 0.009618178009986877, 0.013881001621484756, 0.17750564217567444, -0.2755475640296936, -0.39180946350097656, -0.6266955137252808, -0.39323121309280396, 0.1930238902568817, -0.412855327129364, -0.1650202274...
google.load("jquery", "1.2.6"); google.load("jqueryui", "1.5.3"); </script> <script type="text/javascript"> $(document).ready(function() { (function() { var global = this; global.Map = function(container) { function render_board() { var max_rows = 8; var cols = new Array('a','b',...
[ -0.0768190324306488, -0.25398755073547363, 0.9414848685264587, -0.15176279842853546, 0.11516907811164856, 0.14389963448047638, 0.10817120969295502, -0.07363633811473846, -0.3527168929576874, -0.8063311576843262, -0.2742372751235962, 0.37115374207496643, -0.6801389455795288, 0.0900591015815...
for(x; x<max_rows; x++) { var jqRow = $('<span />'); jqRow.addClass('row'); var i=0; for(i; i<cols.length; i++) { var jqCol = $('<span />');
[ -0.17941229045391083, -0.3375091552734375, 0.92519611120224, -0.454537570476532, -0.03292786329984665, 0.284768670797348, 0.10232538729906082, -0.3562402129173279, -0.09759914875030518, -0.3722468316555023, -0.3520094156265259, 0.39798012375831604, -0.4999121427536011, 0.04271842539310455,...
jqCol.attr('id', cols[i]+(x+1)); jqCol.addClass(cols[i]); jqRow.append(jqCol); } jqMap.append(jqRow); } $('#'+container).append(jqMap); } function add_piece(where, id) { var jqPiece = $('<div>MY PIECE'+id+'</div>'); var jqWhere = $('#'+w...
[ 0.02879568748176098, -0.2482084482908249, 0.9267274141311646, -0.4520312249660492, -0.32719260454177856, 0.32514190673828125, 0.11477860808372498, -0.6371134519577026, -0.07664287090301514, -0.5192860960960388, -0.2860676646232605, 0.4716489911079407, -0.6802463531494141, 0.118356175720691...
'piece-'+id); jqPiece.addClass('army'); jqPiece.draggable({cursor: 'move', grid:[82, 82], containment: '#chessboard',
[ -0.2801118493080139, -0.24197791516780853, 0.4569087028503418, -0.258565753698349, -0.1143990084528923, 0.17382226884365082, 0.12686221301555634, -0.6607527732849121, -0.4304630756378174, -0.47894880175590515, -0.45376861095428467, 0.05467737838625908, -0.41533371806144714, -0.052327349781...
revert: 'invalid', stop: function(ev, ui) { //console.log(ev.target.id); }
[ 0.03714604303240776, -0.11737136542797089, 0.4030109941959381, -0.15521101653575897, 0.06626294553279877, 0.4445478022098541, 0.37395647168159485, -0.04611600935459137, 0.025550011545419693, -0.33989590406417847, -0.4035828113555908, 0.6303020715713501, -0.23539942502975464, 0.281350016593...
}); jqWhere.append(jqPiece); check_allowable_moves(where); } function check_allowable_moves(location) { var x_axis = { 'a':1,'b':2, 'c':3, 'd':4, 'e':5, 'f':6, 'g':7, 'h':8 }; var x_axis_alpha = { 1:'a',2:'b', 3:'c', 4:'d', 5:'e', 6:'f', 7:'g', 8:'h' }; $('.allowable').droppable("destro...
[ 0.02546660229563713, -0.14566385746002197, 0.642615020275116, -0.2699801027774811, 0.4669361412525177, 0.13557985424995422, 0.3123414218425751, -0.22921690344810486, -0.14254668354988098, -0.2350752204656601, -0.49852895736694336, 0.4563037157058716, -0.6771425008773804, 0.1953148543834686...
piece just placed var x = parseInt(x_axis[location[0]], 10); var y = parseInt(location[1], 10); var x_min = x-2; var y_min = y-2; for(x_min; x_min<=x+2; x_min++) { for(y_min; y_min<=y+2; y_min++) { var jqCell = $('#'+x_axis_alpha[x_min]+y_min) jqCell.addClass('all...
[ 0.23406982421875, -0.4129054844379425, 0.550813615322113, -0.34928590059280396, -0.12157013267278671, 0.4194202125072479, 0.04456719756126404, -0.32287293672561646, -0.19844049215316772, -0.04039708524942398, -0.34944650530815125, 0.014754434116184711, -0.005112305283546448, 0.021971469745...
drop: function(ev, ui) { //console.log(ev, ui, $(this)); //handle_drop(ev, ui, $(this)); check_allowable_moves($(this).attr('id')); } }); }
[ 0.017633585259318352, -0.35782569646835327, 0.6705866456031799, -0.11150816828012466, 0.2825220227241516, 0.14886483550071716, -0.047750018537044525, -0.2554739713668823, -0.10609070956707001, -0.2257508784532547, -0.48919978737831116, 0.540037214756012, -0.4595012962818146, -0.13682900369...
y_min = parseFloat(y)-2; } } render_board(); add_piece('d5', '2'); } })(); var map = new Map('content'); }); </script> </head> <body id="debug"> <div id="page"> <div id="content"> </div> </div><!-- end page --> </body> </html> ``` Suppose piece p is at position x, y and can move ...
[ -0.019983790814876556, -0.1875404417514801, 0.7893376350402832, -0.2151842713356018, -0.005811742972582579, 0.42929384112358093, 0.05189223960042, -0.4404078722000122, -0.28917819261550903, -0.9125192761421204, -0.45128920674324036, 0.4007091820240021, -0.03584170714020729, 0.0404832437634...
to show which squares can be moved to (rather than taking inputs x2 and y2), I think it'd be best to loop over all positions in a square around the piece. That is... ``` for (x - n TO x + n): for (y - n TO x + n): if (abs(x - x2) + abs(y - y2) <= n): mark as okay. ``` This answer assumes piec...
[ 0.08452174067497253, -0.05804869532585144, 0.37949612736701965, -0.22002795338630676, 0.049018409103155136, -0.03634911775588989, 0.06783086061477661, -0.5477758646011353, -0.5334653854370117, -0.3473760187625885, -0.5147675275802612, 0.14289671182632446, -0.22736431658267975, -0.249267220...
moving along a diagonal costs just as much as moving horizontally or vertically, then the problem is actually much easier - the piece p can move between the ranges of (x - n, x + n) and (y - n, y + n). The answer becomes a lot more complex if moving diagonally doesn't cost as much as a horizontal + vertical movement (...
[ 0.11282014846801758, 0.00854220986366272, 0.39501017332077026, 0.10984060168266296, -0.35365650057792664, 0.7130904793739319, -0.07055126130580902, -0.7003751993179321, -0.33612820506095886, -0.6877985000610352, 0.0265473835170269, 0.3341188430786133, 0.14829768240451813, -0.29455119371414...
i have a long running function¹: ``` public string FindPasswordFromHash(String hash) { ... } ``` which is called like: ``` private void Button1_Click(object sender, EventArgs e) { PasswordTextBox.Text = FindPasswordFromHash(HashTextBox.Text); } ``` Now i want to convert it into the asynchronous BeginInvok...
[ -0.03618312254548073, -0.0923750102519989, 0.5227421522140503, -0.08085711300373077, 0.14646491408348083, -0.12097997963428497, 0.46050769090652466, -0.3226556181907654, -0.06461725383996964, -0.48605096340179443, -0.17008943855762482, 0.4372706115245819, -0.30320340394973755, 0.4255980849...
other than the thread it > was created on." Given that the asynchronous delegate pattern was invented to convert long running operations into asynchronous operations - what is the proper technique to use BeginInvoke/EndInvoke as replacement for the synchronous call? And more specifically, what is the method to force...
[ -0.059667397290468216, -0.3454873263835907, 0.12601472437381744, 0.2370709329843521, 0.0639052465558052, -0.2765854299068451, 0.07102407515048981, -0.1817774921655655, -0.14417895674705505, -0.33992621302604675, -0.2480226308107376, 0.6689754724502563, -0.3363504707813263, 0.16992770135402...