text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
If I am evaluating a Python string using eval(), and have a class like: ``` class Foo(object): a = 3 def bar(self, x): return x + a ``` What are the security risks if I do not trust the string? In particular: 1. Is `eval(string, {"f": Foo()}, {})` unsafe? That is, can you reach os or sys or something unsafe...
[ 0.02797745354473591, 0.2433207780122757, -0.014045271091163158, -0.2502279579639435, 0.018799589946866035, -0.055739495903253555, 0.7763911485671997, -0.42647066712379456, -0.036412563174963, -0.23048940300941467, -0.06307753175497055, 0.6839594841003418, -0.3612203598022461, -0.1290417164...
are some unsafe strings like "[0] \* 100000000" I don't care about, because at worst they slow/stop the program. I am primarily concerned about protecting user data external to the program. Obviously, `eval(string)` without custom dictionaries is unsafe in most cases. You cannot secure eval with a blacklist approach l...
[ 0.3664478063583374, 0.1539890170097351, -0.10168839246034622, 0.1457110196352005, 0.15178734064102173, -0.3428642451763153, 0.8084637522697449, 0.19275768101215363, -0.4351847171783447, -0.2700843811035156, 0.05074454843997955, 0.8352760076522827, -0.266762912273407, 0.10753998160362244, ...
I have a Java applet consisting of a wizard-like form with three steps. At the final step, the user can click a "finish" button. I want that button to cause the web browser to navigate to a specific URL. **Question:** Is there a way to cause the browser to navigate to a specific URL, in such a way that it will work ac...
[ 0.3184775114059448, 0.3824351131916046, 0.5622440576553345, -0.5136364102363586, 0.11488219350576401, 0.01837822236120701, 0.275760680437088, -0.09437631070613861, 0.0054507204331457615, -0.7807801365852356, 0.023901721462607384, 0.34715893864631653, -0.345282644033432, 0.04100845754146576...
page to the specified URL: ``` getAppletContext().showDocument(url); ``` Additionally you can pass a [target](http://java.sun.com/javase/6/docs/api/java/applet/AppletContext.html#showDocument(java.net.URL,%20java.lang.String)) parameter. To visit a relative URL you can use: ``` URL url = new URL(getCodeBase().getP...
[ 0.21513189375400543, 0.053187161684036255, 0.9649103283882141, -0.21770623326301575, 0.08965691924095154, 0.07605210691690445, 0.09349078685045242, 0.07684660702943802, -0.2767488658428192, -0.7648493647575378, -0.6030712723731995, 0.29336267709732056, -0.21504180133342743, 0.1653622686862...
work in every major browser since Java version 1.1.
[ 0.34352606534957886, 0.12193498015403748, -0.006158389151096344, -0.500342845916748, -0.035032112151384354, -0.15658661723136902, 0.3306402266025543, 0.30401042103767395, -0.09981725364923477, -1.0127785205841064, -0.5008485317230225, 0.17784492671489716, -0.22169773280620575, -0.111842721...
I have the tag functionality working ok but can't generate a tag\_cloud in my controller: ----------------- ``` def tag_cloud @tags = Article.tag_counts # returns all the tags used end ``` in the view: ------------ ``` <% tag_cloud Article.tag_counts.sort { |x, y| x.name <=> y.name }, %w(x-small small normal la...
[ 0.33323734998703003, -0.2134382575750351, 0.835691511631012, 0.031154528260231018, 0.10503092408180237, -0.23536735773086548, 0.09219953417778015, -0.2789022624492645, -0.09051132947206497, -0.8153499960899353, 0.005469584837555885, 0.6346243619918823, -0.23573309183120728, -0.144260436296...
the property to "org.w3c.flute.parser.Parser" as suggested by javamonkey79, you would specify: -Dorg.w3c.css.sac.parser=org.w3c.flute.parser.Parser
[ -0.3052597641944885, 0.34411153197288513, 0.032525986433029175, -0.33300408720970154, 0.14857284724712372, 0.015400438569486141, 0.13364334404468536, -0.24325241148471832, -0.44021275639533997, -0.3638496398925781, -0.17783436179161072, 0.30140116810798645, -0.0317147858440876, 0.102859526...
For full screenshots, I use this code: ``` form1.Hide; sleep(500); bmp := TBitmap.Create; bmp.Height := Screen.Height; bmp.Width := Screen.Width; DCDesk := GetWindowDC(GetDesktopWindow); BitBlt(bmp.Canvas.Handle, 0, 0, Screen.Width, Screen.Height, DCDesk, 0, 0, SRCCOPY); form1.Show ; FileName := 'Screenshot_'+FormatDa...
[ 0.32015764713287354, -0.25276902318000793, 1.0116889476776123, -0.2750726342201233, -0.18095006048679352, 0.0779513344168663, 0.3863614499568939, -0.29195836186408997, -0.4901474118232727, -0.7578096985816956, -0.09668254107236862, 0.7252861261367798, -0.11404651403427124, 0.00850410107523...
window! When I executed your code, my Delphi IDE was captured and as it is on fullscreen by default, it created the illusion of a fullscreen screenshot. (Even though your code is mostly correct) Considering the above steps, I was successfully able to create a single-window screenshot with your code. Just a hint: You...
[ 0.21490691602230072, -0.1973940134048462, 0.6949484944343567, -0.03586491569876671, -0.07061154395341873, -0.12547819316387177, 0.4677177369594574, -0.03899882361292839, -0.37375932931900024, -0.7923953533172607, -0.14395014941692352, 0.6877726316452026, -0.25763997435569763, -0.0108981626...
the client area. var hWin: HWND; dc: HDC; bmp: TBitmap; FileName: string; r: TRect; w: Integer; h: Integer; begin form1.Hide; sleep(500); hWin := GetForegroundWindow; if FullWindow then begin GetWindowRect(hWin,r); dc := GetWindowDC(hWin) ; end else begin Windows.GetClientRect(h...
[ 0.04370353743433952, -0.25315505266189575, 1.1567597389221191, -0.22842183709144592, 0.13737986981868744, 0.029748305678367615, 0.35640326142311096, -0.275180459022522, -0.33767372369766235, -0.6141664385795593, -0.5231042504310608, 0.6387701034545898, -0.09266900271177292, 0.2814088761806...
0, SRCCOPY); form1.Show ; FileName := 'Screenshot_'+FormatDateTime('mm-dd-yyyy-hhnnss',now()); bmp.SaveToFile(Format('C:\Screenshots\%s.bmp', [FileName])); ReleaseDC(hwin, DC); bmp.Free; end; ``` **EDIT 2:** As requested I'm adding a better version of the code, but I'm keeping the old one as a reference. Yo...
[ 0.2772124409675598, -0.10342658311128616, 0.9724438786506653, -0.31175512075424194, 0.19135645031929016, -0.11424220353364944, 0.5221986770629883, -0.3537011742591858, -0.1732754111289978, -0.726651132106781, -0.46106210350990295, 0.7097352147102356, -0.4578878581523895, 0.2144157886505127...
Width: Integer; Height: Integer; begin Form1.Hide; try Application.ProcessMessages; // Was Sleep(500); Win := GetForegroundWindow; if FullWindow then begin GetWindowRect(Win, WinRect); DC := GetWindowDC(Win); end else begin Windows.GetClientRect(Win, WinRect); DC :...
[ -0.030128685757517815, -0.3362260162830353, 0.943229615688324, -0.4090402126312256, 0.34987083077430725, 0.09005185216665268, 0.421939879655838, -0.38661840558052063, -0.20826677978038788, -0.6577849984169006, -0.4175378680229187, 0.6378710269927979, 0.21799929440021515, 0.3689048588275909...
Bmp := TBitmap.Create; try Bmp.Height := Height; Bmp.Width := Width; BitBlt(Bmp.Canvas.Handle, 0, 0, Width, Height, DC, 0, 0, SRCCOPY); FileName := 'Screenshot_' + FormatDateTime('mm-dd-yyyy-hhnnss', Now()); Bmp.SaveToFile(Format('C:\Screenshots\%s.bmp', [FileNam...
[ 0.3239743113517761, -0.22138646245002747, 0.6996771097183228, -0.20908482372760773, 0.004628361202776432, 0.4089333415031433, 0.35577118396759033, -0.31113144755363464, -0.49048683047294617, -0.6449916958808899, -0.5098466873168945, 0.34781646728515625, -0.43873709440231323, 0.002717741532...
end; finally ReleaseDC(Win, DC); end; finally Form1.Show; end; end; ```
[ 0.05538225546479225, -0.07042892277240753, 0.3440827429294586, -0.13453128933906555, -0.254191517829895, -0.1220460832118988, 0.044016510248184204, -0.001669283490628004, 0.09890694171190262, -0.33336421847343445, -0.8149158954620361, 0.2144976109266281, -0.3046291172504425, 0.485137313604...
I’m trying to build a parallel implementation of a [min-max search](http://en.wikipedia.org/wiki/Minimax). My current approach is to materialize the tree to a small depth and then do the normal thing from each of these nodes. The simple way to do this is to compute the heuristic value for each leaf and then sweep up a...
[ 0.12624989449977875, -0.22000664472579956, 0.1190059632062912, -0.15451936423778534, 0.07857955992221832, 0.08652959018945694, 0.29086774587631226, -0.09006795287132263, -0.15943920612335205, -0.5512038469314575, 0.01278714369982481, 0.28781142830848694, -0.18684792518615723, -0.0339460037...
the tree and check if a leaf should be pruned. **The problem is that it's totally broken.** (2 days of debugging to notice that, darn I feel stupid) Now for the question: *Is there a way to build a min-max tree that allows the leafs to be evaluated in random order and also allows alpha/beta pruning?* Check out *pa...
[ 0.12769456207752228, -0.08668794482946396, -0.04865290969610214, 0.2731728255748749, 0.00029251453815959394, -0.10025392472743988, 0.234751358628273, -0.05012154206633568, -0.430061936378479, -0.21542614698410034, -0.23012690246105194, 0.3092266917228699, -0.2124009132385254, -0.0130319837...
I am using JavaScript to store values in a stack. The problem is that the stack value remains active until the page is refreshed. When the page is refreshed, the value in the stack value gets set to 'Undefined'. Is it better to implement a place to permanently store the stack values? Then even if the page is refreshed...
[ 0.14119499921798706, 0.09726971387863159, 0.38176611065864563, -0.4952336251735687, -0.07332491129636765, 0.07901851087808609, 0.2899356782436371, -0.4492233097553253, -0.16479067504405975, -0.5690405368804932, 0.16633662581443787, 0.34044504165649414, -0.23053550720214844, 0.0416359417140...
arr.splice(0,arr.length); // For deleting the stack ``` How to I refer to the PHP stored values in JavaScript? Another way to solve this is to not refresh the page, but reload its body, a form or a div element using Ajax. jQuery makes this *especially* simple: ``` $('body').load(url); ``` That way you can have per...
[ 0.26021695137023926, 0.13463015854358673, 0.46920740604400635, -0.12077925354242325, -0.3967083990573883, -0.2528041899204254, 0.3943513333797455, -0.1700638234615326, -0.21039921045303345, -0.5638630390167236, 0.034079425036907196, 0.5304877758026123, -0.3043108284473419, 0.08984693884849...
I notice that Project 2007 has the functions that allow operations that can be undone to be placed in a single stack item, or "undo transaction". [For example:](http://msdn.microsoft.com/en-us/library/ms477952.aspx) ``` Application.OpenUndoTransaction "Create 6 tasks" Dim i As Integer For i = 1 To 6 ActiveProject....
[ -0.2674467861652374, 0.058961171656847, 0.5489839911460876, -0.28268715739250183, -0.05469249561429024, 0.15843626856803894, 0.4430331289768219, -0.4324592053890228, -0.6046090126037598, -0.45415157079696655, -0.20413413643836975, 0.4355905055999756, -0.4227198660373688, 0.0858087167143821...
if they have to click on Undo several times if they make a mistake. Although those specific functions don't appear to exist, does anyone know if / how this can be done in some way? You can simulate transactional behavior in Word by overwriting the Undo and Redo command routines in VBA (I don't think that overwriting bu...
[ -0.009391920641064644, -0.11682427674531937, 0.34564921259880066, -0.12213040143251419, 0.20447024703025818, -0.1630706489086151, 0.3445683419704437, -0.16565611958503723, -0.4994361102581024, -0.44744765758514404, 0.055377840995788574, 0.6838419437408447, -0.14457154273986816, 0.208759799...
the marker is gone. Redo is working the same way. This mechanism supports transactional undo/redo of all modifications done to the document content. However, to allow undo/redo of modifications to the document properties a special mechanism needs to be implemented using the SetCustomProp macro. Document properties shou...
[ 0.07217345386743546, -0.12077673524618149, 0.9432289004325867, -0.09379623830318451, 0.3251282870769501, -0.1279333382844925, 0.20701338350772858, -0.41829419136047363, -0.3406740725040436, -0.5040273070335388, -0.21870554983615875, 0.6407330632209778, -0.31094497442245483, -0.054926078766...
for quite a while With Word 2003 (it's not tested with Word 2007, so be prepared for surprise ;) ``` Option Explicit ' string constants for Undo mechanism Public Const BM_IN_MACRO As String = "_InMacro_" Public Const BM_DOC_PROP_CHANGE As String = "_DocPropChange_" Public Const BM_DOC_PROP_NAME As String = "_DocProp...
[ -0.568211555480957, -0.1424698680639267, 0.669880747795105, -0.36868709325790405, 0.14615994691848755, 0.11589109897613525, 0.3925747871398926, -0.23402556777000427, -0.3238365948200226, -0.4092600643634796, -0.18748900294303894, 0.9719410538673401, -0.3249208629131317, -0.1278508752584457...
not the toolbar command '----------------------------------------------------------------------------------- Public Sub EditUndo() ' Catches Ctrl-Z 'On Error Resume Next Dim bRefresh As Boolean bRefresh = Application.ScreenUpdating Application.ScreenUpdating = False Do If ActiveDocument.Bo...
[ -0.15766149759292603, -0.23573622107505798, 1.118691086769104, -0.24670366942882538, -0.025601325556635857, -0.15946440398693085, 0.27374857664108276, -0.31966888904571533, -0.13217958807945251, -0.32540979981422424, -0.42076539993286133, 0.8659890294075012, -0.2988312840461731, 0.26118844...
ActiveDocument.Bookmarks(BM_DOC_PROP_NAME).Range.Text strOldValue = ActiveDocument.Bookmarks(BM_DOC_PROP_OLD_VALUE).Range.Text ActiveDocument.CustomDocumentProperties(strPropName).Value = strOldValue End If Loop While (ActiveDocument.Undo = True) _ And ActiveDocument.Bookmark...
[ -0.14512772858142853, -0.2894194722175598, 1.0196747779846191, -0.25775691866874695, 0.538806140422821, -0.04542319104075432, 0.4742853045463562, -0.46830490231513977, -0.22629931569099426, -0.5275919437408447, -0.528825581073761, 0.9370905160903931, -0.3825700581073761, -0.168018057942390...
not the toolbar command '----------------------------------------------------------------------------------- Public Sub EditRedo() ' Catches Ctrl-Y Dim bRefresh As Boolean bRefresh = Application.ScreenUpdating Application.ScreenUpdating = False Do If ActiveDocument.Bookmarks.Exists(BM_DOC_PROP...
[ -0.13689756393432617, -0.3551214635372162, 1.0022894144058228, -0.2229211926460266, -0.033509742468595505, -0.08700817078351974, 0.2870893180370331, -0.4407409429550171, -0.1852983832359314, -0.3153062164783478, -0.4254409968852997, 0.8621573448181152, -0.3674251139163971, 0.15842336416244...
ActiveDocument.Bookmarks(BM_DOC_PROP_NAME).Range.Text strNewValue = ActiveDocument.Bookmarks(BM_DOC_PROP_NEW_VALUE).Range.Text ActiveDocument.CustomDocumentProperties(strPropName).Value = strNewValue End If Loop While (ActiveDocument.Redo = True) _ And ActiveDocument.Bookmark...
[ -0.03607091307640076, -0.1292964518070221, 0.9514806866645813, 0.08155845105648041, 0.3435373306274414, -0.07799676805734634, 0.14130468666553497, -0.40953946113586426, -0.26452553272247314, -0.48932525515556335, -0.7458651065826416, 0.7611732482910156, -0.2530374526977539, -0.027949428185...
strOldValue = "" oDoc.CustomDocumentProperties.Add _ Name:=strName, LinkToContent:=False, Value:=Trim(strValue), _ Type:=msoPropertyTypeString GoTo exitHere existsAlready: strOldValue = oDoc.CustomDocumentProperties(strName).Value oDoc.CustomDocumentProperties(strName).Value = strValue ...
[ -0.15152966976165771, 0.03764684125781059, 1.1066817045211792, -0.19107100367546082, 0.10622794181108475, 0.012510021217167377, 0.453793466091156, -0.5391097068786621, -0.24616503715515137, -0.4397655725479126, -0.5777238011360168, 0.4378035068511963, -0.15292991697788239, 0.08096493780612...
True End If Dim oRange As Range Set oRange = ActiveDocument.Range oRange.Collapse wdCollapseEnd oRange.Text = " " oRange.Bookmarks.Add "DocPropDummy_", oRange oRange.Collapse wdCollapseEnd oRange.Text = strName oRange.Bookmarks.Add BM_DOC_PROP_NAME, oRange oRange.Collapse wdC...
[ 0.055882133543491364, -0.1730702817440033, 0.901810348033905, -0.38284170627593994, 0.30617842078208923, -0.11065422743558884, 0.9861805438995361, -0.44075727462768555, 0.33321255445480347, -0.34425726532936096, -0.5010413527488708, 0.8737228512763977, -0.10207182914018631, 0.3856713175773...
Set oRange = ActiveDocument.Bookmarks(BM_DOC_PROP_NEW_VALUE).Range ActiveDocument.Bookmarks(BM_DOC_PROP_NEW_VALUE).Delete If Len(oRange.Text) > 0 Then oRange.Delete Set oRange = ActiveDocument.Bookmarks(BM_DOC_PROP_OLD_VALUE).Range ActiveDocument.Bookmarks(BM_DOC_PROP_OLD_VALUE).Delete If Len(oRang...
[ -0.0830576941370964, -0.3400822877883911, 0.9848154187202454, -0.47168833017349243, 0.38210564851760864, 0.22962035238742828, 0.19170458614826202, -0.31458088755607605, -0.016905564814805984, -0.6128923296928406, -0.7345730066299438, 0.8746252059936523, -0.5459946990013123, -0.028889032080...
Procedure : SampleUsage ' Purpose : Demonstrates a transaction '----------------------------------------------------------------------------------- Private Sub SampleUsage() On Error Resume Next ' mark begin of transaction ActiveDocument.Range.Bookmarks.Add BM_IN_MACRO Selection.Text = "Hello World...
[ -0.10882341116666794, -0.2931063175201416, 0.3915141820907593, -0.08023682981729507, 0.22722099721431732, -0.10429566353559494, 0.25278955698013306, -0.35329577326774597, 0.011508864350616932, -0.20916029810905457, -0.20444218814373016, 0.4393821358680725, -0.4262492060661316, 0.0295916944...
What happens here: ``` double foo( const double& x ) { // do stuff with x } foo( 5.0 ); ``` 1. Does the compiler create an anonymous variable and sets its value to 5.0? 2. Does the x reference a memory location in read-only memory? This is a weird phrasing, I know... **edit**: I forgot the const keyword... A te...
[ 0.40064767003059387, 0.3839089274406433, 0.28466159105300903, -0.2676241397857666, 0.2278040200471878, -0.34842485189437866, 0.4325634837150574, 0.0006589292315766215, -0.1797318309545517, -0.22596098482608795, -0.13797974586486816, 0.5656507015228271, -0.5899305939674377, 0.25842174887657...
I have a string that is like below. ``` ,liger, unicorn, snipe, ``` how can I trim the leading and trailing comma in javascript? because I believe everything can be solved with regex: ``` var str = ",liger, unicorn, snipe," var trim = str.replace(/(^,)|(,$)/g, "") // trim now equals 'liger, unicorn, snipe' ```
[ -0.4117208421230316, 0.15695121884346008, 0.32530707120895386, -0.15763011574745178, -0.058146774768829346, 0.2709619998931885, 0.3542369306087494, -0.164784237742424, -0.20001396536827087, -0.5836645364761353, -0.37671539187431335, 0.629723846912384, -0.44627052545547485, -0.3325656652450...
I got a native library that needs to be added to *java.library.path*. With JVM argument *-Djava.library.path=path...* I can set the path as I want. My problem is that my other library (pentaho reporting) searches fonts based on the default java.library.path (including system directories etc) and the manual setting ove...
[ 0.2007720172405243, 0.09462140500545502, 0.17498396337032318, 0.05206357315182686, -0.11025895923376083, -0.19613812863826752, 0.5059822797775269, -0.2352791279554367, -0.2093932032585144, -0.9544873237609863, 0.042650941759347916, 0.6772233247756958, -0.17310768365859985, -0.1174543201923...
Eclipse. (The deployment is done with JNLP and there I can use *nativelib* under *resources*) Had forgotten this issue... I was actually asking with Eclipse, sorry for not stating that originally. And the answer seems to be too simple (at least with 3.5; probably with older versions also): Java run configuration's Arg...
[ 0.23536857962608337, 0.0026302540209144354, 0.29104092717170715, -0.32669374346733093, -0.20296725630760193, -0.2653801441192627, 0.11250010877847672, -0.16029013693332672, -0.1594723016023636, -0.812717854976654, -0.1358070969581604, 0.7406798601150513, -0.48185333609580994, -0.1440337598...
When a JSP finishes execution, will all variables declared in the JSP page be put up for garbage collection? If I declare a number of memory intensive Hashtables in the JSP, and I let the JSP finish execution without setting the variables to null beforehand, will the object stay in memory even after the JSP has finishe...
[ -0.0020913544576615095, 0.06350919604301453, 0.49850067496299744, 0.0036448186729103327, -0.14756625890731812, -0.28727924823760986, 0.3305736482143402, -0.1086176335811615, -0.31155672669410706, -0.5430303812026978, -0.4704541862010956, 0.5609170794487, -0.34551122784614563, -0.1370870471...
still consuming memory, only the reference count decreases by 1. If the reference count is 0 the garbage collector will free the memory.
[ 0.09973106533288956, 0.3017154932022095, 0.6329870223999023, 0.09678466618061066, 0.05619760602712631, 0.024829136207699776, 0.35413751006126404, -0.026917697861790657, -0.4517243206501007, -0.6765810251235962, -0.23725108802318573, 0.44892385601997375, -0.2724369466304779, 0.5915319323539...
I'm hoping someone can help with a problem...I don't work in anything related to programming, but we needed some asset tracking pretty badly, so in my spare time (not very much, we average 10hrs days) and with the tools at hand (a 600mhz pile running winXP) i built a little classic ASP site to handle all the tracking a...
[ 0.43965521454811096, 0.15142618119716644, 0.004976677242666483, 0.07933973520994186, 0.10763418674468994, -0.21104472875595093, 0.38285958766937256, 0.33528250455856323, -0.016891246661543846, -0.6092824935913086, 0.1679592877626419, 0.5539298057556152, 0.1334635466337204, -0.0196515433490...
JET drivers and go with MS SQL Server 2000 Express (don't forget, 600mhz and not much RAM). I started rebuilding, and everything seemed to be working great (and much faster) until I started getting errors. I figured out that for some queries, only a couple of the Columns would return any data. **For Example**: I have...
[ -0.12631335854530334, 0.15295881032943726, 0.337917298078537, 0.2778072953224182, -0.13337543606758118, 0.23165099322795868, -0.030068228021264076, -0.05772756412625313, 0.019214700907468796, -0.5917384624481201, 0.19450590014457703, 0.8245997428894043, -0.4644891917705536, 0.1692915111780...
only gID and colID fields have data, everything else is nothing. I opened up the Web Data Administrator app and run the query in there, and it returns everything nice and fine. So then i decided there is a bug somewhere, so I write a quick test page and same problem (except this time its gID and iLength that return dat...
[ 0.2067168653011322, -0.06770960241556168, 0.07138999551534653, 0.20995166897773743, -0.1365814507007599, 0.12666407227516174, 0.15718328952789307, 0.22163920104503632, -0.17026567459106445, -0.7519065737724304, 0.3577115535736084, 0.520854115486145, -0.27441373467445374, 0.1666999310255050...
this on my throw away computer at home, which actually has a modern processor and decent amounts of RAM, so its not the machine at all. Thanks for the help...i listen to the podcast and it seems like its been server/sql week for a while now, figured i'd ask someone here... ----EDIT---- Changed the code...a version...
[ 0.008004040457308292, 0.3806774318218231, 0.2563508152961731, -0.0363929308950901, -0.12566109001636505, 0.09932472556829453, 0.38421952724456787, -0.15746177732944489, -0.2910252511501312, -0.6266748905181885, -0.12185382097959518, 0.44580402970314026, -0.23776666820049286, 0.386269301176...
varchar)" sqltxt="select iDesc, gID from ShopItems order by gID asc" set rs1=db1.execute(sqltxt) rs1.movefirst do until rs1.eof gID=rs1("gID") 'iLength=rs1("iLength") iDesc=rs1("iDesc") response.write("<br>gID: " & gid & "<br>") response.write("<br>iLength: " & iLength & "<br>") response.write("<br>iDe...
[ -0.009448621422052383, -0.11444475501775742, 0.6575832366943359, -0.4821605384349823, -0.3286261260509491, 0.2133258730173111, 0.4900060296058655, -0.6048286557197571, 0.023356018587946892, -0.4684047996997833, -0.15325993299484253, 0.7838797569274902, -0.3310307562351227, 0.01474459283053...
If my loop produces output we can track things down. ``` <% Option Explicit On Error Goto 0 Dim db1, sqltxt, rs1 Dim gID, iLength, iDesc, arrRS Set db1 = Server.CreateObject("ADODB.Connection") 'db1.Open "Provider=MSDASQL;Driver={SQL Server};Server=Phsion;Database=master;" db1.Open "Provider=MSDASQL;DSN=SHOPWEB;" 's...
[ 0.047896742820739746, -0.0357174389064312, 0.5011688470840454, -0.15443812310695648, -0.24604730308055878, 0.41411447525024414, 0.5396701097488403, -0.4625024199485779, -0.1214977353811264, -0.5509646534919739, -0.2685548663139343, 0.35128483176231384, -0.53969407081604, 0.3249714970588684...
response.write("iLength: " & iLength & "") ' response.write("iDesc: " & iDesc & "") ' rs1.movenext ' loop ' rs1.close : set rs1=nothing sqltxt="select iDesc, gID from ShopItems order by gID asc" set rs1=db1.execute(sqltxt) '//Dump the recordset into an array arrRS = rs1.GetRows() '//We can close the rs...
[ 0.11676360666751862, -0.046357687562704086, 0.8172248005867004, -0.2756403088569641, -0.4560675024986267, 0.34300053119659424, 0.42903074622154236, -0.5847413539886475, -0.3717687427997589, -0.4133096933364868, -0.11465436220169067, 0.34858208894729614, -0.6002690196037292, 0.1993709504604...
'//Loop through all the columns For j = 0 To UBound(arrRS,1) '//write out each column in the row Response.Write("<td>" & arrRS(j,i) & "</td>") '//Look I will be honest, I can't test this so your might have to swap the i and the j to get a full output Next Response.Write("...
[ 0.21766576170921326, 0.16955551505088806, 0.4060050845146179, -0.3083857297897339, -0.20456843078136444, 0.4221537113189697, 0.6024349331855774, -0.5291520357131958, -0.08803309500217438, -0.5253496170043945, -0.14146097004413605, 0.5825966000556946, -0.5484357476234436, 0.1580464988946914...
I have recently been asked to develop an application that will have to integrate with Sage Line 50 financial software. I've done some googling and I am surprised at the lack of info on interfacing with Sage from Java or .Net. Is Sage such a black box that you need to sign up to a Sage Developer program before you g...
[ 0.5316247940063477, 0.12765131890773773, 0.08216269314289093, -0.1888212412595749, -0.23075716197490692, -0.038378145545721054, -0.052228786051273346, -0.21041744947433472, 0.1630992740392685, -0.3786521852016449, 0.12221047282218933, 0.40499281883239746, 0.18754813075065613, -0.2248954474...
.Net if you want to use the SDK. Problem is that the SDK is only available under the Developer programme which starts at £1500: [Here's the brochure](https://www.sage.co.uk/PDF/sage_developers_programme_brochure.pdf). However the developer programme does give you free copies of the Sage software for development purpo...
[ 0.5513477921485901, -0.1307026445865631, 0.3119570314884186, -0.028457054868340492, -0.21011513471603394, -0.043013960123062134, 0.27378034591674805, -0.3188689947128296, 0.10031037032604218, -0.4908382296562195, -0.15816077589988708, 0.3926132321357727, 0.18310001492500305, -0.13327352702...
I have created an array in the implementation of my class loginController. Now I want to use this array (with its objects) in another class of my project. What is the right way to import it? It is not supported natively by jQuery, but you can write your own custom selector using [hasEvent plugin](http://plugins.jquery....
[ 0.0346798300743103, -0.19788645207881927, 0.27101457118988037, -0.06158905103802681, -0.30478590726852417, -0.19743147492408752, -0.10123076289892197, -0.1747351884841919, -0.4082433581352234, -0.6836927533149719, -0.10813618451356888, 0.6728187799453735, -0.319183886051178, -0.02127774246...
In the search for resources to become a better developer, I am looking for good examples of how to structure the code in n-tier applications. Like... What does the business object do and look, how does it interface with the data access layer etc. How does the UI interface the business layer, and does it interface the...
[ 0.48442065715789795, 0.03134141489863396, 0.22851306200027466, 0.3089846670627594, -0.11211556196212769, 0.18837720155715942, -0.11069817841053009, -0.145268052816391, -0.36047640442848206, -0.6799261569976807, -0.2148921936750412, 0.08890984207391739, -0.17097090184688568, 0.1113847419619...
I am looking for best practices for creating collections made from anonymous types. There are several approaches - [this](http://www.eggheadcafe.com/software/aspnet/31356077/using-anonymous-types-in.aspx) one and most answers on [this](http://blog.sb2.fr/post/2008/11/25/Anonymous-Type-Collection-with-C-35.aspx) thread...
[ 0.23335683345794678, 0.10003232210874557, 0.18235532939434052, 0.07843468338251114, -0.15088026225566864, -0.1317591667175293, 0.03904145956039429, -0.18410465121269226, -0.386688232421875, -0.45832157135009766, 0.06209981441497803, 0.2463855892419815, -0.20001310110092163, 0.1692596971988...
an anonymous type (acting as a tuple). I need these anonymous types to be put in a collection and then sort them for further work. Other approaches I have considered: 1. Use an object[] or ArrayList (losing the benefit of the anonymous type) 2. Creating a wrapper class for the required items (removing the need for th...
[ 0.2282942682504654, -0.13340666890144348, 0.09251575171947479, 0.01707674376666546, -0.11310914903879166, -0.28862830996513367, 0.23704767227172852, -0.12987183034420013, -0.21722671389579773, -0.5958490967750549, -0.14501048624515533, 0.38952478766441345, -0.4605976343154907, -0.024344041...
most Linq extension methods such as .Select won't work: **Code sample** ``` foreach (Item item in myItems) { foreach (Confirmation confirmation in item.GetConfirmations(true)) { if (lastParentId != item.ParentId) { lastParentId = item.ParentId; parentObject = new Parent...
[ -0.12912584841251373, -0.29173192381858826, 0.5123551487922668, -0.1654028445482254, 0.338506817817688, 0.03867337852716446, 0.1370568871498108, -0.33930274844169617, 0.05762206017971039, -0.35077887773513794, -0.44400590658187866, 0.44837716221809387, -0.07636960595846176, 0.3248629271984...
if (parentObject!= null) { itemHolder.Add(parentObject.Rate); } sortConfirmations.Add(confirmation.Date, itemHolder); } } // Use sortConfirmations ``` **Resolution** I ended up using a generic dictionary to collect the related items together and using .OrderBy() to sort them...
[ -0.0816953256726265, -0.01632637344300747, 0.37107446789741516, 0.024790864437818527, 0.1123369112610817, 0.16732485592365265, 0.14089559018611908, -0.31095242500305176, -0.1840423196554184, -0.4796029031276703, -0.05894758552312851, 0.13314630091190338, -0.07415745407342911, 0.33460712432...
the > collection I would like to collect > related objects in an anonymous type > (acting as a tuple). I need these > anonymous types to be put in a > collection and then sort them for > further work. That sounds like: ``` var list = (from item in collection from related in item.Relationship ...
[ -0.02643412910401821, -0.06912203878164291, 0.4511503577232361, 0.19854269921779633, -0.21616113185882568, -0.029367366805672646, 0.08000018447637558, -0.26778629422187805, -0.12862595915794373, -0.7474915385246277, -0.18779517710208893, 0.3844354748725891, -0.46882879734039307, 0.17647890...
I have a GridView on my aspx page which displays a collection of objects defined by the following class ``` public class Item { public string ItemName{get; set;} public object ItemValue{get; set;} } ``` Then in my aspx markup I have something like this ``` <asp:GridView ID="MyTable" runat="server"> <Col...
[ 0.22289583086967468, -0.09615054726600647, 0.5418950915336609, 0.007046917453408241, -0.1590806394815445, 0.0702790841460228, -0.09235845506191254, -0.15201027691364288, -0.18377113342285156, -0.8537120819091797, 0.06666410714387894, 0.3264598846435547, -0.0656580924987793, 0.1513169258832...
string it will return the string unchanged, or if it holds a DateTime it will displays as DateTime.ToShortDateString().* Not sure if you can use a BoundField, but if you change it to a TemplateField you could use a formatting function like in [this link](http://www.vbforums.com/showthread.php?t=545143). ie something l...
[ -0.07433827966451645, -0.393245130777359, 0.6353668570518494, -0.17443810403347015, -0.04159333556890488, -0.24015158414840698, 0.045463141053915024, -0.18092601001262665, -0.15381038188934326, -0.44319137930870056, -0.3287835717201233, 0.5825686454772949, -0.2272450029850006, 0.0924098789...
the datavalue is null/is a double ``` protected void OnRowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { DataRowView drv = e.Row.DataItem as DataRowView; Object ob = drv["ItemValue"]; if (!Convert.IsDBNull(ob) ) { ...
[ -0.087692029774189, -0.27551352977752686, 0.6773343086242676, -0.26066693663597107, 0.22510644793510437, 0.37427714467048645, 0.36804118752479553, -0.39421382546424866, -0.016256680712103844, -0.4568081796169281, -0.3934059143066406, 0.5518779754638672, -0.24898333847522736, 0.358023941516...
{ if (dVal > 3f) { TableCell cell = e.Row.Cells[1]; cell.CssClass = "heavyrow";
[ -0.24958881735801697, -0.22736121714115143, 0.5331564545631409, -0.5896322727203369, 0.338749498128891, 0.051334772258996964, 0.2215624302625656, -0.5234387516975403, -0.2525908648967743, -0.4756893515586853, -0.47380372881889343, 0.24406379461288452, -0.3093724846839905, 0.157137393951416...
cell.BackColor = System.Drawing.Color.Orange; } } } } } ```
[ -0.0769842341542244, 0.14498844742774963, 0.1965104043483734, -0.39509013295173645, 0.3954474925994873, -0.0007748740608803928, 0.08059630542993546, -0.05969584360718727, -0.1393318772315979, -0.548956573009491, -0.3851339817047119, 0.3995508849620819, -0.5539109110832214, 0.15490561723709...
I have created an iPhone app where you start in a NavController and after a couple of levels you select an option from the table and an animated view pops in that has a tabbarcontroller at its root. This is a completely seperate view that replaces the navcontroller. You tab around and when you want to go back to the ...
[ 0.05364968627691269, -0.3899388313293457, 0.7166332602500916, 0.2660079896450043, 0.019485201686620712, 0.1627206802368164, 0.2082870602607727, 0.016369586810469627, -0.14726516604423523, -0.5817875862121582, 0.03880000486969948, 0.47170647978782654, -0.3873414993286133, 0.2464302331209182...
seems you continually increase the reference count for the view controllers. Then when you call release on the tabBarController reference it will only release the view controller of the selected tab or any tabs you haven't viewed yet, and it takes one of the retain count on the others tabs viewcontrollers. This means y...
[ 0.45189955830574036, -0.059593070298433304, 0.5930389761924744, 0.2004387229681015, -0.1259736716747284, -0.3042793869972229, 0.10161733627319336, -0.1978810578584671, -0.46430614590644836, -0.41256096959114075, -0.07852742820978165, 0.5491762757301331, -0.5305867195129395, 0.4541813731193...
that prints out the retain count for itself. Start the app and press back and forth on the First and Second tab buttons and watch the log the retain count just keeps increasing. So I am wondering if there is a way to release a tab bar controller and have it release all of its view controllers at the same time? Not sur...
[ 0.47631141543388367, -0.06360820680856705, 1.0248218774795532, -0.0929461196064949, 0.16900299489498138, -0.17157205939292908, 0.08110644668340683, -0.24913600087165833, -0.17294344305992126, -0.43288007378578186, 0.0659538060426712, 0.9750764966011047, -0.026897700503468513, -0.0155593305...
as object) As String 'custom enter code hereformatting goes here End Function ``` Or you could do something in the OnRowCreated event of the gridview, like in [this link](http://www.netomatix.com/development/gridviewformatcolumn.aspx) ``` <asp:GridView ID="ctlGridView" runat="server" OnRowCreated="OnRowCreated" ...
[ 0.23243147134780884, -0.3836800158023834, 0.746368408203125, -0.21352268755435944, -0.2106817662715912, -0.010098705068230629, 0.15240533649921417, -0.4884898066520691, -0.2371847927570343, -0.5467574596405029, -0.42112839221954346, 0.4691051244735718, -0.335387259721756, 0.379856318235397...
{ double dVal = 0f; if (Double.TryParse(ob.ToString(), out dVal)) { if (dVal > 3f) {
[ -0.08629488199949265, -0.21468856930732727, 0.4223405718803406, -0.691582202911377, 0.17680127918720245, 0.2967350482940674, 0.52348393201828, -0.7178670763969421, 0.1941249668598175, -0.48704254627227783, -0.43837931752204895, 0.6937675476074219, -0.426282674074173, -0.16194844245910645, ...
TableCell cell = e.Row.Cells[1]; cell.CssClass = "heavyrow"; cell.BackColor = System.Drawing.Color.Orange; } } } } } ```
[ -0.4090211093425751, 0.003290323307737708, 0.5748723149299622, -0.32125741243362427, 0.2822302579879761, -0.04309089854359627, -0.029230762273073196, -0.22432740032672882, -0.46144676208496094, -0.511342465877533, -0.3563147783279419, 0.13643094897270203, -0.4635482132434845, 0.06887917220...
I have a process that runs on cron every five minutes. Usually, it takes only a few seconds to run, but sometimes it takes several minutes. I want to ensure that only one version of this is running at a time. I tried an obvious way... ``` File.open("/tmp/indexer_lock.tmp",'w') do |f| exit unless f.flock(File::LOCK_...
[ 0.5573136806488037, 0.10088412463665009, 0.5944130420684814, 0.07298115640878677, -0.0388605073094368, -0.041959915310144424, 0.45773354172706604, -0.06365912407636642, -0.35023772716522217, -0.8065964579582214, 0.14426979422569275, 0.46567782759666443, -0.14407885074615479, 0.370519965887...
(you could use <http://daemons.rubyforge.org/>) You could have your indexer (assuming its indexer.rb) be run through a wrapper script named script/index for example: ``` require 'rubygems' require 'daemons' Daemons.run('indexer.rb') ``` And your indexer can do almost the same thing, except you specify a sleep inte...
[ 0.3131399154663086, -0.18038129806518555, 0.1413871943950653, -0.04525735229253769, -0.025906914845108986, -0.13304811716079712, 0.23828285932540894, -0.11863260716199875, -0.4514561891555786, -0.6381522417068481, 0.007096056826412678, 0.24085842072963715, -0.4018217623233795, 0.3002981245...
The new Silverlight 3 beta includes the ability to run Out-of-Browser applications. The demos so far show this only inside a special frame. Does anyone know how I can run Siverlight 3 controls inside a (WPF) application? No, you can not embed out-of-browser silverlight into WPF. The sllauncher.exe standalone frame has ...
[ 0.28436702489852905, -0.13001464307308197, 0.5257374048233032, -0.12063725292682648, -0.3615156412124634, -0.26217564940452576, 0.5151910781860352, -0.23404833674430847, 0.08513879776000977, -0.6070368885993958, -0.046013131737709045, 0.34118524193763733, -0.4393658936023712, -0.1890436857...
way to do this the address for this app is: C:\Program Files\Microsoft Silverlight\3.0.40307.0\sllauncher.exe As others have said, however, you can embed a silverlight control inside of an html page and that inside a WebBrowser element. Be cautious with this method, however, since there is currently no x64 support fo...
[ 0.4460130035877228, 0.12683558464050293, 0.4076758623123169, 0.2802802622318268, 0.042274925857782364, -0.44843074679374695, 0.4666498899459839, 0.0610528290271759, -0.14216700196266174, -0.5508209466934204, 0.02700338140130043, 0.23311081528663635, -0.473271906375885, -0.04264143109321594...
I am reading files in various formats and languages and I am currently using a small encoding library to take attempt to detect the proper encoding (<http://www.codeproject.com/KB/recipes/DetectEncoding.aspx>). It's pretty good, but it still misses occasionally. (Multilingual files) Most of my potential users have ve...
[ 0.29185357689857483, 0.3159509003162384, -0.0797777771949768, 0.14825688302516937, 0.02413608692586422, 0.08334844559431076, 0.27894124388694763, 0.31773093342781067, -0.07448121905326843, -0.974335789680481, -0.10536559671163559, 0.3106732666492462, -0.12315276265144348, -0.09438340365886...
Click here to try a different encoding! (Well that's the concept anyway) What would be the best way to implement something like that? --- Edit: Looks like I didn't express myself clearly enough. By "cycling through the encoding", I don't mean "how to loop through encodings?" What I meant was "how to let the user t...
[ 0.6080148816108704, -0.10773813724517822, -0.11879593133926392, 0.18220552802085876, -0.11100427806377411, -0.013735255226492882, 0.203611359000206, 0.09182814508676529, -0.28231680393218994, -0.5547436475753784, 0.342087984085083, 0.35446223616600037, -0.4863636791706085, 0.09125609695911...
a different encoding. The user just need to keep clicking until the right encoding is found. (whatever encoding looks good for the user will do fine). As long as the user can click "next", he has a reasonable chance of solving his problem. What I have found so far involves converting the string to bytes using the curr...
[ 0.18204909563064575, -0.016051098704338074, 0.14738872647285461, 0.164116770029068, -0.0178914163261652, 0.3221023380756378, 0.04257061704993248, 0.15825898945331573, -0.16969354450702667, -0.9287044405937195, 0.11422771215438843, 0.48460623621940613, -0.25227347016334534, 0.11634709686040...
read a string and return it using a different encoding, something like "render(string, encoding)". --- Thanks a lot for the answers! Read the file as bytes and use then the Encoding.GetString Method. ``` byte[] data = System.IO.File.ReadAllBytes(path); Console.WriteLine(Encoding.UTF8.GetString(data)...
[ 0.06851040571928024, 0.05266418308019638, 0.6442418694496155, 0.13038791716098785, 0.07788745313882828, -0.024460896849632263, 0.22858953475952148, -0.2715380787849426, -0.2001120150089264, -0.8225342631340027, -0.33057188987731934, 0.5191199779510498, -0.2518599331378937, 0.05624187737703...
Encoding.GetEncoding(...).GetString(data) for further processing.
[ -0.027040379121899605, -0.2076691836118698, 0.2769574224948883, 0.5133442282676697, 0.01563471555709839, 0.18579183518886566, -0.12644481658935547, -0.2054470181465149, -0.15623784065246582, -0.9396535158157349, -0.597758412361145, 0.4676101505756378, -0.3350900113582611, -0.18977025151252...
OK, this is a slightly weird question. We have a touch-screen application (i.e., no keyboard). When users need to enter text, the application shows virtual keyboard - hand-built in WinForms. Making these things by hand for each new language is monkey work. I figure that windows must have this keyboard layout informat...
[ 0.3949716091156006, 0.16287118196487427, 0.008278289809823036, 0.2880992591381073, 0.0827888697385788, 0.0647166520357132, 0.09211163967847824, 0.2606310546398163, -0.3114028871059418, -0.48350900411605835, 0.044653620570898056, 0.47286516427993774, 0.11514541506767273, 0.12056918442249298...
a Japanese keyboard, state machine and all..., so XML might not be sufficient) **UPDATE**: pretty good series on this subject (I believe) [here](http://www.siao2.com/2006/04/22/581107.aspx) [Microsoft Keyboard Layout Creator](http://msdn.microsoft.com/en-us/goglobal/bb964665.aspx) can load system keyboards and export ...
[ 0.05695043504238129, -0.08649478107690811, 0.5056647062301636, -0.03633773699402809, -0.2754899859428406, 0.0435328371822834, 0.10631907731294632, -0.029734045267105103, -0.19522757828235626, -0.47148197889328003, 0.07328636199235916, 0.4657115340232849, -0.009816602803766727, 0.0317738354...
to crash the taskbar :/ However, it does work :) ``` using System; using System.Collections; using System.IO; using System.Reflection; class KeyboardExtractor { static Object InvokeNonPublicStaticMethod(Type t, String name, Object[] args) { return t.GetMethod(name, BindingFlags.Static | B...
[ -0.20339736342430115, -0.13844123482704163, 0.34623774886131287, 0.03341563418507576, 0.24252523481845856, 0.11760606616735458, 0.39506807923316956, -0.0945868045091629, -0.16352641582489014, -0.3526782691478729, -0.42660602927207947, 0.7411153316497803, -0.4649234116077423, 0.102179490029...
o.GetType().GetMethod(name, BindingFlags.Instance | BindingFlags.NonPublic) .Invoke(o, args); } static Object GetNonPublicProperty(Object o, String propertyName) { return o.GetType().GetField(propertyName, BindingFlags.Instance | BindingFlags.NonPublic) .GetV...
[ -0.08622980862855911, -0.003023132449015975, 0.5990695357322693, -0.34622761607170105, 0.24177788197994232, 0.25985392928123474, 0.3235533833503723, -0.38062989711761475, 0.017628511413931847, -0.6160991787910461, -0.7323100566864014, 0.6409614086151123, -0.4104781150817871, 0.087943322956...
o.GetType().GetField(propertyName, BindingFlags.Instance | BindingFlags.NonPublic) .SetValue(o, v); } [STAThread] public static void Main() { System.Console.WriteLine("Keyboard Extractor..."); KeyboardExtractor ke = new KeyboardExtractor(); ke.extractAll(); ...
[ -0.36387765407562256, -0.00851247739046812, 0.5752713680267334, -0.408479243516922, 0.3672857880592346, 0.3138086795806885, 0.3272571265697479, -0.2856922447681427, -0.010231740772724152, -0.4562155604362488, -0.7336700558662415, 0.5584113001823425, -0.2270602136850357, 0.4315630793571472,...
Type keyboardType; String baseDirectory; public KeyboardExtractor() { msklcAssembly = Assembly.LoadFile("C:\\Program Files\\Microsoft Keyboard Layout Creator 1.4\\MSKLC.exe"); utilitiesType = msklcAssembly.GetType("Microsoft.Globalization.Tools.KeyboardLayoutCreator.Utilities"); keyboar...
[ -0.4607934355735779, -0.23161084949970245, 0.5767380595207214, -0.2414095550775528, 0.2495979368686676, 0.15890783071517944, 0.25977176427841187, 0.11845220625400543, -0.10841487348079681, -0.5463659763336182, -0.324709415435791, 0.4085445702075958, -0.2202482968568802, 0.3992443382740021,...
utilitiesType, "KeyboardsOnMachine", new Object[] {false}); DateTime loopStartTime = DateTime.UtcNow; int i = 0; foreach (DictionaryEntry e in keyboards) { i += 1; Object k = e.Value; String name = (String)GetNonPublicProperty(k, "m_stLayoutName");
[ -0.17632213234901428, -0.38546091318130493, 0.6069662570953369, -0.4536077082157135, 0.5089728236198425, 0.15911146998405457, 0.3973383903503418, -0.22188536822795868, 0.22447903454303741, -0.47138679027557373, -0.4739808142185211, 0.7076424956321716, -0.4259760081768036, 0.220564499497413...
String layoutHexString = ((UInt32)GetNonPublicProperty(k, "m_hkl")) .ToString("X"); TimeSpan elapsed = DateTime.UtcNow - loopStartTime; Double ticksRemaining = ((Double)elapsed.Ticks * keyboards.Count) / i - elapsed.Ticks; TimeSpan remaining =...
[ -0.18753568828105927, -0.2546103298664093, 0.4513110816478729, -0.43402159214019775, 0.23452360928058624, 0.5045576095581055, 0.3471362888813019, -0.43488025665283203, -0.46106114983558655, -0.37531623244285583, -0.08795350044965744, 0.21504908800125122, -0.30304014682769775, 0.39314448833...
String msgTimeRemaining = ""; if (i > 1) { // Trim milliseconds remaining = new TimeSpan(remaining.Hours, remaining.Minutes, remaining.Seconds);
[ 0.1250436156988144, -0.4676678776741028, 0.4477878212928772, -0.3215040862560272, 0.40413951873779297, 0.15388032793998718, 0.4575748145580292, -0.2175101786851883, -0.22296126186847687, -0.44478583335876465, -0.20960092544555664, 0.284400999546051, 0.07189124077558517, 0.47144564986228943...
msgTimeRemaining = String.Format(", about {0} remaining", remaining); } System.Console.WriteLine( "Saving {0} {1}, keyboard {2} of {3}{4}",
[ -0.3646034598350525, -0.5403831601142883, 0.7360504269599915, 0.06361200660467148, 0.24619343876838684, 0.21904709935188293, 0.38280120491981506, -0.16967016458511353, -0.3295230567455292, -0.7083098292350769, -0.004729882348328829, 0.41538429260253906, -0.30415329337120056, 0.277914911508...
layoutHexString, name, i, keyboards.Count, msgTimeRemaining); SaveKeyboard(name, layoutHexString); } System.Console.WriteLine("{0} elapsed", DateTime.UtcNow - startTime); } private void SaveKeyboard(String name, String layoutHexString) { Object k = ke...
[ -0.3676545023918152, -0.20781344175338745, 0.7040089964866638, -0.4059658646583557, 0.522960364818573, 0.4454697072505951, 0.23662567138671875, -0.08270446956157684, -0.12304138392210007, -0.6245771646499634, -0.21425029635429382, 0.5321506261825562, -0.33041271567344666, 0.535336375236511...
BindingFlags.Instance | BindingFlags.NonPublic)[0] .Invoke(new Object[] { new String[] {"", layoutHexString}, false}); SetNonPublicField(k, "m_fSeenOrHeardAboutPropertiesDialog", true); SetNonPublicField(k, "m_stKeyboardTextFileName",
[ -0.08517248183488846, -0.14239607751369476, 0.8229981064796448, -0.33362877368927, 0.265916109085083, -0.032062631100416183, 0.5453454256057739, -0.35365238785743713, -0.2067459672689438, -0.6085339784622192, -0.43429529666900635, 0.36786630749702454, -0.5596205592155457, 0.287359744310379...
String.Format("{0}\\{1} {2}.klc", baseDirectory, layoutHexString, name)); InvokeNonPublicInstanceMethod(k, "mnuFileSave_Click", new Object[] {new Object(), new EventArgs()}); ((IDisposable)k).Dispose(); } } ``` Basically, it gets a list of all the keyboards on...
[ -0.22857102751731873, -0.1683228760957718, 0.7008285522460938, -0.12772728502750397, 0.463300496339798, 0.2612333595752716, 0.04681679606437683, 0.17824237048625946, -0.3245009183883667, -0.8183045387268066, -0.22555658221244812, 0.5454136729240417, -0.4732203483581543, 0.3602539598941803,...
keyboard properties, and then simulates a click on the File -> Save menu item.
[ -0.3061806261539459, -0.18275991082191467, 0.4224720001220703, 0.1241331472992897, 0.39635419845581055, 0.16944259405136108, -0.0785495787858963, -0.03554356098175049, -0.19364158809185028, -0.5796858072280884, -0.15363739430904388, 0.6117607355117798, 0.146534264087677, -0.116162106394767...
I've got a MailAddressCollection that contains all the addresses I want to send an email to, but instead of being able to simply have: ``` myMessage.To = myMailAddressCollection; ``` I have to do: ``` foreach (MailAddress address in myMailAddressCollection) { myMessage.To.Add(address); } ``` Can anyone ...
[ 0.3426744043827057, 0.18732260167598724, 0.15273961424827576, -0.027722833678126335, 0.16483812034130096, -0.1967780441045761, 0.11632896959781647, 0.036924075335264206, -0.09007918834686279, -0.6504709124565125, 0.02772977203130722, 0.21310541033744812, -0.2853158116340637, 0.340811431407...
stands your code is about as easy as it's going to get.
[ 0.7028221487998962, 0.11928296834230423, 0.3079906105995178, 0.12114539742469788, -0.14370635151863098, 0.005992408841848373, 0.5260692238807678, -0.23150530457496643, -0.1822120100259781, -0.25145164132118225, 0.3631327450275421, 0.28933680057525635, 0.12902414798736572, -0.51899111270904...
The [Silverlight 2](http://msdn.microsoft.com/en-us/library/hs600312(VS.95).aspx) and [Silverlight 3 Beta](http://msdn.microsoft.com/en-us/library/hs600312(VS.96).aspx) framework do not support *compiled* Regular Expressions i.e: ``` RegexOptions.Compiled ``` I'd be interested to hear the reasoning behind why this i...
[ 0.1820344626903534, 0.0011644283076748252, 0.1585615575313568, 0.05267994850873947, -0.2645929753780365, -0.21698549389839172, 0.1993408501148224, -0.2151724249124527, 0.08371508121490479, -0.5008474588394165, -0.4135296642780304, 0.44733184576034546, -0.6401578783988953, -0.29063853621482...
In a system I'm developing I have a choice of either using a single stored procedure that does three related jobs and returns either no result, or the same result set, but sourced from two different tables. I read an article yesterday that suggested that a stored-procedure should only have one execution plan and that ...
[ 0.30072706937789917, 0.009707024320960045, 0.04904470965266228, 0.01646229811012745, 0.05098412558436394, 0.37436777353286743, -0.22594590485095978, -0.15796592831611633, -0.5004866123199463, -0.5668238401412964, 0.27053195238113403, 0.40243902802467346, -0.5883641242980957, 0.266118854284...
is whether the performance gained from having procedures that don't have different execution plans depending on inputs vs a single procedure is worth the effort i.e. is the overhead of calling the database three times greater than the overhead of having to recompile the performance plan depending on circumstances? Tha...
[ 0.34275609254837036, -0.09336314350366592, -0.2240883857011795, 0.23078575730323792, 0.0452815443277359, 0.1768486499786377, 0.0721176266670227, -0.36576446890830994, -0.24168895184993744, -0.3286210298538208, 0.5221334099769592, 0.8460351228713989, -0.16904078423976898, -0.256246984004974...
I'm using the Windows API SendInput() call to simulate keyboard events. The following snippet (irrelevant details omitted) works perfectly for sending a sequence of characters: ``` wchar_t txt = ...; INPUT *input = ...; size_t nInput = 0; for (unsigned int j = 0; j < length; j++) { input[nInput].ki.wVk = 0; i...
[ -0.12984471023082733, -0.050599370151758194, 0.5444971323013306, -0.3899812698364258, -0.1881074160337448, 0.4400867819786072, 0.6048805713653564, -0.2381131500005722, -0.09925428032875061, -0.732529878616333, -0.17302237451076508, 0.3730070888996124, -0.19938567280769348, 0.05404349043965...
I tried the following code: ``` bool control, alt shift; wchar_t chr; if (control) { input[nInput].ki.wVk = VK_CONTROL; input[nInput].ki.dwFlags = 0; nInput++; } if (alt) { input[nInput].ki.wVk = VK_MENU; input[nInput].ki.dwFlags = 0; nInput++; } if (shift) { input[nInput].ki.wVk = VK_SHIF...
[ -0.2175389677286148, -0.17384964227676392, 0.28040456771850586, -0.2907993793487549, -0.002344920067116618, 0.5299251079559326, 0.5119271278381348, -0.5100566744804382, 0.07777154445648193, -0.710188090801239, 0.07197234034538269, 0.5445439219474792, -0.31195950508117676, -0.27373951673507...
input[nInput].ki.wVk = VK_MENU; input[nInput].ki.dwFlags = KEYEVENTF_KEYUP; nInput++; } if (control) { input[nInput].ki.wVk = VK_CONTROL; input[nInput].ki.dwFlags = KEYEVENTF_KEYUP; nInput++; } SendInput(nInput, input, sizeof(INPUT)); ``` However, modifiers don't seem to get through, i.e., even th...
[ -0.20844562351703644, -0.2569466829299927, 0.4330131709575653, 0.08995489031076431, 0.06778676807880402, 0.34005042910575867, 0.3016578257083893, -0.342332661151886, -0.05853966251015663, -0.37274909019470215, -0.4111645221710205, 0.3059338927268982, -0.1699436604976654, -0.067911393940448...
chr); input[nInput].ki.wVk = LOBYTE(virtKey); input[nInput].ki.dwFlags = 0; nInput++; input[nInput].ki.wVk = LOBYTE(virtKey); input[nInput].ki.dwFlags = KEYEVENTF_KEYUP; nInput++; ``` I have not tested how this works for non-ASCII unicode characters, that are mapped to non-English keyboard layouts, and what happens w...
[ -0.16069462895393372, 0.23231211304664612, 0.8324624300003052, -0.3462887406349182, 0.21268771588802338, 0.5251331329345703, 0.18805067241191864, -0.16282203793525696, -0.19711649417877197, -0.7119204998016357, -0.7266099452972412, 0.4823639392852783, -0.4080061614513397, 0.091666094958782...
Let us assume that a particular Exception "`SomeException`" is part of the exception stack, so let us assume `ex.InnerException.InnerException.InnerException` is of type "`SomeException`" Is there any built-in API in C# which will try to locate a given exception type in exception stack? Example: ``` SomeException s...
[ 0.11920452117919922, -0.04731767624616623, 0.06105603650212288, -0.24395233392715454, 0.214535191655159, -0.30662834644317627, 0.35687562823295593, 0.08424078673124313, 0.01437717117369175, -0.3390551805496216, -0.30626314878463745, 0.5931652784347534, -0.31424158811569214, 0.0238626804202...
(candidate != null) { return candidate; } outer = outer.InnerException; } return null; } ``` If you're using C# 3 you could make it an extension method (just make the parameter "this Exception outer") and it would be even nicer to use: ``` SomeException nested = originalEx...
[ 0.05009149760007858, -0.18857872486114502, 0.3056592345237732, -0.2727173864841461, 0.13184931874275208, 0.07918223738670349, 0.19143012166023254, -0.4099085032939911, 0.13466297090053558, -0.3779361844062805, -0.1771792620420456, 0.4316723942756653, -0.3349965512752533, 0.1732126176357269...
I have some repositories on a svn server which include an Eclipse project. In those repositories it is put the bin folder because I have some properties files and I couldn't run the program without putting them in that folder. Now when I checkout the project, import the project in Eclipse and build it the svn entries...
[ 0.6875219345092773, 0.3732666075229645, -0.03846346586942673, 0.06910497695207596, -0.2923601269721985, -0.38017505407333374, 0.17982986569404602, -0.2209979146718979, -0.23814937472343445, -0.6274990439414978, 0.17036570608615875, 0.352257639169693, -0.14437314867973328, 0.424195140600204...
files? Edit: I'm not using a plugin for Eclipse. I got files using Tortoise SVN. Could you set an exclusion on the source folder under project settings -> build path? Then it shouldn't copy the .svn files from src to bin. Sorry, can't test right now to give a more accurate answer.
[ 0.5295743346214294, 0.0636141449213028, 0.08921345323324203, 0.18676021695137024, -0.15458522737026215, -0.10941574722528458, 0.42566978931427, 0.07365866005420685, -0.40699121356010437, -0.35746586322784424, -0.016500426456332207, 0.5407426953315735, -0.44257405400276184, 0.08411957323551...