text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
a service for working on his product.
* Consider an agile development model or something similar so that tasks are well defined, small, paid for, and indisputable. | [
0.4822293817996979,
-0.0023069591261446476,
-0.26987993717193604,
0.15254656970500946,
-0.10266634076833725,
0.2215612381696701,
0.44478291273117065,
0.02953232452273369,
-0.15277515351772308,
-0.6049380898475647,
-0.3860916197299957,
0.3006841242313385,
-0.08139364421367645,
-0.1134878844... | |
I'm trying to find the best solution for nonblocking IO via stdin/stdout with the following characteristics:
* As long as there is enough data, read in *n*-sized chunks.
* If there's not enough data, read in a partial chunk.
* If there is no data available, block until there is some (even though it may be smaller than... | [
0.11729218810796738,
-0.033706143498420715,
-0.035237301141023636,
0.08079350739717484,
-0.27233150601387024,
0.09194538742303848,
0.16536769270896912,
-0.023874875158071518,
-0.27576395869255066,
-0.8859791159629822,
0.07334163039922714,
0.3862806558609009,
-0.17567284405231476,
0.0071008... | |
(since you can't select() on file handles in windows)... ((There is also istream::readsome() which seems promising, but the only results I can find on google were of people saying it doesn't actually work well.))
Since I haven't done much coding w/ these APIs, perhaps there is a better way.
Maybe [boost::asio](http://... | [
0.26926252245903015,
-0.06804601103067398,
0.4198863208293915,
0.0792989432811737,
0.05918020382523537,
-0.1888304501771927,
0.2166493833065033,
-0.11812364310026169,
-0.25545504689216614,
-0.49745866656303406,
-0.19511692225933075,
0.5611258149147034,
-0.019854793325066566,
-0.23936833441... | |
I am trying to find out which Hypervisor will allow me to grant access to specialized PCI cards (such as a telephony card) to a virtual machine. So far I have tried out VMWare ESXi server and it doesn't seem to allow me to do this. I have heard that Microsoft Virtual Server does allow this, but I haven't been able to f... | [
0.5181166529655457,
0.14542801678180695,
0.21960178017616272,
0.321181058883667,
0.07468665391206741,
-0.22927163541316986,
0.09187424182891846,
0.150577574968338,
-0.21756412088871002,
-0.7536916732788086,
-0.0822581872344017,
0.4922730028629303,
-0.20280107855796814,
0.2605855464935303,
... | |
more information. I'm not a Xen user, but from my virtualization experience I would guess that the paravirtualization aspects of a Xen host/guess is going to be your best bet for raw device access. | [
0.5468896627426147,
-0.2330692857503891,
-0.1242285817861557,
0.5166665315628052,
-0.012453720904886723,
-0.3750024437904358,
0.16087141633033752,
0.49833014607429504,
-0.18042908608913422,
-0.6383684873580933,
0.20586973428726196,
0.27423056960105896,
0.10910915583372116,
0.28813883662223... | |
I've got Postscript code/data (?) in memory (in a Java Tomcat webapp) that I'd like to send directly to a networked PS printer. Is there an easy way (i.e. just popping open a port and sending the text) to print this, bypassing all of the O/S-specific drivers and stuff (and hopefully not even requiring extra jars)? A li... | [
0.5169737935066223,
-0.04370268061757088,
0.7793851494789124,
0.16012819111347198,
0.06603775918483734,
-0.1222916841506958,
0.10491577535867691,
0.5677610635757446,
-0.21363365650177002,
-0.9508334994316101,
-0.2154904454946518,
0.3832474648952484,
-0.028697706758975983,
-0.00184406107291... | |
My C++ framework has Buttons. A Button derives from Control. So a function accepting a Control can take a Button as its argument. So far so good.
I also have List`<`T>. However, List`<`Button> doesn't derive from List`<`Control>, which means a function accepting a list of Controls can't take a list of Buttons as its a... | [
-0.2514961063861847,
0.2848277986049652,
0.23229269683361053,
-0.19436590373516083,
-0.1858472228050232,
0.1349766105413437,
0.01688377745449543,
-0.12489894777536392,
-0.17513109743595123,
-0.5632197856903076,
0.11632046103477478,
0.6833319067955017,
-0.44363078474998474,
-0.1012786179780... | |
to Control instead of pointers to Control, your buttons will be garbage anyway (Google "object slicing"). If they're lists of pointers, then either make the `list<button*>` into `list<control*>` as others have suggested, or do a copy to a new `list<control*>` from the `list<button*>` and pass *that* into the function i... | [
0.08407466858625412,
-0.30387750267982483,
0.5272817015647888,
0.1506148725748062,
0.025928733870387077,
0.28180545568466187,
-0.05064079537987709,
-0.5205219388008118,
-0.16168522834777832,
-0.6653413772583008,
0.18892240524291992,
0.5789012312889099,
-0.5409525036811829,
0.15052247047424... | |
buttons;
std::list<Control*> controls;
doSomething( buttons );
doSomething( controls );
}
``` | [
-0.022337989881634712,
0.0216289684176445,
0.4715332090854645,
-0.17314741015434265,
0.22292116284370422,
0.3180555999279022,
0.0665568932890892,
-0.2834758162498474,
-0.1830405294895172,
-0.6274110078811646,
-0.02639755979180336,
0.6703504323959351,
-0.4200294017791748,
0.194630429148674,... | |
I'm using the `QMdiArea` in Qt 4.4.
If a new project is created, I add a number of sub windows to a `QMdiArea`. I'd like to disallow the user to close a sub window during runtime. The sub windows should only be closed if the whole application is closed or if a new project is created.
How can I do this?
You need to de... | [
0.13446730375289917,
0.17486074566841125,
0.5349901914596558,
-0.2196948230266571,
0.04784729331731796,
-0.17181195318698883,
0.3446301519870758,
-0.33053743839263916,
0.10593380033969879,
-0.707358181476593,
-0.1667092889547348,
0.465580016374588,
-0.4636169672012329,
0.5993918180465698,
... | |
do something else, like
// writing a string in status bar ...
}
```
then subclass the `QMdiArea` and override `QMdiArea::closeAllSubWindows ()` like this:
```
class MainWindowArea : public QMdiArea
{
Q_OBJECT
public:
explicit MainWindowArea(QWidget *parent = 0);
signals:
void c... | [
0.006994641851633787,
-0.08904803544282913,
0.6355190277099609,
-0.24507291615009308,
0.23052161931991577,
-0.03922867774963379,
0.3619570732116699,
-0.3893371820449829,
-0.0019056251039728522,
-0.6207799911499023,
-0.4012233018875122,
0.30865219235420227,
-0.3573263883590698,
0.5259034037... | |
}
}
```
you may also need to override `close` slot of your mdi area. | [
0.06766769289970398,
0.12655948102474213,
0.18739260733127594,
-0.16225659847259521,
0.4158916473388672,
-0.3861081898212433,
-0.2577170431613922,
0.100487619638443,
0.08519423753023148,
-0.6074885129928589,
-0.33175551891326904,
0.6601702570915222,
-0.3036953806877136,
0.19089925289154053... | |
I'm using two commercial libraries that are produced by the same vendor, called VendorLibA and VendorLibB. The libraries are distributed as many DLLs that depend on the compiler version (e.g. VC7, VC8). Both libraries depend on a another library, produced by this vendor, called VendorLibUtils and contained in one DLL.
... | [
0.40558913350105286,
0.1481533646583557,
-0.09660116583108902,
0.029306326061487198,
-0.17328378558158875,
-0.1854211837053299,
0.05983657017350197,
-0.0009006384643726051,
0.007329999003559351,
-0.8023087978363037,
0.20944996178150177,
0.4245397448539734,
-0.47449642419815063,
0.363891184... | |
since my process is not that one that's importing VendorLibUtils.
**EDIT:** Forgot to mention the obvious, I don't have to source code for any of the commercial libraries and probably I will never have (*sigh*).
**EDIT:** The alternative btw, is to do this: [How to combine GUI applications in Windows](https://stackov... | [
0.28547459840774536,
0.06569042056798935,
0.11962410807609558,
-0.12178470194339752,
-0.14014211297035217,
-0.10661181062459946,
0.10776777565479279,
-0.09853528439998627,
-0.3487232029438019,
-0.807641327381134,
-0.17320513725280762,
0.7134660482406616,
-0.4355100095272064,
-0.00598706817... | |
with the same names, you *might* need to patch the imports and export tables too, but let's hope not! :-) | [
0.7243126034736633,
0.33278924226760864,
0.05423544719815254,
0.25268200039863586,
0.13188429176807404,
0.13695867359638214,
0.07142090052366257,
0.42922312021255493,
-0.40460896492004395,
-0.3778468668460846,
-0.1972583383321762,
0.4592777490615845,
-0.17970292270183563,
0.192092701792716... | |
At the moment I'm creating a `DateTime` for each month and formatting it to only include the month.
Is there another or any better way to do this?
You can use the [`DateTimeFormatInfo`](http://msdn.microsoft.com/en-us/library/system.globalization.datetimeformatinfo.aspx) to get that information:
```
// Will return ... | [
0.2179383635520935,
0.007863643579185009,
0.6956761479377747,
0.0821457952260971,
-0.02678011916577816,
0.015204863622784615,
0.019709927961230278,
0.14044658839702606,
-0.48820585012435913,
-0.36311712861061096,
-0.16342616081237793,
-0.1977841854095459,
-0.0025161798112094402,
0.44581750... | |
12 months (such as those found in en-US or fr for example). | [
0.4149586260318756,
0.09386719763278961,
0.02356893941760063,
-0.09221642464399338,
0.05035039409995079,
-0.14243145287036896,
0.3225191831588745,
0.3838616609573364,
-0.15766136348247528,
-0.11544571816921234,
-0.3537946343421936,
-0.08103103190660477,
0.48719772696495056,
-0.192524462938... | |
I can't, for the life of me, remember what exactly our teacher said that day and I'm hoping you would probably know.
The module is "Data Structures and Algorithms" and he told us something along the lines of:
> The `if` statement is the most expensive
> [something]. [something] registers
> [something].
Yes, I do h... | [
0.8495138883590698,
0.11660051345825195,
-0.07279182970523834,
0.25689008831977844,
0.3944483697414398,
0.11712397634983063,
0.0011615058174356818,
-0.028202595189213753,
0.09906952828168869,
-0.5163975954055786,
0.0724814236164093,
0.6337634921073914,
0.04682934656739235,
0.16479703783988... | |
be executed is stored in something typically called the *instruction pointer* (IP) or *program counter* (PC); these terms are synonymous, but different terms are used with different architectures. For most instructions, the PC of the next instruction is just the current PC plus the length of the current instruction. Fo... | [
0.6237947344779968,
-0.13955534994602203,
0.3858388364315033,
-0.06933753192424774,
0.20233531296253204,
0.3314637839794159,
0.17257806658744812,
0.07205411046743393,
-0.02162124589085579,
-0.24630075693130493,
-0.1582181602716446,
0.16700401902198792,
-0.14972592890262604,
0.1294528096914... | |
of the next instruction.
For *branch* instructions, however, the next instruction to be executed is not the next location after the current instruction. Branches are gotos - they tell the processor where the next instruction is. Branches can either be conditional or unconditional, and the target location can be either... | [
0.14879094064235687,
-0.584813117980957,
0.20311667025089264,
0.440599262714386,
0.38733017444610596,
0.12709401547908783,
0.30457478761672974,
0.24166493117809296,
-0.20800714194774628,
-0.28228864073753357,
-0.6122402548789978,
0.08213935047388077,
-0.07749941200017929,
0.012144866399466... | |
always taken. Conditional branches show up in `if` statements and the control tests of `for` and `while` loops. Unconditional branches show up in infinite loops, function calls, function returns, `break` and `continue` statements, the infamous `goto` statement, and many more (these lists are far from exhaustive).
The ... | [
0.1920793652534485,
-0.48714303970336914,
-0.06711933761835098,
0.3444736897945404,
0.03484301269054413,
-0.028584135696291924,
0.34552139043807983,
0.10511250793933868,
-0.45745569467544556,
-0.024426205083727837,
-0.36582863330841064,
0.0685356929898262,
-0.38048192858695984,
0.133419290... | |
`switch` statements (sometimes), returning from a function, virtual function calls, and function pointer calls.
So what does this all mean for performance? When the processor sees a branch instruction appear in its pipeline, it needs to figure out how to continue to fill up its pipeline. In order to figure out what in... | [
0.4524390697479248,
-0.5588251352310181,
0.11054261773824692,
0.18569061160087585,
0.20308108627796173,
0.2571827471256256,
0.11485558748245239,
-0.013921020552515984,
-0.3616420328617096,
-0.3545758128166199,
-0.1700938194990158,
0.35060223937034607,
0.0023893301840871572,
0.1075033470988... | |
at full speed. If instead the processor guesses *incorrectly*, it just spent some time computing the wrong thing. It now has to flush its pipeline and reload it with instructions from the correct execution path. Bottom line: a big performance hit.
Thus, the reason why if statements are expensive is due to **branch mis... | [
0.15229591727256775,
0.02229057252407074,
0.09487020969390869,
0.367199569940567,
-0.1103682816028595,
0.024449888616800308,
0.6635795831680298,
0.14294449985027313,
-0.348254919052124,
-0.3134270906448364,
-0.16210609674453735,
0.7700785994529724,
0.0977521687746048,
-0.2233736664056778,
... | |
often be superior to code that branches, even if several more instructions are needed. There are some cool bit-twiddling tricks you can do to compute things such as `abs()`, `min()`, and `max()` without branching. | [
0.3833472430706024,
-0.07121232897043228,
-0.10221119225025177,
0.5659369230270386,
0.10303305834531784,
-0.1878633350133896,
0.4682947099208832,
-0.09506898373365402,
-0.13225369155406952,
-0.38484662771224976,
-0.15771831572055817,
0.7214081287384033,
0.14586283266544342,
-0.239712074398... | |
I have a database that i'm dealing with which is updated every few hours remotely (not on any specific time span) and i have no control over the administration of it. I have web clients connecting to it to view information contained within it. These clients (coded using PHP and Javascript) might be checking the databas... | [
0.8872264623641968,
0.49856066703796387,
0.06593091040849686,
-0.007213423494249582,
0.0477961041033268,
-0.17755597829818726,
0.3411376476287842,
0.16426509618759155,
-0.042479947209358215,
-0.5828560590744019,
-0.03760412335395813,
0.4098753333091736,
-0.06677812337875366,
-0.00888033304... | |
things snappy what would be the best way to limit the number of times the clients will actually run the whole query on the database?
To make things crystal clear, i have no way of altering the database, i can only query it. But i have full control over the source of the web client.
Do you have control over the web app... | [
0.4171402156352997,
-0.2934551239013672,
0.653398871421814,
0.12193898856639862,
0.06382936239242554,
-0.20740041136741638,
0.18163439631462097,
0.2735798954963684,
-0.5316849946975708,
-0.16156932711601257,
0.19306372106075287,
0.9329187273979187,
-0.13100041449069977,
-0.1619304865598678... | |
the last query.
[PHP Sessions](http://us.php.net/session "PHP Sessions") | [
-0.05095004290342331,
0.04898219555616379,
0.5644316673278809,
0.26842957735061646,
-0.14059634506702423,
-0.05320723354816437,
0.418646901845932,
-0.0787406861782074,
-0.42173662781715393,
-0.27225038409233093,
-0.0475526861846447,
0.1866808533668518,
0.03715011849999428,
0.19102944433689... | |
I have a nice and lovely Django site up and running, but have noticed that my `error.log` file was getting huge, over 150 MB after a couple of months of being live. Turns out a bunch of spambots are looking for well known URL vulnerabilities (or something) and hitting a bunch of sub-directories like `http://mysite.com/... | [
0.2845139801502228,
0.4087767004966736,
0.33798179030418396,
-0.10325523465871811,
-0.24208498001098633,
-0.4968503713607788,
0.5703250169754028,
0.2988637685775757,
-0.24523596465587616,
-0.6149914264678955,
0.08915653079748154,
0.43162018060684204,
0.03469070419669151,
0.3752811551094055... | |
but it's filling up my logs very quickly.
Is there a way to turn this behavior off? Or perhaps just block the IP's doing this?
Um, perhaps, use [logrotate](http://linuxcommand.org/man_pages/logrotate8.html) to rotate and compress the logs periodically, if it isn't being done already. | [
0.3389299809932709,
-0.018966589123010635,
0.4153546988964081,
0.19925571978092194,
0.1375586986541748,
-0.5425624847412109,
0.3895201086997986,
0.11682241410017014,
-0.5758335590362549,
-0.5379751920700073,
-0.02446688339114189,
0.5431715250015259,
-0.10792484879493713,
0.2582638263702392... | |
I am using windows authentication within an ASP.NET application. I am wondering how to best get the objectGuid from the currently logged in user?
Regards, Egil.
You can do this with the System.DirectoryServices namespace.
```
Dim entry As DirectoryServices.DirectoryEntry
Dim mySearcher As System.DirectoryServices.Di... | [
-0.2126166820526123,
-0.09397869557142258,
1.0543968677520752,
-0.19523969292640686,
-0.1736852079629898,
-0.06130615621805191,
0.21547627449035645,
-0.30194270610809326,
-0.025198934599757195,
-0.8206226825714111,
-0.14455386996269226,
0.6680390238761902,
-0.20430663228034973,
0.279994368... | |
the AD entry that goes with it
myEntry = result.GetDirectoryEntry
'The Guid property is the objectGuid
objectGuid = myEntry.Guid
```
There might be a better way to do this, but this works! | [
-0.0856672152876854,
0.1592164933681488,
0.7693021297454834,
0.055736690759658813,
0.003671258920803666,
-0.4158209264278412,
0.12433359026908875,
0.15992242097854614,
0.3424157202243805,
-0.5194562077522278,
-0.13670296967029572,
0.5733487010002136,
-0.13396795094013214,
0.393911480903625... | |
Is it advisable to use arrays in Javascript using tens of thousands of indexes?
I have a database which contains a table of static data, meaning that it will never change. In this case would it be advisable to convert this table to a javascript array and look the info up in there when needed? Is this bad practice?
Th... | [
0.32147979736328125,
0.2428489774465561,
0.22366446256637573,
0.22761455178260803,
-0.16673989593982697,
0.11002827435731888,
-0.1305970996618271,
-0.482541561126709,
-0.2450123429298401,
-0.6221640110015869,
0.14593656361103058,
0.4887830317020416,
-0.3040844202041626,
-0.0071886964142322... | |
less memory footprint than a huge JavaScript array. | [
-0.41690585017204285,
0.1865394115447998,
-0.5293839573860168,
0.17850403487682343,
-0.3084185719490051,
-0.013898157514631748,
0.055074553936719894,
0.11570405215024948,
0.29245445132255554,
-0.8360975384712219,
-0.06991986185312271,
0.41353917121887207,
-0.11914954334497452,
0.0230415649... | |
I am currently using SQL Server Management Studio (Ver 9.00.3042.00) and click the "New Query" and wrote the following code:
```
Select
colA,
colB,
colC
colD
From
table1
```
When I click the parse (checkbox) button to validate the SQL statement, it says "Command(s) completed successfully". Isn't... | [
-0.0022588104475289583,
0.4778059124946594,
0.6278459429740906,
-0.11566853523254395,
0.12333779782056808,
-0.06057921051979065,
0.26232385635375977,
0.10578536242246628,
-0.24866294860839844,
-0.48753440380096436,
-0.19257283210754395,
0.5020729303359985,
-0.20304878056049347,
0.321127802... | |
as colD
```
Edit: For what it's worth, this is one of the reasons why people will argue that you should put the commas at the beginning of the line in cases like this. It's a lot easier to spot gotchas like this when the code is formatted as such:
```
Select
colA
, colB
, colC
colD
From
table1
... | [
0.09489364922046661,
0.29138854146003723,
0.40466082096099854,
0.09178870171308517,
-0.14793407917022705,
0.09010934084653854,
-0.05716955289244652,
0.49480491876602173,
-0.38436973094940186,
-0.2504936754703522,
-0.47885847091674805,
0.20297154784202576,
-0.3478621542453766,
0.17100153863... | |
Do you have any tricks for generating SQL statements, mainly INSERTs, in Excel for various data import scenarios?
I'm really getting tired of writing formulas with like
`="INSERT INTO Table (ID, Name) VALUES (" & C2 & ", '" & D2 & "')"`
The semi-colon needs to be inside the last double quote with a closing paren. Wh... | [
0.08677718788385391,
0.30848774313926697,
-0.007177176885306835,
-0.08141584694385529,
0.07857350260019302,
-0.10002897679805756,
0.32924962043762207,
0.005081973038613796,
-0.05364922434091568,
-0.29911190271377563,
-0.018375815823674202,
0.4742632508277893,
-0.30562329292297363,
-0.15816... | |
Here is the code currently used.
```
public String getStringFromDoc(org.w3c.dom.Document doc) {
try
{
DOMSource domSource = new DOMSource(doc);
StringWriter writer = new StringWriter();
StreamResult result = new StreamResult(writer);
TransformerFactory tf ... | [
-0.010687767527997494,
-0.3003433644771576,
0.8567285537719727,
-0.3204724192619324,
0.3857751786708832,
0.17548365890979767,
0.49762746691703796,
-0.3728793263435364,
0.08131977915763855,
-0.6138610243797302,
-0.33682018518447876,
0.6887255311012268,
-0.303794264793396,
0.3464856147766113... | |
= tf.newTransformer();
transformer.transform(domSource, result);
writer.flush();
return writer.toString();
}
catch(TransformerException ex)
{
ex.printStackTrace();
return null;
}
}
```
Relies on [DOM Level3 | [
-0.04031503200531006,
-0.572952926158905,
0.5159404873847961,
-0.34858638048171997,
0.2337186634540558,
-0.06191539764404297,
0.5823652148246765,
-0.682045042514801,
0.04420505464076996,
-0.26225435733795166,
-0.20919841527938843,
0.9682437181472778,
-0.39316609501838684,
0.221164479851722... | |
Load/Save](http://www.w3.org/TR/DOM-Level-3-LS/load-save.html):
```
public String getStringFromDoc(org.w3c.dom.Document doc) {
DOMImplementationLS domImplementation = (DOMImplementationLS) doc.getImplementation();
LSSerializer lsSerializer = domImplementation.createLSSerializer();
return lsSerializer.wr... | [
-0.26784801483154297,
0.011881113983690739,
0.8019163608551025,
-0.3875981271266937,
0.23206111788749695,
0.0323021300137043,
0.24124877154827118,
-0.4104657769203186,
-0.29621562361717224,
-0.4942166805267334,
-0.6443520784378052,
0.6576128005981445,
-0.46777358651161194,
0.13784185051918... | |
I like the idea of having only one `return` statement per method.
What do you do in this situation though?
```
public static string ChopText(string Text)
{
if (String.IsNullOrEmpty(Text))
{
// return here ?????
}
}
```
The only alternative I can think of is setting a flag, and then checking for the f... | [
0.07306550443172455,
-0.019657209515571594,
0.09698891639709473,
-0.11844849586486816,
-0.3366656005382538,
-0.13600243628025055,
0.5867730379104614,
-0.18434058129787445,
-0.2490818351507187,
-0.5420774817466736,
-0.06472738087177277,
0.6695403456687927,
-0.08675659447908401,
-0.017118195... | |
Is there a Wiki plugin for TFS 2005, ie. SharePoint Services 2.0?
You cannot do it easily.
The best option is:
[http://geekswithblogs.net/kobush/articles/CustomBorderForms3.aspx](https://web.archive.org/web/20200718062913/http://geekswithblogs.net:80/kobush/articles/CustomBorderForms3.aspx)
You can find more answers ... | [
-0.11532249301671982,
0.09156598895788193,
0.29489627480506897,
0.17898951470851898,
-0.229847714304924,
-0.021281631663441658,
0.3006449341773987,
-0.11322762072086334,
-0.2188347578048706,
-0.34943199157714844,
-0.06617285311222076,
0.5891889333724976,
-0.05561789497733116,
-0.1826766878... | |
I'm a non-computer science student doing a history thesis that involves determining the frequency of specific terms in a number of texts and then plotting these frequencies over time to determine changes and trends. While I have figured out how to determine word frequencies for a given text file, I am dealing with a (r... | [
0.32241103053092957,
0.32048431038856506,
0.44758883118629456,
0.08900479227304459,
-0.1185123473405838,
-0.2642253339290619,
0.12016322463750839,
0.10164043307304382,
-0.002303051995113492,
-0.5133937001228333,
0.008265100419521332,
0.2162243127822876,
0.14398834109306335,
0.0994153171777... | |
all I need to have is the frequencies for the specific words for each text file I process, preferably in spreadsheet format (tab delineated file) so that I can then create graphs and visualizations using that data.
I use Linux day-to-day, am comfortable using the command line, and would love an open-source solution (o... | [
0.450483500957489,
0.3643762469291687,
0.28670787811279297,
0.03779943659901619,
0.09450073540210724,
-0.22479082643985748,
0.24544218182563782,
0.23088575899600983,
0.013821332715451717,
-0.9669285416603088,
-0.16569602489471436,
0.6600493788719177,
-0.14382505416870117,
-0.01617821305990... | |
to do a frequency count using just the terms from the pre-defined list.
Any ideas?
I would go with the second idea. Here is a simple Perl program that will read a list of words from the first file provided and print a count of each word in the list from the second file provided in tab-separated format. The list of wor... | [
0.5846052169799805,
-0.1335127055644989,
0.3511642515659332,
-0.031184587627649307,
-0.16859480738639832,
-0.15247918665409088,
0.17841602861881256,
-0.1635904759168625,
-0.013312064111232758,
-0.6300371289253235,
0.12225800007581711,
0.7652096748352051,
-0.5719549655914307,
0.141573861241... | |
to track, initialize the count to zero
open(WORDS, $word_list_file) or die "Failed to open list file: $!\n";
while (<WORDS>) {
chomp;
# Store words in lowercase for case-insensitive match
$word_counts{lc($_)} = 0;
}
close(WORDS);
# Read the text file one line at a time, break the text up into words
# based on wo... | [
0.07579755783081055,
-0.03774923458695412,
0.4792110025882721,
-0.09372443705797195,
0.3151881992816925,
0.41788944602012634,
0.4394700229167938,
-0.26709920167922974,
-0.10139676928520203,
-0.40710020065307617,
-0.35096755623817444,
0.4905637204647064,
-0.2584264576435089,
0.0319728627800... | |
a hyphen, remove the hyphen and
# continue reading lines until we find one that doesn't
chop;
my $next_line = <FILE>;
defined($next_line) ? $_ .= $next_line : last;
}
my @words = split /\b/, lc; # Split the lower-cased version of the string
foreach my $word (@words) {
$word_counts{$word}++ if... | [
-0.03708109259605408,
0.0039034809451550245,
0.8978708386421204,
-0.2675216495990753,
0.011647642590105534,
0.3233819305896759,
0.25763455033302307,
-0.3888442814350128,
-0.01774345152080059,
-0.6264694929122925,
-0.49597787857055664,
0.2832432687282562,
-0.23568084836006165,
0.06496583670... | |
the file words.txt contains:
```
linux
frequencies
science
words
```
And the file text.txt contains the text of your post, the following command:
```
perl analyze.pl words.txt text.txt
```
will print:
```
frequencies 3
linux 1
science 1
words 3
```
Note that breaking on word boundaries using \b may not... | [
0.3370184004306793,
0.42783617973327637,
0.3989865183830261,
-0.04418634995818138,
-0.1934935748577118,
-0.12384644150733948,
0.3868162930011749,
0.005373743828386068,
0.4166736602783203,
-0.5120323300361633,
-0.238992378115654,
0.6305228471755981,
-0.3947557508945465,
-0.1777244210243225,... | |
hyphen and read another line before splitting the line into words.
**Edit**: Updated version that handles words case-insensitively and handles hyphenated words across lines.
Note that if there are hyphenated words, some of which are broken across lines and some that are not, this won't find them all because it only r... | [
-0.1759183704853058,
0.09313123673200607,
0.4035813808441162,
-0.04174215346574783,
-0.5739740133285522,
0.34312376379966736,
0.40104639530181885,
-0.047159936279058456,
-0.13081014156341553,
-0.7558310627937317,
-0.3746117949485779,
0.45082998275756836,
-0.23820766806602478,
0.06011121347... | |
How does one preserve the settings in the Open Dialog box? For example, I would the Open Dialog to remember that I chose the Details view and sorted by date modified.
Microsoft didn't see fit to give us any documented way of doing this, but some people have figured out bits of the puzzle. This link shows how to set the... | [
0.25295335054397583,
-0.12391788512468338,
0.3712709844112396,
0.27915599942207336,
0.23116236925125122,
-0.1097559928894043,
0.054549045860767365,
0.033120136708021164,
-0.22584883868694305,
-0.6323012113571167,
0.08711837977170944,
0.5124996900558472,
0.022648826241493225,
0.133023872971... | |
I have a three-step process that is entirely reliant upon JavaScript and Ajax to load data and animate the process from one step to the next. To further complicate matters, the transition (forward and backward) between steps is animated :-(. As user's progress through the process anchor's appear showing the current ste... | [
0.23911051452159882,
0.025148408487439156,
0.398292601108551,
-0.023562319576740265,
0.285259485244751,
0.23038187623023987,
0.04994935169816017,
-0.2747958302497864,
-0.17296789586544037,
-0.8880723118782043,
0.08529729396104813,
0.4816749691963196,
0.06414584070444107,
-0.077971525490283... | |
and step 2 also perform the same action as step 3.
This is the portion of the code that loops through all of the steps up to the current step that the user would be on and displays each anchor in turn and assigns the appropriate function to the click event:
```
for (var i = 0; i < profile.current + 1; i++) {
if ... | [
-0.1776677966117859,
-0.451887845993042,
0.8129227757453918,
-0.34636107087135315,
0.3345963954925537,
0.12140313535928726,
0.2384704202413559,
-0.811131477355957,
-0.344386488199234,
-0.40202754735946655,
-0.2765820324420929,
0.5465245842933655,
-0.468812495470047,
-0.36884933710098267,
... | |
+ i).innerHTML = profile.steps[i].anchor;
$('step_anchor_' + i).observe('click', function(){
pm.loadData(action, dao_id, true);
});
Effect.Appear('step_anchor_' + i, {
duration: 1,
delay: (down_delay++)
});
}
}
```
I know that problem lies in th... | [
-0.04568303003907204,
-0.5739862322807312,
0.7933233976364136,
-0.25959512591362,
0.3174251317977905,
0.12419389188289642,
0.34884384274482727,
-0.5501163005828857,
-0.47165393829345703,
-0.3825644254684448,
-0.33725863695144653,
0.5040857791900635,
-0.40726611018180847,
-0.109746180474758... | |
being passed in. I've also tried passing profile.steps[i].action and profile.steps[i].dao\_id but in that case both profile and i or at least i are out scope.
How do I make it so that I can assign the parameters for action and dao\_id correctly for each step? (If it makes any difference we are using Prototype and Scr... | [
0.2945764362812042,
-0.24062767624855042,
0.16457700729370117,
-0.18186913430690765,
-0.12003608793020248,
0.013515492901206017,
0.5892132520675659,
-0.3399921953678131,
-0.1448410302400589,
-0.5632382035255432,
0.13835866749286652,
0.21965835988521576,
-0.7232377529144287,
0.1291389763355... | |
local variables within the parent function remain active and available as long as the closure exists.
You are trying to pass and then use "action" and "dao\_id" to your closure, but you are passing references here, not values. So when your closures (handlers) are called they use the value that the reference was last a... | [
-0.004960035439580679,
-0.1938280463218689,
0.2080812007188797,
-0.15165774524211884,
0.019756058230996132,
-0.1445683091878891,
0.264382541179657,
-0.030358145013451576,
-0.31923943758010864,
-0.6283020377159119,
-0.5361859798431396,
0.3481333255767822,
-0.36005699634552,
-0.0829054340720... | |
scope. Once you declare a variable it is available until the end of the function or until is it deleted. Whichever comes first.
All that said, you need to break the scope chain. Here are two ways to do that:
Try this:
```
for (var i = 0; i < profile.current + 1; i++) {
if ($('step_anchor_' + i).innerHTML.empty()... | [
0.2217848300933838,
-0.5616552829742432,
0.7376931309700012,
-0.41712504625320435,
0.1976422667503357,
-0.04496626928448677,
0.407410591840744,
-0.6039645671844482,
-0.2544323801994324,
-0.48402300477027893,
-0.29673340916633606,
0.8324044346809387,
-0.5764288306236267,
-0.0134431635960936... | |
$('step_anchor_' + i).observe('click', function(a, b){
return function(){pm.loadData(a, b, true)};
}(action, dao_id));
Effect.Appear('step_anchor_' + i, {
duration: 1,
delay: (down_delay++)
});
}
}
```
Or this:
```
function createHandler(ac... | [
0.09910516440868378,
-0.4899824559688568,
0.5808054208755493,
-0.15703390538692474,
0.5310574173927307,
0.08286290615797043,
0.34403321146965027,
-0.6067397594451904,
-0.4061414301395416,
-0.2649807333946228,
-0.3656079173088074,
0.4474654495716095,
-0.27624887228012085,
-0.216010600328445... | |
true);};
}
/* snip - inside some other function */
for (var i = 0; i < profile.current + 1; i++) {
if ($('step_anchor_' + i).innerHTML.empty()) {
var action = profile.steps[i].action;
var dao_id = profile.steps[i].dao_id;
$('step_anchor_' + i).innerHTML = profile.steps[i].anchor;
... | [
-0.03561823442578316,
-0.6336023807525635,
0.8074280023574829,
-0.37485405802726746,
0.32289746403694153,
0.3358975052833557,
0.6354077458381653,
-0.7586697936058044,
-0.33297252655029297,
-0.5616633892059326,
-0.30124524235725403,
0.49081626534461975,
-0.5254268646240234,
-0.3275045454502... | |
duration: 1,
delay: (down_delay++)
});
}
}
``` | [
0.3295080065727234,
-0.32457104325294495,
0.47769299149513245,
-0.2348872572183609,
0.06618983298540115,
-0.039482954889535904,
0.18281853199005127,
-0.026887819170951843,
-0.44488880038261414,
-0.07658343762159348,
-0.4007021486759186,
0.6003395915031433,
-0.41424760222435,
0.264289140701... | |
I am facing a problem.
I would like to localize my action names in my project so french people can have clean urls with french names.
<http://www.test.com/Home> should be <http://www.test.com/Accueil>
It is a good thing too for google indexing.
Moreover I would like to be Restful on the application, so I would like t... | [
0.5940840244293213,
0.07515014708042145,
-0.09966155886650085,
0.3030526638031006,
-0.1778496503829956,
0.03888721019029617,
0.4102162718772888,
0.18687158823013306,
-0.13481801748275757,
-0.6778014302253723,
0.009965073317289352,
0.22537222504615784,
0.26473939418792725,
0.025425158441066... | |
can do this when you register the routes in global.asax.
if normally you have this:
```
routes.MapRoute("Catalog-Brands", "catalog/brand/", new {controller = "Brand", action = "Index", isActive = true});
```
you could make this one too (I don't know french, sorry)
```
routes.MapRoute("Catalog-Brands-French", "fren... | [
-0.0792035236954689,
-0.13879993557929993,
0.22773192822933197,
0.2721651494503021,
0.150516077876091,
-0.04184894263744354,
0.2707965672016144,
0.10512115806341171,
-0.44149988889694214,
-0.9640674591064453,
-0.3099575936794281,
0.21036280691623688,
-0.42296749353408813,
-0.09904522448778... | |
I have a problem when assigning functions to the click event of a button in IE 7 with jQuery. Something like the following works fine in Opera but produces an infinite loop in IE:
```
function updateIndputFields(index, id) {
$("#reloadBtn").click(function(){ updateIndputFields(index, id) });
}
```
As I understand... | [
-0.018338559195399284,
-0.30949968099594116,
0.4256213307380676,
-0.17437298595905304,
-0.15984074771404266,
-0.28136295080184937,
0.38285890221595764,
0.08182504773139954,
-0.12463276833295822,
-0.5133988261222839,
-0.03223937004804611,
0.9337819814682007,
-0.5137242078781128,
0.119347229... | |
that you have already bound to the click event. I used this on IE and, if I understand what you're trying to do, it seems to do what you need:
```
<script type="text/javascript">
function updateIndputFields(index, id) {
$('#output').append('<p>' + index + ' : ' + id + '</p>');
$('#reloadBtn').unbind('click');
$("#relo... | [
0.14076469838619232,
-0.0557454451918602,
0.5173579454421997,
-0.3004833161830902,
0.12514786422252655,
-0.12566375732421875,
0.1632469892501831,
-0.43481388688087463,
-0.16299711167812347,
-0.5043466687202454,
-0.3146083950996399,
0.7156234383583069,
-0.6157652139663696,
-0.12149319797754... | |
an interesting recursive situation. | [
-0.2413901388645172,
-0.02589774690568447,
-0.035258110612630844,
0.26114603877067566,
-0.13060347735881805,
-0.02600265108048916,
0.09492543339729309,
0.24337038397789001,
-0.06986561417579651,
-0.4072791635990143,
-0.03776421770453453,
0.16482605040073395,
0.00632322346791625,
-0.0408305... | |
I'm trying to find a good way to detect a loss of connection.
My adapter is implemented as a Fix::Application based on one of the examples. It uses a socket initiator to connect to the fix gateway.
When I unplug the internet it takes about 30 seconds for the Fix::Application's onLogout method to be fired. It seems ... | [
0.06773710995912552,
-0.06677675992250443,
0.30211910605430603,
0.2356126606464386,
0.07907551527023315,
-0.08242128044366837,
0.40274617075920105,
0.1327538639307022,
-0.15313276648521423,
-0.6489942669868469,
0.16130663454532623,
0.6801612973213196,
-0.4320320785045624,
0.075662948191165... | |
I don't know of any messages that fire for a loss of TCP connection, but I don't think QuickFix is listening for OS events either. Although, it would likely flow through the fromAdmin event if there were such a message.
Did you post your question to the QuickFix DL? | [
0.39436107873916626,
-0.26933321356773376,
0.16980354487895966,
0.413248747587204,
-0.0889677032828331,
-0.30278897285461426,
0.18397852778434753,
0.3195827305316925,
-0.23973333835601807,
-0.5080975890159607,
0.16934603452682495,
0.4493880271911621,
-0.30684351921081543,
0.172774881124496... | |
I've been using this function but I'd like to know what's the most efficient and accurate way to get it.
```
function daysInMonth(iMonth, iYear) {
return 32 - new Date(iYear, iMonth, 32).getDate();
}
```
```js
function daysInMonth (month, year) { // Use 1 for January, 2 for February, etc.
return new Date(year, m... | [
-0.013304784893989563,
0.10879464447498322,
0.889417827129364,
-0.04311644658446312,
0.09526143223047256,
0.056713707745075226,
0.2769678235054016,
-0.14899024367332458,
-0.338030606508255,
-0.32782334089279175,
-0.18513166904449463,
0.3929079473018646,
-0.07104069739580154,
0.265028178691... | |
days in the current month](https://stackoverflow.com/a/69267613/7942242) | [
0.33990567922592163,
-0.12245725095272064,
0.7000070214271545,
0.1254950612783432,
0.26499590277671814,
-0.07503814250230789,
0.16789460182189941,
0.3332093060016632,
-0.7622864842414856,
-0.01959572732448578,
-0.03679397329688072,
-0.1615184247493744,
-0.3057865798473358,
0.39770534634590... | |
I just started using CCNet, and in the process of getting my build projects set up I racked up a lot of build history from trial and error. I really don't want to keep that old stuff around, but I can't seem to see where/how to get rid of it. I'm sure this is a silly question, and I apologize if I'm overlooking somethi... | [
1.0408214330673218,
0.1652846336364746,
0.1490689218044281,
-0.11358673125505447,
0.2875252068042755,
-0.2518764138221741,
0.3031421899795532,
-0.08233468234539032,
-0.1227155551314354,
-0.5860965251922607,
0.4299936890602112,
0.5892156958580017,
0.22352270781993866,
0.10273461043834686,
... | |
know if that has anything to do with it), but the old builds are still there if I drill into a project's stats from the dashboard. Any suggestions? Thanks.
**Answered**: I had explicitly set the artifacts directory to a location that was not under the CCNet server directory and consequently never looked in it again...... | [
0.49396589398384094,
-0.021337125450372696,
0.47647520899772644,
0.2908625900745392,
0.31449782848358154,
-0.3841705918312073,
0.2268468141555786,
-0.04682759568095207,
-0.5066734552383423,
-0.7581600546836853,
0.14424164593219757,
0.729434072971344,
0.1645953357219696,
0.20706114172935486... | |
How can I achieve the following? I have two models (blogs and readers) and a JOIN table that will allow me to have an N:M relationship between them:
```
class Blog < ActiveRecord::Base
has_many :blogs_readers, :dependent => :destroy
has_many :readers, :through => :blogs_readers
end
class Reader < ActiveRecord::Ba... | [
0.3395005464553833,
0.12052938342094421,
0.6725103855133057,
0.07581677287817001,
0.07163416594266891,
-0.16917724907398224,
0.2662758529186249,
-0.32441702485084534,
-0.055890124291181564,
-0.9920571446418762,
0.2827813923358917,
0.6278378367424011,
-0.2645799219608307,
0.3606773018836975... | |
`readerID`, same `blogID`) in the `BlogsReaders` table. How can I achieve this?
The second question is, how do I get a list of blog that the readers isn't subscribed to already (e.g. to fill a drop-down select list, which can then be used to add the reader to another blog)?
What about:
```
Blog.find(:all,
:... | [
0.2021087259054184,
-0.09978169202804565,
0.3348047137260437,
0.33459001779556274,
-0.20282398164272308,
-0.11813709139823914,
0.3062179982662201,
-0.32859331369400024,
0.017839353531599045,
-0.6763980388641357,
0.10194835066795349,
0.5528526902198792,
-0.22213776409626007,
0.0335634350776... | |
I get the following error while building OpenCV on OS X 10.5 (intel):
```
ld: warning in .libs/_cv_la-_cv.o, file is not of required architecture
ld: warning in .libs/_cv_la-error.o, file is not of required architecture
ld: warning in .libs/_cv_la-pyhelpers.o, file is not of required architecture
ld: warning in .libs/... | [
-0.257950097322464,
0.3247901499271393,
0.6264033913612366,
0.13374653458595276,
0.17033179104328156,
-0.03725941851735115,
0.8761445879936218,
-0.2163015902042389,
0.0126594053581357,
-0.7226813435554504,
-0.5161339640617371,
0.721422553062439,
-0.1489083468914032,
-0.06670460850000381,
... | |
/var/folders/Sr/Srq9N4R8Hr82xeFvW3o-uk+++TI/-Tmp-//cchT0WVX.out (No such file or directory)
make[4]: *** [_cv.la] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
```
While running ./configure --without-python everything is ... | [
0.21281865239143372,
0.27123814821243286,
0.3206135034561157,
-0.1779356747865677,
0.0023788134567439556,
-0.3215672969818115,
0.6726328730583191,
-0.08717187494039536,
-0.3453412353992462,
-0.5914631485939026,
-0.28942883014678955,
0.9066781997680664,
-0.40585848689079285,
0.0076182098127... | |
In my JSF/Facelets app, here's a simplified version of part of my form:
```
<h:form id="myform">
<h:inputSecret value="#{createNewPassword.newPassword1}" id="newPassword1" />
<h:message class="error" for="newPassword1" />
<h:inputSecret value="#{createNewPassword.newPassword2}" id="newPassword2" />
<h:message ... | [
0.22343172132968903,
0.14718011021614075,
0.7067084908485413,
-0.2939799427986145,
-0.08720289170742035,
0.0027018773835152388,
0.5966132879257202,
-0.4222593307495117,
0.020903566852211952,
-0.8363502025604248,
0.03149773180484772,
0.6403107047080994,
-0.18773213028907776,
-0.178074792027... | |
use the h:messages tag because the page has multiple places that I need to display different error messages. When I tried this, the page displayed duplicates of every message.
I tried this as a best guess, but no luck:
```
public Navigation continueButton() {
...
expensiveMethod();
if(...) {
FacesContext.ge... | [
0.04874267056584358,
-0.15542374551296234,
0.8392759561538696,
-0.0029661329463124275,
0.2273830622434616,
-0.18148790299892426,
0.6197599768638611,
-0.4136909246444702,
-0.20305432379245758,
-0.725432276725769,
-0.09881068021059036,
0.6545193195343018,
-0.6276940107345581,
-0.118782907724... | |
class="error" for="newPassword1" id="newPassword1Error" />
<h:inputSecret value="#{createNewPassword.newPassword2}" id="newPassword2" />
<h:message class="error" for="newPassword2" id="newPassword2Error" />
<h:commandButton value="Continue" action="#{createNewPassword.continueButton}" />
</h:form>
```
This is i... | [
-0.11811415106058121,
-0.46449148654937744,
0.66051185131073,
0.08845435827970505,
0.3490349054336548,
-0.08158523589372635,
0.6593344211578369,
-0.355744332075119,
-0.05000033229589462,
-0.5915720462799072,
-0.4218265414237976,
0.7250347137451172,
0.09959574043750763,
-0.4575164318084717,... | |
I need to create a internal website and can't figure out if we should be writing our own, or using an existing framework.
Most of the website will essentially be a front end to a database. We need to have a number of people enter data into forms. We then want to be able to show different views of all this data -- incl... | [
0.7187476754188538,
0.2527644634246826,
0.30220815539360046,
0.24119918048381805,
0.008146761916577816,
-0.12531867623329163,
0.18755652010440826,
-0.002573695033788681,
0.15822944045066833,
-0.7394348978996277,
0.10769644379615784,
0.3447185158729553,
0.029431911185383797,
0.0457272827625... | |
simple 1:1 mapping of resource to entry. For example, we might track several attributes for one item as the "base set of data" for that item. Then we could have several additional sets of data.
Imagine a recipe application. You might have a recipse for a starter. This could then be referenced by several other recipes... | [
0.2187167853116989,
-0.2245228886604309,
0.025767343118786812,
0.2574184238910675,
-0.013689866289496422,
0.005145539063960314,
-0.03752363845705986,
-0.2787657380104065,
-0.24368998408317566,
-0.7630575895309448,
0.12422040104866028,
0.45186832547187805,
-0.3610600233078003,
0.06252451241... | |
would develop this have the most knowledge using php and MySql.
I usually lean towards wanting to use an existing platform, but am interested in other people's thoughts. To give you an idea of scope, I would imagine if we wrote this from scratch we are probably talking about 3-5 weeks of development.
Would you recomm... | [
0.30594778060913086,
-0.11587604880332947,
0.2165006399154663,
0.3538942039012909,
-0.11230520159006119,
-0.20669497549533844,
-0.09785085171461105,
0.12524159252643585,
-0.20244187116622925,
-0.6968952417373657,
0.22714608907699585,
0.4127390682697296,
-0.08371804654598236,
-0.10855194181... | |
you'll probably need a few key additional modules like the "Content Creation Kit" (CCK) and "Views".
Unlike other web CMS systems (WordPress, Exponent, phpNuke), Drupal treats your entries as a "pool" of content, from which you pull various subsets for different areas of your site.
There is a lot of documentation for... | [
0.2678702175617218,
-0.1229148805141449,
0.3983061909675598,
0.49381548166275024,
-0.2592574656009674,
-0.40502381324768066,
-0.08470354974269867,
0.14019441604614258,
-0.3526560366153717,
-0.4983011484146118,
0.03315233066678047,
0.2991775870323181,
0.10964639484882355,
0.0450356937944889... | |
the right direction.
The power, flexiblity and capability of Drupal is both its biggest strength and weakness - I know it took me a bit of effort to get my head around key concepts, and I'm far from being a Drupal Expert.
One last comment: Having written my own CMS from scratch, which I abandoned in favour of Drupal,... | [
0.030979998409748077,
-0.11752284318208694,
0.3655310571193695,
0.012096161022782326,
-0.01254862267524004,
0.30660706758499146,
0.36529237031936646,
-0.07488728314638138,
0.06761498749256134,
-0.43130120635032654,
-0.04684820398688316,
0.30068451166152954,
0.3841733932495117,
-0.117289535... | |
I'm building a custom web part for SharePoint and I'm trying to use the default styles so when people theme the site, it will theme with it.
I've found a couple of decent sites that show the different styles like:
<http://www.sharepointcustomization.com/resources/tipstricks/wss_cssguide.htm>
but I'm looking for somet... | [
0.25736361742019653,
0.012422675266861916,
0.05700985714793205,
0.20910564064979553,
-0.4383891820907593,
0.13736458122730255,
0.16739660501480103,
-0.09584802389144897,
-0.6263430118560791,
-0.11053600907325745,
0.37844523787498474,
0.35990116000175476,
0.07440868765115738,
0.126691266894... | |
CSS class you are looking for. | [
-0.004115466959774494,
-0.2995297312736511,
-0.1911374032497406,
0.38516905903816223,
0.11463945358991623,
-0.40077292919158936,
0.10402265936136246,
0.8710790872573853,
-0.11526737362146378,
-0.4036642611026764,
0.012370900250971317,
0.09254516661167145,
0.20044130086898804,
-0.1091486811... | |
There are a few things that I almost always do when I put a class together in C++.
1) Virtual Destructor
2) Copy constructor and assignment operator (I either implement them in terms of a private function called Copy(), or declare them private and thus explicitly disallow the compiler to auto generate them).
What thi... | [
0.2584752142429352,
0.2353106290102005,
0.10969506204128265,
0.07359004020690918,
-0.10375884175300598,
-0.4742307662963867,
0.22146572172641754,
-0.18871815502643585,
-0.31318238377571106,
-0.5185573101043701,
-0.10072216391563416,
0.9994175434112549,
-0.4345567226409912,
0.01529211085289... | |
violations of the following style guidelines from Scott
> Meyers’ Effective C++ book:
>
> · Item 11: Define a copy constructor and an assignment operator
> for classes with dynamically allocated memory.
>
> · Item 12: Prefer initialization to assignment in constructors.
>
> · ... | [
0.009923899546265602,
-0.03392952308058739,
-0.05563218519091606,
0.2297336906194687,
-0.07665007561445236,
0.03115726262331009,
0.4330245852470398,
-0.3020592927932739,
-0.23511311411857605,
-0.47589799761772156,
-0.3307723104953766,
0.5840229392051697,
-0.32493868470191956,
0.20500190556... | |
· Item 15: Have "operator=" return a reference to *this.
>
> · Item 23: Don’t try to return a reference when you must return
> an object.
>
> and about violations of the following style guidelines from Scott
> Meyers’ More Effective C++ book:
>
> · Item 6: Distinguish betwe... | [
0.15496332943439484,
0.1783449500799179,
0.27883103489875793,
-0.057198453694581985,
-0.35759541392326355,
0.1441476047039032,
0.6179032325744629,
-0.43437954783439636,
0.05068199709057808,
-0.2611773610115051,
-0.4821557402610779,
0.5257735848426819,
-0.3366466164588928,
-0.13692271709442... | |
ment and decrement operators.
>
> · Item 7: Never overload "&&", "││", or ",".
>
> If you use this option, you should be aware that the standard
> library headers do not obey all of these guidelines; you can use
> grep -v to filter out those warnings.
>
> ``` | [
-0.06456589698791504,
0.184144526720047,
0.4513559341430664,
-0.005760418251156807,
0.01808648556470871,
-0.1409846693277359,
0.6927759647369385,
-0.2726771831512451,
-0.23868528008460999,
-0.5648403763771057,
-0.5777755975723267,
1.106935739517212,
-0.31540822982788086,
-0.058897577226161... | |
I'm wondering if there is a better/inbuilt way, other than using a byte buffer and looping, to read from one stream and write it to another (in .NET). Generally this is done to apply a transform to a stream and move it on.
In this instance, what I am loading a file, putting it through a deflate stream and writing it o... | [
0.25454971194267273,
-0.22023344039916992,
0.4132656455039978,
-0.18087731301784515,
0.21154583990573883,
0.02985759638249874,
0.15831927955150604,
-0.24043461680412292,
0.0037396717816591263,
-0.8078631162643433,
-0.1245175302028656,
0.4771880507469177,
-0.33628952503204346,
-0.0202969759... | |
using (DeflateStream ds = new DeflateStream(fsout, CompressionMode.Compress))
{
int read = 0;
do
{
read = fsin.Read(buffer, 0, buffer.Length);
ds.Write(buffer, 0, read); | [
-0.14539159834384918,
-0.49646520614624023,
0.5665028691291809,
-0.23064136505126953,
0.0804423987865448,
0.22216926515102386,
0.5141351819038391,
-0.567290723323822,
0.13454459607601166,
-0.5098283290863037,
-0.3031592071056366,
0.36041685938835144,
-0.41104012727737427,
-0.24691589176654... | |
}
while (read > 0);
}
}
}
buffer = null;
```
**Edit:**
.NET 4.0 now has a Stream.CopyTo function, Hallelujah
There's not really a better way than that, though I tend to put the looping part into a `CopyTo` extension method, e.g.
```
public static void CopyTo(this Stream source, Stream destin... | [
0.4154524505138397,
0.18575988709926605,
0.3212893605232239,
-0.2733875513076782,
0.134381502866745,
0.06358969956636429,
0.7703871726989746,
-0.07813280820846558,
-0.04792718216776848,
-0.4977370500564575,
-0.15009930729866028,
0.5094485878944397,
-0.4499857723712921,
0.6411709189414978,
... | |
destination.Write(buffer, 0, bytesInBuffer);
}
}
```
Which you could then call as:
```
fsin.CopyTo(ds);
``` | [
-0.32831111550331116,
-0.32137274742126465,
0.4840792715549469,
0.04123286157846451,
0.31522780656814575,
-0.12596024572849274,
0.14736972749233246,
0.3320767879486084,
-0.06812448799610138,
-0.8408741354942322,
-0.03432900086045265,
0.377896785736084,
-0.3780773878097534,
0.46637174487113... | |
Does anybody have any experience with different fonts for OCR? I am generating an ID then trying to scan it with tesseract. At the moment I am just T&E'n different fonts, but this seems pretty inefficient. I've tried the OCR\* family of fonts, and various others such as Arial and Georgia. The tesseract tends to get con... | [
0.27760106325149536,
0.44402340054512024,
0.1670732945203781,
-0.056306254118680954,
-0.09229782968759537,
0.3681678771972656,
-0.027534469962120056,
0.4318617284297943,
-0.1464080959558487,
-0.6607043743133545,
0.46395301818847656,
0.48297199606895447,
-0.3093167543411255,
0.0039309724234... | |
VBScript doesn't appear to have a way to include a common file of functions.
Is there a way to achieve this?
The "Windows Script Host" framework (if ya want to call it that), offers an XML wrapper document that adds functionality over regular vbs files. One of which is the ability to include external script files of b... | [
0.5949743390083313,
0.10177427530288696,
0.2739852964878082,
-0.18573515117168427,
-0.3030836582183838,
-0.4018598794937134,
0.21458765864372253,
-0.12491031736135483,
-0.2622029185295105,
-0.6118795275688171,
-0.029278894886374474,
0.3661653399467468,
-0.3704512417316437,
0.03287967294454... | |
<script language="VBScript" src="logging.vbs"/>
<script language="VBScript" src="iis-queryScriptMaps.vbs"/>
</job>
```
If the above file is called "iis-scriptmaps.wsf", run it this way with cscript.exe:
```
cscript.exe iis-scriptmaps.wsf
``` | [
0.07603273540735245,
0.17551881074905396,
0.5731101036071777,
-0.5543656349182129,
-0.3091966509819031,
0.013015573844313622,
0.4263570308685303,
-0.20758536458015442,
-0.41434046626091003,
-0.6109498143196106,
-0.1742856353521347,
0.2512854039669037,
-0.34234756231307983,
-0.1196080595254... | |
I have **CustomForm** inherited from **Form** which implements a boolean property named **Prop**. The forms I'll be using will inherit from **CustomForm**. This property will do some painting and changes (if it's enabled) to the form. However, this is not working as it should, the VS IDE designed is not being refresh t... | [
0.6801585555076599,
-0.3292275667190552,
0.9307689666748047,
-0.16774386167526245,
0.01096105482429266,
0.254353791475296,
0.3484416902065277,
-0.3938606381416321,
-0.10794734954833984,
-0.8923407196998596,
0.18888065218925476,
0.740915834903717,
-0.16630131006240845,
0.26277920603752136,
... | |
IDE designer to refresh itself just like it happens when I build the solution? If so, I could add that code to the **Prop** set accessor and my problem was gone.
Note that I've tried to call Invalidate(), Refresh() and Update. But none of them seemed to fix the problem...
---
Here's a little insight on my real probl... | [
0.44300925731658936,
-0.33965545892715454,
0.45538902282714844,
-0.22429169714450836,
-0.06988143175840378,
0.24036554992198944,
0.3830723166465759,
-0.4969059228897095,
0.26666489243507385,
-0.9511275887489319,
0.1129956915974617,
0.6469363570213318,
-0.3176863193511963,
0.091902419924736... | |
return enableSkin;
} set {
enableSkin = value;
if(enableSkin) {
BackColor = Color.Lime; | [
0.1620970070362091,
-0.4721648395061493,
0.6670109033584595,
-0.46271470189094543,
0.46027258038520813,
0.2947966456413269,
0.4188021123409271,
-0.4815496504306793,
0.34474244713783264,
-0.7366558909416199,
-0.11694615334272385,
0.5241106748580933,
-0.20302924513816833,
0.05816329270601272... | |
MaximizedBounds = Screen.GetWorkingArea(this);
TransparencyKey = Color.Lime;
base.FormBorderStyle = FormBorderStyle.None;
} else { | [
0.5041516423225403,
-0.13149766623973846,
0.33353906869888306,
-0.4712473452091217,
0.15840154886245728,
0.00922709796577692,
0.48849546909332275,
-0.3311280608177185,
0.18326149880886078,
-0.48799195885658264,
0.15192602574825287,
0.6963421106338501,
-0.5727057456970215,
0.058108571916818... | |
BackColor = SystemColors.Control;
MaximizedBounds = Rectangle.Empty;
TransparencyKey = Color.Empty;
base.FormBorderStyle = FormBorderStyle; | [
0.05236443504691124,
-0.38974639773368835,
0.30596837401390076,
-0.16931290924549103,
-0.12671849131584167,
-0.03260216861963272,
0.23483337461948395,
-0.505621612071991,
0.12574683129787445,
-0.2340431809425354,
-0.3266075849533081,
0.10291047394275665,
-0.5836775898933411,
0.227172091603... | |
}
}
}
[DefaultValue(FormBorderStyle.Sizable)]
public new FormBorderStyle FormBorderStyle {
get {
return formBorderStyle;
} set {
formBorderStyle = value;
if(EnableSkin) { | [
-0.04819713160395622,
-0.36080673336982727,
0.7269013524055481,
-0.289384663105011,
0.14864833652973175,
-0.2839275598526001,
0.4466542899608612,
-0.48558011651039124,
0.02220280095934868,
-0.5635116696357727,
-0.42567262053489685,
0.43779563903808594,
-0.13274091482162476,
-0.034416832029... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.