text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
When working on a project, after the interesting parts are coded, my motivation is severely diminished. What do you do to get over this problem? Don't leave all the "boring" bits to the end - make sure that each component works, with regression tests and documentation, as early as possible in the project. That said, t...
[ 0.6670152544975281, 0.34321320056915283, -0.20420679450035095, 0.28817006945610046, 0.18999812006950378, -0.40050241351127625, 0.6026277542114258, 0.15162838995456696, -0.02677788771688938, -0.3149457275867462, 0.10138536989688873, 0.4578360617160797, 0.20431643724441528, -0.09837871044874...
that the sooner it's done, the sooner you can start on all the lower-priority, more interesting things that have been queued behind the current release. You can't completely avoid last-minute requirements/docs changes other than by arranging for your customers to all be on holiday just before release. Or get yourself ...
[ 0.6904281973838806, 0.2774835228919983, 0.29601365327835083, 0.2739361822605133, 0.26234254240989685, -0.4365874230861664, -0.13768717646598816, 0.4796333909034729, -0.37864792346954346, 0.03878023475408554, -0.31222614645957947, 0.4086102247238159, 0.25751709938049316, 0.21472589671611786...
fix. But in practice some proportion of them will become less elusive as the project goes on, or turn out to be side-effects of another known issue, so you save time on average by giving them a limited chance to do so. The downside of this is that towards the end there will be a few left. If there are more than about t...
[ 0.8967978358268738, -0.1053275391459465, 0.11431261897087097, 0.4126208424568176, 0.2381783127784729, -0.1997569054365158, 0.30561819672584534, 0.04227181151509285, -0.4574241638183594, -0.32021528482437134, -0.01522190310060978, 0.4897599518299103, -0.12847831845283508, -0.182968959212303...
most of it away because you skipped some difficult planning, you'll have made yourself more productive.
[ 0.2525630295276642, -0.017004190012812614, -0.21608683466911316, 0.23997940123081207, 0.07700492441654205, -0.02116805873811245, 0.15592782199382782, 0.14087513089179993, -0.12070655822753906, -0.3458457291126251, 0.08019920438528061, 0.33431023359298706, 0.21889448165893555, 0.12099706381...
My colleague has found himself in an "interesting" situation. He is working on a Silverlight (2.0) prototype that needs to call existing web services in the enterprise and bind the returned data to data-display controls. The thing is, the web services return .NET DataSets (they are not about to change existing implemen...
[ 0.12452127784490585, 0.01852293871343136, 0.07811503857374191, 0.2548808455467224, 0.10878319293260574, -0.09309609234333038, 0.14287562668323517, -0.1599404662847519, -0.28930726647377014, -0.5747281908988953, 0.023057347163558006, 0.22891396284103394, -0.31709006428718567, 0.320810794830...
.NET web service returns a DataSet, it returns its XML representation (which is pretty friendly). The fact that a .NET client can consume the DataSet directly only abstracts the fact that an Xml Serialization-Deserialization is taking place. So I would manually query the web services you require, observe the generate...
[ 0.5097281336784363, -0.018913015723228455, 0.2853635251522064, 0.27686595916748047, -0.30342501401901245, -0.4320002496242523, 0.08157151192426682, 0.22408649325370789, -0.09617508202791214, -0.8659515380859375, -0.28146547079086304, 0.47633472084999084, -0.31126829981803894, 0.13554593920...
generated by the XSD.exe tool will be Silverlight friendly, but it is worth giving it a shot.
[ 0.6215296387672424, -0.026702985167503357, 0.5554711222648621, 0.48334428668022156, 0.00447084242478013, -0.6357720494270325, -0.41267651319503784, -0.010767821222543716, 0.12103211879730225, -0.5386079549789429, -0.1271464228630066, 0.32940560579299927, -0.3568275272846222, -0.07058051228...
Is there the way to apply "greedy" behavior to and keys in Visual Studio? By "greedy" I mean such behavior when all whitespace between cursor position and next word bound can be deleted using one keystroke. Well, I don't think you can change the binding of the delete key or backspace key - but CTRL+DEL & CTRL+Backspace...
[ -0.014225877821445465, -0.3081229627132416, 0.2742556035518646, 0.2287723571062088, 0.021232739090919495, -0.04770110547542572, -0.09281227737665176, -0.11320652067661285, -0.21864034235477448, -0.4221942126750946, 0.09409051388502121, 0.7985928654670715, -0.16233444213867188, -0.187198638...
I've always wondered this - why can't you declare variables after a case label in a switch statement? In C++ you can declare variables pretty much anywhere (and declaring them close to first use is obviously a good thing) but the following still won't work: ``` switch (val) { case VAL: // This won't work int...
[ -0.1799646019935608, -0.06473138928413391, 0.31850484013557434, -0.2598675787448883, 0.08815550804138184, -0.34782660007476807, 0.4977719783782959, -0.07530954480171204, -0.2928979694843292, -0.47011587023735046, -0.21333461999893188, 0.7559099793434143, -0.1787521094083786, 0.138607248663...
Why is this such a problem? `Case` statements are only **labels**. This means the compiler will interpret this as a jump directly to the label. In C++, the problem here is one of scope. Your curly brackets define the scope as everything inside the `switch` statement. This means that you are left with a scope where a ju...
[ 0.4461561441421509, -0.32695502042770386, 0.017640026286244392, -0.14970120787620544, 0.005965291056782007, -0.39293918013572693, 0.1931236833333969, -0.4372120499610901, -0.26382777094841003, -0.2814658582210541, -0.09955471754074097, 0.6956519484519958, -0.5597822666168213, 0.12725441157...
work int newVal = 42; break; } case ANOTHER_VAL: ... break; } ```
[ 0.03713184595108032, -0.09399815648794174, 0.17889250814914703, -0.6381954550743103, 0.3199731409549713, 0.0563540905714035, 0.7010571360588074, -0.5999311804771423, -0.2302473485469818, -0.5835699439048767, -0.5315207242965698, 0.6402798295021057, -0.19438518583774567, 0.16213637590408325...
Based on a simple test I ran, I don't think it's possible to put an inline <style> tag into an ASP.NET server control. The style did not end up rendering to the output HTML. Even if it was possible, I'm sure it is bad practice to do this. Is it possible to do this? I can see it being useful for quick prototypes that j...
[ 0.4003241956233978, 0.026058509945869446, 0.42294004559516907, 0.07808452099561691, -0.3828097879886627, -0.21359829604625702, 0.11475186794996262, -0.22280488908290863, -0.25118181109428406, -0.5147125720977783, 0.14059607684612274, 0.30937063694000244, -0.3400723934173584, -0.21511454880...
and link to it using `<link>`. So it's not a good idea to include style elements (e.g. a `<style type="text\css"></style>` block) in a control. If you could, it'd probably have an effect in some browsers but it wouldn't validate and is bad practice. If you want to apply styles inline to an element then either of thes...
[ 0.42563971877098083, 0.05343249812722206, 0.32637763023376465, 0.20637226104736328, 0.0333833321928978, -0.23942475020885468, 0.09628764539957047, -0.20711007714271545, 0.034946806728839874, -0.6736375689506531, -0.1875912994146347, 0.571520209312439, -0.5171813368797302, -0.10722725838422...
something to watch out for. Using CSS classes would be preferable as you can group multiple style declarations and avoid redundancy and page bloat. All controls derived from [WebControl](http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webcontrol.aspx) have a [CssClass](http://msdn.microsoft.com/en-us...
[ 0.20698124170303345, 0.0028049410320818424, 0.19172802567481995, 0.3449115753173828, -0.16251295804977417, -0.2553122043609619, 0.12172140926122665, 0.016104279085993767, -0.3566012382507324, -0.6832252740859985, -0.22014591097831726, 0.19398383796215057, -0.15203365683555603, 0.1461081206...
I've been working on this for a few days now, and I've found several solutions but none of them incredibly simple or lightweight. The problem is basically this: We have a cluster of 10 machines, each of which is running the same software on a multithreaded ESB platform. I can deal with concurrency issues between thread...
[ 0.2847107946872711, 0.24386382102966309, 0.3952018916606903, 0.19885574281215668, 0.2864339351654053, 0.11737341433763504, 0.1298951506614685, 0.07315604388713837, -0.4524960517883301, -0.584304928779602, 0.14130695164203644, 0.33604976534843445, -0.07446616142988205, 0.46387043595314026, ...
on the other system. If it does not, we create it via a web service method. So it requires a sort of test-and-set, but I need a semaphore of some sort to lock out the other machines from causing race conditions. I've had situations before where a remote customer was created twice for a single local customer, which isn'...
[ 0.525976300239563, -0.039607394486665726, -0.2064177244901657, 0.35022908449172974, 0.3159242868423462, 0.20579200983047485, 0.03667810931801796, 0.010917137376964092, -0.22981742024421692, -0.4223190248012543, 0.3292773962020874, 0.40151074528694153, -0.45904138684272766, 0.04630375280976...
in order to do a "test-and-set" for a lock record. 3. Using Terracotta, an open source server software which assists in scaling, but uses a hub-and-spoke model. 4. Using EHCache for synchronous replication of my in-memory "locks." I can't imagine that I'm the only person who's ever had this kind of problem. How did yo...
[ 0.09396518766880035, 0.21056534349918365, 0.5220609903335571, 0.16797497868537903, -0.01259369496256113, -0.15671312808990479, 0.07784491777420044, 0.007744856644421816, -0.6002788543701172, -0.4199202060699463, 0.07603663206100464, 0.324710488319397, -0.19370977580547333, 0.24961943924427...
In my multithreaded application and I see heavy lock contention in it, preventing good scalability across multiple cores. I have decided to use lock free programming to solve this. How can I write a lock free structure? Short answer is: You cannot. Long answer is: If you are asking this question, you do not probabl...
[ 0.4447605013847351, 0.4164104163646698, 0.01753496378660202, 0.22670787572860718, -0.0018027534242719412, -0.39934268593788147, 0.37197670340538025, -0.28361818194389343, -0.2597395181655884, -0.5493336319923401, -0.3012368977069855, 0.1727503389120102, -0.4724441170692444, 0.3160818517208...
it documented, if it is well proven, what are the limitations - even some lock free structure other people published are broken. If you do not find a lock free structure corresponding to the structure you are currently using, rather adapt the algorithm so that you can use some existing one. If you still insist on cre...
[ 0.16629453003406525, -0.03200490027666092, -0.0933760330080986, 0.3611842095851898, -0.034075938165187836, -0.23986169695854187, 0.0734192505478859, -0.20344720780849457, -0.2643451690673828, -0.5575569868087769, -0.037042126059532166, 0.38130322098731995, -0.10028278827667236, -0.20744200...
if it will work, prove it * heavily test the result More reading: [Lock free and wait free algorithms at Wikipedia](http://en.wikipedia.org/wiki/Lock-free_and_wait-free_algorithms) [Herb Sutter: Lock-Free Code: A False Sense of Security](http://www.ddj.com/cpp/210600279)
[ 0.6157032251358032, 0.04061111807823181, -0.14488865435123444, 0.08206213265657425, 0.40160417556762695, -0.2567968964576721, 0.5562757253646851, -0.4259350001811981, 0.08595637232065201, -0.17290085554122925, -0.16560150682926178, 0.5288763046264648, -0.15945638716220856, -0.0129289934411...
When refactoring away some `#defines` I came across declarations similar to the following in a C++ header file: ``` static const unsigned int VAL = 42; const unsigned int ANOTHER_VAL = 37; ``` The question is, what difference, if any, will the static make? Note that multiple inclusion of the headers isn't possible d...
[ 0.5283328890800476, 0.0931674912571907, 0.1964946836233139, -0.19377873837947845, -0.23258955776691437, 0.02127898670732975, 0.18602930009365082, -0.31870707869529724, -0.11570893973112106, -0.18316061794757843, -0.14843124151229858, 0.7121877074241638, -0.38739219307899475, 0.366941243410...
included in. But it also means that multiple inclusions will not result in multiple definitions of `VAL` that will collide at link time. In C, without the `static` you would need to ensure that only one source file defined `VAL` while the other source files declared it `extern`. Usually one would do this by defining it...
[ -0.05312858894467354, -0.296613872051239, 0.19421716034412384, 0.10511399060487747, -0.2279076725244522, -0.247889906167984, 0.09870949387550354, 0.16080622375011444, -0.24537070095539093, -0.3597264289855957, -0.3709118962287903, 0.5288975834846497, -0.4548562467098236, 0.1011205017566680...
C++, `const` objects with neither the `static` nor `extern` keywords in their declaration are implicitly `static`.
[ -0.2558155655860901, 0.06886839121580124, 0.10763724893331528, -0.21604309976100922, -0.23851178586483002, -0.1391620934009552, -0.05692903697490692, 0.3904215097427368, 0.03717397525906563, 0.39422059059143066, -0.4302138090133667, 0.4796508550643921, -0.6478646993637085, 0.03846506029367...
I noticed a new web service today called a [Dead man's switch](http://www.deadmansswitch.net/), which dispatches email in the event that you don't respond to periodic "pings" that prove you're still alive. But it occurred to me that I might outlive the person or organization that pays the bills for the service, making ...
[ 0.7218667268753052, -0.19944137334823608, 0.12252572923898697, 0.318641722202301, 0.2002221643924713, -0.13079319894313812, 0.13345178961753845, 0.33558592200279236, -0.6006157994270325, -0.2252167910337448, 0.27077770233154297, 0.1920580267906189, -0.021474935114383698, 0.0870383903384208...
different programs and devices, but that would break them all if someone forgot to pay the hosting bill. But say the service "owned itself", and paid its own hosting bills? Like this: * The host is Amazon EC2 or similar * The bill is paid by debiting a bank account * The bank account is replenished by interest return...
[ 0.6599598526954651, 0.0005352123407647014, 0.42837321758270264, 0.2952723503112793, 0.0016290085623040795, -0.10816290974617004, 0.23640292882919312, 0.3958027958869934, -0.2503674328327179, -0.30020931363105774, -0.0439721941947937, 0.19054168462753296, 0.07575027644634247, 0.433350712060...
of building Mars rovers, bury-n-forget power generators, The Millenium Clock, and other artifacts that have their own homeostasis mechanisms and can be abandoned by their creators without ceasing to function. The question is: what are the gotchas? Must the bank account be in a real person's name? Can you prevent the g...
[ 0.5869520902633667, 0.4388788342475891, 0.032786786556243896, 0.5376519560813904, 0.5020020008087158, 0.02931356430053711, 0.19045224785804749, 0.14832289516925812, -0.4849763512611389, -0.05296897143125534, 0.04448526352643967, 0.4339359998703003, -0.04103151708841324, 0.26470306515693665...
way - if the bank account is a single point of failure then when (not if) it fails, you lose. A bank account can't exist without a legal entity to own it, but that's just a detail here - other failures are that Amazon might pull SC2, or raise the price, or make an incompatible API change, or be bribed by your rival or ...
[ 0.49739035964012146, -0.337821900844574, 0.17433308064937592, 0.32391852140426636, 0.5075705647468567, -0.10880579799413681, 0.37589186429977417, -0.15686309337615967, -0.24174295365810394, -0.13885636627674103, -0.18332228064537048, 0.3128334581851959, -0.2388334572315216, 0.0593650303781...
possible, and ensure that they all have solid incentives to keep the service running, and to keep specific data live. It has to be resilient against as many as possible participants dropping out, and against as many as possible participants "going rogue" and trying to subvert it. He only gives broad outlines in the pa...
[ 0.7217755913734436, -0.07517074793577194, 0.4196832478046417, 0.026171322911977768, 0.5451033711433411, -0.0886540561914444, 0.26892128586769104, -0.07499317079782486, -0.36208200454711914, 0.14220884442329407, -0.01319444365799427, 0.4406496584415436, -0.1309167742729187, 0.35816490650177...
I have a site map of a few thoasand pages where the only different content on them is the title attribute and the content plotted out in a google map? Will google punish me for this as spam? Google has a specific standard for indexing geo-spatial content which they call a "[Geo sitemap](http://www.google.com/support/w...
[ 0.5121307969093323, 0.2483101785182953, 0.5682094693183899, 0.1448536366224289, 0.03558754175901413, -0.37186306715011597, 0.09680891782045364, -0.04839460179209709, -0.09300407767295837, -0.4676058292388916, 0.06354046612977982, 0.19814027845859528, -0.13140042126178741, 0.454133927822113...
on your server instead of the user-accessible pages. If you are generating your maps via other methods, you can achieve it by creating "shadow" KML files that mirror your content just for the Google crawler. As I recall the keys to this process were: * Mirror your content using [KML (Keyhole Markup Language)](http://...
[ 0.3729532063007355, -0.17286384105682373, 0.8136231303215027, 0.008320758119225502, 0.00236872723326087, 0.08583776652812958, 0.15334896743297577, 0.19641534984111786, -0.3656955063343048, -0.6099731922149658, 0.10611461848020554, 0.27623674273490906, -0.37327903509140015, 0.22552917897701...
and mark it appropriately One gotcha I discovered is you must put your geo sitemap content in a separate file from your other sitemaps and link to it via a [sitemap index file](http://sitemaps.org/protocol.php#index). Then submit the geo sitemap separately in [Google Webmaster Tools](https://www.google.com/webmasters/...
[ 0.19894441962242126, 0.11793982982635498, 0.574256420135498, -0.012571761384606361, -0.4487903118133545, -0.06560917943716049, 0.11851269006729126, -0.2578378915786743, -0.09409862756729126, -0.4631631672382355, 0.24960492551326752, 0.44069525599479675, 0.0455114021897316, -0.0411038100719...
I am writing a Composite control, which contains a listview to display a table of items. Normally when using a ListView in Asp.NET I would define the templates in the code-forward. ``` <asp:ListView runat="server" ID="ArticleList"> <LayoutTemplate> <div class="ContentContainer"> <div runat="ser...
[ 0.08903874456882477, 0.05970897898077965, 0.42682358622550964, -0.17168846726417542, -0.3235319256782532, 0.24771209061145782, -0.006676582153886557, -0.5213623046875, -0.16574101150035858, -0.8773289322853088, 0.08887690305709839, 0.14176255464553833, -0.33994370698928833, -0.137657701969...
</div> </ItemTemplate> </asp:ListView> ``` I assume it's something like: ``` ListView view = new ListView(); view.LayoutTemplate = ..... view.ItemTemplate = ..... // when do I call these? view.DataSource = myDataSource; view.DataBind(); ``` **Update:** I created 2 templates by implementing the ITemplate i...
[ -0.013588473200798035, -0.3177999258041382, 0.725486159324646, -0.2688849866390228, -0.19447888433933258, 0.2361435443162918, -0.04475683346390724, -0.6070067882537842, -0.3303320109844208, -0.7492919564247131, -0.07561942934989929, 0.5402924418449402, -0.3363325893878937, 0.03488310426473...
container.Controls.Add(table); } } private class ItemTemplate : ITemplate { public void InstantiateIn(Control container) { var inner = new HtmlGenericControl("div"); container.Controls.Add(inner); } } ``` and I can add them using: ``` dataList.LayoutTemplate = new LayoutTemplate(); ...
[ -0.16499385237693787, -0.14642749726772308, 0.747998833656311, -0.15816739201545715, 0.10187941789627075, 0.34449031949043274, 0.021736230701208115, -0.36561909317970276, -0.2879522740840912, -0.6473222970962524, -0.3024140000343323, 0.30251502990722656, -0.44183769822120667, 0.08012582361...
// .... } protected override void CreateChildControls() { base.CreateChildControls(); ListView view = new ListView(); view.LayoutTemplate = new LayoutTemplate(); view.ItemTemplate = new ItemTemplate(); view.DataSource = FibonacciSequence(); view.DataBind()...
[ 0.07489333301782608, -0.37340977787971497, 0.6095288991928101, -0.2874070703983307, 0.35444363951683044, 0.16536706686019897, 0.344666063785553, -0.5336027145385742, -0.08324576914310455, -0.6370130181312561, -0.39835992455482483, 0.6159368753433228, -0.2580977976322174, 0.1350714564323425...
int i1 = 0; int i2 = 1; for (int i = 0; i < Iterations; i++) { yield return i1 + i2; int temp = i1 + i2; i1 = i2;
[ -0.164092019200325, -0.4029274582862854, 0.2878246307373047, -0.30292218923568726, 0.047304559499025345, 0.4134816825389862, 0.5944783687591553, -0.5150776505470276, 0.22522354125976562, -0.2997223138809204, -0.1807241439819336, 0.3797006607055664, -0.24838405847549438, -0.2435839921236038...
i2 = temp; } yield break; } public int Iterations { get; set; } private class LayoutTemplate : ITemplate { public void InstantiateIn(Control container) { var ol = new HtmlGenericControl("ol"); var li = new
[ -0.07839922606945038, -0.46900737285614014, 0.5582951307296753, -0.06935590505599976, 0.028696155175566673, 0.5012618899345398, 0.16282673180103302, -0.2494378238916397, -0.1495978832244873, -0.7065410017967224, -0.28865355253219604, 0.2241113930940628, -0.2484855353832245, 0.1983710974454...
HtmlGenericControl("li") { ID = "itemPlaceholder" }; ol.Controls.Add(li); container.Controls.Add(ol); } } private class ItemTemplate : ITemplate { public void InstantiateIn(Control container) { var li = new HtmlGenericControl("li");
[ -0.45119208097457886, -0.40855005383491516, 0.6070287823677063, -0.04947613179683685, -0.17247022688388824, 0.16418403387069702, 0.05809846147894859, -0.28058838844299316, -0.06519313156604767, -0.7054538726806641, -0.49757763743400574, 0.26419326663017273, -0.4907020032405853, 0.103815607...
li.DataBinding += DataBinding; container.Controls.Add(li); } public void DataBinding(object sender, EventArgs e) { var container = (HtmlGenericControl)sender; var dataItem = ((ListViewDataItem)container.NamingContainer).DataItem; container.Contro...
[ -0.1903674304485321, -0.2898280620574951, 0.6318691968917847, -0.07961304485797882, -0.04367304593324661, 0.17323175072669983, 0.20725469291210175, -0.43295973539352417, -0.18621301651000977, -0.5339337587356567, -0.46337637305259705, 0.5107344388961792, -0.5352388024330139, 0.240835487842...
} } ```
[ 0.17493881285190582, 0.41805654764175415, 0.05209751054644585, -0.04864929988980293, 0.437467485666275, -0.15825650095939636, 0.13202530145645142, 0.5446501970291138, 0.35430577397346497, -0.4846813380718231, -0.2295716553926468, 0.546978771686554, -0.3188462555408478, 0.2798506021499634, ...
I have a couple databases on a shared SQL Server 2005 cluster instance, that I would like performance metrics on. I have some processes that run for a very long time and suspect that code inefficiencies, rather than insufficient hardware are to blame. I would like some way to get these performance metrics so that I ca...
[ -0.03619632124900818, -0.11891283094882965, 0.2893851399421692, 0.010321207344532013, 0.09120087325572968, 0.00439050979912281, 0.1014772430062294, -0.02871822379529476, -0.24965600669384003, -0.4182995855808258, -0.06255603581666946, 0.5973706841468811, -0.47286829352378845, 0.05281203985...
// .... } protected override void CreateChildControls() { base.CreateChildControls(); ListView view = new ListView(); view.LayoutTemplate = new LayoutTemplate(); view.ItemTemplate = new ItemTemplate(); view.DataSource = FibonacciSequence(); view.DataBind()...
[ 0.07489333301782608, -0.37340977787971497, 0.6095288991928101, -0.2874070703983307, 0.35444363951683044, 0.16536706686019897, 0.344666063785553, -0.5336027145385742, -0.08324576914310455, -0.6370130181312561, -0.39835992455482483, 0.6159368753433228, -0.2580977976322174, 0.1350714564323425...
int i1 = 0; int i2 = 1; for (int i = 0; i < Iterations; i++) { yield return i1 + i2; int temp = i1 + i2; i1 = i2;
[ -0.164092019200325, -0.4029274582862854, 0.2878246307373047, -0.30292218923568726, 0.047304559499025345, 0.4134816825389862, 0.5944783687591553, -0.5150776505470276, 0.22522354125976562, -0.2997223138809204, -0.1807241439819336, 0.3797006607055664, -0.24838405847549438, -0.2435839921236038...
i2 = temp; } yield break; } public int Iterations { get; set; } private class LayoutTemplate : ITemplate { public void InstantiateIn(Control container) { var ol = new HtmlGenericControl("ol"); var li = new
[ -0.07839922606945038, -0.46900737285614014, 0.5582951307296753, -0.06935590505599976, 0.028696155175566673, 0.5012618899345398, 0.16282673180103302, -0.2494378238916397, -0.1495978832244873, -0.7065410017967224, -0.28865355253219604, 0.2241113930940628, -0.2484855353832245, 0.1983710974454...
HtmlGenericControl("li") { ID = "itemPlaceholder" }; ol.Controls.Add(li); container.Controls.Add(ol); } } private class ItemTemplate : ITemplate { public void InstantiateIn(Control container) { var li = new HtmlGenericControl("li");
[ -0.45119208097457886, -0.40855005383491516, 0.6070287823677063, -0.04947613179683685, -0.17247022688388824, 0.16418403387069702, 0.05809846147894859, -0.28058838844299316, -0.06519313156604767, -0.7054538726806641, -0.49757763743400574, 0.26419326663017273, -0.4907020032405853, 0.103815607...
li.DataBinding += DataBinding; container.Controls.Add(li); } public void DataBinding(object sender, EventArgs e) { var container = (HtmlGenericControl)sender; var dataItem = ((ListViewDataItem)container.NamingContainer).DataItem; container.Contro...
[ -0.1903674304485321, -0.2898280620574951, 0.6318691968917847, -0.07961304485797882, -0.04367304593324661, 0.17323175072669983, 0.20725469291210175, -0.43295973539352417, -0.18621301651000977, -0.5339337587356567, -0.46337637305259705, 0.5107344388961792, -0.5352388024330139, 0.240835487842...
} } ```
[ 0.17493881285190582, 0.41805654764175415, 0.05209751054644585, -0.04864929988980293, 0.437467485666275, -0.15825650095939636, 0.13202530145645142, 0.5446501970291138, 0.35430577397346497, -0.4846813380718231, -0.2295716553926468, 0.546978771686554, -0.3188462555408478, 0.2798506021499634, ...
``` class A : IFoo { } ... A[] arrayOfA = new A[10]; if(arrayOfA is IFoo[]) { // this is not called } ``` Q1: Why is `arrayOfA` not an array of `IFoos`? Q2: Why can't I cast `arrayOfA` to `IFoo[]`? `arrayOfA` **is** `IFoo[]`. There must be something else wrong with your program. You seem to have mocked up...
[ -0.052513327449560165, 0.17636848986148834, 0.12237707525491714, -0.2728620767593384, 0.03324747085571289, -0.07652796059846878, 0.4069086015224457, -0.14946302771568298, -0.3043171167373657, -0.5013605356216431, -0.25715720653533936, 0.6050470471382141, -0.5049772262573242, 0.140481829643...
void Main() { A[] aOa = new A[10]; if (aOa is IFoo[]) { Console.WriteLine("aOa is IFoo[]"); } } public interface IFoo {} public class A : IFoo {} } PS D:\> csc test.cs Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.1 for Microsoft (R) .NET Framework version 3.5 Copyright (C) Micr...
[ 0.03666943684220314, 0.24998444318771362, 0.2612988352775574, -0.09612933546304703, 0.10876790434122086, -0.0790594294667244, 0.5207468271255493, -0.03388569504022598, 0.03732602298259735, -0.37205034494400024, -0.5244463682174683, 0.004148304462432861, -0.47251346707344055, 0.344834506511...
I have an announcements list on one site. I want to add it as a web part to the top of each subsite. How can I do this in MOSS? Out of box that is not possible. Lists are limited to one site only. The only option you have is to use content query web part (available in SharePoint Standard or better). [Here](http://ww...
[ 0.5604422092437744, -0.07174181938171387, 0.29487088322639465, 0.029527906328439713, -0.2449292689561844, -0.43575164675712585, 0.11420648545026779, 0.09805377572774887, -0.2126341611146927, -0.4911085069179535, -0.0346510112285614, 0.2076563686132431, 0.016762083396315575, 0.0539341233670...
I'm implementing a comment control that uses an ASP.Repeater to display each comment. The comment itself is currently displayed using a table to divide up some images to display the comment in a bubble. I know that tables are supposed to be the epitome of evil for design layout, and really expensive to display for the...
[ 0.6436195969581604, 0.3067440092563629, 0.3806638717651367, 0.21260635554790497, -0.1566963791847229, 0.09917984157800674, -0.02217188850045204, 0.2829223573207855, -0.24493499100208282, -0.7553626298904419, 0.389586478471756, 0.2500774562358856, -0.17746326327323914, 0.19287589192390442, ...
resource I've seen for creating rounded corners using DIV elements was an article on "A List Apart" - see <http://alistapart.com/articles/customcorners/>. If you're looking to use DIV elements to layout your entire site, there are several other relevant articles on that site. See: <http://alistapart.com/articles/slidi...
[ 0.08794479817152023, -0.19620466232299805, 0.02294570952653885, 0.07358977943658829, -0.45599788427352905, 0.20175960659980774, 0.2846721410751343, -0.14228786528110504, -0.3705708682537079, -0.3703201711177826, 0.3098946213722229, 0.03531143069267273, -0.3720855712890625, 0.13535702228546...
This question was [already asked in the context of C#/.Net](https://stackoverflow.com/questions/13049). Now I'd like to learn the differences between a struct and a class in C++. Please discuss the technical differences as well as reasons for choosing one or the other in OO design. I'll start with an obvious differen...
[ 0.029122397303581238, 0.15907418727874756, 0.19188161194324493, -0.04371563717722893, -0.23670141398906708, 0.003531368914991617, -0.08743654936552048, -0.03237591311335564, 0.02196411043405533, -0.4763094186782837, -0.28286927938461304, 0.4855409264564514, -0.08645492792129517, -0.1624971...
through C++11): > In absence of an *access-specifier* > for a base class, public is assumed > when the derived class is declared > *struct* and private is assumed when the class is declared *class*. And just for completeness' sake, the more widely known difference between class and struct is defined in (11.2): > ...
[ -0.06682327389717102, -0.1064930334687233, -0.03552548959851265, -0.12148012965917587, -0.16004802286624908, -0.012149040587246418, 0.15678204596042633, -0.26537588238716125, -0.10181266069412231, -0.5414794683456421, -0.4226546585559845, 0.5449656248092651, -0.3352477550506592, -0.0855156...
so used.
[ -0.10054368525743484, 0.16151660680770874, -0.29526907205581665, -0.05689260736107826, -0.528465986251831, 0.10874496400356293, 0.1484888195991516, -0.3109704852104187, 0.19233156740665436, -0.4340655207633972, 0.3225012421607971, 0.16098736226558685, -0.13592861592769623, 0.47984635829925...
What is best practises for communicating events from a usercontrol to parent control/page i want to do something similar to this: ``` MyPage.aspx: <asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceholder" runat="server"> <uc1:MyUserControl ID="MyUserControl1" runat="server" OnSomeEvent="MyUserCo...
[ -0.05473781004548073, 0.1548699140548706, 0.4710944592952728, -0.1373213827610016, 0.02841045707464218, -0.3499125838279724, 0.5302364826202393, -0.3688998520374298, 0.018819399178028107, -0.5996836423873901, -0.04863701015710831, 0.39212700724601746, -0.11674444377422333, 0.09526517242193...
in the parent. See [OdeToCode](http://www.odetocode.com/code/94.aspx) for an example. Here is the article for longevity sake: Some user controls are entirely self contained, for example, a user control displaying current stock quotes does not need to interact with any other content on the page. Other user controls wi...
[ 0.3393914997577667, -0.16841882467269897, 0.05916006490588188, 0.32857003808021545, -0.02219223603606224, -0.33848294615745544, -0.20009374618530273, -0.022024031728506088, 0.048127155750989914, -0.41830405592918396, -0.10355634987354279, 0.19623498618602753, -0.18711067736148834, 0.157599...
commonly referred to as “event bubbling” since the event can continue to pass through layers, starting at the bottom (the user control) and perhaps reaching the top level (the page) like a bubble moving up a champagne glass. For starters, let’s create a user control with a button attached. ``` <%@ Control Language="c...
[ -0.10788416117429733, -0.2740741968154907, 0.5846101641654968, 0.06191522628068924, 0.16156058013439178, -0.13781876862049103, 0.03792663663625717, 0.0586201511323452, -0.306999534368515, -0.3942943513393402, -0.3051341474056244, 0.20174583792686462, -0.06144161894917488, 0.253101289272308...
Button1; protected System.Web.UI.WebControls.Panel Panel1; private void Page_Load(object sender, System.EventArgs e) { Response.Write("WebUserControl1 :: Page_Load <BR>"); } private void Button1_Click(object sender, System.EventArgs e) { Response.Write("WebUserControl1 :: Begin Button1_C...
[ -0.5911197662353516, -0.42406877875328064, 0.7414489388465881, -0.3432360887527466, 0.08535461127758026, 0.21809549629688263, 0.29029908776283264, -0.290597140789032, -0.31105679273605347, -0.6579224467277527, -0.64969402551651, 0.776753842830658, -0.3606686592102051, -0.14415058493614197,...
BubbleClick(this, e); } } #region Web Form Designer generated code override protected void OnInit(EventArgs e) { InitializeComponent(); base.OnInit(e); } private void InitializeComponent() { this.Button1.Click += new System.EventHandler(this.Button1_Click); ...
[ -0.43470340967178345, -0.62319415807724, 0.6689656376838684, -0.21555401384830475, 0.478014200925827, -0.26340430974960327, 0.26855340600013733, -0.0021311803720891476, -0.056583207100629807, -0.8032402992248535, -0.5853298306465149, 0.49215981364250183, -0.5467150807380676, -0.00071761442...
which declares a delegate. Anyone interested in the BubbleClick event can add an EventHandler method to execute when the event fires – just like the user control adds an EventHandler for when the Button fires the Click event. In the OnBubbleClick event, we first check to see if anyone has attached to the event (Bubble...
[ 0.014964639209210873, -0.5302900671958923, 0.299587219953537, 0.05695602297782898, -0.027316434308886528, -0.35727420449256897, 0.09159193933010101, -0.20183314383029938, -0.20421567559242249, -0.4300403594970703, -0.29848843812942505, 0.5526828765869141, -0.36206692457199097, 0.0174316056...
the user control to work. ``` <%@ Register TagPrefix="ksa" TagName="BubbleControl" Src="WebUserControl1.ascx" %> <%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="aspnet.eventbubble.WebForm1" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <HTML>...
[ -0.029804958030581474, -0.008800799958407879, 0.7883532047271729, 0.10356052964925766, 0.04405484348535538, -0.05091634392738342, 0.09851673245429993, -0.44756364822387695, 0.07705705612897873, -0.6194413304328918, -0.45928096771240234, 0.6344581842422485, -0.3885977864265442, -0.357201486...
class WebForm1 : System.Web.UI.Page { protected WebUserControl1 BubbleControl; private void Page_Load(object sender, System.EventArgs e) { Response.Write("WebForm1 :: Page_Load <BR>"); } #region Web Form Designer generated code override protected void OnInit(EventArgs e) { InitializeC...
[ -0.28876590728759766, -0.5585747957229614, 0.6397226452827454, -0.17489610612392426, 0.06950491666793823, 0.033876750618219376, 0.1757560521364212, -0.3642752170562744, -0.2343505322933197, -0.8290265798568726, -0.5629919767379761, 0.5739908814430237, -0.35471832752227783, 0.13672700524330...
#endregion private void WebForm1_BubbleClick(object sender, EventArgs e) { Response.Write("WebForm1 :: WebForm1_BubbleClick from " + sender.GetType().ToString() + "<BR>"); } } ``` Notice the parent page simply needs to add an event handler during InitializeComponent meth...
[ 0.11453225463628769, -0.48884913325309753, 0.8545696139335632, -0.2388068437576294, 0.18015699088573456, -0.4104890823364258, 0.6341990232467651, 0.06657341122627258, -0.0836186408996582, -0.6117045283317566, -0.31474003195762634, 0.635114312171936, -0.4978792071342468, -0.1323486715555191...
InitializeComponent method to make sure the designer has not removed any of the code adding event handlers.
[ 0.07929418981075287, -0.3604757785797119, -0.038805268704891205, 0.03820343315601349, 0.1403690129518509, -0.14541548490524292, 0.02059859223663807, -0.17409957945346832, -0.03578270599246025, -0.5562598705291748, -0.12257002294063568, 0.3219573199748993, -0.3186827301979065, -0.2458873242...
I'm using memcache to design a cache for the model layer of a web application, one of my biggest problems is data consistency. It came to my mind caching data like this: (key=query, value=list of object ids result of the query) for each id of the list: (key=object.id, value=object) So, every time a query is done: If ...
[ 0.08727847784757614, 0.4992799758911133, -0.06847864389419556, 0.10781773924827576, -0.18220975995063782, 0.02282600849866867, 0.2296782284975052, -0.1074991226196289, -0.17947332561016083, -0.6702258586883545, 0.19890476763248444, 0.41589558124542236, -0.2667045295238495, 0.50010746717453...
where there is no one right answer - it depends on your domain. The caching policy that you describe may be sufficient for your domain. However, you don't appear to be worried about stale data. Often I would expect to see a timestamp against some of the entities - if the cached value is older than some system defined ...
[ 0.07735250890254974, 0.38727426528930664, -0.07867872714996338, 0.19509780406951904, 0.14019328355789185, -0.24158217012882233, -0.04249211773276329, -0.053916092962026596, -0.39516744017601013, -0.5591230392456055, -0.2688920199871063, 0.26593607664108276, -0.07530597597360611, 0.22687335...
A friend of mine and I were having a discussion regarding currying and partial function application in Javascript, and we came to very different conclusions as to whether either were achievable. I came up with this implementation of `Function.prototype.curry`, which was the basis of our discussion: ``` Function.protot...
[ -0.06007333844900131, -0.04073260724544525, 0.2820185720920563, -0.6454271078109741, 0.07690383493900299, 0.5482178330421448, 0.3231700658798218, -0.5535902976989746, -0.07319018244743347, -0.7147470116615295, 0.10589089244604111, 0.3023504912853241, -0.6204447150230408, 0.1243539974093437...
} } ``` Which is used as follows: ``` var vindaloo = function(a, b) { return (a + b); } var karahi = vindaloo.curry(1); var masala = karahi(2); var gulai = karahi(3); print(masala); print(other); ``` The output of which is as follows in Spidermonkey: ``` $ js curry.js 3 4 ``` His opinion was that since t...
[ 0.14391158521175385, 0.2808942496776581, 0.048897601664066315, -0.6053200364112854, -0.15645785629749298, 0.19315098226070404, 0.3467414677143097, -0.4274274706840515, -0.04756087064743042, -0.3770048916339874, -0.21809478104114532, 0.33132028579711914, -0.59238201379776, 0.465886086225509...
itself does not provide support for partial application in its' `function` primitives (unlike say, ML or Haskell), that doesn't mean you can't create a higher order function of the language which is capable of encapsulating concept of a partially applied function. Also, despite being "applied", the scope of the functio...
[ -0.00476579274982214, 0.10778748244047165, 0.08638329803943634, -0.0558755099773407, -0.2360636293888092, -0.05354319140315056, 0.2999069392681122, 0.05033739656209946, 0.010192959569394588, -0.07524146139621735, -0.08510329574346542, 0.5044028759002686, -0.5407801270484924, 0.125820070505...
be closer to this (note that this isn't a general solution): ``` vindaloo.curry = function(a) { return function(b) { return a + b; }; }; ``` IIUC, this still wouldn't be a partially applied function. But it's closer. A true partially applied function would actually look like this if you can examine t...
[ 0.18362505733966827, 0.10349693894386292, 0.18504318594932556, -0.2298264354467392, -0.27872955799102783, -0.1513323336839676, 0.3691769242286682, -0.43969064950942993, 0.11877351254224777, -0.5285389423370361, -0.0641225278377533, 0.3908594846725464, -0.4111197590827942, 0.082302130758762...
be to parse the function, apply the changes, and then run it through an eval(). However, your solution is a good practical application of the concept to JavaScript, so practically speaking accomplishes the goal, even if it is not technically exact.
[ 0.06077219173312187, -0.16688378155231476, -0.02854541689157486, 0.07064207643270493, 0.19168028235435486, -0.03647862747311592, 0.34018635749816895, -0.4950233995914459, 0.08939370512962341, -0.38485315442085266, -0.44040873646736145, 0.7211295366287231, -0.4154009222984314, -0.4683399498...
Does anyone know of an IDE for F# development that does not involve me shelling out $300? I will gladly move to F# VS Express if they ever release one, but spending money to just get started with a new language is not in my budget. <http://msdn.microsoft.com/en-us/vsx2008/products/bb933751.aspx> Visual Studio Shell - ...
[ 0.054606642574071884, -0.09699815511703491, 0.005471873562783003, -0.06591252982616425, -0.15364177525043488, -0.11668331176042557, 0.21599474549293518, 0.25735217332839966, -0.08860543370246887, -0.40823227167129517, -0.08687887340784073, 0.9221258163452148, -0.11198104172945023, -0.22848...
How do you implement an **efficient and thread safe reference counting system** on X86 CPUs in the C++ programming language? I always run into the problem that the **critical operations not atomic**, and the available X86 Interlock operations are not sufficient for implementing the ref counting system. The following...
[ 0.36021003127098083, 0.21795904636383057, 0.23729409277439117, 0.1770138293504715, -0.23758578300476074, -0.15465152263641357, 0.1265110969543457, -0.3222307562828064, -0.4131850302219391, -0.3253885507583618, 0.26209473609924316, 0.9981386661529541, -0.13698430359363556, 0.099529504776000...
I'm supposed to create a simple rule engine in C#. Any leads on how I can proceed?. It's a minimalistic rule engine, and would use SQL server as the back end. Do we have any general blueprint or design patterns that generally apply to rule engines? What kind of .Net technologies can I use to design one? Any directions ...
[ 0.4626941382884979, -0.010016338899731636, 0.11634749174118042, 0.0884215384721756, -0.18307068943977356, -0.4884014427661896, 0.07794760167598724, -0.18503382802009583, -0.06856457144021988, -0.5036988854408264, 0.0013421131297945976, 0.4804164469242096, -0.35909605026245117, -0.059010025...
it works great. You can use the IDE that comes with the Workflow examples and put it in your own apps. It's excellent.
[ 0.5545752644538879, 0.2060813456773758, 0.17285118997097015, 0.2645052969455719, 0.06708203256130219, -0.19484907388687134, -0.03360261023044586, 0.2405775636434555, 0.013376276008784771, -0.5983985066413879, 0.28799980878829956, 0.8806568384170532, 0.38192301988601685, -0.0711835473775863...
In a .net 2 winforms application, what's a good way to set the culture for the entire application? Setting CurrentThread.CurrentCulture for every new thread is repetitive and error-prone. Ideally I'd like to set it when the app starts and forget about it. The culture for a thread in .NET is the culture for the sy...
[ 0.6005345582962036, -0.11715274304151535, 0.3736182749271393, 0.01368703879415989, -0.04276522621512413, -0.1867576539516449, 0.22416986525058746, 0.07281727343797684, 0.09734880179166794, -0.5435754656791687, 0.04656220227479935, 0.4326895475387573, -0.46086835861206055, 0.029319828376173...
I'm having a problem debugging an Eclipse Application from Eclipse. When I launch the Debug Configuration, the Eclipse Application starts up and then stops repeatedly. It shows the splash screen and then disappears. This is the farthest it gets before restarting: ``` MyDebugConfiguration [Eclipse Application] or...
[ 0.3231264054775238, 0.12949463725090027, 0.3706313967704773, -0.05398803576827049, -0.20544782280921936, -0.21849723160266876, 0.43491512537002563, 0.25868019461631775, -0.46685779094696045, -0.5881470441818237, -0.24167275428771973, 0.4103563129901886, -0.2533474862575531, 0.1821296513080...
Daemon Thread [Framework Event Dispatcher] (Running) Thread [State Saver] (Running) Daemon Thread [Start Level Event Dispatcher] (Running) Thread [Refresh Packages] (Running) C:\MyApp\eclipse\jdk\jre\bin\javaw.exe (Sep 18, 2008 9:38:19 AM) ``` I am using Version 3.4.0 of the E...
[ 0.07849661260843277, 0.09864169359207153, 0.6516245007514954, -0.1798660159111023, -0.30857986211776733, -0.39771899580955505, 0.6213896870613098, -0.17613933980464935, -0.4308489263057709, -1.0340080261230469, 0.04826248437166214, 0.3462410271167755, -0.5249623656272888, 0.314769297838211...
= [{ "name" => "paint fence"}] p.new_tasks_attributes = (new_tasks_attributes) p.save assert p.tasks.length == 1 end ```
[ 0.23859955370426178, -0.0780997946858406, 0.4203939735889435, -0.13667015731334686, -0.04519025608897209, -0.04431430995464325, 0.343865305185318, -0.6572027206420898, -0.1109248623251915, -0.3785170912742615, -0.1632164716720581, 0.6121219992637634, 0.015721851959824562, -0.00104412122163...
It looks quite easy to find such a tool for Java ([Checkstyle](http://checkstyle.sourceforge.net/), [JCSC](http://jcsc.sourceforge.net/)), but I can't seem to find one for C/C++. I am not looking for a lint-like static code analyzer, I only would like to check against coding standards like variable naming, capitalizati...
[ 0.332567036151886, -0.21828067302703857, -0.07825016975402832, 0.25660285353660583, -0.15024977922439575, -0.024468636140227318, -0.04970870167016983, -0.18101179599761963, -0.25527435541152954, -0.6325140595436096, 0.2544701099395752, 0.4718686044216156, -0.054628659039735794, 0.047148682...
I have created a foreign key (in SQL Server) by: ``` alter table company add CountryID varchar(3); alter table company add constraint Company_CountryID_FK foreign key(CountryID) references Country; ``` I then run this query: ``` alter table company drop column CountryID; ``` and I get this error: > *Msg 5074, L...
[ -0.3774357736110687, 0.4794146716594696, 0.6704249978065491, -0.24437518417835236, 0.3828183114528656, 0.17528791725635529, 0.04787960648536682, -0.007990282028913498, -0.10993067920207977, -0.313926637172699, -0.04000415652990341, -0.018841389566659927, -0.42589107155799866, 0.54223674535...
foreign key Company_CountryID_FK; alter table company drop column CountryID; ``` What do I need to do to drop the `CountryID` column? Thanks. Try ``` alter table company drop constraint Company_CountryID_FK alter table company drop column CountryID ```
[ -0.21056273579597473, 0.4489808976650238, 0.4757886230945587, -0.1560073345899582, 0.45947372913360596, 0.15077580511569977, 0.08263357728719711, 0.18637315928936005, -0.27884551882743835, 0.1341903954744339, -0.5024420022964478, 0.2258293628692627, -0.3070194125175476, 0.2595151662826538,...
For our online game, we have written tons of PHP classes and functions grouped by theme in files and then folders. In the end, we have now all our backend code (logic & DB access layers) in a set of files that we call **libs** and we include our libs in our GUI (web pages, presentation layer) using *include\_once('path...
[ 0.17117847502231598, 0.20730465650558472, 0.33290937542915344, 0.07479936629533768, 0.028491348028182983, -0.13197234272956848, 0.14981809258460999, 0.00029601302230730653, 0.12451048940420151, -0.7404093742370605, 0.021125802770256996, 0.44533979892730713, -0.3270387053489685, -0.14747796...
a significant impact on the performance. Therefore What would be the best solution ? * Remove all include statements from the libs file and only call the necessary one from the web pages ? * Do something else ? Server uses a classic LAMP stack (PHP5). EDIT: We have a mix of simple functions (legacy reason and the ma...
[ 0.2503949701786041, 0.007040913682430983, 0.19734948873519897, 0.01638132520020008, -0.12277477979660034, -0.24541181325912476, 0.4766128659248352, -0.21203480660915375, -0.11914100497961044, -0.7584510445594788, -0.17086224257946014, 0.6270109415054321, -0.47227540612220764, -0.1764176785...
use autoload, it's slow and makes APC and equivalent caches jobs a lot harder * You can turn off the "stat"-operation in APC, but then you have to clear the cache manually every time you update the files
[ 0.2760171592235565, -0.13386023044586182, 0.007277616765350103, 0.2452705055475235, -0.08167220652103424, -0.11478034406900406, 0.3804318904876709, 0.024634405970573425, -0.48264846205711365, -0.799175500869751, -0.2709961235523224, 0.8235073089599609, -0.3744092583656311, -0.1340195685625...
We're testing our ClickOnce deployed application internally on IIS (Internet Information Services), but we're wondering if we can deploy it to the wider internet using Apache on Linux so we can make use of our existing external website host. If so, is there anything else I need to consider other than as specifying the...
[ 0.4525889456272125, 0.12895281612873077, 0.5317928194999695, -0.11226093769073486, 0.004581736400723457, -0.08664751052856445, 0.1439667046070099, 0.10974685847759247, -0.19517064094543457, -0.5241332650184631, 0.08255454152822495, 0.33872807025909424, -0.27529773116111755, -0.097665548324...
be setting up the mime types and providing access to the files.
[ 0.5858969688415527, 0.1897284835577011, 0.12109235674142838, -0.05503308027982712, 0.2840518355369568, -0.49253588914871216, -0.013367968611419201, -0.17141783237457275, 0.2427932769060135, -0.664139449596405, -0.3293476998806, 0.598953127861023, -0.02633143775165081, -0.471597284078598, ...
I have the following code: ``` String inputFile = "somefile.txt"; FileInputStream in = new FileInputStream(inputFile); FileChannel ch = in.getChannel(); ByteBuffer buf = ByteBuffer.allocateDirect(BUFSIZE); // BUFSIZE = 256 /* read the file into a buffer, 256 bytes at a time */...
[ 0.0664757788181305, -0.09215305000543594, 0.8333958387374878, -0.3869495093822479, 0.06924673169851303, 0.25244489312171936, 0.08032521605491638, -0.30651766061782837, 0.04839077219367027, -0.8098462820053101, 0.12515413761138916, 0.37078580260276794, -0.16398727893829346, 0.22594901919364...
) { buf.rewind(); for ( int i = 0; i < rd/2; i++ ) { /* print each character */ System.out.print(buf.getChar()); } buf.clear();
[ -0.008400380611419678, 0.007940949872136116, 0.6463337540626526, -0.72214275598526, 0.44005832076072693, 0.48571568727493286, 0.44074931740760803, -0.4313066601753235, -0.10827795416116714, -0.5178170800209045, -0.6722145676612854, 0.32032448053359985, -0.45145970582962036, 0.2154510319232...
} ``` But the characters get displayed at ?'s. Does this have something to do with Java using Unicode characters? How do I correct this? You have to know what the encoding of the file is, and then decode the ByteBuffer into a CharBuffer using that encoding. Assuming the file is ASCII: ``` import java.util.*; import ...
[ 0.24225224554538727, 0.04993234574794769, 0.14906109869480133, -0.1825486123561859, 0.3053642809391022, 0.19476749002933502, 0.14625601470470428, -0.17401215434074402, -0.15103961527347565, -0.6243242025375366, -0.258090615272522, 0.37217098474502563, -0.5662789344787598, 0.193936869502067...
FileChannel ch = in.getChannel(); ByteBuffer buf = ByteBuffer.allocateDirect(BUFSIZE); // BUFSIZE = 256 Charset cs = Charset.forName("ASCII"); // Or whatever encoding you want /* read the file into a buffer, 256 bytes at a time */ int rd; while ( (rd = ch.read( buf )) != -1 ) ...
[ 0.038166593760252, -0.17486950755119324, 0.7452121376991272, -0.49486860632896423, 0.022745836526155472, 0.3346059322357178, 0.24733391404151917, -0.42145779728889465, -0.1737922579050064, -0.5904368758201599, -0.25891199707984924, 0.3331608772277832, -0.215735524892807, 0.2305265963077545...
CharBuffer chbuf = cs.decode(buf); for ( int i = 0; i < chbuf.length(); i++ ) { /* print each character */ System.out.print(chbuf.get()); } buf.clear();
[ 0.07432258874177933, 0.008555825799703598, 0.5551002621650696, -0.6449147462844849, 0.06052926555275917, 0.5108615756034851, 0.4225923717021942, -0.44278571009635925, 0.03629942983388901, -0.5156144499778748, -0.4689868986606598, 0.21518243849277496, -0.529667317867279, 0.19817614555358887...
} } } ```
[ 0.033695679157972336, 0.4034728407859802, 0.1949702352285385, -0.15257494151592255, 0.4299153685569763, -0.20141436159610748, 0.07711705565452576, 0.4467844069004059, 0.3091506361961365, -0.5090379118919373, -0.3048633635044098, 0.5600791573524475, -0.33611243963241577, 0.3141762912273407,...
Is there any website/service which will enable me to add RSS subscription to any website? This is for my company I work. We have a website which displays company related news. These news are supplied by an external agency and they gets updated to our database automatically. Our website picks up random/new news and dis...
[ 1.0248980522155762, -0.1291426420211792, 0.2836124897003174, 0.11401867866516113, 0.07369837909936905, -0.003691318677738309, -0.3013361692428589, 0.3853687047958374, -0.49900883436203003, -0.23691768944263458, 0.1649169921875, 0.29936379194259644, -0.06273332983255386, 0.05346386507153511...
put text like: ``` <link rel="alternate" title="RSS Feed" href="http://www.example.com/rss-feed/latest/" type="application/rss+xml" /> ``` This allows the feed to be "auto-discovered" by your user's browser (e.g. the RSS icon appears in the address bar in FF).
[ 0.4967060983181, -0.05823400244116783, 0.2653522789478302, -0.1190551295876503, 0.03960130363702774, -0.27895382046699524, 0.04766537994146347, 0.03009568713605404, -0.15479472279548645, -0.5775877237319946, -0.4429236352443695, 0.406626433134079, -0.556636393070221, -0.18713386356830597, ...
I would like to add AES encryption to a software product, but am concerned by increasing the size of the data. I am guessing that the data does increase in size, and then I'll have to add a compression algorithm to compensate. AES does not expand data. Moreover, the output will not generally be compressible; if you int...
[ -0.10276046395301819, 0.3614584505558014, 0.23962490260601044, -0.034430231899023056, 0.21778637170791626, -0.08561321347951889, 0.21797850728034973, -0.38933947682380676, -0.09631216526031494, -0.5895613431930542, -0.41514816880226135, 0.5697594285011292, -0.30203983187675476, -0.24769008...
Is it possible to use DateTimePicker (Winforms) to pick both date and time (in the dropdown)? How do you change the custom display of the picked value? Also, is it possible to enable the user to type the date/time manually? Set the Format to Custom and then specify the format: ``` dateTimePicker1.Format = DateTimePick...
[ 0.2290971726179123, -0.4281653165817261, 0.9371863603591919, 0.12915055453777313, 0.26261386275291443, 0.20645885169506073, -0.08693624287843704, -0.1522410660982132, -0.47372251749038696, -0.5668420195579529, 0.03604734688997269, 0.562808632850647, 0.2109217792749405, 0.08690668642520905,...
know about the picker for date and time together. Sounds like a custom control to me.
[ 0.5877330899238586, -0.06147079914808273, 0.31860873103141785, 0.21004708111286163, 0.24345727264881134, -0.15169742703437805, -0.35643213987350464, 0.2754863202571869, -0.12858282029628754, 0.22594428062438965, 0.662982165813446, 0.3264414668083191, 0.2806341052055359, 0.03356576710939407...
The IIS 6.0 is serving my Classical ASP pages in a serial fashion (one at a time) The #2 request will be handled by the web server only when the #1 request ends. If the #1 request takes a little longer, the #2 request will have to wait for the #1 ends to starts being handled by IIS. **Is this a missconfiguration in...
[ 0.04564550891518593, -0.07973256707191467, 0.704922080039978, -0.18775102496147156, -0.26811596751213074, -0.33769482374191284, 0.6828057765960693, -0.01891070045530796, -0.16553106904029846, -0.6445151567459106, -0.45347970724105835, 0.5047392249107361, -0.524211585521698, 0.3765130639076...