text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I'm compiling a C++ static library and as all the classes are templated, the class definitions and implementations are all in header files. As a result, it seems (under visual studio 2005) that I need to create a .cpp file which includes all the other header files in order for it to compile correctly into the library.
... | [
0.3306848704814911,
0.3281429409980774,
-0.02117850072681904,
0.009020048193633556,
-0.18647484481334686,
0.05231863632798195,
0.1359444558620453,
-0.07282979786396027,
-0.3081074655056,
-0.47560542821884155,
-0.1809161752462387,
0.4502194821834564,
-0.45591220259666443,
-0.077983081340789... | |
they're included, at the very location they're included. If the compiler should compile the headerfiles as well, you'd for example have multiple definitions on many things.
**Example, this is what the preprocessor sees:**
```
[foo.h]
void foo();
```
--
```
[mysource.cpp]
#include "foo.h"
int main()
{
foo();
}
... | [
0.12291689962148666,
0.2511518597602844,
0.19818700850009918,
-0.11522915214300156,
0.29974305629730225,
0.030418334528803825,
-0.036696042865514755,
-0.09645242244005203,
-0.43306654691696167,
-0.5002188682556152,
-0.6457592248916626,
0.5148990750312805,
-0.5198824405670166,
-0.0895083472... | |
*edited*
Given that the words "uncertain" and "uncertainty" are fairly ubiquitous, it's hard to Google "uncertainty arithmetic" and get anything immediately helpful. Thus, can anyone suggest a good library of routines, in almost any programming/scripting language, that implements handling of uncertain values, as per ... | [
-0.15478211641311646,
0.06632523238658905,
-0.06184830889105797,
0.041152555495500565,
0.04879971966147423,
-0.044019412249326706,
0.09102695435285568,
-0.16197696328163147,
-0.046073418110609055,
-0.3568834364414215,
0.04802131652832031,
0.6198868155479431,
-0.048593129962682724,
-0.30111... | |
my first choice for a supporting library. | [
0.27984482049942017,
0.05494896322488785,
-0.14289143681526184,
0.1321200132369995,
0.21143226325511932,
-0.04469025135040283,
-0.1499398946762085,
0.31220725178718567,
0.022975869476795197,
-0.3078322112560272,
0.050633616745471954,
0.1413477510213852,
0.23004773259162903,
0.0914138182997... | |
I would like to add a semi-transparent colour over the contents of a WPF window (to indicate the state of the window). Currently I am using a UserControl that fills the Window, and I change the Background colour and Visibility as required.
The problem with this method is when the UserControl is visible, I cannot click... | [
0.4695665240287781,
-0.011232379823923111,
0.4304192066192627,
-0.08468479663133621,
0.16453176736831665,
-0.03234336897730827,
0.6835870742797852,
-0.1377268135547638,
-0.18101300299167633,
-0.7204853892326355,
-0.04587592929601669,
0.4029290974140167,
-0.17017215490341187,
0.235360682010... | |
masking element.
```
<Grid>
<Button>Background Button</Button>
<Rectangle Fill="Blue" Opacity="0.25" IsHitTestVisible="False"/>
</Grid>
```
Try that XAML out in something like [Kaxaml](http://www.kaxaml.com). You will still be able to click the button, yet the blue rectangle will be presented over the top. It ... | [
-0.06796160340309143,
-0.21763359010219574,
0.19832895696163177,
0.06523855775594711,
0.11118347197771072,
-0.15505298972129822,
0.28009146451950073,
0.13216064870357513,
-0.08056482672691345,
-0.7331874966621399,
-0.3541768491268158,
0.2082565873861313,
-0.5283774733543396,
-0.05058953538... | |
i want to be able to create a copy of the element that i want to drag. im using the standard ui draggable and droppable. i know about the helper clone option. but that does not create a copy. the dragged item gets reverted back to the original position.
Mark,
Try this example:
```
$(document).ready(function()... | [
0.3091827630996704,
-0.2168581634759903,
0.5640354752540588,
0.0703723207116127,
0.38373473286628723,
-0.0940597653388977,
0.01703084260225296,
-0.16665023565292358,
-0.16473311185836792,
-0.5498791933059692,
-0.11161043494939804,
0.5684323310852051,
-0.38779589533805847,
0.137187033891677... | |
drop: function(event,ui){
console.log("Item was Dropped");
$(this).append($(ui.draggable).clone());
}
});
});
```
And the Html looks like this
```
<div class="objectDrag"
style="width:10%; color:white;border:black 1px solid; backgr... | [
0.10614164918661118,
-0.4157387614250183,
0.8339787721633911,
-0.11209599673748016,
0.0029276004061102867,
0.06820040941238403,
0.08124890178442001,
-0.09329473972320557,
-0.2938532531261444,
-0.27822721004486084,
-0.5039786100387573,
0.19649305939674377,
-0.4725022315979004,
-0.0018458017... | |
me</div>
<div id="garbageCollector" style="width:100%; height:400px; background-color:#333; color:white;"> Drop items on me</div>
``` | [
0.16355954110622406,
0.16872374713420868,
0.2303028106689453,
0.041104283183813095,
-0.03218713402748108,
0.27232295274734497,
0.20925606787204742,
-0.10254906117916107,
0.04523596540093422,
-0.32499000430107117,
-0.49835070967674255,
0.24521036446094513,
-0.042502738535404205,
0.111470259... | |
I am looking to pass an event to a helper function. This function will attach a method to the event. However, I am having trouble properly passing the event. I have tried passing a `EventHandler<TEventArgs>`. It compiles, but events are not attached (but are still added; it seems a copy of the event handler is made).
... | [
-0.20722028613090515,
0.18557651340961456,
0.5864571332931519,
-0.28096243739128113,
0.2807244062423706,
-0.09312763065099716,
0.4766600728034973,
-0.11976698786020279,
0.12672343850135803,
-0.7266278862953186,
-0.36724361777305603,
0.5832039713859558,
-0.36379116773605347,
0.3006075918674... | |
to a delegate creates a new delegate which is the combination of the old and the new. It does not modify the existing delegate.
In order to get this to work you will have to pass the delegate by reference.
```
public static void Helper(ref EventHandler<EventArgs> e)
{
e+= (x,y) => {};
}
```
The reason this wor... | [
0.2652936577796936,
-0.18725860118865967,
0.28646624088287354,
0.1818486899137497,
0.26307785511016846,
-0.19341246783733368,
0.0552879199385643,
-0.2988218069076538,
-0.19984307885169983,
-0.6045563817024231,
-0.41586872935295105,
0.21954099833965302,
-0.2760726511478424,
0.35489609837532... | |
I'm using the `NSURLConnection` class to download a large file in my iPhone application, but it crashes every so often because it's using too much memory. I'm doing the usual `NSURLConnection` usage, to append the received data to a `NSMutableData` object.
```
- (void)connection:(NSURLConnection *)connection didReceiv... | [
-0.320355623960495,
0.11654733866453171,
0.6102283596992493,
-0.20126116275787354,
0.21130679547786713,
0.0599483922123909,
0.4746135473251343,
0.21840724349021912,
-0.31699517369270325,
-0.803342342376709,
-0.5319201946258545,
0.6131049990653992,
-0.42306485772132874,
0.10936987400054932,... | |
NSString *tempFile = [tempPath stringByAppendingPathComponent:@"temp.pdf"];
[self.fileData writeToFile:tempFile atomically:YES];
NSData *mappedData = [NSData dataWithContentsOfMappedFile:tempFile];
NSURL *baseURL = [NSURL URLWithString:@"http://mydomain.com"];
[webView loadData:mappedData MIMEType:@"ap... | [
-0.008706482127308846,
-0.11149069666862488,
0.5538952946662903,
-0.018330901861190796,
0.11387186497449875,
-0.07089833915233612,
0.18987667560577393,
-0.18250738084316254,
-0.3968189060688019,
-0.7608135938644409,
-0.14046168327331543,
0.3246862590312958,
-0.06571007519960403,
0.02991241... | |
I wouldn't know under what keyword to look for this in the PHP database, so I'm asking here.
Reason I want to know is because of how different Operating Systems handle new lines in textdocuments.
I'm using a CSV file in windows but each time I think I add a new line, what really happens is the new line gets pasted to... | [
0.2921835482120514,
0.2023136019706726,
0.5365866422653198,
-0.052044667303562164,
-0.12799078226089478,
-0.04383010417222977,
0.09191623330116272,
0.22317937016487122,
-0.3429672122001648,
-0.7492218613624573,
0.19364318251609802,
0.26992958784103394,
-0.31619760394096375,
0.1163815036416... | |
so I can implement a simple `if()` statement and solve this. Currently I've hardcoded the `\r\n`, but it should be simpler, no?
PHP has included the constant [PHP\_EOL](http://us3.php.net/manual/en/reserved.constants.php) for solving the problem you face, available since php 4.3.10 and PHP 5.0.2 - it contains a suitabl... | [
0.0004636674711946398,
-0.024855146184563637,
0.6343767642974854,
-0.011897810734808445,
-0.06293058395385742,
0.17978739738464355,
0.12476785480976105,
0.12211248278617859,
-0.1800735741853714,
-0.45762020349502563,
-0.026935290545225143,
0.465084969997406,
-0.1977785974740982,
0.08123172... | |
Here is what I currently have so far:
```
void WriteHexToFile( std::ofstream &stream, void *ptr, int buflen, char *prefix )
{
unsigned char *buf = (unsigned char*)ptr;
for( int i = 0; i < buflen; ++i ) {
if( i % 16 == 0 ) {
stream << prefix;
}
stream << buf[i] << ' ';
... | [
0.08978332579135895,
0.1485634297132492,
0.6233169436454773,
-0.45775794982910156,
0.5325948596000671,
0.492859810590744,
0.2593299150466919,
-0.47592875361442566,
-0.09835874289274216,
-0.7513439059257507,
0.02557828463613987,
0.6918781995773315,
-0.46442529559135437,
-0.31359627842903137... | |
), as well as searching Google for a bit. I've also tried:
```
stream << stream.hex << (int)buf[i] << ' ';
```
But that doesn't seem to work either.
Here is an example of some output that it currently produces:
```
Í Í Í Í Í Í Í Í Í Í Í Í Í Í Í Í
Í Í Í Í Í Í Í Í Í Í Í Í Í Í Í Í
Í Í Í Í Í Í Í Í Í Í Í Í Í Í Í Í
Í... | [
-0.3060092031955719,
-0.0027146697975695133,
0.17233310639858246,
-0.06472737342119217,
-0.12361256033182144,
0.33018890023231506,
0.33701783418655396,
0.3615380525588989,
-0.09775988757610321,
-0.823114812374115,
0.19571518898010254,
0.11865153908729553,
0.06876237690448761,
0.68203186988... | |
Í Í Í Í Í Í Í Í Í Í Í Í Í Í
Í Í Í Í Í Í Í Í Í Í Í Í Í Í Í Í
```
I would like the output to look like the following:
```
FF EE DD CC BB AA 99 88 77 66 55 44 33 22 11 00
FF EE DD CC BB AA 99 88 77 66 55 44 33 22 11 00
FF EE DD CC BB AA 99 88 77 66 55 44 33 22 11 00
FF EE DD CC BB AA 99 88 77 66 55 44 33 22 11 00
FF | [
0.07954683899879456,
0.547923743724823,
0.31168133020401,
-0.12408792972564697,
-0.6879531145095825,
0.5619813799858093,
0.31707528233528137,
-0.20432797074317932,
0.03945796191692352,
-0.4056406319141388,
0.012602913193404675,
0.5123536586761475,
-0.0891588106751442,
0.28563976287841797,
... | |
EE DD CC BB AA 99 88 77 66 55 44 33 22 11 00
FF EE DD CC BB AA 99 88 77 66 55 44 33 22 11 00
```
```
#include <iostream>
using namespace std;
int main() {
char c = 123;
cout << hex << int(c) << endl;
}
```
**Edit:** with zero padding:
```
#include <iostream>
#include <iomanip>
using namespace std;
int main(... | [
0.43908265233039856,
0.13366997241973877,
0.5874620079994202,
-0.39275941252708435,
0.23917722702026367,
0.5106502771377563,
0.32594722509384155,
-0.376386433839798,
-0.2723570168018341,
-0.4140852391719818,
-0.237918883562088,
0.7475691437721252,
-0.6934124827384949,
-0.3974952697753906,
... | |
i'm using C# and i'm trying to allow only alphabetical letters and spaces. my expression at the moment is:
```
string regex = "^[A-Za-z\s]{1,40}$";
```
my IDE says that \s is an "Unrecognized escape sequence"
what am i missing?
"\" is a c# escape character as well as a regex escape character. Try:
```
string regex... | [
-0.1947811394929886,
0.2746760845184326,
0.05003103241324425,
-0.1762072741985321,
0.4118161201477051,
0.10369006544351578,
0.460162878036499,
-0.2622393071651459,
-0.19153693318367004,
-0.2844943106174469,
-0.46872803568840027,
0.5432901978492737,
-0.6535300612449646,
0.09563304483890533,... | |
I have created a Windows Shell Extension using ATL (Visual Studio 2008). It has the following modules and each module is a separate ATL Simple Object with its own .rgs file for registration:-
1. IShellFolder/IShellView -> For a virtual drive in windows explorer
2. IContextMenu/IShellExtInit -> For a popup menu files a... | [
0.05810459330677986,
0.0355243943631649,
0.8915232419967651,
-0.1540440320968628,
-0.09631817042827606,
-0.14303430914878845,
0.163749098777771,
-0.3227784037590027,
-0.25065016746520996,
-0.7241452932357788,
0.023721765726804733,
0.8745678663253784,
-0.11992304772138596,
0.277018427848815... | |
method calls for (2) and (4). The drive gets created in Windows Explorer but the underlying methods are not called when I click it.
Although when I right click I get called for (2) and when I select "Properties" for a file or folder I get into the code for (4).
Is there some interface that I am missing for (1) and (3)... | [
0.0177661944180727,
-0.025724975392222404,
0.471377968788147,
0.08677193522453308,
0.08348946273326874,
-0.11024615168571472,
0.01637079194188118,
-0.4363759160041809,
-0.009591847658157349,
-0.5432417392730713,
0.31951168179512024,
0.8116481900215149,
-0.38527294993400574,
-0.016391087323... | |
was has problems when Release() was called on it.
Check this link
[Internet Explorer crashes when MSXML2::IXMLDOMDocumentPtr -> Release() is called](https://stackoverflow.com/questions/641896/internet-explorer-crashes-when-msxml2ixmldomdocumentptr-release-is-called) | [
-0.21295641362667084,
-0.25787603855133057,
0.4894830882549286,
0.0016290537314489484,
-0.13088054955005646,
-0.2637355625629425,
0.11762256920337677,
0.055251237004995346,
-0.13559159636497498,
-0.2649233043193817,
-0.2147931158542633,
0.34210312366485596,
-0.43488603830337524,
0.12913715... | |
I'm searching the pattern `(.*)\\1` on the text `blabl` with `regexec()`. I get successful but empty matches in `regmatch_t` structures. What exactly has been matched?
The regex .\* can match successfully a string of zero characters, or the nothing that occurs between adjacent characters.
So your pattern is matching ... | [
0.13811631500720978,
0.14427579939365387,
0.382480651140213,
-0.1231805682182312,
0.13198482990264893,
0.16593687236309052,
0.11198580265045166,
-0.10021576285362244,
-0.16994749009609222,
-0.4853602349758148,
-0.043288521468639374,
0.682008683681488,
-0.307856023311615,
-0.151984304189682... | |
should match the 'oo' in 'foo') | [
0.1759236603975296,
0.6002904772758484,
0.4424743354320526,
-0.6516245603561401,
0.08090857416391373,
0.23323357105255127,
0.18628306686878204,
0.33885571360588074,
0.06110875681042671,
0.14961059391498566,
-0.5151612758636475,
0.37200120091438293,
-0.3591578006744385,
-0.40212610363960266... | |
Performance and Design wise what would be the pros and cons
Using a sealed class and events or using a abstract class with a virtual function?
there will only be one listener to the events...
You shouldn't worry too much about performance in terms of abstract classes, inheritance, and event subscription. These are la... | [
0.5251462459564209,
0.0840400755405426,
-0.09733167290687561,
0.26815569400787354,
-0.29090163111686707,
-0.16918352246284485,
0.2830222547054291,
-0.18203459680080414,
-0.021219046786427498,
-0.6628190875053406,
0.07479239255189896,
0.9044759273529053,
-0.036356981843709946,
-0.3145929276... | |
doing a lot of repetitive or iterative tasks.
* **[Reference Types](http://msdn.microsoft.com/en-us/library/490f96s2.aspx) vs. [Value Types](http://msdn.microsoft.com/en-us/library/s1ax56ch.aspx)** - Objects created as "structs" are stored by value. This means that the entire value of the object is passed around when s... | [
0.07359098643064499,
-0.03479890897870064,
0.1647767722606659,
0.262349009513855,
-0.3349173665046692,
0.1826316863298416,
0.38175129890441895,
-0.16068850457668304,
-0.3870294392108917,
-0.7611483931541443,
-0.09453438222408295,
0.0783175379037857,
-0.2941998541355133,
0.3769640326499939,... | |
allocated to the heap, it's lifespan in memory is less deterministic.
* **[Subscribing/unsubscribing to events](http://msdn.microsoft.com/en-us/library/aa970850.aspx)** - This is not so much a performance issue as just a general development mistake. Objects will not be GC'ed unless all events are unsubscribed from. If ... | [
-0.02972554787993431,
-0.11393805593252182,
-0.1735621690750122,
0.35230717062950134,
-0.42787590622901917,
-0.2853921353816986,
0.4260381758213043,
-0.01904706470668316,
-0.6232534050941467,
-0.6283354759216309,
-0.2536265552043915,
0.4441934823989868,
-0.12813551723957062,
0.210837423801... | |
not a performance concern.
Generally, code *structure* is more important to worry about. Think about how you're working with your data and what patterns you use that could be heavy to execute. | [
0.5873294472694397,
0.036609064787626266,
-0.3752787411212921,
0.24096645414829254,
-0.1889086812734604,
-0.20970305800437927,
0.43468791246414185,
-0.05414644628763199,
-0.4436994791030884,
-0.7395898103713989,
-0.14455033838748932,
0.42689886689186096,
-0.07118100672960281,
-0.3109325468... | |
What information have you been able to gather regarding how do the amazon web services work?
* What hardware do they use
* What web server
* What Operating System
* What storage for AWS
* What virtualization software for EC2/EBS
* What software for they distributed firewall for EC2
* Physical location of their data ce... | [
0.6476534605026245,
-0.1514437198638916,
0.05881108343601227,
0.43083682656288147,
-0.190130352973938,
0.059418972581624985,
0.017850060015916824,
0.20234036445617676,
-0.40087008476257324,
-0.7107377052307129,
0.30764657258987427,
0.37721118330955505,
0.46924400329589844,
0.07475610822439... | |
I just rolled a small web application into production on a remote host. After it ran a while, I noticed that MS SQL Server started to consume most of the RAM on the server, starving out IIS and my application.
I have tried changing the "server maximum memory" setting, but eventually the memory usage begins to creep a... | [
0.35564762353897095,
0.4427216947078705,
0.19824831187725067,
-0.1431606411933899,
0.18855521082878113,
-0.11168280243873596,
0.27064573764801025,
0.3381688892841339,
-0.37681594491004944,
-0.7095760107040405,
0.33108779788017273,
0.41971755027770996,
-0.1531357318162918,
0.522512793540954... | |
think it means. I do note that if I simply restart the server, the process of memory consumption starts over without any adverse impact on the application - pages load without incident, all retrievals work.
There has got to be a better way to control sql or force it to release some memory back to the system????
From ... | [
0.4038580656051636,
-0.051075465977191925,
0.5766610503196716,
0.1488523632287979,
0.3877570927143097,
0.11309458315372467,
0.3792872428894043,
0.025766093283891678,
-0.22191506624221802,
-0.4561464190483093,
0.08905670791864395,
0.574509859085083,
-0.10864439606666565,
0.07878681272268295... | |
for allocations of other
> components such as extended stored
> procedures, COM objects, non-shared
> DLLs, EXEs, and MAPI components.
> Because of the preceding allocations,
> it is normal for the SQL Server
> private bytes to exceed the max server
> memory configuration.
Are you using any extended stored proc... | [
0.20279811322689056,
-0.16498495638370514,
0.1668202430009842,
0.3375388979911804,
0.22417621314525604,
-0.2529933750629425,
0.050633955746889114,
-0.13525469601154327,
-0.5144100785255432,
-0.46254366636276245,
-0.0797765851020813,
0.4993196129798889,
-0.12352631241083145,
0.0905436873435... | |
I have a Java program that stores a lot of mappings from Strings to various objects.
Right now, my options are either to rely on hashing (via HashMap) or on binary searches (via TreeMap). I am wondering if there is an efficient and standard trie-based map implementation in a popular and quality collections library?
... | [
-0.03169660642743111,
0.021934574469923973,
-0.10131149739027023,
0.22672076523303986,
-0.03258923441171646,
-0.14143921434879303,
-0.013503544963896275,
0.06811283528804779,
-0.3014482855796814,
-0.921465277671814,
0.0008391254232265055,
0.14857010543346405,
-0.06595200300216675,
0.059740... | |
many shared prefixes.
You might want to look at the [Trie implementation that Limewire is contributing](https://github.com/google/guava/issues/10) to the Google Guava. | [
0.12868133187294006,
0.13231715559959412,
-0.21199077367782593,
0.2720012664794922,
-0.3261832892894745,
0.07784125208854675,
-0.1282903552055359,
0.30232906341552734,
-0.30472150444984436,
-0.5011504292488098,
0.05907755345106125,
0.1907789707183838,
-0.17926636338233948,
0.16466772556304... | |
Is there a more succinct way to define a class in a namespace than this:
```
namespace ns { class A {}; }
```
I was hoping something like `class ns::A {};` would work, but alas not.
You're close, you can forward declare the class in the namespace and then define it outside if you want:
```
namespace ns {
class ... | [
-0.23240546882152557,
0.09881022572517395,
0.027789531275629997,
-0.06660065054893494,
-0.27261435985565186,
0.055571820586919785,
0.32262110710144043,
-0.18598972260951996,
-0.4181421399116516,
-0.5314599275588989,
-0.08857783675193787,
0.30896061658859253,
-0.22274820506572723,
0.1940945... | |
the One Definition Rule (or somesuch nonsense). | [
0.25114190578460693,
-0.18470929563045502,
-0.09610161185264587,
0.2616283595561981,
-0.11293120682239532,
-0.591673731803894,
0.1851203888654709,
-0.13858525454998016,
0.12937995791435242,
-0.23731791973114014,
-0.01807507872581482,
0.48709070682525635,
-0.617004930973053,
0.1819964051246... | |
I am trying to create a model for a ruby on rails project that builds relationships between different words. Think of it as a dictionary where the "Links" between two words shows that they can be used synonymously. My DB looks something like this:
```
Words
----
id
Links
-----
id
word1_id
word2_id
```
How do I crea... | [
0.06577920913696289,
0.2966615855693817,
-0.06480268388986588,
-0.15110309422016144,
-0.33850303292274475,
-0.22154304385185242,
0.34159335494041443,
0.028469013050198555,
0.15740375220775604,
-0.7284287810325623,
0.17548947036266327,
0.4272306263446808,
-0.32538551092147827,
0.27443963289... | |
Try this for the Word model:
```
class Word < ActiveRecord::Base
has_many :links, :dependent => :destroy
has_many :synonyms, :through => :links
end
```
Link model:
```
class Link < ActiveRecord::Base
belongs_to :word
belongs_to :synonym, :class_name => 'Word'
# Creates the complementary link automaticall... | [
0.0393400639295578,
-0.32470953464508057,
0.34561702609062195,
-0.12291666120290756,
0.007484173867851496,
-0.32272201776504517,
0.2883610129356384,
-0.5213224291801453,
-0.09470266848802567,
-0.5954589247703552,
-0.03967702388763428,
0.5800847411155701,
-0.34036684036254883,
0.32550621032... | |
complement.destroy
end
end
protected
def find_complement
Link.find(:first, :conditions =>
["word_id = ? and synonym_id = ?", synonym.id, word.id])
end
end
```
Tables:
```
Words
----
id
Links
-----
id
word_id
synonym_id
``` | [
-0.10963892936706543,
0.20645180344581604,
0.39784368872642517,
0.05050606653094292,
-0.08366993069648743,
-0.34249448776245117,
0.43770545721054077,
-0.15978357195854187,
0.13497039675712585,
-0.5500475168228149,
-0.27288618683815,
0.5317848324775696,
-0.28194400668144226,
0.4366529285907... | |
When I was a Linux admin I could do anything from the SSH command line. Now, as a Windows admin, I have to deal with the Windows Remote Desktop graphical interface, which I found to be inefective (slow) and hard to automate tasks in it.
a) Can I connect to a Windows Server through SSH or any encrypted connection with ... | [
0.4249718487262726,
0.15471576154232025,
0.23056012392044067,
-0.05865968018770218,
-0.01207591500133276,
-0.3709750473499298,
0.5108292698860168,
-0.01338445208966732,
-0.29455265402793884,
-0.8195175528526306,
-0.21855026483535767,
0.6939342021942139,
-0.2513868510723114,
0.2971522510051... | |
know if it fullfills all conditions above
My conclusion so far: from Windows PowerShell can do MOST but not ALL administrative tasks. And I still don't know if Windows PowerShell 2.0 Remoting uses an encrypted connection.
**PowerShell** is what you're looking for. It is primarily targetted at **system administration**... | [
-0.026204893365502357,
-0.27446743845939636,
0.5714587569236755,
0.4050638675689697,
0.08233322948217392,
-0.6824610233306885,
0.02413102053105831,
0.06912801414728165,
-0.4270723760128021,
-0.6293894648551941,
-0.22406697273254395,
0.3999846875667572,
-0.34227606654167175,
0.0201864317059... | |
to administer them. PowerShell's WMI support is excellent, giving you a lot of machine administration power. PowerShell can talk to .NET directly, which lets you go further than built-in facilities when needed. And writing C# for PowerShell to call works out cleanly, too.
You asked for a command line interface, but do... | [
0.10924296081066132,
0.08933869004249573,
0.3012390434741974,
0.22534483671188354,
-0.01566239818930626,
-0.40893933176994324,
-0.24226173758506775,
0.1693575531244278,
-0.13728375732898712,
-0.4615640342235565,
-0.07343357056379318,
0.9754087924957275,
-0.1200990155339241,
-0.104064904153... | |
I've read plenty of articles about tuning GC in Java and have often wondered how many people *really* use some of the more advanced features.
I've always avoided tuning where possible and concentrated on writing the simplest possible code I can (Brian Goetz's advice) - this seems to have worked well for me so far.
Ar... | [
0.8411559462547302,
0.20211349427700043,
-0.17557381093502045,
-0.07874859124422073,
0.0433269664645195,
0.0463327132165432,
0.41886088252067566,
-0.18809348344802856,
0.10661361366510391,
-0.5916797518730164,
0.10670240968465805,
0.7125550508499146,
-0.06226200610399246,
-0.03901771828532... | |
with a large amount of memory (currently around 8 Gb), mostly due to ongoing calculations with lots of cached data. I did the initial deployment with the standard GC setup , mostly because there wasn't a simple way to simulate the production environment running at full tilt.
In stages, over the next few months, I've ... | [
0.06415916979312897,
0.21015366911888123,
0.6295731067657471,
-0.05005680024623871,
0.03412029519677162,
-0.030335936695337296,
-0.042343296110630035,
0.04796930402517319,
-0.4333110451698303,
-0.3178943991661072,
-0.048319075256586075,
0.7290481925010681,
0.051147524267435074,
0.121255345... | |
performance improvements.
I'm not going to post my specific settings because a) they're specific to our setup, and b) because I don't have them handy :). But in general, what I've found is
* there's been a lot of work done in
tuning the default gc settings.
*Almost* always the defaults work better than any tweaks I ... | [
-0.06807230412960052,
0.009959831833839417,
0.3368283808231354,
-0.000345717795426026,
0.14753484725952148,
0.005550714675337076,
0.24215324223041534,
-0.10422245413064957,
-0.3014868497848511,
-0.6658276319503784,
-0.09193708747625351,
0.8301532864570618,
0.06962601095438004,
-0.229861065... | |
I'm using calendar from Yahoo UI as follows:
> calDate = (calDate.getMonth() + 1) +
> '/' + calDate.getDate() + '/' +
> calDate.getFullYear();
This displays a `MMDDYYYY` format.
I want to change this format to `YYYY-MM-DD` so that I can insert it into a MySQL database.
I changed the code to:
> calDate = calDate.g... | [
0.45299452543258667,
-0.12619425356388092,
0.5955304503440857,
-0.2589222192764282,
-0.20465315878391266,
0.32810717821121216,
0.03192441537976265,
-0.050474297255277634,
-0.2311222404241562,
-0.8497694730758667,
0.4008094072341919,
0.5939096212387085,
-0.017592493444681168,
0.280509233474... | |
the server side, let the client side have the format that it wants, and change the date around later. | [
0.29971083998680115,
-0.18634076416492462,
0.6209408640861511,
0.2514796555042267,
0.23381590843200684,
-0.28696733713150024,
-0.3394019901752472,
0.5120280385017395,
-0.01630334183573723,
-0.6704748868942261,
-0.3563431203365326,
0.4533911645412445,
0.22681915760040283,
0.1079474091529846... | |
I'm new to Java. I'm simply trying to build a .jar file of my applet so I can run it from my browser. This is what my directory structure looks like:
```
C:\java\pacman\src
```
contains all of the .java class files.
```
C:\java\pacman\assets
```
contains about 4-5 images and audio files.
If I try to use the fol... | [
0.2966300845146179,
0.2911110520362854,
0.4729922115802765,
-0.30014193058013916,
0.0732823982834816,
0.003365330398082733,
0.6417797207832336,
-0.40562132000923157,
-0.32191920280456543,
-0.9538617134094238,
0.0379256047308445,
0.7576063871383667,
-0.3666088581085205,
0.08988450467586517,... | |
it into run and hit enter:
So to avoid myself a lot of headache i commented out the code in my ImgHelper class and did this:
```
public ImgHelper(String dir)
{
//this.imgDir=dir;
imgDir="C:\\java\\pacman\\assets\\";
}
```
Which works perfectly. But I want to put this on a web server, and I have no idea how/... | [
0.4238097071647644,
0.048607997596263885,
0.21463488042354584,
-0.006077768746763468,
0.10120998322963715,
-0.1797947883605957,
0.4084804952144623,
-0.05105728283524513,
-0.051088474690914154,
-0.8425600528717041,
0.09899686276912689,
0.7639299035072327,
-0.34537896513938904,
0.06908346712... | |
more flexible to use a Stream than a File.
getResourceAsStream will work when the files are not in a JAR as well, they need to be relative to the class file.
EDIT:
Another thing, the File method won't work if the applet is on a server as it will be trying to open the file from the local machine (I think, I haven't ... | [
0.26084452867507935,
-0.38483139872550964,
0.25938230752944946,
0.1914006620645523,
-0.1490413248538971,
-0.14330999553203583,
0.07278182357549667,
0.145975723862648,
-0.40735387802124023,
-0.8938245177268982,
0.13670510053634644,
0.729684054851532,
-0.16806219518184662,
0.0906774625182151... | |
Before the introduction to generics to the Java language I would have written classes encapsulating collections-of-collections-of-collections. For example:
```
class Account {
private Map tradesByRegion; //KEY=Region, VALUE=TradeCollection
}
class TradeCollection {
private Map tradesByInstrument; //KEY=Instrume... | [
0.04510026425123215,
-0.42794808745384216,
0.3282204866409302,
0.03313234820961952,
-0.14334967732429504,
-0.11777106672525406,
0.11562362313270569,
-0.1660623699426651,
-0.5909662246704102,
-0.6181097030639648,
0.14947478473186493,
0.6043118834495544,
-0.5384383201599121,
0.29922336339950... | |
how many nested collections should I use before declaring new classes). Opinions?
2 is better because:
* Less code accomplishes the same
effect (better, actually, as in #1
some of your type information exists
only in comments)
* It's completely clear what's going
on.
* Your type errors will be caught at compile time.
... | [
0.1724548637866974,
-0.11113584786653519,
-0.009324113838374615,
0.2400098741054535,
-0.4896933138370514,
-0.06710341572761536,
0.3256623148918152,
-0.18864917755126953,
-0.2547469437122345,
-0.8154305815696716,
0.18541651964187622,
0.5579601526260376,
-0.279792457818985,
-0.12226318567991... | |
lists of maps. | [
-0.15629209578037262,
0.22656261920928955,
0.2545144855976105,
0.13992106914520264,
0.10617247968912125,
0.19945628941059113,
0.037584636360406876,
0.10586151480674744,
-0.5237225890159607,
-0.6833556294441223,
0.0848877876996994,
-0.1858239322900772,
0.054017361253499985,
0.08384520560503... | |
Do you know of a Java library to access the native linux api?
I guess something like this must use JNI. So be it.
Have a look at [JNA.](https://github.com/twall/jna)
Here is the summary of JNA from their home page.
> JNA provides Java programs easy access to native shared libraries (DLLs on Windows) without writing ... | [
0.2775663137435913,
-0.12802943587303162,
-0.29077979922294617,
-0.1624373495578766,
-0.418722003698349,
-0.1837412714958191,
0.39760634303092957,
-0.01667439006268978,
-0.35514912009239197,
-0.6721349358558655,
-0.030942071229219437,
0.4534008800983429,
-0.07908269017934799,
-0.0165436081... | |
how can i command to run file.exe file from another computer in my domain with C#
I know System.Diagnostic.Process.Start but its starting in my computer.
How can i use it for "192.168.100.2" ip addressed computer for running an exe file from my comp with a command? I know TCP/Socket programming but else ?
[PsExec](htt... | [
0.4401085674762726,
-0.2356269508600235,
0.27248939871788025,
0.2436976134777069,
0.15719306468963623,
-0.2615550756454468,
0.09476297348737717,
0.14000844955444336,
-0.247934028506279,
-0.8110175728797913,
-0.11058474332094193,
0.5451902151107788,
-0.12279359996318817,
0.2310197949409485,... | |
I have a Java app that runs on linux that has a lots of events and business logic that revolve around times and dates.
For testing, is it possible to tweak something into time going faster. Let's say, make a whole computer-year finish in one hour wall time?
You can write a wrapper interface for your time/date calls. H... | [
0.5859672427177429,
0.12356296181678772,
-0.06032433360815048,
0.23009717464447021,
0.1546269953250885,
0.006672597024589777,
-0.024438833817839622,
0.12335889041423798,
-0.08004554361104965,
-0.5712978839874268,
0.5265018939971924,
0.25335055589675903,
0.12073738127946854,
0.2441073954105... | |
I wonder if there is a .NET library that mimics a browser in terms of HTTP transactions. In other words I am going to make multiple GET/POST requests and I want the cookies to be persisted to a storage, so that consecutive request will be identified by the remote host. AFAIK [cURL](http://curl.haxx.se/) has support for... | [
0.33434125781059265,
-0.03663506731390953,
0.48921138048171997,
-0.019667210057377815,
-0.013798464089632034,
-0.2475140541791916,
0.3117729723453522,
-0.1619095802307129,
-0.4235490560531616,
-0.6044631004333496,
0.10781113058328629,
0.4217998683452606,
-0.21086591482162476,
0.34363916516... | |
I am trying to read a UTF8 string via a java.nio.ByteBuffer. The size is an unsinged int, which, of course, Java doesn't have. I have read the value into a long so that I have the value.
The next issue I have is that I cannot create an array of bytes with the long, and casting he long back to an int will cause it to b... | [
0.16389916837215424,
-0.0107890535145998,
0.2258310765028,
-0.2576424777507782,
-0.0035549690946936607,
-0.1179531067609787,
0.3668678402900696,
0.1226799488067627,
-0.2406189739704132,
-0.6115440726280212,
0.11890476197004318,
0.4030032455921173,
-0.14381790161132812,
0.30764394998550415,... | |
has more in it that just the UTF8 string.
Any ideas on how to read a UTF8 string that has a potential length of an unsigned int from a ByteBuffer.
EDIT:
[Here is an example of the issue](http://java.sun.com/j2se/1.4.2/docs/guide/jpda/SourceDebugExtension_attribute.html).
```
SourceDebugExtension_attribute {
... | [
-0.15147367119789124,
0.011344116181135178,
0.40200233459472656,
0.18347357213497162,
-0.22253507375717163,
-0.10742489993572235,
0.007794681936502457,
-0.33068886399269104,
-0.1955861896276474,
-0.2252817302942276,
-0.04834440350532532,
0.5471042990684509,
-0.06697674840688705,
0.21432973... | |
The value of the attribute_length item indicates the length of the attribute, excluding the initial six bytes. The value of the attribute_length item is thus the number of bytes in the debug_extension[] item.
debug_extension[]
The debug_extension array holds a string, which must be in UTF-8 format. There is no ter... | [
-0.09299716353416443,
-0.010842787101864815,
0.35768574476242065,
-0.17163501679897308,
0.009759671986103058,
-0.06353321671485901,
0.03742660954594612,
-0.34776657819747925,
-0.2963642179965973,
-0.13902297616004944,
-0.39825642108917236,
0.44276556372642517,
-0.3107122480869293,
0.166050... | |
class file that is the full u4 (unsigned, 4 bytes) in length.
These won't be an issue if there is a limit to the size of a UTF8 string (I am no UTF8 expert so perhaps there is such a limit).
I could just punt on it and go with the reality that there is not going to be a String that long...
Unless your array of bytes... | [
0.18800276517868042,
-0.31868091225624084,
-0.019281836226582527,
-0.05453072488307953,
-0.11895187944173813,
-0.11870133876800537,
0.40142592787742615,
0.1513143926858902,
-0.35815250873565674,
-0.6644436120986938,
0.06243040785193443,
0.5377939343452454,
-0.13004234433174133,
0.256314635... | |
than 2GB in length, you're doing it wrong, not least because that's way more than the default maximum heapsize of the JVM... | [
0.03386658430099487,
-0.07367340475320816,
0.0030245748348534107,
0.13767752051353455,
-0.21049486100673676,
-0.26986655592918396,
0.29160112142562866,
-0.0567166693508625,
-0.4974655508995056,
-0.4178899824619293,
0.050336070358753204,
0.23438076674938202,
0.08913705497980118,
0.029994381... | |
What component should I use to display a PDF file in a Delphi 2009 application?
EDIT:
I have been using [PDF Viewer](http://www.synactis.com/pdf-viewer.htm) by Synactis - a very nice free PDF Viewer
But it has no Delphi 2009 support.
So I need to designing it out of the product
We embedded the Acrobat Reader in our ... | [
-0.18848294019699097,
-0.17460794746875763,
0.6202139258384705,
0.0005398247158154845,
-0.1468980610370636,
-0.17190878093242645,
0.026505813002586365,
-0.26006561517715454,
-0.1120939776301384,
-0.26923638582229614,
-0.10520155727863312,
0.8417129516601562,
-0.6011239886283875,
-0.2688626... | |
your form
OpenDialog1.Filter := 'PDF Files (*.pdf)|*.pdf';
if OpenDialog1.Execute then
Pdf1.src := OpenDialog1.FileName;
end;
```
There is native Delphi components out there but embedding the Acrobat Reader component served our needs. | [
0.035036079585552216,
-0.20079918205738068,
0.633881688117981,
0.08493655174970627,
-0.23433299362659454,
-0.2826421856880188,
0.23888573050498962,
-0.2010592669248581,
0.10976425558328629,
-0.7753477692604065,
-0.20827867090702057,
0.631644606590271,
-0.5481188297271729,
-0.29647812247276... | |
I am working on a Django app. One of my models, "User", includes a "gender" field, as defined below:
```
GENDER_CHOICES = (
('M', 'Male'),
('F', 'Female'),
)
gender = models.CharField(max_length=1, choices=GENDER_CHOICES, null=True)
```
I am using a ModelForm to generate a "new user" HTML form. M... | [
0.07860337942838669,
0.4010681211948395,
0.2315843552350998,
-0.21959781646728516,
-0.030687270686030388,
0.32513925433158875,
0.1670588254928589,
-0.1505252569913864,
0.1065661683678627,
-0.6428418755531311,
-0.0611548013985157,
0.365526407957077,
-0.3453068137168884,
0.000386019295547157... | |
then pass an 'initial' dictionary to the constructor of your model form using the name of your field as the key:
```
form = MyModelForm (initial={'gender':'M'})
```
-OR-
You can override certain attributes of a ModelForm using the declarative nature of the Forms API. However, this is probably a little cumbersome fo... | [
0.05593224987387657,
-0.03301505744457245,
0.3531576097011566,
0.18167489767074585,
-0.036376431584358215,
-0.006116502918303013,
0.047803495079278946,
-0.2789295017719269,
0.30087974667549133,
-0.6298815608024597,
-0.3048650026321411,
0.6112339496612549,
-0.16352401673793793,
-0.024598756... | |
ModelForm that is bound to a particular instance of your model, you can pass an 'instance' of your model which causes Django to pull the selected value from that model.
```
form = MyModelForm (instance=someinst)
``` | [
0.11386097967624664,
-0.17361946403980255,
0.3665614724159241,
-0.09479058533906937,
-0.04224478825926781,
-0.40600454807281494,
0.14738039672374725,
0.09598924219608307,
0.0005214533885009587,
-0.7920888066291809,
-0.04225229099392891,
0.5011444687843323,
-0.3758373260498047,
0.2257446199... | |
I am developing publishing site and it will have complex tree structure.
Is there any way to deploy site structure (multiple sub sites - SPWeb) using SharePoint solution?
I know I can create site tree programmatically.
I have been on a project with the same needs, but we didn't find the answer with the OOTB funct... | [
0.4972844123840332,
0.24795228242874146,
0.21597692370414734,
-0.006628031376749277,
-0.04702432453632355,
-0.32528984546661377,
-0.07382995635271072,
0.09790834039449692,
-0.184124156832695,
-0.6342343091964722,
0.024733424186706543,
0.32463228702545166,
-0.21160148084163666,
0.3237159550... | |
as input. The xml defines the site structure and is read by the feature receiver which parses it and creates the specified sites.
I know that there is some coding involved in this solution, but I think the extra work is well spent, since the site structure will likely change numerous times before it reaches production... | [
0.5642250776290894,
0.0964309498667717,
0.40721023082733154,
-0.19389066100120544,
0.04334612563252449,
0.053227249532938004,
-0.09764780849218369,
-0.048142194747924805,
0.08745529502630234,
-0.8040943145751953,
-0.5429739356040955,
0.41251882910728455,
-0.0012800261611118913,
-0.00600127... | |
OKay, I'm from a PHP background, but I've just been tasked with developing some custom Web Parts in SharePoint. I've figured out how to create and deploy a basic "Hello world" web part in VB. Okay so far.
What I'm stuck on is a really basic, stupid point - how the hell do I lay out things in a VB web part?
For an exa... | [
0.31257709860801697,
0.2309231013059616,
0.39346107840538025,
-0.0415014922618866,
-0.14269337058067322,
-0.1909884512424469,
0.23518776893615723,
-0.13002637028694153,
-0.09738612174987793,
-0.697383463382721,
0.1393808275461197,
0.25536656379699707,
-0.24743658304214478,
0.36197310686111... | |
than running one after the other as they do now? In PHP I'd just wrap them in some top break them onto differnt lines, but how do I do it here?
There are a number of ways to go about it. The easiest, if you really just want the controls to appear on different lines would be to add an ASP.net [LiteralControl](http://msd... | [
0.21470479667186737,
-0.0005508540780283511,
0.2871952950954437,
0.08508681505918503,
-0.3851931095123291,
-0.09046448022127151,
0.020018789917230606,
-0.26455000042915344,
-0.3722946047782898,
-0.534407377243042,
0.13242314755916595,
0.47362276911735535,
-0.15300670266151428,
-0.099675238... | |
formatting based on style-sheets you can use.
The last method, and the most customizable, but hardest to maintain and change, would be to override the webpart's Render method and generate your HTML completely by hand in the WebPart.
Alternately, you could scrap this altogether, and employ the [SmartPart](http://www.c... | [
0.501470148563385,
-0.12929394841194153,
0.59535813331604,
0.35372957587242126,
-0.29722142219543457,
-0.09686793386936188,
-0.0762171596288681,
-0.3417350947856903,
-0.17510248720645905,
-0.8521095514297485,
-0.09397399425506592,
0.4351953864097595,
-0.39151933789253235,
-0.08391878753900... | |
Hello i have recently started using vim editor ( actually the plugin for netbeans ) and i am having trouble with the pastebin.
What would happen is i would yunk something in, and then do some deletes with dd and so i lose my initial yunk content. So for me as a beginner with vim its very confusing that delete actuall... | [
0.36246657371520996,
-0.07213912159204483,
0.3320683538913727,
0.0875394344329834,
-0.5593039989471436,
-0.024353094398975372,
0.3178306519985199,
0.30371496081352234,
-0.16052605211734772,
-0.8234972357749939,
0.1924268901348114,
0.42947548627853394,
0.050567690283060074,
0.33081829547882... | |
something in, and then do some deletes with dd and so i lose my initial yunk content.
No, you don't. Your yunked text is in register `"0`.
`:help "0` for more info. | [
0.06665542721748352,
0.049784108996391296,
0.7448388934135437,
0.23558861017227173,
-0.21358521282672882,
0.038287077099084854,
0.5014299750328064,
0.3998180627822876,
-0.044096171855926514,
-0.6554173827171326,
-0.1309683620929718,
0.5205663442611694,
0.040189407765865326,
0.1558649241924... | |
Working on .NET gives me good performance in general for the application itself but the initial load times for my application are quite large. A lot of it goes towards loading assemblies which is difficult to gauge.
**Are there any optimizations that I can apply to my assemblies to make them faster to load without in... | [
0.46544960141181946,
0.029198303818702698,
0.22077849507331848,
-0.28982555866241455,
-0.35409021377563477,
-0.29437583684921265,
0.4458535313606262,
-0.1855829954147339,
-0.04046224430203438,
-0.8254922032356262,
0.1563190519809723,
0.6632827520370483,
-0.17186015844345093,
-0.02507570013... | |
shows a splash screen asap. After that I initialize everything.
The JIT-compiler loads modules that are called from the method that is being jitted. So you have to take care that the method that shows the splash screen, does not call methods in modules that you do not want loaded yet.
Example:
```
internal sealed c... | [
0.3393920660018921,
-0.0957055389881134,
0.629870593547821,
-0.3010562062263489,
0.15529000759124756,
-0.07515106350183487,
0.04135298356413841,
-0.08122003078460693,
-0.5006000399589539,
-0.5253364443778992,
-0.21912986040115356,
0.4170728027820587,
-0.356807678937912,
-0.0629554763436317... | |
{
_splash = new Splash();
_splash.Show();
Application.DoEvents();
}
[MethodImpl(MethodImplOptions.NoInlining)]
private void ContinueStartup() {
// Do the startup here
}
}
```
The [MethodImpl(MethodImplOptions.NoInlining)] is needed so the ContinueStartup() method does ... | [
0.15648990869522095,
-0.32620537281036377,
0.8689241409301758,
-0.35754334926605225,
0.5754703879356384,
-0.15688462555408478,
0.29105275869369507,
-0.07580112665891647,
-0.5636898279190063,
-0.34225037693977356,
-0.29185694456100464,
0.48083174228668213,
-0.305973082780838,
0.231250748038... | |
Given that the HTML
```
<div>
<div id="content1"> content 1</div>
<div id="content2"> content 2</div>
<div id="content3"> content 3</div>
</div>
```
render as
```
content 1
content 2
content 3
```
My question:
Is there a way to render it as below by using CSS only without changing the HTML part.
```
... | [
0.26895466446876526,
0.002018643543124199,
0.3287312686443329,
0.12324695289134979,
-0.12888868153095245,
-0.36743178963661194,
0.13999712467193604,
-0.28569215536117554,
0.12510302662849426,
-0.6214448809623718,
-0.09239909797906876,
0.6219178438186646,
-0.13734924793243408,
-0.4654155075... | |
The Winforms System.Windows.Forms.Control class has an instance method "DrawToBitmap" which I think is very useful in a variety of circumstances. I'm wondering if there's an equivalent way of getting a System.Drawing.Bitmap from a WPF application?
I realize I could do some P/Invoke stuff to just get the application w... | [
-0.0702333152294159,
-0.28797611594200134,
0.5200121402740479,
0.05880793184041977,
-0.2778366506099701,
0.1544516235589981,
0.12275271117687225,
-0.2638809084892273,
0.04003419354557991,
-0.8089406490325928,
0.12778285145759583,
0.7613901495933533,
-0.060340676456689835,
0.003584500402212... | |
I am reorganizing my ColdFusion directory structures and am curious about how experienced CF developers are organizing libraries of smaller cffunctions.
I am not as curious about elaborate components (objects) as I am about the dozens of little utility functions we all build up over time.
* Do you use a large single ... | [
0.6188074946403503,
0.1925901621580124,
0.19758294522762299,
-0.0084057142958045,
-0.21082721650600433,
-0.26251208782196045,
0.11076018214225769,
-0.14204774796962738,
-0.3126820921897888,
-0.38516154885292053,
-0.09827941656112671,
0.48799005150794983,
-0.4451766610145569,
-0.09628193825... | |
a better way?
Since I don't like verbose syntax I have been just cfincluding a lib.cfm that has a bunch of common cffunctions in it. I may refactor them to grouped cfcs I can createobject on just to have better isolation on variable scopes.
Is there a better way to do this?
This is a reprint of a [blog post I did](ht... | [
0.35085904598236084,
-0.02708633616566658,
0.5455948710441589,
0.0720459371805191,
-0.12401807308197021,
-0.2575197219848633,
0.4986092746257782,
0.06389899551868439,
-0.3477558493614197,
-0.7329472303390503,
0.2814786732196808,
0.7367393374443054,
-0.40528246760368347,
-0.0299903769046068... | |
people have with them is how to include and organize them in your application.
What I've found that most people do is create a Utils.cfc or UDFs.cfc and cut and paste their UDFs that they want to use into the component as demonstrated below:
```
<!--- UDFs.cfc --->
<cfcomponent output="false">
<cffunction name="init... | [
0.44407036900520325,
0.28839147090911865,
0.39931541681289673,
0.002588837407529354,
0.14034833014011383,
0.04383879899978638,
-0.011626255698502064,
-0.12285418808460236,
-0.3437020778656006,
-0.9949697852134705,
-0.19090886414051056,
0.549922525882721,
-0.11728562414646149,
0.06175779178... | |
scope. The following line is placed into the `onApplicationStart()` if you're using Application.cfc or by just adding it into the Application.cfm if you're using that:
```
<cfset application.functions = CreateObject("component", "udfs").init()>
```
Whichever one you're using, Application.cfc or Application.cfm, the ... | [
0.6472004652023315,
0.15105555951595306,
0.802026093006134,
-0.052588555961847305,
0.05569618195295334,
-0.4067162573337555,
0.017572224140167236,
-0.26281803846359253,
-0.2915566861629486,
-0.7347424030303955,
-0.05456516891717911,
0.7653811573982239,
-0.3802858293056488,
0.32059019804000... | |
problem with having such a huge component file is editing it becomes a nightmare since scrolling through thousand of lines of code isn't very fun and also I've noticed that CFEclipse bogs down on huge files. Sure code collapse does provide some relief but there has to be a better way.
What I wanted was to just have on... | [
0.22896893322467804,
0.17297303676605225,
0.30587515234947205,
0.2443523406982422,
-0.22540892660617828,
-0.1325199455022812,
0.3683038651943207,
0.11601029336452484,
-0.35025763511657715,
-0.7021433711051941,
0.32209864258766174,
0.5585269927978516,
-0.364152193069458,
0.2679717540740967,... | |
I also wanted to be able to grab UDFs from [CFLib.org](http://www.cflib.org/) and just drop them into my application without having to edit anything. If I ever needed to remove a UDF from my application, it would be as easy as deleting the UDF file and reinitializing my application.
To accomplish what I wanted, I modi... | [
0.09554978460073471,
-0.026235276833176613,
0.7138981223106384,
-0.28249499201774597,
-0.2516237199306488,
0.3319051265716553,
0.2765065133571625,
-0.4849138557910919,
-0.21292242407798767,
-0.6329129338264465,
-0.12225674092769623,
0.40053513646125793,
-0.5176393985748291,
-0.008570006117... | |
<cfinclude template="udfs\#name#">
</cfoutput>
</cfcomponent>
```
So what exactly is going on?
In a nutshell, here's what’s happening: I have a directory called `udfs` in the same directory that I have my UDFs.cfc. This is the directory that I put all of my UDF CFM files. What the UDFs.cfc does is scan this direc... | [
0.8569100499153137,
0.23041079938411713,
0.6413513422012329,
-0.13662052154541016,
0.06359124183654785,
-0.5751876831054688,
-0.004206511657685041,
0.034183479845523834,
-0.5410090684890747,
-0.6763661503791809,
0.022106919437646866,
0.4175046682357788,
-0.4533191919326782,
0.4654682278633... | |
component file to find it. I can now open and edit it easily. By just looking at the directory, I know what UDFs my application is using. I can automatically add a UDF from CFLib.org by just saving the text from browser into a file in the directory. Plus if I no longer need to use the UDF in my application, I simply de... | [
0.550990641117096,
0.11000039428472519,
0.7974286675453186,
-0.11915899813175201,
-0.3277707099914551,
-0.24947026371955872,
0.050282105803489685,
0.01684037782251835,
-0.35481593012809753,
-0.7687385678291321,
0.04927261173725128,
0.7478999495506287,
-0.6678014397621155,
0.469646871089935... | |
CFM files looks like. The file is called `fullLeft.cfm` and resides in the UDFs directory.
```
<!--- fullLeft --->
<cffunction name="fullLeft" access="public" displayname="fullLeft" returntype="string" output="false">
<cfargument name="str" type="string" required="true">
<cfargument name="count" type="numeric" req... | [
-0.06010874733328819,
0.19753816723823547,
1.172383189201355,
-0.3401082158088684,
-0.016674354672431946,
0.106289803981781,
-0.03483794629573822,
-0.32039880752563477,
-0.18989501893520355,
-0.5414517521858215,
-0.39205917716026306,
0.40561574697494507,
-0.2469400018453598,
0.234656587243... | |
Right now my loop is
```
for (TreeNode n = e.Node.FirstNode; n != null; n = n.NextNode)
```
and my data is something like
```
a
a1
a2
b
b1
```
I want to enum breadth only (a, b etc, not a1, a2 etc). How do i do this?
Breadth first enumeration is typically done by using a queue of some sort as an ancil... | [
0.12431900948286057,
-0.267889142036438,
0.08542920649051666,
-0.09619476646184921,
-0.0016590715385973454,
0.10335957258939743,
-0.07244595885276794,
-0.08987849205732346,
-0.3818415403366089,
-0.5410024523735046,
0.16238565742969513,
0.0715162456035614,
-0.10128024220466614,
0.2824458479... | |
item you popped. | [
0.02280990406870842,
-0.1255258172750473,
0.1726643443107605,
0.6547774076461792,
-0.3160475194454193,
-0.04899539425969124,
-0.1970939040184021,
0.17792366445064545,
-0.40086039900779724,
-0.1880475878715515,
0.07842257618904114,
0.3459876775741577,
-0.15082234144210815,
0.068650633096694... | |
How, if possible, can I have iPhone SDK's classes (UI\*) to autocomplete inside TextMate?
Ok, after looking the link Kendall posted and some other places this is what I have found:
There is currently NO easy way to have autocomplete of iPhone APIs in TextMate.
The link on the post Kendall pointed is old, but I found ... | [
0.2931101322174072,
-0.05880630016326904,
0.14348918199539185,
0.13209189474582672,
-0.2036033272743225,
-0.077525295317173,
0.3224065601825714,
0.014078604057431221,
-0.2948538362979889,
-0.473047137260437,
-0.01378968358039856,
0.6413610577583313,
-0.44384196400642395,
-0.221261456608772... | |
developer (Joachim Mårtensson).
You can have autocomplete with this bundle, but it is working only with classes files, not headers. | [
0.3449547290802002,
-0.1629510521888733,
-0.3603097200393677,
0.41466301679611206,
-0.11534205824136734,
-0.06193893775343895,
0.42111241817474365,
-0.2667832672595978,
0.10112380981445312,
-0.5816579461097717,
-0.1744500696659088,
0.27632787823677063,
-0.6621069312095642,
-0.2171869426965... | |
Is it possible to recover from a network partition in an mnesia cluster without restarting any of the nodes involved? If so, how does one go about it?
I'm interested specifically in knowing:
* How this can be done with the standard OTP mnesia (v4.4.7)
* What custom code if any one needs to write to make this happen (... | [
-0.27589866518974304,
-0.1554766148328781,
0.07387987524271011,
0.19042576849460602,
0.21612444519996643,
-0.026084335520863533,
0.3953110873699188,
-0.09292379766702652,
-0.4485595226287842,
-0.6272054314613342,
-0.3671942949295044,
0.5399273037910461,
-0.08363797515630722,
-0.09441597014... | |
and requires that the node(s) that are part of the non-master partition be restarted.
While I appreciate the pointers to general distributed systems theory, in this question I am interested in erlang/OTP mnesia only.
After some experimentation I've discovered the following:
* Mnesia considered the network to be parti... | [
-0.18353848159313202,
-0.25850027799606323,
0.04182479530572891,
0.0958472490310669,
0.07001418620347977,
-0.17865543067455292,
-0.1335049420595169,
-0.004461147356778383,
-0.5801512002944946,
-0.5412625074386597,
-0.3775569796562195,
0.24780279397964478,
-0.340652734041214,
0.225749164819... | |
Only Mnesia needs to be restarted in order to clear the network partitioned event. You don't need to restart the entire node.
* Mnesia resolves the network partitioning by having the newly restarted Mnesia node overwrite its table data with data from another Mnesia node (the startup table load algorithm).
* Generally n... | [
-0.21253445744514465,
-0.179604172706604,
0.26227518916130066,
0.24363858997821808,
0.12251514196395874,
-0.05127444118261337,
0.43613430857658386,
0.060295768082141876,
-0.6436316967010498,
-0.5948091149330139,
-0.3820416033267975,
0.3651358187198639,
-0.25979775190353394,
0.3723332881927... | |
its old peers), shutdown all nodes and start them all back up again starting the disconnected node first, the disconnected node will be considered the master and its data will overwrite all the other nodes. There is no table comparison/checksumming/quorum behaviour.
So to answer my question, one can perform semi onlin... | [
-0.3259386122226715,
-0.3345103859901428,
0.15125924348831177,
0.18622806668281555,
0.08431173861026764,
-0.10870149731636047,
0.3785560131072998,
-0.07873403280973434,
-0.4812752306461334,
-0.7428340315818787,
-0.41354262828826904,
0.3018626570701599,
-0.31690606474876404,
0.8412368297576... | |
the losing partition, you may want to set the master nodes for table loading to nodes in the winning partition - otherwise I think there is a chance it will load tables from another node in the losing partition and thus return to the partitioned network state.
Unfortunately mnesia provides no support for merging/recon... | [
-0.20914454758167267,
-0.2959689795970917,
0.2501516044139862,
0.2104879468679428,
0.038126081228256226,
0.020147329196333885,
0.11345881968736649,
0.08693442493677139,
-0.3621179759502411,
-0.6111732721328735,
-0.1795862764120102,
0.3823823928833008,
-0.21976101398468018,
0.42823600769042... | |
owns/should be the most up-to-date for (assuming one user conneciton per cluster). If a merge phase existed, the node could filter userdata tables, save all records for connected users, load tables as per usual and then write the saved records back to the mnesia cluster. | [
0.11333559453487396,
-0.2577223777770996,
0.44263800978660583,
0.42207780480384827,
0.21816833317279816,
-0.18239261209964752,
-0.062459446489810944,
-0.07419966161251068,
-0.15636643767356873,
-0.6028424501419067,
-0.328019917011261,
0.1042032241821289,
0.061987198889255524,
0.38186484575... | |
I have an ebook in word that I convert to PDF before distributing to my clients. I'd like to dynamically insert their email address into all links in the ebook to allow them access to the members-only content on my site, and I'd like to do this on the fly, as part of the book download process.
I've briefly looked at <... | [
0.49166637659072876,
0.12211091071367264,
0.5405052900314331,
0.14857076108455658,
0.1782909780740738,
-0.22529113292694092,
-0.0390525758266449,
0.19087724387645721,
-0.04983929172158241,
-0.6945554614067078,
-0.17926298081874847,
0.40321463346481323,
0.06296566873788834,
0.02675657719373... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.