text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
Say we have this scenario: ``` Artist ==< Album ==< Track //ie, One Artist can have many albums, and one album can have many tracks ``` In this case, all 3 entities have basically the same fields: * ID * Name * A foreign of the one-many relationship to the corresponding children (Artist to Album and Album to Track ...
[ 0.2962592840194702, 0.07873835414648056, -0.0025330944918096066, 0.26107195019721985, 0.247503399848938, 0.011128588579595089, -0.3773488998413086, -0.4503152370452881, -0.3657114803791046, -0.5598108172416687, -0.03732198476791382, 0.7228644490242004, 0.004419549833983183, 0.1109609752893...
the sort: ``` Table: EntityType(EntityTypeID, EntityName) This table would hold 3 entities (1. Artist, 2. Album, 3. Track) Table: Entities(EntityID, Name, RelField, EntityTypeID) This table will hold the name of the entity (like the name of an artist for example), the one-many field (foreign-key...
[ 0.1663742959499359, 0.03155503422021866, 0.3996066451072693, 0.32108861207962036, 0.1331281214952469, 0.07244346290826797, -0.47120922803878784, -0.5276641845703125, -0.22699102759361267, -0.5099660158157349, 0.06323797255754471, 0.42251303791999817, -0.2629431486129761, 0.2310183346271515...
incorporate "OOP concepts" in this DB scenario? And finally, would you prefer having the foreign-key constraints of the first scenario or the more generic (with the risk of linking an artist with a Track for example, since there is no check to see the inputter foreign-key value is really of an album) approach? *..bt...
[ 0.5226758122444153, -0.10618506371974945, -0.10089576244354248, 0.35763317346572876, -0.22657182812690735, -0.29886648058891296, 0.1130027249455452, -0.20513762533664703, -0.20365585386753082, -0.41761940717697144, 0.2282746285200119, 0.8026259541511536, -0.4208442270755768, 0.254144251346...
to maintain and troubleshoot. I will stay away from this technique. The simpler, the better, is my mantra.
[ 0.5526047945022583, 0.27987387776374817, 0.058922912925481796, -0.18504740297794342, 0.07864776998758316, 0.07517870515584946, 0.8083006143569946, -0.23928719758987427, 0.09709692001342773, -0.6461614966392517, 0.1074058935046196, 0.8608887791633606, 0.056270696222782135, 0.017444966360926...
Background ---------- I am using interface-based programming on a current project and have run into a problem when overloading operators (specifically the Equality and Inequality operators). --- Assumptions ----------- * I'm using C# 3.0, .NET 3.5 and Visual Studio 2008 UPDATE - The Following Assumption was False!...
[ 0.02430378459393978, 0.139693945646286, 0.03898056223988533, 0.07256430387496948, 0.015897901728749275, 0.10460052639245987, 0.2387048304080963, 0.08316151052713394, -0.1505642533302307, -0.6400339603424072, 0.2661939859390259, 0.6714510917663574, -0.4197010397911072, -0.33763694763183594,...
suggest it. However, after re-reading [Guidelines for Overriding Equals and Operator==](http://msdn.microsoft.com/en-us/library/ms173147.aspx) I have found this: > By default, the operator == tests for reference equality by determining whether two references indicate the same object. Therefore, reference types do not ...
[ 0.10860101878643036, 0.2243931144475937, 0.3149550259113312, -0.014509446918964386, -0.05114832520484924, -0.12714971601963043, 0.21981672942638397, -0.42502424120903015, 0.25418511033058167, -0.4819815754890442, 0.1398589015007019, 0.39651697874069214, -0.5329980254173279, 0.3264274001121...
is not a good idea to override operator == in non-immutable types. and this [Equatable Interface](http://msdn.microsoft.com/en-us/library/ms131187.aspx) > The IEquatable interface is used by generic collection objects such as Dictionary, List, and LinkedList when testing for equality in such methods as Contains, Inde...
[ -0.2701869308948517, -0.08636688441038132, 0.36417609453201294, 0.057109761983156204, 0.04037676751613617, -0.08041113615036011, 0.22729520499706268, -0.24776571989059448, 0.1265403926372528, -0.8012692332267761, 0.017492184415459633, 0.6950222849845886, -0.4224493205547333, -0.05311712622...
operator== method will be called. * When overloading an operator on a class, at least one of the parameters of the binary operator must be the containing type, otherwise a compiler error is generated (Error BC33021 <http://msdn.microsoft.com/en-us/library/watt39ff.aspx>) * It's not possible to specify implementation on...
[ -0.33576515316963196, 0.019598089158535004, 0.12624740600585938, -0.018415113911032677, -0.029865311458706856, 0.1601533442735672, 0.29662808775901794, -0.5531413555145264, 0.2632156312465668, -0.4469470679759979, 0.07557183504104614, 0.6612985730171204, -0.6284366846084595, -0.23117890954...
refer to the same object. For the string type, == compares the values of the strings. --- See Also -------- --- Code ---- ``` using System; namespace OperatorOverloadsWithInterfaces { public interface IAddress : IEquatable<IAddress> { string StreetName { get; set; } string City { get; set;...
[ 0.21119551360607147, -0.006542610935866833, 0.3044683039188385, -0.11875452846288681, -0.1160004511475563, 0.13434472680091858, 0.4817351698875427, -0.25941094756126404, 0.09157858043909073, -1.0938084125518799, -0.3503955900669098, 0.37272825837135315, -0.6147779822349548, 0.3666472136974...
private string _city; private string _state; public Address(string city, string state, string streetName) { City = city; State = state; StreetName = streetName; } #region IAddress Members
[ -0.22195664048194885, -0.338680237531662, 0.19453634321689606, -0.008841770701110363, 0.1664229929447174, 0.1461961567401886, 0.39884161949157715, 0.15914799273014069, -0.2049988955259323, -0.8232187032699585, -0.6396129131317139, 0.04653887823224068, -0.1913241297006607, 0.703512847423553...
public virtual string StreetName { get { return _streetName; } set { _streetName = value; } } public virtual string City { get { return _city; }
[ 0.16897054016590118, -0.3385293185710907, 0.17900191247463226, 0.19150851666927338, 0.04140187054872513, 0.08065904676914215, 0.1703975647687912, 0.2642506957054138, 0.08895239233970642, -0.9002719521522522, -0.3998313248157501, 0.6200231313705444, -0.38963931798934937, 0.3537425100803375,...
set { _city = value; } } public virtual string State { get { return _state; } set { _state = value; } } public static bool operator ==(Address lhs, Address rhs)
[ 0.015157896094024181, -0.30155929923057556, 0.368512362241745, 0.00478070555254817, 0.027151739224791527, -0.12365938723087311, 0.4370352327823639, -0.06715655326843262, 0.043062254786491394, -0.6697281002998352, -0.6499195694923401, 0.2057088315486908, -0.558306872844696, 0.30635860562324...
{ Console.WriteLine("Address operator== overload called."); // If both sides of the argument are the same instance or null, they are equal if (Object.ReferenceEquals(lhs, rhs)) { return true; }
[ -0.2191670536994934, 0.12318585813045502, 0.4688255488872528, 0.007465819828212261, 0.2945319414138794, 0.29890915751457214, 0.32250291109085083, -0.31976643204689026, 0.27094730734825134, -0.4457799792289734, -0.09440865367650986, 0.4626525938510895, -0.20818108320236206, 0.29971578717231...
return lhs.Equals(rhs); } public static bool operator !=(Address lhs, Address rhs) { return !(lhs == rhs); } public override bool Equals(object obj) { // Use 'as' rather
[ -0.1776585578918457, -0.1515490859746933, 0.5531525611877441, -0.24303491413593292, -0.06775526702404022, 0.02377910725772381, 0.47141677141189575, -0.44310733675956726, -0.13636554777622223, -0.5123160481452942, -0.5309160947799683, 0.32565149664878845, -0.37294837832450867, 0.16938479244...
than a cast to get a null rather an exception // if the object isn't convertible Address address = obj as Address; return this.Equals(address); } public override int GetHashCode() { string composite = StreetName +
[ 0.10133577883243561, -0.228538379073143, 0.43451210856437683, -0.1154324933886528, 0.10077530890703201, 0.014629734680056572, 0.39714479446411133, -0.5431708693504333, 0.022945798933506012, -0.4692405164241791, -0.006898204796016216, 0.17342044413089752, -0.46939247846603394, 0.27675610780...
City + State; return composite.GetHashCode(); } #endregion #region IEquatable<IAddress> Members public virtual bool Equals(IAddress other) { // Per MSDN documentation, x.Equals(null) should return false if ((object)other == null)
[ -0.00948918517678976, -0.345496267080307, 0.640200674533844, 0.025789251551032066, -0.03305840864777565, -0.14607647061347961, 0.5763170123100281, -0.02769318036735058, -0.19682592153549194, -0.7661545872688293, -0.28485700488090515, 0.13551221787929535, -0.5061309933662415, 0.399560987949...
{ return false; } return ((this.City == other.City) && (this.State == other.State) && (this.StreetName == other.StreetName)); }
[ 0.1905580312013626, -0.19515424966812134, 0.15043747425079346, -0.07522876560688019, 0.30453261733055115, 0.024614544585347176, 0.5490009188652039, -0.30129116773605347, -0.04760259762406349, -0.6300584673881531, -0.5717069506645203, 0.3150506317615509, -0.2527908384799957, 0.3381249904632...
#endregion } public class Program { static void Main(string[] args) { IAddress address1 = new Address("seattle", "washington", "Awesome St"); IAddress address2 = new Address("seattle", "washington", "Awesome St"); functionThatComparesAddresses(address1, ...
[ 0.09538748115301132, -0.1667366921901703, 0.5421326160430908, -0.2942631244659424, 0.1249491274356842, -0.07759921252727509, 0.48578932881355286, 0.34099581837654114, 0.22860892117023468, -0.5719904899597168, -0.4900459945201874, 0.41009995341300964, -0.5842134952545166, 0.3662892580032348...
Console.Read(); } public static void functionThatComparesAddresses(IAddress address1, IAddress address2) { if (address1 == address2) { Console.WriteLine("Equal with the interfaces."); }
[ -0.41979584097862244, 0.11120209097862244, 0.6263071298599243, 0.015752043575048447, 0.19737060368061066, 0.2403813600540161, 0.19466768205165863, -0.2382349818944931, 0.27779537439346313, -0.821643054485321, -0.19037416577339172, 0.5904650092124939, -0.3225206136703491, 0.3741078972816467...
if ((Address)address1 == address2) { Console.WriteLine("Equal with Left-hand side cast."); } if (address1 == (Address)address2) { Console.WriteLine("Equal with Right-hand side cast.");
[ -0.683349609375, 0.018730467185378075, 0.5728709697723389, -0.15968264639377594, 0.32501864433288574, 0.208764910697937, 0.09713173657655716, -0.254793256521225, 0.4459243714809418, -0.6449292898178101, -0.5649297833442688, 0.5515403747558594, -0.0816471055150032, 0.03921292722225189, 0....
} if ((Address)address1 == (Address)address2) { Console.WriteLine("Equal with both sides cast."); } } } } ``` --- Output ------ ``` Address operator== overload called Equal with both sides cast. ``` Short answer: I think your second assumption may be...
[ -0.2927195727825165, 0.1384960114955902, 0.47279468178749084, -0.0053811888210475445, 0.3100029528141022, -0.0005367710837163031, 0.2287670373916626, -0.482185423374176, 0.288191020488739, -0.5736738443374634, 0.042385298758745193, 0.7624081373214722, -0.20831379294395447, -0.0509166233241...
to check for *semantic equality* of two objects, not `operator ==`.** --- Long answer: Overload resolution for operators is *performed at compile time, not run time*. Unless the compiler can definitively know the types of the objects it's applying an operator to, it won't compile. Since the compiler cannot be sure t...
[ -0.15231527388095856, 0.09412463009357452, 0.08046109974384308, -0.045153629034757614, 0.01462604571133852, -0.03817516937851906, 0.5250101685523987, -0.31237727403640747, -0.0367409773170948, -0.7426822781562805, -0.2918514609336853, 0.5469814538955688, -0.3732846677303314, -0.09803990274...
compile. Why? Because the compiler can't tell that a particular `IAddress` is an `Address`, and there is no default `operator +` implementation to fall back to in `System.Object`. --- Part of your frustration probably stems from the fact that `Object` implements an `operator ==`, and everything is an `Object`, so the...
[ 0.19506505131721497, 0.21499398350715637, -0.07016302645206451, 0.18923945724964142, -0.06216580048203468, -0.14854483306407928, 0.49946433305740356, -0.15236353874206543, -0.0688435509800911, -0.6069443821907043, -0.019068090245127678, 0.6897668838500977, -0.7874494791030884, 0.0386293232...
a viable solution, especially when passing your types to libraries (such as Collections). In my view, this is precisely what you should be doing. **`Equals()` is the right way to check for *semantic equality* of two objects.** Sometimes semantic equality is just reference equality, in which case you won't need to chan...
[ 0.09495697915554047, 0.02429317496716976, 0.07552628219127655, 0.5101008415222168, 0.1679253727197647, -0.0016426712973043323, 0.1391800045967102, -0.05374537408351898, -0.12327714264392853, -0.7754678130149841, 0.04006868973374367, 0.3995493948459625, -0.1418597549200058, -0.1317473202943...
`Equals()` and `operator ==` are not the same thing. Whenever you need to override `operator ==`, you should override `Equals()`, but almost never the other way around. `operator ==` is more of a syntactical convenience. Some CLR languages (e.g. Visual Basic.NET) don't even permit you to override the equality operator.
[ -0.21963559091091156, 0.2293797880411148, 0.27644532918930054, 0.09709075838327408, -0.03982482850551605, -0.35571417212486267, 0.06963390111923218, 0.035724882036447525, 0.04700784385204315, -0.2924093008041382, -0.3888072371482849, 0.5883100628852844, -0.39135539531707764, -0.18132248520...
I want to know what is the main technical difference between Web (ASP, PHP, Ruby, etc.), Application (C, C++, .NET, Java), and Mobile (J2ME, Objective C) programming, and which is the hardest. If someone learns one of these, can he easily switch over to one of the others? First, from a *technical* perspective you sho...
[ 0.700238823890686, 0.3963938057422638, 0.12058685719966888, 0.33576521277427673, 0.12131888419389725, -0.02067195437848568, 0.027198191732168198, 0.010664615780115128, -0.3030800223350525, -0.6569154858589172, -0.09797055274248123, 0.641506016254425, 0.1329614371061325, 0.00468993140384554...
every page request is completely de-linked from every other page request. It is only through various technical work-arounds that web applications manage to maintain the illusion that a web app user is running a coherent application as they navigate from page to page. In ASP.NET, for example, the ASP.NET ISAPI DLL manag...
[ 0.06252777576446533, -0.11809223890304565, 0.501384437084198, 0.2695083022117615, -0.01590026170015335, 0.025774158537387848, 0.19913068413734436, -0.08221880346536636, -0.24731898307800293, -0.5895875692367554, -0.5157604217529297, 0.3781799077987671, -0.3415657579898834, -0.0006871484220...
the "state" of the application is a given as you navigate from dialog to dialog. In addition, the tight integration of the application with the user's computer permits the use of on-board resources (memory, disk). In a web app, by contrast, there is little or no access to these resources except as mediated by the brows...
[ 0.012487520463764668, 0.3066817820072174, 0.34257790446281433, 0.027067821472883224, 0.21552203595638275, 0.23248209059238434, 0.5842108726501465, 0.0896013081073761, -0.1538216471672058, -1.0799115896224976, -0.3089425563812256, 0.22597308456897736, -0.04722118005156517, 0.14589823782444,...
same way as a standard web app but you can not count on some of the capabilities that you usually have with a full-blown browser. This last constraint, by the way, is rapidly going away as mobile devices become more powerful. Mobile *client* applications require a development environment, deployment strategy, etc. tha...
[ 0.16583284735679626, 0.19016027450561523, 0.18941210210323334, 0.13118405640125275, 0.20647840201854706, -0.22121214866638184, 0.06973432749509811, 0.26214519143104553, -0.3240603804588318, -0.7868783473968506, -0.19491490721702576, 0.6604228615760803, -0.04530850797891617, -0.042948558926...
attempted to provide as much commonality as possible although, even here, you'll find that you have a different mind set and different constraints than when developing a WinForms application. Hope this helps!
[ 0.31475114822387695, 0.07154320180416107, 0.11914947628974915, 0.11084301769733429, 0.08273361623287201, -0.013335438445210457, 0.3627690374851227, 0.3161747455596924, 0.18629716336727142, -0.6107385158538818, 0.15507479012012482, 0.4153836965560913, -0.0702754557132721, -0.184450477361679...
I've just been informed at my workplace that we have an application that is used in production that has stopped working. I'm searching as best I can to find where the source for the application is in our source control but without much luck. I'm really hoping that this isn't an application that was developed on a local...
[ 1.0103031396865845, 0.3040267825126648, 0.11558166891336441, 0.010617421008646488, 0.3092513382434845, -0.22528986632823944, 0.16993021965026855, 0.5882782936096191, -0.13970054686069489, -0.7167314887046814, 0.3497573733329773, 0.4394221901893616, 0.055143121629953384, 0.6056470274925232,...
found that it references mscorlib, System, System.Data, System.Drawing, and System.Windows.Forms but all of them state that they are version 1.0.5000.0. How is this possible? Could it be that this is an application that was developed against the .NET 1.0 framework and has lived in production ever since? Is it possible...
[ 0.24968867003917694, 0.006192668341100216, 0.7131262421607971, 0.25836873054504395, 0.11289307475090027, 0.03475213423371315, 0.17175936698913574, -0.08424616605043411, -0.4226143956184387, -0.4085964262485504, 0.12638795375823975, 0.5378641486167908, -0.2724479138851166, 0.064237348735332...
our current environment... Sounds like .NET 1.0 is indeed on your production box... pretty sure you can run as many versions of .NET as you want installed in parallel. Samuel has already pointed out the download location for .NET 1.0, but one other thing that may help, if you can't find the source, is the [File Disass...
[ 0.6219624876976013, 0.1127675473690033, 0.28021207451820374, 0.33162686228752136, 0.26875123381614685, -0.23014716804027557, 0.2711036205291748, -0.0007076902547851205, -0.2727653384208679, -0.773280680179596, -0.041204050183296204, 0.35084739327430725, -0.08877246826887131, 0.285658478736...
I am connecting to a service using a HttpWebRequest. In the service logs, there are Authentication errors being logged, even though the information is correct. The vendor who set up the server with the service, has said that .NET does not send the authentication headers on the first try. ``` _Req.Credentials = new Ne...
[ 0.295581579208374, 0.15318343043327332, 0.6571537852287292, -0.14201658964157104, 0.03694333881139755, -0.23310934007167816, 0.6071481108665466, -0.08253367245197296, 0.028014512732625008, -0.8285759687423706, -0.16348674893379211, 0.25850021839141846, -0.2686423361301422, 0.34951710700988...
Given multiple (x,y) ordered pairs, I want to compare distances between each one of them. So pretend I have a list of ordered pairs: ``` pairs = [a,b,c,d,e,f] ``` I have a function that takes two ordered pairs and find the distance between them: ``` def distance(a,b): from math import sqrt as sqrt from math...
[ 0.030017441138625145, 0.13167931139469147, 0.2501559257507324, -0.22509713470935822, -0.18082143366336823, 0.4802771210670471, 0.18218006193637848, -0.632897675037384, 0.046021636575460434, -0.5843209028244019, -0.4056124985218048, 0.581320583820343, -0.2791638970375061, -0.202303364872932...
ordered pair, ultimately finding the two ordered-pairs with the greatest distance between them? Psuedopsuedocode: ``` distance(a,b) distance(a,c) ... distance(e,f) ``` Any help would be tremendously appreciated. ``` try: from itertools import combinations except ImportError: def comb...
[ -0.13263563811779022, -0.1484881490468979, 0.032132092863321304, -0.23757115006446838, -0.09230586886405945, 0.3197672367095947, 0.27577441930770874, -0.43460550904273987, -0.2386411875486374, -0.39093855023384094, -0.4911723732948303, 0.42119458317756653, -0.32747915387153625, -0.27973222...
yield l[i], l[j] coords_list = [(0,0), (3,4), (6,8)] def distance(p1, p2): return ( ( p2[0]-p1[0] ) ** 2 + ( p2[1]-p1[1] )**2 ) ** 0.5 largest_distance, (p1, p2) = max([ (distance(p1,p2), (p1, p2)) for (p1,p2) in combinations(coords_list, 2) ]) print largest_distance, p1, p2 ```
[ -0.36308929324150085, 0.14016306400299072, 0.5131861567497253, -0.4904099106788635, 0.23361515998840332, 0.6357104182243347, 0.06942359358072281, -0.7354139089584351, -0.006736361887305975, -0.573607861995697, -0.18473297357559204, 0.6530367136001587, 0.1751527488231659, -0.098329253494739...
I recently wrote a new Perl script to kill processes based on either process name / user name and extended it using Classes so that I could reuse the process code in other programs. My current layout is - ``` /home/mutew/src/prod/pskill <-- Perl script /home/mutew/src/prod/Process.pm <-- Package to handle proc...
[ 0.1574416607618332, 0.29118096828460693, 0.47882750630378723, -0.3286731243133545, 0.22878780961036682, 0.3106781244277954, 0.25564131140708923, 0.044370800256729126, -0.2875725030899048, -0.7348495721817017, 0.12078916281461716, 0.2776704430580139, -0.005289833527058363, 0.427876114845275...
@INC includes only the current directory - '.'). One workaround that I have been using is the use lib directive as so - ``` use lib '/home/mutew/src/prod'; ``` but this is a major portability issue. Any solutions which will also allow me to export the script to other systems without and changes? --- **EDIT** 1. I...
[ 0.22479546070098877, -0.07555346190929413, 0.227346733212471, -0.1183479055762291, -0.159725621342659, -0.12134797126054764, 0.4210711717605591, -0.12731941044330597, 0.10668698698282242, -0.6336684823036194, -0.24558532238006592, 0.8060988187789917, -0.5890528559684753, 0.0470200814306736...
I prefer to have my scripts provided in such a way that programs are in whatever/bin, and libraries are in whatever/lib In these situations I use a slightly more complicated approach: ``` use Cwd qw(abs_path); use FindBin; use lib abs_path("$FindBin::Bin/../lib"); ``` The abs\_path call is to make the @INC contain ...
[ 0.042265065014362335, -0.005743189714848995, 0.17746853828430176, -0.14997658133506775, -0.15926645696163177, -0.048120543360710144, 0.44191253185272217, 0.20273646712303162, 0.01906953752040863, -0.7862915396690369, -0.2792416214942932, 0.7294445633888245, -0.5111344456672668, -0.18466342...
I try blocking Ip addresses in my app like this - [lifeonrails.org](http://lifeonrails.org/2007/8/26/blocking-ip-addresses-in-rails). I already have a module in /lib and model banned\_ip. Why I have this error below from views/banned\_ips/index.html? ===My error:=== **NoMethodError in Admin/banned\_ips#index** *Sho...
[ -0.2587461471557617, -0.007624055724591017, 0.5751444101333618, 0.2558939754962921, -0.1471722573041916, 0.12278495728969574, 0.48916569352149963, -0.3643488883972168, -0.367165207862854, -0.9176477193832397, 0.10380662977695465, 0.325229287147522, -0.4983549416065216, 0.08191987127065659,...
initialize(address) @address = address end def split @address.split(‘.‘).map {|s| s.to_i } end def <=>(other) split <=> other.split end def to_s @address end end end ``` --- ===Model banned\_ip:=== ``` class BannedIp < ActiveRecord::Base @banned_ips # hash o...
[ -0.07756827771663666, -0.6007751822471619, 0.18724589049816132, 0.006815935950726271, 0.11127295345067978, -0.16997899115085602, -0.03147123381495476, -0.47298645973205566, -0.35260385274887085, -0.8057104349136353, -0.3010721206665039, 0.07237895578145981, -0.48021769523620605, 0.19430539...
validates_format_of :first_ip, :with => REG_IP, :message => "is invalid (must be x.x.x.x where x is 0-255)", :if => Proc.new {|ar| !ar.first_ip.blank? } validates_format_of :last_ip, :with => REG_IP, :message => "is invalid (must be x.x.x.x where x is 0-255)", :if => Proc.new {|ar| !ar.last_ip.blank? } def sel...
[ -0.017803000286221504, 0.15335501730442047, 0.5637134909629822, 0.09862292557954788, -0.2862659692764282, 0.035534393042325974, 0.06635694950819016, -0.6229035258293152, -0.5204209685325623, -0.24852624535560608, -0.4298992455005646, 0.15978994965553284, -0.2791220545768738, 0.114486545324...
return true if ip.between?(b[0], b[1]) } rescue logger.info "IP FORMAT ERROR" return true end false end def self.banned_ips reload_banned_ips if @banned_ips.nil? @banned_ips.collect {|b| b[0].to_s + ".." + b[1].to_s }.join"\n" end
[ 0.11272355914115906, -0.20317795872688293, 0.5100198984146118, -0.0449308343231678, 0.2549511194229126, -0.042177535593509674, 0.6673581004142761, -0.37267568707466125, -0.3246559500694275, -0.295272558927536, -0.24471692740917206, 0.36678946018218994, -0.48239126801490784, 0.0655845925211...
#keeps a cache of all banned ip ranges def self.reload_banned_ips r = connection.select_all("select first_ip, last_ip from banned_ips") if !r @banned_ips=[] end @banned_ips = r.map {|item| [Infrid::IPAddress.new(item["first_ip"]),Infrid::IPAddress.new(item["last_ip"])] } end end...
[ 0.046745218336582184, -0.11254877597093582, 0.3029062747955322, 0.34947577118873596, -0.15745490789413452, -0.1324753761291504, 0.4119974672794342, -0.31138452887535095, -0.39991575479507446, -0.7633195519447327, -0.29974955320358276, 0.233463317155838, -0.3457993268966675, -0.026144636794...
I use a slightly more complicated approach: ``` use Cwd qw(abs_path); use FindBin; use lib abs_path("$FindBin::Bin/../lib"); ``` The abs\_path call is to make the @INC contain whatever/lib, and not whatever/bin/../lib - it's just a slight change, but makes reading error messages easier.
[ -0.02669619396328926, -0.09586188942193985, 0.2936933636665344, -0.27731335163116455, -0.1172555461525917, -0.058281756937503815, 0.4061495065689087, 0.17144913971424103, 0.0920184999704361, -0.7157266139984131, -0.22912344336509705, 0.7541683316230774, -0.5239042043685913, -0.135989159345...
I'm trying to use Java annotations, but can't seem to get my code to recognize that one exists. What am I doing wrong? ``` import java.lang.reflect.*; import java.lang.annotation.*; @interface MyAnnotation{} public class FooTest { @MyAnnotation public void doFoo() { } public ...
[ 0.16948027908802032, 0.23727750778198242, 0.3140188455581665, -0.2131887972354889, 0.2685410678386688, 0.1866993010044098, 0.302075058221817, 0.029571546241641045, -0.2550707459449768, -0.6746764183044434, 0.02726459503173828, 0.3049068748950958, -0.3579077124595642, 0.1357509344816208, ...
Method method = FooTest.class.getMethod( "doFoo" ); Annotation[] annotations = method.getAnnotations(); for( Annotation annotation : method.getAnnotations() ) System.out.println( "Annotation: " + annotation ); } } ``` You need to specify the annotation as being a Runtime annotation...
[ -0.22642715275287628, -0.030064767226576805, 0.4739149808883667, 0.12685921788215637, 0.31467437744140625, 0.047990813851356506, 0.08203210681676865, -0.4063320457935333, -0.263264000415802, -0.3567759096622467, -0.00592575641348958, 0.3246920108795166, -0.16608025133609772, 0.148622274398...
I generate some images using a PHP lib. Sometimes the browser does not load the new generated file. How can I disable cache just for images created dynamically by me? Note: I have to use same name for the created images over time. A common and simple solution to this problem that feels like a hack but is fairly por...
[ 0.41516780853271484, 0.11955082416534424, 0.2541283965110779, 0.11681696772575378, -0.2734735310077667, -0.03792140632867813, 0.18956954777240753, -0.2093077450990677, -0.18884418904781342, -0.5741045475006104, 0.06610734015703201, 0.36444711685180664, -0.4253116548061371, 0.16589143872261...
of the browser no caching can be performed. The random number generation can happen either on the server when serving the page (just make sure the page itself isn't cached...), or on the client (using JavaScript). You will need to verify whether your web-server can cope with this trick.
[ 0.09533682465553284, 0.07137030363082886, 0.18175682425498962, 0.12763753533363342, -0.21381936967372894, -0.19207793474197388, 0.4339955449104309, 0.11327728629112244, -0.3250688314437866, -0.9830482006072998, -0.26024118065834045, 0.16483010351657867, -0.3691846430301666, 0.2480760812759...
MySQL 6.0 is for production. Can I use it for database storage of a large project? MySQL 5.1 is the latest stable version, I'd recommend sticking with that. 6.0 will be quite unstable at this point. **EDIT** as of 2011-05-26 MySQL 5.5.12 is the latest stable version. See this link for the lastest stable version: <htt...
[ 0.1423800140619278, 0.010588809847831726, 0.6467742919921875, 0.12564878165721893, -0.18346147239208221, -0.2441440224647522, 0.5492002964019775, 0.3312152922153473, -0.16189444065093994, -0.7918295860290527, -0.24987338483333588, 0.5691455006599426, -0.20303483307361603, 0.187668755650520...
I am looking for something like trim() but for within the bounds of a string. Users sometimes put 2, 3, 4, or more line returns after they type, I need to sanitize this input. Sample input ``` i like cats my cat is happy i love my cat hope you have a nice day ``` Desired output ``` i like cats my cat is happy i...
[ 0.47161734104156494, -0.09126458317041397, 0.43974828720092773, -0.17028382420539856, 0.23635359108448029, 0.14763528108596802, 0.39760321378707886, 0.020779214799404144, -0.14336402714252472, -0.7977286577224731, -0.060342028737068176, 0.36362048983573914, -0.31166696548461914, -0.4142184...
had. I have an odd feeling there is a regex for this one as well. Finally managed to get it, needs preg so you are using the PCRE version in php, and also needs a \n\n replacement string, in order to not wipe all line endings but one: ``` $body = preg_replace("/\n\n+/", "\n\n", $body); ``` Thanks for getting me o...
[ 0.30319738388061523, 0.18299604952335358, 0.20739316940307617, 0.203871488571167, -0.09162449836730957, -0.11050771921873093, 0.45686614513397217, 0.16619464755058289, 0.17289890348911285, -0.5654903650283813, 0.16113847494125366, 0.6167891025543213, 0.10326585918664932, 0.0577716156840324...
I'm currently deciding on a platform to build a scientific computational product on, and am deciding on either C#, Java, or plain C with Intel compiler on Core2 Quad CPU's. It's mostly integer arithmetic. My benchmarks so far show Java and C are about on par with each other, and .NET/C# trails by about 5%- however a ...
[ 0.01833634451031685, 0.17259250581264496, -0.0656004473567009, 0.22674651443958282, -0.21798668801784515, 0.20176343619823456, -0.022863073274493217, 0.17509466409683228, -0.12788157165050507, -0.659390926361084, 0.11976724863052368, 0.4322241246700287, 0.04773201793432236, -0.163768336176...
app starting (Probably a few seconds in my case, as it's mostly tight loops), so I'm not sure whether to believe them Can anyone shed any light on the situation? Would .NET beat Java? (Or am I best just sticking with C at this point?). The code is highly multithreaded and data sets are several terabytes in size. Ha...
[ -0.032622065395116806, -0.09103340655565262, 0.3094519078731537, -0.05380501225590706, -0.1646747589111328, 0.08571209013462067, 0.21880002319812775, -0.16565600037574768, -0.432192862033844, -0.7323328256607056, -0.09888294339179993, 0.6803741455078125, -0.40962129831314087, -0.2181811779...
these provide a significant speedup). Edit: We are considering moving to C# or Java because they may, in theory, be faster. Every percent we can shave off our processing time saves us tens of thousands of dollars per year. At this point we are just trying to evaluate whether C, Java, or c# would be faster. The key pi...
[ 0.3162614107131958, 0.03815747797489166, 0.11083780229091644, 0.3020271360874176, 0.09750957787036896, 0.04679116979241371, 0.027183743193745613, 0.19273798167705536, -0.3164745569229126, -0.8542513847351074, -0.0035947677679359913, 0.6248177886009216, -0.13447925448417664, -0.067757755517...
that optimization effort costs tens of thousands of dollars per year, then it isn't worth doing. You could make a bigger saving by firing a programmer. With the right skills (which today are rarer and therefore more expensive) you can hand-craft assembler to get the fastest possible code. With slightly less rare (and ...
[ 0.1501842886209488, 0.4188155233860016, -0.13297966122627258, 0.5601308345794678, 0.44184789061546326, 0.16356147825717926, 0.06795795261859894, 0.09085644781589508, -0.1395287960767746, -0.6862208247184753, 0.013417009264230728, 0.9587013125419617, -0.20409724116325378, -0.095679201185703...
this stays at "tens of thousands of dollars per year" then there will come a point where it is no longer worth the effort. In fact I would hazard a guess you're already at that point because "tens of thousands of dollars per year" is in the range of one salary, and probably not enough to buy the skills required to hand...
[ 0.5616896748542786, 0.2770155668258667, 0.1857064664363861, 0.2366349697113037, 0.39620572328567505, 0.10794532299041748, 0.3145107924938202, 0.2643202245235443, -0.08655763417482376, -0.5388943552970886, -0.0771813914179802, 0.7067950963973999, 0.3329642117023468, -0.058191653341054916, ...
simply because you won't be taking advantage of the capabilities of the platform, but instead working against them, e.g. trying to use Java as if it was C. Also within your existing code, there will be parts that make a crucial contribution to the running time (they run frequently), and other parts that are totally ir...
[ 0.42100363969802856, 0.12225562334060669, -0.06426836550235748, 0.3684244155883789, 0.27167001366615295, -0.173563152551651, 0.2699478566646576, 0.14329266548156738, -0.3506210744380951, -0.5932302474975586, -0.10041004419326782, 0.47072532773017883, -0.15542849898338318, -0.31011942028999...
see where time is being wasted in the existing code. **Update when I noticed the reference to the code being "multithreaded"** In that case, if you focus your effort on removing bottlenecks so that your program can scale well over a large number of cores, then it will automatically get faster every year at a rate tha...
[ 0.3892018496990204, -0.05080519989132881, 0.45062455534935, 0.36652886867523193, 0.2884080111980438, 0.048034653067588806, 0.1727234423160553, 0.22411638498306274, -0.809068500995636, -0.8093574047088623, -0.17717577517032623, 0.464201956987381, 0.13902561366558075, 0.06802095472812653, ...
that a 32 core machine will cost less than a developer by that time.
[ -0.020718954503536224, 0.26281845569610596, -0.10335638374090195, 0.24270576238632202, 0.2782348096370697, 0.2487984299659729, -0.13845886290073395, 0.141080841422081, 0.0027408816386014223, -0.44306132197380066, -0.0018130408134311438, 0.36676669120788574, 0.04022960364818573, -0.15300600...
I have a main app and a type library contains 2 COM objects, one is IFile, one is IFiles. IFiles creates IFile, and stores them in a TLIST, and has standard methods like Add, Remove etc. Both IFile and IFiles are TAutoObject. "Add" method in IFiles is working fine, it simply creates IFile object [Code 1], and adds it ...
[ -0.07535597681999207, 0.11208511143922806, 0.5338675379753113, 0.019587164744734764, 0.11792510747909546, 0.38353532552719116, 0.30625802278518677, -0.422352135181427, -0.004216072149574757, -0.6522290110588074, -0.08050337433815002, 0.5446791648864746, -0.39732295274734497, -0.13550634682...
this. [Code 2] ``` var i: Integer; f: IFile; Files: IFiles; begin Files := CoTIFile.Create; for i:= 1 to 4 do begin // Create a dummy file object f := Files.Add('Filename ' + IntToStr(i)); f._AddRef; // Not sure if AddRef works like this // Prints out the last file Memo1.Lines.Add(Files...
[ -0.2096218466758728, -0.1532220095396042, 0.5073482990264893, -0.14764276146888733, 0.005919357296079397, 0.11108258366584778, 0.2456461489200592, -0.3804742991924286, -0.20554864406585693, -0.9281901121139526, -0.3399602770805359, 0.29170697927474976, -0.19662150740623474, 0.1826872080564...
Memo1.Lines.Add(f.Filename); // ! No print out. end; end; ``` From the 2nd loop, even though fFiles.Count = 4, but all contents have lost. Do I need some extra treatment in IFile to handle AddRef and Release? or the way IFiles.Add method I wrote is wrong? Try using TInterfaceList rather than TList to store the in...
[ -0.08816788345575333, 0.010667524300515652, 0.32914817333221436, -0.0006877448176965117, -0.016264742240309715, 0.05654021352529526, 0.5888871550559998, -0.12322522699832916, -0.23221993446350098, -0.7568678855895996, 0.08990105986595154, 0.6626428365707397, -0.2952718138694763, 0.15989674...
I am writing stored procedures for several operations in a database, I just wanted to know: * Is it better to design a single procedure for a table which can perform add, modify, delete operations or... * Should I design seperate procedures for each operations Which approach would be better? I would say that a separa...
[ 0.11109065264463425, 0.08212698996067047, 0.001639758818782866, 0.04445475712418556, -0.09131338447332382, 0.26974183320999146, 0.11624569445848465, -0.30251261591911316, -0.28675487637519836, -0.2988109290599823, 0.0750739648938179, 0.5616812705993652, -0.4764461815357208, 0.0690394714474...
dummy insert parameters when you just want to delete a record.
[ 0.8296310901641846, 0.1251920908689499, -0.5852067470550537, 0.4069153666496277, 0.12310678511857986, -0.2909674048423767, -0.02176419273018837, 0.10532248765230179, -0.248430997133255, 0.10980476438999176, 0.21026475727558136, 0.8135230541229248, -0.24412761628627777, -0.17845305800437927...
I'm working with with asp.net and writing a few classes (controls for the CMS) to use on my website. At the moment i'm using a text editor (UE) which has sftp support and syntax highlighting to edit the files and save via sftp. Then i just test it out on the test site. It's working well.. but since i'm very new to c# i...
[ 0.5971628427505493, 0.2051999419927597, 0.10673639923334122, -0.15007255971431732, -0.481781542301178, -0.02477126568555832, 0.05432929843664169, 0.010920088738203049, -0.2045089155435562, -0.7799853682518005, 0.150606170296669, 0.7792023420333862, -0.1428520828485489, -0.13081108033657074...
setting up a local environment to work in as i already have a test environment at my webhost, and frankly it's the differences between my set up and the host (ie: the CMS, unicode issues, dates...) that are the trickier bits. Is there a way to use Visual Studio with a remote site accessible only by sftp? One way to do...
[ 0.6626467704772949, 0.032617270946502686, -0.003803583327680826, 0.19519688189029694, -0.05107830464839935, -0.12246061861515045, 0.1815233677625656, -0.10299262404441833, -0.27186843752861023, -0.6355125308036804, -0.027555080130696297, 0.5078034400939941, -0.14435628056526184, -0.1222531...
can find software that lets you mount the SFTP server as a drive. Software that allows you to do this include [ExpanDrive](http://www.expandrive.com/windows). This would allow you to use Visual Studio as normal whilst behind the scenes the files are uploaded to and downloaded from the SFTP server as required.
[ 0.7381507158279419, -0.19415505230426788, 0.2657935619354248, 0.15019944310188293, 0.19130755960941315, -0.34080398082733154, -0.2641246020793915, 0.26114097237586975, -0.5613308548927307, -0.4346519708633423, -0.11066846549510956, 0.5295620560646057, 0.040446970611810684, 0.00085744034731...
I do a rs.getTimestamp("datetime") in Java. In the database, this datetime is 2009/03/06 02:47:18 but the time is returned as 14:47:18 I'm not very knowledgeable about MySQL dates, so I would appreciate any explanation as to why this is happening. It doesn't matter. Its not about MySQL or any database. This is the...
[ 0.172994926571846, 0.02079065330326557, 0.886742115020752, -0.1921679675579071, -0.0485818050801754, -0.22312334179878235, 0.3645603656768799, -0.0035302306059747934, -0.4421038031578064, -0.686747670173645, 0.2018118053674698, 0.2830566167831421, 0.11570676416158676, 0.11602792888879776, ...
I am currently working on an Webservice to retrieve a pdf Document from an Crystal Report. As lonmg as there are no parameter Values in the Report, the service works fine. As soon as I use parameters in a Query the Reports can't be shown anymore and I retrieve an error like 'missing parameter values'. But there is only...
[ -0.12148983031511307, -0.044820934534072876, 0.657134473323822, 0.16099326312541962, -0.35827580094337463, 0.0566556490957737, 0.13177697360515594, -0.5620912909507751, -0.9009023904800415, -0.362921804189682, -0.21894949674606323, 0.37867382168769836, -0.31604158878326416, 0.5326322913169...
Report repDoc.ParameterFields[index].CurrentValues.Clear(); repDoc.ParameterFields[index].CurrentValues.AddValue(value); // now i create the PDF as an HTTPresponse repDoc.ExportToHttpResponse(ExportFormatType.PortableDocFormat, response, false, "Report"); ``` I really have no idea why it doesnt work... My approach wo...
[ -0.20799289643764496, -0.04622944816946983, 0.8399720191955566, 0.23200206458568573, -0.3019183576107025, -0.2597716748714447, 0.28251731395721436, -0.3871033489704132, -0.27890199422836304, -0.3308059871196747, -0.16707976162433624, 0.7505221962928772, -0.2628922462463379, -0.062509633600...
is there any way to add a JMenuItem to a JPanel so that I can create a button to show multiple options, like the latest news button in firefox, under the address bar? I can only add JMenu and JMenuItems to a JMenuBar, JPopupMenu and other JMenus and JMenuitems Is there any way to create in Java Swing a drop down Jbut...
[ 0.2709427773952484, -0.22409860789775848, 0.3507797420024872, 0.10039473325014114, -0.18050304055213928, 0.15834276378154755, 0.06680003553628922, -0.11690158396959305, -0.23120345175266266, -0.42060574889183044, -0.18093149363994598, 0.7297914028167725, -0.27826282382011414, -0.6026957035...
the button i write this code: ``` popMenu.show(showOptionsButton,0,showOptionsButton.getHeight()) ``` It works fine like a JMenu in a JMenuBar, but not exactly like a dropdown button, in which you can perform an action pressing the button or show more actions pressing the down arrow. I believe this can be done ussin...
[ -0.03377312421798706, -0.2682378888130188, 0.9854162931442261, -0.30517032742500305, -0.20645344257354736, 0.10133673995733261, 0.0528208389878273, -0.4453390836715698, -0.16071653366088867, -0.4561842381954193, -0.048397455364465714, 0.6503031253814697, -0.2299320101737976, -0.35890454053...
I'm reading a c# book that describes the SyncRoot pattern. It shows ``` void doThis() { lock(this){ ... } } void doThat() { lock(this){ ... } } ``` and compares to the SyncRoot pattern: ``` object syncRoot = new object(); void doThis() { lock(syncRoot ){ ... } } void doThat() { lock(syncRoot){ .....
[ 0.139791801571846, -0.1815813183784485, 0.5556828379631042, -0.11695297807455063, 0.3160790801048279, -0.037908248603343964, 0.27564799785614014, -0.11744734644889832, -0.08297369629144669, -0.7559993863105774, 0.27037176489830017, 0.4969509541988373, -0.7801029682159424, 0.191770762205123...
form the class itself, you can use the SyncRoot pattern* Eh? 'object of the instance'? Can anyone tell me the difference between the two approaches above? If you have an internal data structure that you want to prevent simultaneous access to by multiple threads, you should always make sure the object you're locking on...
[ 0.11199715733528137, -0.08043330162763596, -0.23565326631069183, 0.26860785484313965, -0.19260390102863312, -0.45246174931526184, 0.4533081352710724, 0.11821237951517105, -0.4043165147304535, -0.3457144796848297, -0.1949079930782318, 0.18524976074695587, -0.47852715849876404, 0.55754506587...
Likewise, you should not lock on something you expose to the outside world. Which means that the best solution is to use an internal object, and thus the tip is to just use `Object`. Locking data structures is something you really need to have full control over, otherwise you risk setting up a scenario for deadlockin...
[ 0.2206905037164688, 0.0782858282327652, -0.07765653729438782, 0.454560250043869, 0.1269448697566986, -0.6421975493431091, 0.39446771144866943, -0.0792146623134613, -0.47932443022727966, -0.2684887647628784, -0.35731959342956543, 0.485191285610199, -0.22947026789188385, 0.29286545515060425,...
I'm searching for a component similiar to this one(Delphi) in .NET 3.5 SP1 [alt text http://img15.imageshack.us/img15/6657/compc.jpg](http://img15.imageshack.us/img15/6657/compc.jpg) Thanks. ListView with "View = Detail" or DataGridView.
[ 0.22594277560710907, -0.13629981875419617, 0.37975600361824036, 0.2898899018764496, -0.27067291736602783, -0.13843084871768951, 0.3082965612411499, 0.0694994181394577, -0.18013198673725128, -0.7694501876831055, -0.2398153394460678, 0.3855810761451721, 0.08356137573719025, -0.30903273820877...
software fails to write to profile folder stored in C: with Win2003 limited user due "out of disk space" When I look with Admin rights, there is plenty of space on C: drive When I go with limited to user to cmd.exe and say dir c:/ , its 0 bytes free Looks like there is a [disc quota](http://www.microsoft.com/technet/...
[ -0.08292121440172195, 0.19173306226730347, 0.1575213074684143, 0.21101324260234833, 0.11159219592809677, -0.4112744629383087, 0.3930891454219818, 0.08076432347297668, 0.15500463545322418, -0.28928497433662415, -0.15950217843055725, 0.7157867550849915, -0.06744838505983353, 0.09787290543317...
When I create WPF applications, very quickly my XAML starts to bloat. I then **approach the XAML/style issue in a HTML/CSS way**, looking for repetitive code and packing it into styles which I put into my Window.Resources section. Is this the way others are doing it or is there some better way now in XAML? It just se...
[ 0.49604836106300354, 0.26016485691070557, 0.33952271938323975, -0.13599048554897308, -0.2501085102558136, -0.017120661213994026, 0.23498935997486115, -0.2827211320400238, -0.47466105222702026, -0.8202224969863892, 0.11270506680011749, 0.23986020684242249, -0.3786976635456085, 0.05809864774...
25 lines of same with the names and perhaps the Click targets. **Or perhaps when I move this to MVVM this issue will take care of itself with DataBinding** (it is currrently just a hard-coded prototype), so I can keep the names of the menu items in a collection in my ViewModel and it then creates the menu dynamically...
[ 0.31082355976104736, 0.03792436048388481, 0.543239951133728, 0.04114347696304321, -0.12886613607406616, 0.19060194492340088, 0.273556113243103, -0.14396026730537415, -0.28587067127227783, -0.7536248564720154, 0.0493159182369709, 0.5828530788421631, -0.21695415675640106, -0.0801314190030098...
<Setter Property="Cursor" Value="Hand"/> <Setter Property="Foreground" Value="#555"/> <Setter Property="Background" Value="Transparent"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <TextBlock TextDecorations="...
[ -0.17495879530906677, -0.3308182954788208, 0.4736226201057434, 0.030399736016988754, 0.03511631116271019, 0.25440171360969543, -0.13731035590171814, -0.6708874106407166, -0.05680137872695923, -0.597734272480011, -0.24844202399253845, 0.3338311016559601, -0.40899544954299927, -0.13730196654...
Text="{TemplateBinding Content}" Background="{TemplateBinding Background}"/> <ControlTemplate.Triggers> <Trigger Property="IsPressed" Value="True"> <Setter Property="Foreground" Value="Red"/>
[ 0.06467404216527939, -0.3003648519515991, 0.25613561272621155, 0.009406881406903267, 0.1135147213935852, 0.220283642411232, 0.1175001785159111, -0.5359347462654114, -0.013402832671999931, -0.47957178950309753, -0.3510614335536957, 0.49620896577835083, -0.4279034733772278, -0.09140615165233...
</Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> </Window.Resources> ``` **Current XAML:** ``` <Expander HorizontalAlignment="Left" Header="File" VerticalAlignment="Top" ExpandDirection="Down" Width="200" Padding=...
[ -0.33689457178115845, -0.4296019673347473, 0.7531680464744568, -0.09496919810771942, 0.46477505564689636, 0.18927983939647675, -0.2280622273683548, -0.4148740768432617, -0.5581302046775818, -0.5362926721572876, -0.32769930362701416, 0.44525983929634094, -0.18279024958610535, 0.070408724248...
<GradientStop Color="#bbb" Offset="0"/> <GradientStop Color="#ccc" Offset="1"/> </LinearGradientBrush> </Expander.Background> <Border CornerRadius="5"> <Border.Background> <LinearGradientBrush> <GradientStop Color="#ccc" Offset="0"/> <Gradi...
[ -0.33402249217033386, -0.47702789306640625, 0.7041134834289551, 0.11710882186889648, 0.007297267206013203, -0.04731546342372894, -0.15708133578300476, -0.39027339220046997, -0.16366791725158691, -0.43751969933509827, 0.3032715618610382, 0.18688149750232697, -0.25206345319747925, 0.05267317...
</LinearGradientBrush> </Border.Background> <StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Top"> <Button Click="buttonClose_Click" Style="{StaticResource Link}" Margin="10 3 3 3" Content="Close">
[ -0.2838148772716522, -0.4592885375022888, 0.9252040982246399, -0.007958118803799152, 0.16735263168811798, 0.07715708017349243, -0.05862175300717354, -0.3025764524936676, -0.16895993053913116, -0.3182872235774994, 0.014219769276678562, 0.2401997596025467, -0.027284640818834305, 0.2317719310...
</Button> </StackPanel> </Border> </Expander> <Expander HorizontalAlignment="Left" Header="Customers" VerticalAlignment="Top" ExpandDirection="Down" Width="200" Padding="2"> <Expander.Background> <LinearGradientBrush> <GradientStop Color="#bbb" Offset="0"/> <GradientStop...
[ -0.37910398840904236, -0.5651268362998962, 0.8160555958747864, -0.047880496829748154, 0.18142564594745636, 0.27052876353263855, -0.5014904141426086, -0.3937104344367981, -0.5047955513000488, -0.48348724842071533, -0.08597790449857712, 0.2887960970401764, -0.1311679482460022, 0.079409509897...
<LinearGradientBrush> <GradientStop Color="#ccc" Offset="0"/> <GradientStop Color="#bbb" Offset="1"/> </LinearGradientBrush> </Border.Background> <StackPanel HorizontalAlignment="Left" VerticalAlignment="Top"> <Button Click="btnAppPage_Click" ...
[ -0.228563129901886, -0.48237818479537964, 0.6808367371559143, -0.1856784224510193, 0.05698283016681671, 0.23807856440544128, -0.14904971420764923, -0.21030184626579285, -0.189138263463974, -0.2787851393222809, 0.02549823187291622, 0.2834762632846832, -0.19576098024845123, 0.122285746037960...
Style="{StaticResource Link}" Margin="10 3 3 3" Content="Create Customer"/> </StackPanel> </Border> </Expander> ``` Simple: identify repetition and move it into a control. The control can have whatever properties necessary to compose the required variations at runtime. And ...
[ 0.2704057991504669, -0.42187970876693726, 0.5593372583389282, 0.11196671426296234, 0.06969792395830154, -0.10136468708515167, -0.09805721044540405, -0.3936392068862915, -0.3732227087020874, -0.5633985996246338, -0.07618431001901627, 0.19201505184173584, -0.41361019015312195, 0.254269093275...
I've installed various PHP packages to be able to use PHP with Apache but also in the commandline. From both I need to be able to connect to MySQL databases. Pretty simple right? That's what I thought but with php-cli I receive following error: ``` Fatal error: Call to undefined function mysql_pconnect() ``` I have ...
[ 0.11701776087284088, 0.31926676630973816, 0.38133296370506287, -0.0050437794998288155, -0.05410439521074295, -0.15864893794059753, 0.18497778475284576, -0.3928773105144501, 0.08671165257692337, -0.5310289859771729, 0.032571010291576385, 0.7613140940666199, -0.37678268551826477, 0.156372636...
gives me this: ``` Configuration File (php.ini) Path => /etc/php5/cli/php.ini ``` Then i've uncommented 'mysql.so' in the extensions section but when i do and run following command it says: ``` PHP Warning: Module 'mysql' already loaded in Unknown on line 0 ``` So for some reason he thinks it is already loaded, ...
[ -0.018772266805171967, 0.15520811080932617, 0.47814175486564636, 0.06914561241865158, 0.2815549075603485, -0.28687047958374023, 0.35574302077293396, 0.16362570226192474, -0.5057124495506287, -0.5830240249633789, -0.2608491778373718, 0.5567254424095154, -0.47043925523757935, 0.2896741032600...
MYSQL_INCLUDE => -I/usr/include/mysql > MYSQL_LIBS => -L/usr/lib -lmysqlclient > mysql.allow_persistent => On => On > ... and more > > ``` From Jaka Jančar. 'php -v' shows: > PHP 5.1.2 (cli) (built: Feb 11 2009 19:55:22) And from php interactive mode 'php -r 'var\_dump(extension\_loaded("mysql"));' gives nothing! `...
[ -0.14918534457683563, 0.27448683977127075, 0.8402376770973206, -0.02327975071966648, 0.12393902242183685, -0.05865466222167015, 0.4405163526535034, -0.13534091413021088, -0.1687415987253189, -0.38374069333076477, -0.4530670642852783, 0.540253758430481, -0.3838965594768524, -0.1251221597194...
I'm trying to write a function that shifts all the elements in an array of strings up by one. ``` void shift_frags(char **frags, int frag_len, int cur) { int i; for(i = cur; i < frag_len-1; i++) { if(strlen(frags[i+1]) > strlen(frags[i])) frags[i] = realloc(frags[i], strlen(frags[i+1])*...
[ -0.06095458194613457, -0.26266151666641235, 0.31993526220321655, -0.3803353011608124, -0.014705848880112171, 0.1892956793308258, 0.25352203845977783, -0.3715613782405853, -0.42687302827835083, -0.3227531909942627, -0.22253923118114471, 0.7273885607719421, -0.3597777783870697, 0.06540385633...
allocated to be the size of a string read from a file. Shouldn't I be able to dynamically allocate new array sizes since my frags parameter is an array of pointers? Thanks Since as you say the array is just an array of pointers, you do not need to perform any reallocations. You just need to copy the pointers themselve...
[ 0.08597856760025024, -0.050040364265441895, 0.13091175258159637, 0.07322186231613159, 0.055312179028987885, 0.12770667672157288, 0.04673652723431587, -0.26343226432800293, -0.6025521755218506, -0.526681125164032, 0.01777389645576477, 0.6120895743370056, -0.5526711344718933, 0.3042039573192...
I have a messaging aspect of my application using [Jabber-net](http://code.google.com/p/jabber-net/) (an [XMPP library](http://en.wikipedia.org/wiki/List_of_XMPP_library_software).) What I would like to do, if for some reason the connection to the Server is ended, is keep trying to connect every minute or so. If I st...
[ 0.4360005557537079, 0.005024055950343609, 0.33390527963638306, -0.13739611208438873, -0.06672262400388718, 0.09408963471651077, 0.29311782121658325, 0.13872675597667694, -0.37262260913848877, -0.4868239760398865, 0.17887865006923676, 0.36262908577919006, -0.3939332067966461, 0.012343450449...
thread-pool thread unless you specify a `SynchronizingObject` * `System.Threading.Timer` executes its callback in a thread-pool thread In all cases, the timer itself will be asynchronous - it won't "take up" a thread until it fires.
[ 0.2401919960975647, -0.2873116433620453, 0.29195481538772583, 0.011890633963048458, 0.2782723605632782, -0.48609310388565063, -0.2630971372127533, -0.1521817445755005, -0.19627930223941803, -0.22420743107795715, 0.021516617387533188, 0.23864735662937164, -0.33502423763275146, 0.13718350231...
I would like to know the most common scenarios where xml serialization may fail in .NET. I'm thinking mainly of `XmlSerializer` here: * it is limited to tree-like data; it can't handle full object graphs * it is limited to public members, on public classes * it can't really do much with `object` members * it has some ...
[ -0.045553773641586304, -0.09083907306194305, 0.1730712652206421, 0.2709093689918518, -0.40656691789627075, -0.4169969856739044, 0.15391474962234497, 0.08836055546998978, -0.359408974647522, -0.6731352210044861, -0.10383670032024384, 0.3706264793872833, -0.34464195370674133, 0.0625127032399...
limitations: * it can't handle values in attributes * requires .NET 3.0 (so not much use in 2.0)
[ -0.13433685898780823, 0.032877471297979355, 0.04699089005589485, 0.3631344139575958, -0.2171860784292221, -0.23276859521865845, 0.389489084482193, 0.004081214778125286, 0.053545255213975906, -0.5409029126167297, 0.1761288046836853, 0.7547966241836548, -0.08110034465789795, -0.2409802973270...
Ok, didn't really want to ask this question as it should be quite a simple solution, but I've spent hours trying to resolve it to no avail. I have a web page with a text box, and then a select drop down next to each other. In Firefox and chrome they line up fine next to each other, but in IE the select box sits higher ...
[ 0.20893582701683044, 0.09669902920722961, 0.6080793738365173, -0.1025361716747284, -0.17637023329734802, -0.0425298847258091, -0.040853336453437805, -0.3016560673713684, -0.4040403962135315, -0.7026152610778809, -0.08864264190196991, 0.4468110501766205, -0.33724135160446167, -0.07310761511...
/> <select name="ctl00$main$acceptedDomainsDropDownList" id="ctl00_main_acceptedDomainsDropDownList"> <option value="domain.com">domain.com</option> <option value="doamin1.com">domain1.com</option> <option value="domain2.com">domain2.com</option> <option value="domain3.co...
[ 0.1725493222475052, -0.241873636841774, 0.5341378450393677, 0.14542965590953827, 0.0368889756500721, -0.31656530499458313, 0.09095565229654312, 0.02095823734998703, -0.23254695534706116, -0.5387377738952637, -0.02781798131763935, 0.22054727375507355, -0.24249839782714844, 0.118642963469028...