text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
I'm aware of the fact that Core Animation dispatches its animations in a seperate thread, as stated in the documentation. Nevertheless, my animations seem to be blocking my main thread. All animations start and finnish. (With or without kCATransactionDisableActions set as true.) but become jumpy and the main runloop st...
[ 0.1653180867433548, -0.062258366495370865, 0.32104426622390747, -0.04905816167593002, 0.02288673259317875, 0.1780019849538803, 0.4267454445362091, -0.1892872452735901, -0.258924275636673, -0.7574427127838135, -0.18776345252990723, 0.5126063823699951, -0.278698205947876, 0.1905566155910492,...
idea, and not how Core Animation was intended to be used. Core Animation was designed around the idea that you tell the system where you want your layer (or layer-backed view) to end up, and it figures out the rest, including how many frames to drop to run the animation in the time frame you provide. The animations the...
[ 0.5460246801376343, -0.2980767786502838, 0.40435776114463806, 0.34066227078437805, 0.3001917898654938, 0.08557340502738953, -0.0755932480096817, -0.07134035229682922, -0.15096670389175415, -0.4428248107433319, -0.06412866711616516, 0.00892785657197237, 0.01732982136309147, 0.07990707457065...
would overload your main thread. You goal should be to minimize the amount of interaction with Core Animation. If you have a complex, but scripted, motion path (or other property change), set it all up ahead of time using a CAKeyframeAnimation and just call that animation once. If there's something about the motion of...
[ 0.4418271780014038, -0.054966893047094345, 0.16105642914772034, 0.33464136719703674, 0.1534883826971054, 0.2884366810321808, -0.09641088545322418, 0.001984264003112912, -0.15997739136219025, -0.7397274971008301, 0.10008443892002106, 0.4668155610561371, -0.1874420940876007, 0.30427736043930...
work with Core Animation in this fashion, you can simultaneously animate up to 50 moving translucent layers at 60 FPS on the iPhone.
[ 0.33881887793540955, -0.0888620913028717, 0.1982036828994751, 0.2613909840583801, 0.30129575729370117, 0.24412374198436737, 0.15542201697826385, -0.2432931810617447, -0.2117002159357071, -0.6924166083335876, -0.17038442194461823, 0.2936214804649353, 0.10977965593338013, -0.1906546056270599...
Does anyone know how to prevent task panes from expanding unless you click on them? Sometimes I hover over one, and it takes a bit to load breaking my concentration. Thanks! EDIT: Now that I've had a few days to reflect on my question, I realize the answer is to close it. Let me provide an example. When you are in Wo...
[ 0.0593964122235775, 0.008723575621843338, 0.23337911069393158, 0.163737490773201, 0.002163968048989773, 0.009684101678431034, 0.5729849934577942, 0.19433988630771637, -0.4090210199356079, -0.561371922492981, -0.25310012698173523, 0.3027876615524292, -0.008196189999580383, -0.02468877658247...
done, you click the X to close it. You don't unpin it and have it sit on the side and get annoyed when you hover over it and it pops into view, covering your content and getting in the way. With that being said, the same mental model applies to visual studio. Don't have windows or panes open which you don't need. Open ...
[ 0.5705742835998535, 0.140315979719162, 0.32820364832878113, 0.1914377063512802, -0.1646803915500641, -0.21264007687568665, 0.2678420841693878, 0.17444123327732086, -0.5184581279754639, -0.5431798100471497, -0.16368117928504944, 0.41286736726760864, 0.3490265905857086, 0.04412315785884857, ...
debate me on this). I still would like an option to choose when to open collapsed windows. I keep it closed. I open it only when needed. I do the same for tools and servers.
[ 0.43031689524650574, 0.3779433071613312, 0.3178044259548187, -0.05773134157061577, 0.1745273619890213, -0.06874557584524155, 0.36697331070899963, 0.031869035214185715, -0.1435922384262085, -0.7520741820335388, -0.21923862397670746, 0.43693864345550537, 0.1862449198961258, 0.131844833493232...
I am a student, with decent knowledge of SQL, but have had very little to do with triggers in the past. I've looked at a few sites for guidance, but comprehensive explanation on all commonly used statements seems fairly sparse. Is there a 'definitive' site for this kind of thing? Perhaps like a w3chools for advanced S...
[ 0.8510776162147522, 0.39129096269607544, -0.2883267104625702, 0.0685015395283699, -0.15139298141002655, -0.25625473260879517, 0.18969103693962097, 0.184031143784523, -0.015487762168049812, -0.33553817868232727, 0.2041718065738678, 0.18506979942321777, 0.24803103506565094, -0.20912450551986...
dev work, you'll be glad to score your own personal copy of the book. You can get the relational DB engine to do a significant amount of work in a small amount of code - thinking that way will make you a much more efficient programmer. Most book stores (my local Borders always has a couple copies) will have a copy on t...
[ 0.6185435056686401, 0.21791404485702515, 0.1701611429452896, 0.4514316916465759, -0.24658915400505066, -0.2943817675113678, 0.23846493661403656, 0.1949157863855362, -0.09182711690664291, -0.512514054775238, 0.3275904953479767, 0.7901432514190674, 0.2572634816169739, -0.0014114934019744396,...
I'm currently building a WordPress theme that I would like to have a header (in the WordPress, not the HTML sense) that fits from corner to corner at the top of the page. Anchoring the far left would be an image that is filled with a solid color on its right side. Anchoring the far right would be an image that is fille...
[ 0.04025238752365112, -0.1144074946641922, 0.8163782954216003, 0.30984920263290405, -0.05131599307060242, -0.03629618138074875, -0.3737914264202118, 0.2930302619934082, -0.17664267122745514, -0.6546127796173096, -0.12960724532604218, -0.06599973142147064, -0.18221259117126465, 0.07185477763...
on its right. Is there a way to do this via CSS? Do the gradient as an image in [GIMP](http://www.gimp.org/) (one pixel high) and see <http://www.cssplay.co.uk/layouts/background.html>
[ -0.2524454593658447, -0.302960604429245, 0.6317704916000366, -0.015622551552951336, -0.21765799820423126, 0.36321380734443665, -0.3356778919696808, -0.01765315607190132, -0.08767952024936676, -0.46107298135757446, 0.3268878161907196, 0.0556425005197525, -0.24679037928581238, -0.21697582304...
I'm about to start building a site entirely in flash (per the client's request), using AS3, and was wondering about best practices for doing so in terms of application architecture. The site isn't too large--think homepage, persistent nav, 8 subsections or so, each with their own content but similar design between subs...
[ 0.28380709886550903, 0.012203579768538475, 0.39871329069137573, 0.02654855139553547, -0.19918541610240936, -0.11328420042991638, 0.028433512896299362, 0.2754226624965668, -0.39246007800102234, -0.8395833373069763, -0.1337910294532776, 0.23750516772270203, -0.08009763807058334, 0.0847317352...
preloader to load it). Are there any best-practices for determining whether it's better to dynamically load smaller swfs vs building a single large swf? In AS2 I think loading many smaller swfs made more sense, but with AS3's stronger object-oriented capabilities I'm wondering if that's still the case. I know that on...
[ 0.3023448884487152, -0.061541419476270676, 0.20747457444667816, -0.07075288146734238, -0.48470789194107056, -0.16376109421253204, 0.050183407962322235, 0.045447248965501785, -0.4930195212364197, -0.6317631006240845, -0.2333880513906479, 0.6385216116905212, -0.2357213944196701, -0.148150086...
a shell that loads a core. Sometimes you can get by with just one SWF that tracks its own load progress. That said, you want to load content and assets on demand; images, video, animations and large textual content. These typically should not be embedded in the core SWF but loaded on user request. The primary advantage...
[ 0.0461820587515831, -0.1826203167438507, -0.03371308743953705, 0.32621321082115173, 0.01266650389879942, -0.18891412019729614, -0.033927831798791885, -0.2225847691297531, -0.4467231333255768, -0.5913399457931519, -0.389031320810318, 0.7536104917526245, -0.21407946944236755, -0.008445086888...
your application code in the core. Hope that helps!
[ 0.27694934606552124, 0.3466366231441498, -0.19764724373817444, 0.3067381680011749, 0.13138003647327423, -0.1541689783334732, 0.43115392327308655, 0.4033403992652893, 0.05801911652088165, -0.5769205093383789, -0.07291654497385025, 0.44365113973617554, 0.13161538541316986, -0.113303981721401...
I have a simple struct that has limited use. The struct is created in a method that calls the data from the database. If there is no data returned from the database I want to be able to return a null, but Visual Studio complains, Cannot convert null to PackageName.StructName because it is a non-nullable value type. Ho...
[ 0.09459633380174637, 0.01912607066333294, 0.15199869871139526, -0.3009418547153473, -0.2663823068141937, -0.02488243207335472, 0.3986984193325043, -0.09345033019781113, -0.014914470724761486, -0.5166683793067932, -0.09371072053909302, 0.44338852167129517, -0.49614521861076355, 0.1519408524...
In my quest to develop a pretty data-driven silverlight app, I seem to continually come up against some sort of race condition that needs to be worked around. The latest one is below. Any help would be appreciated. You have two tables on the back end: one is Components and one is Manufacturers. Every Component has ONE...
[ 0.7419204711914062, 0.35518667101860046, 0.6273550391197205, 0.08468364179134369, -0.08628425747156143, 0.24574977159500122, -0.2893824875354767, -0.18458189070224762, -0.2898975610733032, -0.6454344391822815, 0.07208088785409927, 0.4020833969116211, -0.11649800837039948, 0.304924964904785...
to populate the possible selections for a ComboBox. I then Bind the SelectedItem on the ComboBox to the Manufacturer for the Current Component and the ItemSource on the ComboBox to the list of possible Manufacturers. like this: ``` <UserControl.Resources> <data:WebServiceDataManager x:Key="WebService" /> </UserCon...
[ 0.21937847137451172, -0.3530537188053131, 0.8445255160331726, 0.18529878556728363, 0.02011098712682724, 0.43949344754219055, -0.4811519384384155, -0.4832908809185028, 0.05379335582256317, -0.7409564852714539, -0.2590760588645935, 0.1963127702474594, -0.3070559799671173, 0.25246381759643555...
<ComboBox.ItemTemplate> <DataTemplate> <Grid> <TextBlock Text="{Binding Name}" Style="{StaticResource DefaultTextStyle}"/> </Grid> </DataTemplate> </ComboBox.ItemTemplate> </ComboBox> </Grid> ``` This worked great for the longest ...
[ -0.010539760813117027, -0.46262264251708984, 0.43277594447135925, -0.07920993119478226, -0.34671011567115784, -0.0821210965514183, 0.04617007076740265, -0.7081252336502075, -0.011447726748883724, -0.6887955069541931, 0.11965091526508331, 0.6499791741371155, -0.055755797773599625, -0.184378...
until I got clever and did a little client side caching of the Component (which I planned turn on for the Manufacturers as well). When I turned on caching for the Component and I got a cache hit, all of the data would be there in the objects correctly, but the SelectedItem would fail to Bind. The reason for this, is th...
[ 0.19609011709690094, 0.04356222227215767, 0.5022885799407959, 0.1512264758348465, -0.0018753566546365619, -0.008371615782380104, 0.14428085088729858, -0.23271676898002625, -0.2649570405483246, -0.4876462519168854, -0.019579626619815826, 0.36705732345581055, -0.2385411411523819, 0.488812416...
not there, because this list is still empty because Manufacturers.All has not loaded from the WCF service yet. Again, if I turn off the Component caching, it works again, but it feels WRONG - like I am just getting lucky that the timing is working out. The correct fix IMHO is for MS to fix the ComboBox/ ItemsControl co...
[ 0.18456892669200897, -0.09939040243625641, 0.5660369396209717, 0.1960119605064392, -0.05497896671295166, -0.03015504777431488, 0.23214878141880035, -0.049311183393001556, -0.3922673463821411, -0.6328387260437012, -0.08041919022798538, 0.9160166382789612, -0.3430533707141876, 0.157282039523...
board to once again mask the problem. Not Good IMHO, because this will fail again. Not really willing to sweep it back under the rug. 2. Create an intermediary object that would do the synchronization for me (that should be done in the ItemsControl itself). It would accept and Item and an ItemsList and then output and ...
[ -0.11269640922546387, -0.5061503052711487, 0.37643054127693176, 0.3722102642059326, -0.31197383999824524, 0.0005760716157965362, 0.08486077189445496, -0.3470023274421692, -0.09924191981554031, -0.6573315262794495, 0.35204198956489563, 0.42779386043548584, -0.2837052345275879, -0.0081711420...
condition does not re-occur. Any thougnts/Comments? FWIW: I will post my solution here for the benefit of others. @Joe: Thanks so much for the response. I am aware of the need to update the UI only from the UI thread. It is my understanding and I think I have confirmed this through the debugger that in SL2, that the...
[ 0.4647351801395416, -0.0670621320605278, 0.4071516990661621, -0.21486316621303558, 0.22325491905212402, 0.23958496749401093, 0.3815285563468933, -0.026869911700487137, -0.296457976102829, -0.8553210496902466, -0.38715389370918274, 0.5210991501808167, -0.05543419346213341, 0.024802779778838...
is called from the UI thread. My problem is not this, it is that I make two different calls (one for the manufacturers list and one for the component that references an id of a manufacturer) and then Bind both of these results to a single ComboBox. They both Bind on the UI thread, the problem is that if the list does n...
[ 0.4035678207874298, -0.21757104992866516, 0.36350017786026, 0.258120596408844, -0.15873682498931885, -0.054542265832424164, 0.009846220724284649, -0.7696934342384338, 0.0020043980330228806, -0.7374714016914368, 0.23331432044506073, 0.38557061553001404, -0.20714658498764038, 0.0558554343879...
condition, I discovered something else interesting. You should **NEVER** genrate a PropertyChanged event from within the "getter" for that property. Example: in my SL data object of type ManufacturerData, I have a property called "All". In the Get{} it checks to see if it has been loaded, if not it loads it like this: ...
[ 0.12020412087440491, -0.28135696053504944, 0.07118310779333115, 0.01144423894584179, 0.20493292808532715, -0.07381194829940796, 0.04037497937679291, -0.0206141397356987, -0.3890282213687897, -0.5994309782981873, 0.07258876413106918, 0.4554450213909149, -0.3883669078350067, 0.41551718115806...
LoadAllManufacturersAsync(); return mAll; } private set { mAll = value; OnPropertyChanged("All"); } } private void LoadAllManufacturersAsync() {
[ 0.29701998829841614, -0.2085309773683548, 0.33802494406700134, -0.25179100036621094, 0.25559449195861816, 0.22041240334510803, 0.22009630501270294, -0.3228703737258911, -0.05756298825144768, -0.2441236972808838, -0.43645596504211426, 0.9093030691146851, -0.44592753052711487, 0.109082825481...
if (!mCurrentlyLoadingAll) { mCurrentlyLoadingAll = true; // check to see if this component is loaded in local Isolated Storage, if not get it from the webservice ObservableCollection<Web.Manufacturer> all = IsoStorageManager.GetDataTransferObjectFromCache<ObservableCollecti...
[ 0.12385119497776031, -0.11019079387187958, 0.7510818839073181, 0.004526831675320864, 0.24512478709220886, 0.19368405640125275, 0.4247852563858032, -0.5683721303939819, -0.5091511011123657, -0.21713042259216309, -0.2656797766685486, 0.5981085300445557, -0.2527380883693695, 0.366494089365005...
{ UpdateAll(all); mCurrentlyLoadingAll = false; } else { Web.SystemBuilderClient sbc = GetSystemBuilderClient();
[ -0.025560207664966583, -0.20288340747356415, 0.6169154047966003, -0.14234378933906555, 0.254650741815567, -0.022771276533603668, 0.7833578586578369, -0.5102311372756958, -0.3581388592720032, -0.6379642486572266, -0.41657039523124695, 0.5314448475837708, -0.4258460998535156, 0.1794572323560...
sbc.Manufacturers_GetAllCompleted += new EventHandler<hookitupright.com.silverlight.data.Web.Manufacturers_GetAllCompletedEventArgs>(sbc_Manufacturers_GetAllCompleted); sbc.Manufacturers_GetAllAsync(); ; } } } private void UpdateAll(ObservableCollection<Web.Manufacturer> all)...
[ 0.33588457107543945, 0.21455906331539154, 0.46736520528793335, -0.2697884738445282, 0.01512851007282734, 0.23159106075763702, 0.24886839091777802, -0.5735098123550415, -0.44457852840423584, -0.4851892590522766, -0.5249791145324707, 0.47618213295936584, -0.4586515426635742, 0.40363755822181...
if (e.Error == null) { UpdateAll(e.Result.Records); IsoStorageManager.CacheDataTransferObject<ObservableCollection<Web.Manufacturer>>(e.Result.Records, mAllManufacturersIsoStoreFilename); } else OnWebServiceError(e.Error); mCurrentlyLoadingAll = false;...
[ 0.10102487355470657, 0.18615424633026123, 0.4201226234436035, -0.1009795293211937, 0.4399230480194092, 0.08263878524303436, 0.4654477536678314, -0.48115330934524536, -0.23841869831085205, -0.4752136170864105, -0.27922654151916504, 0.5504111051559448, -0.09364330768585205, 0.433481901884079...
"All" from within the All { Get {}} method which would normally cause the Binding System to call All {get{}} again...I copied this pattern of creating bindable silverlight data objects from a ScottGu blog posting way back and it has served me well overall, but stuff like this makes it pretty tricky. Luckily the fix is ...
[ 0.30586373805999756, -0.31357207894325256, 0.4281409680843353, 0.1366463601589203, -0.3173198401927948, -0.213675856590271, 0.3554594814777374, -0.3397543132305145, -0.2978020906448364, -0.7454941272735596, -0.1533917784690857, 0.39761003851890564, -0.4623948037624359, 0.2073887139558792, ...
complete Reset of the selection and clears the SelectedItem/SelectedIndex. You can see this here in the System.Windows.Controls.Primitives.Selector (the base class for the ComboBox): ``` protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e) { base.OnItemsChanged(e); int selectedIndex = thi...
[ -0.02136523835361004, -0.557486891746521, 0.32366296648979187, -0.14780102670192719, 0.6150286793708801, 0.12826837599277496, 0.346647173166275, -0.5085425972938538, -0.2952343821525574, -0.46989136934280396, -0.3449040949344635, 0.7137990593910217, -0.3218335807323456, 0.12817856669425964...
if ((e.NewStartingIndex <= selectedIndex) && !flag) { this._processingSelectionPropertyChange = true; this.SelectedIndex += e.NewItems.Count; this._processingSelectionPropertyChange = false;
[ 0.07936309278011322, -0.4975897967815399, 0.1996850222349167, -0.08620445430278778, 0.47376278042793274, 0.07818292826414108, 0.08088994026184082, -0.5844528079032898, 0.07324367761611938, -0.3553299009799957, -0.269039124250412, 0.2955390214920044, -0.3723159432411194, 0.25014302134513855...
} if (e.NewStartingIndex > this._focusedIndex) { return; } this.SetFocusedItem(this._focusedIndex +
[ 0.5056728720664978, -0.5325260162353516, 0.7580823302268982, -0.19266705214977264, 0.2069295346736908, -0.35361209511756897, 0.11932399123907089, 0.023842208087444305, -0.014639214612543583, -0.5713415145874023, -0.43576908111572266, 0.8656084537506104, -0.5723581314086914, 0.0409934706985...
e.NewItems.Count, false); } return; case NotifyCollectionChangedAction.Remove: if (((e.OldStartingIndex > selectedIndex) || (selectedIndex >= (e.OldStartingIndex + e.OldItems.Count))) && (e.OldStartingIndex < selectedIndex)) { this._processingSele...
[ -0.1171288788318634, -0.3556051552295685, 0.4207300841808319, -0.2178964614868164, 0.5216759443283081, 0.11658607423305511, 0.2817366123199463, -0.5170935988426208, -0.017101479694247246, -0.20875796675682068, -0.3541586101055145, 0.4528469443321228, -0.15530651807785034, 0.452867776155471...
this.SelectedIndex -= e.OldItems.Count; this._processingSelectionPropertyChange = false; } if ((e.OldStartingIndex <= this._focusedIndex) && (this._focusedIndex < (e.OldStartingIndex + e.OldItems.Count))) { this.SetFocusedItem(-1, false);
[ 0.07966970652341843, -0.4376131594181061, 0.4452182650566101, -0.1739397943019867, 0.383332222700119, 0.09554414451122284, 0.06998714804649353, -0.38309744000434875, -0.02114645205438137, -0.3579941987991333, -0.48002442717552185, 0.4905247688293457, -0.40449997782707214, 0.239852786064147...
return; } if (e.OldStartingIndex < selectedIndex) { this.SetFocusedItem(this._focusedIndex - e.OldItems.Count, false); } return; case NotifyCollectionChangedAction.Replace:
[ 0.24547024071216583, -0.4661460518836975, 0.31165072321891785, -0.11861353367567062, 0.4843316972255707, 0.00017304513312410563, 0.18579013645648956, -0.34387826919555664, -0.03316733241081238, -0.3026672899723053, -0.2846081256866455, 0.6871874332427979, -0.17820808291435242, 0.3144001066...
if (!this.AddedWithSelectionSet(e.NewStartingIndex, e.NewStartingIndex + e.NewItems.Count)) { if ((e.OldStartingIndex <= selectedIndex) && (selectedIndex < (e.OldStartingIndex + e.OldItems.Count))) { this.SelectedIndex = -1;
[ 0.00019443953351583332, -0.40496137738227844, 0.3259407877922058, -0.07948539406061172, 0.2908705770969391, 0.06459702551364899, 0.0036455527879297733, -0.4825386703014374, 0.003421335481107235, -0.39362743496894836, -0.4112900197505951, 0.3444073796272278, -0.1298573613166809, 0.276030093...
} if ((e.OldStartingIndex > this._focusedIndex) || (this._focusedIndex >= (e.OldStartingIndex + e.OldItems.Count))) { return; } this.SetFocusedItem(-1, false);
[ 0.295034795999527, -0.13602466881275177, 0.5600013732910156, -0.3504682183265686, 0.43758425116539, -0.009177838452160358, 0.3064657151699066, -0.2209249883890152, 0.13331559300422668, -0.14872083067893982, -0.730941116809845, 0.9878249168395996, -0.22593824565410614, 0.2952142357826233, ...
} return; case NotifyCollectionChangedAction.Reset: if (!this.AddedWithSelectionSet(0, base.Items.Count) && !flag) { this.SelectedIndex = -1; this.SetFocusedItem(-1, false);
[ 0.02313833124935627, -0.39995917677879333, 0.2154397815465927, -0.16302484273910522, 0.6459293961524963, 0.14849960803985596, 0.4472634792327881, -0.46953335404396057, -0.08600030094385147, -0.34148189425468445, -0.2924879789352417, 0.3951207399368286, -0.19476363062858582, 0.2043148130178...
} return; } throw new InvalidOperationException(); } ``` Note the last case - the reset...When you load a new ItemSource you end up here and any SelectedItem/SelectedIndex gets blown away?!?! Well the solution was pretty simple in the end. i just subclassed the errant ComboBox and provided and ov...
[ -0.07512348145246506, -0.3335368037223816, 0.07510700076818466, 0.06110571324825287, 0.18490959703922272, 0.05073648691177368, 0.1582125723361969, -0.153588205575943, -0.2867487668991089, -0.3533008098602295, -0.18196047842502594, 0.5614838600158691, -0.6057042479515076, 0.1810398995876312...
// This is here to sync the dep properties (OnSelectedItemChanged is private is the base class - thanks M$) base.SelectionChanged += (s, e) => { FixedSelectedItem = SelectedItem; }; } // need to add a safe dependency property here to bind to - this will store off the "requested selectedItem" // th...
[ 0.054937612265348434, -0.3753006160259247, 0.23736780881881714, 0.09015178680419922, 0.20331700146198273, 0.027618026360869408, 0.21611131727695465, -0.5054852962493896, -0.014865212142467499, -0.42015331983566284, -0.10824722051620483, 0.5135658979415894, -0.2618434727191925, 0.0838748291...
DependencyProperty.Register("FixedSelectedItem", typeof(object), typeof(FixedComboBox), new PropertyMetadata(null, new PropertyChangedCallback(FixedSelectedItemPropertyChanged))); private static void FixedSelectedItemPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { FixedComb...
[ -0.3739466369152069, -0.40558069944381714, 0.6575522422790527, -0.03423091769218445, 0.5341103076934814, 0.18891504406929016, 0.27765440940856934, -0.10435812175273895, -0.19414949417114258, -0.292224645614624, -0.535164475440979, 0.8553609848022461, -0.575967013835907, 0.2977137863636017,...
override void OnItemsChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { base.OnItemsChanged(e); if (-1 == SelectedIndex) { // if after the base class is called, there is no selection, try if (null != mLastSelection && Items.Contains(mLastSele...
[ -0.15238136053085327, -0.3849920332431793, 0.4154009222984314, -0.08541727811098099, 0.4514269232749939, 0.09775944799184799, 0.3082215487957001, -0.4605884253978729, -0.08437391370534897, -0.28304535150527954, -0.4641774594783783, 0.31527647376060486, -0.5283987522125244, 0.34113901853561...
} } protected object mLastSelection = null; } ``` All that this does is (a) save off the old SelectedItem and then (b) check that if after the ItemsChanged, if we have no selection made and the old SelectedItem exists in the new list...well...Selected It!
[ -0.08055934309959412, -0.15330596268177032, 0.3125516474246979, -0.16167451441287994, 0.21653224527835846, -0.13733284175395966, 0.19783739745616913, -0.18435102701187134, -0.22201679646968842, -0.33134689927101135, -0.30152538418769836, 0.5207216143608093, -0.5109090805053711, 0.414938777...
I am in the process of unifying these inconsistent naming conventions and this one problem has been a bit driving me crazy lately. In the code base I am working with has no convention regarding "ID"; "ID", "Id" and even "iD" are used inconsistently. \*\*\*\*Question\*\*: In .NET, how do you guys capitalize "ID"? For ...
[ 0.16796249151229858, 0.14275218546390533, 0.029859745875000954, 0.15365982055664062, -0.21862828731536865, -0.12079399079084396, 0.29140546917915344, 0.20728635787963867, -0.13138066232204437, -0.9606314897537231, -0.07877097278833389, 0.5109012126922607, -0.04658544063568115, -0.123349368...
Is it considered bad manners/bad practice to explicitly place object members on the heap (via new)? I would think you might want to allow the client to choose the memory region to instantiate the object. I know there might be a situation where heap members might be acceptable. If you know a situation could you describe...
[ 0.44098547101020813, -0.0040733469650149345, -0.6028117537498474, 0.2681177258491516, -0.27971017360687256, -0.08319775760173798, 0.27241528034210205, 0.13138151168823242, -0.3328651785850525, -0.6165627837181091, 0.0791337639093399, 0.32374680042266846, -0.1711282581090927, 0.192806512117...
Just make sure you're free of memory leaks (deallocate things in the destructor, reference count, etc.) and you're fine. If you want more flexibility, consider letting your user specify an [Allocator](http://en.cppreference.com/w/cpp/memory/allocator). I'll explain. Certain classes, e.g. `std::vector`, string, map, e...
[ 0.25745517015457153, -0.054000988602638245, 0.26512858271598816, 0.08615843951702118, 0.2010422796010971, -0.0637594535946846, 0.16827121376991272, -0.10849345475435257, -0.6496081948280334, -0.80837482213974, -0.13403606414794922, 0.658113956451416, -0.1824476569890976, -0.190297052264213...
allocated here. std::vector<int> foo(10); } ``` Likewise, for `std::string`, you know there's an internal, heap-allocated `char*`. Whether there's one per `string` instance is usually up to the STL implementation; often times they're reference counted. However, for nearly all of the STL classes, users **do** h...
[ -0.0646895095705986, -0.24154122173786163, 0.2307780534029007, -0.03934624791145325, -0.0844992995262146, 0.4050372838973999, -0.2655107080936432, -0.1187000498175621, -0.3753988742828369, -0.7176288962364197, -0.18076877295970917, 0.32273972034454346, -0.518787145614624, 0.038959164172410...
heap storage it may need. If users doesn't like the default allocation strategy, they can specify one of their own: ``` vector<int, MyCustomAllocator> foo(10); ``` Now when the constructor allocates, it will use a `MyCustomAllocator` instead of the default. Here are some [details on writing your own STL allocator](h...
[ -0.05232025682926178, -0.06938938796520233, 0.047959864139556885, 0.005024582613259554, 0.0003679780347738415, 0.10053186863660812, -0.15828634798526764, 0.004673431161791086, -0.515086829662323, -0.6230418682098389, -0.1000567227602005, 0.1654931902885437, -0.3093850016593933, 0.057692222...
I have a *little* experience with bug tracking systems such as FogBugz where help tickets are issues are (or can be) bugs, and I have some experience using a bug tracking system internally completely separate from a help center system. My question is, in a company with an existing (home-grown) help center system wher...
[ 0.5657621622085571, -0.11374395340681076, 0.12865275144577026, 0.45019903779029846, 0.34620243310928345, -0.057189974933862686, 0.25045427680015564, -0.020753389224410057, -0.38297930359840393, -0.5511805415153503, 0.08266156166791916, 0.33598077297210693, -0.22741301357746124, 0.004846452...
application issue they can't solve in the help desk it gets assigned to a developer). A user can put a request for small modifications or fixes to an application in a help ticket and the developer it gets assigned to will make the change at some point, apply their time to that ticket, and then close the ticket when it ...
[ 0.35218244791030884, 0.08664868772029877, 0.5961687564849854, 0.5735012888908386, 0.48118719458580017, -0.023803047835826874, 0.1524130254983902, -0.0894629955291748, -0.29470744729042053, -0.6882812976837158, -0.07858440279960632, 0.2433617264032364, -0.30505815148353577, -0.0589049160480...
issue or feature request) and then close the ticket if it's not an emergency fix? We probably don't want to expose the bug tracking system to anyone else as they wouldn't know what to put in the help center system and what to put in the bug tracker... right? Any thoughts? Suggestions? Tips? Advice? To-dos? Not to-dos?...
[ 0.3658147156238556, -0.19386954605579376, 0.4749821126461029, 0.3719120919704437, 0.32407474517822266, -0.2123967707157135, 0.11742532253265381, 0.024054430425167084, -0.34749194979667664, -0.38631945848464966, -0.06328384578227997, 0.5973827838897705, -0.5013431310653687, -0.0103040458634...
latter, you should not integrate at all.
[ 0.25667309761047363, 0.11590518057346344, -0.4714777171611786, 0.16260333359241486, -0.24223381280899048, -0.04801689833402634, 0.27884724736213684, 0.0489005446434021, -0.08930493146181107, -0.5858737826347351, -0.0439794659614563, 0.5660716891288757, -0.27547377347946167, -0.040482662618...
I want to know when I should use `include` or `require` and what's the advantage of each one. [`require`](http://us3.php.net/require) requires, [`include`](http://www.php.net/include) includes. According to the manual: > require() is identical to include() except upon failure it will produce a fatal E\_ERROR level er...
[ 0.6552025079727173, 0.11963167041540146, 0.3969414234161377, -0.39654067158699036, 0.41048523783683777, -0.22755123674869537, 0.6009638905525208, -0.5960029363632202, -0.12660209834575653, -0.3222348392009735, -0.3991939127445221, 0.7471783757209778, -0.45743587613105774, -0.08495832979679...
My 7 year old would like to learn, how to program? (his idea not mine, and he does things in the outside world. So, I am not too worried from that point of view. He already went so far as to take a game programming book out of my office to read at bed time.) The other day we sat down and wrote a very simple number gues...
[ 0.18289053440093994, -0.14221452176570892, -0.04899987578392029, 0.22803038358688354, -0.06011463329195976, 0.001638399320654571, 0.3286246061325073, 0.27667781710624695, -0.12468378990888596, -0.4261797368526459, 0.20427164435386658, 0.2838588356971741, 0.09352533519268036, 0.096622712910...
(I happened to pick Java as I had the IDE opened at the time.) I teach post-secondary introductory programming courses so this was a bit of an eye opener to me (most students out of high school are reluctant to ask questions) as I really had to figure out, how to explain syntax to a 7 year old? Clearly any C type lang...
[ 0.0838209018111229, 0.007908884435892105, -0.24709109961986542, -0.01263550017029047, -0.2686876952648163, -0.1895204484462738, 0.7122682929039001, 0.3717448115348816, -0.05809670686721802, -0.3141212463378906, 0.13956841826438904, 0.442062646150589, -0.10761791467666626, -0.28302156925201...
of view he is comfortable with a keyboard/mouse and can put together Lego sets with relative ease (so following directions with a fun outcome works for him). I have access to Lego NXT but he is still a bit young for that (it takes too long to see the results of the work, even with the supplied graphical environment). ...
[ 0.3220086395740509, 0.21665745973587036, 0.0624786876142025, 0.04697257652878761, 0.3795930743217468, 0.16643419861793518, 0.21655753254890442, 0.11466085910797119, -0.11700471490621567, -0.6254950165748596, 0.07695705443620682, 0.8857685327529907, 0.3219068646430969, -0.16721326112747192,...
ideas or if anyone can recommend a good logo environment? Edit 1: Logo works out well. I'll need to teach him the concept of angles (90 degrees, 180 degrees). Unfortunalty they don't really do division at school yet so angles might be fun... First off draw a square: ``` FORWARD 50 RIGHT 90 FORWARD 50 RIGHT 90 FORWA...
[ 0.5830512642860413, 0.1516883224248886, 0.48677879571914673, 0.07675835490226746, 0.1292819380760193, 0.1264292448759079, -0.20087936520576477, -0.20126649737358093, -0.2589844763278961, -0.5950093865394592, 0.19993473589420319, 0.43203648924827576, -0.10619593411684036, -0.351240187883377...
old to remember the vocabulary, and immediate feedback. Edit 2: Well it was a success, in that he was able to write a simple program (no loops yet) while I was out of the room. It actually works out very well - we went out and got to graph paper and a protractor, we fugured out 90 degree angles, and he made a bunch o...
[ 0.26794812083244324, 0.32672494649887085, 0.37855350971221924, 0.12228713184595108, -0.06596116721630096, 0.06064489111304283, 0.07050073891878128, -0.353985458612442, -0.12122006714344025, -0.5964053869247437, 0.20403307676315308, 0.4864784777164459, -0.01589139923453331, -0.1459619104862...
think I'd recommend it to my post-secondary students too (!) There is actually a browser-based Logo interpreter in Javascript. <http://logo.twentygototen.org/>
[ 0.46828538179397583, 0.18911030888557434, 0.20511649549007416, -0.061459895223379135, 0.0911673828959465, 0.009839721024036407, 0.07414668053388596, 0.3871706426143646, -0.4725610315799713, -0.6724010109901428, 0.30302512645721436, 0.41952356696128845, 0.19266360998153687, -0.5073636770248...
I am new to Python. I am writing an application using wxPython and I currently my code that generates a toolbar looks like this: ``` class Window(wx.Frame) def __init__(self, parent, plot): wx.Frame.__init__(self, parent, wx.ID_ANY, "Name", size =(900, 600)) self.Centre() self.toolbar = self.CreateToolBar...
[ 0.29616907238960266, 0.2889646291732788, 0.4632110595703125, -0.32442596554756165, -0.08420798927545547, 0.03598351031541824, 0.3056102693080902, -0.4143221378326416, -0.2725412845611572, -0.9214232563972473, -0.15917779505252838, 0.4006958603858948, -0.18046146631240845, 0.172052219510078...
toolbar, I simply call it something like this: ``` toolbar = Toolbar() ``` My question is how can I rewrite it so it works like that? Currently my code looks like this: ``` class Toolbar(): def __init__(self): self.toolbar = self.CreateToolBar(style=(wx.TB_HORZ_LAYOUT | wx.TB_TEXT)) self.toolbar...
[ -0.010229338891804218, 0.10439567267894745, 0.528095543384552, -0.3342885375022888, -0.08766156435012817, 0.10212787985801697, 0.19529913365840912, -0.3899737000465393, -0.17981432378292084, -0.8310389518737793, 0.05589111149311066, 0.7380213141441345, -0.26576167345046997, -0.058656405657...
to rewrite the **init** function? How do I fix it? Any help is greatly appreciated. Thanks Instead of a class that sets up your toolbar, use a function. The function can be a member function of your Window that subclasses wx.Frame. That way, the toolbar will get Created from the correct window, and be attached the way ...
[ 0.40008625388145447, -0.05568920448422432, 0.2931390702724457, 0.08752109110355377, -0.11037620157003403, 0.2802366018295288, 0.38860321044921875, -0.15940909087657928, -0.1913696527481079, -0.8464412093162537, -0.1609371304512024, 0.7542845606803894, -0.42151421308517456, 0.20656456053256...
def __init__(self, frame_to_connect_to): frame_to_connect_to.toolbar = frame_to_connect_to.CreateToolBar(style=(wx.TB_HORZ_LAYOUT | wx.TB_TEXT)) frame_to_connect_to.toolbar.SetToolBitmapSize((32,32)) frame_to_connect_to.toolbar.AddLabelTool(3, '', wx.Bitmap('GUI/icons/fileopen.png')) frame_to_connect_to...
[ 0.050809603184461594, -0.03851517662405968, 0.376576691865921, -0.019622040912508965, 0.03742741793394089, 0.17298908531665802, 0.3816278874874115, -0.6478770971298218, -0.303754061460495, -0.8535621166229248, -0.3225661814212799, 0.4389919936656952, -0.34102168679237366, 0.019498534500598...
=(900, 600)) self.Centre() self._init_toolbar() def _init_toolbar(self): self.toolbar = self.CreateToolBar(style=(wx.TB_HORZ_LAYOUT | wx.TB_TEXT)) self.toolbar.SetToolBitmapSize((32,32)) self.toolbar.AddLabelTool(3, '', wx.Bitmap('GUI/icons/fileopen.png')) self.toolbar.AddLabelTool(3, '', wx....
[ 0.16703708469867706, 0.17579543590545654, 0.7530739307403564, -0.21515558660030365, -0.11490169167518616, 0.2811529040336609, 0.07548075169324875, -0.6398952007293701, -0.17269770801067352, -0.8818377256393433, -0.31102392077445984, 0.8104789853096008, 0.000998373725451529, -0.233459502458...
I am looking to read the value of the allowScriptAccess tag so that if it is set to "never", or if it isn't set that I won't attempt to make an ExternalInterface call. Using the flex framework I can use Application.application. Is there an equivalent for Flash? It seems pretty well documented that accessing these param...
[ 0.09031163156032562, -0.013837052509188652, 0.3692789077758789, -0.10284710675477982, -0.22355520725250244, -0.2854572534561157, 0.3548762798309326, 0.017395630478858948, -0.20187243819236755, -0.7765280604362488, 0.00008600831642979756, 0.7696126699447632, -0.31159383058547974, -0.0453297...
I used the one-click installer to install 1.86 a while back. I wanted to upgrade to 1.9 but since there's no one-click installer for 1.9 I just downloaded the 1.91 binary and overwrote my 1.86 install. Didn't work so well. I got errors all over the place afterwards. What's the proper way to upgrade (for a dummy, i.e...
[ 0.28791067004203796, 0.11087501794099808, 0.24286091327667236, 0.04037909954786301, 0.10017696022987366, -0.1885051131248474, 0.6063138246536255, -0.10065927356481552, -0.11437592655420303, -0.4876949191093445, -0.203801229596138, 1.1264652013778687, -0.43173858523368835, 0.028399443253874...
then overwrite the install directory with 1.9? Or should I not have done that?** Is there a better way to do a clean install of 1.9? I guess I'm just not sure how to install 1.9 without using the 1.86 one-click installer first. To install, just extract the zip file into a folder of your choice. You will find that it ...
[ 0.6560542583465576, 0.14056642353534698, 0.08762761950492859, -0.07305494695901871, -0.04860280826687813, -0.16945858299732208, 0.6729763150215149, -0.03092687390744686, -0.15608754754066467, -0.7138348817825317, -0.09493569284677505, 0.7471089959144592, -0.36017119884490967, 0.08497481793...
folder separate from your 1.8 install, then change your path statement to point to this new folder. What is likely happening is that you are pulling in gems or other code that is incompatible with 1.9. A fresh 1.9 install will give you a better idea as to what code is missing and/or needs to be updated to work. --Bru...
[ 0.8030738234519958, 0.242824524641037, -0.16920879483222961, 0.33762192726135254, 0.14540427923202515, -0.47821545600891113, 0.3201580345630646, -0.059892576187849045, -0.38796761631965637, -0.37271884083747864, -0.4736986458301544, 0.7391520738601685, -0.3630197048187256, -0.1336390972137...
VS2008/C# newbie here. If I open our project, have no code files open, and hit Build Solution it'll show about half a dozen errors. Fine. When I start double-clicking open the individual code files (or double click on the error line) more errors start to crop up, and not necessarily about the file that I just opened....
[ 0.5780293941497803, 0.13255074620246887, 0.518224835395813, 0.23602594435214996, -0.14749570190906525, -0.18989680707454681, 0.7101840376853943, -0.013632792048156261, -0.4949225187301636, -0.5427041053771973, 0.2083299160003662, 0.7105724215507507, -0.16086852550506592, 0.1678075045347213...
setting or something we're missing? Edit: Sorry I wasn't more specific. It's a Visual C# Class Library project with 19 CS files with 1 to 3 classes in each file. I'd have to see to be sure, but I think what is happening is that you're seeing the compiler errors when you first build, and then as you open files, you get...
[ 0.5824680328369141, 0.26845782995224, 0.07348261028528214, 0.18428191542625427, -0.020780552178621292, 0.10964249074459076, 0.25972628593444824, -0.10412617027759552, -0.277142196893692, -0.6049049496650696, 0.16635487973690033, 0.22403950989246368, -0.3063283860683441, 0.06852658092975616...
you have a bunch of errors like this, there's some common cause that, once addressed, will fix the rest. For example, a missing reference or something like that.
[ 0.458575040102005, 0.4331582486629486, -0.0192366074770689, 0.4715944826602936, 0.22029274702072144, -0.053090568631887436, 0.12928496301174164, 0.2732647955417633, -0.20774319767951965, -0.44205084443092346, 0.16842864453792572, 0.30753520131111145, -0.15766464173793793, 0.124477036297321...
I'm writing a program that writes output to a file. If this file doesn't exist, I want to create it. Currently, I'm using the following flags when calling open: O\_WRONLY | O\_CREATE However, when this creates the file, it doesn't give me any permissions to write to it... How can I use open so that it creates a file...
[ 0.3162914216518402, 0.5596222877502441, 0.24107976257801056, -0.25407248735427856, 0.0054636308923363686, 0.004683587234467268, 0.4864596128463745, -0.015237953513860703, -0.223776176571846, -0.8745217323303223, -0.29914379119873047, 0.6072041988372803, -0.5617883801460266, 0.2940617799758...
Hi I have the following piece of code to upload a file to Sharepoint. It uses HTTP PUT: ``` public static string UploadFile(string destUrl, string sourcePath) { try { Uri destUri = new Uri(destUrl); FileStream inStream = File.OpenRead(sourcePath);
[ 0.14189645648002625, -0.17235921323299408, 0.8726799488067627, -0.1947583109140396, -0.046938225626945496, 0.006037818267941475, 0.2476986199617386, -0.39331871271133423, 0.39789795875549316, -0.691522479057312, -0.10253096371889114, 0.48990941047668457, -0.36300188302993774, 0.36483791470...
WebRequest req = WebRequest.Create(destUri); req.Method = "PUT"; req.Headers.Add("Overwrite", "F"); req.Timeout = System.Threading.Timeout.Infinite; req.Credentials = CredentialCache.DefaultCredentials;
[ -0.06412316113710403, -0.18445205688476562, 0.31533923745155334, 0.14778870344161987, 0.026441408321261406, 0.0074208942241966724, 0.7490875720977783, -0.1849420815706253, -0.15815286338329315, -0.6764969825744629, -0.3547787070274353, 0.5098586082458496, -0.2987363040447235, 0.28467917442...
Stream outStream = req.GetRequestStream(); string status = CopyStream(inStream, outStream); if (status == "success") { outStream.Close(); WebResponse ores
[ 0.0642174556851387, -0.4250446856021881, 0.7194225788116455, 0.016617655754089355, 0.3328929841518402, 0.09618864953517914, 0.409711092710495, 0.12445709109306335, 0.08301643282175064, -0.4181632399559021, -0.31305673718452454, 0.5957028269767761, -0.36598101258277893, 0.26043522357940674,...
= req.GetResponse(); return "success"; } else { return status;
[ -0.020617332309484482, -0.3968276083469391, 0.23525817692279816, -0.17566454410552979, 0.6135811805725098, -0.04181515425443649, 0.717233419418335, -0.2570169270038605, -0.04102621600031853, -0.2673893868923187, -0.7494004368782043, 0.8599859476089478, -0.04595744237303734, 0.1265749484300...
} } catch (WebException we) { return we.Message; } catch (System.Exception ee) {
[ 0.30738717317581177, -0.41917717456817627, 0.03528260439634323, -0.04246280714869499, 0.12434844672679901, 0.0863027349114418, 0.45139995217323303, -0.021052295342087746, -0.07593664526939392, -0.44725891947746277, -0.22140873968601227, 0.27719569206237793, -0.5201340317726135, 0.081921443...
return ee.Message; } } ``` When I run this code I get the exception: > "The remote server returned an error: (409) Conflict." Does anyone have any ideas as to where I am going wrong? Thanks, Alex I've had this issue when I was referencing the url of the document library and not the destinatio...
[ 0.304594486951828, 0.21609656512737274, 0.36728453636169434, -0.03681483119726181, 0.18880188465118408, -0.20315809547901154, 0.524724006652832, 0.2178461253643036, -0.35033226013183594, -0.7301555871963501, 0.05272308737039566, 0.6493179798126221, -0.2869458794593811, 0.34226900339126587,...
I'm writing a program in C# that has a custom collection. The custom collection performs some useful aggregate functions (AllSuccessful, %Successful, etc) over it's members which are of type ResultInfo. I have several classes that derive from ResultInfo (UploadResultInfo, XUploadResultInfo, and YUploadResultInfo), and ...
[ 0.1922883838415146, 0.12348587065935135, 0.3360236883163452, 0.014878598973155022, -0.09016463905572891, 0.23235763609409332, -0.030510209500789642, -0.27136844396591187, 0.019531358033418655, -0.4011256694793701, 0.20416225492954254, 0.49321049451828003, -0.33006030321121216, 0.0883962810...
there an elegant way of solving my problem? I've considered generics but I don't quite know how that would work. To define a generic class that handles any child of ResultInfo you just define it like ``` public class MyCollection<T> : ICollection<T> where T : ResultInfo { ... the required methods ... just use "T...
[ -0.26518014073371887, -0.11019326746463776, 0.46021023392677307, 0.1344846487045288, -0.006780039984732866, 0.0841551125049591, -0.1250229775905609, -0.26871010661125183, -0.1568077802658081, -0.5518382787704468, 0.22931337356567383, 0.5621345043182373, -0.36437395215034485, 0.152325496077...
I have two radio buttons and want to post the value of the selected one. How can I get the value with jQuery? I can get all of them like this: ``` $("form :radio") ``` How do I know which one is selected? To get the value of the **selected** `radioName` item of a form with id `myForm`: ``` $('input[name=radioName]...
[ 0.21874494850635529, 0.04370395094156265, 0.6838954091072083, -0.1014103814959526, -0.2922620475292206, -0.04052484780550003, 0.05905263125896454, -0.7269753217697144, 0.04325488582253456, -0.7348842620849609, -0.13284526765346527, 0.865152895450592, -0.3500206172466278, 0.1622911393642425...
<br /> </fieldset> </form> ```
[ 0.10945422947406769, 0.4038988947868347, 0.15382273495197296, -0.2652190625667572, -0.08295462280511856, -0.10253860801458359, -0.16478319466114044, -0.039787016808986664, -0.1457151472568512, -0.54032301902771, -0.5275025367736816, 0.3416268229484558, -0.21121089160442352, 0.1433670073747...
I want to process a particular mailbox when it receives mail, I know I could have cron check every n minutes for any mail, but wondering if there's a way to "listen" for mail rather than continually polling. Try a [.forward file](http://en.wikipedia.org/wiki/E-mail_forwarding) You can pipe the message into any program...
[ 0.4399607479572296, 0.1462671309709549, 0.3286399841308594, -0.06585089862346649, -0.09530448168516159, 0.2674514651298523, 0.2669834792613983, -0.017318377271294594, -0.2809639275074005, -0.8214647769927979, 0.06255808472633362, 0.28246641159057617, -0.16004858911037445, 0.014042844995856...
Are there any paradigm that give you a different mindset or have a different take to writing multi thread applications? Perhaps something that feels vastly different like procedural programming to function programming. Concurrency has many different models for different problems. The Wikipedia page for [concurrency](ht...
[ 0.15132930874824524, 0.01147609855979681, -0.061512358486652374, 0.36193230748176575, -0.19204020500183105, -0.022473836317658424, 0.08904145658016205, 0.07499368488788605, -0.7358000874519348, -0.4334186017513275, 0.47090643644332886, 0.4253736138343811, -0.35383743047714233, 0.4290482103...
was taught that concurrency uses [mutual exclusion](http://en.wikipedia.org/wiki/Mutual_exclusion) and [synchronization](http://en.wikipedia.org/wiki/Synchronization_(computer_science)) together to solve concurrency issues. Some solutions only require one, but with both you should be able to solve any concurrency issue...
[ 0.3063538074493408, 0.3202689588069916, 0.04992210865020752, 0.1681058406829834, -0.0022031229455024004, -0.18490460515022278, 0.3415697515010834, -0.10941371321678162, -0.4425850212574005, -0.22848205268383026, 0.24324320256710052, 0.04295375943183899, -0.1197766363620758, 0.6087514162063...
What is the correct way to get a control that was rendered by ASP.NET with jQuery? Example: I have a checkbox that was generated like this: ``` <input id="ctl00_Content_chkOk" type="checkbox" name="ctl00$Content$chkOk" /> ``` If I want to select it to get if it's checked, I tried this: ``` $('form input[name=chkOk...
[ -0.2377215325832367, -0.2524546980857849, 0.5162560939788818, 0.2565394639968872, 0.0953824520111084, -0.08786556869745255, 0.06582605093717575, -0.16931822896003723, -0.022321535274386406, -0.48382869362831116, -0.19501833617687225, 0.483442485332489, -0.27628293633461, -0.333850145339965...
I'm using Eclipse to generate `.equals()` and `.hashCode()`, and there is an option labeled "Use 'instanceof' to compare types". The default is for this option to be unchecked and use `.getClass()` to compare types. Is there any reason I should prefer `.getClass()` over `instanceof`? Without using `instanceof`: ``` i...
[ -0.0582941435277462, 0.14793838560581207, 0.37466248869895935, -0.2685159146785736, -0.22903046011924744, 0.002927920315414667, 0.32059991359710693, -0.18229122459888458, 0.03838410973548889, -0.6014183759689331, -0.0022697781678289175, 0.6978664994239807, -0.42267584800720215, 0.029336232...
any reason that's a bad idea? If you use `instanceof`, making your `equals` implementation `final` will preserve the symmetry contract of the method: `x.equals(y) == y.equals(x)`. If `final` seems restrictive, carefully examine your notion of object equivalence to make sure that your overriding implementations fully ma...
[ 0.08923878520727158, 0.3053475618362427, 0.12603867053985596, 0.21577224135398865, -0.03256009519100189, -0.2593384385108948, 0.3953384459018707, -0.1916399598121643, -0.23244749009609222, -0.44256284832954407, -0.0034419286530464888, 0.5445042848587036, -0.21980617940425873, 0.17197188735...
false. Liskov substitutability would encourage you to find a symmetry-preserving implementation that can yield `true` when it makes sense. If a subclass has a radically different notion of equality, is it really a subclass?
[ 0.11131460964679718, 0.06971430033445358, -0.27343761920928955, 0.23122040927410126, -0.31337103247642517, -0.14121855795383453, 0.5986013412475586, -0.2329418957233429, 0.014762717299163342, -0.24763017892837524, -0.24173441529273987, 0.2855514585971832, -0.41450634598731995, 0.2466038167...
I'd like to convert a float to a whole number in JavaScript. Actually, I'd like to know how to do BOTH of the standard conversions: by truncating and by rounding. And efficiently, not via converting to a string and parsing. ``` var intvalue = Math.floor( floatvalue ); var intvalue = Math.ceil( floatvalue ); var intval...
[ -0.08705154806375504, 0.2004624903202057, 0.6470650434494019, 0.11181917786598206, -0.27125194668769836, 0.19112347066402435, 0.010986756533384323, -0.4004434645175934, -0.4330962300300598, -0.5754527449607849, 0.01670141890645027, 0.3369569182395935, -0.16491828858852386, -0.0978804379701...
5 5 5 Math.ceil(value) // 5 6 6 Math.round(value) // 5 5 6 Math.trunc(value) // 5 5
[ -0.1592683643102646, 0.45023614168167114, 0.6114838123321533, -0.1981441080570221, -0.12992019951343536, 0.5204702019691467, -0.08648733794689178, -0.45033320784568787, -0.1614944189786911, -0.29909050464630127, -0.14273881912231445, 0.44649049639701843, 0.4776640236377716, 0.0818283036351...
5 parseInt(value) // 5 5 5 ~~value // 5 5 5 value | 0 // 5 5
[ -0.49721866846084595, 0.1425362527370453, 0.5841548442840576, -0.17294108867645264, 0.06988644599914551, 0.3615541458129883, 0.12271855026483536, -0.5085331797599792, 0.17185145616531372, -0.3865995407104492, -0.14376813173294067, 0.5359407663345337, 0.5318028926849365, 0.20057114958763123...
5 value >> 0 // 5 5 5 value >>> 0 // 5 5 5 value - value % 1 // 5
[ -0.0969095379114151, 0.0408439114689827, 0.42779257893562317, -0.12983044981956482, 0.008329757489264011, 0.06386721134185791, 0.2809918224811554, -0.5351234674453735, 0.24373048543930054, -0.3147140443325043, -0.12437573820352554, 0.2564389407634735, 0.3232995867729187, 0.5571829080581665...
5 5 ``` **Negative** ``` // value=x // x=-5 -5>x>=-5.5 -5.5>x>-6 Math.floor(value) // -5 -6 -6 Math.ceil(value) // -5 -5 -5 Math.round(value) // -5 -5
[ -0.10688789933919907, 0.4548364579677582, 0.6586581468582153, -0.15737226605415344, -0.11925002187490463, 0.2674209773540497, 0.10370109975337982, -0.5791192650794983, -0.30672428011894226, -0.6648021936416626, -0.12889352440834045, 0.28204137086868286, 0.37312689423561096, 0.2519035935401...
-6 Math.trunc(value) // -5 -5 -5 parseInt(value) // -5 -5 -5 value | 0 // -5 -5 -5 ~~value
[ -0.6636542677879333, 0.37429940700531006, 0.545861542224884, 0.007558522280305624, 0.049174875020980835, 0.26139259338378906, 0.28863525390625, -0.3871414363384247, 0.17161358892917633, -0.4261784553527832, -0.45597851276397705, 0.5089266300201416, 0.39368435740470886, -0.04936733841896057...
// -5 -5 -5 value >> 0 // -5 -5 -5 value >>> 0 // 4294967291 4294967291 4294967291 value - value % 1 // -5 -5
[ -0.1436116248369217, 0.21151578426361084, 0.15117333829402924, 0.004542894661426544, 0.11306793987751007, 0.40469831228256226, 0.2514742314815521, -0.421764612197876, 0.010261506773531437, -0.2971190810203552, -0.3467200696468353, 0.5334484577178955, 0.25676271319389343, 0.3698915839195251...
-5 ``` **Positive - Larger numbers** ``` // x = Number.MAX_SAFE_INTEGER/10 // =900719925474099.1 // value=x x=900719925474099 x=900719925474099.4 x=900719925474099.5 Math.floor(value) // 900719925474099 900719925474099 900719925474099 Math.ceil(value) // 900719925474099 90071992547...
[ -0.4980662763118744, 0.5577119588851929, 0.5362393856048584, 0.1422460675239563, 0.03679915517568588, 0.21287335455417633, 0.15458746254444122, -0.5014668107032776, -0.6760456562042236, -0.5094068646430969, -0.3612009286880493, 0.29682058095932007, 0.24554044008255005, 0.46136415004730225,...
900719925474099 900719925474099 value | 0 // 858993459 858993459 858993459 ~~value // 858993459 858993459 858993459 value >> 0 // 858993459
[ -0.6244047284126282, 0.1779402792453766, 0.1955854445695877, 0.2831738293170929, 0.06433100253343582, 0.25901347398757935, 0.3702794909477234, -0.1988924890756607, -0.19261592626571655, -0.48390448093414307, -0.3589436709880829, 0.8345452547073364, -0.1400151252746582, 0.30412906408309937,...