text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
CHAR szDisplayName[MAX_PATH]; // out: display name (or path) CHAR szTypeName[80]; // out: type name } SHFILEINFOA; ``` Keep in mind that you must free the obtained icon by passing `hIcon` to [`DestroyIcon()`](http://msdn.microsoft.com/en-us/library/ms648063(VS.85).aspx) after you'...
[ 0.1108478456735611, 0.11522987484931946, 0.47062253952026367, -0.1871832311153412, 0.12474949657917023, -0.406759113073349, 0.5528492331504822, -0.11589107662439346, -0.10655981302261353, -0.5988991856575012, -0.5480612516403198, 0.7165072560310364, -0.21264387667179108, 0.0114038838073611...
I need users to mark some section of text with custom tags, I can't use the xml based tags as the whole text will be embedded in XML documents and all the < will be converted to html escape code <. I want users to marks some section of text with tags like skip, bookmark, these tags can have attributes also like bookmar...
[ 0.695576548576355, 0.14380335807800293, 0.17568011581897736, -0.13173893094062805, -0.3076941668987274, -0.21360349655151367, 0.018482865765690804, -0.24269917607307434, -0.3930748403072357, -0.48497071862220764, 0.054520383477211, 0.31635260581970215, -0.47483134269714355, 0.0598320811986...
text as down by the markdown or textile, I just want to tag some section of text, like the phpBB tags. The question is there any other style than phpBB? Like in some software I see {{bookmark name = "abcd"}} style. The three common markups I know of for this purpose are [Markdown](http://daringfireball.net/projects/mar...
[ 0.6103203296661377, -0.24176086485385895, 0.46882936358451843, -0.13951194286346436, -0.5436440706253052, 0.014644031412899494, -0.05040575563907623, -0.06702293455600739, -0.4867706596851349, -0.2842038869857788, -0.24225600063800812, 0.18106260895729065, -0.1620006561279297, 0.1336282193...
What is the best idea to fill up data into a Django model from an external source? E.g. I have a model Run, and runs data in an XML file, which changes weekly. Should I create a view and call that view URL from a curl cronjob (with the advantage that that data can be read anytime, not only when the cronjob runs), or ...
[ 0.18965715169906616, 0.12281616777181625, 0.422680526971817, -0.022402623668313026, 0.029933054000139236, -0.1939087212085724, -0.13594813644886017, -0.21535629034042358, -0.2702353000640869, -0.554234504699707, 0.16617083549499512, 0.6618083119392395, -0.12854371964931488, -0.082686118781...
takes all environment configuration and other stuff allows you to concentrate on concrete task. And of course call it directly by cron.
[ 0.4467720091342926, 0.4377153217792511, 0.028360474854707718, 0.02456849068403244, -0.024598464369773865, -0.1528846025466919, 0.13156235218048096, 0.036529865115880966, -0.035177744925022125, -0.4871985614299774, -0.22020521759986877, 0.7255712151527405, -0.06320855766534805, -0.041173595...
Mail for my domain is handled by google apps service, all required DNS MX records entered correctly. Also I have webserver that handles HTTP requests for the domain. And I can't send mail from that server to my mail domain, sendmail ignores MX records and always trying to deliver all messages for my domain locally. Lo...
[ 0.46306270360946655, 0.3438878357410431, 0.6154662370681763, -0.054853275418281555, -0.2616332173347473, 0.35464683175086975, 0.6148306131362915, -0.10229390114545822, -0.1644788235425949, -0.7120674252510071, 0.04474111273884773, 0.20693998038768768, -0.4102787971496582, 0.453443825244903...
vds sendmail[4100]: n17I33c2004100: from=root, size=36, class=0, nrcpts=1, msgid=<200902071803.n17I33c2004100@vds.xxxxxx.com>, relay=root@localhost ``` Well. Found a solution for my case. Just add the following line to your source .mc-file and recreate sendmail.cf ``` define(`confDONT_PROBE_INTERFACES', `true') ```
[ 0.26586368680000305, -0.16646833717823029, 0.8945184350013733, -0.04885801672935486, -0.31593918800354004, -0.03943288326263428, 0.5172967910766602, -0.1365881860256195, -0.20704679191112518, -0.677247166633606, -0.05191471800208092, 0.4554663598537445, -0.3848288953304291, 0.3900601267814...
I am looking for the best resources, videos, books, magazines(I like videos) to learn and master Object Oriented design and analysis. I would really like to know more about trusted and reputable methodologies for structuring your programs, designing classes, and dealing with databases in your programs. So, my question ...
[ 0.33844316005706787, 0.3713752329349518, 0.030537791550159454, 0.204745352268219, 0.15120764076709747, 0.1328544169664383, 0.41582125425338745, 0.4144511818885803, -0.39517849683761597, -0.371570885181427, -0.09576305747032166, 0.7158507108688354, 0.07533323019742966, 0.09077334403991699, ...
**Objective**: Make a progress bar where users can check how much of a file has been downloaded by my server. **Scenario**:I have a PHP script that executes a python script via popen. I have done this like so: ``` $handle = popen('python last', 'r'); $read = fread($handle, 4096); pclose($handle); ``` This python ...
[ 0.2588762044906616, 0.16644687950611115, 0.6264263987541199, -0.142948716878891, -0.1222129762172699, -0.04875184968113899, 0.3235222101211548, -0.07590412348508835, -0.3469476103782654, -0.48447391390800476, -0.0014267583610489964, 1.030285120010376, -0.29403290152549744, -0.1191561669111...
run the command via the shell, the shell cursor appears at the end of that line and waits till the script is done. Thanks all First thing that comes into my mind: maybe the program detects that it is not executed on a TTY and therefore does not show the last line, which probably involves ugly control characters becaus...
[ 0.3970227539539337, -0.07775723189115524, 0.23904800415039062, 0.15509872138500214, 0.09840555489063263, -0.11832989752292633, 0.43392589688301086, 0.45215272903442383, -0.23393294215202332, -0.5612528920173645, -0.0987451896071434, 1.0701874494552612, -0.12641538679599762, 0.0008127192268...
solution than to fix the source.
[ -0.2391553372144699, -0.21785853803157806, -0.06355349719524384, 0.35244786739349365, -0.1378171741962433, 0.3429219126701355, 0.0412118174135685, -0.08093370497226715, -0.08002409338951111, -0.48040276765823364, 0.04794257506728172, 0.28628790378570557, -0.16028065979480743, -0.0006710535...
I have created a Python file to generate a Mandelbrot set image. The original maths code was not mine, so I do not understand it - I only heavily modified it to make it about 250x faster (Threads rule!). Anyway, I was wondering how I could modify the maths part of the code to make it render one specific bit. Here is t...
[ 0.19540879130363464, 0.27215006947517395, 0.3925771117210388, -0.09778226912021637, -0.23671066761016846, 0.4592500925064087, 0.3369145095348358, -0.15651927888393402, -0.2696944773197174, -0.5903806686401367, 0.07337242364883423, 0.5910868644714355, -0.27693918347358704, 0.062752626836299...
o = complex(0,0) dotcolor = 0 # default, convergent for trials in xrange(n): if abs(o) <= 2.0: o = o**2 + z else: dotcolor = trials
[ 0.025235923007130623, -0.09167894721031189, 0.5565168857574463, -0.33723774552345276, 0.19400157034397125, 0.289734810590744, 0.4432375729084015, -0.7034593224525452, -0.23736317455768585, -0.4781642556190491, 0.0651150718331337, 0.3926874101161957, -0.5069088339805603, -0.0257524717599153...
break # diverged im.putpixel((x,y),dotcolor) ``` And the size definitions: ``` size1 = 500 size2 = 500 n=64 box=((-2,1.25),(0.5,-1.25)) plus = size[1]+size[0] uleft = box[0] lright = box[1] xwidth = lright[0] - uleft[0] ywidth = uleft[1] - lright[1] ``` what do I need to modify to make it render a certain...
[ 0.09046048671007156, -0.11620544642210007, 0.8513660430908203, -0.0706227645277977, 0.1211899071931839, 0.22862429916858673, 0.0422561876475811, -0.5567306876182556, -0.1434934288263321, -0.4714134931564331, -0.35036349296569824, 0.3443165123462677, -0.12661373615264893, -0.196942180395126...
from the image should be quite straightforward. You've got two coordinate systems, your "image" system 100x100 pixels in size, origin at (0,0). And your "complex" plane coordinate system defined by "box". For X: ``` X_complex=X_complex_origin+(X_image/X_image_width)*X_complex_width ```
[ 0.2349071055650711, -0.09871842712163925, 0.5571444630622864, 0.12150045484304428, -0.051260728389024734, 0.20718497037887573, -0.26271313428878784, -0.2237236350774765, 0.1290089339017868, -0.7697253823280334, -0.03132687881588936, 0.3950299620628357, -0.13032115995883942, 0.1723832488059...
I have heard people state that Code Generators and T4 templates should not be used. The logic behind that is that if you are generating code with a generator then there is a better more efficient way to build the code through generics and templating. While I slightly agree with this statement above, I have not really...
[ 0.6417015194892883, 0.1399497240781784, -0.24280382692813873, 0.12978288531303406, -0.3029175400733948, -0.39209529757499695, 0.3947809934616089, -0.2808231711387634, -0.13138240575790405, -0.5902890563011169, -0.1334218978881836, 0.5576194524765015, -0.3824585974216461, 0.3059509992599487...
have been wonderful at generating mass amounts of code without having to copy / paste or use resharper. Many of the problems I have found with Generics too is that to my shock there are a lot of developers who do not understand them. When I do examine generics for a solution, there are times where it gets complicated ...
[ 0.7326374053955078, 0.027611935511231422, -0.18943729996681213, 0.17111878097057343, -0.2504144012928009, -0.19787198305130005, 0.38935866951942444, 0.03788852319121361, -0.1565873622894287, -0.49118566513061523, 0.320321261882782, 0.46931663155555725, -0.10542630404233932, 0.2453312724828...
amount about generics, but there are traps and pitfalls that I always run into that cause me to resort to a T4 template. What is the more proper way to handle scenarios where you need a large amount of flexibility? Oh and as a bonus to this question, what are good resources on C# and Generics? You can do new T(); if y...
[ 0.831702709197998, -0.21477121114730835, 0.20218467712402344, 0.19016344845294952, -0.11548404395580292, -0.13447655737400055, 0.1858191043138504, -0.22031715512275696, -0.3025471866130829, -0.7896566390991211, 0.18320973217487335, 0.9674742817878723, -0.26422789692878723, 0.28886881470680...
in fact :-) Generics solve one problem, code-generators solve another. For example, creating a business model using a UML editor and then generating your classes with persistence code as I do all of the time using [this tool](http://capableobjects.com/ProductsServices_ECO.aspx) couldn't be achieved with generics, beca...
[ 0.30050379037857056, 0.02712145633995533, 0.19148623943328857, 0.21668601036071777, -0.2617812752723694, -0.2759299874305725, 0.5395294427871704, -0.09611349552869797, -0.5992305278778076, -0.28012824058532715, -0.04956875741481781, 0.5165243744850159, -0.4054281711578369, 0.30306288599967...
I am reporting on data that lets say has 10 columns. Now some of my clients have data in all 10 of the columns whereas some may only use 7 or 5... you get the idea. Of course I dont want to have to build a new rdl for each possibiliy. Well in the tabular report I can hide the columns fine if no data exists by using the...
[ 0.39896664023399353, 0.42490509152412415, 0.5350464582443237, -0.035460617393255234, -0.38762137293815613, 0.02364039048552513, 0.21309244632720947, -0.006037456449121237, -0.31059733033180237, -0.5225650072097778, 0.32158514857292175, 0.4523148238658905, -0.3867362439632416, -0.0123893646...
all of the potential columns still show up in the series legend. I've read that 2008 gives you that level of chart customization, but 2005 does not. Any other ideas? You could use [`$_REQUEST`](http://php.net/manual/reserved.variables.request.php), but be aware that it contains the contents of `$_GET`, `$_POST` and `$...
[ 0.15697845816612244, -0.10588008165359497, 0.6010425090789795, 0.04831438139081001, -0.0747438445687294, -0.045861080288887024, 0.18566951155662537, -0.28255945444107056, -0.4976550042629242, -0.4743516147136688, 0.16597817838191986, 0.2513240873813629, -0.46353238821029663, 0.172883838415...
up in some fashion, perhaps providing additional useful functionality, e.g. automatically applying `stripslashes()` to values mangled using `magic_quotes`, providing default values for missing variables, etc.
[ 0.5938279032707214, -0.09616677463054657, 0.23233471810817719, 0.1734718233346939, -0.010857924818992615, -0.24092544615268707, 0.26211488246917725, -0.1503693014383316, -0.47278788685798645, -0.08599021285772324, -0.5237453579902649, 0.10096772015094757, -0.30501458048820496, 0.0337536036...
This is a compiler error (slightly changed for readability). This one always puzzled me. FxCop tells that this is a bad thing to return `List<T>` and classes that are derived from `Collection<T>` should be preferable as return types. Also, FxCop says that it is OK to use `List<T>` for internal data storage/manipulati...
[ 0.2312801331281662, -0.10205911844968796, -0.10801724344491959, 0.11161735653877258, -0.33253273367881775, 0.01175261102616787, -0.0785110592842102, -0.07970831543207169, -0.1859954595565796, -0.6848317384719849, 0.1574181318283081, 0.652108371257782, -0.4715364873409271, 0.106503233313560...
it does, however, implement `ICollection<T>`. That would be a better choice of return type. As for the `new List<int>(some collection<int>)` question - it partly depends on what the collection is. If it implements `ICollection<T>` (at execution time) then the constructor can use its `Count` property to create the list...
[ -0.01634160429239273, -0.009420662187039852, 0.34484168887138367, 0.005305722821503878, -0.10933233052492142, 0.03547743335366249, -0.0014725871151313186, -0.30900129675865173, -0.11778075248003006, -0.5714794397354126, -0.030382180586457253, 0.4654243290424347, -0.32370367646217346, 0.196...
believe the constructor does anything cunning for arrays, which it potentially could - using `Array.Copy` or whatever to just copy the lot in one go rather than iterating though. (Likewise if it were another `List<T>` it could get at the backing array and copy that directly.)
[ 0.7435948252677917, 0.09650784730911255, -0.08289428055286407, 0.23558299243450165, -0.03563546761870384, -0.013087183237075806, 0.13395550847053528, -0.0834316834807396, -0.21560613811016083, -0.3260832130908966, 0.13985255360603333, 0.596796452999115, 0.04408326745033264, 0.0473257601261...
I cant tell, does boost asio handle endian? Asio does convert things like *port* into network order. The conversion functions are not exposed as part of the official interface and are hidden in the *detail* namespace instead (e.g. *boost::asio::detail::socket\_ops::host\_to\_network\_short*).
[ 0.07523452490568161, -0.1527508795261383, 0.1188807487487793, -0.06907438486814499, -0.008932947181165218, 0.06490668654441833, 0.28452473878860474, 0.041415486484766006, -0.16335037350654602, -0.6467260122299194, -0.12020031362771988, 0.576449990272522, -0.12908822298049927, -0.2617145180...
I'm writing some code where the UI thread need to communicate with the background thread doing network communication. The code works, but would it be considered thread safe? I would feel a lot better if someone experienced could lead me on to the right path on this... ``` static Mutex^ mut_currentPage = gcnew Mutex; ...
[ 0.3414582908153534, 0.0876099169254303, 0.7056888341903687, -0.2704007625579834, 0.08367706090211868, -0.03087104856967926, 0.43808239698410034, -0.3639916181564331, -0.14026767015457153, -0.7874535322189331, 0.020757898688316345, 0.6572981476783752, -0.5783786177635193, 0.1946313679218292...
.NET C++ code... :) It looks thread-safe, but you might want to think about exception handling; setting a field shouldn't error (except perhaps `ThreadAbortException`), but if the code was more complex, you'd want to ensure you release the mutex upon exception. I'd also look at `Monitor` ("lock" in C#) One other thou...
[ 0.2922550141811371, -0.21235162019729614, 0.16129891574382782, -0.11731218546628952, -0.22321681678295135, -0.4618467390537262, 0.2767592966556549, -0.10724196583032608, -0.3047051429748535, -0.34768205881118774, 0.04388241097331047, 0.6361094117164612, -0.5141617655754089, 0.0439596064388...
People always advised me that if I am doing some application that should use some Windows APIs to do any process level job, I must use VC++ and not any other .net language. Is there any truth in that? Can everything that can be done using VC++ be done in other .net languages also? Are all the .net languages the same...
[ 0.5626980066299438, 0.2220606952905655, 0.19997772574424744, 0.013224226422607899, -0.2030051052570343, -0.08414289355278015, 0.17147120833396912, -0.09995568543672562, -0.1981213092803955, -0.631452739238739, -0.04567687213420868, 0.9542310833930969, -0.10157804936170578, 0.01590366289019...
languages are the same in terms of capabilities, although C# and VB.NET are *largely* equivalent in functionality. I know there are some things which C++/CLI exposes which aren't exposed by C# or VB.NET - I don't know if the reverse is true. (I've no idea what C++/CLI is like for lambda expressions, extension methods e...
[ 0.225726917386055, -0.014813954941928387, -0.09869399666786194, -0.08637306094169617, -0.22195683419704437, -0.007932299748063087, 0.3832758069038391, 0.38279563188552856, -0.4612697958946228, -0.6167458295822144, 0.033033233135938644, 0.5744177103042603, -0.3877539336681366, -0.1628199219...
I need to test my PHP applications with multiple versions of PHP 5.x, such as PHP 5.0.0 and PHP 5.2.8. Is there a way that I can configure a development LAMP server so I can quickly test applications with multiple versions of PHP5? One way to do this is to have your main version of php set up with mod\_php and run all...
[ 0.7247380614280701, 0.1530497670173645, 0.3265244662761688, 0.13171203434467316, -0.16629886627197266, -0.40133386850357056, 0.45443519949913025, -0.19749118387699127, -0.1273900270462036, -0.5985088348388672, 0.3848351836204529, 0.8221851587295532, -0.40606510639190674, -0.058752559125423...
I am trying to create a c++ ostream for educational reasons. My test will be creating an ostream that acts like a ofstream would except instead of writing to a file it would write to a deque or vector container. As it is for education, as you say, i will show you how i would do such a thingy. Otherwise, `stringstream` ...
[ 0.4085274636745453, -0.03009161911904812, 0.16929909586906433, 0.09993166476488113, -0.15936145186424255, -0.16238637268543243, 0.10640481859445572, -0.01102153304964304, 0.015356055460870266, -0.8364936113357544, 0.2610960602760315, 0.3851223289966583, -0.4575236737728119, 0.1205720752477...
= std::char_traits<Ch>, typename Sequence = std::vector<Ch> > struct basic_seqbuf : std::basic_streambuf<Ch, Traits> { typedef std::basic_streambuf<Ch, Traits> base_type; typedef typename base_type::int_type int_type; typedef typename base_type::traits_type traits_type; virtual int_type ov...
[ -0.3094913363456726, -0.16466635465621948, 0.5571355223655701, -0.3547108769416809, -0.10408247262239456, 0.4511961340904236, 0.26343226432800293, -0.2022029310464859, 0.14426960051059723, -0.6022600531578064, -0.3786562383174896, 0.5497772097587585, -0.45072200894355774, 0.211732655763626...
} Sequence const& get_sequence() const { return c; } protected: Sequence c; }; // convenient typedefs typedef basic_seqbuf<char> seqbuf; typedef basic_seqbuf<wchar_t> wseqbuf; ``` You can use it like this: ``` seqbuf s; std::ostream os(&s); os << "hello, i'm " << 22 << " years old" << std::endl...
[ -0.11781760305166245, 0.11403361707925797, 0.6141216158866882, -0.3319995403289795, 0.33917203545570374, -0.014732025563716888, 0.23922231793403625, 0.1052575409412384, -0.1447179913520813, -0.7157496809959412, -0.01955300383269787, 0.43099918961524963, 0.015453641302883625, 0.639690756797...
`Html.Encode` seems to simply call `HttpUtility.HtmlEncode` to replace a few html specific characters with their escape sequences. However this doesn't provide any consideration for how new lines and multiple spaces will be interpretted (markup whitespace). So I provide a text area for the a user to enter a plain text...
[ 0.13540346920490265, -0.11655383557081223, 0.5522951483726501, 0.06474176049232483, -0.21156440675258636, -0.03951960802078247, 0.40259480476379395, -0.23304195702075958, -0.02662849798798561, -0.8979498744010925, -0.04815422371029854, 0.14864572882652283, -0.3624882698059082, -0.061997450...
then replaces new lines in the resulting string with `<br>` and groups of multiple spaces with `&nbsp;` Another option would be to mess about with the `white-space: pre` attribute in my style sheets - however I'm not sure if this would produce side effects when Html helper methods include new lines and tabbing to make...
[ 0.2558044195175171, 0.06387315690517426, 0.47784560918807983, -0.09318188577890396, -0.4015491306781769, 0.00047299647121690214, 0.29958003759384155, 0.02008521929383278, -0.14931070804595947, -0.7571597099304199, -0.2581971287727356, 0.3059968650341034, -0.40276336669921875, -0.1864625960...
does not encode whitespace characters. I would go with your first option, and make it an extension method for HtmlHelper. Something like: ``` public static string HtmlEncode(this HtmlHelper htmlHelper, string text, bool preserveWhitespace) { // ... ...
[ 0.07889972627162933, 0.11638243496417999, 0.11468012630939484, -0.04353629797697067, -0.09457066655158997, -0.013686873018741608, 0.039436448365449905, 0.21784478425979614, -0.12999190390110016, -0.7364824414253235, -0.07786093652248383, 0.16148211061954498, -0.6147429943084717, -0.1152172...
`String.Replace()` to encode the newlines and spaces (or `Regex.Replace` if you need better matching).
[ 0.0899103656411171, -0.29664748907089233, 0.15117250382900238, 0.029656991362571716, 0.07498491555452347, 0.21567434072494507, -0.039176154881715775, -0.1337532252073288, 0.07404565811157227, -0.7305514216423035, -0.48537424206733704, 0.19270725548267365, -0.6761704087257385, 0.06408151239...
Exact duplicate: [Split a string by spaces -- preserving quoted substrings -- in Python](https://stackoverflow.com/questions/79968/split-a-string-by-spaces-in-python) --- I want to take in a string and return a list, dictionary or tuple of values as separated by spaces. However, I want to not match spaces that are so...
[ -0.15776115655899048, 0.11914173513650894, -0.1818113476037979, 0.1744595766067505, -0.10046549141407013, 0.4949929118156433, -0.08506492525339127, -0.3089524209499359, -0.6301888823509216, -0.41511183977127075, -0.19058939814567566, 0.307917058467865, -0.4076518714427948, -0.0257000345736...
'green', '"banana tree"'] """ import re p = re.compile(r'"[\w ]+"') quoted_item = p.search(string).group() newstring = p.sub('', string) return newstring.split() + [quoted_item] ```
[ -0.0029429274145513773, -0.006188147235661745, 0.6576800346374512, -0.07870762050151825, 0.1065482497215271, 0.18271781504154205, -0.0075472029857337475, -0.5348176956176758, -0.5261609554290771, -0.2519688308238983, -0.6242547035217285, 0.4723435938358307, -0.5880248546600342, 0.179114684...
I have some e-commerce code that I use often that uses Linq To SQL for saving orders to the database. I want to remove the tightly coupled Linq to SQL bit and pass in an IRepository instead but I am still a little confused on things. Say I have a GetCustomer() method on my ICustomerRepository that returns a Customer o...
[ 0.13669858872890472, 0.05703505128622055, 0.47571325302124023, 0.471484512090683, -0.09049137681722641, -0.23218870162963867, 0.10784749686717987, 0.23095209896564484, -0.1438562422990799, -0.3608478009700775, 0.08355618268251419, 0.47992944717407227, -0.18474972248077393, 0.22822380065917...
is there a way in Linq To SQL to easily convert my Linq To SQL Customer object to my ICustomer object like SubSonics ExecuteSingle(Of ) method? If you want your Customer class to be a plain object with no attachment to LINQ, then you will most likely need to write a mapper method to convert your LINQ-based Customer obj...
[ 0.14838041365146637, 0.09178972244262695, 0.2644919455051422, 0.2843974232673645, -0.11982545256614685, -0.2764819860458374, -0.32143256068229675, -0.005948190111666918, -0.2435259371995926, -0.4576275944709778, 0.07244245707988739, 0.3748117685317993, -0.29781708121299744, 0.2411959618330...
CustomerRepository method my look like: ``` public Customer GetById(int id) { return dataContext.LINQCustomers.Where(c => c.Id == id) .Single() .ToDomainObject(); } ``` and the ToDomainObject() method is defined in an extension method like: ``...
[ 0.05544869601726532, -0.19584132730960846, 0.6526886820793152, -0.07302689552307129, 0.05498597398400307, 0.1694774031639099, -0.02168797142803669, -0.04942195490002632, 0.013820885680615902, -0.3636799454689026, -0.2500012516975403, 0.7889972925186157, -0.2646861970424652, 0.2703201770782...
public static Customer ToDomainObject(this Customer linqObject) { var domainObject = null if (linqObject != null) { domainObject = new Customer { Id = linqObject.Id,
[ -0.1847894936800003, -0.4321433901786804, 0.7781751751899719, 0.013157812878489494, 0.055467139929533005, 0.056564271450042725, -0.008571533486247063, 0.01942930743098259, 0.16109929978847504, -0.35026583075523376, -0.055657707154750824, 0.648019015789032, -0.5855008363723755, 0.4897241890...
FirstName = linqObject.FirstName, LastName = linqObject.LastName } } return domainObject; } } ``` or something similar. You can do the same to convert your domain object back to a LINQ object to pass back into your repository for persistence.
[ -0.10407964140176773, -0.28329697251319885, 0.6110013127326965, 0.08957241475582123, 0.016923118382692337, -0.3458758294582367, -0.09350708872079849, 0.048286471515893936, -0.03876280412077904, -0.5790064334869385, 0.001753829070366919, 0.20413090288639069, -0.368938148021698, 0.6308845877...
I've heard of security features in the framework and the BCL, but does this have anything to do with preventing malicious programmers from writing harmful software, or preventing malware from running on the CLR? For example, is it possible to write a program in C# that makes harmful changes to the Windows folder? Absol...
[ 0.5298459529876709, 0.2361781895160675, -0.1147199273109436, 0.17576615512371063, -0.06002127751708031, -0.4768643379211426, 0.31661051511764526, 0.04353132098913193, -0.3294751048088074, -0.453182190656662, -0.15751415491104126, 0.6998004913330078, -0.05861780047416687, -0.025324288755655...
I'm reading the second edition of K&R book and one of the exercises requires printing all maximum integer values defined in limits.h header. However, this... ``` printf("unsigned int: 0 to %d\n", UINT_MAX); ``` ... outputs the following: ``` unsigned int: 0 to -1 ``` How come I get -1? Anyone could explain this b...
[ -0.008710541762411594, 0.19150951504707336, 0.20655526220798492, -0.20913825929164886, 0.00002072086681437213, -0.09269411861896515, 0.14687635004520416, -0.11946628987789154, -0.3420809507369995, -0.6452375054359436, -0.17149390280246735, 0.5418226718902588, -0.1434377282857895, 0.0993926...
-1 here. **Update:** If you use "%u" as the format string you will get the expected result.
[ 0.039405133575201035, 0.14898356795310974, 0.3210564851760864, -0.11471579968929291, -0.12105105072259903, 0.056506961584091187, 0.03177236020565033, 0.2369648665189743, 0.19316980242729187, -0.4984860122203827, -0.3484247326850891, 0.26242485642433167, -0.09560710191726685, 0.228679358959...
I have two tables, that is joined in some way. I've spent the last hour googling around, not finding any concrete answers that worked in my case. The case is, table 1 is called Clients, and table 2 is called Projects. I need to list all the client names, followed by number of projects related to that project and the p...
[ 0.33359798789024353, 0.06610666215419769, 0.3278520107269287, 0.10369356721639633, -0.01659439317882061, 0.1477876454591751, -0.1821809858083725, -0.1676458716392517, -0.3367144465446472, -0.6853150129318237, 0.0912754163146019, 0.48761776089668274, -0.08381003141403198, 0.2546553611755371...
resolves to -1 if treated as a signed integer. The reason for this is, that integers are represented in [two's-complement](http://en.wikipedia.org/wiki/Two%27s_complement). As a consequence, -1 and 4294967296 (i.e. UINT\_MAX) have the same bit representation (0xFFFFFFFF, i.e. all bits set) and that's why you get a -1 h...
[ -0.7033382058143616, 0.04264509305357933, 0.5312329530715942, -0.21856319904327393, 0.04697897285223007, 0.08797156810760498, 0.06925451010465622, -0.27210137248039246, -0.18430261313915253, -0.3616955578327179, -0.49969372153282166, 0.2976067066192627, -0.2824416756629944, 0.2055047899484...
I have a data grid that has a checkbox item renderer in a cloumn to allow row selections: **Main application:** ``` <mx:DataGrid id="dg"> <mx:columns> <mx:DataGridColumn id="ir" itemRenderer="renderers.RowCheckbox" /> <mx:DataGridColumn dataField="Name" headerText="Name" /> </mx:columns> </...
[ -0.044376980513334274, 0.2792464792728424, 0.6770380735397339, -0.20129531621932983, -0.14297989010810852, 0.1633540540933609, -0.14714811742305756, -0.5389198660850525, -0.19264328479766846, -0.6792101263999939, 0.01536894403398037, 0.4303366541862488, -0.11917202919721603, -0.11924458295...
it by adding a "selected" property to the entities in the dataprovider of the datagrid. The selected property of the checkBox was then bound to the selected property of our entity. To know which ones were selected, we just looped over the entities in the dataprovider instead of the item renderers. After a lot of differ...
[ -0.14700059592723846, -0.3685504198074341, 0.26561397314071655, 0.561791181564331, -0.11102205514907837, 0.1914532482624054, 0.0435338020324707, -0.1566830426454544, -0.14063705503940582, -0.5362637042999268, 0.061969418078660965, 0.417443186044693, -0.1288672238588333, 0.2570650279521942,...
would be to dispatch an event in the item renderer which bubbles up all the way to the control hosting the datagrid. You could then listen for these events and update your model to reflect the changes.
[ -0.08051355928182602, -0.6343725323677063, 0.4373597204685211, 0.45733213424682617, -0.05308724567294121, 0.12358338385820389, 0.00996036734431982, -0.04823331534862518, -0.28289905190467834, -0.5846011638641357, 0.03458981215953827, 0.32301953434944153, -0.1374143660068512, 0.080220706760...
How can i find out if the obj returned by a func is a int or something else (like a sqlite cursor) Use `isinstance(item, type)` -- for instance: ``` if isinstance(foo, int): pass # handle this case ``` However, explicit type checking is not considered a good practice in the Python world -- it means that much of ...
[ 0.06271031498908997, 0.006989073473960161, 0.24538283050060272, 0.13475145399570465, -0.05929037928581238, -0.10863159596920013, 0.22795061767101288, -0.14576417207717896, -0.18358847498893738, -0.38756251335144043, -0.11857326328754425, 0.35391899943351746, -0.23613035678863525, -0.237289...
I am in a project with 3 people. We need to have the same folds in Vim for each member. How can I share my folds? **[Feedback]** I understood one important thing: Google ignores signs, such as {{{, so please google "VIM three braces" to find help about the marker-method. It becomes much easier to practise, as you ca...
[ 0.477209210395813, 0.09836987406015396, 0.2407587170600891, -0.04588119685649872, -0.26052600145339966, 0.18673314154148102, 0.2834714353084564, -0.26868724822998047, 0.1974826604127884, -1.0461617708206177, 0.27023765444755554, 0.20601360499858856, -0.3025917410850525, -0.1354265660047531...
the `vim:fdm=marker` setting in the file itself. For example, here's a shell script which contains both the setting to use fold markers and two levels of fold: ``` #/bin/sh # vim:fdm=marker echo This file contains fold markers. #Top Level Fold {{{1 echo This is a top-level fold. #Second Level Fold {{{2 echo Thi...
[ 0.2833799421787262, -0.13083839416503906, 0.7147366404533386, -0.2312210500240326, -0.2764730155467987, -0.014840204268693924, 0.4625040292739868, -0.47235748171806335, 0.12980687618255615, -0.6741520166397095, -0.343158096075058, 0.5748267769813538, -0.23114462196826935, -0.02846191637217...
you could use: ``` // vim:fdm=marker ```
[ 0.42530933022499084, 0.14395853877067566, 0.30542558431625366, -0.09460427612066269, -0.15349876880645752, -0.27959108352661133, 0.08858674019575119, 0.14948982000350952, -0.1564997434616089, -0.3498251736164093, -0.37749701738357544, 0.437638521194458, -0.25518399477005005, -0.00042359984...
Whats wrong with the following c# code? Compiler reports this error: Inconsistent accessibility: parameter type 'ClassLibrary1.Interface1' is less accessible than method 'ClassLibrary1.Class1.Class1(ClassLibrary1.Interface1)' with the following code: ``` interface Interface1<T> { bool IsDataValid(); /* Other...
[ 0.19783130288124084, 0.051814086735248566, 0.35989442467689514, 0.029875701293349266, -0.2924237549304962, -0.07514350861310959, 0.46877944469451904, -0.2883487939834595, -0.13959437608718872, -0.7945576906204224, 0.230849489569664, 0.5634198188781738, -0.7420034408569336, 0.27655124664306...
bool IsDataValid(); /* Other interfaces */ } ```
[ -0.11557786911725998, -0.006900154985487461, 0.2768941819667816, -0.16336096823215485, -0.19366824626922607, -0.41885825991630554, 0.4289485216140747, 0.07696841657161713, 0.006860979367047548, -0.7898370623588562, -0.2501040995121002, 0.6771834492683411, -0.41898661851882935, 0.1466694921...
I have decided to take up f# as my functional language. My problem: Give a bunch of 50digits in a file, get the first 10 digits of the sum of each line. (euler problem for those who know) for example (simplified): 1234567890 The sum is 45 The first "ten" digits or in our case the "first" digit is 4. Heres my p...
[ -0.14374640583992004, 0.07919382303953171, 0.2298208773136139, -0.0916387289762497, -0.19149917364120483, 0.6892508268356323, 0.1441798061132431, -0.41100290417671204, -0.33512082695961, -0.5215387940406799, -0.10863086581230164, 0.33869537711143494, -0.21366602182388306, -0.16987556219100...
that array. ``` let total = lines.Split([|'\n'|]) |> Seq.map (fun line -> line.ToCharArray()) |> Seq.take 1 |> Seq.to_list |> Seq.length ``` I get each line, convert it to array, i take the first array (for testing only), and i try to convert it to list, and then get the length of the list. B...
[ 0.15558180212974548, -0.2469256967306137, 0.39549195766448975, -0.022442283108830452, -0.12838594615459442, 0.14221635460853577, 0.17846617102622986, -0.5211831331253052, -0.3669796288013458, -0.7170620560646057, -0.17679060995578766, 0.4614896774291992, -0.2937629222869873, -0.07979321479...
pipeline it to access each char? My final answer: ``` let total = lines.Split([|'\n'|]) |> Seq.map (fun line -> line.ToCharArray() |> Array.to_seq) |> Seq.map (fun eachSeq -> eachSeq |> Seq.take 50 //get rid of the \r
[ 0.28877419233322144, -0.37819433212280273, 0.5284748077392578, 0.06726443022489548, 0.2552732229232788, 0.365203320980072, 0.1292186826467514, -0.37857145071029663, 0.12236466258764267, -0.3142012655735016, 0.007748154923319817, 0.7374555468559265, -0.14801748096942902, 0.00261883856728673...
|> Seq.map (fun c -> Double.Parse(c.ToString())) |> Seq.skip 10 |> Seq.sum
[ -0.3819749355316162, -0.24020551145076752, 0.06010313332080841, 0.030190812423825264, -0.27973154187202454, 0.04778548702597618, 0.04375142231583595, -0.5224850177764893, -0.3060850501060486, -0.2539253532886505, -0.448548287153244, 0.26750448346138, -0.4469852149486542, -0.420019656419754...
) |> Seq.average ``` is what i got finally and it's working :). Bascially after I convert it to charArray, i make it a sequence. So now i have a sequence of sequence. Then I can loop through each seqquence.
[ 0.05273896083235741, 0.10582445561885834, 0.47432324290275574, -0.3741963505744934, -0.09228869527578354, 0.2490726113319397, 0.13785810768604279, -0.09587925672531128, 0.05570010840892792, -0.5876504778862, 0.014092002995312214, 0.42299580574035645, -0.039411384612321854, 0.10162123292684...
Does anyone know of examples which show how to encrypt a dataset at the client side and send it over to a web service and have it decrypted there? Another question: What i need to do is a send hundreds of rows of data from a client to a web service and have the web service update the database with these records. I ca...
[ 0.4874058961868286, 0.1904628574848175, 0.049929700791835785, 0.6938846111297607, 0.06826937198638916, -0.07215201109647751, 0.023229636251926422, -0.02894704043865204, -0.42832717299461365, -0.2963099777698517, 0.3574238717556, 0.5986021161079407, 0.09985531866550446, 0.31630587577819824,...
SSL - it'll most likely be much safer than a homegrown alternative. I would probably create a custom struct/object and send an array of those to the webservice rather than a DataSet. It will mean (slightly) less network traffic; it will make the webservice's WSDL more descriptive; and it will make it easier for any no...
[ 0.05227118730545044, 0.0006954556447453797, 0.4553200900554657, -0.01962321810424328, -0.3966534733772278, -0.3001503050327301, 0.28027263283729553, -0.07221725583076477, -0.46462708711624146, -0.8189871907234192, -0.3826863467693329, 0.24095404148101807, -0.6026413440704346, -0.0254662744...
// this is your custom type public class ExampleUser { public int UserID { get; set; } public string Name { get; set; } public DateTime DateOfBirth { get; set; } } // this is your method // accepts an array of ExampleUser rather than a DataSet [WebMethod] public void...
[ 0.1684391349554062, -0.10288476198911667, 0.5342007875442505, -0.1502135843038559, 0.0250544436275959, -0.022732531651854515, 0.23673726618289948, -0.18224236369132996, -0.34636616706848145, -0.5096004009246826, -0.0012229119893163443, 0.21162651479244232, -0.32634055614471436, 0.404460132...
{ // do something... } } ``` In the client application you would add a reference to the webservice. This will enable you to use the ExampleUser type declared in the server-side code above. You could then just convert your DataSet to an array of ExampleUser objects before sending it to the webservice: ``...
[ 0.06986323744058609, 0.3010880649089813, 0.6257849931716919, -0.15710273385047913, -0.03050636313855648, 0.21973495185375214, 0.2189294695854187, -0.3017626106739044, -0.35146796703338623, -0.8594822883605957, 0.11230536550283432, 0.4434422552585602, -0.5154301524162292, 0.2451731562614441...
i++) { DataRow dr = yourDataSet.Tables[0].Rows[i]; // create an ExampleUser object and populate it from the DataRow columns ExampleWebService.ExampleUser eu = new ExampleWebService.ExampleUser(); eu.UserID = (int)dr["User_ID"]; eu.Name = (string)dr["Name"]; eu.DateOfBirth = (DateTime)dr["Date_O...
[ -0.001561331213451922, 0.16737082600593567, 0.813470721244812, -0.26126256585121155, 0.0073730056174099445, 0.2958431839942932, 0.2545992136001587, -0.425062894821167, -0.23008127510547638, -0.6728959679603577, -0.07064909487962723, 0.1728234738111496, -0.48094385862350464, 0.2612852156162...
initialisers to create your array: ``` // create and populate the array ExampleWebService.ExampleUser[] usersArray = yourDataSet.Tables[0].AsEnumerable().Select ( s => new ExampleWebService.ExampleUser() { UserID = (int)s["User_ID"], Name = (string)s["Name"], ...
[ 0.1744105964899063, 0.03168472647666931, 0.4710821211338043, -0.34233832359313965, 0.16796934604644775, 0.27726274728775024, 0.3085050582885742, -0.2350211888551712, -0.3571231961250305, -0.7702176570892334, -0.060008250176906586, 0.3151388168334961, -0.3296823501586914, 0.2958734631538391...
the webservice ExampleWebService.UploadUsers(usersArray); ```
[ 0.36128515005111694, 0.4347609877586365, -0.11596638709306717, -0.021489005535840988, -0.21739204227924347, -0.17260487377643585, 0.3989751636981964, 0.2877703011035919, -0.39006492495536804, -0.6301819086074829, -0.1601833552122116, 0.4599754214286804, -0.4061499834060669, 0.2507125139236...
I'm working on an application that will gather data through HTTP from several places, cache the data locally and then serve it through HTTP. So I was looking at the following. My application will first create several threads that will gather data at a specified interval and cache that data locally into a SQLite databa...
[ 0.2824684977531433, 0.061354003846645355, 0.21735577285289764, 0.008738581091165543, 0.19814234972000122, 0.28688785433769226, -0.11726415157318115, 0.13759556412696838, -0.46623504161834717, -0.5942744016647339, 0.3562099039554596, 0.25903716683387756, -0.24561282992362976, 0.318506687879...
database will I also be able to create/use an in memory database? Short answer: Don't use Sqlite3 in a threaded application. Sqlite3 databases scale well for size, but rather terribly for concurrency. You will be plagued with "Database is locked" errors. If you do, you will need a connection per thread, and you have ...
[ 0.22807401418685913, 0.301072895526886, 0.12564170360565186, 0.158464252948761, -0.06765918433666229, -0.3081323504447937, 0.27504396438598633, -0.2652626931667328, -0.3291949927806854, -0.5873890519142151, 0.3694455027580261, 0.46229109168052673, -0.39275282621383667, 0.25563082098960876,...
To put it simple: a swing app that uses sqlitejdbc as backend. Currently, there's no problem launching multiple instances that work with the same database file. And there should be. The file is locked (can't delete it while the app is running) so the check should be trivial. Turns out not. ``` File f = new File("/...
[ 0.19291065633296967, 0.0015429356135427952, 0.7429004907608032, -0.03193190321326256, -0.08326689898967743, -0.21162959933280945, 0.33293190598487854, -0.5502886772155762, -0.4875357151031494, -0.5369460582733154, -0.16679047048091888, 0.6902628540992737, -0.37747225165367126, 0.1446201950...
exclusive to the JVM, not an individual thread. So if you ran that code inside the same process as your Swing app, you would get the lock because it is shared by the JVM. If your Swing app is not running, no other process is contending for the lock so you will obtain it there is well.
[ 0.5192196369171143, -0.202284574508667, 0.24263958632946014, 0.2181542068719864, -0.05770238861441612, -0.2924235463142395, -0.12699593603610992, -0.29569047689437866, -0.48563694953918457, -0.26984521746635437, -0.13534550368785858, 0.03945160284638405, -0.11092445999383926, 0.15418013930...
Note: Let me appologize for the length of this question, i had to put a lot of information into it. I hope that doesn't cause too many people to simply skim it and make assumptions. Please read in its entirety. Thanks. I have a stream of data coming in over a socket. This data is line oriented. I am using the APM (A...
[ 0.33053797483444214, 0.023695440962910652, 0.11849048733711243, 0.2939097583293915, 0.0175803080201149, -0.01444245595484972, 0.0899602398276329, 0.08272559940814972, -0.06784503906965256, -0.7026162147521973, -0.18536697328090668, 0.4899911880493164, -0.05905834957957268, -0.0079255513846...
are issues there as well. The problem is that my input stream (which i have no control over) doesn't give me any information on how long the stream is. It simply is a stream of newline lines looking like this: ``` COMMAND\n ...Unpredictable number of lines of data...\n END COMMAND\n ....repeat.... ``` So, using APM...
[ 0.14225620031356812, -0.05432843416929245, 0.4545252025127411, -0.03383351489901543, 0.07991565018892288, -0.001316355774179101, 0.11916220933198929, -0.4041081964969635, -0.5883392095565796, -0.629298985004425, -0.10256155580282211, 0.17313648760318756, -0.2226727157831192, 0.269981175661...
"ine\n.............................More Lines..." ``` My first thought was to use a StringBuilder and simply append the buffer lines to the SB. This works to some extent, but i found it difficult to extract blocks of data. I tried using a StringReader to read newlined data but there was no way to know whether you wer...
[ -0.11674562096595764, -0.15372437238693237, 0.42718058824539185, -0.1136370599269867, -0.2189933806657791, 0.1979726254940033, 0.40645885467529297, -0.12471362203359604, -0.2637230455875397, -0.568398118019104, -0.0799795389175415, -0.06115252152085304, -0.4309004545211792, 0.1089711338281...
full newlined line of data. Example: ``` // Note: no newline at the end StringBuilder sb = new StringBuilder("This is a line\nThis is incomp.."); StringReader sr = new StringReader(sb); string s = sr.ReadLine(); // returns "This is a line" s = sr.ReadLine(); // returns "This is incomp.." ``` What's worse, is...
[ -0.11175282299518585, -0.3365589678287506, 0.9252779483795166, -0.28685274720191956, -0.3101743459701538, 0.14468099176883698, 0.5402846336364746, -0.11580061912536621, -0.5298890471458435, -0.5938326716423035, -0.2572925090789795, -0.026232095435261726, -0.4110369384288788, 0.424602627754...
my own ReadLine function, but then I'm stuck locking the data during reads and writes. Also, the larger blocks of data (which can consist of hundreds of reads and megabytes of data) require scanning the entire buffer looking for newlines. It's not efficient and pretty ugly. I'm looking for something that has the simpl...
[ 0.1098860502243042, -0.22113211452960968, 0.4450955092906952, 0.153499573469162, 0.08731953799724579, 0.03497469797730446, 0.1498083770275116, 0.02870246209204197, 0.10558675229549408, -0.6606907844543457, 0.16010737419128418, 0.5032275319099426, -0.20052078366279602, 0.13665658235549927, ...
last read in the buffer is a complete line or not, plus it's even harder to remove the "stale" data from the stream. I also thought about using a thread with synchronous reads. This has the advantage that using a StreamReader, it will always return a full line from a ReadLine(), except in broken connection situations...
[ 0.1161615252494812, -0.20054972171783447, 0.45826032757759094, 0.03819163143634796, -0.13492390513420105, 0.04882743954658508, 0.1708918660879135, 0.19991080462932587, -0.28309473395347595, -0.5067968964576721, -0.03862646594643593, 0.16138717532157898, 0.01636931113898754, 0.2563219666481...
program blocking on data receive. The connection is long lasting. And data will continue to flow over time. During the intial connection, there is a large flow of data, and once that flow is done the socket remains open waiting for real-time updates. I don't know precisely when the initial flow has "finished", since t...
[ 0.16265399754047394, -0.21207691729068756, 0.4303329885005951, 0.25642383098602295, -0.19130288064479828, 0.1050209105014801, 0.2581082284450531, 0.33435216546058655, -0.5157375931739807, -0.5293499827384949, -0.21345928311347961, 0.5447714924812317, -0.34463366866111755, 0.26513671875, ...
handle this situation in a way that isn't overly complicated? I really want this to be as simple and elegant as possible, but I keep coming up with more and more complicated solutions due to all the edge cases. I guess what I want is some kind of FIFO in which i can easily keep appending more data while at the same tim...
[ 0.35260820388793945, -0.10267955809831619, 0.28127965331077576, 0.17847034335136414, 0.18046218156814575, -0.22091743350028992, 0.0076367673464119434, 0.14024122059345245, -0.1929183155298233, -0.369648814201355, 0.2366666942834854, 0.3766874074935913, -0.5145928263664246, 0.07064510881900...
(I managed to get around most of the problems with blocking sockets using locks and lots of exception handlers.) Still, using the in-built asynchronous operations is typically advisable as it allows for true OS-level async I/O, so I understand your point. Well I've gone and written a class for accomplishing what I bel...
[ 0.14041101932525635, 0.036158639937639236, -0.00802510417997837, 0.13182467222213745, 0.1682756394147873, -0.023197980597615242, 0.28359657526016235, -0.19906924664974213, -0.1435374766588211, -0.9041396975517273, -0.2777988016605377, 0.6334445476531982, -0.3089565336704254, -0.05849101021...
has been disposed public AsyncStreamProcessor() { _buffer = null; } public IEnumerable<string> Process(byte[] newData) { // Note: replace the following encoding method with whatever you are reading. // The trick here is to add an extra line break to the new data so that the...
[ 0.2949511408805847, -0.22271500527858734, 0.37959444522857666, -0.25629112124443054, 0.07778600603342056, 0.000782013579737395, 0.0664505660533905, -0.11742804199457169, -0.3029491901397705, -0.6841392517089844, -0.3039959669113159, 0.18642911314964294, -0.028371114283800125, 0.25569489598...
new data. using(var newDataReader = new StringReader(Encoding.ASCII.GetString(newData) + Environment.NewLine)) { // Read all lines from new data, returning all but the last. // The last line is guaranteed to be incomplete (or possibly complete except for the line break, ...
[ -0.1386004239320755, -0.3136284351348877, 0.48987001180648804, -0.06600295752286911, 0.19711855053901672, 0.050879910588264465, 0.48929712176322937, -0.18500831723213196, -0.2192823886871338, -0.7418302893638611, -0.5626814365386963, 0.11623046547174454, -0.4586763381958008, 0.205636486411...
string line, prevLine = null; while ((line = newDataReader.ReadLine()) != null) { if (prevLine != null) { yield return (_buffer ==
[ -0.152541846036911, -0.6377464532852173, 0.402607262134552, -0.3041714131832123, 0.3217095732688904, 0.29243698716163635, 0.47298532724380493, -0.41589710116386414, 0.055305179208517075, -0.21446655690670013, -0.3222106397151947, 0.3955312967300415, -0.3039644658565521, 0.2317216843366623,...
null ? string.Empty : _buffer.ToString()) + prevLine; _buffer = null; } prevLine = line; } // Store last incomplete line in buffer.
[ -0.19287586212158203, -0.1158379316329956, 0.3925376534461975, -0.3011821508407593, 0.28066286444664, 0.3366745412349701, 0.6313921809196472, -0.15565147995948792, -0.147440105676651, -0.3741343915462494, -0.2850320339202881, -0.06840692460536957, -0.2471257597208023, 0.4431842863559723, ...
if (_buffer == null) // Note: the (* 2) gives you the prediction of the length of the incomplete line, // so that the buffer does not have to be expanded in most/all situations. // Change it to whatever seems appropiate.
[ -0.007971376180648804, -0.4067593812942505, 0.10487807542085648, -0.16747720539569855, 0.07620105892419815, 0.12644918262958527, 0.3148428201675415, 0.03447927534580231, -0.1732497364282608, -0.5956812500953674, -0.21077412366867065, 0.10360648483037949, -0.12975934147834778, 0.03099791333...
_buffer = new StringBuilder(prevLine, prevLine.Length * 2); else _buffer.Append(prevLine); } } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } private void Dispose(bool disposing) {
[ 0.40088632702827454, -0.24728073179721832, 0.24480211734771729, -0.4972139298915863, 0.21970055997371674, -0.11413092166185379, 0.5016161799430847, -0.6446700096130371, -0.29653218388557434, -0.32554545998573303, -0.29012441635131836, 0.5210683941841125, -0.4734782576560974, 0.281596422195...
if (!_isDisposed) { if (disposing) { // Dispose managed resources. _buffer = null; GC.Collect();
[ 0.04649008437991142, -0.19234400987625122, 0.13339465856552124, -0.23490306735038757, 0.5270305275917053, -0.26717445254325867, 0.11537474393844604, -0.16269323229789734, -0.40039923787117004, -0.43262770771980286, -0.4610729217529297, 0.33342018723487854, -0.6183834075927734, 0.4349102079...
} // Dispose native resources. // Remember that object has been disposed. _isDisposed = true; } } } ``` An instance of this class should be created for each NetworkStream and the Process function should be called whenever new data is received (in the callback method f...
[ -0.10287345200777054, 0.07632134854793549, 0.2332640290260315, -0.20632459223270416, 0.24630951881408691, -0.47297486662864685, 0.166036456823349, -0.004468199796974659, -0.14013472199440002, -0.7901085615158081, 0.011698891408741474, 0.7134861350059509, -0.1565934717655182, 0.356069833040...
only verified this code with test data, not actual data transmitted over the network. However, I wouldn't anticipate any differences... Also, a warning that the class is of course not thread-safe, but as long as BeginRead isn't executed again until after the current data has been processed (as I presume you are doing)...
[ 0.3776231110095978, 0.043533626943826675, 0.028331860899925232, 0.4172705411911011, 0.18029795587062836, -0.3453470468521118, 0.66905277967453, 0.23870490491390228, 0.033642809838056564, -0.4658423960208893, 0.05630097910761833, 0.3267141282558441, 0.1414160132408142, 0.0057036192156374454...
I'm using the following piece of Objective-C code to format a NSNumber, and it works fine most of the time, but it doesn't quite do what I want when the NSNumber object holds an integer (no fractional part). ``` UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(80.0f, 90.0f, 225.0f, 40.0f)]; label.backgroundC...
[ 0.22742943465709686, -0.093082956969738, 0.784572422504425, -0.18842938542366028, -0.06369233131408691, 0.2954307496547699, 0.2485375553369522, -0.25887665152549744, -0.0999872088432312, -0.6257427334785461, 0.13920915126800537, 0.41162964701652527, -0.10077495127916336, 0.2736362516880035...
variable holds 55, it will simply display "55" on the label. What I really want is for this code to always include the 2 decimal places in the output. How can I achieve that? Your format string should have a "`0`" for each decimal place you want to always exist. ``` [formatter setFormat:@"###.00"]; ``` for "55.23"...
[ 0.017970340326428413, 0.06597375124692917, 0.4190024137496948, 0.0666179358959198, 0.007031402550637722, 0.16361702978610992, -0.15178652107715607, -0.6318774819374084, -0.21634897589683533, -0.1412399560213089, -0.06416484713554382, 0.4941093623638153, 0.009216261096298695, 0.072702333331...
In PHP I can do the following: ``` $myVar = 'name'; print $myClass->$myVar; // Identical to $myClass->name ``` I wish to do this in Python but can't find out how In python, it's the getattr built-in function. ``` class Something( object ): def __init__( self ): self.a= 2 self.b= 3 x= Something...
[ 0.04263539984822273, 0.2618737816810608, 0.30474016070365906, -0.33541566133499146, -0.41088464856147766, -0.09433341026306152, 0.19894061982631683, -0.1429262012243271, -0.07608193159103394, -0.41035547852516174, 0.10438710451126099, 0.48734378814697266, -0.25696709752082825, -0.052789807...
I am using FancyBox to generate a popup image. > [FancyBox](http://fancy.klade.lv/) (In case you are curious.) It pops up a `div` with `z-index: 92;`. I have a Flash animation running which is far below that `z-index`. My problem is that in two different Firefox browsers (same versions) I have different results. I...
[ 0.5714048743247986, 0.30507567524909973, 0.34298065304756165, -0.24717043340206146, -0.15216228365898132, -0.034675825387239456, 0.4474419951438904, -0.12251195311546326, -0.12516456842422485, -0.6922593712806702, -0.06241957098245621, 0.11924663186073303, -0.3834797739982605, 0.0423706956...
http://www.my-clock.net/tmp/sreen02.jpg](http://www.my-clock.net/tmp/sreen02.jpg) Try setting your wmode = transparent on the flash. This will keep flash from laying over top of everything no matter what z-index you set it to.
[ 0.576500654220581, -0.3385975956916809, 0.4972834885120392, -0.031484730541706085, -0.18518707156181335, -0.4293825626373291, 0.21225875616073608, 0.11194555461406708, -0.4459603726863861, -0.647420346736908, 0.08931200206279755, 0.7463666796684265, -0.18817755579948425, -0.046751990914344...
I'm working on a web application. A user will create an email message that will be sent to another person. I would like the e-mail that gets sent to appear from the user's name and e-mail address of the user on my system. And if they reply to the e-mail then it should go directly to the sender's email address. Howeve...
[ 0.9322896599769592, 0.1301007866859436, 0.2346450388431549, 0.09364447742700577, 0.17719236016273499, -0.04170602560043335, 0.14900623261928558, 0.0637550801038742, -0.10092980414628983, -0.7212504744529724, 0.22988639771938324, 0.2831604778766632, -0.056236378848552704, 0.2631605863571167...
look like: ``` To: email@domain.com Subject: [Test Blog] =?UTF-8?B?aGVsbA==?= MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From:=?UTF-8?B?aGVsbA==?=<sender@senderdomain.com> Message-Id: <20090207234737.39C9522802F3@web7.sat.wordpress.com> Date: Sat, 7 Feb 2009 23:47:37 +0000 (UTC) Return-Path: donotrep...
[ 0.1729343831539154, -0.04645121842622757, 0.7480723857879639, -0.26166313886642456, -0.1626424491405487, -0.023873241618275642, 0.4395372271537781, 0.255389541387558, 0.013907335698604584, -0.6798450350761414, -0.2554248571395874, 0.3723655343055725, -0.3743484318256378, 0.1608925312757492...