text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
extensions enabled, PATH/APPEND/PROMPT/SET/ASSOC in .CMD > files will set ERRORLEVEL regardless of error. .BAT sets ERRORLEVEL > only on errors. In other words, if ERRORLEVEL is set to non-0 and then you run one of those commands, the resulting ERRORLEVEL will be: * left alone at its non-0 value in a .bat file * ...
[ 0.04646117985248566, -0.24906772375106812, 0.651403546333313, 0.01705433987081051, -0.14247682690620422, 0.36973246932029724, 0.15216635167598724, -0.18329797685146332, -0.7009862065315247, -0.6550813913345337, -0.23751814663410187, 0.5431222319602966, -0.3055117130279541, 0.05629255995154...
I'm trying to figure out how to decide when to use NSDictionary or NSCoder/NSCoding? It seems that for general property lists and such that NSDictionary is the easy way to go that generates XML files that are easily editable outside of the application. When dealing with custom classes that holds data or possibly othe...
[ 0.15340694785118103, -0.07364384084939957, 0.13055211305618286, 0.25100892782211304, -0.13824549317359924, -0.4549720883369446, 0.08017216622829437, -0.020050883293151855, -0.26826292276382446, -0.8798981308937073, 0.06518937647342682, 0.37764972448349, -0.2068447768688202, 0.0916886180639...
data characteristics to a single level to be able to save it, where as NSCoder/NSCoding would automatically encode nested custom classes that implement the NSCoding interface. Outside of it being binary data and not editable outside of your application is there a real reason to use one over the other? And along those ...
[ -0.12195608764886856, 0.21954694390296936, 0.14378362894058228, 0.3525818884372711, -0.24166515469551086, 0.07482396066188812, 0.028296394273638725, -0.02413433976471424, -0.2850075960159302, -0.8538717031478882, -0.2505822777748108, 0.3502434194087982, -0.16310986876487732, -0.08977553248...
only preserves the values of the objects and their position in the hierarchy. Multiple references to the same value object might result in multiple objects when deserialized. The mutability of the objects is not maintained. > > > … > > > Mac OS X archives store an arbitrarily complex object graph. The archive prese...
[ -0.14727185666561127, 0.47208958864212036, 0.1845938265323639, 0.18907274305820465, 0.21784310042858124, -0.27074798941612244, 0.47094595432281494, 0.030487408861517906, -0.26807963848114014, -0.5153568387031555, -0.35287514328956604, 0.5007188320159912, -0.2818373441696167, 0.230814635753...
if you want to store simple *values*, serialization (using an NSDictionary, for example) is a fine way to go. If you want to store an *object graph* of arbitrary types, with uniqueness and mutability preserved, using archives (with NSCoder, for example) is your best bet. You may also want to read Apple's [Archives and...
[ 0.30475643277168274, 0.10535731911659241, -0.12161600589752197, 0.2639678418636322, -0.034436218440532684, -0.14798149466514587, 0.22758470475673676, 0.024250373244285583, -0.7454059720039368, -0.8504120707511902, -0.31206145882606506, 0.4070197641849518, -0.027504870668053627, -0.00375404...
Assume the following: *models.py* ``` class Entry(models.Model): title = models.CharField(max_length=50) slug = models.CharField(max_length=50, unique=True) body = models.CharField(max_length=200) ``` *admin.py* ``` class EntryAdmin(admin.ModelAdmin): prepopulated_fields = {'slug':('title',)} ``` ...
[ 0.05842823535203934, 0.1867769956588745, 0.290648877620697, -0.0060194688849151134, 0.19518372416496277, 0.0005479275132529438, 0.007755802012979984, -0.34596529603004456, 0.15541571378707886, -0.5918997526168823, 0.0639548972249031, 0.6220746636390686, -0.15251219272613525, -0.09447542577...
your save method to slugify (it's built-in method, look at django source) the title and store it in slug field. Also from there you can easily check if this slug is indeed unique and change it somehow if it's not. Consider this example: ``` def save(self): from django.template.defaultfilters import slugify i...
[ 0.35667046904563904, 0.07846877723932266, 0.1652766466140747, -0.0684041753411293, 0.19637556374073029, -0.18646660447120667, -0.0894751325249672, -0.30856555700302124, -0.2040969431400299, -0.5898371934890747, 0.18154647946357727, 0.689872145652771, -0.303157240152359, 0.18982574343681335...
There doesn't seem to be an accepted way of sending down a header parameter in non ascii format. The header for file download usually looks like Content-disposition: attachment; filename="theasciifilename.doc" Except if you smash a utf8 encoded string in the filename parameter, Firefox will handle it fine, whereas I...
[ 0.07796520739793777, 0.2477799504995346, 0.2990572154521942, -0.0689242035150528, -0.24429813027381897, -0.3124264180660248, 0.3958376348018646, -0.1468745768070221, -0.3829505145549774, -0.40957316756248474, -0.36023685336112976, 0.36392390727996826, -0.5812376737594604, 0.287050604820251...
get %e1%ba%a3? (I'm obviously missing something simple here) Problem #2: While IE acknowledges this encoding, Firefox doesn't! What to do? Answer to question #1: You are confusing Unicode and UTF-8. The hex value of 'ả' is 0xA31E however that is not a UTF-8 character. In UTF-8 that character requries three bytes, `0xE...
[ 0.07939384132623672, 0.3096308410167694, 0.2342911660671234, -0.15843740105628967, -0.2754376232624054, -0.03186744824051857, 0.5741740465164185, -0.1261575073003769, 0.08059216290712357, -0.5440440773963928, -0.3622466027736664, 0.24253502488136292, -0.45811334252357483, 0.104244232177734...
I want to see the stack trace in any function of my code, so i made somthing like this to call it and print the stack trace: ``` public function PrintStackTrace() { try { throw new Error('StackTrace'); } catch (e:Error) { trace(e.getStackTrace()); } } ``` I like to know if there are other...
[ 0.03008437529206276, 0.11004048585891724, 0.16600298881530762, -0.17374897003173828, 0.21585099399089813, -0.34969663619995117, 0.3053981363773346, -0.21658892929553986, -0.2383219301700592, -0.5370293259620667, 0.20608986914157867, 0.4249708354473114, -0.5430697202682495, -0.1356108635663...
i want to know. Thanks! As far as I know, the only way to make the stack trace available to your own code is via the [getStackTrace()](http://livedocs.adobe.com/flex/3/langref/Error.html#getStackTrace()) method in the Error class, just like you're already doing. In response to the example in your question, though, I w...
[ 0.40055564045906067, 0.19920441508293152, 0.22344695031642914, 0.08314038068056107, 0.24200907349586487, -0.4586642384529114, 0.3723610043525696, -0.23966822028160095, -0.2284829169511795, -0.4839956760406494, 0.02861853688955307, 0.7327788472175598, -0.22331272065639496, -0.21289348602294...
the value of [Capabilities.isDebugger](http://livedocs.adobe.com/flex/3/langref/flash/system/Capabilities.html#isDebugger) if you want.
[ 0.19908231496810913, -0.09693663567304611, 0.4736679494380951, -0.057588130235672, -0.002962341997772455, -0.03639061748981476, 0.050582658499479294, -0.23490512371063232, -0.4716258943080902, -0.37635260820388794, -0.2835223078727722, 0.8320284485816956, 0.2910131514072418, -0.43324354290...
How can I capture the event in Excel when a user clicks on a cell. I want to be able to use this event to trigger some code to count how many times the user clicks on several different cells in a column. Check out the Worksheet\_SelectionChange event. In that event you could use Intersect() with named ranges to figure ...
[ 0.5887255668640137, 0.05296795070171356, 0.2859787940979004, 0.10083155333995819, 0.0636153519153595, -0.1930561065673828, 0.09047044068574905, -0.3136169910430908, -0.36505773663520813, -0.7070690393447876, 0.4559587836265564, 0.21846020221710205, -0.5121712684631348, -0.05969395488500595...
End If End Sub ```
[ -0.4447985887527466, 0.15598012506961823, 0.2619900405406952, -0.15588214993476868, -0.35663706064224243, -0.5538625717163086, 0.5333803296089172, 0.020958255976438522, -0.008569943718612194, -0.27533861994743347, -0.7436071038246155, -0.030464226379990578, -0.3144347667694092, 0.459538221...
We have been designing our reports around Crystal Reports in VS2008 for our web application and I just discovered the Microsoft provided ReportViewer control. I've searched around a bit but cannot find a good breakdown of the pros and cons of each method of producing reports. I'm looking for pros and cons regarding: ...
[ 0.5823640823364258, 0.05647847428917885, 0.20080192387104034, 0.31726130843162537, -0.35706838965415955, -0.2015567421913147, -0.05379146337509155, -0.051403239369392395, -0.01103640254586935, -0.5532805919647217, 0.25633764266967773, 0.6435359716415405, -0.1049148440361023, -0.07341095060...
If you can create SQL Reporting Services reports, you can create these. They can take any kind of datasource so you have full control. [Here is an excellent book on Client Side reporting](https://www.apress.com/us/book/9781590598542). There are built in PDF and Excel exports available but you can add your own export ...
[ 0.4602242410182953, 0.10665471106767654, 0.025071728974580765, 0.39649122953414917, -0.40561234951019287, -0.4392794668674469, 0.07011432200670242, 0.09199308604001999, -0.347025066614151, -0.4252735674381256, 0.11377933621406555, 0.585389256477356, -0.10235892981290817, 0.0106912842020392...
In an aspx C#.NET page (I am running framework v3.5), I need to know where the user came from since they cannot view pages without logging in. If I have page `A` (the page the user wants to view) redirect to page `B` (the login page), the Request.UrlReferrer object is null. Background: If a user isn't logged in, I re...
[ 0.20518173277378082, 0.004335733596235514, 0.5493692755699158, -0.26520243287086487, -0.06409677863121033, 0.006327212788164616, 0.5864003300666809, 0.07486271858215332, -0.4747360944747925, -0.6146093010902405, -0.4273129105567932, 0.303149551153183, -0.3917112648487091, 0.145309299230575...
+ Request.ServerVariables["SCRIPT_NAME"]);` Then, just look at QueryString on login page you forced them to and put the user where they were after successful login. If you use the standard Membership provider, and set the Authorization for the directory/page, the code will automatically set a query parameter of Return...
[ 0.10670943558216095, -0.2597702145576477, 0.7593082189559937, -0.20271702110767365, -0.26575660705566406, -0.2899121344089508, 0.386547714471817, -0.31973716616630554, -0.11366098374128342, -0.5240244269371033, -0.18229803442955017, 0.5185421705245972, -0.2866348922252655, 0.19417387247085...
I'm getting warnings about CSS3.0 properties like text-overflow. Is there a way to validate against 3.0? --- HTML5 and CSS3 support is coming to VS2010 in SP1. [Link](https://web.archive.org/web/20120621010521/http://blogs.msdn.com:80/b/webdevtools/archive/2011/01/27/html5-amp-css3-in-visual-studio-2010-sp1.aspx) -...
[ 0.08871785551309586, 0.07554575800895691, 0.43009650707244873, -0.20980340242385864, -0.5394108295440674, 0.1311853528022766, 0.33174097537994385, -0.3906477093696594, -0.3742438554763794, -0.2099045217037201, 0.1044200211763382, 0.6452953815460205, -0.13649222254753113, 0.0180367026478052...
most of it is very much still in flux, despite some decent browser support for some properties. <http://www.w3.org/Style/CSS/current-work>
[ 0.26842737197875977, -0.06874766200780869, -0.17697136104106903, 0.02397426962852478, -0.04037083685398102, -0.21189525723457336, 0.03528190404176712, 0.24443872272968292, -0.44495531916618347, -0.5905802845954895, -0.20568305253982544, -0.0822966992855072, -0.011786112561821938, 0.0584398...
I'm trying to create a ImageIcon from a animated gif stored in a jar file. ``` ImageIcon imageIcon = new ImageIcon(ImageIO.read(MyClass.class.getClassLoader().getResourceAsStream("animated.gif"))); ``` The image loads, but only the first frame of the animated gif. The animation does not play. If I load the animate...
[ 0.2995278239250183, 0.08154945075511932, 0.6068098545074463, 0.06752308458089828, -0.26008421182632446, 0.2533101737499237, 0.21228376030921936, -0.21341447532176971, -0.08438754826784134, -0.5905165672302246, 0.22545363008975983, 0.8796767592430115, -0.3779670000076294, 0.0960926115512847...
public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { AnimationTest test = new AnimationTest(); test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); test.setVisible(true); }
[ 0.5861465930938721, -0.1883033961057663, 0.466287761926651, -0.13320624828338623, 0.1965682953596115, 0.1745760440826416, 0.2706475257873535, -0.21959403157234192, -0.2654377520084381, -0.26772478222846985, -0.49111035466194153, 0.29438918828964233, -0.41498684883117676, 0.2262399792671203...
}); } public AnimationTest() { super(); try { JLabel label = new JLabel(); ImageIcon imageIcon = new ImageIcon(ImageIO.read(AnimationTest.class.getClassLoader().getResourceAsStream("animated.gif"))); label.setIcon(imageIcon); imageIcon.setImageObs...
[ 0.05814309045672417, -0.5368523597717285, 0.706458330154419, 0.039500318467617035, -0.04712068662047386, 0.30493029952049255, 0.30748775601387024, -0.2477785050868988, -0.08706304430961609, -0.6215780377388, -0.4614773392677307, 0.7370198965072632, -0.4099659025669098, 0.12420313060283661,...
pack(); } catch (Exception e) { e.printStackTrace(); } } } ``` This reads gif animation from inputStream ``` InputStream in = ...; Image image = Toolkit.getDefaultToolkit().createImage(org.apache.commons.io.IOUtils.toByteArray(in)); ```
[ 0.38738805055618286, -0.30146506428718567, 0.38596311211586, -0.13067768514156342, -0.06905772536993027, -0.12371475249528885, 0.39677032828330994, -0.32132604718208313, -0.16478988528251648, -0.6944201588630676, -0.36847183108329773, 0.5158619284629822, -0.5827756524085999, -0.11915769428...
I'm doing a webapp and need a backup plan. Here's what I've got so far: * nightly encrypted backup of the SQL database to Amazon S3 and my external drive (incremental if possible, not overly familiar with PostgreSQL yet, but that's another thread) * nightly backup of my Mercurial repo (which includes Apache configs, d...
[ 0.26689356565475464, 0.0052300854586064816, 0.27001678943634033, 0.27631399035453796, 0.21195173263549805, 0.08260839432477951, 0.42430490255355835, 0.08796633780002594, -0.3025105595588684, -0.6287824511528015, 0.005442132707685232, 0.7069801688194275, 0.11598990857601166, -0.264505922794...
nightly incremental ones as well perhaps? It means that if one of your old incremental backups gets corrupted then you have lost less than a week of data. Also, ensure you have a backup test plan to ensure your backups work. There are a lot of horror stories going around about this, from companies that have been doin...
[ 0.45889484882354736, -0.18200257420539856, 0.30202409625053406, 0.415245920419693, 0.005498123820871115, -0.159968301653862, 0.6517835259437561, 0.40407830476760864, -0.5369124412536621, -0.4295133948326111, 0.16851307451725006, 0.5996256470680237, 0.01568795181810856, -0.04611772298812866...
What is the best way to determine available bandwidth in .NET? We have users that access business applications from various remote access points, wired and wireless and at times the bandwidth can be very low based on where the user is. When the applications appear to be running slow, the issue could be due to low band...
[ 0.7004498839378357, -0.07409948855638504, 0.24633701145648956, 0.5053303837776184, 0.20072515308856964, -0.16906994581222534, 0.15061576664447784, 0.1451869010925293, -0.19280466437339783, -0.7827053070068359, 0.2624289393424988, 0.6067222356796265, -0.017012862488627434, 0.260120689868927...
long it takes. the disadvantage of that is that you'd need to waste a lot of bandwidth to do it. Also, if you wanted to alert when throughput drops below a threshold, you'll have to run the test more-or-less continuously. IMHO, I'd live with poor performance in some locations, given that you can't do anything about it...
[ 0.7165591716766357, -0.12045841664075851, -0.13407152891159058, 0.25522345304489136, 0.19995401799678802, -0.4029530882835388, 0.41111621260643005, 0.13886959850788116, 0.14758281409740448, -0.4900621473789215, 0.3924860954284668, 0.5283374786376953, 0.3710799217224121, -0.1602124124765396...
I have 7-8 xml files. Each one is approximately 50 MB in size. What is the best way to merge files programmatically in C# without getting System.OutOfMemory Exception? So far I have tried reading each file in a StringBuilder and than putting it in an array of string builder but I still get system.outofmemoery exception...
[ 0.23135465383529663, 0.22388339042663574, 0.47008320689201355, -0.06787006556987762, -0.17942510545253754, 0.05352097749710083, 0.23773333430290222, -0.2903306186199188, -0.2594507336616516, -0.7552030086517334, -0.09930035471916199, 0.48582109808921814, -0.15589985251426697, 0.14903964102...
I aggressively delete the orginal XML file and wipe the sectors where it existed on the disk to remove the taint. :-)
[ 0.4148716330528259, 0.3471241295337677, 0.6308749914169312, -0.033867985010147095, -0.06093154847621918, -0.1144820973277092, 0.17195512354373932, 0.06843741238117218, 0.36048102378845215, -0.5867449045181274, -0.1887151151895523, 0.47179266810417175, -0.20910389721393585, 0.37106493115425...
I'm slowly getting back into PHP, and now I run into a problem, I want to install some web software on our host and I need to have either the latest Zend (which they don't have) or IonCube on the server and IonCube requires enable\_dl to be on in the php.ini. Now a colleague of mine thinks I can update this via an .hta...
[ 0.3717101514339447, 0.28354963660240173, 0.5367904305458069, -0.20600955188274384, -0.3021915853023529, 0.09237063676118851, 0.44459229707717896, 0.23100334405899048, -0.29762616753578186, -0.8160533308982849, 0.13694438338279724, 0.39096611738204956, -0.4131995439529419, 0.503016889095306...
the file to just .htaccess on the server. When I refresh the file is gone, when I keep it as s.htaccess it's fine but my php info still shows it as Off. What n00b mistake am I making? Personally, when I *have* to deal with XML files (forced by threat of physical violence usually), I do this: 1. Load each file into a ...
[ 0.43553245067596436, 0.06009604036808014, 0.6036205887794495, -0.006029252894222736, -0.3812173008918762, -0.10603079944849014, 0.4033748209476471, 0.11627963185310364, -0.09361306577920914, -0.8668881058692932, 0.060218606144189835, 0.36128750443458557, -0.22497394680976868, 0.36482188105...
:-)
[ 0.0172603540122509, 0.22793078422546387, 0.3623863458633423, 0.15089811384677887, -0.05113988742232323, 0.36776286363601685, 0.06857030093669891, -0.18816916644573212, -0.021440178155899048, -0.11322763562202454, -0.2691616415977478, 0.40258872509002686, -0.20798330008983612, 0.21058464050...
When adding an EditItemTemplate of some complexity (mulitple fields in one template), and then parsing the controls from the RowUpdating event, the controls that were manually entered by the user have no values. My guess is there is something going on with when the data is bound, but I've had instances where simply add...
[ 0.2025204449892044, 0.037911344319581985, 0.29720279574394226, -0.019909298047423363, -0.08338989317417145, -0.21960009634494781, 0.3368915021419525, -0.194682314991951, -0.168644517660141, -0.5646753311157227, -0.18381164968013763, 0.560787558555603, -0.5322265625, 0.11167546361684799, ...
box is found, but the .Text is not the user input. Did you turn off ViewState? Did you add control programmatically in the template? If so, did you create them at the correct stage?
[ 0.4084089398384094, -0.26928627490997314, 0.3485914170742035, 0.39884310960769653, 0.29908275604248047, -0.021730268374085426, -0.09976089745759964, -0.4484117329120636, -0.0780230239033699, -0.31969115138053894, -0.0019052703864872456, 0.586785614490509, -0.5667496919631958, -0.0109668709...
I want to create Code39 encoded barcodes from my application. I know I can use a font for this, but I'd prefer not to as I'd have to register the font on the server and I've had some pretty bad experiences with that. *An example of what I've produced after asking this question is in the answers* This is my current c...
[ 0.395871639251709, 0.3858794569969177, 0.06054581329226494, 0.07574409991502762, -0.07613728195428848, 0.31527528166770935, 0.060352399945259094, -0.17578913271427155, -0.014700233936309814, -0.8295603394508362, -0.09012775123119354, 0.33532536029815674, -0.6122968196868896, 0.114183813333...
this example: 'http://www.atalasoft.com/cs/blogs/loufranco/archive/2008/04/25/writing-code-39-barcodes-with-javascript.aspx-generation.aspx 'With a bit of this thrown in: 'http://www.atalasoft.com/cs/blogs/loufranco/archive/2008/03/24/code-39-barcode Private _encoding As Hashtable = New Hashtable ...
[ -0.2094510942697525, 0.26662811636924744, 0.14549678564071655, -0.029809866100549698, -0.08348839730024338, -0.10424839705228806, 0.2749100625514984, -0.27024462819099426, -0.4640794098377228, -0.4697383642196655, -0.2225591391324997, 0.20744511485099792, -0.4187253415584564, 0.13442434370...
_encoding.Add("%", "bwbWbWbWb") _encoding.Add(" ", "bWBwbwBwb") _encoding.Add(".", "BWbwbwBwb") _encoding.Add("/", "bWbWbwbWb") _encoding.Add("+", "bWbwbWbWb") _encoding.Add("0", "bwbWBwBwb") _encoding.Add("1", "BwbWbwbwB") _encoding.Add("2", "bwBWbwbwB") ...
[ 0.15867263078689575, 0.21721449494361877, -0.045867227017879486, -0.30345064401626587, 0.09686334431171417, 0.6656821966171265, 0.06731078773736954, -0.6664843559265137, -0.2817978858947754, -0.9432646632194519, -0.23560519516468048, 0.1478598564863205, -0.5145303010940552, 0.1374232620000...
_encoding.Add("6", "bwBWBwbwb") _encoding.Add("7", "bwbWbwBwB") _encoding.Add("8", "BwbWbwBwb") _encoding.Add("9", "bwBWbwBwb") _encoding.Add("A", "BwbwbWbwB") _encoding.Add("B", "bwBwbWbwB") _encoding.Add("C", "BwBwbWbwb") _encoding.Add("D", "bwbwBWbwB") ...
[ 0.19859690964221954, 0.25242316722869873, -0.03212118148803711, -0.27927228808403015, 0.02319362573325634, 0.6083562970161438, 0.027080649510025978, -0.6767409443855286, -0.4978422224521637, -0.917293131351471, -0.33854636549949646, 0.22699075937271118, -0.6268890500068665, 0.0986607149243...
"BwbwbWBwb") _encoding.Add("I", "bwBwbWBwb") _encoding.Add("J", "bwbwBWBwb") _encoding.Add("K", "BwbwbwbWB") _encoding.Add("L", "bwBwbwbWB") _encoding.Add("M", "BwBwbwbWb") _encoding.Add("N", "bwbwBwbWB") _encoding.Add("O", "BwbwBwbWb") _encoding.Add("P", ...
[ 0.03826260194182396, 0.2350829839706421, 0.07853428274393082, -0.4270648956298828, 0.10331468284130096, 0.8209901452064514, -0.17687352001667023, -0.6645916104316711, -0.5261741876602173, -0.9899833798408508, -0.29222455620765686, 0.22919689118862152, -0.5098063349723816, 0.136031284928321...
_encoding.Add("T", "bwbwBwBWb") _encoding.Add("U", "BWbwbwbwB") _encoding.Add("V", "bWBwbwbwB") _encoding.Add("W", "BWBwbwbwb") _encoding.Add("X", "bWbwBwbwB") _encoding.Add("Y", "BWbwBwbwb") _encoding.Add("Z", "bWBwBwbwb") End Sub Protected Sub Page_Load(ByVal s...
[ -0.04384621977806091, 0.27749428153038025, 0.3364127278327942, -0.1613091230392456, -0.12408348172903061, 0.35606250166893005, 0.078437440097332, -0.5127115845680237, -0.13232211768627167, -0.853843629360199, -0.23604591190814972, 0.3759952783584595, -0.3041500449180603, 0.3263348639011383...
As String = String.Empty If Not IsNothing(Request("barcode")) AndAlso Not (Request("barcode").Length = 0) Then barcode = Request("barcode") Response.ContentType = "image/png" Response.AddHeader("Content-Disposition", String.Format("attachment; filename=barcode_{0}.png", barco...
[ 0.28638508915901184, -0.408631294965744, 0.8212398290634155, -0.2514931559562683, -0.0853622704744339, 0.08470042049884796, -0.05834910646080971, -0.437107652425766, -0.2308240681886673, -0.6527856588363647, -0.3456028401851654, 0.537950336933136, -0.28131163120269775, 0.19883649051189423,...
GenerateBarcodeImage(250, 140, barcode).WriteTo(Response.OutputStream) End If End Sub Protected Function getBCSymbolColor(ByVal symbol As String) As System.Drawing.Brush getBCSymbolColor = Brushes.Black If symbol = "W" Or symbol = "w" Then getBCSymbolColor = Brushes.White ...
[ 0.15323320031166077, -0.3723848760128021, 0.7314945459365845, -0.14096200466156006, -0.18242408335208893, 0.21078555285930634, 0.16934053599834442, -0.6532902717590332, -0.06923910975456238, -0.3830035328865051, -0.022766731679439545, 0.292891263961792, -0.518936038017273, 0.26929000020027...
getBCSymbolWidth = _narrowBarWidth If symbol = "B" Or symbol = "W" Then getBCSymbolWidth = _wideBarWidth End If End Function Protected Overridable Function GenerateBarcodeImage(ByVal imageWidth As Short, ByVal imageHeight As Short, ByVal Code As String) As MemoryStream 'crea...
[ -0.07586792856454849, -0.13858667016029358, 0.7837950587272644, -0.07957617193460464, -0.055603090673685074, -0.1689062863588333, 0.2537640333175659, -0.2790478765964508, -0.045269597321748734, -0.44889143109321594, -0.3065389096736908, 0.5610482096672058, -0.42508170008659363, 0.122709624...
a canvas to paint on Dim canvas As New Rectangle(0, 0, imageWidth, imageHeight) 'draw a white background Dim g As Graphics = Graphics.FromImage(b) g.FillRectangle(Brushes.White, 0, 0, imageWidth, imageHeight) 'write the unaltered code at the bottom 'TODO: truely center ...
[ 0.19903507828712463, -0.3963930904865265, 0.6593719720840454, 0.04825195297598839, -0.027926331385970116, 0.26882946491241455, 0.30956241488456726, -0.42173680663108826, -0.07709729671478271, -0.6704608798027039, -0.11231470853090286, 0.524487316608429, -0.09183575212955475, 0.032750628888...
g.DrawString(Code, New Font("Courier New", 12), textBrush, 100, 110) 'Code has to be surrounded by asterisks to make it a valid Code39 barcode Dim UseCode As String = String.Format("{0}{1}{0}", "*", Code) 'Start drawing at 10, 10 Dim XPosition As Short = 10 Dim YPosition As Sho...
[ 0.16183066368103027, -0.22496803104877472, 0.6787216663360596, 0.0011835360201075673, -0.20959168672561646, 0.33257779479026794, 0.32926490902900696, -0.711539626121521, -0.35360342264175415, -0.6686460375785828, -0.20789869129657745, 0.41300907731056213, -0.25385335087776184, -0.084661349...
Dim CurrentSymbol As String = String.Empty For j As Short = 0 To CShort(UseCode.Length - 1) CurrentSymbol = UseCode.Substring(j, 1) 'check if symbol can be used If Not IsNothing(_encoding(CurrentSymbol)) Then Dim EncodedSymbol As String = _encoding(CurrentSym...
[ 0.06047205999493599, -0.6829367876052856, 0.7908208966255188, -0.2927398681640625, -0.18170525133609772, -0.06199543550610542, 0.34280771017074585, -0.43549326062202454, -0.023509731516242027, -0.38198065757751465, 0.03427166864275932, 0.022745683789253235, -0.6309123039245605, -0.15670135...
For i As Short = 0 To CShort(EncodedSymbol.Length - 1) Dim CurrentCode As String = EncodedSymbol.Substring(i, 1) g.FillRectangle(getBCSymbolColor(CurrentCode), XPosition, YPosition, getBCSymbolWidth(CurrentCode), _barHeight) XPosition = XPosition + getBCSymbol...
[ -0.17976033687591553, -0.21579721570014954, 0.796938955783844, -0.27503225207328796, 0.03577641770243645, 0.32579848170280457, 0.06735348701477051, -0.34339338541030884, -0.14614379405975342, -0.41772279143333435, -0.5083497762680054, 0.1197652667760849, -0.2975253164768219, 0.084554694592...
Next 'After each written full symbol we need a whitespace (narrow width) g.FillRectangle(getBCSymbolColor("w"), XPosition, YPosition, getBCSymbolWidth("w"), _barHeight) XPosition = XPosition + getBCSymbolWidth("w") Else
[ -0.22518432140350342, 0.07695083320140839, 0.580274760723114, -0.39199647307395935, -0.1557610034942627, 0.17579464614391327, 0.3844606578350067, -0.20757420361042023, -0.036191925406455994, -0.6938717365264893, -0.6367115378379822, 0.14408151805400848, -0.20002290606498718, -0.16458524763...
invalidCharacter = True End If Next 'errorhandling when an invalidcharacter is found If invalidCharacter Then g.FillRectangle(Brushes.White, 0, 0, imageWidth, imageHeight) g.DrawString("Invalid characters found,", New Font("Courier New", 8), textBrush, 0, 0) ...
[ -0.06855453550815582, -0.049270208925008774, 0.6361287236213684, 0.04370914772152901, -0.28218838572502136, 0.36488303542137146, 0.33548662066459656, -0.39771410822868347, -0.19444577395915985, -0.4885958135128021, -0.30243611335754395, 0.13818208873271942, -0.43568795919418335, 0.18513642...
New Font("Courier New", 8), textBrush, 0, 10) g.DrawString("Input was: ", New Font("Courier New", 8), textBrush, 0, 30) g.DrawString(Code, New Font("Courier New", 8), textBrush, 0, 40) End If 'write the image into a memorystream Dim ms As New MemoryStream Dim en...
[ 0.026526618748903275, -0.5402399301528931, 0.9915532469749451, 0.11565764248371124, -0.1260463446378708, 0.5473113059997559, 0.2604578137397766, -0.3749798536300659, -0.13949444890022278, -0.5947781205177307, -0.23960532248020172, 0.5248040556907654, -0.3924015760421753, -0.025909755378961...
encodingParams.Param(0) = New EncoderParameter(Encoder.Quality, 100) Dim encodingInfo As ImageCodecInfo = FindCodecInfo("PNG") b.Save(ms, encodingInfo, encodingParams) 'dispose of the object we won't need any more g.Dispose() b.Dispose() Return ms End Function ...
[ 0.11896765232086182, -0.3347586393356323, 0.6159161925315857, -0.17442993819713593, -0.05254685878753662, 0.34656062722206116, 0.25056764483451843, -0.4856773316860199, -0.060176678001880646, -0.8473141193389893, -0.3792658746242523, 0.5222424268722534, -0.5673488974571228, 0.0565891414880...
For Each e As ImageCodecInfo In encoders If e.FormatDescription.Equals(codec) Then Return e Next Return Nothing End Function End Class ```
[ 0.11703303456306458, -0.006433763541281223, 0.6307092905044556, -0.09655880182981491, 0.10548533499240875, -0.26217538118362427, 0.05797313526272774, -0.2542344331741333, 0.2093740850687027, -0.7583412528038025, -0.2589579224586487, 0.4175912141799927, -0.4320257902145386, 0.00071616453351...
We have a Windows machine running SQL Server 2005, and we need to be able to run some database queries on it from a Linux box. What are some of the recommended ways of doing this? Ideally, we would want a command-line utility similar to sqlcmd on Windows. [FreeTDS](http://www.freetds.org) + [unixODBC](http://www.unixod...
[ 0.15281552076339722, 0.1778746247291565, 0.3948252499103546, 0.13657286763191223, -0.2592543363571167, -0.2709493935108185, -0.11949912458658218, 0.05619732663035393, -0.03299260511994362, -0.7147932648658752, 0.2523880898952484, 0.7189236283302307, -0.412273108959198, 0.16249701380729675,...
to MSSQL) I'm personally using FreeTDS + iODBC: ``` $more /etc/freetds/freetds.conf [10.0.1.251] host = 10.0.1.251 port = 1433 tds version = 8.0 $ more /etc/odbc.ini [ACCT] Driver = /usr/local/freetds/lib/libtdsodbc.so Description = ODBC to SQLServer via FreeTDS Trace = No Servername = 10.0.1.251 Databas...
[ -0.07466214895248413, 0.35394275188446045, 0.6595034003257751, -0.07114776223897934, 0.024125687777996063, 0.02104114182293415, 0.4894070029258728, 0.05846183001995087, -0.3184663951396942, -0.9544468522071838, -0.09200739115476608, 0.2254682332277298, -0.2962653636932373, 0.21429748833179...
This XML file contained archived news stories for all of last year. I was asked to sort these stories by story categor[y|ies] into new XML files. ``` big_story_export.xml ``` turns into ``` lifestyles.xml food.xml nascar.xml ``` ...and so on. I got the job done using a one-off python script, *however*, **I origi...
[ 0.7431605458259583, 0.17460674047470093, -0.029912343248724937, 0.26792293787002563, -0.020762396976351738, -0.35342758893966675, -0.16447968780994415, 0.21196836233139038, -0.11250340193510056, -0.43383699655532837, 0.24189811944961548, 0.5852944254875183, -0.16986079514026642, -0.1443126...
I don't have a lot of leverage when it comes to defining the structure of this file.* If you guys want code samples, I'll put some together. If anything, I'd be satisfied with some tips for making XML+XSLT work together smoothly. --- @Sklivvz I was using python's libxml2 & libxslt to process this. I'm looking int...
[ 0.6590125560760498, 0.17859600484371185, 0.25179871916770935, 0.18261340260505676, -0.25362563133239746, -0.18023234605789185, 0.3317619264125824, 0.1022193655371666, -0.17481420934200287, -0.554405689239502, 0.08026434481143951, 0.3571215271949768, -0.06210392341017723, -0.127224326133728...
if it were a one-time thing, though I foresee having to handle more files like this from our vendor. Writing a schema (and submitting it to the vendor) would be an excellent long-term strategy for managing XML funk like this. Thanks! This sounds like a bug in the large XML file or the XSLT processor. There are two thi...
[ 0.5957318544387817, -0.049222610890865326, 0.19665181636810303, 0.2339482307434082, 0.013081884942948818, -0.5777369737625122, 0.15401393175125122, -0.12574456632137299, -0.23790186643600464, -0.5705537796020508, -0.1129547730088234, 0.5428402423858643, -0.03357364609837532, -0.23452694714...
and an XML validator ([xmlstarlet](http://xmlstar.sourceforge.net/) can do this trick as well). I suggest you invest some effort to write the schema definition of your file. It will simplify a lot your debugging, because you can then easily pinpoint the exact source of problems you may be having. If the file is well-f...
[ 0.023022111505270004, 0.11030945926904678, 0.3404565751552582, 0.2795376777648926, 0.1397944688796997, -0.4682866334915161, 0.04222051426768303, -0.08864569664001465, -0.23257772624492645, -0.4623333215713501, -0.21797612309455872, 0.6778241991996765, -0.05076725408434868, -0.0407199934124...
Well, it seems simple enough, but I can't find a way to add a caption to an equation. The caption is needed to explain the variables used in the equation, so some kind of table-like structure to keep it all aligned and pretty would be great. The `\caption` command is restricted to floats: you will need to place the equ...
[ -0.018210694193840027, 0.16674578189849854, 0.713786780834198, 0.2628656029701233, 0.22162175178527832, -0.25010597705841064, -0.12284344434738159, -0.07070299237966537, -0.2745475471019745, -0.37225282192230225, -0.22558081150054932, 0.23262475430965424, -0.3916601240634918, 0.05113319680...
fixed position, don't use a float. The `\captionof` command of the [caption package](http://www.tex.ac.uk/tex-archive/macros/latex/contrib/caption/caption-eng.pdf) can be used to place a caption outside of a floating environment. It is used like this: ``` \[ E = m c^2 \] \captionof{figure}{A famous equation} ``` Thi...
[ -0.06154937297105789, -0.08561863005161285, 0.8607321381568909, 0.13469736278057098, 0.2188117951154709, 0.1647145003080368, -0.42393437027931213, -0.40757039189338684, -0.2624147832393646, -0.21183155477046967, -0.20619554817676544, 0.45524299144744873, -0.3535728454589844, -0.12694203853...
I've been arguing with my coworkers about Pascal casing (upper camel case) vs. lower [CamelCasing](http://en.wikipedia.org/wiki/CamelCase). They are used to lower camel casing for everything from table names in SQL databases to property naming in C# code but I like Pascal casing better, lower camel casing for variables...
[ -0.038481321185827255, 0.30649635195732117, -0.017907671630382538, 0.02546260878443718, -0.37988829612731934, -0.024409113451838493, -0.23599323630332947, 0.0769694596529007, -0.045750606805086136, -0.6904135346412659, 0.010419338941574097, 0.7789871096611023, -0.12208615243434906, 0.30528...
to keep my code, e.g.: ``` System.Console.WriteLine("string") ``` What do you use/prefer and why? I'm sorry if somebody else asked this question but I searched and did not find anything. **Update:** I've given a method example and not a property but it's the same. As I stated in the first paragraph my colleagues us...
[ 0.7878111004829407, 0.37611401081085205, 0.08979711681604385, -0.022267526015639305, -0.117188960313797, -0.2269587516784668, 0.28490185737609863, -0.025550298392772675, -0.10432163625955582, -0.5478731393814087, 0.12945222854614258, 0.6737848520278931, 0.020117362961173058, 0.035385649651...
there's no standard at all.
[ 0.9381393790245056, 0.20346905291080475, -0.037551987916231155, 0.06211842596530914, 0.012471433728933334, -0.28054356575012207, 0.36718323826789856, 0.1307610273361206, -0.01537405140697956, -0.3920719623565674, 0.25364184379577637, 0.37429842352867126, 0.06471231579780579, -0.04018325358...
I'm investigating an annotation-based approach to validating Spring beans using [spring modules](https://springmodules.dev.java.net/). In [this tutorial](http://wheelersoftware.com/articles/spring-bean-validation-framework.html), the following bean (getters and setters omitted) is used as an example: ``` public final ...
[ 0.06553520262241364, 0.06992693990468979, 0.10368500649929047, -0.12855559587478638, -0.11476375162601471, 0.1759408414363861, 0.16160070896148682, -0.35397669672966003, -0.5024527311325073, -0.19168023765087128, -0.19774287939071655, 0.19137373566627502, -0.33438313007354736, -0.133480519...
format: ``` bean-class.bean-propery[validation-rule]=Validation Error message ``` Examples for the class shown above include: ``` User.email[not.blank]=Please enter your e-mail address. User.email[email]=Please enter a valid e-mail address. User.email[length]=Please enter no more than {2} characters. ``` The ...
[ -0.234376922249794, 0.1377955973148346, 0.20640665292739868, 0.04783577099442482, -0.07565898448228836, -0.059487950056791306, 0.16185589134693146, -0.21705125272274017, -0.08608661592006683, -0.7759747505187988, -0.14254923164844513, 0.41139161586761475, -0.18593336641788483, 0.2240490615...
documentation claims that is possible to configure a default message for a particular rule (e.g. @Email) like this: ``` email=email address is invalid ``` This default message should be used if a bean-specific message for the rule cannot be found. However, my experience is that this simply does not work. An altern...
[ 0.24496565759181976, 0.5057363510131836, 0.1567775011062622, -0.0007930141873657703, 0.15078160166740417, -0.26593542098999023, 0.4264300465583801, -0.4155709445476532, -0.16922858357429504, -0.45923301577568054, 0.041408080607652664, 0.6682037711143494, -0.4975966215133667, 0.196826010942...
this, out and again, it just doesn't seem to work. Has anyone found a way to avoid duplicating error messages when using this validation framework? I took a quick look at the [BeanValidator API](https://springmodules.dev.java.net/source/browse/%2Acheckout%2A/springmodules/www/docs/javadocs/0.8/org/springmodules/validat...
[ 0.08753971755504608, 0.3094642162322998, 0.18530984222888947, -0.17712907493114471, -0.163025364279747, 0.10436710715293884, 0.30557873845100403, -0.2746868431568146, -0.26282617449760437, -0.6069343686103821, -0.060115665197372437, 0.5343934893608093, -0.445016473531723, -0.07888875901699...
Log log = LogFactory.getLog(MyErrorCodeConverter.class); @Override public String convertPropertyErrorCode(String errorCode, Class clazz, String property) { log.error(String.format("Property %s %s %s", errorCode, clazz.getClass().getName(), property)); return errorCode; // <------ use the error...
[ -0.007719656452536583, 0.23990173637866974, 0.6663975715637207, -0.3318580985069275, 0.2717284858226776, -0.015232508070766926, 0.41844937205314636, -0.3027525246143341, 0.061141420155763626, -0.7424784302711487, -0.17614257335662842, 0.9564196467399597, -0.32859060168266296, 0.33181139826...
@Email(errorCode="MyEmailErrorCode") String email } ```
[ 0.12815257906913757, 0.35157322883605957, 0.12231704592704773, -0.2363927960395813, 0.11194390803575516, -0.17781323194503784, 0.4914628863334656, 0.39391446113586426, -0.025257030501961708, -0.48497653007507324, 0.05408638343214989, 0.7617833018302917, -0.24145714938640594, 0.148096308112...
We have a few operations where we are doing a large number of large string concatenations, and have recently encountered an out of memory exception. Unfortunately, debugging the code is not an option, as this is occurring at a customer site. So, before looking into a overhaul of our code, I would like to ask: what is...
[ 0.30763545632362366, 0.1403350532054901, 0.06467518210411072, -0.034242670983076096, 0.0667557641863823, -0.11528851091861725, 0.29112866520881653, 0.14046618342399597, -0.5439338088035583, -0.39292410016059875, 0.006189783103764057, 0.49998342990875244, -0.017780598253011703, 0.1581382006...
speed but RAM. Here is a nice study about [String Concatenation vs Memory Allocation](http://blog.cumps.be/string-concatenation-vs-memory-allocation/). > **If you can avoid concatenating, do it!** > > > This is a no brainer, if you don't > have to concatenate but want your > source code to look nice, use the > fi...
[ -0.12394244968891144, -0.10737818479537964, 0.08611629903316498, 0.3150385022163391, 0.12018445134162903, -0.07231663912534714, 0.24868814647197723, -0.019352855160832405, -0.39014220237731934, -0.8550257086753845, 0.042102161794900894, 1.056581735610962, -0.17284300923347473, -0.300181657...
(2 > strings, 3 strings, string array). > This will clearly show what your code > does without any surprises, while > allowing yourself to keep a check on > the efficiency. > > > **Try to estimate the target size of a StringBuilder.** > > > The more accurate you can estimate the > needed size, the less tempor...
[ 0.13195396959781647, -0.14971278607845306, 0.18525801599025726, 0.08596564829349518, -0.24889986217021942, -0.18567731976509094, 0.2813771963119507, -0.4948582649230957, -0.3729560375213623, -0.8257484436035156, -0.11798672378063202, 0.6299924850463867, -0.16693665087223053, -0.18718029558...
could > construct an array out of pieces when > all you are using are {x} replaces. > Format() is good for readability, but > one of the things to go when you are > squeezing all possible performance out > of your application.
[ 0.04777812212705612, -0.2831132411956787, -0.1244162991642952, 0.21197457611560822, -0.34371238946914673, -0.23682112991809845, 0.36590108275413513, -0.42625775933265686, 0.057052165269851685, -0.8242592811584473, 0.06270807981491089, 0.1992950737476349, -0.07310435175895691, -0.1443596035...
I was currently developing a desktop application in C# using mono and testing in SuSE and Windows. The concept doesn't matter much, but it is a "web lint" program that will scan a web site and return possible issues with security and/or cross browser compatibility. However, I want to be able to offer binaries for multi...
[ 0.4472901523113251, 0.20107699930667877, -0.053329482674598694, 0.05861981585621834, -0.24302005767822266, -0.3611026406288147, 0.19567649066448212, -0.07536041736602783, -0.08119865506887436, -0.6117406487464905, 0.010101264342665672, 0.5922194719314575, -0.3737778663635254, -0.0879661664...
most desktop environments. The trick will be the "mobile platform" requirement. Mobile operating systems are wildly diverse and there's not a lot you can do to generalize. Some have Java, like the Blackberry. C# may get you onto Windows Mobile-based platforms. iPhones do their own thing. You pretty much have to pick ...
[ 0.20046009123325348, 0.17180585861206055, -0.007706643547862768, 0.24466852843761444, 0.31880706548690796, 0.01920730620622635, 0.33008337020874023, 0.45752158761024475, -0.42975476384162903, -0.7350485324859619, -0.1708325445652008, 0.4717598259449005, -0.3172658085823059, -0.103156186640...
I've got a 'task list' database that uses the adjacency list model (see below) so each 'task' can have unlimited sub-tasks. The table has an 'TaskOrder' column so everything renders in the correct order on a treeview. Is there an SQL statement (MS-SQL 2005) that will select all the child nodes for a specified parent a...
[ -0.09306841343641281, 0.15455745160579681, 0.20022718608379364, -0.03174065798521042, 0.18348394334316254, 0.30058997869491577, 0.05234866216778755, -0.051533788442611694, -0.34558606147766113, -0.5679574012756348, 0.1495896428823471, 0.4919598400592804, -0.024314064532518387, 0.2693719267...
than the one you deleted, thereby closing the gap (pseudocode follows): ``` CREATE TRIGGER ON yourtable FOR DELETE AS UPDATE Task SET TaskOrder = TaskOrder - 1 WHERE ParentTaskId = deleted.ParentTaskId AND TaskOrder > deleted.TaskOrder ``` If you don't want a trigger, you can capture the parentI...
[ -0.32247596979141235, -0.3161745071411133, 0.31815242767333984, -0.05750073119997978, 0.028108717873692513, 0.10595665872097015, 0.1364668905735016, -0.2204616218805313, -0.11817637085914612, -0.6455726623535156, 0.04682043567299843, 0.4751320481300354, -0.4172336757183075, 0.2593747973442...
then move the others up, then do the delete, but that seems overly complicated.
[ 0.17977163195610046, 0.09540199488401413, 0.24054980278015137, 0.2020939737558365, 0.09534159302711487, 0.002500674221664667, 0.07305330038070679, -0.28639277815818787, -0.2933099567890167, -0.3472808301448822, -0.19515807926654816, 0.3405197858810425, 0.07176373153924942, 0.05595632642507...
I am trying to extract a certain part of a column that is between delimiters. e.g. find foo in the following test 'esf :foo: bar So in the above I'd want to return foo, but all the regexp functions only return true|false, is there a way to do this in MySQL Here ya go, bud: ``` SELECT SUBSTR(column, LOCATE('...
[ -0.09079621732234955, 0.2542283236980438, 0.49340328574180603, -0.4132518470287323, -0.04736241325736046, 0.23908813297748566, 0.5009573101997375, -0.26775798201560974, 0.1745477169752121, -0.41133594512939453, 0.11971177160739899, 0.5155771374702454, -0.41509491205215454, -0.1171655207872...
LOCATE, so we have to do it manually by performing a LOCATE(':', REVERSE(column)). With the index of the first ':', the number of chars from the last ':' to the end of the string, and the CHAR\_LENGTH (*don't use LENGTH() for this*), we can use a little math to discover the length of the string between the two instanc...
[ -0.16482356190681458, 0.07547098398208618, 0.26841023564338684, 0.04694042727351189, 0.10335475951433182, 0.3729460537433624, 0.25604507327079773, -0.12494595348834991, 0.3917578458786011, -0.6982933878898621, -0.13070864975452423, 0.38828280568122864, -0.08813045173883438, 0.0490761809051...
In a C++ Linux app, what is the simplest way to get the functionality that the [Interlocked](http://msdn.microsoft.com/en-us/library/system.threading.interlocked.aspx) functions on Win32 provide? Specifically, a lightweight way to atomically increment or add 32 or 64 bit integers? Upon further review, [this](http://gcc...
[ -0.20237119495868683, 0.059239909052848816, 0.36288201808929443, 0.11384449154138565, 0.11027494072914124, -0.12884147465229034, -0.011449374258518219, -0.2550865411758423, -0.3638647794723511, -0.23294268548488617, -0.29828453063964844, 0.415750652551651, -0.7164593935012817, -0.350677430...
I'm benchmarking a WPF application on various platforms and I need an easy way to determine if WPF is using hardware or software rendering. I seem to recall a call to determine this, but can't lay my hands on it right now. Also, is there an easy, code based way to force one rendering pipeline over the other? Check R...
[ 0.25667786598205566, -0.0732099711894989, 0.6712393760681152, -0.0558917373418808, -0.46630144119262695, -0.026714490726590157, 0.07543852925300598, -0.5007252097129822, -0.06597590446472168, -0.8419961333274841, -0.16141687333583832, 0.5908748507499695, -0.0009498691069893539, -0.11962021...
indicates the rendering tier for the current thread. * **RenderCapability.TierChanged** - Occurs when the rendering tier has changed for the Dispatcher object of the current thread. **RenderCapability.Tier >> 16** * **Rendering Tier 0** - No graphics hardware acceleration. The DirectX version level is less than versi...
[ -0.1613178551197052, -0.12528207898139954, 0.8936296105384827, -0.1949106603860855, -0.3076176643371582, 0.1639569252729416, 0.3788667917251587, 0.2709386348724365, -0.28836703300476074, -0.9161433577537537, -0.43133193254470825, 0.5073139071464539, -0.1318690925836563, 0.2368035465478897,...
[This question](https://stackoverflow.com/questions/57168/how-to-copy-a-row-from-one-sql-server-table-to-another) comes close to what I need, but my scenario is slightly different. The source table and destination table are the same and the primary key is a uniqueidentifier (guid). When I try this: ``` insert into MyT...
[ -0.07324931770563126, 0.346050500869751, 0.2673884630203247, 0.12202031165361404, 0.04314212501049042, -0.1017565056681633, -0.18155725300312042, -0.05229783430695534, -0.1784314662218094, -0.6431413292884827, 0.11765199154615402, 0.3323672413825989, -0.19661696255207062, 0.447567939758300...
make matters more complex, I need to take the primary key of the original record, and insert it into another field in the copy (PreviousId field). I'm sure there is an easy solution to this, I just don't know enough TSQL to know what it is. Try this: ``` insert into MyTable(field1, field2, id_backup) select fiel...
[ 0.18541577458381653, 0.0668545588850975, -0.02014448121190071, -0.07144572585821152, 0.2678963840007782, -0.2797853350639343, -0.11049015074968338, -0.015162704512476921, 0.08011698722839355, -0.5733966827392578, 0.13682837784290314, 0.5953453779220581, -0.11391956359148026, 0.248250499367...
Often I want to add a value to a table or update the value if its key already exists. This can be accomplished in several ways, assuming a primary or unique key is set on the 'user\_id' and 'pref\_key' columns in the example: **1. Blind insert, update if receiving a duplicate key error:** ``` // Try to insert as a ne...
[ 0.27000877261161804, 0.24405156075954437, 0.4412980079650879, -0.1615702509880066, 0.10238812863826752, -0.13615399599075317, 0.17315950989723206, -0.46425020694732666, -0.09185842424631119, -0.7807362675666809, -0.08635768294334412, 0.5394517779350281, -0.32867559790611267, 0.029386971145...
If count is zero, insert INSERT INTO my_prefs (user_id, pref_key, pref_value) VALUES (1234, 'show_help', 'true'); // If count is one, update UPDATE my_prefs SET pref_value = 'true' WHERE user_id=1234 AND pref_key='show_help'; ``` The first way seems to be preferable as it will require only one query for new inse...
[ 0.1920187920331955, 0.2640335261821747, 0.44926995038986206, -0.09731884300708771, 0.13723544776439667, 0.13892780244350433, 0.2327674776315689, -0.33768603205680847, -0.14917799830436707, -0.5731428265571594, 0.0889461562037468, 0.8420401811599731, -0.3606260418891907, -0.0264855977147817...
to non-MySQL databases. The "blind insert" seems reasonable and robust provided that rows are never deleted. (If the INSERT case fails because the row exists, the UPDATE afterward should succeed because the row still exists. But this assumption is false if rows are deleted - you'd need retry logic then.) On other data...
[ -0.03424326702952385, 0.2159079611301422, -0.06328989565372467, 0.35701560974121094, 0.25769609212875366, -0.2326388955116272, 0.38825902342796326, 0.14361609518527985, -0.30605369806289673, -0.6256589889526367, -0.29129767417907715, 0.7071999311447144, -0.46703141927719116, 0.081388644874...
could be added between your SELECT and your UPDATE. Transactions won't even really help - I think even at isolation level "serializable", you'll see "could not serialize access due to concurrent update" errors occasionally (or whatever the MySQL equivalent error message is). You'll need retry logic, so I'd say the pers...
[ -0.03130713105201721, -0.19652214646339417, 0.2104216068983078, 0.2356054037809372, 0.1123577430844307, -0.0965956300497055, 0.26232361793518066, 0.11407507956027985, -0.2910207211971283, -0.5647749304771423, 0.005115796346217394, 0.6966260671615601, -0.27175527811050415, 0.123682431876659...
I want to be able to run a text editor from my app, as given by the user in the TEXT\_EDITOR environment variable. Now, assuming there is nothing in that variable, I want to default to the TextEdit program that ships with OSX. Is it kosher to hardcode /Applications/TextEdit.app/Contents/MacOS/TextEdit into my app, or i...
[ 0.3156326115131378, 0.20760853588581085, 0.36014237999916077, -0.0992468073964119, -0.05634778365492821, -0.036084987223148346, 0.4887979030609131, 0.30410075187683105, -0.26732122898101807, -0.7442865371704102, -0.08257115632295609, 0.785204291343689, -0.363535076379776, -0.22168849408626...
for a reason. In your second edit it makes it sound like you just want to get the path to TextEdit, this can be done easily by using NSWorkspace method absolutePathForAppBundleWithIdentifier: ``` NSString *path = [[NSWorkspace sharedWorkspace] absolutePathForAppBundleWithIdentifier:@"com.apple.TextEdit"]; ```
[ -0.03215617686510086, -0.17022283375263214, 0.4666084945201874, -0.12908585369586945, 0.09717745333909988, 0.12337341904640198, 0.545560896396637, 0.1659010797739029, -0.1759641021490097, -0.8973870873451233, -0.052493542432785034, 0.8019329309463501, -0.2719268500804901, -0.25253328680992...
I'm running my site through the W3C's validator trying to get it to validate as XHTML 1.0 Strict and I've gotten down to a particularly sticky (at least in my experience) validation error. I'm including certain badges from various services in the site that provide their own API and code for inclusion on an external sit...
[ 0.5481587052345276, 0.5558397173881531, 0.35348618030548096, 0.09935060143470764, 0.04907393455505371, -0.22707565128803253, 0.3667653203010559, -0.014874839223921299, -0.03921088948845863, -0.41213729977607727, -0.24781998991966248, -0.002592892851680517, -0.039855875074863434, 0.22634366...
tag which it then throws an error on. As a caveat, I understand that I could complain to the services that their badges don't validate. Sans this, I assume that someone has validated their code while including badges like this, and that's what I'm interested in. Answers such as, 'Complain to Flickr about their badge' ...
[ 0.5727182030677795, 0.18141186237335205, 0.5611878633499146, 0.19998188316822052, -0.06409011036157608, -0.288412868976593, 0.5770361423492432, -0.20178338885307312, -0.00649357819929719, -0.353839635848999, -0.07867176085710526, 0.6839830875396729, -0.20047874748706818, -0.207797452807426...
the only way it can be made to validate, oh well, but please lean answers towards semantic markup. As an example: ``` <div id="twitter_div"> <h2><a href="http://twitter.com/stopsineman">@Twitter</a></h2> <ul id="twitter_update_list"> <script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></sc...
[ -0.15910863876342773, -0.08213083446025848, 0.8535609245300293, 0.0470200814306736, -0.25844818353652954, 0.10919700562953949, 0.06712886691093445, -0.4042782485485077, -0.38768714666366577, -0.4239994287490845, -0.3879823386669159, -0.10414404422044754, 0.1592065393924713, -0.061187699437...
var insertedNode = document.createElement("ul"); insertedNode .setAttribute("id", "twitter_update_list"); parentNode.insertBefore( insertedNode, placeHolderNode); parentNode.remove(placeHolderNode); </script> <script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script> <script ty...
[ -0.12324979901313782, -0.06334184855222702, 0.5315299034118652, -0.4001600742340088, 0.23545026779174805, 0.390989750623703, -0.21700923144817352, -0.18124444782733917, -0.04642416909337044, -0.42522117495536804, -0.3284543454647064, 0.12164846807718277, -0.15847113728523254, 0.13589209318...
It's helpful to name threads so one can sort out which threads are doing what for diagnostic and debugging purposes. Is there a particular naming convention for threads in a heavily multi-threaded application that works better than another? Any guidelines? What kind of information should go into the name for a thread?...
[ 0.8576804995536804, 0.011310056783258915, -0.3655863404273987, 0.30563685297966003, -0.03219067305326462, -0.12200931459665298, 0.2983849346637726, 0.3785723149776459, -0.5339890718460083, -0.4425729811191559, 0.11402979493141174, 0.08791858702898026, -0.17578481137752533, 0.37661126255989...
part is at the beginning. Log viewers in a graphical user interface tend to have tables with columns, and the thread column is usually small or will be made small by you to read everything else. * Do not use the word "thread" in the thread name because it is obvious. * make the thread names easily grep-able. Avoid simi...
[ 0.20027387142181396, -0.08708938956260681, 0.21890918910503387, 0.09793411195278168, -0.04579344391822815, 0.08183590322732925, 0.2529006004333496, -0.006921014282852411, -0.16479873657226562, -0.320525199174881, -0.2072596400976181, 0.17335541546344757, -0.06955830752849579, 0.27170351147...
the next 5 worker threads?), "GUIThread" (which GUI? is it for one window? for everything?) or "Calculation" (what does it calculate?). * if you have a test group that uses thread names to grep your application's log files, do not rename your threads after some time. Your testers will hate you for doing so. Thread name...
[ 0.02140360325574875, -0.1482296884059906, 0.5201078057289124, 0.06523484736680984, 0.1089772880077362, 0.09772849082946777, 0.18972933292388916, 0.06346281617879868, -0.38333606719970703, -1.1239292621612549, 0.06553347408771515, 0.49215513467788696, -0.20272107422351837, 0.457387536764144...
have many threads and forgot to name one, your log mechanism should output a unique thread ID instead (API-specific, e.g. by calling pthread\_self() )
[ 0.3882144093513489, -0.1475593000650406, 0.15599210560321808, 0.10633088648319244, 0.28873199224472046, -0.14353583753108978, 0.31233805418014526, 0.0008470154134556651, -0.4570685029029846, -0.7052284479141235, 0.08745630830526352, 0.39467695355415344, -0.2867814898490906, 0.2730686068534...