text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
On the program I'm writing I have a class `RestrictedUser` and class `User` that is derived from `RestrictedUser.` I'm trying to hide the User specific methods by casting to `RestrictedUser` but when I do the casting the User methods are still available. Also when I run the debugger the type of the variable comes up as... | [
-0.048697952181100845,
0.2239946722984314,
0.16050009429454803,
-0.2091939002275467,
-0.3566017746925354,
-0.14949087798595428,
0.2475418895483017,
-0.09887701272964478,
-0.36067095398902893,
-0.5705974102020264,
0.10275792330503464,
0.41581979393959045,
-0.5924757122993469,
0.164169773459... | |
compilation error. That won't be secure in any way, shape, or form, because even if you were to pass around the `RestrictedUser` to, say, another method, that method could do this:
```
if (restricted instanceof User) {
User realUser = (User)restricted;
realUser.methodDefinedInTheUserClass(); // !!
}
```
and ... | [
0.03575524687767029,
-0.016352707520127296,
0.28421691060066223,
0.030994663015007973,
0.27709677815437317,
-0.22595888376235962,
0.3260694146156311,
-0.14488261938095093,
-0.49991896748542786,
-0.5157925486564636,
-0.172723188996315,
0.45995083451271057,
-0.43224504590034485,
0.5741033554... | |
indeed "hide" the subclass's methods and fields, but not securely. | [
0.37008780241012573,
0.12951484322547913,
-0.47522079944610596,
0.12827527523040771,
0.12173626571893692,
-0.27488791942596436,
0.5951812863349915,
-0.2816579341888428,
0.07558925449848175,
-0.24025475978851318,
-0.5509950518608093,
0.17530487477779388,
0.004261060617864132,
0.192496344447... | |
I have the XML given below. From this XML, in an ASPX page with an ASCX control that will contain the data, I want a drop-down on top with option "GMAT", "GRE", "LSAT", and "MCAT". And when I select GMAT below it will show only GMAT brochure and same with others.
Can you please provide some code for this?
```
<?xml v... | [
0.1828194409608841,
0.20217733085155487,
0.8424919247627258,
0.14019103348255157,
-0.25106552243232727,
0.08330391347408295,
0.09185922890901566,
-0.013959994539618492,
-0.027708986774086952,
-0.5883389115333557,
-0.17993341386318207,
0.9293000102043152,
-0.15626898407936096,
-0.1135233342... | |
and Online Coursegrams.</p></Description>
<FilePath>/Images/gmat_brochure_uk_tcm55-8064.pdf</FilePath>
</data>
<data>
<ImageId>tcm5510981</ImageId>
<ImageURL>/Images/practice-test-image_tcm55-10980.JPG</ImageURL>
<ImageTitle>GMAT Problem Solving Questions and Answers</Image... | [
-0.1299932450056076,
0.026156509295105934,
0.6146730184555054,
0.6746441125869751,
-0.2175033688545227,
0.17195121943950653,
0.015283863060176373,
-0.3863487243652344,
0.06514157354831696,
-0.32120805978775024,
-0.12237943708896637,
0.8275809288024902,
-0.07907024025917053,
-0.191851764917... | |
<ImageId>tcm5511066</ImageId>
<ImageURL>/Images/practice-test-image_tcm55-10980.JPG</ImageURL>
<ImageTitle>GMAT Sentence Correction Practice Questions</ImageTitle>
<Description><p xmlns="http://www.w3.org/1999/xhtml">Tick the box to
download GMsee how you might do on t... | [
-0.06335893273353577,
0.19697235524654388,
0.7203171849250793,
0.08060967922210693,
-0.19608575105667114,
-0.07799744606018066,
0.5726235508918762,
-0.31465157866477966,
-0.09048021584749222,
-0.3519967496395111,
0.07956687361001968,
0.9140264391899109,
0.08740402013063431,
-0.267180025577... | |
</data>
<data>
<ImageId>tcm556663</ImageId>
<ImageURL>/Images/gre_brochure_thumb_tcm55-7315.gif</ImageURL>
<ImageTitle>GRE Brochure</ImageTitle>
<Description><p xmlns="http://www.w3.org/1999/xhtml">Courses and
Tutoring for the Grprograms</p></Descript... | [
-0.3112897574901581,
0.5061511993408203,
0.8998483419418335,
0.07024458050727844,
-0.2996082603931427,
0.24251754581928253,
0.11871280521154404,
-0.6064034104347229,
-0.3166281580924988,
-0.3075207769870758,
-0.0767383724451065,
0.6246870756149292,
0.17358022928237915,
-0.02626244165003299... | |
<ImageTitle>GRE Quantitative Questions Answers and Explanations</ImageTitle>
<Description>Download the answers and exp with the correct answer. Tick
the box and click download now to start the process.</Description>
<FilePath>/Images/gre-quantitative-practice-questions_tcm55-11214.pd... | [
-0.3508271872997284,
0.3132164478302002,
0.5535148978233337,
-0.009282750077545643,
-0.5414109826087952,
0.126211479306221,
0.27228426933288574,
-0.5139064192771912,
-0.023674245923757553,
-0.5937377214431763,
-0.2544021010398865,
0.380581259727478,
0.0007324323523789644,
-0.29811504483222... | |
Answers and Explanations</ImageTitle>
<Description><p xmlns="http://www.w3.org/1999/xhtml">Complete the
sentence on the download now button to see how you did.</p></Description>
<FilePath>/Images/gre-sentence-completions_tcm55-11213.pdf</FilePath>
</data>
<data>
... | [
-0.05473615974187851,
0.21288159489631653,
0.6045286655426025,
0.3405049443244934,
-0.09795496612787247,
0.019590122625231743,
0.16469942033290863,
-0.4594976007938385,
-0.07807720452547073,
-0.42905473709106445,
-0.34897905588150024,
0.3645220100879669,
-0.05156499147415161,
0.00140042090... | |
law schools</Description>
<FilePath>/Images/lsat-brochure_tcm55-8066.pdf</FilePath>
</data>
<data>
<ImageId>tcm5511275</ImageId>
<ImageURL>/Images/practice-test-image_tcm55-10980.JPG</ImageURL>
<ImageTitle>LSAT Comparative Reading Practice Questions Answers and Explanations</Imag... | [
0.3548550605773926,
0.1603161096572876,
0.4165492355823517,
0.011388544924557209,
0.026529911905527115,
0.026538532227277756,
0.3493293523788452,
0.07455044984817505,
-0.05629009008407593,
-0.811347246170044,
-0.1252036839723587,
0.8888131380081177,
0.11092940717935562,
0.16638407111167908... | |
<data>
<ImageId>tcm5511281</ImageId>
<ImageURL>/Images/practice-test-image_tcm55-10980.JPG</ImageURL>
<ImageTitle>LSAT Reading Comprehension Practice Questions Answers and Explanations</ImageTitle>
<Description><p xmlns="http://www.w3.org/1999/xhtml">Read the passage
... | [
0.35254034399986267,
0.27589496970176697,
0.13351906836032867,
-0.10622314363718033,
-0.3310379981994629,
0.07302939891815186,
0.5515474081039429,
-0.42806780338287354,
-0.26211944222450256,
-0.32194048166275024,
-0.129830002784729,
0.32232996821403503,
-0.0873708575963974,
-0.359665036201... | |
<FilePath>/Images/lsat-reading-comprehension_tcm55-11280.pdf</FilePath>
</data>
<data>
<ImageId>tcm558074</ImageId>
<ImageURL>/Images/mcat_brochure_thumb_tcm55-7317.gif</ImageURL>
<ImageTitle>MCAT Brochure</ImageTitle>
<Description>Courses and Tutoring for the Medical College Adm... | [
0.012466969899833202,
0.49436283111572266,
0.599707305431366,
0.2038939893245697,
0.17835526168346405,
0.11214571446180344,
-0.08274347335100174,
-0.37579450011253357,
-0.2719751000404358,
-0.5950005054473877,
-0.06965216994285583,
0.6615586876869202,
0.4642820656299591,
0.2941025793552398... | |
<ImageURL>/Images/practice-test-image_tcm55-10980.JPG</ImageURL>
<ImageTitle>MCAT Biological Sciences Practice Questions Answers and Explanations</ImageTitle>
<Description>Have you wri download now to find out how you've done.</Description>
<FilePath>/Images/mcat-biological-sciences_tcm55-11271.... | [
0.3694215714931488,
0.11204683780670166,
0.7379234433174133,
-0.12029209733009338,
-0.22775818407535553,
-0.10135917365550995,
0.26207318902015686,
-0.46627867221832275,
-0.21710163354873657,
-0.5168824195861816,
-0.10834799706935883,
0.6048623323440552,
-0.06721846014261246,
0.29307192564... | |
xmlFile = @Server.MapPath("~/" + ConfigurationManager.AppSettings["BrochureXml"].ToString());
string sfinalString = "";
hdnIds.Value = "";
try
{
if (File.Exists(xmlFile))
{
xmlFileData.ReadXml(xmlFile); | [
0.09347081929445267,
-0.422789067029953,
0.6680808663368225,
-0.21618391573429108,
0.16858871281147003,
-0.08811625093221664,
0.09047836065292358,
-0.18825913965702057,
0.05037445202469826,
-0.6275957822799683,
-0.43121060729026794,
0.41269564628601074,
-0.5057086944580078,
0.1930406987667... | |
}
}
catch (Exception ex)
{
throw ex;
}
return xmlFileData;
}
```
> I want a dropdown on top with option "GMAT", "GRE", "LSAT", "MCAT"
Right now, you could only select those items based on string-parsing the ImageTitle and finding substring in it - less than op... | [
0.0524967685341835,
-0.3236490488052368,
0.5492998361587524,
0.09388743340969086,
0.11492428183555603,
-0.13100647926330566,
0.049777157604694366,
0.027287324890494347,
-0.08691182732582092,
-0.2702012360095978,
-0.32456597685813904,
0.6298324465751648,
-0.2934710681438446,
-0.033180911093... | |
at all, I'd recommend adding a tag (or whatever you want to call it) to your data, something like this:
```
<data>
<ImageId>tcm556662</ImageId>
<ImageURL>/Images/2008_gmat_brochure_uk_thumb_tcm55-7311.gif</ImageURL>
<ImageTitle>GMAT Brochure</ImageTitle>
<Type>GMAT</Type>
<Description><p xmlns="http://www... | [
0.26800620555877686,
-0.09578511863946915,
0.5977185964584351,
0.18146836757659912,
-0.04607194662094116,
-0.11288768798112869,
0.21777404844760895,
-0.2512766122817993,
-0.04841111600399017,
-0.6705671548843384,
-0.18652655184268951,
0.8078996539115906,
0.05576741322875023,
-0.24915154278... | |
I'm starting a new project and plan on using nhibernate. I'm struggling with whether or not I should keep my domain model clean of persistence information by leaving out foreign keys. I keep feeling like some of my "model" isn't really necessary and that performance is going to be an issue. For example:
In my db I hav... | [
-0.1393120139837265,
0.28783202171325684,
0.31379076838493347,
-0.06606557965278625,
-0.33334049582481384,
0.05788673833012581,
0.2480994313955307,
0.12490064650774002,
-0.10530096292495728,
-0.7227720618247986,
0.36081239581108093,
0.2523796260356903,
-0.19625899195671082,
0.6022673249244... | |
{ get; set; }
virtual PostingStatus Status { get; set; }
// ..
}
class PostingStatus
{
virtual int Id { get; set; }
virtual string Name { get; set; }
}
```
Does PostingStatus belong in my model? and in cases where I know the FK ahead of time, like updating a posting after a submit, isn't it a pretty ... | [
-0.08000139892101288,
-0.006608572322875261,
0.4785510301589966,
0.10685721784830093,
-0.4054114520549774,
-0.07698715478181839,
0.15544094145298004,
0.3182002007961273,
-0.3583274483680725,
-0.65537428855896,
0.25822094082832336,
0.1970357447862625,
-0.19241759181022644,
0.343856930732727... | |
an pieces of the discussion that have shotty relevance. Thoughts or resources on this issue would be greatly appreciated.
If the Domain Model requires relationships to be enforced then you need Foreign Keys.
Don't worry about performance until you actually have a performance problem. | [
0.15250848233699799,
0.04065787047147751,
0.2888410985469818,
0.40028083324432373,
-0.1126677542924881,
-0.2888484299182892,
0.4711934030056,
-0.027461836114525795,
-0.33195415139198303,
-0.43186697363853455,
-0.1598234325647354,
0.6998552083969116,
-0.022552676498889923,
0.022006299346685... | |
What's the difference between *Explicitly implement the interface* and *Implement the interface*.
When you derive a class from an interface, intellisense suggest you to do both.
But, what's the difference?
Another aspect of this:
If you *implicitly* implemented, it means that the interface members are accessible to... | [
0.37183257937431335,
-0.15786288678646088,
-0.11207243800163269,
-0.10885156691074371,
-0.11423017829656601,
0.12158562242984772,
0.14604753255844116,
-0.28758835792541504,
-0.0453781895339489,
-0.6746142506599426,
0.23969298601150513,
0.6816736459732056,
-0.6329561471939087,
-0.2158951163... | |
Sleep();
}
class Wombat : Animal, Animal2
{
// Implicit implementation of Animal2
public void Sleep()
{
}
// Explicit implementation of Animal
void Animal.EatRoots()
{
}
void Animal.EatLeaves()
{
}
}
```
Your client code
```
Wombat w = new Wombat();
w.Sleep();
w.EatRo... | [
0.34499746561050415,
0.04410563409328461,
-0.12353237718343735,
-0.556717574596405,
0.360745370388031,
0.3259536325931549,
0.3340769112110138,
-0.2711392343044281,
-0.0710938349366188,
-0.8789616227149963,
-0.16814549267292023,
0.7182385921478271,
-0.765125036239624,
-0.05413547530770302,
... | |
What jQuery plugins exist for a vertical hover accordion? I am looking for a plugin to be used for a menu where:
* sub-menu items will only expand after a second being hovered over (so something that perhaps uses the hoverIntent plugin);
* it can degrade gracefully if Javascript is turned off; and
* will collapse/clos... | [
-0.023159978911280632,
-0.20357343554496765,
0.3148229122161865,
-0.016081340610980988,
0.1098683550953865,
0.4401814639568329,
-0.1030975878238678,
0.3143334984779358,
-0.6158201098442078,
-0.8004477024078369,
0.3122226297855377,
0.7097547054290771,
0.13253594934940338,
0.218451589345932,... | |
When you step back and look at ...
* the nature of animals, insects, plants and the problems they have organically solved
* perhaps even the nature and balance of the universe
Have you ever been able to solve a problem by deriving an approach from nature?
I've heard of [Ant Colony Algorithms](http://en.wikipedia.or... | [
0.6010419130325317,
-0.17137768864631653,
-0.03376931697130203,
0.2622915506362915,
-0.3116540014743805,
0.13685494661331177,
0.26326417922973633,
0.25135737657546997,
-0.7106803059577942,
-0.6595260500907898,
0.20878766477108002,
0.29908081889152527,
0.20859406888484955,
0.273637294769287... | |
recommend watching the "[Hunting the Hidden Dimension](http://www.pbs.org/wgbh/nova/fractals/)" Nova episode on fractals.
I remember reading a book by a mathematician about the field of mathematics, and he mentioned an example from nature. His example from nature helped me improve a design I was working on.
His exampl... | [
0.5684354305267334,
-0.18545827269554138,
0.16237691044807434,
0.36138424277305603,
0.16197627782821655,
-0.40633028745651245,
-0.045207101851701736,
0.2810564339160919,
-0.30922454595565796,
-0.38231325149536133,
0.24912813305854797,
0.36070507764816284,
-0.1694750040769577,
0.06282760202... | |
Birds prefer to maximize their free space, I guess.
This helped me at a point when I was fairly new to OO. I kept tending to make things procedural and have centralized intelligence in "god-objects". I read this and realized that individual objects could focus only on the things they needed to know and care about, and... | [
0.5305054783821106,
0.16619287431240082,
-0.25358685851097107,
0.3153347373008728,
-0.17433877289295197,
0.308214396238327,
0.18055088818073273,
0.03686477243900299,
-0.1566530019044876,
-0.5089744329452515,
0.10745155066251755,
0.34725335240364075,
-0.583652913570404,
-0.12626224756240845... | |
I need to create table on the fly in C#.net program. Task is to export excel file to SQL Database. How to write store procedure for creating table if column name and table name are passed as parameters? I tried to write following SP.
```
ALTER PROCEDURE dbo.CreateTempTable
@Param1 VarChar(50),
@Param2 VarChar(50),
@P... | [
0.22241339087486267,
0.2917840778827667,
0.619982898235321,
0.039630305022001266,
-0.025305485352873802,
0.357338547706604,
0.23769336938858032,
-0.7132408618927002,
-0.32452329993247986,
-0.5024341940879822,
-0.0056734164245426655,
-0.009615222923457623,
-0.25321322679519653,
0.0910138264... | |
should be
```
exec ('CREATE TABLE [dbo.Temp] (' + @param1 + ' int,' + @param2 + ' [DateTime], ' + @Param3 + ' VarChar, ' + @Param4 + ' VarChar)')
```
Although, as you're calling it from .net, you might as well just build up a string in .net and execute that as inline SQL...
eg:
```
string sql = string.Format("CR... | [
0.24768106639385223,
0.09615164250135422,
0.4241511821746826,
0.08574040234088898,
-0.2718581259250641,
0.016082122921943665,
0.19471949338912964,
-0.4260687828063965,
0.08392892777919769,
-0.4587581157684326,
-0.18383994698524475,
0.2599951922893524,
-0.2895316779613495,
0.105411089956760... | |
I'm upsizing a backend MS Access database to SQL Server. The front-end client will remain an Access application for the time being (has about 30k lines of code).
The aim is to eventually allow synchronisation of the database accross multiple servers (not using replication but probably the sync framework).
Currentl... | [
-0.2057143896818161,
0.2750433087348938,
0.8396845459938049,
0.16516029834747314,
0.04813306778669357,
0.0807037204504013,
0.04542466998100281,
-0.09065095335245132,
-0.35734233260154724,
-0.7099542021751404,
0.05346258729696274,
0.5261589288711548,
-0.26679274439811707,
0.2555070519447326... | |
and allow the PK to be created on the client if necessary, for instance in Offline mode).
**GUID**
*Pro:*
* standardised format.
* uniqueness assured (practically anyway)
*Cons:*
* not easy to manipulate in Access, especially when using them as filters for subforms or in controls.
* degrade INSERT performance due... | [
0.04291382059454918,
-0.04110183194279671,
0.2163017988204956,
0.2041841745376587,
-0.2922925055027008,
-0.07437772303819656,
0.22529509663581848,
-0.0007239858387038112,
-0.2874636650085449,
-0.7572822570800781,
-0.42081671953201294,
0.4355124831199646,
-0.2812606394290924,
-0.29771581292... | |
conversions to/from string).
My idea for a codification scheme would be along the lines of a 10 character code split into:
* 8 digits for a timestamp
* 4 digits for a unique client ID
* 2 digits as a random number for potential colisions
Each digit would be in base 34, composed of letters from A-Z and 2-9, avoiding `... | [
0.13423822820186615,
0.16531667113304138,
0.39370980858802795,
-0.14338688552379608,
-0.0997624322772026,
0.5785824060440063,
0.5305961966514587,
-0.537732720375061,
-0.013582699000835419,
-0.7700558304786682,
-0.25000452995300293,
0.41517338156700134,
-0.25227540731430054,
-0.036363285034... | |
to adapt).
* uniqueness assured (practically)
*Cons:*
* performance in JOIN hasn't been proven
* performance in INSERT should be faster than GUID but not proven
* Each server/client machine must be set its own UID, although that should not be too much of an issue.
So, should I use GUID or another scheme for my PK?
*... | [
-0.1771642565727234,
-0.06746584177017212,
0.35889583826065063,
0.16087405383586884,
-0.17274469137191772,
-0.19399282336235046,
0.11875227093696594,
-0.09062513709068298,
-0.4654659926891327,
-0.986664891242981,
0.07657437026500702,
0.6219157576560974,
-0.5243546366691589,
0.0940014868974... | |
their randomness.***
-> If you have performance problem based od this, you can have cluster index on another column (timestamp for example). But MSSQL server has two function for generating new GUID values - "newid()" and "newsequenceid()". The second methods - as name says - generates new values in sequence, so the i... | [
-0.19617830216884613,
-0.17174279689788818,
0.5327704548835754,
0.04991244524717331,
-0.11054741591215134,
0.24174927175045013,
0.1378491222858429,
-0.10952849686145782,
-0.3929056227207184,
-0.9489650130271912,
0.07411374896764755,
0.5972131490707397,
-0.3432638943195343,
0.12888810038566... | |
think you should worry about efectivity of JOINs on GUID columns. The joining GUID columns is much more eficient than conditions on text columns for example.
I don't hink the Custom codification scheme is good idea, because you must solve many things. On other hand the GUID is standardly used and tools are ready to us... | [
0.30662763118743896,
0.15646450221538544,
0.2002536952495575,
0.22831957042217255,
-0.12343230843544006,
-0.21769556403160095,
0.22431029379367828,
0.24502168595790863,
-0.28483182191848755,
-0.7176424860954285,
0.22296039760112762,
0.7435649037361145,
-0.31273889541625977,
-0.133336663246... | |
How can i add Checkbox in listbox. i want to make it in asp.net .
You probably want to use [CheckBoxList](http://www.w3schools.com/aspnet/control_checkboxlist.asp). | [
0.390226274728775,
-0.33948206901550293,
0.0919128879904747,
0.21593372523784637,
0.044367752969264984,
-0.2724083662033081,
0.2925329804420471,
0.07140715420246124,
-0.30841493606567383,
-0.7305164337158203,
0.15257298946380615,
-0.005538260564208031,
-0.2363882213830948,
-0.3457424938678... | |
I've read somewhere on MSDN that the equivalent to C#'s "is" keyword would be dynamic\_cast, but that's not really equivalent: It doesn't work with value types or with generic parameters. For example in C# I can write:
```
void MyGenericFunction<T>()
{
object x = ...
if (x is T)
...;
}
```
If I try t... | [
-0.049624912440776825,
-0.33580639958381653,
0.33652767539024353,
-0.2715790271759033,
-0.13222485780715942,
-0.13254694640636444,
0.16748183965682983,
-0.014750998467206955,
0.011319516226649284,
-0.5094586610794067,
-0.13705451786518097,
0.6970802545547485,
-0.616503894329071,
0.25354659... | |
to 'T'".
The only thing I can think of is to use reflection:
```
if (T::typeid->IsAssignableFrom(obj->GetType()))
```
Is there a simpler way to do this?
You can use `safe_cast` where you would use `dynamic_cast` in native C++ and trap the System::InvalidCastException. In terms of *compatible types* the semantics of... | [
0.45457759499549866,
-0.35030871629714966,
0.09731746464967728,
0.06370366364717484,
-0.19244806468486786,
-0.06875984370708466,
0.19225549697875977,
-0.26789942383766174,
0.002204506890848279,
-0.44267672300338745,
-0.07838201522827148,
0.9559805989265442,
-0.38277244567871094,
-0.2448841... | |
I have XML file with values expressed in SI unit (m, N).
I use an XSLT document to transform it into HTML page where I would like to display values with other units (um, mN).
Is there a way to modify values I extract from my XML document using XSLT without modifying XML content before XSLT processing ?
Thanks in adva... | [
0.26587703824043274,
0.15771158039569855,
0.37273138761520386,
0.11654345691204071,
0.10348765552043915,
0.45177435874938965,
-0.07698842883110046,
-0.32174035906791687,
-0.15363790094852448,
-0.8767927289009094,
0.2599780261516571,
0.36726313829421997,
0.041647009551525116,
0.063967905938... | |
I thought I understood Perl RE to a reasonable extent, but this is puzzling me:
```
#!/usr/bin/perl
use strict;
use warnings;
my $test = "'some random string'";
if($test =~ /\'?(.*?)\'?/) {
print "Captured $1\n";
print "Matched $&";
}
else {
print "What?!!";
}
```
prints
> Captured
>
> ... | [
0.17882081866264343,
-0.4191693663597107,
0.5074145197868347,
-0.10235895216464996,
-0.05884206295013428,
-0.16721230745315552,
0.24880284070968628,
-0.29751068353652954,
-0.20178547501564026,
-0.20330657064914703,
-0.3238655626773834,
0.40739184617996216,
-0.44702693819999695,
0.187424048... | |
This in between behaviour baffles me, can anyone explain what is happening?
The `\'?` at the beginning and end means *match 0 or 1 apostrophes greedily*. (As another poster has pointed out, to make it non-greedy, it would have to be `\'??`)
The `.*?` in the middle means *match 0 or more characters non-greedily*.
The ... | [
-0.010858890600502491,
-0.16396717727184296,
0.4833971858024597,
-0.12533888220787048,
-0.1417236328125,
0.23099467158317566,
0.025233779102563858,
0.2629489004611969,
0.13302162289619446,
-0.2900152802467346,
-0.47110283374786377,
0.42812827229499817,
-0.33113086223602295,
-0.169364765286... | |
by the empty string. | [
0.1460159868001938,
0.2080925852060318,
0.27530530095100403,
-0.16945913434028625,
-0.3567464351654053,
0.10813339054584503,
-0.14888806641101837,
0.1128588318824768,
-0.5501844882965088,
0.15619449317455292,
-0.07429500669240952,
-0.16185800731182098,
-0.3760758638381958,
0.49945828318595... | |
Is it possible to pause a process, save the memory contents to a file, and then later reload the file so you can continue the program?
**Edit**
I've been reading about this:
<http://en.wikipedia.org/wiki/Setcontext>
Is it possible to dump the contents of the struct, and somehow force malloc to allocate the same memo... | [
0.4849192500114441,
-0.2141457200050354,
0.2157430797815323,
0.02277861349284649,
0.14777760207653046,
-0.05068717896938324,
0.14391854405403137,
0.10665792226791382,
-0.6002945303916931,
-0.3902477025985718,
-0.1740342080593109,
0.448600172996521,
-0.11130068451166153,
0.08669766783714294... | |
the whole machine state together with all programs running. | [
0.10450849682092667,
0.4038074016571045,
0.3125392198562622,
0.308633029460907,
-0.04521280899643898,
0.02251395769417286,
0.2748856544494629,
0.18194089829921722,
-0.081443652510643,
-0.6080732941627502,
-0.20477090775966644,
0.539473295211792,
-0.14747968316078186,
0.4130128026008606,
... | |
I'm developing an ASP.Net mvc application which has a requirement to do some small, atomic actions without an entire page postback. The logical way of doing this is of course with an ajax call.
My question is - **What would people suggest is the best way of achieving this?**
As far as I am aware I can do it along t... | [
0.4134424030780792,
0.009942430071532726,
0.37164828181266785,
-0.12799327075481415,
-0.2035062164068222,
-0.31731194257736206,
0.27742284536361694,
0.02239489182829857,
-0.40988022089004517,
-0.5129857063293457,
-0.1382865160703659,
0.5413283109664917,
-0.25959455966949463,
-0.08718765527... | |
via cookie/session id but as far as I am aware all the above methods allow this.
On the whole whichever method I end up using will be accessing the database via standardised accessible method calls, so I'm not tied into keeping everything within the same project/namespace.
Would love to hear peoples thoughts / experi... | [
0.12447606027126312,
-0.32734400033950806,
0.10406774282455444,
0.3842805027961731,
-0.22496692836284637,
-0.2193087935447693,
0.23793677985668182,
-0.08044266700744629,
-0.5468385815620422,
-0.49034661054611206,
-0.15658235549926758,
0.42989495396614075,
-0.24129226803779602,
0.0481028258... | |
a common approach in Rails and also in ASPMVC. | [
-0.005325134377926588,
-0.30477550625801086,
0.19154031574726105,
0.17662638425827026,
0.15504321455955505,
-0.32551082968711853,
-0.0750088095664978,
-0.08531400561332703,
-0.23256227374076843,
-0.6362555027008057,
-0.12692886590957642,
0.3915192484855652,
0.07311177253723145,
-0.19167195... | |
I use an O/R mapper, that can reload objects from the DB in a generic manner. I would like to be able to intercept the request *right after* the creation of the mapped objects, in order to reload them.
ActionFilters are of course there, yet the problem is that ActionFilters (or the examples I have seen) can handle th... | [
0.3688606917858124,
-0.030845368281006813,
0.20353932678699493,
0.24914589524269104,
-0.21844248473644257,
-0.13694138824939728,
0.5451195240020752,
0.001903512398712337,
-0.33279263973236084,
-0.4519105851650238,
-0.09638071805238724,
0.35160547494888306,
-0.24259397387504578,
0.132438138... | |
you for your suggestions!
Nasser
Ok, after reading through all your answers and trying to find my error, I almost compeletely rewrote my code.
Finally, I removed debug output I added when the error occured for the first time.
```
NSLog(@"Object count: %@", [objects count]);
```
As `NSArray`'s `count` doesn't return... | [
0.17215365171432495,
0.17934060096740723,
0.04876536503434181,
0.1440930962562561,
-0.2759550213813782,
0.013677289709448814,
0.4334770441055298,
0.004893297329545021,
-0.13049793243408203,
-0.5093806385993958,
0.06828315556049347,
0.5106844305992126,
-0.47712379693984985,
0.39945659041404... | |
problem. I double checked this now. | [
-0.004456344060599804,
-0.004051318392157555,
0.27400025725364685,
0.12694679200649261,
0.27245742082595825,
0.05334550514817238,
0.29062679409980774,
-0.0791003555059433,
-0.4706466794013977,
-0.36453357338905334,
0.35825347900390625,
0.6013734340667725,
-0.22907742857933044,
-0.059642594... | |
I have a business object collection (representing data from the database) that inherits from Collection and has a static method that calls a stored proc and then populates its properties with the data returned.
My question is; is it wrong to inherit from Collection as it doesnt really extend the class? or would it be ... | [
0.12882527709007263,
-0.009490692988038063,
-0.30338454246520996,
0.11807315796613693,
-0.024517904967069626,
-0.19760456681251526,
0.049315448850393295,
-0.18932999670505524,
0.05272134765982628,
-0.26665517687797546,
0.07629286497831345,
0.442644864320755,
-0.36156126856803894,
0.4572838... | |
as it does not really give enough virtual methods to override. This can make altering the behaviour of your class a little tricky in the future.
The trouble with inheritance is that if you use it you will be stuck with the Collection base class's behaviour forever more, or face a complex refactoring. For example, you... | [
0.10235217958688736,
-0.47283264994621277,
0.0036763588432222605,
0.3799860179424286,
-0.18402601778507233,
-0.34734153747558594,
0.37679481506347656,
-0.18785595893859863,
-0.3799508213996887,
-0.5379523634910583,
-0.011190852150321007,
0.37423649430274963,
-0.341164767742157,
0.357159852... | |
to inherit from ICollection or better still IList<T> and then delegate to a private Collection member. This gives you maximum control and allows you to alter the internal representation of your class without affecting the public interface. The trouble with this is that it takes longer to develop you classes.
Therefore... | [
0.6050024628639221,
-0.42859959602355957,
-0.04352112486958504,
0.3178922235965729,
0.01013779453933239,
-0.2552494406700134,
0.21377445757389069,
-0.4695473313331604,
0.15645597875118256,
-0.5918471813201904,
0.07827450335025787,
0.5112907886505127,
-0.19508439302444458,
0.215440586209297... | |
IsReadOnly and then throw a NotSupportedException from all the methods that alter the list. | [
0.11323636770248413,
0.4308173358440399,
0.33864790201187134,
-0.15212279558181763,
0.13654597103595734,
-0.029887862503528595,
0.1237810030579567,
-0.13506026566028595,
0.01569720171391964,
-0.3703153729438782,
-0.1946474015712738,
0.6168099045753479,
0.06645417213439941,
0.19380222260951... | |
Cabbage.hs:
```
module Cabbage where
class Cabbage a
where foo :: a -> String -- the parameter is only present for its type,
-- the parameter value will be ignored
bar :: String -> a
quux :: Cabbage a => String -> a
quux s = bar (s ++ foo (undefined :: a))
```
When I c... | [
0.10472802817821503,
0.03336445614695549,
-0.0317922867834568,
-0.46414288878440857,
0.08876223117113113,
0.03473523631691933,
-0.035316888242959976,
-0.1840926706790924,
-0.3226192891597748,
-0.46740004420280457,
-0.11814890056848526,
-0.013976763002574444,
-0.5781878232955933,
-0.2524671... | |
error message:
```
Cabbage.hs:7:19:
Ambiguous type variable `a' in the constraint:
`Cabbage a' arising from a use of `foo' at Cabbage.hs:7:19-38
Probable fix: add a type signature that fixes these type variable(s)
```
I don't understand why `a` is ambiguous. Surely the `a` in line 7 is the same as the ... | [
0.02455904334783554,
0.47523459792137146,
0.13244949281215668,
-0.23665668070316315,
0.11043006926774979,
0.23349499702453613,
0.3879421353340149,
0.11815875768661499,
-0.24801799654960632,
-0.39863303303718567,
-0.22085393965244293,
0.44680055975914,
-0.5928951501846313,
-0.05408959090709... | |
for `forall a. a`). Scoped type variables must then be explicitly forall-qualified:
```
{-# LANGUAGE ScopedTypeVariables #-}
module Cabbage where
class Cabbage a
where foo :: a -> String -- the parameter is only present for its type,
-- the parameter value will be ignored
... | [
0.03758220747113228,
0.03971512243151665,
0.13259604573249817,
-0.38610130548477173,
0.12064715474843979,
0.11598408967256546,
-0.017706681042909622,
-0.3002058267593384,
-0.21257175505161285,
-0.18027302622795105,
-0.2785111367702484,
0.42833444476127625,
-0.5010055899620056,
-0.192129299... | |
s = bar (s ++ foo (undefined :: a))
``` | [
0.14806337654590607,
0.40097153186798096,
0.7009984254837036,
-0.8306299448013306,
-0.2190784066915512,
-0.01394969504326582,
0.5702057480812073,
-0.3299938440322876,
0.0020713608246296644,
-0.21393682062625885,
-0.39880746603012085,
0.21700812876224518,
-0.49361056089401245,
0.12546971440... | |
if yes then what we can do with cookies?
You say static html, does this mean with javascript?
If so you can use javascript cookies to remember things like whether a menu was expanded, when the user last visited the site etc.
If you just mean pure html on its own then no, cookies can have no benefit to you and you can... | [
0.4231347441673279,
-0.050439804792404175,
0.3945922255516052,
0.34172800183296204,
-0.20639553666114807,
-0.23835232853889465,
0.07682657986879349,
0.0676584243774414,
-0.1858101487159729,
-0.4671761989593506,
0.007604904007166624,
0.5299208164215088,
-0.2592858076095581,
0.09358286857604... | |
I have UITableViewController as the RootViewController. I need to add rows to the table depending on data I get from another thread which I initiate from the RootViewController's thread. When I retun back from other thread to my RootViewController's thread I have the updated data, But I can't update the TableView. I ca... | [
0.023822743445634842,
0.005128941498696804,
0.8274253606796265,
-0.13744543492794037,
-0.24604018032550812,
0.10080844908952713,
0.26003894209861755,
-0.1716381162405014,
-0.22084484994411469,
-0.8589819669723511,
0.2033148854970932,
0.5801381468772888,
-0.32417044043540955,
0.432329863309... | |
= [[cCameraInformation alloc] init];
obj = [camDetails objectAtIndex:i];
NSString *tString = [[NSString alloc] initWithFormat: @" Remote %s %s",[obj->sCameraid UTF8String],[obj->sCameraid UTF8String]];
[tableEntry addObject:tString];
}
[self.tableView reloadData];
}
```
Then there is a re... | [
-0.035893626511096954,
-0.2227630615234375,
0.7883811593055725,
-0.08344543725252151,
-0.18496346473693848,
0.06495817750692368,
0.39138856530189514,
-0.00816822424530983,
-0.3224256634712219,
-0.4486883878707886,
-0.1317058801651001,
0.5412847399711609,
-0.35447797179222107,
0.54056048393... | |
above method using performSelectorOnMainThread.
hey are you sure you are updating the table view display / reloading tableview on the main thread? i faced the same problem, the data was in there but until user scrolls, tableview was not updated
upon googling i came to know you need to call the reloadData method on the... | [
-0.03754771128296852,
-0.1022125706076622,
0.7289004325866699,
-0.08292493969202042,
-0.16936208307743073,
-0.07261919975280762,
0.41217753291130066,
-0.4391747713088989,
-0.4228402078151703,
-0.6933876276016235,
0.16045741736888885,
0.704567015171051,
-0.32402098178863525,
0.1869569569826... | |
On our production servers (win 2003 with IIS6 and load balanced with an F5 BIGIP), we have a problem when introducing wildcardmapping on IIS6. We use .net Framework 3.5 SP1.
The issue manifests itself as by the server only sometimes serving the images stored on a virtual directory pointing to a UNC path.
Sometimes the... | [
0.0022734925150871277,
-0.05818299576640129,
0.25750428438186646,
0.1485760658979416,
-0.1529364138841629,
-0.3272330164909363,
0.1919005960226059,
0.03509039804339409,
-0.4507683515548706,
-0.46621832251548767,
0.034066423773765564,
0.48775655031204224,
-0.45537659525871277,
0.05268811061... | |
the following:
> Message: Failed to start monitoring
> changes to
> '\ourFileServer\folder1\thumbnails'
> because the network BIOS command limit
> has been reached. For more information
> on this error, please refer to
> Microsoft knowledge base article
> 810886. Hosting on a UNC share is not supported for the ... | [
0.06281062215566635,
0.009809618815779686,
0.5405501127243042,
0.10737327486276627,
0.09923108667135239,
-0.20591330528259277,
0.24999888241291046,
-0.15950335562229156,
-0.2567189037799835,
-0.8334392309188843,
-0.15387411415576935,
0.4947609305381775,
-0.25236907601356506,
0.410863906145... | |
System.Web.FileChangesMonitor.StartMonitoringFile(String
> alias, FileChangeEventHandler
> callback) at
> System.Web.Configuration.WebConfigurationHost.StartMonitoringStreamForChanges(String
> streamName, StreamChangeCallback
> callback) at
> System.Configuration.BaseConfigurationRecord.MonitorStream(String
> co... | [
-0.03817097097635269,
-0.2031640261411667,
0.34228435158729553,
0.13688114285469055,
-0.012408824637532234,
-0.26913437247276306,
0.13556784391403198,
-0.050459105521440506,
-0.5557017922401428,
-0.863671064376831,
-0.0375385545194149,
0.36749425530433655,
-0.304187536239624,
0.19466632604... | |
I've ~~got~~ had concerns of many licenses I've seen having nothing preventing other developers from taking code and claiming it as theirs. A few I've looked at included MIT and CPAL licenses. What licenses could offer some peace of mind in that regard?
How about the [Apache 2.0 license](http://www.apache.org/licenses/... | [
0.7074893116950989,
0.3554403781890869,
0.20254459977149963,
0.07964054495096207,
0.09258535504341125,
-0.48318418860435486,
0.003187385154888034,
0.014669323340058327,
-0.06338312476873398,
-0.3760840594768524,
-0.18683071434497833,
0.5867975950241089,
0.2056773453950882,
0.29578790068626... | |
you are worrying too much. Most users of FOSS code will happily retain attributions, license or no, and do you really have the financial resources to pursue those few who don't? | [
0.7772757411003113,
0.28154587745666504,
-0.17034167051315308,
0.3900231122970581,
0.15008069574832916,
-0.31319373846054077,
-0.03760160878300667,
0.20242780447006226,
-0.16063819825649261,
-0.01938847452402115,
-0.045937325805425644,
0.5615026354789734,
-0.10225114226341248,
0.0863791033... | |
What's the best/smoothest solution to import an Excel-file to SQL Server, on a 64 bit Windows system?
What I'm specifically after is to import an Excel 97-2003 file, to a SQL 2005 database, from an ASP.NET/C# page. The import data will demand users to use a "template", so the data looks the same every time.
Previousl... | [
-0.28057897090911865,
0.09480450302362442,
0.3432387411594391,
0.13437394797801971,
-0.0599004402756691,
-0.10785392671823502,
-0.11598073691129684,
0.06810443848371506,
-0.12427220493555069,
-0.738656759262085,
0.18888892233371735,
0.6890512108802795,
-0.3885510563850403,
-0.0601074807345... | |
an option.
So, what are the 64 bit alternatives here?
You should use Integration Services.
Create an Integration Services package that load the Excel file (relatively easy thing to do; you can even use the [Import and Export wizard](http://msdn.microsoft.com/en-us/library/ms141209.aspx)), and then [call the package fr... | [
0.03850673511624336,
-0.13538984954357147,
0.003439090447500348,
0.11586877703666687,
0.02846619300544262,
-0.22483031451702118,
0.335432231426239,
-0.11116871982812881,
-0.10869404673576355,
-0.7606588006019592,
-0.28634172677993774,
0.5735871195793152,
-0.3598836660385132,
-0.29882198572... | |
Which is better approach between use of `NSDictionary` and `NSObject` with `NSStrings` as properties, in terms of faster performance and efficient memory management, if the code is written for an iPhone application?
E.g. If an application deals with parsing an XML file which is as follows:
```
< ?xml version="1.0" en... | [
-0.368171751499176,
0.4299553632736206,
0.2888452410697937,
-0.08897629380226135,
0.13757574558258057,
0.49267056584358215,
0.2919532060623169,
-0.2942075729370117,
-0.20250889658927917,
-0.6187981367111206,
-0.3167468309402466,
0.29135265946388245,
-0.14794285595417023,
-0.297232717275619... | |
'keys'(e.g. `Key=FirstName` `Value=AAA`) efficient and proper as compared to storing the same parsed data into the `NSString` variables(i.e. having `NSString` properties of all the interested nodes to store the respective values. e.g. `NSString *firstName` will store "AAA") of a `NSObject` subclass?
I'm looking for mor... | [
0.10275550931692123,
-0.2359696924686432,
-0.03991536423563957,
0.09466413408517838,
-0.07200989872217178,
-0.22004860639572144,
0.472465455532074,
-0.1601603776216507,
-0.25974926352500916,
-0.4809439480304718,
-0.0038549061864614487,
0.8341065049171448,
-0.2123643457889557,
-0.0406121537... | |
properties be added in future versions of your XML file. In couterpart, I would also say that custom `NSObject` with explicitely named properties is more readable, thus more maintainable, than `NSDictionary`. | [
0.14432880282402039,
0.07912664860486984,
0.3104136884212494,
0.2611308991909027,
-0.22148442268371582,
-0.47621816396713257,
0.06785380840301514,
0.05318056046962738,
-0.22346411645412445,
-0.8101676106452942,
-0.3475591540336609,
0.4541088044643402,
0.058155689388513565,
0.02972620725631... | |
I've got a small test WPF MVVM application working in which a view allows the user to change the first or last names of customers and the full name automatically changes, so communication is going from M-to-MV-to-V and back, everything is fully decoupled, so far so good.
But now as I look to how I will begin extending... | [
0.18697747588157654,
-0.03988256677985191,
0.5292460322380066,
-0.22230932116508484,
-0.12195035815238953,
0.2123568207025528,
0.4139382541179657,
-0.029172394424676895,
-0.3076474666595459,
-0.46350014209747314,
-0.08559811860322952,
0.4830034375190735,
-0.1499546617269516,
0.113205313682... | |
from being set, **how can I send a messsage to the view** telling it to display a message that the name was too long?
* in complex applications **I may have dozens of views on a screen** at one time, yet I understand that in MVVM each view has one and only one ViewModel assigned to it to provide it with data and behavi... | [
0.4758414328098297,
-0.02354704961180687,
0.47141772508621216,
-0.02866039238870144,
-0.2201787531375885,
-0.06666919589042664,
0.06864781677722931,
-0.235480397939682,
-0.4494079053401947,
-0.580787718296051,
-0.05096046254038811,
0.44066372513771057,
-0.03076944686472416,
0.2875502109527... | |
name may only contain 50 characters.", how to we communicate that up the stack to that particular view?
**CustomerHeaderView.xaml (View):**
```
<UserControl x:Class="TestMvvm444.Views.CustomerHeaderView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/wi... | [
-0.3080880045890808,
-0.14452141523361206,
0.726837694644928,
-0.019357217475771904,
-0.04825693368911743,
0.31733694672584534,
-0.1494796872138977,
-0.30914807319641113,
-0.19626717269420624,
-0.3010488450527191,
-0.352151095867157,
0.049760982394218445,
0.22784315049648285,
0.16230666637... | |
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Horizontal">
<TextBox | [
-0.49790510535240173,
0.1309266835451126,
0.26568034291267395,
-0.11140979081392288,
0.1507365107536316,
0.3282308876514435,
0.014396622776985168,
0.07677512615919113,
-0.5932250022888184,
-0.5247249603271484,
-0.4397730827331543,
0.2577093839645386,
0.031054938212037086,
-0.40463989973068... | |
Text="{Binding Path=FirstName, Mode=TwoWay}"
Width="100"
Margin="3 5 3 5"/> | [
0.04653078317642212,
-0.031102698296308517,
0.7679780721664429,
0.07860791683197021,
-0.20094037055969238,
0.02140931226313114,
0.23640494048595428,
-0.5548403263092041,
0.0494774654507637,
-0.6412873864173889,
0.012578591704368591,
0.12241598963737488,
-0.0672047883272171,
-0.015040216036... | |
<TextBox
Text="{Binding Path=LastName, Mode=TwoWay}"
Width="100" | [
0.1906353384256363,
-0.18618829548358917,
0.5226463079452515,
-0.14341026544570923,
0.06733501702547073,
0.24044932425022125,
0.3761345148086548,
-0.36609014868736267,
-0.11418921500444412,
-0.7393075823783875,
0.021406739950180054,
0.34317272901535034,
-0.04571128264069557,
-0.08708791434... | |
Margin="0 5 3 5"/>
<TextBlock
Text="{Binding Path=FullName, Mode=OneWay}" | [
-0.13934382796287537,
-0.15857619047164917,
0.8261644244194031,
-0.03051571175456047,
-0.06750678271055222,
0.08920494467020035,
0.23692390322685242,
-0.3977676033973694,
0.030234090983867645,
-0.7171748280525208,
0.06541697680950165,
0.09418120235204697,
-0.07118333131074905,
0.0395141839... | |
Margin="0 5 3 5"/>
</StackPanel>
</StackPanel>
</DataTemplate> | [
-0.43211665749549866,
-0.11857247352600098,
0.6437761187553406,
0.10392354428768158,
0.04044404625892639,
-0.12279117107391357,
-0.36047080159187317,
-0.3574363589286804,
-0.09605161845684052,
-0.6174513101577759,
-0.07709440588951111,
0.11692295968532562,
0.32989194989204407,
-0.059108868... | |
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</Grid>
</UserControl>
```
**Customer.cs (Model):**
```
using System.ComponentModel;
namespace TestMvvm444.Model
{
class Customer : INotifyPropertyChanged
{
public int ID { get; set; }
public int NumberOfCont... | [
-0.2905724346637726,
-0.47154152393341064,
0.48460593819618225,
0.0879964828491211,
0.11048930138349533,
0.4863184690475464,
-0.013540202751755714,
-0.3193107545375824,
-0.3354577124118805,
-0.6138843894004822,
-0.16772234439849854,
0.40233245491981506,
-0.12652263045310974,
0.132815182209... | |
string FirstName
{
get { return firstName; }
set
{
if (firstName != value)
{ | [
-0.2872592508792877,
-0.5238649249076843,
0.08022923022508621,
-0.2820170223712921,
0.0040747253224253654,
-0.09070006012916565,
0.10327315330505371,
-0.24456219375133514,
0.34480562806129456,
-0.548397421836853,
-0.4240642488002777,
0.5613463521003723,
-0.29412201046943665,
-0.05691928789... | |
firstName = value;
RaisePropertyChanged("FirstName");
RaisePropertyChanged("FullName");
}
}
}
public string LastName | [
-0.4840807616710663,
-0.2761822044849396,
0.21695184707641602,
-0.3981296122074127,
0.042760543525218964,
0.046431370079517365,
0.03645000606775284,
-0.174843430519104,
-0.04042823985219002,
-0.5736369490623474,
-0.32776910066604614,
0.4994201958179474,
-0.02678852714598179,
0.360126107931... | |
{
get { return lastName; }
set
{
if (lastName != value)
{
lastName = value; | [
-0.3267209231853485,
-0.48077481985092163,
0.4152875542640686,
-0.2378510981798172,
0.279260516166687,
0.00587066262960434,
0.22406744956970215,
-0.1876477748155594,
0.26094380021095276,
-0.4994613826274872,
-0.5145048499107361,
0.6714131236076355,
-0.02614208124577999,
-0.0737004205584526... | |
RaisePropertyChanged("LastName");
RaisePropertyChanged("FullName");
}
}
}
public string FullName
{ | [
-0.27529487013816833,
-0.015743009746074677,
0.5927870273590088,
-0.5297858715057373,
0.07207325845956802,
0.21159477531909943,
0.036390360444784164,
-0.2712042033672333,
-0.030466044321656227,
-0.4251946210861206,
-0.24428953230381012,
0.5394267439842224,
0.05855153873562813,
0.1684766113... | |
get { return firstName + " " + lastName; }
}
#region PropertChanged Block
public event PropertyChangedEventHandler PropertyChanged;
private void RaisePropertyChanged(string property)
{
if (PropertyChanged != null)
{ | [
-0.2723700702190399,
-0.622426450252533,
0.47744515538215637,
0.011149883270263672,
0.19714154303073883,
-0.25807592272758484,
0.3164375126361847,
-0.4670983552932739,
-0.12395162880420685,
-0.5224658846855164,
-0.4875049889087677,
0.4951408803462982,
0.10540717095136642,
0.559003949165344... | |
PropertyChanged(this, new PropertyChangedEventArgs(property));
}
}
#endregion
}
}
```
A really simple way to add validation messages is to use binding.
Add an notifable property to your view model that defines whether the validation message should be displayed or not:
```
private Bool... | [
0.2902020514011383,
-0.21417415142059326,
0.6249175667762756,
-0.0053546857088804245,
-0.16364440321922302,
-0.24562370777130127,
0.10659610480070114,
-0.38174116611480713,
-0.00883063580840826,
-0.5217945575714111,
-0.22292613983154297,
0.6853761672973633,
-0.3641151785850525,
0.058035336... | |
_OnPropertyChanged("ItemValidatorDisplayed");
}
}
```
Add a convertor class that converts bool to visibility:
```
using System;
using System.Windows;
namespace xxx
{
public class BoolToVisibilityConverter : IValueConverter
{
public bool Negate { get; set; }
public object Convert(object ... | [
0.0479825884103775,
-0.24137774109840393,
0.5133338570594788,
-0.1553768664598465,
0.015043358318507671,
0.19241495430469513,
0.42035046219825745,
-0.010890179313719273,
-0.18322721123695374,
-0.8384788632392883,
-0.4540332853794098,
0.46979963779449463,
-0.47780588269233704,
0.42933261394... | |
{
return val ? Visibility.Visible : Visibility.Collapsed;
}
else
{
return val ? Visibility.Collapsed : Visibility.Visible;
} | [
-0.46949058771133423,
-0.21662630140781403,
0.04939043149352074,
-0.18411241471767426,
-0.02354796603322029,
0.2567742168903351,
0.5044807195663452,
0.158037930727005,
-0.19135832786560059,
-0.6651289463043213,
-0.48225700855255127,
0.4278542101383209,
-0.2003384232521057,
0.10677146911621... | |
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
```
Bind to the property from the view and apply the converter:
```
<UserControl x:Class="ViewClass"
...... | [
-0.1721009910106659,
-0.06844903528690338,
0.37140175700187683,
-0.1605450063943863,
0.1303519606590271,
-0.1373579204082489,
0.26632001996040344,
-0.14460687339305878,
0.10058660060167313,
-0.7009451985359192,
-0.42448702454566956,
0.7332195043563843,
-0.3619903326034546,
0.39744612574577... | |
<contract:BoolToVisibilityConverter Negate="False"
x:Key="BoolToVisibilityConverter" />
</UserControl.Resources>
...
<TextBlock Visibility="{Binding Converter={StaticResource BoolToVisibilityConverter}, Path=ItemValidatorDisplayed}" />
...
</UserControl>
```
... | [
-0.26321911811828613,
-0.2727386951446533,
0.553233802318573,
-0.2536049485206604,
-0.13967834413051605,
0.17803411185741425,
0.07060214877128601,
-0.31550976634025574,
-0.14100441336631775,
-0.6430284976959229,
-0.37947431206703186,
0.6968705058097839,
-0.18910537660121918,
-0.02152067422... | |
{
InitializeComponent();
this.DataContext = new ViewClass_ViewModel();
}
}
}
```
Bingo - perfectly working validation being pushed to any view that cares to subscribe to this ViewModel / Property. | [
0.19100253283977509,
-0.02764056995511055,
0.4443581700325012,
-0.22101223468780518,
0.23262977600097656,
-0.31514811515808105,
0.15314382314682007,
-0.4199172854423523,
0.11899103969335556,
-0.3651016652584076,
-0.26998549699783325,
0.5077125430107117,
-0.13942325115203857,
0.029507722705... | |
Is it possible to access & control external devices in PHP?
For example, would it be capable of changing the speed of a USB fan or change the direction of a wireless toy car.
I'm trying to go beyond web dev and I'm wondering if the programming language I use is capable of handling my ideas or should I consider changi... | [
0.3908670246601105,
-0.034805137664079666,
0.12847058475017548,
0.5490471720695496,
0.006949782837182283,
-0.2654927968978882,
-0.03921634331345558,
0.2629484534263611,
-0.21922796964645386,
-0.5741135478019714,
0.19100502133369446,
0.871181070804596,
-0.1961982548236847,
-0.13234934210777... | |
you switching to Python, Ruby, Lua or Java.
For example there are bindings for [libusb](http://libusb.wiki.sourceforge.net/) for [Python](http://pyusb.berlios.de/), [Ruby](http://www.a-k-r.org/ruby-usb/), [Lua](http://luaforge.net/projects/lualibusb/) and [Java](http://libusbjava.sourceforge.net/wp/res/doc/ch/ntb/usb/... | [
0.4094148576259613,
-0.18235979974269867,
0.36409255862236023,
-0.16066251695156097,
-0.2943286597728729,
0.23771178722381592,
-0.2098798006772995,
-0.006256766151636839,
-0.47841089963912964,
-0.6226805448532104,
-0.15001243352890015,
0.48249226808547974,
-0.2834159731864929,
0.2462621629... | |
When using a `Guid` as an index for a `Dictionary`, is it better to use the `Guid` object, or the string representation of the Guid?
I just refactored some code which was using string to use the object, because there were `new Guid()` calls all over the place. But that left me wondering what the performance issues mig... | [
0.12408354133367538,
0.10762255638837814,
0.175978884100914,
0.24737206101417542,
-0.27609941363334656,
-0.05742986127734184,
0.012770215049386024,
-0.10103841871023178,
-0.07809507101774216,
-0.5371498465538025,
0.029747338965535164,
0.777627170085907,
-0.1931087225675583,
-0.054595362395... | |
for 7f9b349f-f36f-94de-ad96-04279ddf6ecf
As guid: 466; -1018643328
As string: 512; -1018643328
Searching for 870ba465-08f2-c872-cfc9-b3cc1ffa09de
As guid: 470; 1047183104
As string: 589; 1047183104
Searching for d2376f8a-b8c9-4633-ee8e-9679bb30f918
As guid: 423; 1841649088
As string: 493; 1841649088
Searching for 59988... | [
-0.6574802398681641,
0.2206912636756897,
0.14367589354515076,
0.2924811840057373,
0.052919838577508926,
0.5979762673377991,
0.49777939915657043,
-0.553703248500824,
-0.39288875460624695,
-0.6305639743804932,
-0.12778766453266144,
0.8201806545257568,
-0.07048483937978745,
0.1637561917304992... | |
Random rand = new Random(123456);
int COUNT = 1000;
Dictionary<Guid, int> guids = new Dictionary<Guid, int>(COUNT);
Dictionary<string, int> strings = new Dictionary<string, int>(
COUNT, StringComparer.Ordinal);
byte[] buffer = new byte[16];
for (int i = 0; i < COUNT;... | [
-0.1328411102294922,
-0.39777854084968567,
0.01677711308002472,
-0.1352258026599884,
-0.14689768850803375,
0.34842559695243835,
-0.08294746279716492,
-0.6116070747375488,
-0.14232946932315826,
-0.2889849841594696,
0.055740125477313995,
0.288004994392395,
-0.2187538892030716,
0.305859088897... | |
rand.NextBytes(buffer);
Guid guid = new Guid(buffer);
int val = rand.Next();
guids.Add(guid, val);
strings.Add(guid.ToString(), val);
}
for(int i = 0 ; i < 10 ; i++) { | [
-0.3347286581993103,
-0.29303455352783203,
0.33905714750289917,
-0.24428963661193848,
0.2273930460214615,
0.30347776412963867,
0.04459688812494278,
-0.4829755425453186,
-0.12332777678966522,
-0.6235510110855103,
-0.12519168853759766,
0.47524523735046387,
-0.027611494064331055,
0.1614982634... | |
int index = rand.Next(COUNT);
Guid guid = guids.Keys.Skip(index).First();
Console.WriteLine("Searching for " + guid);
int chk = 0;
const int LOOP = 5000000;
Stopwatch watch = Stopwatch.StartNew();
for (int j = 0; | [
0.010512023232877254,
-0.3697226941585541,
0.6126083731651306,
-0.2634739577770233,
0.25496023893356323,
0.2074773907661438,
0.30361655354499817,
-0.30429479479789734,
-0.1767408400774002,
-0.45860594511032104,
0.020912909880280495,
0.4431668221950531,
-0.34310027956962585,
0.1790115535259... | |
j < LOOP; j++)
{
chk += guids[guid];
}
watch.Stop();
Console.WriteLine("As guid: " + watch.ElapsedMilliseconds
+ "; " + chk); | [
0.020149651914834976,
-0.2645184397697449,
0.7914620041847229,
-0.3108537793159485,
0.39304497838020325,
0.006271591875702143,
0.41544440388679504,
-0.24112388491630554,
-0.06747668236494064,
-0.31219056248664856,
-0.33232441544532776,
0.5046297311782837,
-0.31503811478614807,
0.2813997268... | |
string key = guid.ToString();
chk = 0;
watch = Stopwatch.StartNew();
for (int j = 0; j < LOOP; j++)
{
chk += strings[key]; | [
0.2979338765144348,
-0.5159072875976562,
0.516787052154541,
-0.42273831367492676,
0.4280838370323181,
0.220078706741333,
0.3961620330810547,
-0.27524644136428833,
-0.11316628754138947,
-0.046264272183179855,
-0.2915140390396118,
0.6054997444152832,
-0.46190372109413147,
0.1745080053806305,... | |
}
watch.Stop();
Console.WriteLine("As string: " + watch.ElapsedMilliseconds
+ "; " + chk);
}
Console.ReadLine();
}
}
``` | [
0.07228684425354004,
-0.1858179122209549,
0.770493745803833,
-0.25824758410453796,
0.6204894781112671,
-0.17190015316009521,
0.21468931436538696,
0.07163708657026291,
-0.16564041376113892,
-0.48437461256980896,
-0.3965640366077423,
0.672553539276123,
-0.31009069085121155,
0.369365245103836... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.