text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
is less fun though.
[ 0.4737691283226013, -0.012021596543490887, 0.2622620761394501, 0.2463385909795761, 0.013942839577794075, -0.3843212425708771, 0.42007124423980713, 0.3020327687263489, -0.1656436324119568, -0.24823729693889618, 0.14447791874408722, 0.27354708313941956, 0.29642343521118164, -0.25178754329681...
i have two applications - one is an asp.net website and the other is a windows service. both applications are referencing my business layer (library project), which itself is referencing my data access layer (library project) that itself uses the enterprise library data application block to receive the data form a sql...
[ 0.3196488320827484, 0.24270029366016388, 0.3993758261203766, -0.1197582483291626, -0.04761732742190361, -0.11115052551031113, 0.05135564133524895, 0.11419159173965454, -0.044491417706012726, -0.6841309666633606, 0.059530261904001236, 0.09635329991579056, 0.04572384059429169, 0.607554137706...
if(cache == null) { if (System.Web.HttpContext.Current != null) { //asp.net cache = System.Web.HttpContext.Current.Cache;
[ -0.5516865849494934, -0.2130679488182068, 0.2503473460674286, -0.04489509388804436, 0.24242541193962097, 0.19888372719287872, 0.27070045471191406, -0.09629999846220016, -0.06523945927619934, -0.5534886717796326, -0.34339797496795654, 0.09686370939016342, -0.2744048535823822, 0.213571950793...
} else { //windows service cache = System.Web.HttpRuntime.Cache;
[ -0.04619807377457619, -0.17303010821342468, 0.05349605903029442, -0.26117411255836487, 0.3656482696533203, 0.28095173835754395, 0.5324543118476868, 0.09541432559490204, 0.047134459018707275, -0.7414495944976807, -0.16703926026821136, 0.5996740460395813, -0.2939273715019226, 0.2637530863285...
} } return cache; } } ``` as both applications are running on their own - they both are using a separate Cache object on their own - and this is the problem actually: if i change a object in the asp.net website and save it to the DB. the object to this cache key is removed from th...
[ 0.22185900807380676, 0.18903441727161407, 0.2983597218990326, -0.09694994986057281, 0.08146663010120392, -0.1734602302312851, 0.4859214425086975, -0.004180585965514183, -0.16671523451805115, -0.6767714619636536, -0.17189475893974304, 0.5502939820289612, -0.25062867999076843, 0.432353734970...
becomes stale! vice-versa is it possible that both applications are using the same Cache? One Cache for both applications? the only option i have i think about is that i will have to use SqlDependency with > [Sql Server 2005 Notification-based Cache Invalidation](http://quickstarts.asp.net/QuickStartv20/aspnet/doc...
[ 0.2635148763656616, -0.08867069333791733, 0.5977984070777893, 0.3329932987689972, 0.042390964925289154, -0.4139092266559601, 0.12990602850914001, 0.0107191801071167, -0.22638189792633057, -0.675889790058136, 0.08990850299596786, 0.3983395993709564, -0.08849305659532547, 0.39791005849838257...
I have a vb project which calls functions in a dll. The dll is created in a separate vs project (portaudio), which is written in c. The dll c project compiles clean and builds the required dll, which I am currently dropping in c:\windows\system to vb runtime can see it. VB Project lives in c:\devprojects\vbtest C P...
[ 0.35897108912467957, -0.009266204200685024, 0.4849843680858612, -0.2640632390975952, -0.2272680252790451, -0.0936775729060173, 0.25357452034950256, -0.3265770673751831, -0.11266579478979111, -0.6947871446609497, -0.12452908605337143, 0.4346586763858795, -0.45159876346588135, 0.367819726467...
I don't know if VS2005 supports this kind of mixed language debugging. If this is possible, could you advise how I should set up my Visual Studio to achieve this. Many thanks David It is not necessary to have both projects in the same solution, but you should compile both projects with debug symbols enabled. Now in ...
[ 0.49997082352638245, 0.0830707773566246, -0.10499109327793121, 0.2195751965045929, -0.2965530753135681, -0.2520778179168701, 0.5681878924369812, -0.04318501427769661, -0.14546968042850494, -0.7426585555076599, -0.02176225185394287, 0.699637234210968, -0.17823845148086548, -0.02689423784613...
I'd like to learn CSLA.NET quickly. What advice do you have? The answer to this question all depends on your definition of the words "learn" and "fast". In my experience, no one ever learns *anything* fast. That being said I would suggest you visit Rockford Lhotka's site and check out the forums and books that are th...
[ 0.5123111605644226, 0.13145360350608826, 0.019660502672195435, 0.35757824778556824, 0.34735068678855896, -0.2724759876728058, 0.1585143357515335, 0.5593599677085876, -0.13019263744354248, -0.8886682391166687, 0.14729608595371246, 0.1583147644996643, 0.22301550209522247, -0.0739803686738014...
I'm putting together a quick and dirty animation using swing. I would like the window to be maximized. How can I do that? Provided that you are extending JFrame: ``` public void run() { MyFrame myFrame = new MyFrame(); myFrame.setVisible(true); myFrame.setExtendedState(myFrame.getExtendedState() | JFrame.M...
[ 0.7056511044502258, 0.06453219056129456, 0.585351824760437, -0.03503130376338959, 0.18737782537937164, 0.018209688365459442, 0.274241179227829, -0.21860845386981964, -0.038087669759988785, -0.9213364124298096, -0.13261821866035461, 0.46906253695487976, -0.2918526828289032, 0.12223777174949...
In C# I can use the following code to have code which only executes during debug build, how can I do the same in Xcode? ``` #if DEBUG { // etc etc } #endif ``` The NDEBUG symbol should be defined for you already in release mode builds ``` #ifndef NDEBUG /* Debug only code */ #endif ``` By using NDEBUG you...
[ 0.36856257915496826, 0.20258194208145142, 0.2714623510837555, -0.2648381292819977, 0.016206232830882072, -0.2739977538585663, 0.15724064409732819, -0.23293404281139374, -0.0892002061009407, -0.5382580161094666, -0.07199260592460632, 0.7295397520065308, -0.4514814615249634, -0.1316678822040...
I want to have four colored areas which are clickable. I can user TextBlock in a Border to get the color areas, but then neither of them have a Click event. So I can make the whole thing a button, but then it doesn't have rounded corners and I can't seem to change the background. What is the recommended way to go abou...
[ 0.03018820658326149, -0.04825320467352867, 0.58732670545578, -0.21658183634281158, -0.2147025614976883, 0.1954711526632309, -0.039853598922491074, -0.23897382616996765, -0.42240744829177856, -0.503062903881073, 0.06797745823860168, 0.48434269428253174, -0.1061580553650856, -0.0658879429101...
<Style TargetType="{x:Type TextBlock}"> <Setter Property="FontSize" Value="20"/> <Setter Property="HorizontalAlignment" Value="Center"/> <Setter Property="VerticalAlignment" Value="Center"/> </Style> </UniformGrid.Resources> <Button BorderThick...
[ -0.2709619104862213, -0.5036466717720032, 0.7337296009063721, 0.13967987895011902, 0.1330442577600479, 0.14353907108306885, 0.10266568511724472, -0.42159584164619446, -0.3195604085922241, -0.8161870241165161, 0.014817602932453156, 0.21533341705799103, -0.05745774134993553, -0.2995351254940...
<Border BorderThickness="1px" Margin="10" BorderBrush="Blue" CornerRadius="10" Background="Yellow"> <TextBlock>testing2</TextBlock> </Border> <Border BorderThickness="1px" Margin="10" BorderBrush="Blue" CornerRadius="10" Background="LightBlue"> <TextBlock>testing3</TextBlock> ...
[ -0.30969005823135376, -0.02317642979323864, 0.7299192547798157, 0.19167309999465942, -0.03984662890434265, 0.1296028047800064, 0.23572485148906708, -0.5706261992454529, -0.4090484380722046, -0.7824387550354004, 0.09200292825698853, 0.2531220018863678, 0.024891044944524765, -0.1372608095407...
to define a custom template for your button For example: ``` <UniformGrid> <UniformGrid.Resources> <ControlTemplate x:Key="buttonTemp"> <Border Margin="10" CornerRadius="10" Background="Yellow"> <TextBlock Text="{TemplateBinding Button.Content}"/> </Border> </ControlTemplate> </Uniform...
[ 0.22920751571655273, -0.503745973110199, 0.4804755449295044, -0.03138996660709381, -0.12809836864471436, 0.2048828899860382, -0.2030666470527649, -0.5455682873725891, -0.5932806730270386, -0.7983896732330322, 0.3260117769241333, 0.12771373987197876, -0.31532400846481323, -0.064609527587890...
I am creating a C++ SDL game engine, and it is relevant to know the executable path since images and other resources are not stored within the executable - they are in a separated folder("res/"). Under Linux, I am using a shell script "rungame.sh" that cd's to the executable path and then runs the executable(using the...
[ 0.5658192038536072, 0.05062820389866829, 0.3194897770881653, -0.05890929698944092, -0.04575676843523979, -0.4273083209991455, 0.13410122692584991, 0.17683660984039307, 0.17106245458126068, -0.8546075224876404, -0.07168180495500565, 0.8622757196426392, -0.20481394231319427, 0.11270996183156...
X, if possible) solution to get the current path of the executable. The game path/executable name may change. What is the cleanest way to solve my problem (preferrably using std::string and as few platform-dependent APIs as possible)? I strongly suggest searching before posting: [How do I get the directory that a prog...
[ 0.2538962960243225, 0.09993985295295715, 0.42414578795433044, 0.19148659706115723, 0.33969080448150635, -0.09085943549871445, 0.2982679307460785, 0.13635945320129395, -0.10534962266683578, -0.5105512142181396, -0.32983627915382385, 0.4497244358062744, -0.2873367369174957, 0.211177304387092...
What pointers do you use to compare between compilers? I'm told gcc is the best C compiler, is this true? If so, why? I mean this generally, so you can state which compiler is more appropriate for which architecture. (I hear igc would be more appropriate for Intel for instance, but I don't know why) Personally I in...
[ 0.368550181388855, 0.3275722861289978, 0.07302046567201614, 0.29077059030532837, -0.5047174096107483, -0.13467785716056824, -0.4337261915206909, 0.24619968235492706, -0.2354317158460617, -0.3273228108882904, 0.08667325228452682, 0.761479377746582, -0.2008180022239685, 0.05977364256978035, ...
UNIX vendors when gcc came about in the 1990s. But what defines the "best"? * Time to compile code; * Size of compiled code; * Speed of compiled code; * Memory usage of compiled code; * Bugs and probability of seg faulting; * Support; * Community; * etc. Different things matter to different people. Here's one [set ...
[ 0.23684825003147125, 0.08629479259252548, 0.2067667841911316, 0.24215534329414368, -0.35616958141326904, -0.5208340883255005, -0.3579457700252533, 0.2544128894805908, -0.15472076833248138, -0.43663790822029114, 0.15824511647224426, 0.6884194612503052, -0.033250607550144196, 0.0616401657462...
two) but whether it works or not (this was a real issue a decade or two ago), whether it supports the relevant standards and whether it has any oddities/bugs/features you have to workaround.
[ 0.47736218571662903, 0.11077770590782166, 0.13730211555957794, 0.3154168426990509, 0.15270525217056274, -0.44608527421951294, 0.051230572164058685, -0.20697744190692902, -0.016585009172558784, -0.34216731786727905, -0.04068861901760101, 0.7285856008529663, -0.10774902254343033, -0.19803008...
I need to match up two almost-the-same long freetext strings; i.e., to find index-to-index correspondences wherever possible. Because this is freetext, the comparison should not be line-based as in code diffing. Any suggestions for Java libraries? A simple example (In real life , of course, there would not be extra ...
[ -0.03420859947800636, -0.045310311019420624, -0.20329667627811432, 0.0138345742598176, -0.2733786106109619, -0.06857335567474365, 0.420086145401001, -0.03552113100886345, -0.2249782681465149, -0.6819299459457397, -0.22930121421813965, 0.21619701385498047, -0.6407034397125244, -0.3334370851...
dog. ``` This one might be good [Diff Match Patch](https://github.com/google/diff-match-patch).
[ 0.391305536031723, 0.2482842355966568, 0.30530983209609985, -0.04370388388633728, 0.21725519001483917, -0.044921256601810455, 0.32822832465171814, -0.16255131363868713, -0.17641548812389374, -0.5830836892127991, -0.08325034379959106, 0.4498472213745117, -0.5380162596702576, -0.249351412057...
I figured the easiest thing to do was to just change the port number that Apache listens to, but I still can't get it to start back up after installing IIS. My IIS currently serves up pages correctly at <http://localhost:80>. I have several PHP projects, and here are the basics of how ports are configured in my httpd.c...
[ 0.15886768698692322, 0.31128397583961487, 0.7771201133728027, -0.20027874410152435, -0.06880898028612137, -0.31913986802101135, 0.7285755276679993, -0.39583325386047363, -0.10104721039533615, -1.0200823545455933, 0.1728442907333374, 0.843737781047821, -0.22684957087039948, 0.42199572920799...
file I have an entry like this: 127.0.0.1 virtual.myvirtualdomain.com I have several of these virtual domains setup, all running locally for numerous PHP projects I'm working on currently. This was all working correctly on port 80, but then I installed IIS 5.1, and the service no longer starts up. I did some research...
[ 0.3794746398925781, 0.010373669676482677, 0.510563313961029, 0.03186558932065964, -0.1257711946964264, -0.33003145456314087, 0.5266220569610596, 0.37688642740249634, -0.42270782589912415, -0.9128154516220093, 0.27746865153312683, 0.41279998421669006, -0.1144060343503952, 0.4308957159519195...
to port 80, and it is still failing. I did what Haarsma suggested, and it turns out that I had removed a virtual directory, and so Apache couldn't find it (thus not starting). Apparently it had nothing to do with the ports at all, and was my dumb mistake. I reinstalled IIS, changed my config for Apache to listen on por...
[ 0.009437172673642635, 0.03470510616898537, 0.24738074839115143, -0.04104214161634445, 0.24361923336982727, -0.20647071301937103, 0.9903457164764404, -0.02466392144560814, -0.010404396802186966, -0.5204477906227112, -0.04380958899855614, 1.0507375001907349, -0.15814082324504852, 0.102607086...
I'm working on a SQL Reporting Services report (in VS.Net 2005) which displays a count of different data in a matrix. The columns have a count on the amount of customers in a certain set. So I have several columns like these: "1 employer", "2-9 employers", "10-19 employers" and so on. The problem I have is that SQL Re...
[ 0.6029285192489624, 0.24962599575519562, 0.23949214816093445, -0.036977797746658325, -0.2479073405265808, 0.25351008772850037, -0.10779785364866257, -0.117320217192173, -0.4499196410179138, -0.48153993487358093, 0.5540882349014282, 0.3443331718444824, -0.24834036827087402, 0.27841365337371...
that they sort right? Thanks. We do a lot of SSRS Reports and this was always an issue with mdx. Here is one way we do it: Set *Sorting* in the *Grouping and Sorting Properties* to sort by this expression: ``` =iif(Fields!DataSetField.Value = "ColumnName", "zzz", Fields!DataSetField.Value) ``` Where "zzz" could be...
[ 0.10957401245832443, 0.010857474990189075, 0.07870254665613174, 0.042228326201438904, 0.07373298704624176, 0.00449972040951252, -0.1948706954717636, 0.06995533406734467, -0.38548794388771057, -0.5646005272865295, 0.04540586099028587, 0.28175419569015503, -0.1417669802904129, 0.222168788313...
I'm looking for a way to reinterpret an array of type byte[] as a different type, say short[]. In C++ this would be achieved by a simple cast but in C# I haven't found a way to achieve this without resorting to duplicating the entire buffer. Any ideas? You can achieve this but this is a relatively bad idea. Raw memory...
[ 0.41270288825035095, 0.18238773941993713, -0.037484895437955856, 0.09056344628334045, -0.026692675426602364, -0.14865580201148987, 0.3992428779602051, 0.12109218537807465, -0.3353118896484375, -0.5689054727554321, 0.10669674724340439, 0.5077688097953796, -0.34686318039894104, 0.18362580239...
two separate data sets? In any case, here is a quick and simple code snippet to accomplish what you asked: ``` byte[] bytes = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; int byteCount = bytes.Length; unsafe { // By using the fixed keyword, we fix the array in a static memory location. // Otherwise, the gar...
[ 0.1586698442697525, -0.24682475626468658, 0.17779777944087982, -0.07705413550138474, 0.06951627135276794, 0.11236072331666946, -0.1421484351158142, -0.1666468232870102, -0.2958560883998871, -0.1749349683523178, -0.09350722283124924, 0.4596213102340698, -0.5117649435997009, 0.13012596964836...
for (int index = 0; index < byteCount / 2; index++) { Console.WriteLine("Short {0}: {1}", index, shortPointer[index]); } } } ```
[ -0.0582968108355999, 0.0393502376973629, 0.5714375972747803, -0.3505532145500183, 0.4998089075088501, 0.025761500000953674, 0.1665358990430832, -0.1933748871088028, 0.3137776255607605, -0.5472517013549805, -0.2049204409122467, 0.49064821004867554, -0.21391859650611877, 0.09923125058412552,...
I am using CodeIgniter to pass some parameters to my PHP page through `$_POST` request, and in the PHP page I am reading. ``` $foo = $this->input->post('myParam'); ``` If the `myParam` parameter is present in the `$_POST` request, then `$foo` will be assigned the `myParam` value. How do I check if `myParam` is **no...
[ -0.019198236986994743, 0.12762105464935303, 0.47349828481674194, -0.11373575776815414, -0.005564715713262558, 0.1010962724685669, 0.3940373361110687, -0.20251256227493286, 0.07219666987657547, -0.47595974802970886, -0.07528143376111984, 0.36286404728889465, -0.2723037302494049, 0.071508280...
not set } ```
[ 0.014157438650727272, 0.14089077711105347, -0.12130703032016754, 0.002259100554510951, 0.11914845556020737, -0.11921077221632004, 0.22299779951572418, 0.17499904334545135, -0.06619024276733398, -0.34340551495552063, -0.4583413302898407, 0.505103349685669, -0.5957857966423035, 0.19577689468...
is it possible, in C++, to get the current RAM and CPU usage? Is there a platform-indepentent function call? There is an open source library that gives these (and more system info stuff) across many platforms: [SIGAR API](https://github.com/hyperic/sigar) I've used it in fairly large projects and it works fine (except...
[ 0.19887886941432953, 0.04114372655749321, 0.21068397164344788, 0.20182259380817413, -0.14589981734752655, 0.10912042111158371, -0.25071796774864197, -0.14786411821842194, -0.39803576469421387, -0.3538954555988312, 0.2185722142457962, 0.6376227736473083, -0.20963667333126068, -0.04324715211...
Quick question (I hope), how do I include a window 6 class library dll in a standard net project? I seem to be able to just add a reference via VS in earlier editions of windows mobile projects, but not with version 6. From what I read it should be possible as long as not CE specific libraries have been used. Any hel...
[ 0.5636587142944336, 0.2020416557788849, 0.16192010045051575, 0.1599065065383911, -0.18703757226467133, -0.2667141556739807, 0.20534572005271912, 0.008899322710931301, -0.2118602693080902, -0.829056978225708, -0.18194453418254852, 0.6271116733551025, -0.058340199291706085, 0.027690183371305...
the standard one Here I get: "A reference to cannot be added". Ive found the answer to my own question here: <http://social.msdn.microsoft.com/Forums/en-US/vssmartdevicesvbcs/thread/c0cae024-a9a2-43bd-9d37-69bc9a9338c7/> Turns out that VB.NET projects have trouble referencing CF projects created in VB.NET. All good...
[ 0.4262443780899048, 0.124907948076725, 0.30441176891326904, 0.04444967582821846, -0.10461282730102539, -0.3544817566871643, 0.22196024656295776, 0.2621837556362152, -0.5274705290794373, -0.40971601009368896, 0.0941300094127655, 0.3292485177516937, -0.35853660106658936, 0.3525778353214264, ...
VB.NET automatically prefixes the root namespace set in the project properties to the namespace of each class. This is different from C#, where the full namespace must be declared each time. Is it possible to override this behaviour, creating a namespace outside of the root namespace? If I understand you correctly you...
[ 0.755628764629364, -0.15531323850154877, 0.3366538882255554, -0.3049268126487732, -0.2244839072227478, -0.24229465425014496, 0.38317039608955383, -0.16790954768657684, -0.5100138783454895, -0.4057159125804901, -0.09246595203876495, 0.42717644572257996, -0.24772284924983978, 0.2802531123161...
It's well known that you cannot set foreign key IDs directly in Linq to SQL if the entities have already been loaded. You can however look up the entity by it's foreign key and then set the entity as the foreign entity using the entity relationship. (I've taken out the enum here and used integer values for simplicity)....
[ 0.14410655200481415, 0.27692434191703796, 0.7646233439445496, -0.11153571307659149, 0.35883837938308716, 0.02553670108318329, -0.008257916197180748, -0.251179575920105, -0.000764168391469866, -0.44004541635513306, -0.09093089401721954, 0.7542241215705872, -0.5538405179977417, 0.27726271748...
Where appstat.StatusID = 7 _ Select appstat).Single ``` I have this kind of thing littering my code and I'd like to refactor. So... I could obviously use a helper method in a module like this:- ``` Module Helper
[ 0.15763379633426666, 0.11490478366613388, 0.5293526649475098, -0.06795679777860641, 0.3505420982837677, -0.21570736169815063, 0.2811354100704193, -0.08524581789970398, -0.47914665937423706, -0.6174001693725586, -0.37417054176330566, 0.6463539600372314, -0.6394171714782715, -0.1698553562164...
Public Shared Function GetAppointmentStatus(ByVal AppStatusID As Integer) As AppointmentStatus GetAppointmentStatus = (From appstat In db.AppointmentStatus _ Where appstat.AppointmentStatusID = AppStatus _
[ -0.03985491767525673, 0.0999503880739212, 0.5356624126434326, 0.11922861635684967, 0.035638902336359024, 0.00970149040222168, 0.3649745583534241, -0.0382777638733387, 0.02347700297832489, -0.7510237693786621, -0.24314723908901215, 0.5732842683792114, -0.5086842179298401, 0.1326885670423507...
Select appstat).Single End Function End Module ``` I could even make this into an extension method, like this. ``` Imports System.Runtime.CompilerServices Module Helper Extension()> _ Public Shared Function GetAppointmentStatus(ByVal db as DataClassesDataContext, ByVal AppStatusID As Integer) As Appointment...
[ -0.15500670671463013, -0.06904008239507675, 0.8572887182235718, -0.06618259847164154, 0.2574506402015686, 0.10549826920032501, 0.30114907026290894, -0.3748619556427002, -0.08546961098909378, -0.6235322952270508, -0.47402432560920715, 0.6658492088317871, -0.5587231516838074, 0.0200463533401...
Select appstat).Single End Function End Module ``` I could also put this in the Linq to SQL partial class, like this. ``` Partial Public Class DataClassesDataContext Public Function GetAppointmentStatus(ByVal AppStatusID As Integer) As AppointmentStatus GetAppointmentStatus = (From appstat In Me...
[ -0.15791055560112, -0.0227317214012146, 0.8325730562210083, -0.09539807587862015, 0.30789101123809814, 0.18601498007774353, 0.32077422738075256, -0.19669438898563385, -0.1310853809118271, -0.6291322708129883, -0.39166921377182007, 0.6129973530769348, -0.6332707405090332, -0.050200730562210...
Where appstat.AppointmentStatusID = AppStatusID _ Select appstat).Single End Function End Class ``` Further I could put the code in the Linq to SQL Appointment Entity partial class like this:- ``` Partial Public Class Appointment
[ -0.02463236264884472, -0.10716447979211807, 0.8540934920310974, -0.045250628143548965, 0.2774333655834198, 0.042687706649303436, -0.09531572461128235, -0.18242491781711578, -0.06737815588712692, -0.48922327160835266, 0.1426352560520172, 0.5965933799743652, -0.4490818679332733, 0.3410155177...
Public Function GetAppointmentStatus(ByVal db as DataClassesDataContext, ByVal AppStatusID As Integer) As AppointmentStatus GetAppointmentStatus = (From appstat In db.AppointmentStatus _ Where appstat.AppointmentStatusID = AppStatusID _
[ -0.314974308013916, 0.017509346827864647, 0.7110298275947571, -0.036557286977767944, 0.01227458193898201, 0.11544469743967056, 0.35419121384620667, -0.06926662474870682, -0.043097008019685745, -0.6251769065856934, -0.5998862981796265, 0.7484065890312195, -0.6222764849662781, -0.13790403306...
Select appstat).Single End Function End Class ``` Which should I do and why, or is there a better alternative? There are two main schools of thought on this: 1. Put the logic in the `DataContext` (partial class, or actual class if you code your `DataContext` by hand). The rationale behind this is that your `Data...
[ 0.03831768408417702, 0.07995080947875977, 0.328637957572937, 0.2504664957523346, 0.0750354453921318, -0.04767049103975296, 0.12206677347421646, -0.18233981728553772, 0.04285452142357826, -0.5899797081947327, -0.33938291668891907, 0.5262209177017212, -0.5055176615715027, -0.2102067619562149...
hundred of these API methods (and you probably will, eventually) then your `DataContext` will quickly start turning into a ball of mud, filled with every random query API any programmer decides to throw in. You can try to clean this up by separating related functions into different instances of the same partial `DataCo...
[ 0.10848047584295273, -0.142466738820076, -0.015678318217396736, 0.44422873854637146, -0.0321926511824131, -0.09933268278837204, 0.07894622534513474, -0.29747623205184937, -0.05649062991142273, -0.6541322469711304, 0.08497154712677002, 0.7416002750396729, -0.276792973279953, -0.051173459738...
and (b) the fact that you're sticking to the [Single Responsibility Principle](http://en.wikipedia.org/wiki/Single_responsibility_principle) - it actually makes *sense* for the method to be where it is. The main disadvantages to putting these in repositories are: (a) They may be duplicating very similar logic that's a...
[ 0.35780394077301025, 0.11028266698122025, -0.1965000480413437, 0.3540288507938385, -0.12121566385030746, -0.13118600845336914, 0.10349788516759872, -0.24731417000293732, -0.5270204544067383, -0.24738577008247375, -0.13264456391334534, 0.47699031233787537, -0.11542592197656631, 0.1078666895...
creating one repository for each and every DTO, or creating one master "utility" repository for all the DTOs or some loosely-related group of them. Both end up being a rather poor design. Those are the tradeoffs; only you can decide which is better for your own purposes. I *would* definitely advise *against* the exte...
[ 0.38557255268096924, -0.28983888030052185, -0.24630969762802124, 0.3038223087787628, -0.23724400997161865, -0.12499324232339859, 0.13206852972507477, -0.03378015756607056, 0.018533525988459587, -0.7375234365463257, -0.2524806261062622, 0.4443041980266571, -0.1782548427581787, -0.0755603164...
`Appointment` class; one of the reasons we use tools like Linq To SQL is so we can deal with POCO entities that *don't* need to know anything about where they came from. For this reason I personally am very much against the coupling of entity classes to their `DataContext` - the dependency should be only one-way.
[ 0.12017951160669327, -0.27133533358573914, 0.3655591905117035, 0.2370726615190506, 0.06079651415348053, -0.32548007369041443, -0.19520831108093262, 0.04566427320241928, 0.019822372123599052, -0.43445926904678345, -0.059107325971126556, 0.5678738355636597, -0.12458224594593048, 0.1510089635...
I have installed Visual C++ 2008 Express Edition on Vista Home Premium and whenever i try to create a new project, no mater which type(CLR, Console, Win32, Empty project) i get "Creating project 'project name' ... project creation failed." However i can open an existing solution. So basically my Visual C++ is useles...
[ 0.058964360505342484, 0.3088356554508209, 0.344617635011673, -0.33191245794296265, -0.2609982192516327, 0.12447535991668701, 0.6406791806221008, 0.06353246420621872, -0.08429338783025742, -0.5839322805404663, -0.013609448447823524, 0.8460817337036133, -0.3838770091533661, 0.138840034604072...
Googleing
[ 0.32461705803871155, 0.307127982378006, 0.15260690450668335, 0.4082290828227997, 0.20623575150966644, -0.1722462922334671, -0.0018666005926206708, 0.43832388520240784, -0.05333676189184189, -0.5544131398200989, 0.03270832449197769, 0.2974795997142792, -0.5440019965171814, -0.03802809119224...
I am trying to insert a .csv file into a database with unix linebreaks. The command I am running is: ``` BULK INSERT table_name FROM 'C:\file.csv' WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' ) ``` If I convert the file into Windows format the load works, but I don't want to do this extra step if...
[ 0.2897793650627136, 0.40231257677078247, 0.04982926324009895, -0.32682743668556213, 0.056061044335365295, -0.2768853008747101, 0.056437551975250244, 0.09213395416736603, -0.17608824372291565, -0.7598206400871277, 0.03246570751070976, 0.5235722064971924, -0.2855784296989441, 0.0464404113590...
unix2dos, I needed something with less manual intervention and more automatic via programming. As noted, the Char(10) works within the sql string. I didn't want to use an sql string, and so I used ''''+Char(10)+'''', but for some reason, this didn't compile. What did work very slick was: with (ROWTERMINATOR = '0x0a')...
[ -0.32276615500450134, 0.17275354266166687, 0.3595602810382843, -0.2679513096809387, 0.012079909443855286, -0.09750991314649582, 0.19910863041877747, 0.1711917668581009, 0.06168144941329956, -0.40605735778808594, 0.2630011737346649, 0.7795877456665039, -0.4150848090648651, -0.27783048152923...
I have the following string (japanese) " ユーザー名" , the first character is "like" whitespace but its number in unicode is 12288, so if I do " ユーザー名".trim() I get the same string (trim doesn't work). If i do trim in c++ it works ok. Does anyone know how to solve this issue in java? Is there a special trim method for unico...
[ 0.06552538275718689, 0.1526792198419571, 0.3194560706615448, -0.3189961314201355, -0.1887763887643814, -0.058497726917266846, 0.4556705057621002, -0.705508828163147, 0.020661909133195877, -0.570023775100708, -0.038433898240327835, 0.5419765114784241, -0.29988598823547363, -0.02010633237659...
i'm developing a simple C# Editor for one of my university courses and I need to send a .cs file to Compiler and collect errors (if they exist) and show them in my app. In other words i want to add a C# Compiler to my Editor. Is there anything like this for the debugger? If you use the CodeDomProvider ``` using System...
[ 0.20626015961170197, 0.298784077167511, 0.40511468052864075, 0.18990232050418854, -0.021151747554540634, 0.21602554619312286, 0.32498258352279663, -0.2907967269420624, -0.331756591796875, -0.7788322567939758, -0.05092727765440941, 0.3105994462966919, -0.2895938754081726, -0.019014384597539...
compiler.CompileAssemblyFromFile(cp,filename); if (cr.Errors.HasErrors) { foreach (CompilerError err in cr.Errors) { // do something with the error/warning } } ```
[ 0.3356490731239319, 0.4441525638103485, 0.02656758576631546, -0.07434254139661789, 0.2730431854724884, -0.10284969955682755, 0.3176150321960449, -0.04212441295385361, -0.07149680703878403, -0.5571430921554565, -0.3031543493270874, 0.49909043312072754, -0.39357879757881165, 0.20266623795032...
I used the code below to compress files and they keep growing instead of shrinking. I comressed a 4 kb file and it became 6. That is understandable for a small file because of the compression overhead. I tried a 400 mb file and it became 628 mb after compressing. What is wrong? See the code. (.net 2.0) ``` Public Sub ...
[ 0.3149046003818512, -0.16193635761737823, 0.9147347807884216, -0.3041524887084961, -0.12550950050354004, 0.11703494191169739, 0.37387362122535706, -0.3623785376548767, -0.45772987604141235, -0.7657017707824707, -0.2528512477874756, 0.5611000061035156, -0.4622274935245514, 0.485407978296279...
Integer = sourceFile.ReadByte() While myByte <> -1 compStream.WriteByte(CType(myByte, Byte)) myByte = sourceFile.ReadByte() End While sourceFile.Close() destFile.Close() End Sub ``` Are you sure that writing byte by byte to the stream is a really good idea? It will certainly not have i...
[ 0.14539235830307007, 0.19895155727863312, 0.49047932028770447, -0.11581636965274811, -0.0023428932763636112, 0.123894602060318, 0.05340239778161049, -0.048865847289562225, -0.34640151262283325, -0.7267050743103027, -0.021286766976118088, 0.6709303855895996, -0.3569549322128296, 0.152764350...
code with a text document of the same size as text documents tend to compress much better than random binary. Also, you could try using a pure DeflateStream as opposed to a GZipStream as they both use the same compression algorithm (deflate), the only difference is that gzip adds some additional data (like error check...
[ 0.37247464060783386, 0.20553719997406006, 0.0682583674788475, 0.21082362532615662, -0.44708654284477234, -0.2523297071456909, 0.5187365412712097, -0.12458673864603043, 0.056087300181388855, -0.7106302976608276, 0.013397211208939552, 0.7041154503822327, -0.40868237614631653, -0.146172419190...
a bit of experience: (or maybe someone who is good at VB.NET could edit my post and translate it to VB.NET) ``` FileStream sourceFile; GZipStream compStream; byte[] buffer = new byte[65536]; int bytesRead = 0; while (bytesRead = sourceFile.Read(buffer, 0, 65536) > 0) { compStream.Write(buffer, 0, bytesRead); } ...
[ 0.17943233251571655, -0.01222645677626133, 0.4487578868865967, -0.06643056869506836, 0.0657883808016777, 0.008475505746901035, 0.4458972215652466, -0.197010800242424, -0.2032945603132248, -0.6756535768508911, -0.16742826998233795, 0.44622305035591125, -0.09992314875125885, 0.05017096921801...
I am getting `WatiN.Core.Exceptions.TimeoutException`: > Timeout while Internet Explorer busy error while executing my tests via CruiseControl.Net. Any one have idea how to resolve this? While we are using TeamCity, we had to disable IE protected mode. Also, check that user, under which watiN tests are being run ca...
[ 0.1643756479024887, -0.016706246882677078, 0.44483503699302673, 0.20430730283260345, 0.04604044184088707, -0.5348169803619385, 0.8515215516090393, 0.12448132783174515, -0.1008666381239891, -0.9576338529586792, 0.043975621461868286, 0.7078558802604675, 0.054493099451065063, 0.02756907790899...
How good is C# type inference? I read somewhere that it's only for local variables? Does it work for class level attributes? For method signatures? Method return types? etc. There are a few main kinds of type inference in C#: * Implicitly typed local variables: + Only for local variables + Only when the value is as...
[ -0.06003538519144058, -0.015827639028429985, 0.12490395456552505, 0.0022515091113746166, -0.5455745458602905, -0.2510002851486206, 0.21126523613929749, -0.13836193084716797, -0.08691578358411789, -0.044798921793699265, 0.029621755704283714, 0.8857593536376953, -0.5520692467689514, -0.48884...
the type determined by the initial declaration+assignment; they don't contribute to the inference itself. * Generic method type argument inference, i.e. you don't specify the type arguments in a call to a generic method, the compiler figures them out based on the arguments. + Would be really handy to have this for ge...
[ 0.1813928186893463, -0.1465461552143097, 0.26152303814888, 0.31962692737579346, -0.4521366357803345, -0.14768320322036743, 0.08338113874197006, -0.37703898549079895, -0.03899822011590004, -0.1443595290184021, 0.07828056067228317, 0.620297908782959, -0.4883649945259094, -0.2569043040275574,...
out the types of the parameters for lambda expressions based on the context in which it's used + Usually works pretty well, in my experience * Array type inference, e.g. `new[] { "Hi", "there" }` instead of `new string[] { "Hi", "there" }` + Various small restrictions, nothing major I've probably forgotten some oth...
[ 0.15344911813735962, -0.10626117140054703, -0.017086196690797806, -0.1129470095038414, -0.3479997515678406, -0.06113867089152336, 0.28948429226875305, -0.1527450829744339, -0.0217225831001997, -0.12730084359645844, -0.009461435489356518, 0.6304978728294373, -0.39583367109298706, -0.2353132...
I'm trying to understand what single and multiple dispatch are, exactly. I just read this: <http://en.wikipedia.org/wiki/Multiple_dispatch> And from that definition is seems to me that C# and VB.Net are multiple-dispatch, even though the choice of which overload to call is made at compile-time. Am I correct here,...
[ 0.3719574511051178, -0.20062358677387238, -0.07982014119625092, 0.2015417516231537, -0.27538326382637024, 0.0705319195985794, 0.09471580386161804, 0.13106076419353485, -0.46201828122138977, -0.44245415925979614, 0.1935422420501709, 0.7189732193946838, -0.5423490405082703, 0.087200500071048...
(apparently to me, at least) seem to be dynamically typed. Up to now, with just that definition multiple-dispatch and function overloading sounded exactly the same to me. The case where this makes a real difference is when you * have two overloads of a method that differ on the type of a parameter (`CaptureSpaceShip(...
[ -0.2542988061904907, -0.33976414799690247, 0.4643090069293976, 0.14591418206691742, -0.084474116563797, 0.2943004071712494, -0.09566260129213333, 0.08513782173395157, -0.5742737054824829, -0.5329720973968506, 0.001522904378362, 0.35578668117523193, -0.4057391583919525, 0.24288135766983032,...
= new XWing(); CaptureSpaceShip(theShip); } ``` XWing obviously implements IRebelAllianceShip. In this case, the first method will be called, whereas if C# implemented multiple-dispatch, the second method would be called. Sorry about the doc rehash... This seems to me the clearest way to explain this difference, r...
[ 0.11728224158287048, -0.24815718829631805, 0.3169728219509125, -0.20979727804660797, -0.21466179192066193, -0.10901951044797897, -0.08091019839048386, -0.1992228478193283, -0.4080785810947418, -0.6826664209365845, -0.19747532904148102, 0.7498998045921326, -0.7065345048904419, -0.1768736541...
We have a number of embedded systems requiring r/w access to the filesystem which resides on flash storage with block device emulation. Our oldest platform runs on compact flash and these systems have been in use for over 3 years without a single fsck being run during bootup and so far we have no failures attributed to...
[ 0.33089137077331543, 0.32750189304351807, 0.392534464597702, -0.031766150146722794, 0.12678411602973938, -0.01265211682766676, -0.15120908617973328, 0.07268490642309189, -0.15348419547080994, -0.4057293236255646, -0.08571439236402512, 0.6367530226707458, -0.01821056939661503, 0.15911193192...
I enabled e2fsck in order to see if that would help. As it turned out we had received a shipment of bad flash memories so once those were replaced the problem went away. I have since disabled e2fsck since we had no indication that it made the system any more reliable and historically we have been fine without it. Now ...
[ 0.016639191657304764, 0.2739264965057373, 0.27967333793640137, -0.062444768846035004, -0.021259406581521034, 0.12145702540874481, 0.7100167870521545, 0.3202815055847168, -0.3460274636745453, -0.5649071931838989, -0.12373994290828705, 0.7309366464614868, -0.3695676624774933, 0.3550568819046...
enabled e2fsck again and all the files were corrected. O'Reilly's "*Building Embedded Linux Systems*" recommends running e2fsck on ext2 filesystems but does not mention it in relation to ext3 so I'm a bit confused to whether I should enable it or not. What are your takes on running fsck on an embedded system? We are ...
[ 0.10411615669727325, -0.15294145047664642, 0.3755156993865967, -0.08901521563529968, -0.11265050619840622, -0.32121050357818604, 0.30292075872421265, 0.002683873986825347, -0.3182837963104248, -0.6821291446685791, -0.28450122475624084, 0.6663826704025269, -0.5300650596618652, -0.0137069616...
the answer to your question more relates to what types of coherency requirements you application has relative to its data. That is, what has to be guaranteed if power is lost without a formal shutdown of the system? In general, none of the desktop operating system type file systems handle this all that well without spe...
[ 0.042120665311813354, 0.07128413021564484, 0.3815634250640869, 0.3863754868507385, 0.2911217212677002, -0.5194947719573975, 0.20163793861865997, 0.006445220671594143, -0.3463432788848877, -0.2149718850851059, -0.38079148530960083, 0.7330515384674072, -0.2413632869720459, 0.0369911305606365...
guarantees about what changes you made will actually be kept. ie: It's not exactly deterministic what you'll lose as a result of the power failure. I agree that putting your binaries or other important read-only data on a separate read-only partition does help ensure that they can't erroneously get tossed due to an fs...
[ 0.5349645614624023, -0.04713946208357811, 0.20173217356204987, 0.2033545970916748, 0.4099670648574829, -0.20658357441425323, 0.06431101262569427, -0.16811645030975342, -0.08336513489484787, -0.7258548140525818, -0.12068278342485428, 0.7078959345817566, -0.07548994570970535, -0.095024898648...
anyway. In our application, we actually maintain a pair of directories for things like binaries and the system is setup to boot from either one of the two areas. During software updates, we update the first directory, sync everything to the media and verify the MD5 checksums on disk before moving onto the second copy'...
[ 0.4605218470096588, -0.1501980721950531, 0.32132652401924133, 0.4723604619503021, 0.22364693880081177, -0.25922366976737976, -0.07691515982151031, 0.18003404140472412, -0.21396759152412415, -0.6755214333534241, -0.24865834414958954, 0.7640031576156616, -0.12697596848011017, -0.228567525744...
I've got a custom object (example only code for ease of understanding) ... ``` public class MyClass { private string name; private int increment; private Guid id; public string Name { get { return name; } set { name = value; } } public int Increment { get { ret...
[ 0.3718867301940918, -0.04480196163058281, 0.6980563402175903, -0.053513772785663605, 0.16357676684856415, 0.1105300560593605, 0.36705008149147034, 0.08407729119062424, -0.017253968864679337, -0.49701741337776184, -0.2595750093460083, 0.37631556391716003, -0.05521158128976822, 0.45752662420...
set { increment = value; } } public Guid Id { get { return id; } set { id = value; } } } ``` ... and a custom collection of this class ... ``` public class MyClassCollection : Collection<MyClass> { } ``` I was looking to write a Sort routine for the collection which will have the ...
[ -0.002083122031763196, -0.20134523510932922, 0.5660015344619751, 0.06463363021612167, 0.06044362112879753, 0.11651607602834702, 0.09710106253623962, -0.47117170691490173, -0.3793273866176605, -0.3480316698551178, -0.2572115659713745, 0.4379429519176483, -0.362323135137558, 0.07202754914760...
(sortProperties == null) { throw new ArgumentNullException("sortProperties", "Parameter must not be null"); } if ((sortProperties.Length > 0) && (Items.Count > 1)) { foreach (string s in sortProperties) { // call private sort
[ -0.2968412935733795, -0.36705607175827026, 0.5100862979888916, -0.37786492705345154, 0.11898297816514969, 0.2800229489803314, 0.2819620668888092, -0.40365058183670044, -0.14533933997154236, -0.43044427037239075, -0.46555325388908386, 0.506020724773407, -0.230202779173851, 0.024437284097075...
method Sort(s); } } } ``` ... and the private Sort method would take a parameter of the property name ... ``` private void Sort(string propertyName) { } ``` What I want to do is be able to pass in a set of property names into the method ... ``` MyClassC...
[ -0.2654455602169037, -0.20133057236671448, 0.4400736093521118, -0.14595656096935272, 0.15371331572532654, -0.05951318144798279, 0.036014147102832794, -0.3828628659248352, -0.0695645809173584, -0.35739490389823914, 0.184202641248703, 0.3358170688152313, -0.3513481616973877, 0.49761769175529...
MyClassCollection(); // setup a objects in the collection current = GetCollectionData(); // sort by Name, then by Increment current.Sort("Name", "Increment"); ``` Using the property names passed into the method I want to be able to check to see if it has a property of that name, if s...
[ -0.035931918770074844, -0.08079151064157486, 0.591711163520813, -0.01741071231663227, 0.25156402587890625, -0.14318738877773285, 0.22606205940246582, -0.2007521092891693, -0.28650277853012085, -0.459279865026474, 0.008680405095219612, 0.3385450839996338, -0.11426784843206406, 0.38185104727...
private void Sort(string propertyName) { // convert to List List<MyClass> myCurrentClass = Items as List<MyClass>; // sort if (myCurrentClass != null) { switch (propertyName) {
[ -0.04837082698941231, -0.3884478807449341, 0.2041337788105011, -0.2413691282272339, 0.11078181862831116, 0.18869568407535553, 0.2116735726594925, -0.24484504759311676, -0.25792667269706726, -0.610971987247467, -0.1814330369234085, 0.4572156071662903, -0.25159329175949097, 0.359760761260986...
case "Name": myCurrentClass.Sort(delegate(MyClass myClassOne, MyClass myClassTwo) { return
[ -0.30861660838127136, -0.23716400563716888, -0.17321869730949402, -0.012562190182507038, 0.47622057795524597, 0.2581140697002411, 0.20279914140701294, -0.2596789598464966, -0.00941703375428915, -0.5653111338615417, -0.13325414061546326, 0.43278488516807556, 0.03708595409989357, 0.396693050...
Comparer<string>.Default.Compare(myClassOne.Name,
[ -0.15288908779621124, 0.095450259745121, 0.17424234747886658, -0.03771142289042473, 0.10082729905843735, 0.11870943754911423, 0.556410551071167, 0.05463214963674545, 0.1510065793991089, -0.8700057864189148, 0.07685006409883499, 0.22294242680072784, -0.19325777888298035, 0.5436866283416748,...
myClassTwo.Name); } ); break;
[ -0.31656914949417114, -0.2337753176689148, 0.06916989386081696, -0.35210761427879333, 0.41336220502853394, -0.3182537853717804, 0.7698860168457031, -0.005549924448132515, 0.10480724275112152, -0.4097885489463806, -0.6195151209831238, 0.524928092956543, -0.34044545888900757, 0.4063647985458...
case "Increment": myCurrentClass.Sort(delegate(MyClass myClassOne, MyClass myClassTwo) { return
[ -0.24903295934200287, -0.3573487401008606, 0.10645951330661774, 0.03419815003871918, 0.39751020073890686, 0.28320807218551636, 0.26202812790870667, -0.21483060717582703, -0.07513872534036636, -0.5119463205337524, -0.04122830182313919, 0.4266035258769989, 0.046421121805906296, 0.33436736464...
Comparer<int>.Default.Compare(myClassOne.Increment,
[ -0.11252759397029877, 0.003198091173544526, 0.2580014765262604, 0.004783530253916979, 0.07567008584737778, 0.2507568299770355, 0.6078473329544067, -0.04581541568040848, 0.1469050794839859, -0.9626885056495667, 0.10030420869588852, 0.26664477586746216, -0.21327391266822815, 0.50736767053604...
myClassTwo.Increment); }); break; } } } ``` ... but ideally I would like to switch on the underlying type of the Property
[ -0.03826460987329483, -0.08788657933473587, 0.2836647033691406, -0.05808480829000473, 0.16394856572151184, -0.4183747470378876, 0.3908659815788269, -0.038280948996543884, 0.17850777506828308, -0.5014070868492126, -0.23734913766384125, 0.592646598815918, -0.21012316644191742, 0.485644340515...
(string, int etc.) and using a distinct number of delegate calls for the types for sorting. I've looked around but I've not found anything which points me in the right direction. I've had a look at reflection but I couldn't see anything which would be able to help me. Is this even possible? and if so, how?! Cheers! A...
[ 0.3204852342605591, 0.2407170832157135, 0.0541403666138649, 0.3436039984226227, -0.280758261680603, -0.0707169845700264, 0.5325396060943604, -0.542995035648346, -0.11415459215641022, -0.500992476940155, 0.11847300082445145, 0.1809045970439911, 0.16268208622932434, 0.08350609987974167, -0...
original idea of switching on the underlying object type, this is what I came up with ... ``` private void Sort_version2(string propertyName) { // convert to list List<MyClass> myCurrentClass = Items as List<MyClass>; string typeOfProperty; PropertyInfo pi; // sort ...
[ -0.07846163958311081, -0.32783910632133484, 0.30410176515579224, -0.29712164402008057, 0.06333258748054504, 0.17363840341567993, 0.25693145394325256, -0.4594358801841736, -0.21813566982746124, -0.602338433265686, -0.11147794872522354, 0.5145990252494812, -0.44057586789131165, 0.37281173467...
{ switch(typeOfProperty) { case "System.String": myCurrentClass.Sort(delegate(MyClass one, MyClass two)
[ -0.13735389709472656, -0.41687440872192383, 0.1736319363117218, 0.12130177766084671, 0.5106103420257568, 0.08624646812677383, 0.2506810426712036, -0.17747676372528076, -0.2879225015640259, -0.6244757175445557, -0.10848306119441986, 0.41424018144607544, -0.2087307870388031, 0.25024652481079...
{ return
[ -0.4475473165512085, 0.13956648111343384, -0.5005865693092346, -0.03800157457590103, 0.1611543595790863, 0.22090661525726318, 0.5220441818237305, 0.2580777704715729, 0.36334919929504395, -0.3201572299003601, -0.29791438579559326, 0.6564508676528931, -0.019149689003825188, -0.51201504468917...
Comparer<string>.Default.Compare(pi.GetValue(one, null).ToString(), pi.GetValue(two, null).ToString());
[ -0.4218192994594574, -0.21310584247112274, 0.40920892357826233, -0.3123248517513275, -0.0701938271522522, 0.3252418637275696, 0.4416601359844208, -0.36827388405799866, 0.3245985805988312, -0.7101041078567505, -0.24492819607257843, 0.593671441078186, -0.5379699468612671, -0.0986328646540641...
}); break; case "System.Int32": myCurrentClass.Sort(delegate
[ -0.39236980676651, -0.2822812497615814, 0.044740643352270126, -0.04167192429304123, 0.4531537592411041, 0.006462953053414822, 0.5588098764419556, -0.2830934524536133, -0.19679668545722961, -0.5305870771408081, -0.24146166443824768, 0.32678142189979553, -0.22220365703105927, 0.3444565236568...
(MyClass one, MyClass two) { return
[ -0.46214306354522705, -0.31760603189468384, -0.22127552330493927, -0.04088161140680313, 0.06901875138282776, -0.0023381763603538275, 0.16714172065258026, 0.2020445466041565, 0.09797761589288712, -0.5567479133605957, -0.35480791330337524, 0.606800377368927, -0.1243889331817627, 0.0495244674...
Comparer<int>.Default.Compare(
[ -0.07034388184547424, -0.00456629041582346, 0.25928691029548645, -0.11943875998258591, -0.14374785125255585, 0.27223533391952515, 0.29217323660850525, -0.20163100957870483, 0.17480382323265076, -0.8798204660415649, -0.17001429200172424, 0.4387893080711365, -0.37266603112220764, 0.240888625...
Convert.ToInt32(pi.GetValue(one, null)), Convert.ToInt32(pi.GetValue(two, null)));
[ -0.5052961707115173, -0.34313762187957764, 0.20836052298545837, -0.3011404871940613, -0.07385878264904022, 0.13892413675785065, 0.5108558535575867, -0.4543669521808624, 0.41069310903549194, -0.712498664855957, -0.3900699317455292, 0.5546719431877136, -0.6724416613578796, -0.181116774678230...
}); break; default: throw new NotImplementedException("Type of property not implemented yet"); } } } ``` I've documented the thought process and more details
[ 0.0558471605181694, -0.025449620559811592, 0.12829039990901947, -0.3836907148361206, 0.3886719346046448, -0.3121764659881592, 0.30687814950942993, -0.17455847561359406, 0.08556707203388214, -0.6127795577049255, -0.39928826689720154, 0.7061182260513306, -0.12945464253425598, 0.2101312130689...
on [my blog](http://westdiscgolf.blogspot.com/2009/01/accessing-object-properties-from-string.html) let me know what you think! Thanks to Jon and Frederik for the help :-)
[ 0.3108879327774048, 0.19109486043453217, 0.40911605954170227, 0.010730307549238205, -0.13020850718021393, -0.5558968782424927, 0.4467311501502991, 0.22218972444534302, -0.3673974275588989, -0.4965687096118927, -0.05456429347395897, 0.21018871665000916, 0.5103206634521484, -0.08679801970720...
I wrote an application that loops through a set of records and prints two things. One is a report from SSRS wich works correctly. The other is a drawing that uses a COM object to print. The COM object randomly fails and causes the program to quit. Is there a way to stop it from killing the entire program when the...
[ 0.6624106764793396, 0.05822945386171341, -0.08311577886343002, 0.3332350552082062, 0.1138966977596283, 0.10085929930210114, 0.10200902074575424, -0.19868265092372894, -0.17066481709480286, -0.5306485891342163, 0.455903023481369, 0.2168128341436386, -0.5201723575592041, 0.19708670675754547,...
command on failure.
[ -0.3980715274810791, 0.2454480081796646, -0.16943125426769257, 0.43249720335006714, -0.3722304105758667, 0.10631337016820908, 0.19672104716300964, -0.4317728281021118, -0.15231144428253174, -0.36638733744621277, -0.4508143663406372, 0.8395583033561707, -0.14314886927604675, 0.2043839097023...
The title pretty much says it all. When I'm doing some reflection through my classes, will the MemberInfo.GetCustomAttributes() method preserve the order of attributes on a member, or not? The official documentation does not say anything one way or the other. --- In case you're wondering why I would need this, here's...
[ 0.4522694945335388, 0.10182609409093857, 0.059250425547361374, 0.3585735857486725, -0.13945049047470093, -0.45953795313835144, 0.0616353377699852, 0.14291147887706757, -0.3366280496120453, -0.2829371392726898, 0.09118214249610901, 0.3141424357891083, 0.1202927678823471, 0.11151744425296783...
is expected to have a pretty long lifetime. Over the course it will gain many forms that will have to be accessible from the menu. To make life easier for the developers to come I've made a `MenuItemAttribute` which you can apply to a form's class. This attribute has an unlimited amount of string parameters in its cons...
[ 0.5038343071937561, -0.17367790639400482, 0.6719454526901245, -0.06149134784936905, 0.3647242784500122, -0.08839096128940582, 0.02516539953649044, -0.002941581653431058, -0.10764297097921371, -0.5213672518730164, -0.06360498070716858, 0.40988650918006897, -0.13425348699092865, 0.3065622448...
be an item "Clients" under which there would be an item "Orders" - which would then open the form. A single form can have several of these attributes if needed - it will then be acessible from several places in the menu. Obviously the whole menu is built in runtime by enumerating through all the classes in my assembli...
[ 0.30665770173072815, -0.18015123903751373, 0.2881932258605957, 0.09667365252971649, -0.23107755184173584, 0.15721666812896729, 0.056990448385477066, -0.3347020745277405, -0.3365132808685303, -0.8246352076530457, -0.14729075133800507, 0.3372803330421448, -0.30587461590766907, 0.010406155139...