text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
problem; it's definitely one of the reasons many third-party packages won't work as-is, even if they are pure Python. (In some cases they can be tweaked and massaged into working with judicious use of encoding and decoding.) Supposedly 2.5 uses ASCII natively, which would in principle improve compatibility, but I have ...
[ 0.20637118816375732, 0.27314960956573486, -0.002527233911678195, -0.09656592458486557, -0.043220747262239456, -0.39390450716018677, 0.30856937170028687, 0.32315793633461, -0.03537068888545036, -0.5578396320343018, -0.09881722927093506, 0.5920466780662537, -0.3505812883377075, 0.18079583346...
would affect you depends on what you're trying to do. On the plus side, the iSeries-specific features work quite well. It's very easy to work with physical files as well as stream files. Calling CL or RPG programs from Python is fairly painless. On balance, I find iSeries Python to be highly usable and very worthwhile...
[ 0.39426860213279724, -0.0665106251835823, 0.10583838075399399, -0.20001618564128876, 0.008175695315003395, -0.2097521722316742, 0.057680029422044754, 0.051305245608091354, -0.1505892127752304, -0.48207297921180725, 0.039279207587242126, 0.707003116607666, -0.07626931369304657, -0.436106383...
has gotten Django working on the i. As expected, the move to native ASCII strings solves a lot of the EBCDIC problems and greatly increases compatibility with third-party packages. I enthusiastically recommend iSeries Python 2.7 for anyone on V5R3 or later. (I still strongly recommend iSeries Python 2.3.3 for those who...
[ 0.2372191846370697, 0.3504113554954529, 0.3398861289024353, -0.20749007165431976, -0.1438010334968567, -0.6096556186676025, 0.2026101052761078, 0.3374064266681671, -0.3089922368526459, -0.5186961889266968, -0.09355754405260086, 0.34778571128845215, -0.11887780576944351, 0.09876009076833725...
old (pre-7.2) versions of the operating system. For those who are on 7.2 or newer, there is a Python for PASE from IBM, which should be considered the preferred way to run Python on the midrange platform. This version of Python is part of a [growing ecosystem of open source software on IBM i](https://ibmi-oss-docs.read...
[ 0.08458851277828217, -0.11020786315202713, 0.32678335905075073, -0.1525581330060959, 0.1172376200556755, -0.058620549738407135, 0.28140774369239807, 0.3232435882091522, -0.2990785837173462, -0.35725319385528564, -0.24016590416431427, 0.3640790283679962, -0.25452694296836853, 0.047984875738...
We've got a regular (i.e. not extended) stored procedure in SQL Server **2000** that calls an external exe. That exe, in turn, loads a .dll that came from an SDK and calls some procedures from it (i.e. Init, DoStuff, Shutdown). The only reason we have this external exe thing is because we didn't want to create an exte...
[ 0.13236761093139648, 0.07904527336359024, 0.19655804336071014, 0.06898175179958344, -0.03751789778470993, -0.4043920338153839, 0.025733323767781258, 0.07350083440542221, -0.31644877791404724, -0.3775861859321594, -0.17169605195522308, 0.589529275894165, -0.4859755039215088, 0.3590357601642...
we're upgrading to SQL Server **2008** and considering creating a CLR stored procedure that calls the thing and therefore getting rid of the exe. This SP would be marked as UNSAFE, of course. The question therefor is, is it safe (safer, safe enough etc.) to do it that way as compared to the extended SP approach? The o...
[ 0.38287752866744995, 0.3109324872493744, 0.18784360587596893, -0.1200232207775116, 0.15633679926395416, -0.43857431411743164, 0.5372918248176575, -0.1349799633026123, 0.030183568596839905, -0.2274816334247589, -0.21411508321762085, 0.61162269115448, -0.3119858503341675, 0.13587144017219543...
but I'm not sure whether it answers my question as I'm not after 'robustness and scalability', rather after stability and keeping the thing up and running. PS: We want to get rid of the exe because it causes inconviniences when managing SP permissions (you know, that stuff that suddenly applies to you if you call a SP...
[ 0.1724623292684555, 0.07184623926877975, 0.49514445662498474, 0.1170685887336731, 0.12785111367702484, -0.4493933916091919, 0.3383454978466034, -0.07100813090801239, -0.14835992455482483, -0.40586569905281067, -0.3159200847148895, 0.4951959550380707, -0.41334596276283264, 0.043087653815746...
errors can take down or corrupt SQL Server. (For comparison, in theory, a SAFE CLR routine won't be able to corrupt SQL Server although even it could cause problems that reduce your server's availability without totally taking down the SQL Server.) Basically, the only ways to not crash SQL Server in this scenario are:...
[ 0.07946102321147919, 0.3978125751018524, 0.10145919024944305, 0.5132716298103333, 0.17365142703056335, -0.0412750169634819, 0.5838534832000732, 0.19438070058822632, -0.12195008248090744, -0.5067850351333618, 0.10454444587230682, 0.8429783582687378, -0.4716656804084778, 0.14385399222373962,...
load it UNSAFE, but--if it is written properly--in reality it can be quite safe.
[ 0.3502347767353058, 0.1805710643529892, -0.16935311257839203, 0.22256514430046082, 0.16206496953964233, -0.29784393310546875, 0.25191736221313477, -0.026979561895132065, -0.13912640511989594, -0.05580119788646698, -0.0838148444890976, 0.6091353893280029, -0.29556673765182495, -0.4172240197...
I want to conditionally link a CSS file base on the user's Membership role. An administrator should link my admin.css file while everybody else (other roles and anonymous users) should display my global.css file. Can this be done? Try [this](http://www.aspdotnetfaq.com/Faq/How-to-Programmatically-add-CSS-Stylesheet-fil...
[ 0.4282374083995819, -0.048673681914806366, 0.6227043867111206, -0.04757579416036606, -0.11502857506275177, -0.027255728840827942, 0.28569528460502625, -0.26417550444602966, -0.08155026286840439, -0.6719453930854797, -0.1795720010995865, 0.2925920784473419, -0.2611437439918518, 0.0683727711...
Page.Header.Controls.Add(css); } ```
[ 0.04391210898756981, 0.21673734486103058, 0.2704811692237854, -0.2539880573749542, 0.035585835576057434, -0.2282535284757614, 0.0035509238950908184, 0.18005181849002838, -0.22069603204727173, -0.6043224930763245, -0.4082336723804474, 0.4495609700679779, -0.6104071140289307, 0.2068626284599...
My goal is use the .NET DateTime object (in C#) and have that be serialized to and parsed from a string (for use in XML) in a way that is standards compliant. The specific standard I have in mind is the ISO 8601 standard for representing dates and times. I want an easy to use solution (preferably, one method call each...
[ 0.27171358466148376, 0.018151944503188133, 0.5980188846588135, -0.059064093977212906, -0.0331832580268383, -0.31241053342819214, -0.05818271264433861, 0.30060839653015137, -0.011774653568863869, -0.750271737575531, 0.1200719103217125, 0.2197977900505066, -0.09044297784566879, 0.19858275353...
found a solution to this problem several years ago which involves a custom format and the DateTime.ToString(string) method. I was surprised that a simpler standards compliant solution didn't exist. Using a custom format string to serialize and parse in a standards compliant way smells a little to me. Fortunately, there...
[ 0.15571127831935883, -0.32765474915504456, 0.6781264543533325, -0.041296444833278656, -0.10125891864299774, -0.24818603694438934, 0.026773786172270775, -0.26185742020606995, -0.10422495752573013, -0.674831211566925, -0.10781799256801605, 0.6495897769927979, -0.3676337003707886, 0.235162809...
I have a file I need to write to a temp location, what is the best place in Windows? This file needs to not move as I need to read it a couple of times and dispose it when I close the program. use ``` Path.GetTempPath(); ``` or ``` Path.GetTempFileName(); ``` As commentator pointed out, GetTempFileName() is not ...
[ 0.299661248922348, 0.036055296659469604, 0.30074092745780945, -0.07650837302207947, 0.10668129473924637, -0.23478733003139496, 0.2843502163887024, -0.0334516316652298, -0.19001096487045288, -0.9064682722091675, -0.09802167117595673, 0.4046313762664795, -0.354282021522522, 0.286025196313858...
We are attempting to rewrite some URLs in our response for an outside proxy server. We noticed that the response is being broken up as it goes through the response filter. We then use regular expressions to locate the URLs and rewrite them. The issue we ran into is that the way that it is broken up (not exactly sure ho...
[ 0.184181809425354, -0.06040666997432709, 0.3518870770931244, 0.1552998125553131, -0.2999759018421173, 0.003273086855188012, 0.3304460942745209, -0.021684587001800537, -0.33239468932151794, -0.6471424698829651, -0.28209346532821655, 0.08580216020345688, -0.2963835597038269, 0.33589267730712...
our regular expression doesn't pick up the link as a valid URL. We tried pooling our response into a StringBuilder to make sure we have the whole response before we attempt to rewrite the URLs, but that is resulting in the viewstate being corrupted. Any ideas? Not with your own custom code, in C#. From section 10.1.4 o...
[ 0.4023592472076416, -0.0079136798158288, 0.3764721155166626, 0.174800306558609, -0.13951455056667328, -0.15040598809719086, 0.27233263850212097, -0.060862474143505096, -0.19271086156368256, -0.5069403648376465, -0.27560344338417053, 0.5052863955497742, -0.3874087929725647, 0.21659438312053...
or > indirect base class. However, every time you create a delegate type, that automatically derives from `MulticastDelegate`. From [ECMA-335](http://www.ecma-international.org/publications/standards/Ecma-335.htm), section 8.9.3: > While, for the most part, delegates > appear to be simply another kind of > user-d...
[ 0.2955935597419739, -0.041127726435661316, 0.32961219549179077, 0.4376848042011261, -0.2715498208999634, -0.16730870306491852, 0.004303178284317255, -0.29028043150901794, -0.1351618468761444, -0.6649541258811951, -0.13214357197284698, 0.33803045749664307, -0.2155298888683319, 0.28156819939...
There are two projects in one VS solution: client(wpf app) and а wcf service lib. I'm using Message security and a custom AspNetMembershipPrivider on th server side to validate username and pass. As i'm not using Windows security, I had to use certificate on server to establish secure chanell, and what i did: ...
[ 0.3894084095954895, -0.2827187180519104, 0.7236664295196533, 0.0721551850438118, -0.41274815797805786, 0.1971154361963272, 0.3748517632484436, -0.328264981508255, -0.368965744972229, -0.8084504008293152, 0.0762937143445015, 0.47595304250717163, -0.11914129555225372, 0.25472456216812134, ...
(and VS also started wcfhost app for my wcf lib) Everything was fine, wcfhost worked fine and my services worked ok until I rebooted. After reboot wcfhost stated complaining: ``` The certificate 'CN=xxx' must have a private key that is capable of key exchange. The process must have access rights for the private ...
[ 0.08217940479516983, 0.35455086827278137, 0.7649447917938232, -0.026876816526055336, -0.04124930128455162, -0.1902793049812317, 0.5622599720954895, -0.13217313587665558, -0.26957809925079346, -0.6042594909667969, -0.021806249395012856, 0.7422524690628052, -0.16174796223640442, 0.3632301986...
iis manager to create certificated and not makesert etc. is because I want tobe sure everything will be working on my shared osting account I have (there is on option in hosting panel of creating self-signed certificates). Can anyone assist with this? Thanks I solved the issue. I'm running Vista on my dev box wit...
[ 0.3746320605278015, -0.1493571698665619, 0.1996496170759201, 0.08662144839763641, -0.363522469997406, -0.4409411549568176, 0.6169916391372681, -0.08837618678808212, -0.18110765516757965, -0.927852213382721, 0.07781815528869629, 0.8245022892951965, -0.1304926723241806, 0.4014611840248108, ...
bad, I rarely restart VS, it is common practice having a VS running for a week or two with for example unreal3 lunched simultaniosly. By th way can anyone say will I have problems with access rights for the certificates on a shared hosting(IIS7) with Message security? or shall I target Transport security.
[ 0.43869245052337646, 0.10230793803930283, 0.3435988128185272, 0.022561021149158478, -0.32140427827835083, -0.29126814007759094, 0.5628544688224792, 0.41182762384414673, -0.4368881285190582, -0.577737033367157, 0.05132539942860603, 0.45996010303497314, 0.08036653697490692, 0.417536795139312...
**Dynamic Data Web Application** -------------------------------- **How do I change the default filter so that it displays more than 10 rows?** I recently created a Dynamic Data website to help manage a few dozen lookup tables for my business intelligence data warehouse and I am having trouble manipulating the templa...
[ 0.06857029348611832, -0.2578578591346741, 0.5964886546134949, 0.05692162737250328, -0.1912393867969513, 0.19798843562602997, 0.25870633125305176, 0.22553007304668427, -0.5832087993621826, -0.7276783585548401, 0.2618248760700226, 0.6957208514213562, -0.16359931230545044, -0.1465196311473846...
10 rows. How do I change the default number of rows displayed by the data grid in the standard template of a Dynamic Data website? If you open the ~/DynamicData/Content folder you will find the pager see **GridViewPager.ascx** You can edit this as this is the pager used on all gridviews, in the codebehind you will see ...
[ -0.003310189116746187, -0.05694318935275078, 0.5905500054359436, -0.11021753400564194, -0.002781430259346962, 0.47754111886024475, -0.0002252365811727941, -0.16588884592056274, -0.40410029888153076, -0.6629887819290161, 0.0220140740275383, 0.4796351194381714, -0.38313865661621094, 0.178865...
{ if (c is GridView) { _gridView = (GridView)c; break; } c = c.Parent; } ***_gridView.PageSize = 20;*** } ``` Add the line in BOLD ITALIC to set the initial page size and to change the page size value int he list box edit
[ 0.0756165087223053, -0.14498217403888702, 0.8197524547576904, -0.21033237874507904, -0.2237650603055954, 0.02945093810558319, -0.015311405062675476, -0.2673855423927307, -0.1666039526462555, -0.6840505003929138, -0.32360655069351196, 0.16706757247447968, -0.36600127816200256, 0.20154157280...
the page its self: ``` <asp:DropDownList ID="DropDownListPageSize" runat="server" AutoPostBack="true" CssClass="droplist" onselectedindexchanged="DropDownListPageSize_SelectedIndexChanged"> <asp:ListItem Value="5" /> <asp:ListItem Value="10" /> <asp:ListItem Value="15" /> <asp:ListItem V...
[ -0.33751508593559265, -0.04279836267232895, 1.06345534324646, -0.10100802779197693, -0.38325124979019165, 0.1620461791753769, 0.269234299659729, -0.19187869131565094, -0.4241620898246765, -0.6812756061553955, -0.39607325196266174, 0.14647620916366577, -0.1909351944923401, -0.02617955207824...
I would like to know how this query would be written if no joins were used. I been trying to figure it out for cases where joins aren't viable or can't be used(aren't available). ``` SELECT * FROM ( table1 INNER JOIN table2 ON table1.id = table2.id ) INNER JOIN table3 ON ( table1.id2 = table3.i...
[ -0.024852558970451355, 0.24463239312171936, 0.5546395182609558, -0.12715132534503937, -0.13458159565925598, -0.08850763738155365, 0.17586266994476318, -0.36213502287864685, -0.2952333390712738, -0.6956798434257507, 0.12589524686336517, 0.20200692117214203, -0.5669200420379639, 0.2118225991...
is impossible to extract data from two different tables without joining them in one way or another. You are using a JOIN statement BUT you can achieve the same thing by placing it in the where clause for example: ``` SELECT * FROM table1, table2 WHERE table1.id = table2.id AND ... ```
[ 0.04359399527311325, -0.030625376850366592, -0.024226024746894836, -0.10413757711648941, 0.13353921473026276, -0.17609018087387085, -0.017397716641426086, -0.25646236538887024, -0.10066546499729156, -0.35674652457237244, -0.10671793669462204, 0.14119696617126465, -0.35183724761009216, -0.0...
I tend to declare as static all the methods in a class when that class doesn't require to keep track of internal states. For example, if I need to transform A into B and don't rely on some internal state C that may vary, I create a static transform. If there is an internal state C that I want to be able to adjust, then...
[ 0.28566205501556396, -0.06710078567266464, -0.028732135891914368, -0.0372343510389328, -0.09002882987260818, -0.14914238452911377, 0.3390563428401947, -0.09874173998832703, -0.22473053634166718, -0.20141078531742096, -0.08249184489250183, 0.49473369121551514, -0.5171223282814026, 0.2840133...
rule of thumb above. Is that a reasonable approach or not? There are two kinds of common static methods: * A "safe" static method will always give the same output for the same inputs. It modifies no globals and doesn't call any "unsafe" static methods of any class. Essentially, you are using a limited sort of functio...
[ -0.0945444330573082, -0.18264392018318176, 0.009168545715510845, 0.3550248146057129, -0.07576368004083633, -0.18590852618217468, 0.366699755191803, 0.19095341861248016, -0.2985554039478302, -0.2991207242012024, -0.010506503283977509, 0.7193575501441956, -0.6668760180473328, 0.1698647886514...
of "unsafe" statics -- for example, in the Singleton pattern -- but be aware that despite any pretty names you call them, you're just mutating global variables. Think carefully before using unsafe statics.
[ 0.28116774559020996, 0.2608577311038971, -0.4020206034183502, 0.11191640794277191, -0.16639946401119232, -0.17908336222171783, 0.5074282288551331, 0.48134660720825195, -0.3798478841781616, -0.5798083543777466, -0.11721221357584, 0.7940623760223389, -0.6793442368507385, 0.22152544558048248,...
Is there a way to replace the call to Activator.CreateInstance() used inside NHibernate 2.0.1GA to construct the entities? Ideally I'd like to replace it with StructureMap.ObjectFactory.GetInstance(). You can't do this easily with constructor injection. The NHibernate internals may need to create a proxy object inherit...
[ 0.1452333629131317, -0.04958830028772354, 0.1632450819015503, -0.028150033205747604, -0.3398313522338867, -0.1444336175918579, 0.19822554290294647, -0.22278058528900146, -0.03231700509786606, -0.60066819190979, 0.3477160334587097, 0.7392554879188538, -0.5854326486587524, 0.2353834956884384...
is an example of this [here](http://devlicio.us/blogs/billy_mccafferty/archive/2007/02/05/inject-di-container-into-domain-objects-with-nhibernate.aspx). That example is using Windsor as the DI container, but you can do the same thing with StructureMap of course - [here are the relevant docs for StructureMap](http://str...
[ 0.23085041344165802, 0.00678943982347846, 0.07288556545972824, -0.05451781675219536, -0.040447596460580826, -0.5041967630386353, 0.27649441361427307, -0.32107114791870117, -0.28322580456733704, -0.3549421727657318, -0.02684692293405533, 0.4973961114883423, -0.6056546568870544, 0.1268941015...
Is it good to have all the setter functions return a reference to the object in c++? It's a usable enough pattern if there's a lot of things that need to be set on an object. ``` class Foo { int x, y, z; public: Foo &SetX(int x_) { x = x_; return *this; } Foo &SetY(int y_) { y = y_; return *this...
[ 0.32999250292778015, -0.044621486216783524, 0.31440192461013794, -0.12880857288837433, 0.2056993693113327, -0.30979907512664795, 0.19350995123386383, -0.07854501903057098, -0.0635102242231369, -0.40766698122024536, -0.30625656247138977, 0.6712563037872314, -0.7729551792144775, -0.016360701...
Foo foo; foo.SetX(1).SetY(2).SetZ(3); } ``` This pattern replaces a constructor that takes three ints: ``` int main() { Foo foo(1, 2, 3); // Less self-explanatory than the above version. } ``` It's useful if you have a number of values that don't always need to be set. For reference, a more comple...
[ 0.2390446811914444, 0.16282930970191956, 0.25992146134376526, -0.474347859621048, -0.37570735812187195, -0.03985368460416794, 0.15155473351478577, -0.5827699303627014, -0.3831424415111542, -0.004067253787070513, -0.14121602475643158, 0.6870794296264648, -0.751975953578949, -0.1451486498117...
not...
[ 0.4132644832134247, 0.469411164522171, -0.13140147924423218, 0.07106602191925049, -0.05100161209702492, -0.20616509020328522, 0.2953133285045624, 0.04311650991439819, 0.07851331681013107, -0.6590057611465454, -0.23287536203861237, 0.4583790898323059, -0.27523288130760193, 0.280298948287963...
What can I do to start the server? This is the command I type to the terminal: mvn jetty:run and this is the result: ``` [INFO] Starting jetty 6.1.9 ... 2009-04-15 18:16:00.829::INFO: jetty-6.1.9 2009-04-15 18:16:03.748::INFO: No Transaction manager found - if your webapp requires one, please configure one. 1487...
[ -0.3607005774974823, 0.084300197660923, 0.5798383951187134, 0.046864625066518784, -0.061014655977487564, 0.08713068813085556, 0.5677549242973328, -0.504750669002533, -0.13461290299892426, -0.5290933847427368, -0.08496664464473724, 0.36061856150627136, -0.2650097906589508, 0.193645372986793...
at org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:304) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) at org.mortbay.jetty.Server.doStart(Server.java:233) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) at org.mor...
[ -0.2805598974227905, 0.09150706976652145, 0.43276649713516235, -0.11710818111896515, -0.09030282497406006, 0.7017730474472046, 0.40597766637802124, -0.39363184571266174, -0.37317797541618347, -0.8300201892852783, -0.38061684370040894, 0.6094866991043091, -0.014582815580070019, -0.024184649...
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.code...
[ -0.3415234088897705, 0.07946478575468063, 0.38579925894737244, -0.1608319729566574, -0.06828415393829346, 0.4577687382698059, 0.3654197156429291, -0.3499675989151001, -0.3158431649208069, -0.746789276599884, -0.3785034418106079, 0.36920449137687683, -0.07250053435564041, 0.0680745914578437...
at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute(AbstractJettyRunMojo.java:203) at org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java:184) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:453) at org.apache.maven.lifecycle.DefaultLifecycleExecutor....
[ -0.2390720695257187, 0.3055429458618164, 0.43324726819992065, -0.2688086926937103, 0.11452758312225342, 0.40128982067108154, 0.502186119556427, -0.48100507259368896, -0.37199780344963074, -0.6476797461509705, -0.46860694885253906, 0.6017909049987793, -0.16408996284008026, -0.14914339780807...
exiting. [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Failure Embedded error: Address already in use [INFO] ---------------------------------------------------------------------...
[ -0.7261308431625366, -0.00026308593805879354, 0.4610082507133484, -0.21153636276721954, 0.39154261350631714, 0.4248582720756531, 0.5560954809188843, -0.06933010369539261, -0.09315754473209381, -0.5718770027160645, -0.4243362545967102, 0.5633364915847778, -0.2652271091938019, 0.043478231877...
by: org.apache.maven.plugin.MojoExecutionException: Failure at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:370) at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:293) at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute(AbstractJettyRunMojo.jav...
[ -0.31935518980026245, 0.18685923516750336, 0.4258672893047333, -0.21058861911296844, 0.032868631184101105, 0.4943639636039734, 0.6388871073722839, -0.2201898843050003, -0.5326597690582275, -0.7257862091064453, -0.3120439946651459, 0.37895163893699646, -0.16372627019882202, 0.29301387071609...
21 more [INFO] ------------------------------------------------------------------------ [INFO] Total time: 27 seconds [INFO] Finished at: Wed Apr 15 18:16:10 BST 2009 [INFO] Final Memory: 12M/254M [INFO] ------------------------------------------------------------------------ 2009-04-15 18:16:11.952::INFO: Shutdown ho...
[ -0.21102625131607056, -0.0627719983458519, 0.880024790763855, 0.1927262395620346, 0.06270985305309296, 0.29934197664260864, 0.45246824622154236, -0.528383731842041, -0.5460982918739319, -0.5123326182365417, -0.11115673929452896, 0.6114964485168457, 0.24925842881202698, 0.05030403286218643,...
I have an application and in order to get the images to load into the app I had to use a proxy. So the urls for the images are not .jpg they are .php?var=value They seem to load much slower even after they have already loaded once, I don't really know how it works, but I am thinking that the proxied images are not bein...
[ 0.27750998735427856, 0.23419500887393951, 0.6403396725654602, 0.10027512162923813, -0.28248143196105957, -0.0010410454124212265, 0.44138678908348083, -0.006740239914506674, -0.26005682349205017, -0.5944845676422119, -0.06228604167699814, 0.33119484782218933, -0.357787162065506, 0.096832424...
for these to be cached. --- In PHP, the way to set headers is this: ``` // can be cached by browser, and also by intermediate caches (i.e. by everybody) header('Cache-Control: public'); // is fresh (doesn't have to be re-checked) until that date header('Expires: Fri, 17 Apr 2009 23:50:00 GMT'); ``` Caveat: you n...
[ 0.005209705792367458, 0.3396191895008087, 0.394517183303833, 0.1019468680024147, -0.17977464199066162, -0.34475553035736084, 0.3506298363208771, 0.10659383237361908, -0.19902373850345612, -0.5030232071876526, -0.23572061955928802, 0.11663959920406342, 0.028457792475819588, 0.12793618440628...
I'm trying to do some number rounding and conversion to a string to enhance the output in an Objective-C program. I have a float value that I'd like to round to the nearest .5 and then use it to set the text on a label. For example: 1.4 would be a string of: 1.5 1.2 would be a string of: 1 0.2 would be a string o...
[ 0.5739381909370422, 0.3238861858844757, 0.1981365829706192, 0.5103879570960999, -0.3009568154811859, -0.12363629043102264, 0.24670258164405823, 0.2130873054265976, 0.15119948983192444, -0.3875543773174286, 0.358441025018692, 0.2793048322200775, 0.02520040050148964, 0.19876152276992798, 0...
I've managed to come up with a solution: ``` float roundedValue = round(2.0f * number) / 2.0f; NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; [formatter setMaximumFractionDigits:1]; [formatter setRoundingMode: NSNumberFormatterRoundDown]; NSString *numberString = [formatter stringFromNumber:[NSNumbe...
[ -0.08159718662500381, 0.19083252549171448, 0.6450766324996948, -0.17147982120513916, 0.02331242710351944, 0.09266523271799088, 0.11440986394882202, -0.534892737865448, -0.24844026565551758, -0.4165824353694916, 0.18615904450416565, 0.5271360874176025, 0.09238526225090027, -0.00776232359930...
As a dev team, we're looking to switch to asp.net MVC and I've heard rumors about IIS 6 not being able to support all of the MVC functionality. Is this true? Is there any official set of functionality supported in IIS 7 vs IIS 6? Should we completely avoid running it on IIS6? You do not loose any functionality of ASP.N...
[ 0.740741491317749, -0.16883835196495056, 0.3180157542228699, 0.19655169546604156, -0.2069186270236969, -0.45639386773109436, 0.27064499258995056, -0.026892565190792084, -0.43150100111961365, -0.5590323805809021, -0.0802941769361496, 0.54128098487854, -0.24784912168979645, 0.268608152866363...
you map to ASP.Net. I am currently using .aspx which meant I could avoid changing IIS configuration at the sacrifice of having extensionless URLs. The other option as mentioned is using a wild card mapping. What this does is route all requests to ASP.Net. Even requests for static content such as images. This does have...
[ 0.17645223438739777, -0.3711881935596466, 0.41650089621543884, 0.21388213336467743, -0.11477485299110413, -0.46362751722335815, 0.22820283472537994, 0.29490676522254944, -0.42635029554367065, -1.2195467948913574, 0.03450462967157364, 0.29834631085395813, -0.15802001953125, 0.18531458079814...
i'm using delphi 2009's TRibbon component. certain pages are not relevant depending on the application state. how can i hide a TRibbon page? RibbonPage1.Visible:=false doesn't really hide the page... is this maybe not allowed by the spec from microsoft? thank you for you help! mp I do not think you can hide the indi...
[ 0.11903785169124603, 0.031033189967274666, 0.5257930755615234, 0.08317714184522629, -0.21436229348182678, -0.22623921930789948, 0.406503826379776, -0.3223840296268463, -0.3406812846660614, -0.3882034718990326, -0.02614321932196617, 0.3405952453613281, -0.5391703248023987, 0.150153204798698...
[Adding Commands to the Ribbon](http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devwin32/win32_ribboncontrols2_xml.html)
[ -0.3457337021827698, -0.4808264970779419, 0.8482726812362671, -0.015397481620311737, 0.04055462032556534, 0.07179000228643417, -0.2885287404060364, -0.2581237256526947, -0.7804598808288574, -0.18074274063110352, -0.1442974954843521, 0.3173739016056061, -0.10760702192783356, 0.1329065859317...
I have an iframe that contains a page that is constantly updating (basically a logger type thing). Is there a way (either via JS/jQuery or otherwise) to force the iframe to stick to the bottom of that inner page even as it expands? I basically want to mimic the way may log viewers stick to the tail of a log file as it...
[ 0.25004348158836365, 0.0674394965171814, 0.5054306387901306, -0.17194864153862, -0.0957024097442627, -0.07517486810684204, -0.019416335970163345, 0.2961829900741577, -0.41585594415664673, -0.6589250564575195, 0.11698918044567108, 0.26466622948646545, -0.3239440321922302, 0.0458538606762886...
the contents *inside* the iframe to stay scrolled to the bottom. The iframe has a fixed height, and after the page loads, additional lines are added to that inner page and I want to force the iframe to always show the bottom of that inner page. does the iframe keep refreshing, and adding content.. or does it keep the c...
[ 0.027686750516295433, 0.014839387498795986, 0.6853284239768982, 0.17790116369724274, 0.0853782519698143, -0.08381804078817368, 0.05263035371899605, 0.2576144337654114, -0.18764787912368774, -0.8411056995391846, -0.09689418226480484, 0.44967642426490784, -0.051193010061979294, 0.11709678173...
I have a User model and a Friendship-Model. ``` class Friendship < ActiveRecord::Base belongs_to :sender, :class_name=>'User', :foreign_key=>'sender_id' belongs_to :receiver, :class_name=>'User', :foreign_key=>'receiver_id' validates_presence_of :receiver_id, :sender_id validates_associated :receiver, :sender...
[ -0.29531797766685486, 0.37756383419036865, 0.5057098865509033, -0.2216433584690094, -0.005448603071272373, 0.09812223166227341, 0.06041821464896202, -0.4094342291355133, 0.2848072052001953, -0.8622171878814697, 0.2493569403886795, 0.18274347484111786, -0.0680474042892456, 0.466422200202941...
end it "should not be valid with non-existant receiver_id" do f = Friendship.new(@valid_attributes) f.receiver_id = 99999 f.should_not be_valid end end ``` The test shouldnt be valid, because there is no User with user\_id 9999. But the test say's the friendship-model is valid. Why the hell? ***ED...
[ 0.14415064454078674, 0.3214854300022125, 0.6798062324523926, 0.139275461435318, 0.09062379598617554, -0.4402611553668976, 0.286726176738739, -0.1712958961725235, 0.2540453374385834, -0.08814725279808044, -0.19441360235214233, 0.24051691591739655, 0.07430116832256317, 0.11206834018230438, ...
I am trying to create an object where a user can click and drag to have the effect of a pull motion. Any idea how I would do that with jQuery? Pulling down a container that is hidden off the screen. Would I use drag? If you have either documented or debug versions of the framework you want to use, [VS 2008 will give yo...
[ 0.12155038118362427, -0.1794249415397644, 0.3169896900653839, 0.006001290399581194, -0.08255056291818619, -0.0556052029132843, 0.14108720421791077, 0.004869274795055389, -0.09161847829818726, -0.70765221118927, 0.02216631919145584, 0.37425872683525085, -0.3632884919643402, 0.04630060493946...
forward, VS 2010 will have even more support for JavaScript, working out parameter types from usage, etc. Microsoft have started offering **support** for jQuery - which is different to VS supporting a JavaScript framework - this means that you can phone MS up and say your site isn't working with jQuery, and they will ...
[ 0.13122914731502533, -0.18381713330745697, 0.4740462005138397, 0.1723412722349167, -0.5240044593811035, 0.00024225265951827168, 0.4404793977737427, 0.10212697088718414, -0.28557366132736206, -0.6185386180877686, -0.060533877462148666, 0.40318572521209717, -0.14139950275421143, 0.0190895032...
I am trying to clean all of the HTML out of a string so the final output is a text file. I have some some research on the various 'converters' and am starting to lean towards creating my own dictionary for the entities and symbols and running a replace on the string. I am considering this because I want to automate the...
[ 0.31520727276802063, 0.3216084837913513, 0.2789226472377777, -0.12683598697185516, -0.28776007890701294, 0.06452396512031555, 0.48285600543022156, -0.06452883034944534, 0.03690061718225479, -0.7296170592308044, -0.02550976350903511, 0.37343630194664, -0.5277435779571533, 0.0126120792701840...
using the string method replace. I get a ``` UnicodeDecodeError: 'ascii' codec can't decode byte 0xa0 in position 0: ordinal not in range(128) ``` The actual line of code was ``` s=unicodestring.replace('\xa0','') ``` Anyway-I decided that I needed to preface it with an r so I ran this line of code: ``` s=unic...
[ -0.1627938598394394, 0.17250528931617737, 0.6012857556343079, -0.17024794220924377, -0.2699715197086334, 0.17430537939071655, 0.32749512791633606, -0.4220160245895386, -0.016497990116477013, -0.4764665961265564, -0.32656335830688477, 0.35242676734924316, -0.43006935715675354, -0.1266522854...
I have a database that is part of a Merge Replication scheme that has a GUID as it's PK. Specifically the Data Type is *uniqueidentifier*, Default Value *(newsequentialid())*, RowGUID is set to *Yes*. When I do a InsertOnSubmit(CaseNote) I thought I would be able to leave CaseNoteID alone and the database would input t...
[ 0.000589094590395689, 0.20635217428207397, 0.4309414029121399, 0.03753456100821495, -0.13232292234897614, -0.16468007862567902, 0.047055184841156006, 0.009441890753805637, -0.15561164915561676, -0.925270676612854, 0.19853338599205017, 0.3039802014827728, -0.20507323741912842, 0.55763775110...
next sequential id on a LINQ InsertOnSubmit()? For reference below is the code I am using to insert a new record into the database. ``` CaseNote caseNote = new CaseNote {
[ 0.052165839821100235, 0.1079762876033783, 0.392218679189682, 0.019646061584353447, 0.33024197816848755, -0.2880624234676361, -0.05658808723092079, -0.1652393788099289, -0.349117636680603, -0.7274214029312134, 0.1851864904165268, 0.6076799035072327, -0.288299560546875, 0.2215116322040558, ...
CaseNoteID = Guid.NewGuid(), TimeSpentUnits = Convert.ToDecimal(tbxTimeSpentUnits.Text), IsCaseLog = chkIsCaseLog.Checked,
[ -0.16246391832828522, -0.22996488213539124, 0.37730497121810913, 0.016674961894750595, 0.2402522712945938, 0.08805248886346817, 0.02256026864051819, -0.13616804778575897, -0.12621735036373138, -0.9611280560493469, -0.06701081991195679, 0.3947478234767914, -0.35702577233314514, -0.110451519...
ContactDate = Convert.ToDateTime(datContactDate.Text), ContactDetails = memContactDetails.Text };
[ 0.058857567608356476, -0.3473338484764099, 0.6062827110290527, -0.2913331985473633, 0.2193252593278885, 0.201980322599411, 0.5714530348777771, -0.385636568069458, 0.24109388887882233, -0.5724305510520935, -0.07237650454044342, 0.831255316734314, -0.5108778476715088, -0.033193498849868774, ...
caseNotesDB.CaseNotes.InsertOnSubmit(caseNote); caseNotesDB.SubmitChanges(); ``` --- Based on one of the suggestions below I enabled the Autogenerated in LINQ for that column and now I get the following error --> *The target table of the DML statement cannot have any enabled triggers if the statement contai...
[ 0.2728707492351532, -0.0027802844997495413, 0.7007247805595398, 0.03588363528251648, 0.10682597011327744, -0.1740502119064331, 0.1821124404668808, -0.33661672472953796, -0.11631830781698227, -0.45267459750175476, -0.14591646194458008, 0.6317920684814453, -0.3967602252960205, 0.064943850040...
I am already using this [example of how to read large data files in PHP line by line](https://stackoverflow.com/questions/162176/reading-very-large-files-in-php/162263#162263) Now, what it'd like to do, is obtain the total number of rows in the file so that I may display a percentage complete or at least what the tota...
[ 0.16791723668575287, 0.31729650497436523, 0.305040180683136, 0.0587494783103466, -0.26989030838012695, 0.2749272584915161, 0.08210626989603043, -0.2661355137825012, -0.4132928252220154, -0.5562485456466675, 0.4789162576198578, 0.5510187149047852, 0.18046104907989502, 0.14496086537837982, ...
Calc a simple average reading (use the first 250 lines) and go with that. ``` estNumOfLines = sizeOfFile / avgLineSize ``` You could store off the number of lines in the file when you are creating the file... ***Alternatively, you could display the number of KB processed, and that would be perfectly accurate.***
[ 0.23574405908584595, 0.16090096533298492, 0.5272667407989502, -0.20611900091171265, 0.05107048153877258, 0.4027920067310333, 0.0763617679476738, -0.3975134789943695, -0.1327541172504425, -0.7761573195457458, -0.18637533485889435, 0.6065707206726074, -0.1542295664548874, -0.0907679274678230...
I work on a thick-client app that often runs into "issues" accessing network shares. Before doing any IO with the server, my app tests whether the share (usually of the form \\server\share$) exists. This works fine for detecting those scenarios in which the client has lost its connection to the server, but there are st...
[ 0.6539216637611389, 0.4761877954006195, 0.09410890936851501, 0.04742003232240677, 0.20336736738681793, -0.21487103402614594, 0.038507360965013504, 0.10843832045793533, -0.14342187345027924, -0.721235990524292, 0.24169966578483582, 0.5749431252479553, -0.08242515474557877, 0.216431081295013...
Should I be querying the share's ACL or the files within the share? What if the share is empty? What if the user is a local non-admin in a mixed environment (XP Pro workstation, Windows 2003 server without a domain on a Novell network)? The easiest way is to just do it (i.e. try to read a file, for example). As Jared m...
[ 0.5617110133171082, 0.16161175072193146, 0.10011381655931473, 0.17999227344989777, 0.04744301363825798, -0.3023390471935272, 0.39439281821250916, -0.011655637994408607, -0.10869479179382324, -0.4827617108821869, 0.040823377668857574, 0.5458592176437378, -0.0646742582321167, 0.2310379147529...
answer: ``` string remotePath = @"\\server\share$"; bool haveAccess = false; DirectoryInfo di = new DirectoryInfo(remotePath); if (di.Exists) { try { // you could also call GetDirectories or GetFiles
[ 0.16614817082881927, -0.35464945435523987, 0.6572262644767761, -0.055887434631586075, 0.37922385334968567, -0.08951006829738617, 0.3163676857948303, 0.043167248368263245, 0.024651814252138138, -0.6850138902664185, -0.2573325037956238, 0.4641765356063843, -0.4244758188724518, 0.348284751176...
// to test them individually // this will throw an exception if you don't have // rights to the directory, though var acl = di.GetAccessControl();
[ 0.3747853934764862, -0.26343032717704773, 0.10691602528095245, -0.02646781876683235, 0.2661844789981842, -0.0673348605632782, 0.10896874219179153, -0.45617640018463135, 0.026388904079794884, -0.30733904242515564, -0.2647227644920349, 0.5246229767799377, -0.38124892115592957, 0.154897153377...
haveAccess = true; } catch (UnauthorizedAccessException uae) { if (uae.Message.Contains("read-only")) { // seems like it is just read-only
[ 0.5022614002227783, -0.3947634696960449, 0.5549885034561157, -0.08242350816726685, 0.34503746032714844, -0.518839418888092, 0.4761400520801544, -0.29677751660346985, 0.12582026422023773, -0.3393124043941498, -0.4486108124256134, 0.5457307696342468, -0.3992120027542114, -0.05092832446098327...
haveAccess = true; } // no access, sorry // do something else... } } ``` There are many shortcomings in
[ 0.21944576501846313, 0.3844910264015198, 0.3676471412181854, -0.30855128169059753, 0.17422522604465485, -0.2403605431318283, 0.3593781590461731, -0.22027283906936646, 0.12109092622995377, -0.6336082220077515, -0.26688411831855774, 0.7843529582023621, -0.20778879523277283, -0.06274683773517...
the above code (such as the hard-coded "read-only" test), but it is just an example used to illustrate what you could do. DirectoryInfo has a few other helper methods that you can use to list the files in the folder. If you don't have access, the methods will throw an `UnauthorizedAccessException` exception which you c...
[ 0.33746954798698425, -0.036269061267375946, 0.18942110240459442, 0.3605227768421173, 0.28777268528938293, -0.3822632133960724, 0.3693600296974182, 0.12068260461091995, -0.3703841269016266, -0.580413818359375, 0.03346046060323715, 0.4675271809101105, -0.139724999666214, 0.21195338666439056,...
The design I've been given for an iPhone app I'm working on calls for a 1px red line at the bottom of the navigation bar. I know how to draw a line with Quartz and -drawRect, but how do I get access to the UINavigationBar's view? Or would it work to draw the line in the app's main view, on top of everything else? Dunc...
[ 0.20768052339553833, -0.13716185092926025, 0.7930158972740173, 0.12683051824569702, 0.225574791431427, 0.1442936211824417, 0.16009169816970825, -0.44580867886543274, 0.09656542539596558, -0.599194347858429, -0.11086710542440414, 0.59806227684021, -0.01604457199573517, 0.15683816373348236, ...
are dynamically added. This is what I've settled upon: ``` // UINavigationBar subclass - (void)drawRect:(CGRect)rect { UIImage *image = [UIImage imageNamed: @"background_navbar.png"]; [image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)]; } ```
[ -0.06150725111365318, -0.305558979511261, 0.7096933722496033, -0.12324201315641403, 0.03338151425123215, 0.2957881689071655, 0.05243104696273804, -0.15757758915424347, -0.4095988869667053, -0.6304671764373779, -0.23044268786907196, 0.6033973693847656, -0.156744584441185, -0.004055286757647...
I'm still confused... When we write some thing like this: ``` Object o = new Object(); var resource = new Dictionary<int , SomeclassReference>(); ``` ...and have two blocks of code that lock `o` while accessing `resource`... ``` //Code one lock(o) { // read from resource } //Code two lock(o) { // write to ...
[ 0.14533817768096924, 0.07981596142053604, 0.16737127304077148, -0.07362453639507294, 0.29080602526664734, 0.1272689253091812, 0.0059455325827002525, -0.04831119626760483, -0.24687057733535767, -0.8890832662582397, 0.04116180166602135, 0.4593662619590759, -0.22818994522094727, 0.34314724802...
Will the lock construct help me? ...or should i use something else? (I'm using `Dictionary` for the purposes of this example, but could be anything) There are two cases I'm specifically concerned about: 1. two threads trying to execute same line of code 2. two threads trying to work on the same resource Will `lock`...
[ 0.3024369478225708, -0.017700500786304474, -0.05127626284956932, 0.18228179216384888, 0.06621703505516052, -0.006932161282747984, 0.2059181183576584, -0.2560200095176697, -0.23178192973136902, -0.5046558380126953, 0.16028018295764923, 0.3629266023635864, -0.14347203075885773, 0.07373116910...
to the resource you're trying to synchronize around. As long as all readers/writers agree on the same token it can be anything. When trying to lock on an object (i.e. by calling `Monitor.Enter` on an object) the runtime checks if the lock is already held by a thread. If this is the case the thread trying to lock is s...
[ 0.3397202789783478, -0.207578644156456, 0.451196551322937, 0.24912209808826447, 0.31185805797576904, -0.2481982707977295, 0.2825893759727478, 0.10288991034030914, -0.5075377225875854, -0.6278746724128723, -0.22750699520111084, 0.3859516382217407, -0.24266014993190765, 0.2490219920873642, ...
to keep in mind regarding locks: * Lock as long as you need to, but no longer. * If you use `Monitor.Enter/Exit` instead of the `lock` keyword, be sure to place the call to `Exit` in a `finally` block so the lock is released even in the case of an exception. * Exposing the object to lock on makes it harder to get an o...
[ 0.3000052273273468, -0.15445153415203094, 0.2684685289859772, 0.04877687618136406, 0.318100243806839, -0.4192255735397339, 0.5782421827316284, -0.09094759076833725, -0.5420494675636292, -0.4903939664363861, -0.6593563556671143, 0.46034252643585205, -0.08615133911371231, 0.01424344629049301...
I recently started maintaining a .Net 1.1 project and would like to convert it to .Net 3.5. Any tips to share on reducing code by making use of new features? As a first attempt, I would like to convert a bunch of static helper functions. **Update**: The main reason why I am converting is to learn new features like ...
[ 0.4404437839984894, -0.047022853046655655, 0.18921707570552826, 0.03237532824277878, -0.14473232626914978, -0.1866348683834076, 0.2827318608760834, 0.11688098311424255, -0.19994942843914032, -0.806139349937439, -0.05864698812365532, 0.7456658482551575, -0.36318135261535645, 0.0564946718513...
I think it is MergeSort, which is O(n log n). However, the following output disagrees: ``` -1,0000000099000391,0000000099000427 1,0000000099000427,0000000099000346 5,0000000099000391,0000000099000346 1,0000000099000427,0000000099000345 5,0000000099000391,0000000099000345 1,0000000099000346,0000000099000345 ``` I am...
[ -0.03697649762034416, 0.2905728816986084, 0.32148417830467224, 0.006318526342511177, -0.20689840614795685, 0.24894195795059204, 0.44741809368133545, -0.16235969960689545, -0.3809538781642914, -0.6857791543006897, -0.06773760169744492, 0.22679118812084198, -0.21739321947097778, 0.2829875648...
8 nodes, or 16 nodes, or 32 nodes, and checking out the timing.
[ -0.02078978344798088, -0.1672801971435547, 0.4309267997741699, -0.08934327960014343, 0.17989034950733185, 0.3136812150478363, 0.4071558713912964, -0.00709192780777812, -0.3558453321456909, -0.5243065357208252, -0.2539544999599457, 0.10325740277767181, -0.24016062915325165, -0.0678472518920...
My question is how does one abstract a database connection from the model layer of an application? The primary concern is to be able to easily change from different types of databases. Maybe you start with a flat file, comma-delimited database. Then you want to move to a SQL database. Then later you decide an LDAP impl...
[ 0.18082749843597412, -0.08356339484453201, 0.10639974474906921, 0.33499178290367126, 0.09795887023210526, -0.16908860206604004, -0.197219580411911, 0.0036427509039640427, -0.25888165831565857, -0.8137310147285461, 0.0626981258392334, 0.482361763715744, -0.4732038080692291, 0.19423848390579...
the problems with public instance variables): ``` <?php class User { public $first; public $last; public $email; } ?> ``` I have frequently seen where people have a DAO class which has the SQL embedded in it as such: ``` <?php class UserDAO { public $id; public $fist; public $last; public $email; ...
[ -0.2143249213695526, 0.19577917456626892, 0.1769755631685257, -0.08443307876586914, 0.010561120696365833, 0.06367157399654388, 0.06529214978218079, -0.1794717162847519, -0.09430927038192749, -0.7003633975982666, -0.06683505326509476, 0.5790966153144836, -0.4274282455444336, 0.0898168236017...
delete functions to deal with your new type of database. Even if you have a program to auto-generate them for you (which I am not particularly a fan of), you would have to edit this program to make it work now. What are your suggestions for how to handle this? My current idea is to create a super class for DAO object...
[ 0.03935924172401428, -0.10355959832668304, 0.16977722942829132, 0.31539711356163025, -0.12797100841999054, -0.09993520379066467, 0.11433818191289902, -0.1257292479276657, -0.21246150135993958, -0.28845447301864624, -0.1951558142900467, 0.31808173656463623, -0.4889511168003082, 0.0916303992...
about several classes. Then if you wanted to change your database layer, you would only have to change how the SuperDAO class generates the queries. Advantages? Disadvantages? Foreseeable problems? The good, the bad, and the ugly? Using an [ORM](http://en.wikipedia.org/wiki/Object-relational_mapping) is usually the pre...
[ 0.23539787530899048, -0.11618637293577194, -0.11336579918861389, 0.3785514235496521, -0.2490094155073166, 0.09698113799095154, 0.009494975209236145, 0.24426721036434174, -0.19014179706573486, -0.5509771108627319, -0.2874493896961212, 0.20732595026493073, -0.16411881148815155, 0.13330623507...
Suppose the string is: ``` string item = "t-ewrwerwerwerwer\r-rr\wrjkwlr"; ``` I want to Replace all - except when it is preceded by r. So resut will be ``` string cleanItem = "tewrwerwerwerwer\r-rr\wrjkwlr"' ``` What regular expression can be used? A replacement on `(?<!r)-` by an empty string should do the tr...
[ -0.38418251276016235, -0.08562951534986496, 0.28204065561294556, -0.27727293968200684, -0.07123719900846481, -0.02562084048986435, 0.31917649507522583, -0.2238198220729828, 0.00419944291934371, -0.38767024874687195, -0.5416091680526733, 0.5709840655326843, -0.357856810092926, 0.03029179945...
I'm doing a bit of programming here and there in Emacs Lisp, but I'm not entirely sure how to go about certain things. I'm trying to insert a whole month of dates, each on a new line like the list below: January 01/01/09 Mon: 02/01/09 Tue: 03/01/09 Wed: etc How would I go about doing that? I've found how to form...
[ 0.5452146530151367, 0.14927545189857483, 0.6949052214622498, 0.06194492429494858, -0.1106622964143753, 0.14612247049808502, 0.1839142143726349, 0.40812617540359497, -0.41410350799560547, -0.4847426414489746, 0.28065383434295654, 0.010488255880773067, 0.23705916106700897, 0.1992873102426529...
functions you want are `'encode-time`, `'format-time-string`, and `'decode-time`. For the proper documentation, either `C-h f function-name` or will give you the documentation for the function, or the general elisp info pages can be found here: `C-h i m elisp RET m time conversion RET` Here's that snippet: ``` (defun...
[ 0.11206420511007309, -0.2845669984817505, 0.5208964943885803, -0.04874734580516815, 0.3830650746822357, 0.026021145284175873, -0.01606656424701214, -0.0054242899641394615, -0.15982046723365784, -0.3312668800354004, -0.2938402593135834, 0.6547679305076599, -0.3975643217563629, -0.2499816119...
(insert (format-time-string "%D %a:\n" time)) (setq day (1+ day)) (setq time (encode-time 1 1 0 day month 2009))))) ``` I couldn't find how to determine the number of days in a given month (sure, you could hard-code it, but then you've got to deal with leap years). Luckily, `'encode-time` does all the add...
[ 0.15094581246376038, -0.007520543411374092, 0.6708121299743652, -0.3227980434894562, -0.1894824057817459, 0.24044069647789001, 0.6050708889961243, 0.11343391984701157, -0.3592747449874878, -0.28732240200042725, -0.24338175356388092, -0.019566133618354797, -0.046497076749801636, 0.252148568...
Compare the following two pieces of code, the first using a reference to a large object, and the second has the large object as the return value. The emphasis on a "large object" refers to the fact that repeated copies of the object, unnecessarily, is wasted cycles. Using a reference to a large object: ``` void getOb...
[ 0.026579853147268295, 0.03237723186612129, 0.1096874549984932, -0.526862382888794, 0.1663392186164856, 0.2743453085422516, 0.3950709402561188, -0.1641954630613327, -0.3932630717754364, -0.4369184672832489, -0.4368359446525574, 0.5089516639709473, -0.6130019426345825, 0.2877531051635742, ...
snippet of code does not require copying the large object. In the second snippet, the object is created inside the function, and so in general, a copy is needed when returning the object. In this case, however, in `main()` the object is being declared. Will the compiler first create a default-constructed object, then ...
[ 0.243100106716156, -0.10838879644870758, 0.2399626523256302, 0.13138015568256378, -0.07766222953796387, -0.1744474172592163, 0.2241339087486267, 0.2359754592180252, -0.10322650521993637, -0.7160370349884033, -0.570823073387146, 0.26552215218544006, -0.43359050154685974, 0.17844286561012268...
of argument, contains thousands of objects inside of them. For example, ``` typedef std::vector<HugeObj> LargeObj ; ``` so directly modifying/adding methods to `LargeObj` isn't a directly accessible solution. The second approach is more idiomatic, and expressive. It is clear when reading the code that the function h...
[ -0.29712530970573425, 0.14263981580734253, 0.38335633277893066, -0.02844398282468319, -0.14588256180286407, 0.13204073905944824, 0.17200297117233276, -0.21099790930747986, -0.04196414351463318, -0.6380011439323425, -0.36720767617225647, 0.2597276270389557, -0.5229130983352661, 0.0896856710...
the copies. The code you posted is not using the assignment operator, but rather copy construction. The C++ defines the [return value optimization](http://en.wikipedia.org/wiki/Return_value_optimization) that is implemented in all major compilers. If you are not sure you can run the following snippet in your compiler: ...
[ 0.42189034819602966, 0.39484941959381104, 0.5484623312950134, 0.006272604689002037, 0.024782299995422363, 0.09561417251825333, -0.12690261006355286, 0.11363881081342697, -0.2829964756965637, -0.6035575270652771, -0.1402784287929535, 0.5076632499694824, -0.7139108777046204, -0.0381309576332...
tmp; return tmp; } int main() { X x = f(); } ``` With g++ you will get a single line *X::X()*. The compiler reserves the space in the stack for the *x* object, then calls the function that constructs the *tmp* over *x* (in fact *tmp* **is** *x*. The operations inside *f()* are applied directly on *x*, being e...
[ 0.24052707850933075, -0.15525242686271667, 0.49180686473846436, -0.36243027448654175, -0.319109708070755, 0.32730773091316223, 0.30734869837760925, -0.5344306826591492, -0.11056753993034363, -0.4452553987503052, -0.2698616683483124, 0.4963114261627197, -0.8722296357154846, 0.04426324740052...
line output: *X::X()* / *X::X()* / *X::operator=*. So it could be a little less efficient in cases.
[ -0.1332240104675293, -0.49308156967163086, 0.4690600335597992, -0.01677132397890091, -0.4135550260543823, 0.07799740880727768, 0.1729043871164322, 0.015879636630415916, 0.10608773678541183, -0.39485979080200195, -0.19898730516433716, 0.28255128860473633, -0.3217652440071106, 0.043209332972...
I've got a simple C# web service proxy class that I created with WSDL.exe. I am invoking a method on the remote web service, and it is including a bunch of WS-Addressing and WS-Security headers that I do not want (and that the server is choking on). Here is an example of the raw soap request: ``` <?xml version="1.0" e...
[ 0.07898179441690445, 0.18494188785552979, 0.38448530435562134, -0.16988304257392883, -0.25458860397338867, 0.10164708644151688, 0.17223984003067017, -0.5077747106552124, -0.13327160477638245, -0.6946969628334045, 0.05090045556426048, 0.24370430409908295, -0.1025143638253212, 0.241347447037...
wsu:Id="Timestamp-5c9f0ef0-ab45-421d-a633-4c4fad26d945"> <wsu:Created>2009-04-15T16:27:25Z</wsu:Created> <wsu:Expires>2009-04-15T16:32:25Z</wsu:Expires> </wsu:Timestamp> </wsse:Security> </soap:Header> <soap:Body> <Func1 xmlns="http://example.com"> <arg_1 xmlns="">blah</arg_1> ...
[ 0.044817328453063965, 0.21742422878742218, 0.6564353108406067, -0.22484366595745087, -0.3559902608394623, -0.36560675501823425, 0.6410791277885437, -0.2529383897781372, -0.21554861962795258, -0.8519306778907776, -0.20591731369495392, 0.014096538536250591, -0.18749645352363586, 0.2796034216...
allow me to remove these sections. I've tried: ``` proxyObject.Addressing.Clear(); proxyObject.Security.Clear(); ``` Those cause a null reference exception when I invoke my web service method. I want the SOAP request to look like this: ``` <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http:/...
[ 0.08872446417808533, 0.3780955970287323, 0.413719117641449, -0.2163793295621872, -0.44977977871894836, -0.19649329781532288, 0.07215859740972519, -0.39050477743148804, -0.23962529003620148, -0.7332902550697327, 0.08850718289613724, 0.3288295865058899, -0.34266501665115356, 0.06207921355962...
of the SOAP request before it is sent. Below is an example: ``` public class MyPolicy : SoapFilter { public override SoapFilterResult ProcessMessage(SoapEnvelope envelope) { // Remove all WS-Addressing and WS-Security header info envelope.Header.RemoveAll(); ...
[ 0.14143039286136627, -0.13989666104316711, 0.3226296901702881, -0.21396084129810333, 0.25585299730300903, -0.07853017002344131, 0.5579546689987183, -0.46372514963150024, 0.07965823262929916, -0.4666926860809326, -0.3012288212776184, 0.3744402229785919, -0.21950092911720276, 0.3384574949741...
public class MyAssertion : PolicyAssertion { public override SoapFilter CreateClientInputFilter(FilterCreationContext context) { return null; } public override SoapFilter CreateClientOutputFilter(FilterCreationContext context) { return new MyPolicy();...
[ 0.023395057767629623, -0.4669312536716461, 0.36075714230537415, 0.015298011712729931, 0.15921775996685028, 0.02131919376552105, 0.4485911428928375, -0.20536114275455475, 0.0723881870508194, -0.8435433506965637, -0.2864020764827728, 0.5166535973548889, -0.6192855834960938, 0.113879740238189...