text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
nulla. <span>Quisque ante congue...</span> </p> ``` Here's what I did: ``` <link rel="Stylesheet" type="text/css" href="Stylesheet.css" id="style" runat="server" visible="false" /> ``` It fools Visual Studio into thinking you've added a stylesheet to the page but it doesn't get rendered. --- Here's an even mo...
[ 0.7392238974571228, 0.055583927780389786, -0.009525701403617859, -0.30545923113822937, -0.4437231719493866, -0.06104107201099396, 0.13565601408481598, -0.40544822812080383, -0.2604026794433594, -0.43402624130249023, 0.025067269802093506, 0.27992814779281616, 0.05443887412548065, -0.3185821...
I have an html file with an unordered list. I want to show the list items horizontally but still keep the bullets. No matter what I try, whenever I set the style to inline to meet the horizontal requirement I can't get the bullets to display. The best option I saw in other answers was to use `float:left;`. Unfortunatel...
[ 0.7641124129295349, 0.3182257413864136, 0.21190012991428375, -0.07874755561351776, -0.18448011577129364, 0.29321807622909546, 0.2824643850326538, -0.34249183535575867, -0.2750398516654968, -0.5002498626708984, 0.42518046498298645, 0.53253173828125, -0.24868366122245789, -0.2024312168359756...
adding `&bull;` to the my html, rather than styling this. It's less than ideal, but it's the most compatible option I found. --- ***edit**: \*Current readers take note of the original post date. IE7 is unlikely to be a concern anymore.*
[ 0.40962669253349304, 0.011323807761073112, 0.6819473505020142, -0.15178616344928741, -0.310112863779068, -0.10591255128383636, 0.3748251795768738, 0.3361819088459015, -0.34318265318870544, -0.4842391014099121, -0.3661491274833679, -0.03192141279578209, 0.02822243981063366, 0.08816754072904...
Is anyone using Elmah to send exceptions via email? I've got Elmah logging set up via SQL Server, and can view the errors page via the Elmah.axd page, but I am unable to get the email component working. The idea here is to get the email notification so we can react more quickly to exceptions. Here is my web.config (unn...
[ 0.11081023514270782, 0.6283880472183228, 0.014764120802283287, 0.01673230156302452, -0.21638940274715424, -0.2613392472267151, 0.7356415390968323, -0.12100192904472351, -0.36454668641090393, -0.4696608781814575, 0.1823674738407135, 0.2166237235069275, -0.6506821513175964, 0.175448700785636...
<sectionGroup name="elmah"> <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah"/> <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah"/> <section name="errorFilter" requirePermission="false" type="El...
[ -0.12566831707954407, 0.41461628675460815, 0.3327230215072632, -0.08593969792127609, 0.06462278962135315, 0.026945356279611588, 0.5534969568252563, -0.4715336859226227, -0.39199545979499817, -0.32561054825782776, -0.24246090650558472, 0.436585009098053, -0.14535868167877197, 0.013066943734...
<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="elmah-sql" > </errorLog> <errorMail from="test@test.com" to="test@test.com" subject="Application Exception" async="false" smtpPort="25" smtpServer="***" userName="***"
[ 0.2490716576576233, 0.1904383897781372, -0.022437049075961113, 0.11202976852655411, -0.00971792172640562, 0.109479159116745, 0.8492350578308105, -0.23690325021743774, -0.16545407474040985, -0.47367730736732483, -0.05681688338518143, 0.19829590618610382, -0.1999782919883728, 0.2340029478073...
password="***"> </errorMail> </elmah> <system.web> <customErrors mode="RemoteOnly" defaultRedirect="CustomError.aspx"> <error statusCode="403" redirect="NotAuthorized.aspx" /> <!--<error statusCode="404" redirect="FileNotFound.htm" />--> </customErrors> ...
[ -0.5360803008079529, -0.038018159568309784, 0.33736753463745117, 0.26684635877609253, 0.4951418340206146, 0.06764140725135803, 0.24272817373275757, -0.11693944036960602, -0.23391009867191315, -0.5852363705635071, -0.18448378145694733, 0.6856820583343506, 0.07717642933130264, 0.123757071793...
<remove verb="*" path="*.asmx"/> <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add verb="*" path="*_AppService.axd" validate="false" type="System.Web...
[ -0.3063330352306366, 0.26785627007484436, 0.44680148363113403, -0.05764070525765419, -0.26310551166534424, 0.49012240767478943, 0.800729513168335, -0.5224030017852783, -0.21507199108600616, -0.23067378997802734, -0.38443782925605774, 0.2942616939544678, -0.25534194707870483, 0.078791260719...
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/> </httpModules> </system.web> </configuration> ``` You need the ErrorMail httpMo...
[ -0.07984278351068497, -0.00990921352058649, 0.19959650933742523, -0.10160627216100693, -0.13229192793369293, -0.021815450862050056, 0.6287760734558105, 0.09963773936033249, -0.1944662481546402, -0.796759307384491, -0.27119699120521545, 0.2957771420478821, -0.41074007749557495, 0.2634510099...
Given a Python object of any kind, is there an easy way to get the list of all methods that this object has? Or, if this is not possible, is there at least an easy way to check if it has a particular method other than simply checking if an error occurs when the method is called? **For many objects**, you can use this...
[ 0.09422995150089264, 0.07654976844787598, -0.06909694522619247, 0.04347582533955574, -0.037034403532743454, 0.025685995817184448, 0.18709802627563477, -0.046117641031742096, -0.27367350459098816, -0.2849861681461334, -0.10168681293725967, 0.3640631139278412, -0.3365887701511383, 0.01062184...
(now archived), that should provide some further details! **If you get an `AttributeError`, you can use this instead**: `getattr()` is intolerant of pandas style Python 3.6 abstract virtual sub-classes. This code does the same as above and ignores exceptions. ```py import pandas as pd df = pd.DataFrame([[10, 20, 30]...
[ 0.09152885526418686, 0.009655586443841457, 0.29367485642433167, -0.3567606806755066, -0.17092372477054596, 0.4308307468891144, -0.058396805077791214, -0.3390467166900635, -0.33997994661331177, -0.31724274158477783, -0.0812406912446022, 0.5455881953239441, -0.4569064974784851, -0.0410378947...
methodList.append(str(method_name)) except Exception: methodList.append(str(method_name)) processFunc = (lambda s: ' '.join(s.split())) or (lambda s: s) for method in methodList: try: print(str(method.ljust(spacing)) + ' ' + processFunc(str(getattr(object, method).__doc__)[0:90...
[ -0.13742098212242126, 0.07030536979436874, 0.7764183878898621, -0.3049367368221283, 0.11521027982234955, 0.15418557822704315, 0.25433820486068726, -0.7300987243652344, -0.30856382846832275, -0.04455658420920372, -0.24597212672233582, 0.35485824942588806, -0.39775487780570984, 0.15426188707...
Despite primarily being a windows user, I am a huge fan of rsync. Now, I don't want to argue the virtues of rsync vs any other tool...this is not my point. The only way I've ever found of running rsync on windows is via a version that is built to run on top of Cygwin, and as Cygwin has issues with Unicode, so does rsy...
[ 0.3499378263950348, 0.29725876450538635, -0.006028513889759779, 0.004577526357024908, -0.27635160088539124, -0.3553869128227234, 0.15879660844802856, 0.4683687090873718, -0.26424914598464966, -0.5017229318618774, -0.08311141282320023, 0.81336510181427, -0.28513410687446594, 0.1105966791510...
enough interest from windows users to care to port it over? Partly I ask because I'm am considering trying to take on the task of starting a port, but I want to make sure there's not something I'm missing in terms of why it may not be possible. The way that windows locks open files might cause an issue requiring you t...
[ 0.751038134098053, 0.0008675006101839244, 0.21809856593608856, -0.03180775046348572, 0.22698110342025757, -0.23588502407073975, -0.06448473781347275, 0.2563081979751587, -0.4888181686401367, -0.3352966010570526, 0.29273948073387146, 0.6650357842445374, -0.06694260984659195, 0.2503515183925...
to try contacting. <http://www.russiantequila.com/wordpress/?p=8>
[ -0.0718199759721756, -0.36943185329437256, 0.32013875246047974, 0.096670001745224, -0.013272312469780445, 0.18514151871204376, 0.47345590591430664, 0.5832700729370117, -0.5920531153678894, -0.31108519434928894, -0.12993234395980835, -0.15000982582569122, -0.3956323564052582, 0.229153215885...
I have a small JS function that does Ajax for me and another like it that adds in POST data to the request. With Ajax being such a big topic with so many libraries about it, what am I missing from my function, is it insecure or something else worrying? ``` function loadPage(pagePath, displayElement) { var xmlHttp;...
[ 0.22437307238578796, -0.09032265096902847, 0.40091264247894287, -0.07701650261878967, -0.2309771180152893, -0.11452057212591171, 0.34601566195487976, -0.1570400595664978, -0.12461870163679123, -0.6869508028030396, -0.1374465674161911, 0.45085111260414124, -0.40755245089530945, -0.008381290...
// Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try {
[ 0.1732242852449417, -0.42214059829711914, 0.41541340947151184, -0.07868291437625885, 0.14076924324035645, -0.15307419002056122, 0.2595827877521515, -0.006587267853319645, -0.1068200096487999, -0.9288190007209778, -0.32455503940582275, 0.22323331236839294, -0.6859388947486877, -0.0400040894...
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } }
[ 0.08298453688621521, -0.303921639919281, 0.12112612277269363, -0.10122255980968475, -0.3208748996257782, -0.22388856112957, 0.30436062812805176, 0.05302172154188156, -0.004282865673303604, -0.7031574249267578, -0.3593508005142212, 0.32777154445648193, -0.6053377389907837, -0.10285767912864...
} xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState==4) { document.getElementById(displayElement).innerHTML = xmlHttp.responseText; } } xmlHttp.open("GET", pagePath, true); xmlHttp.send(null); } ``` I strongly recommend you not roll your own Ajax co...
[ 0.2770543694496155, 0.050251662731170654, 0.32013311982154846, -0.01934528723359108, -0.2085348516702652, -0.2240767776966095, 0.26655563712120056, -0.11824905127286911, -0.13904103636741638, -0.8012805581092834, -0.34136563539505005, 0.6560559868812561, -0.31379014253616333, -0.1139315888...
sent, 3 means it's in process, etc.), and they should escape the reponse you're getting so you don't insert potentially insecure javascript or something into your page. Another thing a more robust framework will give you is the ability to do more than just use innerHTML to replace items in the DOM. Your function here ...
[ 0.09337940067052841, -0.38665303587913513, 0.3432207405567169, 0.24308045208454132, -0.46679845452308655, -0.2580850124359131, 0.2465788722038269, -0.1323353499174118, -0.2489800751209259, -0.5871561169624329, 0.11999338865280151, 0.6174790859222412, -0.1997738927602768, -0.043860010802745...
Will limiting a query to one result record, improve performance in a large(ish) MySQL table if the table only has one matching result? for example ``` select * from people where name = "Re0sless" limit 1 ``` if there is only one record with that name? and what about if `name` was the primary key/ set to unique? an...
[ -0.10866934061050415, -0.244527205824852, 0.3642444610595703, 0.3809325695037842, -0.1688993275165558, -0.21230758726596832, 0.07399303466081619, -0.24491190910339355, -0.2499261498451233, -0.6709370613098145, -0.024456515908241272, 0.6681187748908997, -0.2922467887401581, 0.01444069202989...
more rows match the query, **yes**, because the full table scan will be halted after the first row is matched. * if no rows match the query, **no**, because it will need to complete a full table scan
[ -0.10321947187185287, -0.0035494565963745117, 0.8665445446968079, 0.12470515817403793, 0.13338272273540497, 0.07973600924015045, 0.30631953477859497, -0.05011572688817978, -0.5190396904945374, -0.6743698716163635, -0.617243766784668, 0.282023161649704, -0.23471340537071228, 0.3051021695137...
We have a few very large Excel workbooks (dozens of tabs, over a MB each, very complex calculations) with many dozens, perhaps hundreds of formulas that use the dreaded INDIRECT function. These formulas are spread out throughout the workbook, and target several tables of data to look-up for values. Now I need to move ...
[ 0.3881014883518219, 0.43060997128486633, 0.16123448312282562, 0.4002303183078766, 0.1553850769996643, 0.013630403205752373, -0.08835999667644501, 0.08900777250528336, -0.011173496954143047, -0.5447863936424255, 0.13421089947223663, 0.38350388407707214, -0.08272462338209152, -0.017480218783...
rather large tables one at a time proved to be unacceptably high. We are moving the tables in a contiguous range so we can load them all in one shot.) **Is there any way to locate all the INDIRECT formulas that currently refer to the tables we want to move?** I don't need to do this on-line. I'll happily take somethi...
[ 0.42433375120162964, 0.14253494143486023, 0.39146214723587036, 0.1751156449317932, 0.17856957018375397, -0.04129856079816818, 0.037125907838344574, -0.1708371490240097, -0.5756973028182983, -0.8325197100639343, 0.2014954835176468, 0.6107007265090942, 0.1012561097741127, -0.1582218408584594...
vba (i've included the code from @PabloG and @euro-micelli ): ``` Sub iterateOverWorkbook() For Each i In ThisWorkbook.Worksheets Set rRng = i.UsedRange For Each j In rRng If (Not IsEmpty(j)) Then If (j.HasFormula) Then If InStr(oCell.Formula, "INDIRECT") Then ...
[ 0.13296695053577423, 0.026454472914338112, 0.6033234596252441, -0.39506521821022034, 0.03526552394032478, 0.12774695456027985, 0.24901236593723297, -0.4778304100036621, -0.189316987991333, -0.4030900299549103, -0.09305595606565475, 0.7041627764701843, -0.15481561422348022, 0.24815627932548...
End If End If End If Next j Next i End Sub ``` This example substitues every occurrence of "indirect(D4)" with "indirect(C4)". You can easily swap the replace-function with something more sophisticated, if you have more complicated indirect-functions. Performance is not that bad, even for bigg...
[ -0.056280966848134995, -0.08314868807792664, 0.312542587518692, -0.2652845084667206, -0.14700503647327423, -0.2867012321949005, 0.2622048854827881, -0.14253540337085724, -0.027119053527712822, -0.5524961352348328, -0.3110598921775818, 0.3906334638595581, -0.2401515543460846, 0.075486831367...
When writing multithreaded applications, one of the most common problems experienced is race conditions. My questions to the community are: * What is the race condition? * How do you detect them? * How do you handle them? * Finally, how do you prevent them from occurring? A race condition occurs when two or more thre...
[ 0.102635957300663, 0.10977089405059814, -0.33935827016830444, 0.1961631178855896, 0.1916569620370865, 0.022319022566080093, 0.28861570358276367, 0.29753047227859497, -0.28344857692718506, -0.7358041405677795, 0.09612032771110535, 0.1340259164571762, -0.5659803152084351, 0.16255997121334076...
is dependent on the thread scheduling algorithm, i.e. both threads are "racing" to access/change the data. Problems often occur when one thread does a "check-then-act" (e.g. "check" if the value is X, then "act" to do something that depends on the value being X) and another thread does something to the value in betwe...
[ -0.00010950259456876665, -0.41811418533325195, 0.07718819379806519, 0.3762427270412445, 0.14201153814792633, -0.03371337428689003, 0.14119935035705566, -0.26099324226379395, -0.24015434086322784, -0.4273887872695923, -0.009953218512237072, 0.3937447965145111, -0.3705742061138153, 0.1493200...
y will not be equal to 10. } ``` The point being, y could be 10, or it could be anything, depending on whether another thread changed x in between the check and act. You have no real way of knowing. In order to prevent race conditions from occurring, you would typically put a lock around the shared data to ensure on...
[ 0.28129640221595764, -0.10936944931745529, 0.3166186809539795, 0.1657465696334839, 0.3727293908596039, 0.007880459539592266, 0.18165820837020874, -0.13889071345329285, -0.30335965752601624, -0.5465508699417114, -0.07632283121347427, 0.45992740988731384, -0.33071938157081604, 0.133847743272...
// Therefore y = 10 } // release lock for x ```
[ 0.00896660890430212, 0.2231404036283493, 0.217332661151886, -0.3055803179740906, 0.34599465131759644, -0.1904117316007614, 0.12273015081882477, -0.1252211332321167, -0.014909413643181324, -0.08282706141471863, -0.47821468114852905, 0.5924180746078491, -0.4608900547027588, 0.202857479453086...
How do I use JUnit to test a class that has internal private methods, fields or nested classes? It seems bad to change the access modifier for a method just to be able to run a test. If you have somewhat of a legacy **Java** application, and you're not allowed to change the visibility of your methods, the best way to ...
[ 0.17156851291656494, -0.16954830288887024, 0.043512631207704544, 0.1253526508808136, -0.4573189914226532, -0.05136992782354355, 0.10686260461807251, -0.05096025392413139, 0.12524420022964478, -0.7661184072494507, 0.4105083644390106, 0.6438266038894653, -0.17476476728916168, -0.121802270412...
and fields. Of course, you can't change `private static final` variables through reflection. ``` Method method = TargetClass.getDeclaredMethod(methodName, argClasses); method.setAccessible(true); return method.invoke(targetObject, argObjects); ``` And for fields: ``` Field field = TargetClass.getDeclaredField(field...
[ -0.0005125831812620163, -0.02785186469554901, 0.1985180526971817, -0.0117641007527709, 0.05715029314160347, -0.24315908551216125, 0.20808054506778717, -0.2777320444583893, -0.1371600180864334, -0.20359830558300018, -0.19274622201919556, 0.8432908654212952, -0.348347544670105, -0.0127574130...
I would like to have an `iframe` take as much vertical space as it needs to display its content and not display a scrollbar. Is it at all possible ? Are there any workarounds? This should set the `IFRAME` height to its content's height: ``` <script type="text/javascript"> the_height = document.getElementById('the_ifr...
[ 0.11060500144958496, 0.2041829228401184, 0.802398145198822, -0.046748705208301544, 0.17391709983348846, 0.025972701609134674, 0.1157793328166008, 0.010624488815665245, -0.030104098841547966, -0.8381826877593994, -0.1273086816072464, 0.29998308420181274, -0.04879727587103844, 0.119622707366...
I have a recursive algorithm which steps through a string, character by character, and parses it to create a tree-like structure. I want to be able to keep track of the character index the parser is currently at (for error messages as much as anything else) but am not keen on implementing something like a tuple to hand...
[ -0.1582368165254593, 0.2955382168292999, 0.17136722803115845, -0.1245151236653328, -0.16464334726333618, 0.23882068693637848, 0.3352133333683014, -0.11663603782653809, -0.057208072394132614, -0.3124631643295288, -0.1501685529947281, 0.32989534735679626, -0.3000987768173218, 0.3515035510063...
point at a new object) Is there a way to get something similar to work which won't pollute my code? Since you've already discovered the pseudo-mutable integer "hack," how about this option: Does it make sense for you to make a separate Parser class? If you do this, you can store the current state in a member variable...
[ 0.22119082510471344, -0.12531481683254242, -0.03169683739542961, 0.24906733632087708, -0.08201427757740021, 0.04643316939473152, 0.3270633816719055, -0.1518501490354538, -0.208987295627594, -0.4723219573497772, 0.3743087649345398, 0.23104923963546753, -0.3351399600505829, 0.379565119743347...
You can use a standard dot notation or a method call in Objective-C to access a property of an object in Objective-C. ``` myObject.property = YES; ``` or ``` [myObject setProperty:YES]; ``` Is there a difference in performance (in terms of accessing the property)? Is it just a matter of preference in terms of cod...
[ 0.15346549451351166, 0.22533534467220306, 0.5073829889297485, 0.07590926438570023, -0.07255776226520538, -0.13353219628334045, 0.049236781895160675, -0.38327503204345703, -0.07436076551675797, -0.6684698462486267, -0.30610060691833496, 0.7179759740829468, -0.31172534823417664, -0.042077012...
and/or `setter` attribute specified; however, all it does is change what message gets sent, not whether a message is sent: ``` @interface MyView : NSView @property(getter=isEmpty) BOOL empty; @end if ([someView isEmpty]) { /* ... */ } if (someView.empty) { /* ... */ } ``` Both of the last two lines will compile ide...
[ 0.15283797681331635, -0.23962262272834778, 0.5747100114822388, -0.18207252025604248, -0.2694942355155945, -0.09968161582946777, 0.3977871239185333, 0.0737844780087471, -0.016738109290599823, -0.979667067527771, -0.15609726309776306, 0.4711512327194214, -0.1455913484096527, 0.15401893854141...
When I try to do any svn command and supply the `--username` and/or `--password` options, it prompts me for my password anyways, and always will attempt to use my current user instead of the one specified by `--username`. Neither `--no-auth-cache` nor `--non-interactive` have any effect on this. This is a problem becau...
[ 0.03154822066426277, -0.06241200119256973, 0.5650519728660583, -0.23319602012634277, 0.13949525356292725, -0.16524633765220642, 0.3583449721336365, 0.280814528465271, -0.2581687271595001, -0.7440624833106995, -0.27469828724861145, 0.532814085483551, -0.20234496891498566, 0.3262984454631805...
it asking for user1's password instead of user2's? I'm 99% sure all of my permissions are set correctly. Is there some config option for svn that switches off command-line passwords? Or is it something else entirely? I'm running svn 1.3.2 (r19776) on Fedora Core 5 (Bordeaux). --- Here's a list of my environmen...
[ -0.33133459091186523, 0.05561481788754463, 0.7167795896530151, -0.011010870337486267, 0.03846297040581703, 0.3347042202949524, 0.49632278084754944, -0.25624895095825195, 0.03198906406760216, -0.6996962428092957, -0.13184674084186554, 0.8399381041526794, -0.3760293126106262, 0.0236343275755...
OLDPWD=/home/users/XXXXXX ``` The prompt you're getting doesn't look like Subversion asking you for a password, it looks like ssh asking for a password. So my guess is that you have checked out an svn+ssh:// checkout, not an svn:// or http:// or https:// checkout. IIRC all the options you're trying only work for the ...
[ 0.44165152311325073, 0.19303013384342194, 0.41077202558517456, 0.05809050798416138, 0.07292696088552475, -0.4018888771533966, 0.25249871611595154, -0.060216668993234634, -0.12304124236106873, -0.7721470594406128, -0.08334125578403473, 0.6577979326248169, -0.22073324024677277, 0.23580254614...
We have an application with a good amount of jQuery JSON calls to server side code. Because of this, we have a large amount of binding code to parse responses and bind the appropriate values to the form. This is a two part question. 1. What is the reccomended approach for dealing with a large number of forms that all ...
[ 0.5775830149650574, -0.27007898688316345, 0.10910043865442276, 0.2887110114097595, -0.1323210895061493, -0.31452471017837524, 0.15104901790618896, -0.31436991691589355, -0.21817393600940704, -0.30290016531944275, 0.20153765380382538, 0.3274838328361511, -0.3904666304588318, -0.022211000323...
jQuery code or any type of reccomended structure other than just throwing a bunch of functions in a js file? Not 100% sure example what you are asking, but personally, and I use MochiKit, I create JavaScript "classes" (or widgets, if you prefer) for every significant client-side UI structure. These know, of course, how...
[ 0.5984357595443726, 0.14771780371665955, 0.12749403715133667, 0.06633958220481873, -0.3767697811126709, -0.05749811604619026, -0.0144415982067585, 0.37838685512542725, -0.05714043602347374, -0.7291083335876465, -0.07357850670814514, 0.5469915866851807, -0.010945871472358704, -0.28347474336...
populate them with data, have them throw events, etc. etc. Am I up in the night on this? :) --- EDIT: In other words, yes - do what you are doing, for the most part. I see too many novice JavaScript hackers write a bunch of poorly-cohesive functions that don't appear to be a part of anything specific other than they...
[ 0.8831192851066589, -0.20735418796539307, 0.3198583126068115, 0.28872767090797424, -0.06809894740581512, -0.5400153994560242, 0.27452823519706726, 0.13114674389362335, -0.3046892583370209, -0.3482149839401245, -0.22317254543304443, 0.3957267701625824, -0.14765755832195282, -0.3240560591220...
What graphics toolkit is used for the Window's Google Talk application? There isn't much information on this out there but it seems to be their own customized controls plus an IE component (and not Qt like Google Earth). [This forum thread](http://www.customizetalk.com/forums/viewtopic.php?t=841&postdays=0&postorder=as...
[ 0.3852279484272003, -0.17262309789657593, 0.4974669814109802, 0.24353739619255066, -0.3046848475933075, 0.10699383914470673, -0.07371396571397781, 0.2713918685913086, -0.28030458092689514, -0.5695427656173706, 0.20537492632865906, 0.47504013776779175, -0.12745751440525055, 0.06559112668037...
I have some UI in VB 2005 that looks great in XP Style, but goes hideous in Classic Style. Any ideas about how to detect which mode the user is in and re-format the forms on the fly? --- Post Answer Edit: Thanks Daniel, looks like this will work. I'm using the first solution you posted with the GetCurrentThemeName(...
[ -0.016354240477085114, -0.022649744525551796, 0.8926739692687988, -0.1351599097251892, -0.28559836745262146, 0.16177555918693542, 0.3438420593738556, -0.44361433386802673, -0.06431251764297485, -0.7148513197898865, -0.14743690192699432, 0.6964934468269348, -0.25078052282333374, 0.021893754...
New System.Text.StringBuilder(260) Dim stringSizeName As New System.Text.StringBuilder(260) ``` GetCurrentThemeName(stringThemeName, 260, stringColorName, 260, stringSizeName, 260) MsgBox(stringThemeName.ToString) The MessageBox comes up Empty when i'm in Windows Classic Style/theme, and Comes up with "C:\WINDOWS\res...
[ -0.11889102309942245, -0.21290791034698486, 0.8947492241859436, -0.08077549934387207, -0.16984257102012634, 0.24737942218780518, 0.17178693413734436, -0.16768385469913483, -0.6465964317321777, -0.5412362217903137, -0.1381417065858841, 0.5031787753105164, -0.3661157786846161, 0.437250703573...
static extern bool DwmIsCompositionEnabled(); ``` See what results you get out of those two functions; they should be enough to determine when you want to use a different theme!
[ 0.17949071526527405, -0.30056673288345337, 0.526801347732544, -0.1656230092048645, 0.05701703950762749, -0.3224231004714966, 0.07365810126066208, 0.17930373549461365, -0.28787654638290405, -0.25927361845970154, -0.2986133098602295, 0.6010180711746216, -0.40353742241859436, 0.41676536202430...
Is it possible to embed an audio object (mp3, wma, whatever) in a web-enabled InfoPath form ? If it is, how do you do it ? It looks like you can't embed `<object>` tags in a richtext field. I'm getting nothing when I do it.
[ 0.35750606656074524, 0.04215916991233826, 0.11030619591474533, 0.4539565443992615, 0.07409806549549103, -0.4153280258178711, 0.08497371524572372, 0.0265119019895792, -0.03197934478521347, -0.5223341584205627, -0.10859140008687973, 0.6484729647636414, -0.30302029848098755, -0.03939060494303...
I have recently installed .net 3.5 SP1. When I deployed a compiled web site that contained a form with its action set: ``` <form id="theForm" runat="server" action="post.aspx"> ``` I received this error. Method not found: 'Void System.Web.UI.HtmlControls.HtmlForm.set\_Action(System.String)'. If a fellow develo...
[ 0.11170926690101624, -0.1510644555091858, 0.722490131855011, -0.26790890097618103, -0.2023266702890396, -0.13105012476444244, 0.48057159781455994, -0.5235577821731567, -0.6107664704322815, -0.592313826084137, -0.31428980827331543, 0.5738510489463806, -0.3515998423099518, -0.314967751502990...
a setter on the property.
[ 0.035385094583034515, -0.009307019412517548, -0.07837899029254913, 0.07628287374973297, 0.16983726620674133, 0.06494644284248352, -0.05566980317234993, -0.1308058202266693, -0.15430618822574615, -0.1309146136045456, 0.18185646831989288, 0.17319901287555695, -0.10135360807180405, 0.00065177...
What is a good setup for .hgignore file when working with Visual Studio 2008? I mostly develop on my own, only occasionly I clone the repository for somebody else to work on it. I'm thinking about obj folders, .suo, .sln, .user files etc.. Can they just be included or are there file I shouldn't include? Thanks! p.s...
[ 0.11394616216421127, 0.18361744284629822, 0.3515040874481201, 0.03455641120672226, -0.3937849700450897, -0.1022978350520134, 0.22035232186317444, -0.07638216763734818, -0.4005237817764282, -0.6874539852142334, -0.022102396935224533, 0.5271203517913818, -0.6671052575111389, -0.1989311724901...
Ignore Visual Studio 2008 files *.obj *.exe *.pdb *.user *.aps *.pch *.vspscc *_i.c *_p.c *.ncb *.suo *.tlb *.tlh *.bak *.cache *.ilk *.log *.lib *.sbr *.scc [Bb]in [Dd]ebug*/ obj/ [Rr]elease*/ _ReSharper*/ [Tt]est[Rr]esult* [Bb]uild[Ll]og.* *.[Pp]ublish.xml ```
[ 0.1445513516664505, 0.22906138002872467, 0.32987070083618164, 0.10309547185897827, 0.0564640648663044, -0.059233274310827255, 0.38032862544059753, -0.034950003027915955, -0.37911978363990784, 0.1589847058057785, -0.19580772519111633, 0.6168739795684814, -0.9248687028884888, -0.167611628770...
I have a little dilemma that maybe you can help me sort out. I've been working today in modifying ASP.NET's Membership to add a level of indirection. Basically, ASP.NET's Membership supports Users and Roles, leaving all authorization rules to be based on whether a user belongs to a Role or not. What I need to do is...
[ 0.4101467430591583, -0.262423574924469, 0.2601960599422455, 0.0851084291934967, -0.095479317009449, -0.2221466600894928, 0.1597394049167633, -0.19535978138446808, -0.3211860656738281, -0.33225196599960327, 0.057259585708379745, 0.35127758979797363, -0.426194429397583, -0.18869532644748688,...
which has a function assigned. Having said that, my problem has nothing to do with it, it's a generic class design issue. I want to provide an abstract method in my base RoleProvider class to create the function (and persist it), but I want to make it optional to save a description for that function, so I need to c...
[ 0.10228860378265381, -0.21343189477920532, 0.4150903522968292, 0.11760225892066956, 0.13180528581142426, -0.22266292572021484, 0.14116941392421722, -0.4731507897377014, -0.16859152913093567, -0.4090768098831177, 0.07432421296834946, 0.5036630630493164, -0.5247769355773926, -0.1385088264942...
the implementer may not respect the best practice that says that one overload should call the other one with the parameters normalized, and the logic should only be in the final one (the one with all the parameters). Besides, it's not nice to require both methods to be implemented by the developer. 2. Create the first ...
[ 0.0999390259385109, -0.24449747800827026, 0.02242862805724144, 0.2771132290363312, -0.18822228908538818, -0.20600751042366028, 0.371299147605896, -0.4005110561847687, -0.1634119153022766, -0.5989546179771423, -0.11375734955072403, 0.7479038834571838, -0.48788610100746155, -0.15702809393405...
overriden (remove the virtual modifier). The problem here is that the implementer has to be aware that the method could be called with a null description and has to handle that situation. I think the best option is the third one... How is this scenario handled in general? When you design an abstract class and it con...
[ 0.12722261250019073, -0.21533401310443878, 0.037921346724033356, -0.033203475177288055, -0.01820671558380127, -0.1741124391555786, 0.33539879322052, -0.42959463596343994, 0.013047873042523861, -0.3077588975429535, -0.3222017288208008, 0.778714656829834, -0.46669238805770874, 0.343698501586...
{ public abstract constructor(name); public final constructor(name, description) { constructor(name) this.set_description(description) } private final set_description(description) { ... } } ``` There's a rule in Java that supports this decision: "never call non-final methods from a constructor...
[ 0.02368093468248844, -0.10114356875419617, 0.10109218955039978, -0.2687390446662903, 0.02487497217953205, -0.1696038395166397, 0.26455825567245483, -0.31529343128204346, -0.21623395383358002, -0.45790085196495056, -0.47096288204193115, 0.5192060470581055, -0.3156268894672394, 0.21494549512...
I need debug some old code that uses a Hashtable to store response from various threads. I need a way to go through the entire Hashtable and print out both keys and the data in the Hastable. How can this be done? ``` foreach(string key in hashTable.Keys) { Console.WriteLine(String.Format("{0}: {1}", key, hashTable...
[ 0.09695784002542496, 0.12062026560306549, 0.5010582208633423, -0.1097809299826622, 0.26495814323425293, -0.06806472688913345, 0.3883771300315857, -0.407264769077301, 0.0541665181517601, -0.7208430171012878, -0.0654948353767395, 0.5984880924224854, -0.3505394160747528, 0.529878556728363, ...
User equals untrustworthy. Never trust untrustworthy user's input. I get that. However, I am wondering when the best time to sanitize input is. For example, do you blindly store user input and then sanitize it whenever it is accessed/used, or do you sanitize the input immediately and then store this "cleaned" version? ...
[ 0.06973139941692352, 0.25723668932914734, 0.015918266028165817, 0.17386575043201447, -0.20277969539165497, -0.22869324684143066, 0.2965583801269531, -0.28276941180229187, 0.12556882202625275, -0.6922730207443237, 0.4204515814781189, 0.5786287188529968, -0.44554322957992554, 0.3576513528823...
way, what method do people think is best, and for what reasons? I like to sanitize it as early as possible, which means the sanitizing happens when the user tries to enter in invalid data. If there's a TextBox for their age, and they type in anything other that a number, I don't let the keypress for the letter go throu...
[ 0.21357883512973785, 0.26735618710517883, 0.2907154858112335, 0.14832785725593567, 0.39154067635536194, -0.3363424837589264, 0.5844975709915161, 0.10058346390724182, -0.4037964344024658, -0.5243276357650757, -0.00031098860199563205, 0.01984993927180767, 0.16660745441913605, 0.1586355865001...
packets!) Edit: Overall, sanitize early and sanitize any time you've lost sight of the data for even a second (e.g. File Save -> File Open)
[ 0.10873245447874069, -0.3336607813835144, 0.3894865810871124, 0.21348847448825836, 0.0013948897831141949, -0.24540430307388306, 0.499723345041275, -0.18177583813667297, -0.2148868590593338, -0.8896833062171936, -0.3137494921684265, 0.2736552655696869, -0.21591918170452118, -0.0367479287087...
The manual page for `XML::Parser::Style::Objects` is horrible. A simple hello world style program would really be helpful. I really wanted to do something like this: (not real code of course) ``` use XML::Parser; my $p = XML::Parser->new(Style => 'Objects', Pkg => 'MyNode'); my $tree = $p->parsefile('foo.xml'); $tree...
[ 0.07454060763120651, -0.06238609179854393, 0.5592189431190491, 0.16279920935630798, -0.02430541254580021, -0.23934383690357208, 0.3930540978908539, -0.1400393396615982, -0.06868257373571396, -0.6359313130378723, -0.31353890895843506, 0.7719935774803162, -0.32811424136161804, -0.13307510316...
... ``` use XML::Parser; package MyNode::inner; sub doSomething { my $self = shift; print "This is an inner node containing : "; print $self->{Kids}->[0]->{Text}; print "\n"; } package MyNode::Characters; sub doSomething {} package MyNode::foo; sub doSomething { my $self ...
[ -0.1892957091331482, -0.1344626098871231, 0.28759366273880005, -0.1275455206632614, 0.3032737374305725, 0.11127204447984695, 0.08106837421655655, -0.04862232133746147, 0.05659860000014305, -0.6661901473999023, -0.5251390337944031, 0.614539623260498, -0.25134944915771484, -0.253926903009414...
$kid->doSomething(); } } package main; my $p = XML::Parser->new(Style => 'Objects', Pkg => 'MyNode'); my $tree = $p->parsefile('foo.xml'); for (@$tree) { $_->doSomething(); } ``` with foo.xml ``` <foo> <inner>some text</inner> <inner>something else</inner></foo> ``` which outputs ``` >perl -w "tr...
[ 0.2264357954263687, -0.12117719650268555, 0.39313167333602905, -0.037368498742580414, 0.24891993403434753, -0.0001409191027050838, 0.2937183976173401, -0.23096179962158203, 0.15507937967777252, -0.7611436247825623, -0.3468181788921356, 0.7014042735099792, -0.13708040118217468, -0.223455384...
What is the best way to create a lock on a file in Perl? Is it best to flock on the file or to create a lock file to place a lock on and check for a lock on the lock file? If you end up using flock, here's some code to do it: ``` use Fcntl ':flock'; # Import LOCK_* constants # We will use this file path in error mes...
[ 0.5637502074241638, -0.10502205044031143, 0.3195475935935974, -0.03623867779970169, 0.034594450145959854, -0.2566213011741638, 0.3020695745944977, -0.35387611389160156, -0.1386028528213501, -0.3346904218196869, 0.3336365222930908, 0.7299190163612366, -0.6483880281448364, -0.251126408576965...
the error message. This helps debug situations where you # have a stray space at the start or end of the path. open(my $fh, '>>', $file) or die "Could not open '$file' - $!"; # Get exclusive lock (will block until it does) flock($fh, LOCK_EX) or die "Could not lock '$file' - $!"; # Do something with the file here......
[ 0.22265852987766266, -0.22364453971385956, 0.29183536767959595, -0.06056452915072441, 0.3304924964904785, -0.24722985923290253, 0.7973352670669556, -0.307646781206131, -0.02429785765707493, -0.4454303979873657, -0.0804065689444542, 0.5876244306564331, -0.41813719272613525, -0.0831306725740...
data. # In a world of buffered i/o, some or all of your data may not # be written until close() completes. Always, always, ALWAYS # check the return value of close() if you wrote to the file! close($fh) or die "Could not write '$file' - $!"; ``` Some useful links: * [PerlMonks file locking tutorial](http://www.p...
[ 0.2977275848388672, 0.07261087745428085, 0.6879675388336182, -0.07466814666986465, 0.34762874245643616, -0.28136250376701355, 0.3516453802585602, -0.1942771077156067, -0.32459038496017456, -0.33938509225845337, -0.4130072593688965, 0.5359163284301758, -0.38293102383613586, 0.14120927453041...
semantics).
[ -0.1129932701587677, -0.07686292380094528, -0.1359730064868927, 0.007545969914644957, -0.09089433401823044, 0.6420413255691528, 0.3329300880432129, -0.40704554319381714, -0.05792054161429405, -0.26002782583236694, -0.28148820996284485, 0.49490678310394287, -0.3754972219467163, 0.0237760804...
Is it possible to do 3.1 or 5.1 audio using Flash? We're starting a project here for an interactive kiosk, and we've been told to use Flash. However, we also have a requirement to support either 3.1 or 5.1 audio (where 5.1 is the most wanted feature). I haven't done any high-tech audio stuff using Flash, so I was won...
[ 0.4490698277950287, 0.0300136748701334, 0.3203945457935333, 0.2393246740102768, 0.08448822051286697, -0.3514498174190521, 0.1414734274148941, -0.15416496992111206, -0.0867188349366188, -0.3441508114337921, -0.005684313364326954, 0.7173107862472534, -0.0887763649225235, -0.04945331439375877...
Flash to handle the audio side of things. I also found this blog entry from Summit Projects <http://summitprojectsflashblog.wordpress.com/2008/08/07/wave-theory-in-actionscript-3-part-4/> where they go into great detail about byte handling and processing audio samples. I'm not sure if they are using their own actionsc...
[ 0.19349846243858337, 0.16316622495651245, -0.02027743123471737, 0.28241175413131714, -0.39123550057411194, -0.3202788829803467, 0.013200351968407631, -0.2310938686132431, -0.21238411962985992, -0.4354434013366699, -0.16165289282798767, 0.839038074016571, 0.009177884086966515, -0.4382299184...
as lost as I am over some of the concepts they touch on, heh. Good luck!
[ 0.43773558735847473, 0.7542973756790161, 0.3388073444366455, 0.16011247038841248, 0.07846532762050629, -0.3289567828178406, 0.33057868480682373, 0.7736626863479614, -0.17776110768318176, -0.4078045189380646, -0.16348624229431152, 0.09349789470434189, 0.7668487429618835, 0.3738383948802948,...
When building projects in C++, I've found debugging linking errors to be tricky, especially when picking up other people's code. What strategies do people use for debugging and fixing linking errors? Not sure what your level of expertise is, but here are the basics. Below is a linker error from VS 2005 - yes, it's a ...
[ 0.27819591760635376, 0.45416027307510376, 0.15157334506511688, -0.032804299145936966, -0.056651610881090164, -0.16844691336154938, 0.19576683640480042, -0.2529241442680359, -0.285934716463089, -0.5227451920509338, -0.05954432860016823, 0.436695396900177, -0.4187832474708557, -0.03545778617...
ByteComparator.cpp file, this is the source of the linker problem * "int \_\_cdecl does\_not\_exist(void)" - This is the symbol it couldn't find, in this case a function named does\_not\_exist() At this point, in many cases the fastest way to resolution is to search the code base for this function and find where the i...
[ 0.11162090301513672, -0.12973815202713013, 0.34434622526168823, 0.06301940232515335, -0.028721189126372337, 0.014170916751027107, 0.12615422904491425, 0.1425909698009491, -0.4551199674606323, -0.5239813327789307, 0.12502628564834595, 0.45067280530929565, -0.5433608293533325, 0.293244451284...
called with a bunch of .o files) and add the missing .o file. --- In a second scenario, you may be missing an "external" dependency, which you don't have code for. The Win32 libraries are often times implemented in static libraries that you have to link to. In this case, go to [MSDN](http://msdn.microsoft.com/en-us/d...
[ 0.10447379946708679, -0.06483049690723419, 0.3031714856624603, 0.1819644421339035, 0.077900730073452, -0.22884799540042877, 0.161542609333992, 0.025600681081414223, -0.28759974241256714, -0.6701772212982178, -0.34112709760665894, 0.4049396216869354, -0.4029776155948639, 0.32217925786972046...
I'm the second dev and a recent hire here at a PHP/MySQL shop. I was hired mostly due to my experience in wrangling some sort of process out of a chaotic mess. At least, that's what I did at my last company. ;) Since I've been here (a few months now), I've brought on board my boss, my product manager and several other...
[ 0.7130020260810852, 0.2302708774805069, -0.10801529139280319, -0.14358238875865936, -0.09414352476596832, 0.08614242076873779, -0.11101006716489792, 0.3332401216030121, -0.49312978982925415, -0.5299052000045776, 0.004163178615272045, 0.4397672712802887, 0.5961204171180725, -0.1178989261388...
However, my coworker (the only other dev here for now) is not into it. She prefers to close her door and focus on her work and be left alone. Me? I'm into the whole Agile approach of collaboration, cooperation and openness. Without her input, I started the Scrum practices (daily scrums, burndown charts and other things...
[ 0.5584133267402649, 0.2341432422399521, -0.4526739716529846, -0.1845695972442627, -0.32137033343315125, 0.033980630338191986, 0.5906684398651123, 0.09496930241584778, -0.30720481276512146, -0.4878607988357544, 0.43484193086624146, 0.33834609389305115, 0.2018580138683319, -0.384045243263244...
never seen such resistance. Question... how do I get her onboard? Peer pressure is not working. Thanks from fellow Scrum-borg, beaudetious While Scrum other agile methodologies like it embody a lot of good practices, sometimes giving it a name and making it (as many bloggers have commented on) a "religion" that mus...
[ 0.5613531470298767, -0.024285372346639633, 0.006716966163367033, 0.04129871726036072, -0.017879607155919075, 0.05515424534678459, 0.4783901572227478, 0.08488254249095917, -0.1616702526807785, -0.3689217269420624, 0.26139530539512634, 0.3515605628490448, 0.07040365785360336, 0.0240695960819...
the practices one at a time, by showing her how they can improve her life and workflow as well. Programmers love cool things that help them get stuff done. They hate being preached at or being asked to board what they see as a bandwagon. Present it as the former rather than the latter. (It goes without saying, make su...
[ 0.8623340129852295, -0.176100492477417, -0.0330086275935173, 0.07842207700014114, -0.05678389221429825, -0.06880133599042892, 0.47732797265052795, -0.0028339875862002373, -0.203287735581398, -0.342014878988266, 0.37182483077049255, 0.493089884519577, 0.36259928345680237, -0.213718101382255...
dogma (best of both worlds, IMHO). But I was just reading about Scrum and, is a system like that even beneficial for a 2 person team? Scrum does add a certain amount of overhead to a project, it seems, and that might outweigh the benefits when you have a very small team where communication and planning is already eas...
[ 0.3238617479801178, -0.17041568458080292, -0.5326934456825256, 0.3438093066215515, -0.284356951713562, -0.3023245334625244, 0.7442546486854553, -0.35137027502059937, -0.08626235276460648, -0.2560175657272339, 0.29453393816947937, 0.42849040031433105, -0.31194302439689636, -0.30995908379554...
We have some really old code that calls WebServices using behaviours (webservice.htc), and we are having some strange problems... since they've been deprecated a long time ago, I want to change the call. What's the correct way of doing it? It's ASP.NET 1.1 You should be able to generate a proxy class using wsdl.exe. T...
[ 0.4515816867351532, -0.09582751989364624, 0.33562102913856506, 0.08353724330663681, -0.2231592983007431, -0.36726635694503784, 0.4689234495162964, 0.16558992862701416, -0.3642221689224243, -0.557636559009552, 0.20519617199897766, 0.343688428401947, -0.3171572983264923, 0.2996649146080017, ...
**Is there anything built into the core C# libraries that can give me an immutable Dictionary?** Something along the lines of *Java's*: ``` Collections.unmodifiableMap(myMap); ``` And just to clarify, I am not looking to stop the keys / values themselves from being changed, just the structure of the Dictionary. I ...
[ 0.3152039051055908, -0.06252915412187576, 0.32812216877937317, -0.10633370280265808, -0.03248794004321098, -0.12132231891155243, 0.3504946231842041, -0.277381032705307, -0.04857714846730232, -0.6092665195465088, -0.23616330325603485, 0.7100124955177307, -0.41271939873695374, -0.02096792683...
_dict = backingDict; } public void Add(TKey key, TValue value) { throw new InvalidOperationException(); } public bool ContainsKey(TKey key) { return _dict.ContainsKey(key); } public ICollection<TKey> Keys { get { return _dict.Keys; } } public bool ...
[ 0.3263149857521057, -0.17635399103164673, 0.45290407538414, -0.25738948583602905, 0.03669670596718788, 0.12263819575309753, 0.3145175278186798, -0.19024658203125, -0.16224828362464905, -0.24448813498020172, -0.5291932225227356, 0.44598492980003357, -0.4447998106479645, 0.37391602993011475,...
throw new InvalidOperationException(); } public bool TryGetValue(TKey key, out TValue value) { return _dict.TryGetValue(key, out value); } public ICollection<TValue> Values { get { return _dict.Values; } } public TValue this[TKey key] { get { return _dict[k...
[ 0.32564857602119446, -0.37994349002838135, 0.5977707505226135, -0.27050554752349854, -0.04644132778048515, 0.08540666848421097, 0.3827044367790222, -0.18094003200531006, -0.18066968023777008, -0.7349229454994202, -0.3920644223690033, 0.6844499707221985, -0.41462284326553345, 0.306346803903...
} public void Add(KeyValuePair<TKey, TValue> item) { throw new InvalidOperationException(); } public void Clear() { throw new InvalidOperationException(); } public bool Contains(KeyValuePair<TKey, TValue> item) { return _dict.Contains(item); } public v...
[ 0.30774036049842834, -0.13816414773464203, 0.5104358196258545, -0.27411091327667236, 0.17640432715415955, 0.03789163753390312, 0.22235549986362457, -0.39764824509620667, -0.14036059379577637, -0.38850927352905273, -0.4769671559333801, 0.6731027960777283, -0.5295693874359131, 0.304349482059...
_dict.CopyTo(array, arrayIndex); } public int Count { get { return _dict.Count; } } public bool IsReadOnly { get { return true; } } public bool Remove(KeyValuePair<TKey, TValue> item) { throw new InvalidOperationException(); } public IEnumerator<Ke...
[ 0.05530957877635956, -0.11647074669599533, 0.47086331248283386, -0.26741066575050354, -0.02780458889901638, 0.06666149944067001, 0.4841203987598419, -0.43996739387512207, -0.1585899442434311, -0.4548904597759247, -0.5607128143310547, 0.48684027791023254, -0.3972809910774231, 0.295503616333...
return _dict.GetEnumerator(); } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return ((System.Collections.IEnumerable)_dict).GetEnumerator(); } } ``` Obviously, you can change the this[] setter above if you want to allow modifying values.
[ -0.0430108904838562, -0.21319302916526794, 0.21614333987236023, -0.12055141478776932, 0.261849045753479, -0.1741466373205185, 0.20370922982692719, -0.16649331152439117, -0.13489742577075958, -0.5655583739280701, -0.37238866090774536, 0.6634488105773926, -0.43889209628105164, 0.170096293091...
Every time I create an object that has a collection property I go back and forth on the best way to do it? 1. public property with a getter that returns a reference to private variable 2. explicit get\_ObjList and set\_ObjList methods that return and create new or cloned objects every time 3. explicit get\_ObjList tha...
[ 0.28758811950683594, 0.029171528294682503, 0.25727203488349915, 0.22548264265060425, -0.08683338761329651, 0.005939013324677944, 0.173551544547081, -0.35687723755836487, -0.13963833451271057, -0.8015490174293518, -0.07146006077528, 0.49650660157203674, -0.3759269118309021, 0.29513317346572...
as a reference the internals of that child can be changed without the parent "knowing" unless the child has a property changed event. Is there a risk for memory leaks? And, don't options 2 and 3 break serialization? Is this a catch 22 or do you have to implement custom serialization anytime you have a collection prope...
[ 0.43231630325317383, -0.15696106851100922, 0.3631310760974884, 0.34641751646995544, 0.2672828733921051, -0.2606915533542633, -0.10052350163459778, -0.21972915530204773, -0.6676672101020813, -0.47260355949401855, -0.05468440428376198, 0.1337299346923828, -0.34309983253479004, 0.486724972724...
is modified, then just expose it as a public accessor over a private variable per #1. If you don't want other programs to modify the collection then #2 and/or #3 is better. Implicit in the question is why should one method be used over another and what are the ramifications on security, memory, serialization, etc.? Ho...
[ 0.39464104175567627, -0.11887814104557037, 0.125033438205719, 0.1529172956943512, -0.09088306128978729, -0.12340486794710159, 0.2160288244485855, -0.25536221265792847, -0.15662044286727905, -0.7027888894081116, -0.4520682394504547, 0.5671821236610413, -0.3953041732311249, 0.262559175491333...
...; public Collection<T> MyCollection { get { return this.myCollection_; } } ``` This strategy is used for the `Items` collections on the WindowsForms and WPF `ItemsControl` controls, where users add and remove items they want the control to display. These controls publish the actual collection and use callbacks o...
[ 0.15448684990406036, -0.1854851394891739, 0.42534926533699036, 0.1002199649810791, 0.1865486204624176, -0.1641717255115509, 0.10700114816427231, -0.5075698494911194, -0.32343360781669617, -0.49552518129348755, -0.46199530363082886, 0.46700841188430786, -0.02746180072426796, 0.1088747680187...
object, then you can use a readonly collection, as [Quibblesome](https://stackoverflow.com/questions/35007/how-to-expose-a-collection-property#35065) suggested: ``` private readonly List<T> myPrivateCollection_ = new ...; private ReadOnlyCollection<T> myPrivateCollectionView_; public ReadOnlyCollection<T> MyCollection...
[ -0.05079135671257973, -0.1893998086452484, 0.6263967752456665, 0.047962408512830734, -0.0625852420926094, 0.01852012611925602, 0.24169500172138214, -0.3240814805030823, -0.349223792552948, -0.7818254828453064, -0.3115360736846924, 0.6280598044395447, -0.18314996361732483, 0.332397729158401...
{ foreach( T item in this.myPrivateCollection_ ) yield return item; } } ``` This approach is simple to implement and also provides access to all the members without exposing the internal collection. However, it does require that the collection remain unmodfied, as the BCL collection classes will throw an ...
[ 0.19685393571853638, 0.06919881701469421, 0.20890913903713226, -0.08606612682342529, 0.18043597042560577, -0.29158344864845276, 0.36572882533073425, -0.3935320973396301, -0.18052919209003448, -0.523122251033783, -0.4941449463367462, 0.49953776597976685, -0.35585644841194153, 0.229584500193...
to expose arrays rather than higher-level collections, then you should return a copy of the array to prevent users from modifying it (option #2 from the orginal question): ``` private T[] myArray_; public T[] GetMyArray( ) { T[] copy = new T[this.myArray_.Length]; this.myArray_.CopyTo( copy, 0 ); return copy; ...
[ 0.47318390011787415, 0.12472507357597351, 0.199075385928154, -0.09397704154253006, 0.1159004345536232, -0.25764426589012146, 0.3748630881309509, -0.22069500386714935, -0.20553997159004211, -0.6521381735801697, -0.25981321930885315, 0.7126857042312622, -0.5265865921974182, 0.239701256155967...
either add a corresponding `SetMyArray( T[] array )` method, or use a custom indexer: ``` public T this[int index] { get { return this.myArray_[index]; } set { // TODO: validate new value; raise change event; etc. this.myArray_[index] = value; } } ``` (of course, by implementing a custom indexer, you w...
[ 0.07348141819238663, -0.35751864314079285, 0.2407665103673935, -0.01927713304758072, -0.04027879610657692, -0.10953657329082489, 0.1382521241903305, -0.40623387694358826, -0.1467207968235016, -0.3913803696632385, -0.2815099060535431, 0.5684221386909485, -0.4939655661582947, 0.2521863877773...
Is it possible to do image processing in silverlight 2.0? What I want to do is take an image, crop it, and then send the new cropped image up to the server. I know I can fake it by clipping the image, but that only effects the rendering of the image. I want to create a new image. After further research I have answere...
[ 0.5182706713676453, 0.104694664478302, 0.4067155122756958, 0.1885293871164322, -0.348866730928421, -0.34964048862457275, 0.2647871673107147, -0.20724967122077942, -0.244228333234787, -0.6400870680809021, 0.32230493426322937, 0.5505936145782471, -0.20258371531963348, -0.0929003357887268, ...
2... But there are no built in classes to help you. But you can load any image into a byte array, and start manipulating it, or implement your own image encoder. Joe Stegman got lots of great information about "editable images" in Silverlight over at <http://blogs.msdn.com/jstegman/>. He does things like applying filt...
[ 0.37057703733444214, -0.16855452954769135, 0.2129892110824585, 0.15230657160282135, -0.5700551271438599, -0.2674087584018707, 0.08002188801765442, -0.3305603861808777, -0.3647632896900177, -0.9500018954277039, 0.21422211825847626, 0.4938953220844269, -0.5002521872520447, -0.151962786912918...
definetly be done in Silverilght 2. Happy hacking!
[ 0.6679542660713196, -0.14094918966293335, -0.01765287108719349, -0.08350107818841934, 0.01656702347099781, -0.3854644000530243, 0.1683652400970459, 0.0741972103714943, 0.016316907480359077, -0.6571818590164185, -0.01063195988535881, 0.6016647815704346, -0.05589422211050987, -0.202749297022...
I'm getting a `NoSuchMethodError` error when running my Java program. What's wrong and how do I fix it? Without any more information it is difficult to pinpoint the problem, but the root cause is that you most likely have compiled a class against a different version of the class that is missing a method, than the one y...
[ 0.028843466192483902, 0.4202905297279358, -0.07369647175073624, -0.03134967014193535, 0.0754399299621582, -0.08362802863121033, 0.6483399271965027, -0.06386679410934448, -0.2695493698120117, -0.7425439357757568, 0.09226992726325989, 0.47345590591430664, -0.29500043392181396, 0.222858533263...
right version both places. If the exception appears when calling a method on objects instantiated by classes *you* made, then your build process seems to be faulty. Make sure the class files that you are actually running are updated when you compile.
[ 0.1629045158624649, -0.22847136855125427, 0.1289646327495575, 0.005999207496643066, -0.007356874644756317, -0.3369464874267578, 0.571478009223938, 0.0650026872754097, -0.13905715942382812, -0.6627211570739746, -0.2174396961927414, 0.8938663005828857, -0.11021758615970612, -0.01687638275325...
I'm working on a side project that would be a simple web application to maintain a list of classes and their upcoming schedules. I would really like to use Linq to SQL for this project, but unfortunately the server environment I'm developing for only has MySql available. I've dabbled briefly with Subsonic but it just ...
[ 0.5118541121482849, 0.23350666463375092, 0.176042377948761, 0.14365629851818085, 0.20626579225063324, -0.006226153578609228, 0.13639189302921295, 0.2941170632839203, -0.06185775622725487, -0.5923916101455688, 0.45753878355026245, 0.42419299483299255, -0.0816340446472168, 0.1971985250711441...