text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
replaced since they're now undefined.
Anyone know some better practices?
The depression in the responses is overwhelming... But don't fear, we've got [the holy book to exorcise the demons of legacy C++ code](https://rads.stackoverflow.com/amzn/click/com/0131177052). Seriously just buy the book if you are in line for m... | [
0.43456101417541504,
0.3079466223716736,
0.25500866770744324,
0.1112898662686348,
-0.01537051610648632,
-0.031008200719952583,
0.7566925883293152,
0.269986093044281,
-0.10393062233924866,
-0.4379325211048126,
-0.26805296540260315,
0.4526732861995697,
-0.21752986311912537,
0.241938799619674... | |
since we programmers love to take it to the wrong extreme, a file can recursively include a zillion others transitively. Builds take years.. but hey atleast it builds.. we can wait.
Now to say 'instantiating ClassA under a test harness is difficult' is an understatement. (Quoting MF's example - Scheduler is our poste... | [
0.5360640287399292,
-0.006278446409851313,
-0.15888436138629913,
0.012731490656733513,
-0.041882194578647614,
-0.2510140836238861,
0.40747329592704773,
-0.6170098781585693,
0.030851157382130623,
-0.5455666184425354,
-0.24586151540279388,
0.6692752242088318,
-0.25530144572257996,
-0.1851094... | |
if we really need that dependency. Let's assume SchedulerDisplay is one of them, whose displayEntry method is called in Scheduler's ctor.
**Blow#2 Fake-it-till-you-make-it** (Thanks RonJ):
```
#include "TestHarness.h"
#include "Scheduler.h"
void SchedulerDisplay::displayEntry(const string& entryDescription) {}
TEST... | [
0.5584309697151184,
0.031104257330298424,
0.4514034390449524,
0.10462787747383118,
0.08290178328752518,
-0.33862918615341187,
0.23523081839084625,
-0.324907124042511,
0.18113774061203003,
-0.48545998334884644,
0.12004934996366501,
0.8558369874954224,
-0.013315051794052124,
-0.2096066176891... | |
:)
* We need a separate build for test cases in this file ; we can have only 1 definition for the SchedulerDisplay::displayEntry method in a program. So create a separate program for scheduler tests.
* We aren't breaking any dependencies in the program, so we are not making the code cleaner.
* You need to maintain th... | [
1.0466537475585938,
0.14529643952846527,
0.31692004203796387,
0.30615830421447754,
-0.2353811115026474,
-0.10517706722021103,
0.4204583466053009,
0.003644000506028533,
-0.09620527923107147,
-0.6308975219726562,
0.3936818242073059,
0.9627941846847534,
-0.0017305354122072458,
0.0926004126667... | |
or lightly.. **Use this as a starting point for deeper refactorings.** Over time this testing program can be taken behind the barn as you extract more classes (WITH their own tests).
For more.. please do read the book. Invaluable. Fight on bro! | [
0.6316338777542114,
0.15382860600948334,
0.10833077132701874,
0.07983572781085968,
-0.07196249812841415,
-0.3818984627723694,
0.49998578429222107,
-0.25424274802207947,
-0.02950732596218586,
-0.6386285424232483,
0.09500192105770111,
0.6953893899917603,
0.39012396335601807,
-0.3729453384876... | |
Is there some reasonably cross platform way to create a thumbnail image given a URL? I know there are thumbnail web services that will do this, but I want a piece of software or library that will do this locally. I guess in Linux I could always spawn a browser window using a headless X server, but what about Windows or... | [
0.35586974024772644,
0.1359790861606598,
0.2508454918861389,
0.16915114223957062,
-0.23775026202201843,
-0.05254612863063812,
-0.07879067957401276,
0.4197317957878113,
-0.3429463803768158,
-0.6729563474655151,
0.20893821120262146,
0.48581844568252563,
-0.1922590732574463,
0.167430981993675... | |
I'd like to be able to write a PHP class that behaves like an array and uses normal array syntax for getting & setting.
For example (where Foo is a PHP class of my making):
```
$foo = new Foo();
$foo['fooKey'] = 'foo value';
echo $foo['fooKey'];
```
I know that PHP has the \_get and \_set magic methods but those ... | [
0.5311898589134216,
0.13951808214187622,
0.2874264121055603,
-0.11567983776330948,
-0.10803573578596115,
-0.18564873933792114,
0.1921176016330719,
-0.22664806246757507,
-0.13430491089820862,
-0.48996177315711975,
0.2974560260772705,
0.45363086462020874,
-0.36726611852645874,
0.117956236004... | |
[ArrayObject](http://php.net/arrayobject)
* [ArrayAccess](http://php.net/arrayaccess) | [
0.09199310094118118,
0.01045443955808878,
0.06630298495292664,
-0.3817945122718811,
-0.48550447821617126,
0.08400329947471619,
-0.030589871108531952,
-0.08738157153129578,
-0.33015385270118713,
-0.01470085047185421,
-0.14709222316741943,
0.43074238300323486,
-0.4923080503940582,
-0.1418204... | |
Convert a .doc or .pdf to an image and display a thumbnail in Ruby?
Does anyone know how to generate document thumbnails in Ruby (or C, python...)
A simple RMagick example to convert a PDF to a PNG would be:
```
require 'RMagick'
pdf = Magick::ImageList.new("doc.pdf")
thumb = pdf.scale(300, 300)
thumb.write "doc.pn... | [
0.24130868911743164,
-0.07694213092327118,
0.5374889969825745,
0.10658813267946243,
-0.43807798624038696,
0.082514688372612,
0.1096416786313057,
-0.3606322407722473,
-0.3327235281467438,
-0.5867907404899597,
-0.13661913573741913,
0.8618535995483398,
-0.21596767008304596,
-0.267140924930572... | |
are also online conversion services you could try, including <http://Zamzar.com>. | [
0.5298498868942261,
0.14022651314735413,
-0.12926405668258667,
0.3972543179988861,
0.35183170437812805,
0.0817793756723404,
0.16232647001743317,
0.28776875138282776,
-0.29085400700569153,
-0.6506605744361877,
-0.34515881538391113,
0.2790148854255676,
0.25490403175354004,
0.2105524390935897... | |
Does Server Core 2008 support asp.net? I see references online saying that it isn't supported, but they are all old references from CTPs.
No.
Answer here:
<http://www.microsoft.com/windowsserver2008/en/us/compare-core-installation.aspx>
"ASP.NET is not available with Server Core installation option in any edition" | [
-0.09185791015625,
-0.02123747579753399,
0.37718743085861206,
-0.035069212317466736,
-0.20159311592578888,
-0.22945404052734375,
0.28130272030830383,
0.24561461806297302,
-0.1302502304315567,
-0.28952136635780334,
-0.1742735356092453,
0.2500144839286804,
-0.09036628156900406,
-0.0248457677... | |
Each time a python file is imported that contains a large quantity of static regular expressions, cpu cycles are spent compiling the strings into their representative state machines in memory.
```
a = re.compile("a.*b")
b = re.compile("c.*d")
...
```
Question: Is it possible to store these regular expressions in a c... | [
0.10134666413068771,
0.07438673079013824,
-0.03985489159822464,
0.025531265884637833,
-0.2211732268333435,
0.07274527847766876,
0.3741036355495453,
-0.2760760486125946,
-0.5772798657417297,
-0.1413978785276413,
-0.3288736045360565,
0.2777128517627716,
-0.4869116544723511,
0.029049228876829... | |
line 1, in <module>
ValueError: unmarshallable object
```
> Is it possible to store these regular expressions in a cache on disk in a pre-compiled manner to avoid having to execute the regex compilations on each import?
Not easily. You'd have to write a custom serializer that hooks into the C `sre` implementation of ... | [
0.31428536772727966,
-0.048539333045482635,
0.38272222876548767,
0.09196002781391144,
0.05775521323084831,
-0.03159921616315842,
0.3517836034297943,
0.13014870882034302,
-0.1659504771232605,
-0.442033588886261,
-0.2658578157424927,
0.5005277991294861,
-0.5842219591140747,
-0.25644940137863... | |
the current execution -- thereafter, the module and its attributes are cached in memory.
If you have a program that basically spawns once, compiles a bunch of regexes, and then exits, you could try re-engineering it to perform multiple tests in one invocation. Then you could re-use the regexes, as above.
Finally, you... | [
0.3757542371749878,
-0.026553165167570114,
0.09985670447349548,
0.19581608474254608,
0.18879711627960205,
0.19747138023376465,
0.26094260811805725,
-0.301948606967926,
-0.18491849303245544,
-0.4078230559825897,
-0.06622552871704102,
0.5032947063446045,
-0.2256014347076416,
0.21656654775142... | |
I am using Apache Axis to connect my Java app to a web server. I used wsdl2java to create the stubs for me, but when I try to use the stubs, I get the following exception:
> org.apache.axis.ConfigurationException: No service named `<web service name>` is available
any idea?
Just a guess, but it looks like that error ... | [
0.17228415608406067,
0.21920117735862732,
0.06826544553041458,
-0.15672852098941803,
-0.052724722772836685,
-0.08745395392179489,
0.3054618835449219,
0.2689538896083832,
-0.10712343454360962,
-0.96932452917099,
0.044233161956071854,
0.3874364197254181,
-0.3062444031238556,
0.56073367595672... | |
I've created a seperate assembly with a class that is intended to be
published through wmi. Then I've created a windows forms app that
references that assembly and attempts to publish the class. When I try to
publish the class, I get an exception of type
System.Management.Instrumentation.WmiProviderInstallationExce... | [
0.39372020959854126,
0.2220473736524582,
0.41867926716804504,
-0.11921549588441849,
0.01597237028181553,
-0.16976767778396606,
0.24188530445098877,
-0.37436458468437195,
-0.18804021179676056,
-0.45758140087127686,
-0.0024159259628504515,
0.2795579433441162,
-0.3060421049594879,
0.323930531... | |
HostingModel =
System.Management.Instrumentation.ManagementHostingModel.Decoupled)]
namespace WMI
{
[System.ComponentModel.RunInstaller(true)]
public class MyApplicationManagementInstaller :
System.Management.Instrumentation.DefaultManagementInstaller { }
[System.Management.Instrumentation.Manage... | [
0.09525857120752335,
-0.01774199865758419,
0.7015785574913025,
0.29040437936782837,
0.2375667691230774,
0.09153250604867935,
0.15351299941539764,
-0.23673713207244873,
-0.4525339901447296,
-0.5533034801483154,
-0.2039368897676468,
0.43102961778640747,
-0.3847997784614563,
0.513056159019470... | |
[System.Management.Instrumentation.ManagementQualifier("Descriiption",
Value="The number of processors.")]
public int ProcessorCount
{
get { return Environment.ProcessorCount; }
}
}
}
```
```
//Button click in windows forms application to publish class
try
{
Sys... | [
0.3506920039653778,
-0.17543208599090576,
0.7160672545433044,
-0.10974670201539993,
0.2876296937465668,
0.2015388160943985,
0.040595315396785736,
-0.7086564898490906,
-0.4010169506072998,
-0.2167491316795349,
-0.17543774843215942,
0.27691349387168884,
-0.4835740029811859,
0.428017765283584... | |
gacutil - installutil to to test your class (as a dll). The gacutil part worked, but installutil (actually mofcomp) complained about a syntax error:
...
error SYNTAX 0X80044014:
Unexpected character in class name (must be an identifier)
Compiler returned error 0x80044014
...
So I changed the class name to 'MyInter... | [
0.10410536080598831,
-0.21027569472789764,
0.4671260118484497,
-0.10187256336212158,
-0.2666742205619812,
-0.2670798599720001,
0.3909568786621094,
0.3227519392967224,
-0.03512224182486534,
-0.8636308312416077,
0.06020505353808403,
0.8117589950561523,
-0.48235228657722473,
0.177777692675590... | |
As I understand it, anything created with an **alloc**, **new**, or **copy** needs to be manually released. For example:
```
int main(void) {
NSString *string;
string = [[NSString alloc] init];
/* use the string */
[string release];
}
```
My question, though, is wouldn't this be just as valid?:
```
... | [
0.29869765043258667,
-0.34993845224380493,
0.11080721020698547,
-0.15368381142616272,
0.15397796034812927,
-0.28702908754348755,
0.13522346317768097,
-0.10214617103338242,
-0.17687399685382843,
-0.5657130479812622,
-0.34654363989830017,
0.5463889241218567,
-0.46640485525131226,
0.190802380... | |
code snippit is perfectly valid.
Every time -autorelease is sent to an object, it is added to the inner-most autorelease pool. When the pool is drained, it simply sends -release to all the objects in the pool.
Autorelease pools are simply a convenience that allows you to defer sending -release until "later". That "la... | [
0.37899595499038696,
-0.19670149683952332,
0.4944356679916382,
0.14849986135959625,
0.009043971076607704,
-0.19785363972187042,
0.4341968595981598,
0.03380304574966431,
-0.17096461355686188,
-0.43323642015457153,
-0.40379539132118225,
0.3707123100757599,
-0.5248281359672546,
-0.17931331694... | |
A sample perl script that connects to an oracle database, does a simple SELECT query, and spits the results to stdout in CSV format would be great. Python or any other language available in a typical unix distribution would be fine too.
Note that I'm starting from scratch with nothing but a username/password for a re... | [
0.5142846703529358,
-0.14808900654315948,
-0.056721460074186325,
0.12700125575065613,
-0.5278722643852234,
0.03643587604165077,
0.06956615298986435,
0.08842294663190842,
0.009529795497655869,
-0.290457546710968,
0.3336581289768219,
0.5002247095108032,
-0.2985902726650238,
-0.09461623430252... | |
like this, leaving out all the my local variable declarations and ... or die "failmessage" error handling for brevity.
```
use DBI;
use DBD::Oracle;
$dbh = DBI->connect( "dbi:Oracle:host=127.0.0.1;sid=XE", "username", "password" );
# some settings that you usually want for oracle 10
$dbh->{LongReadLen} = 65535;
$db... | [
0.2945154309272766,
-0.06322674453258514,
0.2727111279964447,
-0.16917385160923004,
-0.1828376203775406,
0.023237964138388634,
0.3331923186779022,
-0.4946625232696533,
0.07168097794055939,
-0.6060844659805298,
0.016518758609890938,
0.5317479372024536,
-0.33378711342811584,
0.31011861562728... | |
"\n";
}
$dbh->disconnect();
```
Two notes, because people asked in comments:
* sid=XE is the oracle service id, that is like the name of your database. If you install the free version of oracle, it defaults to "XE", but you can change it.
* Installing DBD::Oracle needs the oracle client libraries on your system. In... | [
0.27923083305358887,
0.058699630200862885,
-0.030571583658456802,
-0.1283775418996811,
0.016568170860409737,
-0.35335856676101685,
0.39421379566192627,
-0.006190103013068438,
-0.008607853204011917,
-0.6885520219802856,
-0.13757959008216858,
0.5427150726318359,
-0.41172459721565247,
0.29057... | |
I'm a longtime Java programmer working on a PHP project, and I'm trying to get PHPUnit up and working. When unit testing in Java, it's common to put test case classes and regular classes into separate directories, like this -
```
/src
MyClass.java
/test
MyClassTest.java
```
and so on.
When unit testing wit... | [
0.6225947141647339,
0.326791912317276,
-0.4431059956550598,
-0.3465805947780609,
-0.12480198591947556,
-0.26971861720085144,
0.24874062836170197,
-0.10119554400444031,
-0.058749232441186905,
-0.7186881899833679,
0.3713909685611725,
0.49976229667663574,
0.0028188873548060656,
0.001655666623... | |
don't want to include the test classes when I push to production.
I think it's a good idea to keep your files separate. I normally use a folder structure like this:
```
/myapp/src/ <- my classes
/myapp/tests/ <- my tests for the classes
/myapp/public/ <- document root
```
In your case, for includin... | [
0.598341703414917,
0.11913081258535385,
-0.335417240858078,
-0.04434695839881897,
0.056537482887506485,
-0.20421220362186432,
0.28159594535827637,
-0.3853724002838135,
0.014527540653944016,
-0.5351525545120239,
-0.15287956595420837,
0.5404184460639954,
-0.35596415400505066,
0.0110975233837... | |
I've been looking at ways to implement gmail-like messaging inside a browser, and arrived at the [Comet](http://en.wikipedia.org/wiki/Comet_(programming)) concept. However, I haven't been able to find a good .NET implementation that allows me to do this within IIS (our application is written in ASP.NET 2.0).
The solu... | [
0.24573133885860443,
-0.19912075996398926,
0.3776777386665344,
0.09489721059799194,
-0.22323395311832428,
-0.19213828444480896,
0.49383944272994995,
0.30724379420280457,
-0.28533947467803955,
-0.5600866079330444,
0.031947214156389236,
0.25857728719711304,
-0.41689810156822205,
-0.089948162... | |
a different way? Is that even possible with IIS?
Comet is challenging to scale with IIS because of comet's persistent connectivity, but there is a team looking at Comet scenarios now. Also look at [Aaron Lerch's blog](http://www.aaronlerch.com/blog/2007/07/08/creating-comet-applications-with-aspnet/) as I believe he's ... | [
0.17175081372261047,
-0.4685506522655487,
-0.05088796466588974,
0.35722583532333374,
-0.22569242119789124,
-0.15285398066043854,
0.5070391893386841,
-0.14649513363838196,
-0.6028789281845093,
-0.4735684394836426,
-0.0065746488980948925,
0.13986337184906006,
-0.424731582403183,
-0.066401824... | |
Can someone tell me how to get path geometry from a WPF FlowDocument object? Please note that I do **not** want to use `FormattedText`. Thanks.
A `FlowDocument` can be viewed in any number of ways, but a `Path` is a fixed shape. I think maybe you really want some simplified, visual-only form of a `FlowDocument`'s conte... | [
0.4028187692165375,
-0.11684280633926392,
0.4972081184387207,
0.5307122468948364,
-0.23917531967163086,
-0.3500751852989197,
-0.09093799442052841,
0.2534528076648712,
-0.20855200290679932,
-0.8367378115653992,
0.06413386017084122,
0.6920173168182373,
-0.21155698597431183,
-0.16867147386074... | |
Maybe this is a silly question, but I've always assumed each number delineated by a period represented a single component of the software. If that's true, do they ever represent something different? I'd like to start assigning versions to the different builds of my software, but I'm not really sure how it should be str... | [
0.22133110463619232,
0.004366579465568066,
0.608233630657196,
-0.018351230770349503,
-0.06759239733219147,
0.1722930669784546,
0.3770861327648163,
-0.020911943167448044,
-0.6469431519508362,
-0.664822518825531,
-0.27797818183898926,
0.22645880281925201,
-0.13337472081184387,
0.331316322088... | |
used)—that's why you see the .NET framework using something like 2.0.4.2709
You won't find a lot of apps going down to four levels, 3 is usually sufficient. | [
0.40329957008361816,
0.1596158742904663,
0.5726803541183472,
0.1764598786830902,
0.004228588193655014,
-0.11542931199073792,
0.43900060653686523,
-0.303193062543869,
-0.45647311210632324,
-0.6027377247810364,
-0.22358153760433197,
0.7926212549209595,
-0.4085542857646942,
-0.253118723630905... | |
As everyone knows, the [Visual C++](http://en.wikipedia.org/wiki/Visual_C%2B%2B) runtime marks uninitialized or just freed memory blocks with special non-zero markers. Is there any way to disable this behavior entirely without manually setting all uninitialized memory to zeros? It's causing havoc with my valid not null... | [
0.2728382349014282,
0.1858070343732834,
0.19268004596233368,
-0.14488285779953003,
-0.0668255165219307,
-0.004511114675551653,
0.40737679600715637,
0.15160447359085083,
-0.2015717476606369,
-0.4564931392669678,
-0.1216772124171257,
0.6130909323692322,
-0.12285757064819336,
0.19573974609375... | |
memory should, I come up with problems as `0xFEEEFEEE` passes a `NULL` check without problems. Is there any good way, other than manually setting all pointers to `NULL` when deleting them, to detect when memory has already been freed? I would prefer to not use [Boost](http://en.wikipedia.org/wiki/Boost_C%2B%2B_Librarie... | [
0.2035447508096695,
0.3149927854537964,
0.15403150022029877,
0.0958261713385582,
0.1357806771993637,
-0.1617020219564438,
0.2794174551963806,
0.06894705444574356,
-0.3448711633682251,
-0.426642507314682,
0.02913905680179596,
0.707546591758728,
-0.03337854519486427,
0.04784255847334862,
-... | |
some thing like `boost::shared_ptr<>` for pointers any way.
That said, if you really want to **shoot your self in the foot** you can.
You can **change** the **default fill** for the windows **DEBUG runtime** by using an allocator hook like this. This will only work on HEAP allocated object!
```
int main(int argc,cha... | [
0.2569774389266968,
-0.23672868311405182,
0.2998521327972412,
-0.19691480696201324,
-0.0792396068572998,
-0.0018057343550026417,
0.24416914582252502,
-0.385122150182724,
-0.29510313272476196,
-0.4189377725124359,
0.24073028564453125,
0.6209365129470825,
-0.4169027805328369,
-0.214308187365... | |
size_t nSize,
int nBlockUse,
long lRequest,
const unsigned char *szFileName,
int nLine )
{
/// Very Importaint !!
/// infinite recursion if this is removed !!
/// _CRT_BLOCK must not do any thing but return TRUE
/// even calling | [
0.08273198455572128,
-0.16816072165966034,
0.39915716648101807,
-0.3373118042945862,
0.20631584525108337,
0.012347533367574215,
0.48333314061164856,
-0.27321502566337585,
-0.3236854076385498,
-0.35633930563926697,
-0.2963595688343048,
0.6960813403129578,
-0.3387666344642639,
0.056376677006... | |
printf in the _CRT_BLOCK will cause
/// infinite recursion
if ( nBlockUse == _CRT_BLOCK )
return( TRUE );
switch(nAllocType)
{
case _HOOK_ALLOC:
case _HOOK_REALLOC:
// zero initialize the allocated space.
memset(pvData,0,nSize);
break;
case _HOOK_FREE:
break;
}
return TRUE;
}
``` | [
-0.09485640376806259,
-0.34302249550819397,
0.3163122534751892,
-0.3269011378288269,
0.5518901348114014,
0.14781954884529114,
0.2901434600353241,
-0.4740909934043884,
-0.4014880359172821,
-0.49621257185935974,
-0.3410821557044983,
0.6792951226234436,
-0.26017120480537415,
0.203667834401130... | |
This link describes an exploit into my app using fckEditor:
<http://knitinr.blogspot.com/2008/07/script-exploit-via-fckeditor.html>
How do I make my app secure while still using fckEditor? Is it an fckEditor configuration? Is it some processing I'm supposed to do server-side after I grab the text from fckEditor?
It's... | [
0.07975319772958755,
-0.06608089059591293,
0.25031644105911255,
0.1216103807091713,
-0.19682906568050385,
-0.15407024323940277,
0.6159653663635254,
-0.37524816393852234,
-0.2501647174358368,
-0.7847483158111572,
0.23222856223583221,
0.5315715074539185,
-0.4631531536579132,
0.00870175007730... | |
on\* event handlers and even more, thanks to stupidities of IE for example.
Also with custom html and css it's easy to hijack look and layout of your site - using overlay (absolutely positioned) which covers all screen etc. Be prepared for that. | [
0.5190759301185608,
-0.12067357450723648,
0.20282967388629913,
0.21674540638923645,
-0.07032527029514313,
-0.5790511965751648,
0.31215062737464905,
0.25146228075027466,
-0.18072593212127686,
-0.794950008392334,
-0.25055500864982605,
0.7208541631698608,
-0.3299534320831299,
0.02428127638995... | |
There are many different flavored HTML WYSIWYG editors from javascript to ASP.Net web controls, but all too often the features are the same. Does anyone have a favorite HTML editor they like to use in projects? Why?
I'm partial to TinyMCE WYSIWYG editor due to the following reasons:
1. Javascript - so it is broadly us... | [
0.37560802698135376,
-0.11756020784378052,
0.3071172535419464,
0.3807179033756256,
-0.26857030391693115,
-0.32757699489593506,
0.012418681755661964,
0.2100391387939453,
-0.24192216992378235,
-0.676719069480896,
0.04808291420340538,
0.3863056004047394,
-0.08470738679170609,
-0.0328405201435... | |
particular buttons
depending on my application needs | [
0.2606653869152069,
0.3439718186855316,
0.003800937905907631,
-0.0920049324631691,
-0.012190436944365501,
0.4120652377605438,
0.04933633655309677,
-0.1727675199508667,
-0.29267004132270813,
-0.3996223211288452,
-0.015215454623103142,
0.10197024047374725,
0.03641832619905472,
0.021115073934... | |
I get this error:
`Can't locate Foo.pm in @INC`
Is there an easier way to install it than downloading, untarring, making, etc?
**On Unix**:
usually you start *cpan* in your shell:
`$ cpan`
and type
`install Chocolate::Belgian`
or in short form:
`cpan Chocolate::Belgian`
**On Windows**:
> If you're using Activ... | [
0.1545233279466629,
0.16536040604114532,
0.33913683891296387,
-0.023675885051488876,
-0.032839372754096985,
-0.1490633189678192,
0.0023297599982470274,
-0.029474813491106033,
-0.6254093647003174,
-0.06250298768281937,
-0.1515524536371231,
0.42523273825645447,
-0.3376859426498413,
0.1630396... | |
benefit from automatic (security) **updates** and the ease of **removal**. This can be pretty tricky with the *cpan* tool itself.
For Gentoo there's a nice tool called **[g-cpan](https://wiki.gentoo.org/wiki/Project:Perl/g-cpan)** which builds/installs the module from CPAN and creates a Gentoo package ([ebuild](http:/... | [
0.12368839979171753,
0.002932971576228738,
0.2462637573480606,
0.010275937616825104,
-0.022031918168067932,
-0.3133569359779358,
0.036157261580228806,
0.11164382845163345,
-0.3726460635662079,
-0.4721907377243042,
-0.16417548060417175,
0.524238646030426,
0.0006817196263000369,
-0.096131719... | |
I would like to read the text and binary attachments in a saved Outlook message (.msg file) from a Java application, without resorting to native code (JNI, Java Native Interface).
[Apache POI-HSMF](http://poi.apache.org/hsmf/index.html) seems to be in the right direction, but it's in very early stages of development.... | [
0.4409047067165375,
0.009114156477153301,
0.2327519953250885,
0.029242360964417458,
-0.042696140706539154,
0.03931812196969986,
-0.25666186213493347,
0.18140770494937897,
-0.1780039668083191,
-0.8989383578300476,
0.05814799293875694,
0.4355756640434265,
-0.04724634066224098,
-0.25462234020... | |
the COM
interfaces that provide access to
the structured document. That would
be much easier than trying to hit it
directly through JNI. | [
0.33209338784217834,
-0.11283769458532333,
0.3590528964996338,
0.43774673342704773,
-0.1645764410495758,
0.10435949265956879,
-0.2443062663078308,
0.1863841712474823,
-0.05182180553674698,
-0.7341966032981873,
-0.24137809872627258,
0.8633527755737305,
0.0745924562215805,
0.0290272310376167... | |
In C# documentation tags allow you to produce output similar to MSDN. What are a list of allowable tags for use inside the /// (triple slash) comment area above classes, methods, and properties?
Check out [Great documentation on the various C# XML documentation tags.](http://web.archive.org/web/20100118163744/http://th... | [
0.37468627095222473,
0.1546592116355896,
0.07906654477119446,
0.13243715465068817,
-0.1447414755821228,
-0.4119413197040558,
-0.22248606383800507,
-0.1561945080757141,
-0.28892359137535095,
-0.462925523519516,
-0.24196675419807434,
0.5523709058761597,
-0.2524779736995697,
-0.28310635685920... | |
I was asked this question in a job interview. The interviewer and I disagreed on what the correct answer was. I'm wondering if anyone has any data on this.
Update: I should have mentioned that the use of shuffle() was strictly forbidden... sorry.
You could use the [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Kn... | [
0.41298526525497437,
-0.4374729096889496,
0.20921899378299713,
0.04479876533150673,
0.2664049565792084,
-0.266292005777359,
-0.13871550559997559,
-0.24925796687602997,
-0.3865937292575836,
-0.6945783495903015,
0.34917575120925903,
0.3371984660625458,
-0.0380728580057621,
0.0951402261853218... | |
I know you could make a helper pretty easily given the data. So, if possible, please only submit answers that also include getting the data.
We are using an action filter for this.
...
```
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
var controller = (Controller) fil... | [
-0.09027457982301712,
-0.2159128487110138,
0.5693861246109009,
-0.2194729745388031,
0.054217010736465454,
-0.07118509709835052,
0.3967392146587372,
-0.3671286702156067,
-0.22569195926189423,
-0.7804749011993408,
-0.2623444199562073,
0.3540697395801544,
-0.45287269353866577,
0.3804160058498... | |
with few options. IBreadcrumbManager looks like this:
```
public interface IBreadcrumbManager
{
Breadcrumb[] PushBreadcrumb(string linkText);
}
```
The implementation puts Breadcrumb objects into the Session. The Url is `HttpContext.Current.Request.RawUrl` | [
-0.2796752452850342,
-0.002580178203061223,
0.39340940117836,
-0.4204859733581543,
-0.3075098693370819,
-0.06909967958927155,
0.19065174460411072,
0.16050037741661072,
-0.11595223844051361,
-0.6533917784690857,
-0.09944607317447662,
0.3832607567310333,
-0.27059608697891235,
0.4295879900455... | |
I've seen examples like this:
```
public class MaxSeconds {
public static final int MAX_SECONDS = 25;
}
```
and supposed that I could have a Constants class to wrap constants in, declaring them static final. I know practically no Java at all and am wondering if this is the best way to create constants.
That is p... | [
0.17521880567073822,
0.030221540480852127,
0.1056673675775528,
-0.17463578283786774,
-0.14447255432605743,
0.039243511855602264,
0.24945972859859467,
0.059448570013046265,
-0.35056498646736145,
-0.371256023645401,
-0.003432756057009101,
0.5783327221870422,
-0.23933029174804688,
0.297822266... | |
a side note: Variables that are declared final and are mutable can still be changed; however, the variable can never point at a different object.
For example:
```
public static final Point ORIGIN = new Point(0,0);
public static void main(String[] args){
ORIGIN.x = 3;
}
```
That is legal and `ORIGIN` would th... | [
-0.23806452751159668,
-0.2825256586074829,
0.39741793274879456,
-0.25733107328414917,
0.21191580593585968,
-0.020562024787068367,
0.1208839938044548,
0.09515723586082458,
-0.22927425801753998,
-0.3856748342514038,
-0.3975349962711334,
0.2513115704059601,
-0.24264156818389893,
0.88808465003... | |
I'm responsible for some test database servers. Historically, too many other poeple have access to them. They run on `SQL Server 2005`.
I've been writing queries and wrapping them in scripts so I can run a regular audit of rights. Finding out which users had Administrator rights on the server itself was fine, as was ... | [
0.26482102274894714,
0.29959607124328613,
0.21621578931808472,
0.10017520934343338,
0.15973621606826782,
-0.19629956781864166,
0.09396976977586746,
0.07466726005077362,
-0.18839484453201294,
-0.3377257287502289,
0.16751453280448914,
0.3468722403049469,
-0.017317891120910645,
0.263147562742... | |
have located the `sys.databases table`. I haven't worked out how to find out which users have rights on a database, and if so, what.
Every Google search brings up people manually using the User Mapping pane of the Login dialog, rather than using a query to do so. Any ideas?
Here's how to do this. I ended up finding r... | [
0.28443533182144165,
0.08628685772418976,
0.32280299067497253,
0.19230841100215912,
0.13468198478221893,
-0.13857930898666382,
0.01930631883442402,
-0.26010724902153015,
-0.49918437004089355,
-0.6105273962020874,
-0.06471188366413116,
0.4132629632949829,
-0.2557053864002228,
0.076718240976... | |
where g.principal_id = m.role_principal_id
and u.principal_id = m.member_principal_id
and g.name in (''db_ddladmin'', ''db_owner'', ''db_securityadmin'')
and u.name not in (''dbo'')
order by 1, 2
```
This then reports the users that have DBO who perhaps shouldn't. I've already revoked some admin acce... | [
-0.42791178822517395,
0.1587180495262146,
0.560377836227417,
0.1748514622449875,
0.17916782200336456,
-0.14413470029830933,
0.3356684744358063,
0.003933863714337349,
-0.13490544259548187,
-0.1408550888299942,
-0.36042746901512146,
0.2909478545188904,
0.04466322436928749,
0.3826028406620025... | |
I found the ad on this site to Krypton controls ([and here's another one!](https://github.com/ComponentFactory/Krypton)) and was wondering if any of you using vs.net 05 or 08 are using them and how that's working out. If you're answering, please specify which parts you're using (free, ribbons, tabs) and which vs.net yo... | [
0.7231044769287109,
-0.04560660943388939,
0.4169575273990631,
0.6792837381362915,
-0.24041974544525146,
0.1970776617527008,
-0.34216687083244324,
0.13446834683418274,
-0.2130173295736313,
-0.5018873810768127,
-0.02091609127819538,
0.21097542345523834,
-0.0228582676500082,
0.356340855360031... | |
experience in those areas. (I've watched all the screencasts)
I have been using the **Krypton Controls ToolKit for over 3 years** with **Visual Studio 2005 and 2008** in **.NET 2.0, 3.0, 3.5, and 3.5 SP1**. I have **only used the free ToolKit** and not the Ribbon or Tab controls. I have used it **only in C**#.
**Pros:... | [
0.2897365391254425,
0.1685226708650589,
0.41044020652770996,
0.1672922968864441,
-0.46450796723365784,
-0.057578589767217636,
0.27809736132621765,
-0.12705352902412415,
-0.17533794045448303,
-0.7221847772598267,
0.23181350529193878,
0.759274959564209,
-0.07071749120950699,
-0.1992070376873... | |
is very nice.
5. The ability to define a master scheme makes it easy to change the look of similar controls in one central location.
6. The support, even on the free Toolkit is awesome, by submitting questions on the Component Factory forum.
7. It includes additional controls that should've been part of the windows for... | [
0.34183022379875183,
-0.20884178578853607,
0.6509857773780823,
0.30959421396255493,
0.0586341992020607,
-0.3659948408603668,
0.11726754903793335,
-0.35893261432647705,
-0.15357016026973724,
-0.4583289921283722,
0.0516890212893486,
0.69786137342453,
-0.1270635426044464,
-0.1546318382024765,... | |
controls implemented as Krypton controls.
Here's a quick sample of our options dialog for the "[MuvEnum Address Bar](http://www.muvenum.com/products/freeware/)" using the Krypton Chrome. It was super easy to create. Notice the smoothness of the fonts.

{
return _ingredients[type];
}
public bool Contains(string type)
{
return _ingredients.ContainsKey(type);
}
}
public class Potion
{
public IngredientBag Ingredients { get; private set;}
public string Name {get; private set;}
public Potion(strin... | [
0.3506031930446625,
0.15944862365722656,
0.6604021191596985,
-0.4911186397075653,
0.12924040853977203,
0.23562560975551605,
0.46902546286582947,
-0.6225649118423462,
0.13197068870067596,
-0.4087865352630615,
-0.3218425512313843,
0.6936381459236145,
-0.4054977297782898,
0.042293667793273926... | |
{
Name = name;
Ingredients = ingredients;
}
public static Expression<Func<Potion, bool>>
ContainsIngredients(string ingredientType, params string[] ingredients)
{
var predicate = PredicateBuilder.False<Potion>();
// Here, I'm accessing p.Ingredients several times in... | [
0.402720183134079,
0.11990153044462204,
0.3967980742454529,
-0.2585296034812927,
0.3215588629245758,
0.4223148226737976,
0.495540052652359,
-0.7566079497337341,
0.12336723506450653,
-0.3785633146762848,
-0.15827719867229462,
0.4766305088996887,
-0.18439218401908875,
-0.07259104400873184,
... | |
// reference the cached value in the expression?
foreach (var ingredient in ingredients)
{
var temp = ingredient;
predicate = predicate.Or (
p => p.Ingredients != null &&
p.Ingredients.Contains(ingredientType) && | [
0.48839694261550903,
0.04529944062232971,
0.03818611055612564,
-0.16344423592090607,
0.5106701254844666,
0.3798503577709198,
0.37337812781333923,
-0.5764023661613464,
0.33885473012924194,
-0.22994689643383026,
-0.2332141399383545,
0.431243896484375,
-0.28745555877685547,
-0.117484591901302... | |
p.Ingredients.Get(ingredientType).Contains(temp));
}
return predicate;
}
}
[STAThread]
static void Main()
{
var potions = new List<Potion>
{
new Potion("Invisibility", new IngredientBag()),
new Potion("Bonus"),
new Potion("Speed", new IngredientBag()),
new ... | [
0.032634831964969635,
-0.2338225245475769,
0.8679590225219727,
-0.16229508817195892,
0.1867244839668274,
0.48584890365600586,
0.3971862196922302,
-0.7254326939582825,
-0.2858932316303253,
-0.6291061639785767,
-0.570586621761322,
0.5557749271392822,
-0.26444828510284424,
-0.0845468118786811... | |
Potion("Dummy Potion")
};
potions[0].Ingredients.Add("solid", "Eye of Newt");
potions[0].Ingredients.Add("liquid", "Gall of Peacock");
potions[0].Ingredients.Add("gas", "Breath of Spider");
potions[2].Ingredients.Add("solid", "Hair of Toad");
potions[2].Ingredients.Add("gas", "Peacock's anguis... | [
0.034561578184366226,
0.2016681730747223,
0.32226189970970154,
-0.30637261271476746,
-0.3094375431537628,
0.8226402997970581,
0.8095144629478455,
-0.34764787554740906,
-0.1069304496049881,
-0.48447152972221375,
-0.43560653924942017,
0.3818470537662506,
-0.4947952330112457,
0.15645959973335... | |
where(predicate).Compile()(p)
select p)
{
Console.WriteLine(result.Name);
}
}
```
Can't you simply write your boolean expression in a separate static function which you call from your lambda - passing p.Ingredients as a parameter...
```
private static bool IsIngredientPresent(Ingredien... | [
0.33332276344299316,
0.048603154718875885,
0.5424131155014038,
-0.35682258009910583,
0.29111433029174805,
0.1365472823381424,
0.2988865375518799,
-0.5760159492492676,
0.11226251721382141,
-0.23586949706077576,
-0.2350282222032547,
0.5807631015777588,
-0.5455158352851868,
-0.073703356087207... | |
ContainsIngredients(string ingredientType, params string[] ingredients)
{
var predicate = PredicateBuilder.False<Potion>();
// Here, I'm accessing p.Ingredients several times in one
// expression. Is there any way to cache this value and
// reference the cached value in the expression?
foreach (va... | [
0.5318902134895325,
0.11840604990720749,
0.2898346185684204,
-0.190870463848114,
0.29880067706108093,
0.4058183431625366,
0.5875091552734375,
-0.8795527815818787,
0.052904125303030014,
-0.31034281849861145,
-0.02725144475698471,
0.43352532386779785,
-0.33240807056427,
-0.0731034055352211,
... | |
p => IsIngredientPresent(p.Ingredients, ingredientType, temp));
}
return predicate;
}
``` | [
0.28644442558288574,
0.12050390988588333,
0.3613104224205017,
-0.3515787124633789,
0.13776680827140808,
0.40392276644706726,
0.23459577560424805,
-0.4698886275291443,
0.18373160064220428,
-0.2562572956085205,
-0.4219134449958801,
0.3124275505542755,
-0.27567049860954285,
0.0517579168081283... | |
When using Google Chrome, I want to debug some JavaScript code. How can I do that?
Windows: `CTRL`-`SHIFT`-`J` OR F12
Mac: `⌥`-`⌘`-`J`
Also available through the wrench menu (Tools > JavaScript Console):
 | [
0.26304200291633606,
0.186628520488739,
0.3457578122615814,
0.126410111784935,
-0.2062925547361374,
0.025100748986005783,
0.6907744407653809,
-0.02072668820619583,
-0.05004182830452919,
-0.6812915802001953,
-0.1782183200120926,
0.7281612157821655,
-0.24544844031333923,
-0.12271331250667572... | |
I am trying to achieve better performance for my Java SWT application, and I just found out it is possible to use OpenGL in SWT. It seems there are more than one Java binding for OpenGL. Which one do you prefer?
Note that I have never used OpenGL before, and that the application needs to work on Windows, Linux and Mac... | [
0.3043864965438843,
0.39380860328674316,
0.3713635504245758,
-0.20864368975162506,
-0.38577380776405334,
-0.39592358469963074,
0.14969956874847412,
0.1687842458486557,
-0.19436413049697876,
-0.8539367914199829,
-0.02186792716383934,
0.6664342284202576,
-0.26659542322158813,
0.1144986525177... | |
if you want to have some fun learning and poking around, [Processing](http://processing.org/ "Processing") is an excellent way to start (Processing also uses JOGL btw...) | [
0.12930497527122498,
-0.17588219046592712,
0.13468679785728455,
0.087504543364048,
0.022068586200475693,
-0.2568511962890625,
-0.05912519246339798,
0.27854758501052856,
-0.4274359941482544,
-0.5466719269752502,
-0.174362912774086,
0.21148435771465302,
-0.16657625138759613,
-0.0606351904571... | |
How do I get started?
I have found the easiest way to achieve this by using Clojure.
Here is the example code:
```
(ns example
(:require [clojure.contrib.sql :as sql])
(:import [java.sql Types]))
```
(def devdb {:classname "oracle.jdbc.driver.OracleDriver"
:subprotocol "oracle"
:subname "thin:username/passwor... | [
0.2571004331111908,
0.02266211248934269,
0.5534868240356445,
0.017060203477740288,
0.06442226469516754,
0.07509464770555496,
0.09558727592229843,
-0.5218601822853088,
-0.18360596895217896,
-0.40442562103271484,
-0.18918535113334656,
0.37264952063560486,
0.11987268924713135,
-0.109001509845... | |
(println rec))))) | [
-0.22567135095596313,
-0.08247595280408859,
0.4579841196537018,
-0.35418829321861267,
-0.07277241349220276,
0.061417728662490845,
0.09885743260383606,
-0.12259016185998917,
-0.2992418110370636,
-0.16485026478767395,
-0.5660656094551086,
0.7173307538032532,
-0.2200450897216797,
0.2494288384... | |
I'm trying to find [ab - Apache HTTP server benchmarking tool](http://httpd.apache.org/docs/2.0/programs/ab.html) for Ubuntu, I'm hoping there's a package I can install for it. I decided I need to do some simple load testing on my applications.
```
% sudo apt-get install apache2-utils
```
The command-not-found package... | [
0.3719289302825928,
0.27748382091522217,
0.24815046787261963,
-0.20208130776882172,
-0.3874188959598541,
-0.30085161328315735,
0.3117419481277466,
-0.1423247903585434,
0.07236427068710327,
-0.6818345785140991,
-0.22444882988929749,
0.6435320377349854,
-0.3319668173789978,
0.031104600057005... | |
not installed. You can install it by typing:
sudo apt-get install apache2-utils
bash: ab: command not found
``` | [
0.3791840374469757,
0.017869753763079643,
0.27999016642570496,
0.02032354474067688,
0.04809470847249031,
-0.4049476087093353,
0.8513742685317993,
-0.13873496651649475,
0.07100886106491089,
-0.5287767052650452,
-0.30042755603790283,
0.7013354301452637,
-0.33850356936454773,
-0.1078610718250... | |
For a particular project I have, no server side code is allowed. How can I create the web site in php (with includes, conditionals, etc) and then have that converted into a static html site that I can give to the client?
Update: Thanks to everyone who suggested wget. That's what I used. I should have specified that I ... | [
0.15297994017601013,
-0.047398608177900314,
0.4148615598678589,
0.008342375047504902,
-0.17393168807029724,
0.023744577541947365,
0.1480351984500885,
0.10591791570186615,
-0.2793262004852295,
-0.8411380648612976,
-0.11397750675678253,
0.56938636302948,
-0.3458303213119507,
-0.0091855740174... | |
: keep an original versions of files without the conversions made by wget
* -E : rename html files to .html (if they don’t already have an htm(l) extension)
* -r : recursive… of course we want to make a recursive copy
* -l 10 : the maximum level of recursion. if you have a really big website you may need to put a highe... | [
0.3272263705730438,
-0.15427643060684204,
0.6475450396537781,
0.03979898616671562,
-0.13562513887882233,
-0.06591518968343735,
0.6841058135032654,
-0.21487310528755188,
-0.36004218459129333,
-0.7204461097717285,
-0.5745121240615845,
0.5342024564743042,
-0.19765052199363708,
-0.323870390653... | |
as an HTML file.
* -nH : By default, wget put files in a directory named after the site’s hostname. This will disabled creating of those hostname directories and put everything in the current directory.
Source: [Jean-Pascal Houde's weblog](http://blog.jphoude.qc.ca/2007/10/16/creating-static-copy-of-a-dynamic-website/... | [
0.032744985073804855,
-0.0948462039232254,
0.12613078951835632,
-0.07576195895671844,
-0.16781620681285858,
-0.11547138541936874,
0.3168385922908783,
0.251168817281723,
-0.5014528036117554,
-0.4288148581981659,
-0.5174185037612915,
0.25506991147994995,
-0.6352279186248779,
0.11510742455720... | |
I've created a python object, but I want to send signals on it. I made it inherit from gobject.GObject, but there doesn't seem to be any way to create a new signal on my object.
You can also define signals inside the class definition:
```
class MyGObjectClass(gobject.GObject):
__gsignals__ = {
"some-signal":... | [
-0.23851461708545685,
0.11506079882383347,
0.5059467554092407,
-0.2837481200695038,
-0.2583904564380646,
0.02219275012612343,
0.1551237255334854,
0.11447929590940475,
-0.13454005122184753,
-0.5587123036384583,
-0.03197316825389862,
0.32764485478401184,
-0.3009653091430664,
0.01564517617225... | |
Is there anything like [ELMAH](http://en.wikipedia.org/wiki/ELMAH) for Windows Forms?
I'm looking for a standard way to process unhandled exceptions and grab a screenshot and other environment information before packaging that up for support.
The very same Jeff Atwood coded a nice solution (albeit in VB.NET) which I ... | [
0.2992773950099945,
0.46375572681427,
-0.20700585842132568,
0.08082304894924164,
-0.11091163754463196,
-0.14668358862400055,
0.4365518391132355,
-0.18567205965518951,
-0.25508609414100647,
-0.3293021321296692,
-0.061774805188179016,
0.17555420100688934,
-0.6167653203010559,
-0.154267191886... | |
Where is a good place to start with making an application in .NET that communicates through [OPC](http://www.opcfoundation.org/Default.aspx/01_about/01_whatis.asp)?
You can find a good article and a library to start with here: <http://www.codeproject.com/KB/COM/opcdotnet.aspx> | [
0.3988874554634094,
-0.047320105135440826,
0.1138424202799797,
0.1250208020210266,
0.42516887187957764,
-0.34812554717063904,
-0.051526524126529694,
0.3411334455013275,
-0.5909919142723083,
-0.5487890243530273,
0.07967273145914078,
0.21566976606845856,
-0.22639310359954834,
-0.052285309880... | |
I've been using make and makefiles for many many years, and although the concept
is sound, the implementation has something to be desired.
Has anyone found any good alternatives to make that don't overcomplicate
the problem?
check out [SCons](http://www.scons.org/). For example Doom 3 and Blender make uses of it. | [
1.0257797241210938,
-0.040858007967472076,
0.048900507390499115,
-0.10294727236032486,
0.2448895275592804,
-0.07185855507850647,
-0.09920445084571838,
0.1310761421918869,
-0.1904727667570114,
-0.604454755783081,
0.2922622263431549,
0.5533937811851501,
-0.03128639981150627,
0.03851721063256... | |
Has anybody experience in building a custom style in Qt? What I have in my mind is a complete new style that affects all kind of widgets. I have seen some examples in the web for a custom combo box. But I have no idea how much time and code it takes to build a "complete" new custom style ... maybe someone can give me a... | [
0.9121874570846558,
0.0861092358827591,
0.09926184266805649,
0.12177180498838425,
-0.015348714776337147,
-0.1313350647687912,
0.30840250849723816,
-0.08347970247268677,
-0.22639602422714233,
-0.5614736080169678,
0.3694470226764679,
0.6790151596069336,
-0.03692838177084923,
0.04303957521915... | |
experimentation. I also derived my style from the generic windows style, to allow it to handle some of the stuff I didn't want to mess with. All told, I think it took me a week to get most of what I wanted, with practically no prior exposure to the styles.
In order to actually develop one, I would get into the source ... | [
0.9989192485809326,
0.04390741512179375,
0.04952488839626312,
0.1085834726691246,
-0.13068421185016632,
-0.035058166831731796,
0.17331984639167786,
-0.28284114599227905,
-0.3170570433139801,
-0.43225041031837463,
0.36612263321876526,
0.6476667523384094,
-0.06093314290046692,
0.036849431693... | |
developing it, you might want to have a configuration file so you can easily change some of the values without recompiling. | [
0.4083735942840576,
-0.18000148236751556,
-0.0317370779812336,
0.3251575231552124,
0.25126218795776367,
-0.31650039553642273,
-0.35250383615493774,
-0.08688592165708542,
-0.017954304814338684,
-0.6310378313064575,
0.14349566400051117,
0.35472872853279114,
0.07955298572778702,
-0.2310722172... | |
Where can I find a guide for integrating JavaScript and JMS (Java Messaging Service)?
I would like a best practice or established technology that allows me to directly or indirectly receive messages from a topic and update a site based on the message. I was thinking of creating two components, a servlet for the Web mo... | [
0.19449970126152039,
-0.06399983167648315,
0.32517164945602417,
-0.14109286665916443,
-0.31546950340270996,
-0.33067572116851807,
0.08371972292661667,
-0.08630449324846268,
-0.44977593421936035,
-0.6296672821044922,
-0.13617070019245148,
0.4249146580696106,
-0.46264487504959106,
-0.1463037... | |
answer. Looks like it is baked in to ActiveMQ. I tried the examples and they seem to work.
<http://activemq.apache.org/ajax.html> | [
0.05413709208369255,
0.1206953153014183,
0.11951290816068649,
0.20443440973758698,
-0.2787497639656067,
-0.007980121299624443,
0.17707467079162598,
0.09269701689481735,
-0.18090026080608368,
-0.6376866102218628,
0.08328526467084885,
0.14084409177303314,
0.033730652183294296,
-0.29765230417... | |
In a JSP page, I created a `<h:form enctype="multipart/form-data">` with some elements: `<t:inputText>`, `<t:inputDate>`, etc. Also, I added some `<t:message for="someElement">` And I wanted to allow the user upload several files (one at a time) within the form (using `<t:inputFileUpload>` ) At this point my code works... | [
0.02088877744972706,
-0.0866614580154419,
0.46584418416023254,
-0.20131425559520721,
-0.40435388684272766,
-0.16369247436523438,
0.26291754841804504,
-0.2604096829891205,
-0.15881890058517456,
-0.6883888840675354,
-0.13590876758098602,
0.48708686232566833,
-0.30217477679252625,
-0.34148177... | |
`<jsp:include page="somePage.jsp">` directive)
First at all, the `<t:inputFileUpload>` fails to load the file at the value assigned in the Managed Bean UploadedFile attribute `#{myBean.upFile}`
Then, [googling for a clue](http://markmail.org/message/b4nht4f6xb74noxp "That has no answer when I readed it"), I knew that... | [
0.1743512898683548,
0.178063303232193,
0.33397719264030457,
-0.22125917673110962,
-0.22069229185581207,
-0.15933823585510254,
0.4663675129413605,
-0.12538564205169678,
-0.2755192518234253,
-0.5697174668312073,
-0.06913777440786362,
0.6627281308174133,
-0.3692086338996887,
-0.03600112721323... | |
have their ID's in part equals to they are looking for, but at the end of the ID's their names change)
At this point, I put a `<t:mesagges>` tag (note the "s" at the end) to show me all validation errors at once at the beginning of the Panel, and it works fine. So, validation errors exists and they show properly at th... | [
0.36120957136154175,
0.33288267254829407,
0.6223970651626587,
0.03813118487596512,
-0.170819491147995,
-0.03119848296046257,
0.25541770458221436,
-0.048791345208883286,
-0.16634249687194824,
-0.5762001276016235,
-0.11642811447381973,
0.708503007888794,
-0.011950741522014141,
-0.31855100393... | |
Tomahawk-1.1.6 with myFaces-impl-1.2.3 in a eclipse Ganymede project with Geronimo as Application Server (Geronimo gives me the myFaces jar implementation while I put the tomahawk jar in the WEB-INF/lib folder of application)
---
"SOLVED": This problem is an issue reported to myFaces forum.
-------------------------... | [
-0.24653831124305725,
0.09230487048625946,
0.793552041053772,
0.06801171600818634,
-0.3725549280643463,
0.22545196115970612,
0.5674875378608704,
-0.40831151604652405,
-0.1910977065563202,
-0.37019094824790955,
-0.20356504619121552,
0.8303584456443787,
-0.2949416935443878,
-0.48094755411148... | |
`<inputText id="name" forceId="true" required="true">` The `<t:message>` doesn't work.
2. Then, after looking the error messages on eclipse console, I renamed my "id" attribute to this: <inputText id="**namej\_id\_1**" forceId="true" required="true">
3. Then the `<t:message>` worked!! but after pressing the "Subm... | [
0.16848216950893402,
-0.03554124757647514,
0.5537735223770142,
-0.17465205490589142,
-0.4177977740764618,
-0.29373931884765625,
0.7193877696990967,
-0.5289548635482788,
0.18189968168735504,
-0.6794339418411255,
0.13963401317596436,
0.8898780941963196,
-0.0357590951025486,
-0.16315810382366... | |
---
**EDIT 2**
Ok, here comes the code, hope it not be annoying.
1.- **mainPage.jsp** (here is the `<t:panelTabbedPane>` and `<f:subview>` tags)
```
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ taglib prefix="t" uri="http://myfaces.ap... | [
0.05924323573708534,
0.0743502601981163,
0.7156447172164917,
0.08044873923063278,
-0.40853971242904663,
-0.15774264931678772,
0.10543836653232574,
-0.5937958359718323,
-0.18019388616085052,
-0.7198473215103149,
-0.17776182293891907,
0.5822936296463013,
-0.08383499085903168,
-0.206916466355... | |
</t:panelTabbedPane>
</h:form>
</f:view>
</body>
</html>
```
```
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ taglib prefix="t" uri="http://myfaces.apache.org/tomahawk"%>
<t:panelTab label="TAB_1">
<t:panelGri... | [
-0.1951148808002472,
-0.38483691215515137,
0.35557425022125244,
0.30426838994026184,
-0.3912678062915802,
0.14053906500339508,
-0.07741500437259674,
-0.5728316307067871,
-0.452046662569046,
-0.7301661372184753,
0.011240308173000813,
0.5102624297142029,
-0.3069628179073334,
-0.1957942247390... | |
<t:outputLabel for="ticket_id" value="TICKET ID" />
<t:inputText id="ticket_id" value="#{myBean.ticketId}" required="true" />
<t:message for="ticket_id" />
<t:outputLabel for="description" value="DESCRIPTION" />
<t:inputText id="description" value="#{myBean.ticke... | [
-0.11399136483669281,
-0.31014978885650635,
0.1786947101354599,
0.5831267833709717,
0.25541961193084717,
-0.05537157878279686,
0.015238876454532146,
-0.09248486161231995,
-0.024203304201364517,
-0.749009370803833,
-0.09029440581798553,
0.4300070106983185,
-0.36352285742759705,
0.1050895377... | |
<t:outputLabel for="attachment" value="ATTACHMENTS" />
<t:panelGroup>
<!-- This is for listing multiple file uploads -->
<!-- The panelGrid binding make attachment list grow as the user inputs several files (one at a time) --> | [
-0.0023186926264315844,
-0.26891764998435974,
0.5166059136390686,
-0.26141446828842163,
-0.4335455596446991,
0.039106711745262146,
-0.3429173231124878,
-0.3744488060474396,
-0.5347505807876587,
-0.7631307244300842,
0.09196864068508148,
0.5360491871833801,
-0.22931313514709473,
0.1157246977... | |
<t:panelGrid columns="3" binding="#{myBean.panelUpload}" />
<t:inputFileUpload id="attachment" value="#{myBean.upFile}" storage="file" />
<t:commandButton value="ADD FILE" action="#{myBean.upload}" />
</t:panelGroup>
<t:message for="attachment" />
... | [
-0.18050463497638702,
-0.33245185017585754,
0.6033723950386047,
-0.4951930344104767,
-0.2500532865524292,
0.35703349113464355,
-0.06981248408555984,
-0.526299774646759,
-0.45315754413604736,
-0.528098464012146,
-0.24272242188453674,
0.6542807817459106,
-0.4711206555366516,
-0.0550603382289... | |
action="#{myBean.create}" value="CREATE TICKET" />
</t:panelGrid>
</t:panelTab>
```
---
**EDIT 3**
On response to Kyle Renfro follow-up:
> Kyle says:
>
>
>
> > "At the first view of the page, if you press the "CREATE TICKET" button with nothing in any of the inputTexts and no files uploaded, do th... | [
0.13109982013702393,
-0.4161145091056824,
0.4864427149295807,
0.2339097112417221,
-0.04204915463924408,
-0.24869151413440704,
0.35264161229133606,
-0.3061898946762085,
-0.4184238910675049,
-0.49126070737838745,
0.007956786081194878,
0.4028971195220947,
-0.3191819489002228,
-0.3628506660461... | |
all (the message tags don't work) Even when I try to test only one validation error message (for example, testing the message for the first input text) none of them shows up.
2.- The eclipse console shows me these internal errors:
```
ERROR [HtmlMessageRendererBase] Could not render Message. Unable to find compone... | [
-0.05002493038773537,
0.06814350932836533,
0.5361104011535645,
0.22631938755512238,
-0.4461306929588318,
0.062275514006614685,
0.2141890823841095,
-0.8048927187919617,
-0.0845896303653717,
-0.4900175631046295,
-0.12720991671085358,
0.745072066783905,
-0.47584158182144165,
-0.19492445886135... | |
message and its component into an h:panelGroup or h:panelGrid.
ERROR [HtmlMessageRendererBase] Could not render Message. Unable to find component 'attachment' (calling findComponent on component 'j_id_jsp_1383779881_1:subview_tab_detail:j_id_jsp_1716158401_0j_id_1:j_id_jsp_1716158401_14j_id_1'). If the provided id wa... | [
-0.34052884578704834,
-0.25497353076934814,
0.7454341053962708,
0.0666399672627449,
-0.3832192122936249,
0.07007862627506256,
0.09129053354263306,
-0.4676501452922821,
-0.3112544119358063,
-0.5438206791877747,
-0.09160320460796356,
0.48817890882492065,
-0.5288605093955994,
-0.1337570399045... | |
version of myfaces and tomahawk that you might try. I would remove the subview functionality as a quick test - copy the detail.jsp page back into the main page.
<https://issues.apache.org/jira/browse/MYFACES-1807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12567158#action_125... | [
0.10658327490091324,
-0.01644337922334671,
0.35611817240715027,
-0.023201944306492805,
-0.25642597675323486,
0.25182846188545227,
0.29481086134910583,
0.16797778010368347,
-0.557147741317749,
-0.21945737302303314,
-0.06683569401502609,
0.5507830381393433,
-0.25141090154647827,
-0.146422564... | |
So you have a String that is retrieved from an admin web UI (so it is definitely a String). How can you find out whether this string is an IP address or a hostname in Java?
Update: I think I didn't make myself clear, I was more asking if there is anything in the Java SDK that I can use to distinguish between IPs and h... | [
-0.08958164602518082,
-0.03550754114985466,
0.15043334662914276,
0.18395701050758362,
-0.11779152601957321,
-0.4422377347946167,
0.44498446583747864,
0.03682108595967293,
-0.24071745574474335,
-0.8487381339073181,
-0.13606958091259003,
0.4406079947948456,
-0.19503094255924225,
-0.044724274... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.