text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
I have user login data with timestamps and what I would like to do is get a histogram of logins by year, but with the year starting at an arbitrary date. For example, I want the following sort of information: ``` 1 May 2005 - 30 Apr 2006 | 525 1 May 2006 - 30 Apr 2007 | 673 1 May 2007 - 30 Apr 2008 | 892 1 May 2006 - ...
[ -0.21312259137630463, 0.32422205805778503, 0.5967774391174316, -0.35573941469192505, 0.07565364986658096, 0.35765016078948975, 0.5988520383834839, 0.03358457610011101, -0.48586487770080566, -0.1448729932308197, -0.17966993153095245, 0.24944274127483368, 0.3447210192680359, 0.23468086123466...
AS cnt FROM logins GROUP BY YEAR([date]) ORDER BY [year] ``` But that doesn't give me the data ranges I want. How can this be done? ``` declare @baseDate datetime set @baseDate = '1 May 2005' SELECT datediff(year, @baseDate, [date]) AS YearBucket ,COUNT(*) AS cnt FROM logins GROUP BY datediff(year, @baseD...
[ -0.1163887232542038, 0.18480779230594635, 0.9601041674613953, -0.0880267545580864, 0.059780728071928024, 0.21338480710983276, -0.021228371188044548, 0.153666689991951, -0.45765992999076843, 0.1018444374203682, -0.15397174656391144, 0.20065836608409882, 0.2534544765949249, 0.470659524202346...
@baseDate = '1 May 2005' SELECT datediff(day, @baseDate, [date]) / 365 AS YearBucket ,COUNT(*) AS cnt FROM logins GROUP BY datediff(day, @baseDate, [date]) / 365 ORDER BY datediff(day, @baseDate, [date]) / 365 ``` Change the datediff units if you want more granularity than days. EDIT #2 - ok, here is a mo...
[ 0.07254553586244583, -0.2279345989227295, 0.7019733190536499, -0.09860395640134811, -0.13878203928470612, 0.10614727437496185, 0.24987758696079254, -0.24907487630844116, -0.36218973994255066, -0.09414328634738922, 0.05850376561284065, 0.04833940044045448, 0.011741282418370247, 0.2173800617...
time (1/1/1900) select @baseDate = '1 May 2005', @interval = '1901' declare @timeRanges table (beginIntervalInclusive datetime, endIntervalExclusive datetime) declare @i int set @i = 1 while @i <= 10 begin insert @timeRanges values(@baseDate, @baseDate + @interval) set @baseDate = @baseDate + @interval set...
[ 0.10484147816896439, 0.0020242107566446066, 0.6177096366882324, -0.13334797322750092, 0.27587372064590454, 0.39258044958114624, -0.08330324292182922, -0.6632781028747559, -0.3856574296951294, -0.5153513550758362, 0.08314252644777298, 0.04998663067817688, -0.13337919116020203, 0.70493990182...
I have an application that makes use of the Mozilla LDAP library. We're diagnosing a problem involving the LDAP library failing to make a connection to the server. I'm attempting to get additional information from the LDAP library by tossing a debug version of the lib in with the application and enabling debug using ld...
[ 0.41853755712509155, 0.06765937060117722, 0.06583553552627563, 0.06664939224720001, -0.23561064898967743, -0.4943080544471741, 0.2690274715423584, 0.05753638595342636, -0.039278287440538406, -0.8437643051147461, -0.1448993682861328, 0.6869474649429321, -0.6388916969299316, 0.23244777321815...
output to a file. The application, though, is running as a Windows service. Anyone know how I could redirect stderr to a file for an application running as a service? **edit** I'm hoping not to have to modify any more of the service source code than I already have. Options in the service configuration would be ideal...
[ 0.10169993340969086, 0.13707172870635986, 0.5093911290168762, -0.16423335671424866, -0.3011411726474762, 0.022699249908328056, 0.5411560535430908, -0.1597357839345932, -0.30878007411956787, -0.7334614992141724, -0.2235436886548996, 0.7117847800254822, -0.2883901000022888, 0.104242801666259...
those streams inside your service yourself. Some services provide an option to redirect these messages to a file. You could either temporarily redirect these streams or add an option to your service to make it configurable next time you have a problem.
[ 0.4288751482963562, -0.22979584336280823, 0.17958633601665497, 0.45127251744270325, 0.22058318555355072, 0.13886885344982147, 0.7382389903068542, 0.4618128836154938, -0.45397377014160156, -0.5572744607925415, -0.3196260631084442, 0.3432336151599884, -0.3670260012149811, 0.24642589688301086...
I have a Visual Studio 2008 project with some legacy native C++ DLL projects, and some newer WPF projects that use the DLLs. When I open the WPF xaml windows in the designer, Visual Studio loads up the native DLLs to be able to display the window. The problem is, is that if I now need to make a change in the legacy D...
[ 0.12055784463882446, 0.36340081691741943, 0.27010485529899597, -0.17087142169475555, -0.2407791167497635, -0.23724758625030518, 0.2638133764266968, -0.004633683245629072, -0.3175494372844696, -0.5914111733436584, -0.03510981798171997, 0.6181161999702454, -0.3588683009147644, 0.199615001678...
there a way to tell Visual Studio to unload those DLLs without a full restart? You'll need to use the Microsoft Excel Interop library. <http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.aspx> You should be able to add a reference, in the com tab, to Microsoft Excel 11 Object Library. <http://msd...
[ 0.30627548694610596, -0.0476243793964386, 0.21244944632053375, 0.34861934185028076, -0.05969700589776039, -0.20163680613040924, -0.04546920955181122, 0.07767846435308456, -0.2292538732290268, -0.6264238357543945, -0.2307085245847702, 0.5997570753097534, -0.15824919939041138, -0.16281808912...
I have a text file that denotes remarks with a single `'`. Some lines have two quotes but I need to get everything from the first instance of a `'` and the line feed. ``` I AL01 ' A-LINE '091398 GDK 33394178 402922 0831850 '
[ 0.22474108636379242, 0.5849215984344482, 0.20124046504497528, 0.04630081728100777, -0.2828342914581299, 0.12615753710269928, 0.11809239536523819, 0.1260845959186554, 0.09590526670217514, -0.6390095949172974, 0.05221309885382652, 0.25602489709854126, 0.04036330059170723, 0.28605130314826965...
'091398 GDK 33394179 I AL02 ' A-LINE '091398 GDK 33394180
[ -0.4635220766067505, -0.2515923082828522, 0.011171129532158375, 0.13556604087352753, -0.4148459732532501, 0.4747210443019867, 0.5249927639961243, -0.03945741429924965, -0.1764620989561081, -0.2662026882171631, -0.5227674841880798, 0.19101357460021973, -0.3098162114620209, 0.025350408628582...
400722 0833118 ' '091398 GDK 33394181 I A10A ' A-LINE 102 ' 53198 DJ 33394182
[ -0.4187011420726776, 0.2737921476364136, 0.057122956961393356, 0.20392629504203796, -0.19064325094223022, 0.2456362396478653, 0.3696264624595642, -0.26726436614990234, -0.3289400339126587, -0.1643957495689392, -0.29233309626579285, 0.4890749752521515, -0.29274827241897583, 0.28477135300636...
395335 0832203 ' ' 53198 DJ 33394183 I A10B ' A-LINE 102 ' 53198 DJ
[ -0.3141974210739136, 0.3777237832546234, 0.18817953765392303, 0.03878277540206909, -0.3466763198375702, 0.42029064893722534, 0.43851733207702637, -0.35187792778015137, -0.20290721952915192, -0.07071756571531296, -0.21648268401622772, 0.42939436435699463, -0.3026558458805084, 0.296009749174...
3339418 ``` ``` '.* ``` I believe you need the option, Multiline.
[ -0.03126320242881775, -0.1471293717622757, 0.009685955941677094, 0.2766796052455902, 0.36461371183395386, 0.09013617038726807, 0.16365580260753632, 0.21530574560165405, -0.19223587214946747, -0.7347420454025269, -0.13056987524032593, 0.6857761740684509, -0.26922523975372314, 0.105504490435...
I am writing a decorator that needs to call other functions prior to call of the function that it is decorating. The decorated function may have positional arguments, but the functions the decorator will call can only accept keyword arguments. Does anyone have a handy way of converting positional arguments into keyword...
[ 0.029004231095314026, 0.21425998210906982, 0.34071630239486694, -0.15040230751037598, -0.04933872073888779, 0.3198815584182739, 0.006640676874667406, -0.3165162205696106, -0.06953056901693344, -0.7296613454818726, 0.020648548379540443, 0.5175424218177795, -0.2663708031177521, 0.26786226034...
def __init__(self, f, *args, **kwargs): self.f = f def __call__(self, *args, **kwargs): hozer(**kwargs) self.f(*args, **kwargs) ``` Is there a way other than just comparing kwargs and co\_varnames, adding to kwargs anything not in there, and hoping for the best? Note - co\_varnames will i...
[ -0.0005786691908724606, 0.14018039405345917, 0.33972740173339844, -0.2792865037918091, 0.07949395477771759, 0.15194974839687347, 0.6633313298225403, -0.27071237564086914, -0.18336918950080872, -0.48477703332901, -0.17097033560276031, 0.8240762948989868, -0.4901306927204132, -0.219445019960...
this with `func_code.co_varnames[:func_code.co_argcount]`, but better is to use the [inspect](http://docs.python.org/library/inspect.html) module. ie: ``` import inspect argnames, varargs, kwargs, defaults = inspect.getargspec(func) ``` You may also want to handle the case where the function defines `**kwargs` or `*...
[ 0.08590196073055267, 0.20228628814220428, 0.3429965674877167, -0.21646670997142792, -0.40490177273750305, -0.22531990706920624, 0.06342247128486633, -0.36895209550857544, -0.2036765068769455, -0.4213819205760956, -0.19187115132808685, 0.5900724530220032, -0.45438817143440247, -0.0332194231...
What are `current_user_can()` function parameters ? This function is used in wordpress script, I know a parameter called `publish_posts` , I want to know the other parameters . There is a sample code : ``` if( current_user_can( 'publish_posts' ) ) { require_once dirname( __FILE__ ) . '/post-form.php'; } ``` Thi...
[ -0.2621139585971832, -0.11511082947254181, 0.6465352773666382, 0.07062563300132751, 0.4843181371688843, -0.05445019155740738, 0.01746353507041931, -0.08046001940965652, 0.019360914826393127, -0.7402973771095276, -0.17271073162555695, 0.740249752998352, 0.19660097360610962, -0.0782460197806...
I'd like to conditionally hide a tab in a TabNavigator. It seems that setting visible doesn't work properly (presumably because this is how the TabNavigator hides the tabs that aren't currently selected). What's the right way to do this? You can do this by making use of TabNavigator's getTabAt() method which returns t...
[ 0.4948360323905945, -0.3157157599925995, 0.24831673502922058, 0.10638077557086945, 0.014035510830581188, -0.09374791383743286, 0.49693071842193604, -0.24803976714611053, -0.08831524848937988, -0.7871899008750916, 0.1030927300453186, 0.802909791469574, -0.3212682902812958, 0.118609368801116...
child (for which visible didn't work).
[ -0.3503114581108093, -0.2780396044254303, 0.05529876798391342, 0.3444809317588806, -0.35909101366996765, 0.38081181049346924, 0.06785357743501663, 0.09480900317430496, -0.3125656843185425, -0.41192951798439026, -0.083966463804245, 0.30536848306655884, 0.030280405655503273, 0.27165767550468...
... or perhaps a way to launch NetBeans through a middle-man app and open up a BASE and LOCAL file in the DIFF editor ... If it is the style of the netbeans diff tool that you like, have a look at the free [Perforce Merge Tool.](http://www.perforce.com/perforce/products/merge.html) [![P4Merge](https://i.stack.imgur.co...
[ 0.23178131878376007, -0.04976082593202591, 0.5957337617874146, -0.24757778644561768, -0.2312604784965515, 0.12059377133846283, 0.21829678118228912, -0.14167672395706177, -0.17138579487800598, -0.3735707998275757, -0.48948097229003906, 0.417757123708725, -0.29699185490608215, -0.10573079437...
I am doing some research about how to access data in a UniData database from .NET code. From what I have found, I can use [UniObjects for .NET](http://www-01.ibm.com/software/data/u2/middleware/index.html#uniobjects-n) and [U2.NET](http://www-01.ibm.com/software/data/u2/u2-net/). I have also found [this information](h...
[ 0.35427021980285645, -0.07103202491998672, 0.1962423473596573, -0.17287792265415192, 0.010935256257653236, -0.02340063452720642, -0.21596497297286987, 0.19289539754390717, -0.4175817370414734, -0.5012481212615967, -0.16418075561523438, 0.38255253434181213, 0.061751801520586014, 0.233733266...
MV.NET repackaged and sold under the IBM name. U2.NET has a lot more features than UniObjects for .NET. UniObjects for .NET is basically the core UniData API recast into .NET... File (Table) opens, Dynamic Arrays, Read/write/delete records, OCONV/ICONV, subroutine calls, EXECUTE, etc U2.NET take the core that UniObje...
[ -0.10269709676504135, -0.3509654104709625, 0.5068613886833191, -0.3195624053478241, -0.36189091205596924, 0.20111459493637085, 0.158855602145195, -0.14858399331569672, -0.3258282542228699, -0.6407488584518433, -0.03704991936683655, 0.42004039883613586, -0.4589799642562866, 0.20531637966632...
This is my scenario in brief: I am making a restaurant's website. The restaurant owner will upload his restaurant's plan view image.(example: <http://cache.smartdraw.com/examples/content/Examples/SmartDraw/Floor_Plans/Restaurant_Plans/Family_Restaurant_Plan_L.jpg>) Then he will mark on the image were the tables avail...
[ 0.37387701869010925, 0.1283320039510727, 0.6627351641654968, -0.1819034069776535, 0.3893667459487915, 0.24134191870689392, -0.014843599870800972, 0.14627231657505035, -0.26026785373687744, -0.9988146424293518, -0.0585378035902977, 0.22706852853298187, 0.07878931611776352, -0.23240426182746...
icon on the image map where the coordinates are? In order to make the points visible for the user. UniObjects for .NET is free, and part of the [UniData](http://www.intl-spectrum.com/database/8/UniData.aspx) Client CD. U2.NET is a paid for product that is actually BluFinity's MV.NET repackaged and sold under the IBM na...
[ -0.030381252989172935, -0.3048282563686371, 0.5737690329551697, -0.21399952471256256, -0.35988056659698486, -0.06745602190494537, 0.07638279348611832, 0.04566788300871849, -0.32699841260910034, -0.6926943063735962, -0.32477620244026184, 0.3284907937049866, -0.3559982478618622, 0.0541773401...
feature easier to access
[ 0.1069992408156395, 0.14435628056526184, 0.03898618742823601, 0.19695954024791718, 0.19524039328098297, 0.12296426296234131, 0.31250616908073425, -0.04557054862380028, -0.18371108174324036, -0.495523065328598, -0.272390753030777, 0.30373311042785645, 0.2921711802482605, -0.1649354696273803...
I'm using Mercurial for personal use and am conteplating it for some distributed projects as an alternative to SVN for various reasons. I'm getting comfortable with using it for self contained projects and can see various options for sharing however I haven't yet found any guidance on managing common libraries to be i...
[ 0.35638412833213806, 0.09525901824235916, -0.164289653301239, 0.25295668840408325, -0.32369592785835266, -0.3898206353187561, 0.024743814021348953, 0.28143975138664246, 0.02845742739737034, -0.6574918627738953, 0.21571704745292664, 0.4568575620651245, -0.14518794417381287, 0.05856984481215...
libraries and similar that we find better to have as projects built with each solution than to pull in as compiled classes (not least because it ensures they are kept up to date, continuous integration helps us address breaking changes). Thoughts (I hate open ended questions, but I want to know what, if anything, othe...
[ 0.13664492964744568, -0.15811783075332642, 0.13076455891132355, 0.35284584760665894, -0.2161637246608734, -0.19106847047805786, 0.19232682883739471, 0.2041826695203781, -0.2198028862476349, -0.6776814460754395, -0.09056775271892548, 0.534604549407959, -0.21900489926338196, -0.0591911002993...
code.
[ 0.49412402510643005, 0.1709488481283188, -0.34349244832992554, 0.47293370962142944, 0.020621994510293007, -0.3459796905517578, 0.26370447874069214, 0.010925516486167908, 0.1232805997133255, -0.7033259272575378, -0.3256821036338806, 0.21533121168613434, -0.41662225127220154, 0.0147464526817...
I am trying to find all possible ways I could improve my website performance. I was considering enabling dynamic compression at the server level but was concerned by performance hits (no caching of compressed pages - corruption of files - overhead on the server). Should I just give up on the dynamic compression with II...
[ 0.3460715711116791, -0.03727462887763977, 0.4836157560348511, 0.010736030526459217, -0.061257101595401764, -0.3594597578048706, 0.30728402733802795, 0.3332027494907379, -0.2545018494129181, -0.6475726962089539, -0.30502602458000183, 0.9478507041931152, 0.004719131626188755, 0.1159099191427...
surprise that bandwidth costs are one of the top costs of running an Internet-facing datacenter. In addition, the bandwidth required to deliver requested content is a key factor in the perceived responsiveness of your application. > > > One of the most effective ways to reduce the bandwidth needed to deliver the appl...
[ -0.020989712327718735, -0.017598945647478104, 0.05104847624897957, 0.26968008279800415, -0.09620165824890137, -0.06289590150117874, 0.2971554398536682, 0.02563893049955368, -0.2597113251686096, -0.5821415185928345, -0.35199254751205444, 0.491599440574646, -0.014895445667207241, -0.07211068...
on desktop hardware are minor compared to the latency savings from sending less data. And since compression is based on Content-Encoding negotiation defined in the HTTP 1.1 protocol, enabling it is safe for clients that do not support compression—these clients simply receive an uncompressed version of the content.
[ -0.18262414634227753, 0.3065405488014221, 0.36580419540405273, 0.17231091856956482, 0.1401468962430954, -0.03752689063549042, 0.16892972588539124, -0.059950634837150574, -0.3088025748729706, -0.8708637952804565, -0.5478529334068298, 0.5845034718513489, -0.26666897535324097, -0.020763304084...
I am using the Model-View-Presenter pattern in a WinForms project and one problem (among many) that I am having is when the form tells the presenter to do something and then is un-reactive while the presenter goes of to do it. Fortunately in my project I have no problem with making all presenter calls asynchronous the ...
[ 0.41641128063201904, -0.09642236679792404, 0.4442603886127472, -0.21915055811405182, 0.03193654865026474, -0.32268834114074707, 0.34229838848114014, -0.13284704089164734, -0.3301536738872528, -0.658376932144165, 0.08256161957979202, 0.5868204236030579, -0.34204626083374023, 0.2731810808181...
some sort of a proxy on the presenter to do this rather than putting the thread creation in the WinForm I can only claim that I've thought about this (prior reading your question ;). First I'd rig the places where this actually matters; for example the DB access chokepoint. If there is a place that should not be execut...
[ 0.27535349130630493, -0.10828456282615662, 0.4187208414077759, 0.0668194517493248, -0.154045969247818, -0.17433413863182068, 0.22870132327079773, -0.06843883544206619, -0.11231959611177444, -0.6710172891616821, -0.08359241485595703, 0.4309004545211792, -0.13423268496990204, 0.2733007371425...
that. I guess you should at least make the type of execution of presenter function configurable via attribute which is then obeyed by proxy. (just in case you want something done in serial fashion). Canceling a task is actually presenter's problem, but you must have a reference object that tells what you want to stop...
[ 0.07227829843759537, -0.10411344468593597, 0.39462175965309143, 0.2345638871192932, -0.4672028124332428, -0.2299962192773819, 0.17602983117103577, 0.1398255079984665, -0.8259985446929932, -0.31401634216308594, 0.11861458420753479, 0.40954646468162537, -0.7219923138618469, 0.406783938407897...
supply the task with a suitable call-specific name when you start it; which implies way too much logic into View side -> Presenter should probably ask View to ask user which one of the tasks should be disposed of. My experience is that this is usually just worked around by using events (SCSF style). If doing it from s...
[ 0.29136648774147034, -0.20014484226703644, 0.018243439495563507, -0.016993163153529167, -0.3448123037815094, 0.15004757046699524, 0.14010603725910187, 0.04697108641266823, -0.26669609546661377, -0.663102388381958, -0.1666116565465927, 0.438821017742157, -0.006953559350222349, -0.0295304525...
I have a few years experience developing with oracle and have now moved to a place where they use SQL server (2005). Where would be a good place to learn things like SQL Server query optimisation, basic dba stuff and sql server gotchas for someone with my background. Thanks! This book is really useful becaseu it has b...
[ 0.08237632364034653, 0.3407001495361328, -0.08109857141971588, 0.11320994794368744, -0.13364537060260773, -0.17113721370697021, 0.3271098732948303, 0.005159449297934771, -0.04764648899435997, -0.6368792057037354, 0.16938020288944244, 0.47909095883369446, -0.0047941748052835464, -0.05002721...
they are big performance killers. There are several books on SQL Server performance tuning. A quick loo at AMazon should get you a bunch o fthem Red-gate provides good tools for comparing databases and also has a lot of good free content that you might want to check out. <http://www.red-gate.com/> Some good content...
[ 0.49995100498199463, 0.12615203857421875, -0.17110943794250488, 0.1030203253030777, -0.32960811257362366, -0.09908557683229446, 0.5341411232948303, 0.00028368819039314985, -0.2247212529182434, -0.7095048427581787, 0.35305771231651306, 0.797354519367218, 0.17656263709068298, 0.0925312563776...
I'm trying to optimize the size of my Delphi classes so that they take up as less memory as possible cause I'm creating a great number of them. The thing is, the classes themselves are pretty small but they aren't taking the space I was expecting. For example if I have ``` type MyClass = class private mMember1 ...
[ 0.026697885245084763, -0.2084595412015915, 0.18019355833530426, -0.026627786457538605, -0.14384406805038452, 0.3253803551197052, 0.3362020254135132, -0.046732451766729355, -0.2475854605436325, -0.681945264339447, 0.12696878612041473, 0.5673069357872009, -0.2889336049556732, 0.1598635911941...
and the same goes for the byte field... For records you can either use the {$A1} directive or declare it as a packed record to make it use up just the needed memory. Is there any way to make the same thing with classes? (Maybe some tutorial on how to correctly override NewInstance class method?) **Edit:** Ok, a litt...
[ 0.2407963126897812, -0.10817625373601913, 0.22113102674484253, 0.20864063501358032, -0.019918901845812798, -0.031102130189538002, 0.10461501777172089, -0.17835751175880432, -0.3309114873409271, -0.5911557674407959, 0.3096648156642914, 0.7252597212791443, -0.06368973851203918, 0.03650493174...
to allow reference counting) and they MUST support interfaces (hence not using packed records at all). This objects get passed around and being casts to several things, whithout the handlers knowing what they got. For example, I've got a class that receives a List of TItems and does something like: ``` if Supports(Li...
[ 0.28452789783477783, -0.02910436876118183, 0.26775288581848145, -0.044877730309963226, -0.15180979669094086, 0.04150005057454109, 0.2754930257797241, -0.5969074368476868, -0.32431507110595703, -0.7357425689697266, 0.24203141033649445, 0.4369969666004181, -0.40920528769493103, 0.11654245108...
much memory the "real" memory manager uses up for the class. In that way I'm pretty confident instances are not being packed. Finally this is in Delphi 7. I've tried to use the {$A1} precompiler directive with no luck, fields get aligned any way, and I may have several million instances as a worst case scenario so sav...
[ -0.1894981563091278, -0.09147284179925919, 0.36303287744522095, -0.19714173674583435, 0.011828354559838772, -0.18261903524398804, 0.13392673432826996, 0.02970895729959011, -0.640453040599823, -0.39076560735702515, 0.016387011855840683, 0.6570073366165161, -0.3696621358394623, 0.13516435027...
end; TMyClass = class private FData : TMyRecord; function GetMember1 : Integer; public property Member1 : Integer read GetMember1; // Later versions of Delphi allow "read FData.Member1;", not sure when from end; function TMyClass.GetMember1 : integer; begin result := FData.Member1; end; ```
[ 0.09234997630119324, -0.20832204818725586, 0.5205622315406799, -0.15792818367481232, 0.4201945960521698, 0.03764915093779564, 0.12333054840564728, -0.5322378873825073, -0.07606783509254456, -0.09465847164392471, -0.1795101761817932, 0.54913729429245, -0.49280866980552673, 0.336944401264190...
Here's my .htaccess file: ``` RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule .* ?p=$0 ``` Which should redirect to `mysite.com/?p=request` only if `request` is not a file. But, it's improperly matching a request like `http://mysite.com/auth.php?openid.ns=http%3A...
[ 0.0463644303381443, 0.39795178174972534, 0.40607890486717224, 0.05610844865441322, -0.0011231366079300642, -0.04634357988834381, 0.5513591170310974, 0.022833101451396942, -0.21713869273662567, -0.6634300351142883, -0.0069251758977770805, 0.4918912947177887, -0.04420928284525871, 0.17640471...
URL. My app was catching this error and spitting out a deceptive 404 which might be less frightening to the end user. Really had nothing to do with .htaccess after all. More details in my answer below. Wasn't a `AllowEncodedSlashes` problem. It was hitting a `mod_security` rule that forbid `http://` in the params to pr...
[ 0.3109234571456909, -0.0162934809923172, 0.4004514515399933, 0.0724862813949585, -0.36256250739097595, -0.18884719908237457, 0.6222988963127136, 0.3649804890155792, -0.42400044202804565, -0.11720680445432663, -0.027962395921349525, 0.26069533824920654, -0.2877744734287262, 0.38840055465698...
I have a component based on HBox that has multiple labels in it. I want to be able to set all the style properties, things like fontSize, fontWeight, color, etc. on my component and have them applied to all the Labels contained by it. Whats the best approach for this? I tried to have my component implement Label but th...
[ 0.5383421182632446, 0.22406981885433197, 0.3944556713104248, 0.2332254946231842, -0.17838700115680695, 0.026877932250499725, -0.3521030843257904, -0.09773670881986618, -0.14506065845489502, -0.5932645797729492, 0.29584047198295593, 0.5567919015884399, -0.12081408500671387, 0.20810034871101...
s("12 34"); istringstream ss(s); int x, y; ss >> x >> y; ``` Since this is homework, I urge you to explore the possibilities and figure out the complete code for yourself.
[ 0.2673477530479431, 0.013896017335355282, 0.33547350764274597, -0.09588402509689331, 0.14024624228477478, -0.24006852507591248, 0.6275792717933655, -0.11057941615581512, 0.056867651641368866, -0.7811082005500793, -0.42443153262138367, 0.1317475289106369, -0.2293318659067154, -0.27751085162...
Is there a setting by which I can get some scripts to load/execute automatically once the PHP starts like getting a few constant up into global memory. Also is there a global memory which is accessible across users? Also about memory is there no memory which is accessible by all users? One person set that another pers...
[ 0.2827158272266388, 0.06664593517780304, -0.07757443934679031, 0.3757869005203247, -0.43490007519721985, -0.21974574029445648, 0.06052006408572197, 0.1954435110092163, -0.5190197825431824, -0.6099364757537842, 0.42197689414024353, 0.5243600010871887, -0.06716049462556839, -0.10867659747600...
you start Apache, to store some globally shared values. If I'm wrong, please edit/comment. The short answer is: no, you can't do that. PHP isn't exactly a server that stays running waiting for client requests. It handles each HTTP request individually. The long answer is: well... you could do auto\_prepend\_file to d...
[ 0.5707625150680542, 0.09853897988796234, 0.15567521750926971, 0.21839672327041626, -0.38414594531059265, -0.22932912409305573, 0.05617716163396835, -0.24828167259693146, -0.2521279454231262, -0.6647906303405762, 0.12480466067790985, 0.5048189163208008, -0.15147362649440765, 0.0878251120448...
have the [Shared Memory](http://us2.php.net/shmop) functions enabled, but it's not guaranteed.
[ 0.4342280924320221, 0.05554354563355446, 0.3017829358577728, 0.1620728075504303, 0.3030352294445038, -0.5083550810813904, 0.36308395862579346, 0.15436139702796936, -0.3269680440425873, -0.490390419960022, -0.21321716904640198, 0.33941739797592163, 0.05271818861365318, -0.4237619638442993, ...
Right... this one had me baffled for a while today so maybe one of you SQL Server bright sparks can shed some light on this behaviour. We have a table `Phones`. In it, the phone numbers are stored as nvarchars and it contains numbers in International format, in only numeric format... so a US number `+1-(212)-999-9999`...
[ 0.2215958535671234, 0.29005005955696106, 0.4709550142288208, 0.3069196343421936, 0.29402056336402893, -0.2333448827266693, 0.04428970068693161, 0.041205622255802155, -0.1923847198486328, -0.18693652749061584, 0.25303173065185547, 0.2454800307750702, -0.19408048689365387, 0.3599646389484405...
column on the table which caused it to break. Consider the following test script. ``` IF EXISTS (SELECT * FROM sys.tables WHERE name = 'Phones') BEGIN DROP TABLE Phones END GO CREATE TABLE [dbo].[Phones] ( [ID] [int] IDENTITY(1,1) NOT NULL, [Mobile] [nvarchar](50) NOT NULL, CONSTRAINT [PK_Phones] PRIM...
[ -0.14060920476913452, -0.2195725291967392, 0.7745218276977539, -0.03987213596701622, 0.3160092234611511, -0.062562495470047, 0.23473943769931793, -0.7010539174079895, -0.21212458610534668, -0.46658939123153687, -0.4672524034976959, 0.537557065486908, -0.40857765078544617, -0.13500300049781...
ON ) ON [PRIMARY] ) ON [PRIMARY] GO DECLARE @biMobile_1 bigint DECLARE @biMobile_2 bigint SET @biMobile_1 = 12121111111 SET @biMobile_2 = 12129999999 Print 'Inserting Phone Number' INSERT INTO Phones (Mobile) VALUES ('12121111111') Print 'Selecting Phone Number' SELECT * FROM Phones WHERE Mobile = @biMobile_1 --Sele...
[ 0.13553650677204132, -0.009655834175646305, 0.5480366945266724, 0.0879993662238121, 0.011934295296669006, 0.49734723567962646, 0.017649231478571892, -0.7277519702911377, -0.27892953157424927, -0.5825083255767822, -0.5228426456451416, 0.41458746790885925, -0.8798083662986755, -0.13419871032...
error returned is ``` Error converting data type nvarchar to bigint. ``` Now this seems completely bonkers behaviour. What I thought would happen is 1. SQL realises its comparing 2 different data types in the `WHERE` clause 2. It would attempt to convert the @variable to the datatype of the column 3. If it fails, ...
[ 0.16430729627609253, 0.09290985763072968, 0.37738293409347534, -0.284789115190506, -0.27868255972862244, -0.04240584746003151, 0.6164076924324036, -0.287693589925766, -0.21947015821933746, -0.4558650255203247, 0.018156057223677635, 0.5834094285964966, -0.3192058801651001, 0.065099902451038...
comparison, and will return that row. 4. If it hits a value in the column, that it can't convert, it bombs, returns whatever data it has found so far, and doesn't continue on through the table. **Can anyone clarify what the reasoning is behind this logic, and if theres any particular order of precedence that SQL Serve...
[ -0.05543486028909683, 0.12452305108308792, 0.2012409269809723, -0.012264326214790344, -0.49025747179985046, 0.28619837760925293, -0.00656488910317421, -0.405068576335907, -0.27010980248451233, -0.5555858612060547, 0.20662559568881989, 0.31171074509620667, -0.4048689603805542, 0.13963642716...
the param type. It just follows the type precedence in the link I gave. This could mean the param gets converted to the column type, if the type precedence dictates so.
[ -0.28692856431007385, 0.021483799442648888, 0.5773631930351257, -0.0357675738632679, -0.3253192603588104, 0.17177759110927582, 0.0013078175252303481, -0.2707771062850952, -0.25561806559562683, -0.49076151847839355, -0.30383920669555664, 0.08203592896461487, -0.5391044020652771, 0.263559252...
I'm looking for an open source, pure Python library that supports the [SyncML](http://en.wikipedia.org/wiki/SyncML) protocol, at least enough to implement a SyncML client. There's <https://sourceforge.net/projects/pysyncml/>: "The pysyncml library is a pure-python implementation of the SyncML adapter framework and prot...
[ 0.19624948501586914, -0.13750720024108887, 0.24687792360782623, 0.14379805326461792, -0.01958942599594593, -0.06914886087179184, -0.012854695320129395, 0.30160462856292725, -0.06115294247865677, -0.4526834189891815, 0.02157140150666237, 0.21138982474803925, -0.4972715973854065, -0.10259284...
This is probably a really simple thing, but I don't know how to implement the following. ``` package mods.client.resultSelector; import com.google.gwt.event.dom.client.MouseDownEvent; import com.google.gwt.event.dom.client.MouseDownHandler; import com.google.gwt.user.client.ui.AbsolutePanel; import com.google.gwt.us...
[ -0.06266454607248306, -0.1662643998861313, 0.5623487234115601, -0.3999236524105072, 0.029240015894174576, 0.5528325438499451, 0.40385565161705017, -0.30169543623924255, -0.16553325951099396, -0.5035285949707031, -0.2841176390647888, 0.7343937158584595, -0.17334134876728058, -0.070609465241...
{ System.out.println("onMouseDown()"); } } ``` I want to have what is effectively a absolutePanel that can accept mouse events. However, within the Composite object I don't know how to tie the the handler I have written (the onMouseDown() thing) with the abs variable. To put it succinctly, I want the abs...
[ 0.007989679463207722, -0.09628254920244217, 0.4101763665676117, -0.15200184285640717, 0.22189433872699738, -0.22655132412910461, 0.31352177262306213, -0.032084472477436066, -0.059563279151916504, -0.5223960280418396, -0.09056377410888672, 0.7561843991279602, -0.43667033314704895, -0.134991...
I have not seen it mentioned in the searches I have done. In this case, extending the Composite is probably not the best idea unless you're deliberately blocking access to the AbsolutePanel you create in the constructor. If you extend the AbsolutePanel you'll be able to reuse the code to add/remove widgets etc.. Here...
[ 0.07171761244535446, -0.032115206122398376, 0.630363941192627, -0.14039693772792816, 0.08447679877281189, -0.044509366154670715, 0.37275999784469604, -0.3258756101131439, -0.11920896917581558, -0.40138310194015503, -0.2991553544998169, 0.8255311250686646, -0.1916869729757309, -0.1063502654...
width) { System.out.println("MousyAbsolutePanel being created with width:" + width); this.setWidth(String.valueOf(width)); this.setHeight("100%"); this.setStyleName("mousyAbsolutePanel"); this.addMouseDownHandler(this); } /** * MouseDownHandler */ public...
[ 0.0497148223221302, -0.21458092331886292, 0.5209303498268127, -0.40857961773872375, 0.22727297246456146, 0.11511512845754623, 0.44263163208961487, -0.4376579523086548, -0.327460914850235, -0.5479448437690735, -0.44933271408081055, 0.4578586518764496, 0.022712862119078636, 0.111759230494499...
to add handlers to the panel */ public HandlerRegistration addMouseDownHandler(MouseDownHandler handler) { return addDomHandler(handler, MouseDownEvent.getType()); } } ``` Then you can access MousyAbsolutePanel the same way you access an AbsolutePanel, but with the additional event handlers, ...
[ 0.2526409327983856, -0.2902749478816986, 0.24799931049346924, -0.10932030528783798, 0.21161548793315887, -0.2136317789554596, 0.25080081820487976, -0.31055060029029846, -0.043892934918403625, -0.5799540877342224, -0.27745431661605835, 0.6894971132278442, -0.21288828551769257, -0.0812302157...
simple problem ( I hope) I have a div: with css: .break{position:relative;height:1px;background-color:#555555;margin:5px 10px 10px 10px;} This div shows up as a line about 10-20px thick in IE 6??? ...works fine in any other browser any tips would be appreciated,..thanks.. Andrew setting ``` overflow: hidden; `...
[ -0.29315871000289917, 0.10998118668794632, 0.4695122241973877, -0.12309946864843369, 0.22162385284900665, 0.1009555384516716, 0.43925485014915466, 0.0018006059108301997, -0.2903797924518585, -0.7596244812011719, -0.28314563632011414, 0.46557724475860596, -0.36770179867744446, -0.1542536914...
Can any one tell me if its possible to create a stored procedure in oracle which accept array as an input parameter and how ? Yes. Oracle calls them collections and there's a variety of collections you can use. A simple array example using a VARRAY. ``` DECLARE TYPE Str_Array IS VARRAY(4) OF VARCHAR2(50); v_arra...
[ 0.14467895030975342, 0.032026637345552444, 0.05154572054743767, -0.019411219283938408, -0.12162423878908157, 0.31782054901123047, 0.25298091769218445, -0.7260061502456665, -0.23791895806789398, -0.4530961811542511, -0.15270787477493286, 0.34171316027641296, -0.38505423069000244, 0.41152209...
Str_Array PROCESS_ARRAY(Str_Array('John','Paul','Ringo','George')); END; ```
[ 0.08734722435474396, 0.32085758447647095, 0.0982411801815033, -0.3041353225708008, 0.18227851390838623, 0.5723382234573364, 0.3517034649848938, -0.3245057463645935, -0.2860662341117859, -0.4313581585884094, -0.3408491611480713, 0.16053824126720428, -0.30460214614868164, 0.6128604412078857,...
I am trying to use an update panel together with a gridview, but I am having some difficulties sorting the gridview. I tried to follow @dfowler in this [thread](https://stackoverflow.com/questions/213148/sort-columns-of-gridview-in-asp-net-c) But when I try to sort I get this error when trying to databind the sorted ...
[ 0.26470258831977844, 0.04858257994055748, 0.24907158315181732, 0.052937813103199005, -0.1927957832813263, -0.06977496296167374, 0.38647744059562683, 0.16699551045894623, -0.2178795039653778, -0.8235651850700378, 0.061222050338983536, 0.528063178062439, -0.0048231384716928005, 0.35225942730...
situations like this cropping up again and again. Some of the problems you'll find are: * Not strongly typed * Inflexible (as you've noted) * Muddy up the presentation code I've taken to doing all data access in the code behind and haven't looked back.
[ -0.04478684440255165, 0.12679897248744965, -0.00868983380496502, 0.04317978769540787, -0.04567717760801315, -0.024736013263463974, 0.4101816415786743, 0.46388089656829834, -0.3507400155067444, -0.8372313976287842, 0.025052765384316444, 0.5590505599975586, -0.12441136687994003, -0.101354330...
I'd like to create a COM server that can hold it state across the calls. My goal is to have a thread-safe in-memory database. And provide an access to it via COM interface. Is that possible? You're correct in that the fine grained control you're looking for is not possible and requires the code behind. ASP.NET's data ...
[ 0.39054521918296814, -0.1480197161436081, 0.2014666348695755, 0.4442659020423889, -0.004321793094277382, -0.0048086089082062244, 0.13502556085586548, 0.24472340941429138, -0.26104360818862915, -0.8700771927833557, 0.11500098556280136, 0.5558449029922485, -0.14767318964004517, 0.22952139377...
code I've taken to doing all data access in the code behind and haven't looked back.
[ 0.28978872299194336, 0.21011872589588165, -0.024022098630666733, 0.08746078610420227, 0.0827661007642746, 0.0339796282351017, 0.3519614338874817, -0.06230770796537399, -0.051271721720695496, -0.48412662744522095, -0.20677056908607483, 0.3450480103492737, -0.009336755611002445, 0.1279484778...
Is there a way pass values from other controls (e.g. "selected value of dropdownlist", "value from query string") to a User Control using a property within the tag itself and NOT from the code behind? Yes you can, you just need to use the `<% %>` in the presentation code. Your code would look something like this: ``` ...
[ -0.04739876836538315, -0.33795323967933655, 0.4562789499759674, 0.282289981842041, -0.025498224422335625, -0.11130284518003464, -0.20805862545967102, -0.2484893947839737, -0.22396320104599, -0.42800846695899963, -0.03931198641657829, 0.2508651316165924, -0.0915105864405632, -0.220422491431...
different binding mechanisms you can use.
[ 0.4917983114719391, 0.21967172622680664, -0.08444328606128693, 0.15262742340564728, -0.22104588150978088, 0.13671283423900604, -0.14043782651424408, -0.4111384451389313, -0.2255192995071411, -0.7193443775177002, 0.3380771577358246, 0.5155911445617676, -0.39115288853645325, 0.23032508790493...
I have classes ``` public class FooKeyedCollection : KeyedCollection<FooType,Foo> { } public enum FooType { FooType1, FooType2, FooType3 } public Foo { public FooType Type { get; set; } public string Value { get; set; } } ``` When I add items to my FooKeyedCollection, I can index them by FooType, bu...
[ 0.10013147443532944, 0.1733274906873703, 0.5312411785125732, -0.3539278507232666, 0.14401958882808685, 0.5694270133972168, 0.17885905504226685, -0.34023892879486084, -0.07911994308233261, -0.5308591723442078, -0.025042032822966576, 0.2603611946105957, -0.21716690063476562, 0.33340781927108...
= "someValue"; foo.Add( myFoo ); Foo myFooByType = foo[FooType.FooType3]; Foo myFooByIndex = foo[0]; // <-- exception thrown here } ``` The result of executing this code is an exception when attempting to retrieve the item by integer index. I hope to expose the FooKeyedCollection as part of a public API, a...
[ 0.28067320585250854, 0.27774783968925476, 0.43250277638435364, -0.28341051936149597, 0.16308511793613434, 0.03242260217666626, 0.44183629751205444, -0.2932092249393463, -0.1789112687110901, -0.44601142406463623, -0.07542041689157486, 0.5826523303985596, -0.3602224886417389, 0.1356750577688...
IList<Foo> self = this; return self[index]; } set { (IList<Foo>)[index] = value; } } ``` This will allow you to index by integer value. Using the enum explicitly will fall back to the KeyedCollection implementation.
[ -0.10137227177619934, -0.15555380284786224, 0.37105682492256165, -0.3029402792453766, -0.06481260061264038, 0.08078168332576752, 0.0086995679885149, -0.5611444711685181, -0.02849729359149933, -0.5270808339118958, 0.141997292637825, 0.7618787288665771, -0.6321617364883423, -0.04190689325332...
My application (the bootstrap application for an installer that I'm working on needs to launch some other applications (my installer and third party installers for my installer's prerequisites) and wait for them to complete. In order to allow the GUI to do screen updates while waiting for an app to complete, I put a me...
[ 0.6243914365768433, 0.06386184692382812, 0.6568751931190491, -0.40532273054122925, 0.32377415895462036, -0.054219238460063934, 0.17431245744228363, -0.2594400644302368, 0.06199398264288902, -0.7150596976280212, -0.10938362777233124, 0.6719511151313782, -0.3494614362716675, -0.0465559549629...
&StartupInfo, &ProcessInfo)) { ::GetExitCodeProcess(ProcessInfo.hProcess, &dwExitCode); if (bWait) while (dwExitCode == STILL_ACTIVE) { // In order to allow updates of the GUI to happen while we're waiting for // the application to finish, we must run a mini message pump here to // allow m...
[ 0.06187482178211212, -0.13345806300640106, 0.8984776735305786, -0.22224882245063782, 0.6578381061553955, 0.01601291075348854, 0.3591635525226593, -0.27508345246315, -0.23126475512981415, -0.6835312247276306, -0.29344677925109863, 0.8157743811607361, -0.39528581500053406, 0.0168503075838089...
performs much like MFC's main message pump found in CWinThread::Run(). MSG msg; while (::PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) { if (!PumpMessage()) { // a termination message (e.g. WM_DESTROY) // was processed, so we need to stop waiting dwExitCode ...
[ 0.07081154733896255, -0.41921013593673706, 0.6258828043937683, -0.23891818523406982, 0.3430270552635193, -0.20284636318683624, 0.6239531636238098, -0.4573362171649933, -0.021748917177319527, -0.4012742042541504, -0.1709754914045334, 0.5731874108314514, -0.4077928960323334, 0.16199287772178...
::PostQuitMessage(0); break; } } // let MFC do its idle processing LONG nIdle = 0; while (OnIdle(nIdle++)) ; if (dwExitCode == STILL_ACTIVE) // was a termination message processed? { // no; wait for .1 second
[ 0.06502048671245575, -0.5152450203895569, 0.7542967200279236, -0.44634658098220825, 0.20357273519039154, 0.022118983790278435, 0.37080034613609314, -0.24181249737739563, -0.45926016569137573, -0.33984294533729553, -0.27581918239593506, 0.11367680877447128, -0.39171096682548523, 0.474848628...
to see if the application is finished ::WaitForSingleObject(ProcessInfo.hProcess, 100); ::GetExitCodeProcess(ProcessInfo.hProcess, &dwExitCode); } } ::CloseHandle(ProcessInfo.hProcess); ::CloseHandle(ProcessInfo.hThread); } else dwExitCode = ::GetLastError(); ``` The problem that I'm h...
[ -0.17151199281215668, 0.31033197045326233, 1.011225938796997, -0.26760274171829224, 0.34823641180992126, 0.036300599575042725, 0.4467221200466156, -0.23091992735862732, -0.07759460061788559, -0.7746905088424683, -0.20501859486103058, 0.5734103322029114, -0.42784401774406433, 0.229400441050...
statement, so I don't know what's going on here to cause the window and menu handles to go south. If I don't have the message pump, everything works fine, except that the GUI can't update itself while the wait loop is running. Does anyone have any ideas as to how to make this work? Alternatively, I'd like to launch a ...
[ 0.6667872071266174, -0.26819467544555664, 0.3041976988315582, 0.19255952537059784, -0.1315760612487793, 0.008083613589406013, 0.736258327960968, 0.11054765433073044, -0.2658880949020386, -0.47224438190460205, 0.13939596712589264, 0.8050941824913025, -0.22927793860435486, -0.029112771153450...
either case.) I've also posted this question on the Microsoft forums, and thanks to the help of one Doug Harris at Microsoft, I found out my problem with my HWND and HMENU values was, indeed due to stale CWwnd\* and CMenu\* pointers (obtained using GetMenu() and GetDialogItem() calls. Getting the pointers again after l...
[ 0.6304802298545837, 0.1334446668624878, 0.08989303559064865, 0.16231290996074677, 0.03437412902712822, -0.03798728063702583, 0.26919302344322205, -0.25866302847862244, -0.16349799931049347, -0.45093998312950134, 0.08863098174333572, 0.40756720304489136, -0.26699063181877136, -0.13763533532...
exit code. My loop now looks like this: ``` if (bWait) { // In order to allow updates of the GUI to happen while we're // waiting for the application to finish, we must run a message // pump here to allow messages to go through and get processed. LONG nIdleCount = 0; for (;;) { MSG msg; if (::Pee...
[ -0.20673999190330505, -0.33506882190704346, 1.0041669607162476, -0.37059441208839417, 0.4116305112838745, 0.02351016364991665, 0.6301195621490479, -0.2341877520084381, -0.13142023980617523, -0.8275819420814514, -0.17528563737869263, 0.33763450384140015, -0.615474283695221, 0.24256646633148...
if (!PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) { DWORD nRes = ::MsgWaitForMultipleObjects(1, &ProcessInfo.hProcess, FALSE, INFINITE, QS_ALLEVENTS); if (nRes == WAIT_OBJECT_0) break;
[ -0.3604211211204529, -0.2188221663236618, 0.513658881187439, -0.23910509049892426, 0.34012269973754883, 0.1044476181268692, 0.6616772413253784, -0.447111576795578, -0.14972740411758423, -0.31311771273612976, -0.7434974312782288, 0.24724474549293518, -0.2977805435657501, 0.16966858506202698...
} } } } ::GetExitCodeProcess(ProcessInfo.hProcess, &dwExitCode); ``` \*That Web site, if you're curious, is: <http://members.cox.net/doug_web/threads.htm>
[ 0.09780678153038025, 0.10593144595623016, 0.3834919035434723, 0.0006074269185774028, 0.27797529101371765, -0.12850195169448853, 0.004279269836843014, 0.2783413231372833, -0.7613025307655334, -0.3640534281730652, 0.00286506162956357, 0.07683706283569336, -0.22491662204265594, 0.467649012804...
I'm playing around with .NET's configuration support (the ConfigurationManager class and related support classes). I would like to write an application that, once installed: * Has default settings in foo.exe.config (in Program Files). * The user may later override the settings with nondefault values which should be pe...
[ 0.5582334995269775, 0.027848107740283012, 0.31722989678382874, -0.11849229782819748, 0.2027467042207718, -0.25448986887931824, 0.200352281332016, 0.14294365048408508, -0.1866648644208908, -0.6847839951515198, 0.11929859220981598, 0.7098272442817688, -0.3840743899345398, 0.08238977938890457...
into bumps and I'm wondering if I'm taking the right approach. The following code produces the runtime exception "ConfigurationSection properties cannot be edited when locked". ``` using System; using System.Configuration; namespace DemoAppSettingsProblem { class Program { static void Main(string[] a...
[ -0.09670008718967438, 0.286952406167984, 0.4511924088001251, -0.08024471998214722, 0.5279332399368286, 0.2685457468032837, 0.14897717535495758, -0.11400274187326431, -0.6052054762840271, -0.7319673895835876, -0.29194653034210205, 0.8206011056900024, -0.13796667754650116, 0.1858444213867187...
null ) userConfig.AppSettings.Settings.Remove("foo"); userConfig.AppSettings.Settings.Add("foo", "The string is foo."); userConfig.Save(ConfigurationSaveMode.Modified); // exception! } } } ``` The problem is that the .NET-defined `<appSettings>` section is decl...
[ 0.23511816561222076, 0.05868934467434883, 0.3083280324935913, -0.1606137603521347, 0.3683720827102661, 0.09695933759212494, 0.5868731141090393, -0.14891615509986877, -0.4763021767139435, -0.47394466400146484, -0.40496987104415894, 0.31919020414352417, -0.6769267916679382, 0.110968597233295...
assume I need to define my own section, with `allowExeDefinition=MachineToLocalUser`. But as far as I can tell from the MSDN docs, that means I need to create my own configuration class, derived from `ConfigurationSection`. The examples there point me toward more work than I was expecting, which usually sets off my ala...
[ 0.21718531847000122, 0.1569758504629135, 0.1929011344909668, -0.029870610684156418, 0.4371066093444824, -0.01002828311175108, 0.3437782824039459, -0.0708618238568306, -0.28769373893737793, -0.9126784205436707, -0.02606935426592827, 0.760359525680542, -0.26036450266838074, -0.04806756600737...
I am playing with class generation ( one class for a table - inheritance etc. not to be considered for now ... ). So I copied shamelessly from [here](http://codebetter.com/blogs/david.hayden/archive/2006/02/05/137569.aspx) the Reflection.Emit code. Reworked it to be generated per table in a given database and created t...
[ 0.2932908236980438, 0.035029761493206024, 0.1101527139544487, -0.21454834938049316, -0.2629564702510834, -0.007580578792840242, 0.5169351696968079, -0.054032959043979645, -0.11839480698108673, -0.5725715756416321, 0.15220150351524353, 0.38649845123291016, -0.02445421740412712, 0.3938059210...
project" ( I do not need any run-time generation ) and also would like to enjoy Intellisense. What pitfalls , difficulties and problems might arrise from this type of approach, any better suggestions for those loosely described requirements ?! Here is the Generation code of the console app creating the assemblies : ...
[ 0.3065234422683716, 0.04313475266098976, 0.3172031044960022, 0.07751965522766113, -0.03630799055099487, -0.1020040437579155, 0.07665993273258209, -0.2776435911655426, -0.00010344646580051631, -0.5712751150131226, -0.3260779082775116, 0.32376718521118164, -0.2098444402217865, -0.06949972361...
using System.Reflection.Emit; namespace GenerateAssemblies { class Program { private static readonly ILog logger = LogManager.GetLogger ( typeof ( Program ) ); static void Main ( string[] args ) { DOMConfigurator.Configure(); //tis configures the l...
[ 0.09458006173372269, -0.38798409700393677, 0.3400099277496338, -0.14541146159172058, 0.23527748882770538, 0.28493884205818176, 0.5109270215034485, -0.5667746663093567, -0.411029189825058, -0.25914183259010315, -0.3928956091403961, 0.7155304551124573, -0.6963810324668884, 0.2726842164993286...
logger.Debug ( "APP START" ); DataTable dtTables = Program.GetTablesFromDb ( "POC" ) ; foreach (DataRow dr in dtTables.Rows) { string strTableName = dr[0].ToString () ; CodeEmitGeneratingAssemblies.DllGenerator.WriteXmlAndTxtFileOutOfDataTableByName ( strTableName...
[ -0.4477933645248413, -0.13315781950950623, 0.6341487765312195, -0.3609202802181244, 0.08785667270421982, 0.28615766763687134, 0.36768192052841187, -0.316763311624527, -0.274821937084198, -0.6440646052360535, -0.6409504413604736, 0.5601344108581543, -0.5771872401237488, 0.3500257134437561, ...
} Console.WriteLine ( " Should have now all the dll's " ); Console.ReadLine (); } //eof method static DataTable GetTablesFromDb ( string strDbName ) { DataTable dt = new DataTable ( "tables" ); string connectionString = "Integrated
[ -0.17600183188915253, -0.2963464558124542, 0.6660100221633911, -0.02652667835354805, 0.28440794348716736, -0.11655605584383011, -0.006342052016407251, -0.3481762409210205, -0.20345380902290344, -0.6432608366012573, -0.32741039991378784, 0.43565502762794495, -0.5525538325309753, 0.324312746...
Security=SSPI;Persist Security Info=False;Initial Catalog=" + strDbName + ";Data Source=ysg"; using (SqlConnection connection = new SqlConnection ( connectionString )) { SqlCommand command = connection.CreateCommand (); command.CommandText = string.Format ( "SELECT name fro...
[ -0.15367214381694794, -0.3089503049850464, 0.5147210359573364, -0.14296409487724304, 0.18135271966457367, -0.16390319168567657, 0.36860665678977966, -0.3725097179412842, -0.40678003430366516, -0.36002129316329956, -0.4876709580421448, 0.48856812715530396, -0.24913671612739563, 0.3849012553...
( CommandBehavior.CloseConnection ) ); } return dt; } //eof method } //eof class namespace CodeEmitGeneratingAssemblies { public class DllGenerator { private static readonly ILog logger = LogManager.GetLogger ( typeof ( DllGenerator ) );
[ -0.09381961077451706, -0.5761579275131226, 0.256150484085083, -0.03560555726289749, 0.13638044893741608, -0.06634388864040375, 0.2857897877693176, -0.3680673837661743, -0.07311470061540604, -0.6400471329689026, -0.6083437204360962, 0.7890855669975281, -0.7448211908340454, 0.107945099472999...
public static void WriteXmlAndTxtFileOutOfDataTableByName (string strDataTableName) { DOMConfigurator.Configure (); //tis configures the logger DataTable tableData = new DataTable ( strDataTableName ); string connectionString = "Integrated Security=SSPI;Persist Security Info=Fal...
[ -0.2200787365436554, -0.18816661834716797, 0.6672070026397705, -0.08068971335887909, 0.35831278562545776, 0.20305319130420685, 0.47446319460868835, -0.4965965151786804, -0.33435139060020447, -0.37910839915275574, -0.4568834900856018, 0.5496358871459961, -0.3588247001171112, 0.2851558029651...
{ SqlCommand command = connection.CreateCommand (); command.CommandText = string.Format ( "SELECT * FROM [" + strDataTableName + "]"); logger.Debug ( "command.CommandText is " + command.CommandText ); connection.Open (); tableData.Load ( command.ExecuteReader...
[ -0.20868492126464844, -0.08560201525688171, 0.503494381904602, -0.15010380744934082, 0.14908890426158905, -0.11006566882133484, 0.21482327580451965, -0.24442718923091888, -0.19197426736354828, -0.22245053946971893, -0.2719095051288605, 0.4383673667907715, -0.46776166558265686, 0.5092642307...
tableData.WriteXml ( strDataTableName + ".xml" ); tableData.WriteXmlSchema ( strDataTableName + ".xsd" ); } //eof method public static void CreateAssembly ( string strDataTableName ) { AppDomain currentDomain = Thread.GetDomain (); AssemblyName myAssemblyName = n...
[ -0.08341629058122635, -0.09405680000782013, 0.7595776319503784, -0.23240910470485687, 0.5084258317947388, 0.14674748480319977, 0.4171399474143982, -0.060637883841991425, -0.28094613552093506, -0.5497754812240601, -0.368257611989975, 0.38159024715423584, -0.6098170876502991, 0.5796056389808...
myAssemblyName.Name = strDataTableName; AssemblyBuilder builder = currentDomain.DefineDynamicAssembly ( myAssemblyName, AssemblyBuilderAccess.RunAndSave ); builder.AddResourceFile ( "TableXml", strDataTableName + ".xml" );
[ -0.1783197522163391, -0.01943444088101387, 0.4460639953613281, -0.14180825650691986, 0.2729036211967468, 0.19781838357448578, 0.41581350564956665, -0.27160540223121643, 0.045604415237903595, -0.5784156322479248, -0.2638826370239258, 0.2467273771762848, -0.33470022678375244, 0.4150465130805...
builder.AddResourceFile ( "TableXsd", strDataTableName + ".xsd" ); builder.Save ( strDataTableName + ".dll" ); } } //eof class } //eof namespace } //eof namespace ``` You get all the problems of using a (relational)database-driven oo design: * not enough abstraction, no inheritan...
[ 0.15114854276180267, 0.09310951083898544, -0.0168126430362463, -0.10796227306127548, -0.08751736581325531, 0.13613680005073547, 0.4105719327926636, -0.3814031779766083, 0.015124347992241383, -0.9599078893661499, -0.14438588917255402, 0.6032356023788452, -0.2922142744064331, 0.2569104731082...