text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
I am looking to write a function like ``` ref String TestIt( int index ) { return this.TestArray[index]; }; ``` so that I could write code like: ``` MyClass.TestIt(0) = "Hello World"; ``` My goal is to mimic this c++ declaration ``` CString& MyClass::Data( UINT index); ``` By Reference I am referring to the c...
[ 0.13108207285404205, 0.07573960721492767, 0.30785468220710754, -0.2684464752674103, -0.14719896018505096, 0.19607986509799957, 0.3461591899394989, 0.026505757123231888, 0.08806297928094864, -0.7200879454612732, 0.20614559948444366, 0.41500231623649597, -0.5014761090278625, 0.33171576261520...
to write a setter property. Unfortunately, setters can’t take further arguments in C# so you won't be able to write this code 1:1 in C#. The closest you can get is a nested class with a default property: ``` class YourClass { public class Nested { public Nested(YourClass outer) { m_RefToOuterWorld = outer;...
[ -0.01460924744606018, -0.23065775632858276, 0.3118543028831482, -0.08884304761886597, 0.1799037605524063, -0.27893444895744324, 0.36739271879196167, -0.14246489107608795, 0.08635047823190689, -0.6520640254020691, -0.08147252351045609, 0.757961630821228, -0.37598350644111633, 0.061185639351...
set { m_RefToOuter.TestArray[index] = value; } } } private readonly Nested m_Nested; private string[] TestArray = new string[10]; public YourClass() { m_Nested = new Nested(this); } public Nested TestIt { get { return m_Nested; } } } ``` You can use it like this: ``` var test = new You...
[ 0.12835070490837097, -0.17467795312404633, 0.30173569917678833, -0.17329587042331696, 0.16103407740592957, -0.19432438910007477, 0.5633482336997986, -0.10562295466661453, -0.12222052365541458, -0.7021722197532654, -0.25646308064460754, 0.5225148797035217, -0.4517174959182739, 0.15116174519...
very C#-y. The useless indiretion through the nested class here isn't something you'll see very often.
[ 0.4490799605846405, 0.010900627821683884, 0.08323512226343155, 0.2808949947357178, -0.17056843638420105, -0.22025343775749207, 0.35954979062080383, 0.512947678565979, -0.33957627415657043, -0.43032437562942505, -0.11393187940120697, 0.0814480409026146, 0.2961668074131012, 0.196682691574096...
I've got a small piece of code that is parsing an index value to determine a cell input into Excel. It's got me thinking... What's the difference between ``` xlsSheet.Write("C" + rowIndex.ToString(), null, title); ``` and ``` xlsSheet.Write(string.Format("C{0}", rowIndex), null, title); ``` Is one "better" than...
[ -0.0758557915687561, 0.28375816345214844, 0.09337536990642548, -0.23159487545490265, -0.2697535455226898, -0.061271753162145615, 0.16865256428718567, -0.270248681306839, -0.0210771095007658, -0.5833854675292969, 0.18678614497184753, 0.6849961280822754, -0.5411701202392578, -0.2276076525449...
of localisation etc, but in a case like this concatenation is simpler and works just as well. **With C# 6** String interpolation makes a lot of things simpler to read in C# 6. In this case, your second code becomes: ``` xlsSheet.Write($"C{rowIndex}", null, title); ``` which is probably the best option, IMO.
[ 0.0005666035576723516, -0.1331389844417572, 0.3224056661128998, -0.3824408948421478, -0.02614823542535305, -0.2482645958662033, 0.26661476492881775, 0.17898331582546234, -0.24044573307037354, -0.5531635284423828, -0.26320821046829224, 0.5630238056182861, -0.5211536288261414, -0.02354492433...
I'm still trying to get my head around using Java's generics. I have no problems at all with using typed collections, but much of the rest of it just seems to escape me. Right now I'm trying to use the JUnit "PrivateAccessor", which requires a Class[] argument with a list of all the argument types for the private meth...
[ -0.14904683828353882, 0.059538695961236954, 0.3233644962310791, -0.4759373068809509, -0.45850327610969543, 0.040118031203746796, 0.2396196573972702, -0.1258091777563095, -0.37178707122802734, -0.4132351875305176, 0.1800190508365631, 0.518463671207428, -0.697822630405426, 0.0578509941697120...
= new Class<? extends Object>[] { Collection<MyClass1>.class, ArrayList<MyClass2>.class }; ``` But Eclipse puts a red marker on the closing >s, and says it's expecting "void" at that point. Can I do this using generics, or shouldn't I bother? The first problem you have is that you should be using ``` Class<?>[] arg...
[ -0.07347171753644943, 0.2947467267513275, 0.3868263065814972, -0.24492672085762024, -0.16127674281597137, -0.14088374376296997, 0.5142800211906433, -0.2539876401424408, -0.10115037858486176, -0.5326777696609497, 0.03923681005835533, 0.6408759951591492, -0.42616531252861023, 0.3144444227218...
the [FAQ](http://www.angelikalanger.com/GenericsFAQ/JavaGenericsFAQ.html) from which I've linked the two explanations above for an "earthly" take on Java generics that will clarify most questions.
[ 0.2196224331855774, 0.19573549926280975, 0.39704152941703796, -0.1196952760219574, -0.16962848603725433, -0.3022940754890442, 0.3566308617591858, 0.03627932071685791, -0.14462865889072418, -0.11546896398067474, 0.04740526154637337, 0.14396989345550537, -0.08432482928037643, 0.0338938944041...
This one has me beat; I have a WPF window with two (important for this case) controls, both from the WPF toolkit available at CodePlex; A DatePicker and a DataGrid. The DataContext of this window is set to a CLR object that has all the information it needs. This CLR object has a large list of data, and a method calle...
[ -0.0483223982155323, -0.433247447013855, 0.7702068090438843, 0.02946433424949646, 0.053377147763967514, -0.17071889340877533, -0.2317723035812378, -0.18687036633491516, -0.4837017357349396, -0.6834144592285156, 0.15049198269844055, 0.40976718068122864, -0.04522110894322395, -0.082297787070...
called with the selected date of the DatePicker as the parameter? In other words, I want the user to use the datepicker to choose a date, and the grid should automatically update whenever the date is changed to reflect the correct data. What kind of black magic do I have to do to achieve something like this - which I...
[ -0.20777945220470428, -0.08102424442768097, 0.6700341105461121, -0.034252215176820755, -0.1103176474571228, -0.11353544145822525, -0.07325015962123871, -0.11996641010046005, -0.2700595557689667, -0.2258344292640686, -0.08029460906982422, 0.18562234938144684, -0.33372366428375244, 0.0748698...
Title="Window1" Height="413" Width="727" x:Name="_this"> <Window.Resources> <ObjectDataProvider ObjectInstance="_this.DataContext" MethodName="GetFromDate" x:Key="odp"> <ObjectDataProvider.MethodParameters>
[ -0.19413450360298157, -0.18370632827281952, 0.6834965944290161, 0.22511783242225647, 0.09273292869329453, -0.17809391021728516, 0.24899305403232574, -0.20747610926628113, -0.20035898685455322, -0.5290107727050781, -0.41891077160835266, 0.3510127663612366, 0.11109459400177002, 0.14517304301...
<System:DateTime>2008-01-01</System:DateTime> </ObjectDataProvider.MethodParameters> </ObjectDataProvider> </Window.Resources> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <dg...
[ -0.4846813678741455, -0.46735134720802307, 0.4223416745662689, 0.11504298448562622, -0.10908128321170807, 0.1800946742296219, -0.1365717351436615, -0.13319335877895355, -0.40921810269355774, -0.6285669803619385, 0.16433405876159668, 0.28327345848083496, -0.05753685161471367, 0.097874008119...
<dg:DatePicker.SelectedDate> <Binding Source="{StaticResource odp}" Path="MethodParameters[0]" BindsDirectlyToSource="True"
[ -0.036488037556409836, -0.5447559952735901, 0.5293031930923462, -0.02921111509203911, 0.13745301961898804, 0.01738816499710083, 0.26342636346817017, -0.5960558652877808, -0.1969427466392517, -0.4503779411315918, -0.03128558769822121, -0.03681464120745659, -0.24997307360172272, 0.2052240818...
Mode="OneWayToSource"/> </dg:DatePicker.SelectedDate> </dg:DatePicker> <dg:DataGrid x:Name="dtgGrid" ItemsSource="{Binding Source={StaticResource odp}}" AutoGenerateColumns="True"
[ -0.09098274260759354, -0.6890251040458679, 0.5353966951370239, -0.008460620418190956, 0.08139704167842865, -0.12090138345956802, 0.18023495376110077, -0.12646052241325378, -0.009601423516869545, -0.40910404920578003, -0.3019051253795624, 0.3678394854068756, -0.30673664808273315, 0.18404193...
Grid.Row="1"/> </Grid> </Window> ``` The code behind: ``` public partial class Window1 : Window { public Window1() { InitializeComponent(); LoadData(); } protected void LoadData() { DataContext = new Data(); ObjectDataProvider odp = this.Resources["odp"] as O...
[ -0.3093982934951782, -0.34271761775016785, 0.6188217401504517, -0.20510700345039368, 0.2695230543613434, 0.14510071277618408, 0.00979636050760746, -0.2382732778787613, -0.29645392298698425, -0.9417425990104675, -0.5281550884246826, 0.39140668511390686, -0.2596781253814697, 0.15580995380878...
DataContext; } } ``` and the business object: ``` public class DataItem { public string Name { get; set; } public int BirthYear { get; set; } } public class Data { private readonly List<DataItem> data; public Data() { data = new List<DataItem>(); data.Add(new DataItem { Name...
[ -0.16031932830810547, 0.030347369611263275, 0.39362040162086487, -0.265150249004364, 0.07122889161109924, 0.23773899674415588, 0.0355578288435936, -0.0532444603741169, -0.05582977086305618, -0.19033388793468475, -0.6753316521644592, 0.5675443410873413, -0.3542879521846771, 0.32246160507202...
data.Add(new DataItem { Name = "Aaron", BirthYear = 2006 }); data.Add(new DataItem { Name = "Bill", BirthYear = 2006 }); data.Add(new DataItem { Name = "Steven", BirthYear = 2005 }); data.Add(new DataItem { Name = "George", BirthYear = 2004 }); data.Add(new DataItem { Name = "Britany", B...
[ 0.29834675788879395, -0.2089613676071167, 0.6205667853355408, -0.05506480857729912, 0.04035584628582001, 0.1207771897315979, 0.27169331908226013, -0.3014255464076996, -0.10386456549167633, -0.3578246533870697, -0.20819491147994995, -0.06720994412899017, -0.08647799491882324, 0.468165069818...
return this.data.Where(d => d.BirthYear == dt.Year).ToList(); } } ```
[ 0.3911028802394867, -0.029474908486008644, 0.23235240578651428, -0.29958564043045044, 0.5877379775047302, -0.05098622664809227, 0.02638242207467556, -0.0732072964310646, 0.09177544713020325, -0.41829314827919006, -0.42176172137260437, 0.38124871253967285, -0.05045464262366295, 0.5196719765...
Can anyone point me to an example of how to use ServletUnit to test JSP's? Do I need I need to call registerServlet()? If so, what class name do I pass? You do not need to registerServlet if you are going use the default Jasper compiler. However, I needed Jasper jars and their dependencies on the CLASSPATH. The Maven d...
[ -0.024124616757035255, 0.014097565785050392, 0.36454519629478455, 0.15642255544662476, 0.011208982206881046, 0.01701350510120392, 0.05982307717204094, -0.36619555950164795, -0.2424030601978302, -0.5024847388267517, 0.04006585851311684, 0.602584183216095, -0.43496063351631165, 0.05486620590...
<version>3.3.2</version> <scope>test</scope> </dependency> ``` I am stuck in a JDK1.4 project,so you may be able to use newer versions. I haven't gotten standard taglib working yet...
[ 0.5207529067993164, 0.29957887530326843, 0.28912219405174255, -0.26046818494796753, -0.1122867539525032, -0.6331632137298584, 0.5800042152404785, -0.05368512123823166, 0.18107716739177704, -0.7326670289039612, -0.03650117665529251, 0.5391187071800232, -0.3327191174030304, 0.146292358636856...
I have a folder "FolderA" which contains three sub-folders: foldera1 foldera2 and foldera3 I need to write a batch file which resides inside "FolderA". It should delete all the folders under "FolderA" as a cleanup activity. I don't know the folder names. `rmdir` does not support wild cards. Could someone provide a so...
[ 0.07362395524978638, 0.04502744600176811, 0.05199209228157997, -0.156073659658432, 0.05878673866391182, -0.04693935066461563, 0.24580968916416168, -0.31100037693977356, -0.035261183977127075, -0.40008383989334106, 0.16536177694797516, 0.35146263241767883, -0.2145305722951889, 0.05667723715...
%a in ('dir /ad /b') do (rmdir /S /Q "%a") for /d %a in (*) do (rmdir /S /Q "%a") ``` Note the **double quotes**, in order to be able to delete directories with spaces in them.
[ -0.012590748257935047, 0.38216346502304077, 0.037838224321603775, -0.1505964696407318, -0.04149359092116356, 0.34589701890945435, 0.18356847763061523, -0.0636160597205162, 0.15747010707855225, -0.22810684144496918, -0.6778292059898376, 0.23505645990371704, -0.06653524935245514, 0.013379786...
Is there a way to prompt the user for input during a NAnt build? I want to execute a command that takes a password, but I don't want to put the password into the build script. I'm using a script for now, but I'd love to hear if there's a prebuilt method already available. Many thanks to sundar for the ForegroundColor t...
[ 0.504778265953064, -0.20120497047901154, -0.28419992327690125, 0.17451722919940948, -0.2712855637073517, 0.13903017342090607, 0.2918637692928314, -0.002880936022847891, 0.1190851554274559, -0.5372708439826965, 0.26679831743240356, 0.8129565715789795, 0.03315789997577667, -0.247363060712814...
<code><![CDATA[ [Function("ask")] public string AskPassword(string prompt) { Project.Log(Level.Info, prompt); ConsoleColor oldColor = Console.ForegroundColor; Console.ForegroundColor = Console.BackgroundColor;
[ 0.26390811800956726, -0.210610032081604, 0.6682555675506592, -0.08278066664934158, 0.29014742374420166, 0.010653599165380001, 0.1703401505947113, -0.5088104605674744, 0.1625269502401352, -0.6377052664756775, -0.40042877197265625, 0.4079132378101349, -0.4119355380535126, 0.21147823333740234...
try { return Console.ReadLine(); } finally {
[ -0.2386404424905777, -0.2788292169570923, 0.3872072398662567, -0.08317631483078003, 0.500048816204071, -0.042060721665620804, 0.35490283370018005, -0.03212597966194153, 0.4237331748008728, -0.7377064228057861, -0.27057743072509766, 0.5598882436752319, 0.014509899541735649, 0.01190335676074...
Console.ForegroundColor = oldColor; } } ]]></code> </script> <echo message="Password is ${password::ask('What is the password?')}"/> </target> ```
[ -0.12523697316646576, -0.08336646109819412, 0.3101641833782196, -0.07033400982618332, 0.38489830493927, 0.01818981021642685, 0.0766562893986702, -0.29726383090019226, 0.1009104996919632, -0.7243062853813171, -0.3110623061656952, 0.5842904448509216, -0.4411049485206604, 0.012388705275952816...
I have a project consisting of two files, main.c and logoff.c. When I try to compile them I get this error: ``` gcc -c -g -Wall main.c gcc -c -g -Wall logoff.c gcc -o main -g -Wall main.o logoff.o ld: duplicate symbol _logoff in logoff.o and main.o ``` I have a function named logoff in logoff.c, but I have searched m...
[ 0.5148053765296936, 0.246223583817482, 0.34379518032073975, -0.0815606564283371, 0.31336262822151184, 0.0661928653717041, 0.24177893996238708, -0.08864304423332214, -0.276162713766098, -0.8261078000068665, 0.20101240277290344, 0.3545144200325012, -0.7647788524627686, 0.30083876848220825, ...
as well. Is there any reason why this might occur? I have this problem on two different systems. One thing that might be relevant is that I used the same logoff.c file in another project but it is not connected to this one. I don't believe there is a best/correct way, but the way I'd do it is... Each wizard gets its ...
[ 0.4877088963985443, -0.1479519158601761, 0.7113300561904907, 0.2918664813041687, -0.2644772529602051, -0.2058146893978119, 0.17285941541194916, -0.2698649764060974, -0.2752029597759247, -0.6650120615959167, -0.044351447373628616, 0.34295761585235596, -0.1684139519929886, 0.1754326671361923...
trivial to implement this using jQuery, and it would be easy to maintain as all the wizard steps are in a single ViewPage. On the controller side, you'd have two controller methods, the HttpVerbs.Get version that would prepare the form for viewing and the HttpVerbs.Post version that would take a FormsResult and parse ...
[ 0.1746213734149933, -0.04468529671430588, 0.18846170604228973, 0.2714312672615051, -0.3283660113811493, -0.25486716628074646, 0.26857122778892517, -0.014952031895518303, -0.1744127720594406, -0.5616818070411682, -0.01152090821415186, 0.6324166059494019, -0.39329075813293457, -0.04591848328...
in your javascript code. This way people with javascript see the wizard and people without javascript will see the entire form (without next/prev buttons). The other option is to create a view for each step in the wizard. You can store the intermediate results of the form in the Session. This way would cost plenty of ...
[ 0.46038103103637695, -0.25701573491096497, 0.12665633857250214, 0.038526859134435654, -0.07431365549564362, -0.315341055393219, 0.4713444113731384, -0.2680184543132782, -0.11583730578422546, -0.9641752243041992, 0.019321035593748093, 0.6913007497787476, 0.06265100836753845, -0.443774074316...
If I want to provide OpenID as the only registration method available AND want to do something meaningful with the nick name, how can I handle 2 users with the same Jon Smith nickname? Actually, when I looked at StackOverflow's URL schema I was surprised that the internal user ID was being used in the URL. For example...
[ 0.6304344534873962, 0.4983386993408203, -0.17763684689998627, 0.055036578327417374, -0.2889898121356964, -0.33172017335891724, 0.44209614396095276, 0.33940884470939636, -0.17656582593917847, -0.5641070008277893, 0.1344359815120697, 0.2767024040222168, -0.19243785738945007, 0.39083522558212...
who's who looking at the OpenID url, but it's quite likely going to cause confusion among non-experienced users. I was thinking about checking the nick during registration and forcing the user to pick up another one in case it was already in use. But then you have to keep the new nick and use it instead of the one set...
[ 0.6969295740127563, 0.11613067239522934, 0.1590295135974884, 0.17859458923339844, -0.06910518556833267, -0.35948696732521057, 0.320866197347641, 0.1477872133255005, -0.10191674530506134, -0.3398059606552124, -0.05270146206021309, 0.2545738220214844, 0.16874906420707703, 0.1378055214881897,...
make it work "properly". Thanks! You can use the nick from Open ID and default the nick choice in your system to that, but do not allow duplicates in your system, so they will be forced to choose a different nick for your system. You could still store their Open ID nick and use it, so if you want them to be able to d...
[ 0.40689486265182495, -0.07973238080739975, 0.3384532928466797, 0.20236440002918243, 0.11191954463720322, 0.1248270645737648, 0.38145768642425537, -0.21214616298675537, -0.3082631528377533, -0.5304594039916992, -0.20990635454654694, 0.725626528263092, -0.30046677589416504, 0.011597964912652...
a lot of users want. I would think that this would discourage any users from picking a non-unique nick, since they won't want it displayed that way.
[ 0.9621286392211914, 0.4528846740722656, -0.17589351534843445, 0.18078169226646423, -0.06421850621700287, -0.2415141463279724, 0.07172849029302597, 0.37124788761138916, -0.22386913001537323, -0.4814322590827942, 0.051896385848522186, 0.25169503688812256, -0.1151912733912468, 0.3533119857311...
Some days ago I realized that [PrintWriter](http://java.sun.com/javase/6/docs/api/java/io/PrintWriter.html) (as well as [PrintStream](http://java.sun.com/javase/6/docs/api/java/io/PrintStream.html)) **never throw an IOException** when writing, flushing or closing. Instead it sets an internal flag (`trouble=true`) when...
[ 0.16659092903137207, 0.3737591803073883, 0.26820841431617737, -0.2678472101688385, -0.09302016347646713, -0.12276013940572739, 0.34429383277893066, -0.096221424639225, -0.6711254119873047, -0.26711517572402954, 0.3163001835346222, 0.516772985458374, -0.3821430504322052, 0.15842700004577637...
Reader/Writer API was added, `PrintWriter` was created to parallel the existing `PrintStream`. One application where this behavior is extremely desirable is logging. Logging is ancillary to a larger application. Typically, if logging fails, one doesn't want that the entire application to fail. Thus, it makes sense for...
[ 0.10710646957159042, -0.2617138922214508, 0.25868186354637146, 0.19229869544506073, 0.1075640320777893, 0.03531273081898689, 0.03711478039622307, -0.0972118228673935, -0.1636437624692917, -0.5939943194389343, 0.10565776377916336, 0.7880293130874634, -0.4597860276699066, -0.0458648577332496...
I've got some code that will generically get all Controls in a form and put them in a list. Here's some of the code: ``` private List<Control> GetControlList(Form parentForm) { List<Control> controlList = new List<Control>(); AddControlsToList(parentForm.Controls, controlList); ...
[ 0.143897145986557, -0.25976037979125977, 0.5674929022789001, 0.14277057349681854, 0.24292153120040894, -0.0908598005771637, 0.009642796590924263, -0.4230494499206543, -0.145590677857399, -0.5100712180137634, -0.1542254388332367, 0.43081218004226685, -0.4157394766807556, 0.154457688331604, ...
private void AddControlsToList(Control.ControlCollection rootControls, List<Control> controlList) { foreach (Control c in rootControls) { controlList.Add(c); if (c.HasChildren) AddControlsToList(c.Controls, controlList);
[ 0.010946682654321194, -0.021816646680235863, 0.061799973249435425, -0.1976453810930252, 0.4066320061683655, -0.03887148201465607, 0.29895085096359253, -0.34586000442504883, 0.04955302178859711, -0.35484686493873596, -0.6343963742256165, 0.5740542411804199, -0.361072838306427, 0.14102384448...
// } } ``` So I'm only able to use c.HasChildren to check and see if there's any more child controls from this root control. **What about a menuStrip, toolStrip, and statusStrip? How do I get all of the controls that are in these controls generically? Ex: MenuStripItem** I know that I could try ...
[ 0.3647981882095337, 0.08650778234004974, 0.27767547965049744, 0.20501089096069336, 0.24759162962436676, 0.08873642981052399, -0.11879222840070724, 0.1714380830526352, -0.24480709433555603, -0.7023525238037109, 0.16583876311779022, 0.6746307611465454, -0.0018997864099219441, 0.1121445894241...
more info, please ask. Thanks a bunch I believe the VS designer does it by getting an instance of the control's designer (see the [`Designer` attribute](http://msdn.microsoft.com/en-us/library/system.componentmodel.designerattribute.aspx)), and, if the designer is a [`ComponentDesigner`](http://msdn.microsoft.com/en-u...
[ 0.2631430923938751, -0.13500657677650452, 0.45397651195526123, 0.35646194219589233, -0.2735827565193176, -0.09301722794771194, 0.040992457419633865, -0.2251756191253662, -0.209333598613739, -0.43143796920776367, -0.14053380489349365, 0.4745534360408783, -0.21652773022651672, 0.014355991967...
classes—which will be explained below. To prevent confusion as to which I am referring to at any given time, I will always refer to the designer functionality within Visual Studio as "the designer", and I will always refer to a designer class as an "IDesigner", which is the interface each must implement. When the Visu...
[ 0.24384015798568726, -0.11419916898012161, 0.020124632865190506, 0.09514889121055603, -0.13116593658924103, -0.15010811388492584, 0.04705757647752762, -0.12294591218233109, -0.0711740255355835, -0.7461457848548889, -0.26088395714759827, 0.6355789303779602, -0.2340627908706665, 0.1506047397...
a class—an IDesigner—the designer can use to interface with the component. In effect, this class controls certain aspects of the designer and of the design-time behavior of the component. There's indeed quite a lot you can do with an IDesigner, but right now we're only interested in one thing. Most controls that use a...
[ 0.06038568541407585, -0.15105417370796204, 0.09858917444944382, 0.6784963607788086, -0.0385928638279438, -0.07530032843351364, 0.08874835819005966, -0.07518195360898972, 0.058087948709726334, -0.5326350927352905, -0.13685064017772675, 0.5398627519607544, -0.40127798914909363, 0.37595584988...
specific, the `ToolStrip` control (and by inheritance, the `MenuStrip` control) has a `DesignerAttribute` that references a class called `ToolStripDesigner`. It looks sort of like: ``` /* * note that in C#, I can refer to the "DesignerAttribute" class within the [ brackets ] * by simply "Designer". The compiler add...
[ 0.44146257638931274, -0.0039190733805298805, 0.184552863240242, 0.2858690619468689, -0.2722720205783844, -0.29461658000946045, -0.058610476553440094, -0.21545886993408203, 0.07030326128005981, -0.5847022533416748, -0.03948188200592995, 0.7435808777809143, -0.3465791940689087, 0.25900486111...
qualified name, the VS designer can use `Activator.CreateInstance` to create an instance of it anyway. This `ToolStripDesigner` class, because it inherits [indirectly] from `ComponentDesigner` has an `AssociatedComponents` property. When you call it you get a new `ArrayList` that contains references to all the items t...
[ 0.4645898640155792, -0.19927361607551575, 0.39515405893325806, 0.3114582598209381, -0.138657346367836, -0.3741459548473358, 0.11643972992897034, -0.4343615472316742, -0.15130485594272614, -0.5813602209091187, 0.009821943938732147, 0.6120411157608032, -0.25466814637184143, 0.168603911995887...
IDesigner to get services from the designer. Because we're not * implementing a real designer, we'll create a dummy site that * provides bare minimum services and which relies on the framework * for as much of its functionality as possible. */ class DummySite : ISite, IDisposable{ DesignSurface designSurface; ...
[ 0.27544888854026794, -0.446304589509964, 0.3749249577522278, 0.14317326247692108, -0.07624731212854385, 0.0743291825056076, 0.2463877946138382, -0.39251402020454407, -0.006696215830743313, -0.5432850122451782, 0.0338912270963192, 0.5056352019309998, -0.3621492087841034, 0.21776306629180908...
false;}} public string Name {get{return name;}set{name = value;}} public DummySite(IComponent component){ this.component = component; designSurface = new DesignSurface(); } ~DummySite(){Dispose(false);} protected virtual void Dispose(bool isDisposing){ if(isDisposi...
[ 0.42117932438850403, -0.3826858401298523, 0.39907708764076233, -0.13950210809707642, 0.09704099595546722, -0.04289160668849945, 0.3353431522846222, -0.499700129032135, -0.20212583243846893, -0.42795661091804504, -0.12685318291187286, 0.5505310297012329, -0.17186811566352844, 0.499532371759...
Dispose(true); GC.SuppressFinalize(this); } public object GetService(Type serviceType){return designSurface.GetService(serviceType);} } static void GetComponents(IComponent component, int level, Action<IComponent, int> action){ action(component, level); bool visible, enabled; Control cont...
[ 0.40911731123924255, -0.3190893828868866, 0.6324482560157776, -0.1389046013355255, 0.12381523847579956, 0.029230471700429916, 0.46203935146331787, -0.6107780933380127, -0.0959097221493721, -0.6263729333877563, -0.310657262802124, 0.5510244369506836, -0.2708403468132019, 0.14238442480564117...
in Visual Studio, but at * runtime, we'd rather the controls maintain their state, so we'll save the * values of these properties and restore them after we detach the IDesigner. */ visible = control.Visible; enabled = control.Enabled; foreach(Control child in control....
[ -0.03801730275154114, -0.2077760547399521, 0.37554579973220825, 0.008974618278443813, 0.2802894711494446, 0.1455063819885254, 0.36326295137405396, -0.16622048616409302, -0.13709625601768494, -0.7123959064483643, -0.5425183773040771, 0.4377816319465637, -0.10223931074142456, -0.225687563419...
+ 1, action); }else visible = enabled = false; /* * The TypeDescriptor class has a handy static method that gets * the DesignerAttribute of the type of the component we pass it * and creates an instance of the IDesigner class for us. This * saves us a lot of trouble. */ ComponentD...
[ 0.26288846135139465, -0.5701393485069275, 0.4058176875114441, 0.15269596874713898, -0.1858384907245636, 0.07181908935308456, 0.6091843843460083, -0.4847072958946228, -0.2068658471107483, -0.5577244162559509, -0.20273402333259583, 0.7412036657333374, -0.3796443045139313, 0.16078604757785797...
try{ DummySite site; if(component.Site == null) component.Site = site = new DummySite(component); else site = null; try{ des.Initialize(component);
[ 0.36210906505584717, -0.46287867426872253, 0.08560992777347565, -0.024766767397522926, -0.21254085004329681, 0.22867034375667572, 0.5664422512054443, -0.4647687077522278, -0.06467894464731216, -0.5621946454048157, -0.21078790724277496, 0.35962775349617004, -0.20807823538780212, 0.276224881...
foreach(IComponent child in des.AssociatedComponents) GetComponents(child, level + 1, action); }finally{ if(site != null){ component.Site = null;
[ -0.1116255596280098, -0.23350989818572998, 0.4345189034938812, -0.014353334903717041, 0.24707649648189545, 0.24523694813251495, 0.350469708442688, -0.2676831781864166, -0.09067707508802414, -0.6881712079048157, -0.3294150233268738, 0.37344467639923096, -0.20023609697818756, 0.1214844733476...
site.Dispose(); } } }finally{des.Dispose();} if(control != null){ control.Visible = visible; control.Enabled = enabled; } } /* We'll use this in the ListComponents call */ [DllImport("user32.dll", CharSet=CharSet.Auto)] static extern int SendMessage(IntPtr h...
[ 0.23736442625522614, -0.5864918828010559, 0.7140987515449524, -0.21605536341667175, 0.09721571952104568, -0.07080387324094772, 0.35364657640457153, -0.25194206833839417, -0.3810112476348877, -0.8902456760406494, -0.27795231342315674, 0.47147178649902344, -0.37490394711494446, 0.21783226728...
/* * Invisible controls and disabled controls will be temporarily shown and enabled * during the GetComponents call (see the comment within that call), so to keep * them from showing up and then disappearing again (or appearing to temporarily * change enabled state), we'll disable redrawing of our w...
[ 0.16453810036182404, -0.3238351345062256, 0.6606310606002808, -0.1538664996623993, 0.2900780439376831, 0.0025816932320594788, 0.5922678709030151, 0.10176083445549011, -0.13971462845802307, -0.7058796286582947, -0.6779255867004395, 0.6239210963249207, -0.39125508069992065, -0.02034758776426...
/* You'll want to do something more useful here */ (component, level)=>System.Diagnostics.Debug.WriteLine(new string('\t', level) + component)); SendMessage(Handle, WM_SETREDRAW, 1, 0); } ```
[ 0.19790008664131165, -0.24234355986118317, 0.46553757786750793, -0.07655052840709686, 0.15621687471866608, -0.12067314237356186, 0.4745907485485077, -0.22822123765945435, -0.06398464739322662, -0.5609287619590759, -0.2761039435863495, 0.7153198719024658, -0.21546611189842224, 0.16682706773...
I want to stress test a web service method by calling it several thousand times in quick succession. The method has a single string parameter that I will vary on each call. I'm planning on writing a Powershell script to loop and call this method a number of times. Is there a better way to do this? If you run call aft...
[ 0.5176224112510681, 0.05602097511291504, -0.008843639865517616, 0.26193106174468994, -0.02660689875483513, -0.07043255865573883, 0.3498499095439911, -0.15781302750110626, -0.3462229371070862, -0.5791361331939697, 0.25053900480270386, 0.5248127579689026, -0.5223784446716309, 0.1792977601289...
testing tools are listed [here](http://www.opensourcetesting.org/performance.php). Just set your web service to accept GET requests as well, not only SOAP(default), so you can form the urls.
[ 0.9180349707603455, -0.3267512023448944, 0.1378055214881897, 0.45932745933532715, -0.035188816487789154, -0.4367212653160095, 0.41038978099823, -0.39560845494270325, 0.1065053641796112, -0.6922602653503418, 0.0302361398935318, 0.4582882523536682, 0.2726079821586609, 0.024336254224181175, ...
I am hoping to dynamically update a ModelForm's inline Meta class from my view. Although this code seems to update the exclude list in the Meta class, the output from `as_p()`, `as_ul()`, etc does not reflect the updated Meta exclude. I assume then that the html is generated when the ModelForm is created not when the ...
[ 0.1534314602613449, -0.19569608569145203, 0.3918169140815735, 0.12668661773204803, -0.17560823261737823, 0.1253252476453781, 0.19013279676437378, -0.247801274061203, -0.13867507874965668, -0.6652457118034363, 0.04863596335053444, 0.48355633020401, -0.37689197063446045, 0.017397554591298103...
self.Meta.exclude = excludes_list class Meta: model = Passenger exclude = [] ``` The Meta class is used to dynamically construct the form definition - so by the time you've created the ModelForm instance, the fields not in the exclude have already been added as the new object's attributes. The no...
[ 0.18748565018177032, -0.07312137633562088, 0.094541035592556, -0.0008232957916334271, -0.13572974503040314, -0.17406421899795532, 0.31144607067108154, -0.27861955761909485, 0.04165239632129669, -0.5581743121147156, 0.38462480902671814, 0.6033564805984497, -0.4312509000301361, 0.01682706177...
class definition on the fly. Something like: ``` def get_form(exclude_list): class MyForm(ModelForm): class Meta: model = Passenger exclude = exclude_list return MyForm form_class = get_form(('field1', 'field2')) form = form_class() ``` **UPDATE**: I just revisited this post ...
[ -0.07596448808908463, -0.4565451741218567, 0.13536790013313293, 0.10832692682743073, -0.16341137886047363, 0.0951964259147644, 0.27264875173568726, -0.20013567805290222, -0.09300383180379868, -0.8138587474822998, -0.06746810674667358, 0.5158763527870178, -0.3531581163406372, 0.182906687259...
model = Passenger exclude = exclude_list def __init__(self): super(MyPassengerForm, self).__init__(*args, **kwargs) return MyPassengerForm() form = PassengerForm(('field1', 'field2')) ```
[ -0.3232385218143463, -0.35687509179115295, 0.5123587846755981, 0.09667868912220001, 0.03600030019879341, 0.34891974925994873, 0.3217807412147522, -0.28947657346725464, -0.05531042069196701, -0.7314832210540771, 0.021878032013773918, 0.5223961472511292, -0.08118127286434174, 0.3120976388454...
We have a Silverlight application that needs to load a number of .png files. We can load the images OK, but Silverlight doesn't support reading the pixel data from the Image class. Can anyone suggest a simple solution for getting at this data? Our current best bet would be a third party .png loading library, but we ar...
[ 0.5417820811271667, 0.09243236482143402, 0.0605388842523098, 0.319390207529068, -0.1891832798719406, -0.009807161055505276, -0.11855356395244598, -0.2204163670539856, -0.15313716232776642, -0.6418560743331909, 0.2005152702331543, 0.47834181785583496, -0.5617390275001526, -0.223807439208030...
BMP) for those in this thread that are looking for that. <http://www.microsoft.com/youshapeit/msdn/ExpertKnowledge/2008-10/InnovateWithSilverlight2.aspx> If you don't care for my implementation of it for Silverlight, then you can go straight to what I modified for PNG decoding: <http://sourceforge.net/projects/pr2/> ...
[ 0.4946897327899933, 0.3445153534412384, 0.2830384373664856, -0.3640926480293274, -0.5191449522972107, -0.10198486596345901, 0.21436721086502075, -0.1327005922794342, -0.39476197957992554, -0.3796527087688446, 0.3099108040332794, 0.49916067719459534, -0.4493637681007385, -0.0100706452503800...
I'm preferably looking for a SQL query to accomplish this, but other options might be useful too. ``` SELECT LAST_DDL_TIME, TIMESTAMP FROM USER_OBJECTS WHERE OBJECT_TYPE = 'PROCEDURE' AND OBJECT_NAME = 'MY_PROC'; ``` **`LAST_DDL_TIME`** is the last time it was compiled. **`TIMESTAMP`** is the last time it was changed...
[ 0.07702267915010452, 0.14515674114227295, 0.3919650912284851, -0.009853585623204708, 0.2253594547510147, -0.0016695419326424599, 0.043949998915195465, -0.06650393456220627, -0.5483925938606262, -0.9137817621231079, -0.16082236170768738, 0.4739835858345032, -0.14677223563194275, 0.207909464...
How can I validate date strings in Perl? I'd like to account for leap years and also time zones. Someone may enter dates in the following formats: ``` 11/17/2008 11/17/2008 3pm 11/17/2008 12:01am 11/17/2008 12:01am EST 11/17/2008 12:01am CST ``` I use [DateTime::Format::DateManip](http://search.cpan.org/dist/DateTim...
[ -0.07874947786331177, 0.0399930439889431, 0.8123653531074524, 0.17284925282001495, 0.13785700500011444, -0.06539958715438843, -0.0076680234633386135, -0.3196731507778168, -0.13166682422161102, -0.1485014259815216, 0.0871264636516571, 0.2625119388103485, -0.08816181868314743, 0.263529568910...
say $dt; } # no dies.. produced the following.... # => 2008-11-17T00:00:00 # => 2008-11-17T15:00:00 # => 2008-11-17T00:01:00 # => 2008-11-17T05:01:00 # => 2008-11-17T06:01:00 ``` NB. I'm on GMT here!
[ 0.05466857925057411, 0.25883153080940247, 0.41280096769332886, -0.2135266363620758, 0.017556479200720787, 0.28724029660224915, 0.538471519947052, 0.19977037608623505, -0.13672791421413422, -0.6131465435028076, -0.06278511136770248, 0.6167613863945007, -0.1396661102771759, 0.500187516212463...
I have two tables. Club and Coach. Between them is 0,1 - 0,1 relationship (coach can have zero or one club. club can have zero or one coach). When I want to change the coach of the given club, i have to update the club table. So i have to change idCoach of that club. Lets consider a new coach (the newly assigned coach ...
[ 0.028354939073324203, 0.0398826003074646, 0.11446819454431534, -0.03650001809000969, -0.29162588715553284, -0.022559508681297302, -0.042563505470752716, 0.1247466579079628, -0.36799317598342896, -0.8722408413887024, 0.2567954957485199, 0.19309085607528687, -0.1912051886320114, 0.2076709419...
want to change the coach, already has a coach, then I have to set idClub of that coach (in Coach table) to Null. All the given above, also applies to when I want to change the club of the certain coach. (have to set to Null idCoach field of the previous club of a given coach and have to set to null idCoach of the new ...
[ -0.13427641987800598, -0.08284702152013779, 0.036938950419425964, -0.011741232126951218, 0.23224109411239624, -0.12869201600551605, 0.24690936505794525, -0.08853549510240555, -0.44672122597694397, -0.9107725024223328, 0.13050611317157745, 0.19017155468463898, -0.3489682674407959, 0.2889677...
references and unlink them). I want to solve this with triggers. I guess I would have to have 3 triggers in Club table (for insert, update and delete) and 3 more in Coach table. In update trigger (for example in Club) I have to update Coach table which will again trigger update in Club (cause in it's body it has to u...
[ 0.25239667296409607, 0.050412725657224655, 0.6208328604698181, 0.11522927135229111, -0.1908128410577774, -0.17967644333839417, 0.09811408072710037, -0.42918118834495544, -0.4670203626155853, -0.7356003522872925, 0.5349729061126709, 0.36792421340942383, -0.22138336300849915, 0.0492977574467...
a simple thing. Cheers! I suggest this might not be an appropriate use for triggers, which are very difficult to debug, and often surprise people by the way they don't support single-record operations as you would expect. Break it down into simple SQL statements and wrap a transaction around it instead.
[ 0.35477593541145325, 0.14310990273952484, -0.0985184907913208, 0.1874733716249466, -0.0005693587008863688, -0.431867390871048, 0.2343204915523529, -0.1183881014585495, -0.0927041620016098, 0.027126295492053032, 0.04337453842163086, 0.5438103675842285, -0.22358274459838867, -0.2140031158924...
I'm writing a basic sprite engine for my own amusement and to get better aquainted with Java's 2d API. Currently I am making use of large numbers of separate .png files with transparent backgrounds to represent the various sprites and different frames of animation that I need. Most 'real world' game development project...
[ 0.4043142795562744, 0.04608616605401039, 0.36269739270210266, 0.2426035851240158, -0.2645307183265686, 0.10028012841939926, -0.0013069086708128452, 0.05749598145484924, -0.23367202281951904, -0.5969265103340149, 0.12922535836696625, 0.49384167790412903, -0.18468022346496582, 0.111322306096...
colour. How does one manage a file like this programatically? * how do you know where one sprite starts and the next begins * how do you deal with transparency There may be other factors that I've not thought of here, so I may add to the list above as I think of things or as people make suggestions (please do so in t...
[ 0.5339073538780212, -0.3052220344543457, 0.3406779170036316, 0.1684117168188095, -0.4346480667591095, 0.1282247006893158, -0.0036033738870173693, -0.23529185354709625, -0.4087696671485901, -0.5006673336029053, 0.07224159687757492, 0.16546723246574402, -0.20909425616264343, -0.0381014309823...
y offset of the frame in sheet, cell width and height, and any transformation (resize/rotation/hue/etc.). Poses store individual frames and animation information (speed, for example), and a pose name to easily identify them in the program (hero.pose = sprite.pose["standing\_right"]). Sprites serve as a document root to...
[ 0.5165259838104248, -0.3202407658100128, 0.5840983986854553, 0.31904336810112, -0.3660317361354828, 0.36501145362854004, -0.12789076566696167, -0.4652745723724365, -0.056767139583826065, -0.4732673764228821, 0.10779759287834167, 0.17248542606830597, -0.12274351716041565, -0.185558557510375...
these dimensions in the file name (e.g. sprite\_name\_32x64.png) for sprites that don't fit the fixed cell dimensions. I like the new approach more, especially with a simplistic editor that fills most values for me and allows me to use sprites as templates for other sprites. I use the alpha and transparency informati...
[ 0.2810320556163788, 0.006065733265131712, 0.5201985836029053, -0.010804018937051296, -0.38406091928482056, 0.24983620643615723, -0.032093897461891174, -0.39194920659065247, -0.10501402616500854, -0.6822225451469421, 0.18448394536972046, 0.365543395280838, -0.22912660241127014, 0.0611430890...
if you're using those, sprite masks, or what have you.
[ 0.552791178226471, 0.10792398452758789, -0.27787238359451294, 0.15331308543682098, -0.3330768346786499, -0.11843926459550858, 0.7361038327217102, 0.03444787114858627, -0.2965143024921417, -0.32386988401412964, 0.014720682054758072, 0.3564358651638031, -0.2031039297580719, 0.372978717088699...
When I create a new instance of a ChannelFactory: ``` var factory = new ChannelFactory<IMyService>(); ``` and that I create a new channel, I have an exception saying that the address of the Endpoint is null. My configuration inside my web.config is as mentioned and everything is as it is supposed to be (especially...
[ 0.06295738369226456, 0.24025513231754303, 0.8590744733810425, -0.3925832509994507, 0.0828825905919075, 0.2612151503562927, 0.786762535572052, -0.34172168374061584, -0.1671217530965805, -0.9489697217941284, -0.2981202304363251, 0.4817744195461273, -0.5864076018333435, 0.37885820865631104, ...
work with a ChannelFactory) does. All this costed me a few hours of work but I finally found a valid reason. :)
[ 0.390926331281662, 0.07353077083826065, 0.8535181879997253, 0.21703623235225677, -0.027024684473872185, 0.04513675346970558, 0.5652612447738647, -0.12892670929431915, 0.1226508617401123, -0.5961418747901917, 0.16465641558170319, 0.6337598562240601, -0.18798072636127472, 0.05491472780704498...
If I have... ``` class Bunny < ActiveRecord::Base has_many :carrots end ``` ...how can I check in the View if `@bunny` has any carrots? I want to do something like this: ``` <% if @bunny.carrots? %> <strong>Yay! Carrots!</strong> <% for carrot in @bunny.carrots %> You got a <%=h carrot.color %> carrot!<br...
[ 0.06424617767333984, -0.060634855180978775, 0.11079864203929901, -0.06811130046844482, -0.16451621055603027, 0.12320493906736374, 0.10606894642114639, -0.21422797441482544, -0.2575570344924927, -0.31466802954673767, 0.0499296672642231, 0.3390355408191681, -0.028257234022021294, 0.013128619...
I have a web application that needs to fire off a long-running SQL Server procedure (to rebuild a table) when certain criteria are met. What is the recommended procedure to do this? I was thinking, when the criteria are met a record would be inserted into the database and a scheduled SQL server job would check that ta...
[ 0.3760242462158203, 0.2079494595527649, 0.22498364746570587, 0.043181486427783966, 0.20839016139507294, -0.3287935256958008, 0.2584415674209595, -0.08878959715366364, -0.42503032088279724, -0.4241226315498352, 0.314961701631546, 0.28735026717185974, -0.03559974208474159, 0.1422400772571563...
a user signs up?) Is this type of scenario what messaging is all about? Your approach is definetly viable and is one way I've seen it done. For example in a complex web which had gigabytes of inventory data, the company implemented basically what you described to allow partial updating of the inventory data throughout...
[ 0.46840691566467285, -0.0626080185174942, 0.12100521475076675, 0.039343059062957764, -0.10901419073343277, -0.015366588719189167, 0.22585730254650116, -0.20884159207344055, -0.4094785749912262, -0.4947042763233185, 0.34914886951446533, 0.37146061658859253, -0.25148651003837585, -0.33376488...
processing of the events, and you can use the DB as a backing store to ensure you don't loose any events. Does your user need to see the results of the action? You could also kick off an asynchronous call to process the results, and then hang on to the user and provide status information. If you don't want to hang on ...
[ 0.2364511489868164, -0.34439873695373535, 0.2632293105125427, 0.46197083592414856, -0.18773676455020905, -0.06670679897069931, 0.2536879777908325, -0.1901099979877472, -0.34284085035324097, -0.3298376202583313, -0.008697029203176498, 0.3810478746891022, -0.26991674304008484, 0.158819556236...
would look into it as an option. We had started looking into it as a way to kick off long running disconnected workflows, but I left the company before we got anywhere.
[ 0.5332323908805847, -0.09122751653194427, 0.0814938172698021, 0.16935507953166962, 0.2402895987033844, -0.23304004967212677, -0.23203186690807343, 0.28805965185165405, 0.14055536687374115, -0.20325469970703125, 0.1481296271085739, 0.21131254732608795, 0.033932749181985855, 0.19480477273464...
I would like to be able to manipulate the DOM just before my page is sent to be printed. Internet Explorer has an event on the window object called "onbeforeprint" but this is proprietary and isn't supported by other browsers. Is it possible to do this via javascript (jQuery in particular, if possible)? Before you ask...
[ 0.41665783524513245, -0.2578584551811218, 0.818139374256134, 0.07907062768936157, -0.16230271756649017, -0.16415010392665863, 0.11054189503192902, 0.01670631766319275, -0.20923154056072235, -0.7486028671264648, 0.11365440487861633, 0.8124441504478455, -0.06632261723279953, 0.33605924248695...
modify the existing jQuery if needs be, however that would be a more time-consuming and risky change. Cheers, Zac Adding `!important` after a property in your CSS will allow it to override the inline styles. For example: ``` <div class="test" style="color: blue;">Some Text</div> ``` css: ``` .test { color: ...
[ 0.4399159550666809, 0.20124246180057526, 0.15716494619846344, 0.007561244536191225, -0.17431533336639404, -0.1597256064414978, 0.35388991236686707, -0.005885436665266752, 0.025004617869853973, -0.6405891180038452, -0.36097803711891174, 0.5302883386611938, -0.28867220878601074, 0.0126459551...
I am wondering if it is possible to use Code Access Security, and a custom permission class (and attribute), without having to register the assembly that the attribute is in, in the GAC. At the moment, I get a TypeLoadException when the method with my attribute is called, and I can't seem to get around it. Everything ...
[ 0.3499818444252014, 0.14755940437316895, 0.04294098541140556, 0.020031340420246124, -0.03649412468075752, -0.11435568332672119, 0.22347508370876312, -0.06062198802828789, -0.26032623648643494, -0.5868754386901855, 0.11265620589256287, 0.5721691846847534, -0.09024649113416672, 0.13548116385...
which is not ideal. Adding `!important` after a property in your CSS will allow it to override the inline styles. For example: ``` <div class="test" style="color: blue;">Some Text</div> ``` css: ``` .test { color: red !important; } ``` will be displayed red.
[ 0.22507087886333466, 0.20180007815361023, -0.00450332323089242, -0.12053099274635315, -0.07410259544849396, -0.1353331357240677, 0.28206881880760193, -0.10303114354610443, -0.022181449458003044, -0.5609106421470642, -0.32145604491233826, 0.31488776206970215, -0.3404802978038788, 0.21538352...
For those of you who aren't familiar with the concept, abstraction inversion is the implementation of low-level constructs on top of high-level constructs, and is generally considered a bad thing because it adds both needless complexity and needless overhead. Of course, this is a somewhat imprecise, subjective definiti...
[ 0.29173901677131653, 0.03235074505209923, -0.43830472230911255, 0.295869916677475, -0.03772970288991928, -0.12720903754234314, 0.3160693645477295, 0.2408600002527237, -0.27463385462760925, -0.26194196939468384, -0.31913283467292786, 0.45528867840766907, -0.2531296908855438, 0.0460501909255...
and even less care about. **Thou shalt not make unto thee any abstraction that cannot be overridden if necessary, that thy code be free of ugly abstraction inversions.** No matter what your paradigm, once you start writing non-trivial code to solve real-world problems, you are going to end up with some things that ju...
[ 0.26408153772354126, 0.3886180520057678, -0.23271514475345612, 0.2892198860645294, -0.29843413829803467, 0.32677093148231506, 0.5738020539283752, 0.02293304353952408, -0.3283758759498596, -0.8002925515174866, -0.006116766482591629, 0.5219618678092957, -0.15002083778381348, 0.07987170666456...
and you suddenly end up with some square pegs and you don't have any saws, (just mallets,) you've got yourself a problem. There's no free lunch. Everything is a trade-off. The easier code becomes to write, the harder it becomes for someone else to read and maintain, or for you or anyone else to debug when problems occ...
[ 0.5445715188980103, -0.1584627330303192, 0.07898323237895966, 0.5189741253852844, -0.07008916884660721, -0.23201853036880493, 0.3144211769104004, 0.27293869853019714, -0.16697293519973755, -0.4191496968269348, -0.08340458571910858, 0.5901677012443542, -0.18562406301498413, 0.39883705973625...
impose a baseline level of abstraction that you are not allowed to reach beneath, and when something goes wrong below that level, there's nothing you can do about it. You're stuck working around a bad abstraction because you can't fix it.
[ 0.7313212752342224, 0.04589134082198143, -0.2050495594739914, 0.5307987332344055, -0.11526311188936234, -0.27013343572616577, 0.14834439754486084, 0.3199959993362427, -0.025891950353980064, -0.3130590319633484, 0.16610799729824066, 0.42140164971351624, -0.3672093152999878, 0.28456410765647...
I have a multipart form that takes basic user information at the beginning with some jquery.validate error checking to see if the fields have been filled in and the email address is valid. Below that there is a series of check boxes (type\_of\_request) for new accounts, delete accounts, new software etc which show/hid...
[ 0.33430150151252747, 0.17446647584438324, 0.32035723328590393, 0.14067961275577545, 0.06335923075675964, -0.053875792771577835, 0.22734104096889496, -0.27102211117744446, 0.007886129431426525, -0.671611487865448, -0.12329250574111938, 0.46941179037094116, 0.056027207523584366, -0.141725406...
the email and other checkbox in the type\_request has been selected: ``` <div id="email" style="display: block;"> // shown because other has been selected in the type request <input id="email_new_account" class="sq-form-field" type="checkbox" value="0" name="q4836:q1"/> // not required <input id="email_ne...
[ -0.10691375285387039, 0.08639486134052277, 0.5611342191696167, -0.1105724349617958, 0.06744665652513504, 0.11215096712112427, -0.17441128194332123, -0.6598179936408997, 0.002691688248887658, -0.586784303188324, -0.3847050070762634, 0.2675783336162567, -0.25402161478996277, -0.1895555853843...
not required <input id="email_add_remove_account_name" class="sq-form-field" type="text" name="q4837:q2"/> // if email_add_remove_access checked then make required <input id="email_add_access" class="sq-form-field" type="text" name="q4836:q2"/> // if email_add_remove_access checked then make required <in...
[ 0.03754830360412598, -0.26595211029052734, 0.3592914044857025, -0.04096093401312828, 0.06358935683965683, -0.11398117989301682, 0.11415546387434006, -0.8014057874679565, 0.17350226640701294, -0.2976703941822052, -0.455654114484787, 0.3787042498588562, -0.30930083990097046, -0.2074163556098...
#other was checked in type request </div> ``` --- Further Reading --- I have reviewed this even further and found that the following can be added to the class of the input items ``` class="{required:true, messages:{required:'Please enter your email address'}}" ``` or ``` class="{required:true, email:true, ...
[ -0.10538282990455627, -0.2255830019712448, 0.37705880403518677, -0.02410886250436306, 0.0764969140291214, -0.21927540004253387, 0.06895037740468979, -0.6625765562057495, -0.21693696081638336, -0.23635822534561157, 0.20217137038707733, 0.4586220979690552, -0.4163834750652313, -0.19414032995...
form which show/hide the id element when you checked the item (show/hide function not shown). ``` <fieldset id="request-type"> <legend>Type of Request</legend> <ul> <li><input type="checkbox" name="q4838:q1[]" id="q4838_q1_0" value="0" class="sq-form-field" /><label for="q4838_q1_0">New account</label></li> <li><inpu...
[ -0.0007154369377531111, -0.08883626759052277, 0.5534385442733765, -0.2164277583360672, -0.14573772251605988, -0.05252380669116974, 0.19872814416885376, -1.0663565397262573, 0.09603659063577652, -0.6010915040969849, -0.30113086104393005, 0.4202841818332672, -0.5189965963363647, 0.1172751858...
the fieldset are required when the delete account option is checked I've added the following to the class attribute of the required input. ``` class="{required:'#checkboxid:checked', messages:{required:'required error message'}}" ``` The "delete-account" fieldset then looks like this..... ``` <fieldset id="delete-a...
[ 0.16731059551239014, 0.0531945563852787, 0.5499594211578369, -0.03627545014023781, 0.32869845628738403, -0.06607887148857117, 0.1299920231103897, -0.2670970559120178, -0.12913356721401215, -0.3126634955406189, -0.06733204424381256, 0.8215599656105042, -0.26836565136909485, 0.06997261196374...
checked it returns as `'true'` and the field becomes required, and if it comes back `'false'` the field is not required. Another thing I found useful was to ensure that someone selected a request type at the beginning of the form by adding the following to the class attribute on each of the checkboxes ``` class="{req...
[ 0.14348621666431427, -0.24108800292015076, 0.3401630222797394, 0.18532617390155792, -0.023942487314343452, -0.1984083354473114, 0.3506861627101898, -0.24095723032951355, 0.2566734552383423, -0.47075071930885315, -0.09628240764141083, 0.7017887234687805, -0.10910800099372864, -0.22555899620...
I have a property defined in my HBM file like this: ``` <property name="OwnerId" column="OwnerID" type="System.Int32" not-null="false" /> ``` It is defined as a nullable field in the database also. If a record in the DB has the OwnerID column set to an integer, this object is correctly loaded by NHibernate. But if t...
[ -0.02122744545340538, 0.22382701933383942, 0.20301048457622528, -0.19300633668899536, -0.18642842769622803, -0.07198071479797363, 0.497146874666214, -0.5484095215797424, -0.10659512877464294, -0.368272066116333, -0.08267083764076233, 0.612385094165802, -0.6158766746520996, 0.42831173539161...
breakConnection) +800118 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +186 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1932 Syste...
[ -0.27655211091041565, 0.05018290877342224, 0.46668773889541626, 0.0005185957998037338, 0.025756478309631348, 0.13964295387268066, 0.6317656636238098, -0.6565699577331543, -0.43125373125076294, -0.19330427050590515, -0.3712460696697235, 0.40915918350219727, -0.47915446758270264, 0.139773055...
not-null property references a null or transient value:] NHibernate.Impl.SessionImpl.CheckNullability(Object[] values, IEntityPersister persister, Boolean isUpdate) +224 NHibernate.Impl.SessionImpl.FlushEntity(Object obj, EntityEntry entry) +1019 NHibernate.Impl.SessionImpl.FlushEntities() +182 NHibernate.I...
[ -0.10113219171762466, 0.0036642486229538918, 0.40892449021339417, 0.12980319559574127, -0.012948268093168736, 0.11305943131446838, 0.3350546956062317, -0.634730339050293, -0.21872590482234955, -0.4039638936519623, -0.15108942985534668, 0.42045047879219055, -0.5966458916664124, 0.1632848531...