instruction stringlengths 0 30k ⌀ |
|---|
If you'd like to see the contents of your %ENV, you can use Data::Dumper to print it out in a rather readable format:
perl -MData::Dumper -e 'print Dumper \%ENV'
|
I personally would go with
Company.Tests.Website
That way you have a common tests namespace and projects inside it, following the same structure as the actual project. |
On victory:
![alt text][1]
[1]: http://www.phdcomics.com/comics/archive/phd113007s.gif |
There is nothing good to be said about stored procedures. There were a necessity 10 years ago but every single benefit of using sprocs is no longer valid. The two most common arguments are regarding security and performance. The "sending stuff over the wire" crap doesn't hold either, I can certainly create a query d... |
I've found some information on [http://views-help.doc.logrus.com/][1], escpecialy this page: [http://views-help.doc.logrus.com/help/views/using-theme][2]
On fact there are two ways to theme a view : the "field" way and the "node" way. In "edit View", you can choose "Row style: Node", or "Row style: Fields".
- w... |
In fact there are two ways to theme a view : the "**field**" way and the "**node**" way. In "edit View", you can choose "`Row style: Node`", or "`Row style: Fields`".
- with the "**Node**" way, you can create a node-contentname.tpl.php wich will be called for each node in the view. You'll have access to your cck f... |
I followed the bridged networking guide at [https://help.ubuntu.com/community/KVM][1] and have the following in /etc/network/interfaces:
auto eth0
iface eth0 inet manual
auto br0
iface br0 inet static
address 192.168.0.10
network 192.168.0.0
netmask 255... |
Someone here has just suggested sudoing tee:
sudo ls -hal /root/ | sudo tee /root/test.out > /dev/null |
Someone here has just suggested sudoing tee:
sudo ls -hal /root/ | sudo tee /root/test.out > /dev/null
This could also be used to redirect any command, to a directory that you do not have access to. It works because the tee program is effectively an "echo to a file" program, and the redirect to /dev/null is t... |
erlswf is an opensource project written in erlang for decompiling .swf files.
Here's the site: http://code.google.com/p/erlswf/ |
Get the Sothink SWF decompiler. Not free, but worth it. Recently used it to decompile an SWF that I had lost the fla for, and I could completely round-trip swf-fla and back!
[link text][1]
[1]: http://www.sothink.com/ |
From your code, it looks like you have a vector of structs each of which comprises 2 ints. Could you instead use 2 vectors of ints? Then
copy(data1, data1 + count, back_inserter(v1));
copy(data2, data2 + count, back_inserter(v2));
Now you don't pay for copying a struct each time. |
SQL Express will be a huge step up from Access in capability and reliability. It shouldn't need any more configuration, just a different approach provided you know what your doing. |
Python has some features of functional programming, such as lambdas. Java does not have such functionality, and some programs would be considerably easier to write if such support was available. Thus it is sometimes easier to write the code in Python and integrate it via Jython that to attempt to write the code in Java... |
The `use constant` pragma creates a subroutine prototyped to take no arguments. While it *looks* like a C-style constant, it's really a subroutine that returns a constant value.
The `=>` (fat comma) automatically quotes left operand if its a bareword, as does the $hash{key} notation.
If your use of the constant n... |
There will be barely any difference in speed between the 2, find will return an iterator, insert does the same and will search the map anyway to determine if the entry already exists.
So.. its down to personal preference. I always try insert and then update if necessary, but some people don't like handling the pair ... |
You can take a look at [WatiN][1] if you want some source code that goes in depth in terms of automating IE. In fact it may do exactly what you are trying to do.
[1]: http://watin.sourceforge.net/index.html |
Hmm. Instead of
(0,3) (1,1), (2,2), (3,6)
I'd expect to see
(0,0), (1,3), (2,1), (3,2), (4,6) etc
Which looks rather like all the PTSes got shifted left one packet.
Are you seeing this behaviour in all mpegs or just this one? Could you post a few more packets' worth of timestamps? |
Hmm. Instead of
(0,3) (1,1), (2,2), (3,6)
I'd expect to see
(0,0), (1,3), (2,1), (3,2), (4,6) etc
Which looks rather like all the PTSes got shifted left one packet.
Are you seeing this behaviour in all mpegs or just this one? Could you post a few more packets' worth of timestamps?
BTW, the rea... |
Clearly the PhoneUserInterface interface, which you can get an implementation of from the PhoneUserFactory.CreatePhoneUser() method, has a method dial(Phone, Number) that you can use to dial the phone.
EDIT: Answering the comment. Neither. The phone should have a buttonPressed() or something like that. The user ... |
Splitting the database by features might not be a good idea unless you see strong evidence suggesting the need. Often you might need to update two databases as part of a single transactions - and distributed transactions are much more harder to work with. Furthermore, if the database needs to be split, you might be abl... |
I've used both, and while subclipse has been flaky for me, subversive (at least with a previous version) locked out an account of my coworker when he accidentally put in the wrong credentials (the network login is used to access the subversion repository). Subclipse tends to get disorganized over time, if Eclipse is n... |
Make sure that you're closing the connections with your PHP code. Also, you could increase the maximum connections allowed in /etc/my.cnf.
max_connections=500
Finally, you can login to a mysql prompt and type `show status` or `show processlist` to view various statistics with your server.
If all else fail... |
You need to use both values in the query for the combo box.
e.g. SELECT CategoryId, CategoryName FROM CategoryTable...
Bind the combo box to the fist column, CategoryId.
Set the column widths for the combo box to 0in (no second value need, so there is no limit). This will hide the first column which contains your ... |
You need to use both values in the query for the combo box.
e.g. SELECT CategoryId, CategoryName FROM CategoryTable...
Bind the combo box to the fist column, CategoryId.
Set the column widths for the combo box to 0in (no second value need, so there is no limit). This will hide the first column which contains your ... |
You need to use both values in the query for the combo box.
e.g. SELECT CategoryId, CategoryName FROM CategoryTable...
Bind the combo box to the fist column, CategoryId.
Set the column widths for the combo box to 0in (no second value need, so there is no limit). This will hide the first column which contains your ... |
I would try something like this:
public class MyClass(){
public void LoadData(IHelper helper){
SomeProperty = helper.GetSomeData();
}
This way you can mock up the helper class using for example MOQ. |
After trying a solution by the book I got stuck with incompatibility's in either Firefox or IE. So I did some tinkering and came up with this CSS. As you can see, the margins are half of the desired size and negative.
<head><title>Centered</title>
<style type="text/css">
body {
background... |
The performance problem here is the cost of creating a new function object at each iteration of the loop and not the fact that you use an anonymous function:
for (var i = 0; i < 1000; ++i) {
myObjects[i].onMyEvent = function() {
// do something
};
}
You are creating... |
The performance problem here is the cost of creating a new function object at each iteration of the loop and not the fact that you use an anonymous function:
for (var i = 0; i < 1000; ++i) {
myObjects[i].onMyEvent = function() {
// do something
};
}
You are creating... |
sgen.exe fails |
|c#|visual-studio| |
After changing the output directory of a visual studio project it started to fail to build with an error very much like:
C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin\sgen.exe /assembly:C:\p4root\Zantaz\trunk\EASDiscovery\EASDiscoveryCaseManagement\obj\Release\EASDiscoveryCaseManagement.dll /proxy... |
The best advice I could give anyone working with PHP4 is this:
error_reporting( E_ALL );
It pretty much will tell you exactly what you need to do. |
I have a bit of experience with both Haley Expert Rules and Haley Office Rules. Both nice systems, but I'd need to know a bit more abut what you want to use them for to answer definitively (See [http://www.haley.com][1])
They both support C# and Java (and I think also a web service api).
The difference between th... |
php array indexing: $array[$index] vs $array["$index"] vs $array["{$index}"] |
|php|syntax| |
What is the difference, if any, between these methods of indexing into a php array:
$array[$index]
$array["$index"]
$array["{$index}"]
Thanks! |
If $index is a string there is no difference because $index, "$index", and "{$index}" all evaluate to the same string. If $index is a number, for example 10, the first line will evaluate to $array[10] and the other two lines will evaluate to $array["10"] which is a different element than $array[10]. |
Lucida Sans Typewriter |
Making code work with register_globals turned off |
|php| |
I have inherited some legacy PHP code what was written back when it was standard practice to use register_globals. We know now that it is bad for security to have it enabled. The problem is how do I find all the places in the code where I need to use $_GET or $_POST? My only thought was to set the error reporting to wa... |
if you don't need to know this pre-render, you could always use the win32 method of getpixel, I believe.
Note: typing on iPhone in the middle of Missouri with no inet access. Will look up real win32 example and see if there is a .net equivalent. |
if you don't need to know this pre-render, you could always use the win32 method of getpixel, I believe.
Note: typing on iPhone in the middle of Missouri with no inet access. Will look up real win32 example and see if there is a .net equivalent.
In case anyone cares, and doesn't want to use the (excellent) answe... |
Ok, scratch my previous confused reply.
For a IBBPBBI movie, you'd expect the PTSes to look like this (in decoding order)
0, 3, 1, 2, 6, 4, 5, ...
corresponding to the frames
I, P, B, B, I, B, B, ...
So you appear to be missing an I at the start of your sequence but otherwise the timestamps look ... |
Thanks for that!
To summarize, this is the final code that works:
Provider class, in it's own assembly:
// the namespace used for publishing the WMI classes and object instances
[assembly: Instrumented("root/mytest")]
using System;
using System.Collections.Generic;
using System.Text;... |
wsdl.exe Error: Unable to import binding '...' from namespace '...' |
|.net|soap|wsdl| |
When running wsdl.exe on a wsdl I created, I get this error:
Error: Unable to import binding 'SomeBinding' from namespace 'SomeNS'.
- Unable to import operation 'someOperation'.
- These members may not be derived.
I'm using the document-literal style, and to the best of my knowledge I'm following al... |
When running wsdl.exe on a wsdl I created, I get this error:
Error: Unable to import binding 'SomeBinding' from namespace 'SomeNS'.
- Unable to import operation 'someOperation'.
- These members may not be derived.
I'm using the document-literal style, and to the best of my knowledge I'm following al... |
There can be a few reasons tables get corrupted, it is discussed in detail in the [manual][1].
To combat it, the following things work best:
1. Make sure you always MySQL shutdown properly
2. Consider using --myisam-recover option to automatically check/repair your tables in the event that shutdown wasn't do... |
Best Java Obfuscation Application For Size Reduction |
|mobile|obfuscation|java-me| |
An important part of mobile development, especially when you are talking about mobile games, is dealing with the application size restrictions. Some devices enforce their own size limits, while all the carriers have their own size requirements for applications to be released in their deck space.
My question is, is t... |
I actually have an alternate parallel root.
Tests.Company.Website
It works nicely for disambiguating things when you have new sub namespaces. |
I usually name test projects *Project-Tests* for brevity in Solution Explorer, and I use *Company.Namespace.Tests* for namespaces. |
Which thread should I process the RxTx SerialEvent.DATA_AVAILABLE event? |
|linux|usbserial|data-available|rxtx| |
I'm using the RxTx library over usbserial on a Linux distro. The RxTx lib seems to behave quite differently (in a bad way) than how it works over serial.
My application has several threads and one of my biggest problems is that out of nowhere, I seem to be getting one to two extra bytes on my stream. I can't fig... |
You shouldn't be detecting Chrome specifically. If anything, you should be detecting WebKit, since as far as page rendering is concerned, Chrome should behave exactly like other WebKit browsers (Safari, Epiphany).
If you need not only to detect WebKit, but also find out exactly what version is being used, see this l... |
Some examples:
Non ideomatic:
StreamReader sr = File.OpenText(path);
string content = sr.ReadToEnd();
sr.Close();
Ideomatic:
string content;
using (StreamReader sr = File.OpenText(path)) {
content = sr.ReadToEnd();
} |
Some examples:
Non ideomatic:
StreamReader sr = File.OpenText(path);
string content = sr.ReadToEnd();
sr.Close();
Ideomatic:
string content;
using (StreamReader sr = File.OpenText(path)) {
content = sr.ReadToEnd();
}
Non ideomatic:
for (int i=0;i<list.Count; i++)... |
Some examples:
**Ressource management**, non ideomatic:
StreamReader sr = File.OpenText(path);
string content = sr.ReadToEnd();
sr.Close();
Ideomatic:
string content;
using (StreamReader sr = File.OpenText(path)) {
content = sr.ReadToEnd();
}
**Iteration**, non ideoma... |
I personally like Visual Studio combined with a third party add-in such as Visual Assist (http://www.wholetomato.com/). I've tried a few of the others and always ended up back with Visual Studio. Plus, Visual Studio is a widely used product in development industries, so having experience using it can only be a plus. |
We find that [Hudson][1] is a great CI server that can perform builds from source control as needed. As it is written in Java it can run on your target platform of choice and as the interface is web based you can control it from anywhere. There are plugins to do most things you want to do and best of all it is free!
... |
[Hyper Estraier][1].
[1]: http://hyperestraier.sourceforge.net/ |
The easiest way to do it is sign up for <a href="http://www.google.com/analytics/">Google Analytics</a> and add their tracking code to your site (there are a number of similar services, but Google's one is the best I've found). It gives you detailed statistics as to what browsers people who visit your site use.
Onc... |
The easiest way to do it is sign up for <a href="http://www.google.com/analytics/">Google Analytics</a> and add their tracking code to your site (there are a number of similar services, but Google's one is the best I've found). It gives you detailed statistics as to what browsers people who visit your site use.
Onc... |
Can you provide a code sample of how you're calling the webservice? If it's a web service with a published WSDL I don't know why you'd even have to address this level of implementation detail, so I have a suspicion that you're calling it wrong somehow. |
You shouldn't need to worry about client credentials and just use the SmtpClient as suggested by Esterban. You will need the user to provide a valid Smtp server url at configuration, but most ISPs allow anonymous smtp providing you are on their network (one of their clients) - as long as the user puts in the url for th... |
You shouldn't need to worry about client credentials and just use the SmtpClient as suggested by Esteban. You will need the user to provide a valid Smtp server url at configuration, but most ISPs allow anonymous smtp providing you are on their network (one of their clients) - as long as the user puts in the url for the... |
Is it possible to integrate SSRS reports with webforms |
|reporting| |
Is it possible to integrate SSRS reports to the webforms..an example will be enough to keep me moving. |
I echo the above statements. Jinja 2 is a pretty good superset of Django templates for general use. I think they're working on making the Django templates a little less coupled to the settings.py, but Jinja should do well for you. |
I would say that an application tends to be used interactively, where a script would run its course, suitable for batch work. I don't think it's a concrete distinction. |
A script tends to be a series of commands that starts, runs, and terminates. It often requires no/little human interaction. An application is a "program"... it often requires human interaction, it tends to be larger. |
Normally, derived files should not be stored in version control. In your case, you could build a release procedure that created a tarball that includes the derived files.
As you say, keeping the derived files in version control only increases the amount of noise you have to deal with. |
Pek, there are many things to worry about an addition to sql injection, or even different types of code injection. Now might be a good time to look a little further into web application security in general.
From a previous question on [moving from desktop to web development][1], I wrote:
The [OWASP Guide to Build... |
Pek, there are many things to worry about an addition to sql injection, or even different types of code injection. Now might be a good time to look a little further into web application security in general.
From a previous question on [moving from desktop to web development][1], I wrote:
>The [OWASP Guide to Buil... |
What you described is indeed classified as a [Cutting Stock](http://en.wikipedia.org/wiki/Cutting_stock_problem) problem, as [Wheelie](http://stackoverflow.com/users/1131/wheelie) mentioned, and not a [Bin Packing](http://en.wikipedia.org/wiki/Bin_packing) problem because you try to minimize the waste (sum of leftovers... |
We don't version files that can be automatically generated using scripts included in the repository itself. The reason for this is that after a checkout, these files can be rebuild with a single click or command. In our projects we always try to make this as easy as possible, and thus preventing the need for versioning... |
|mobile|java-me|obfuscation| |
An important part of mobile development, especially when you are talking about mobile games, is dealing with the application size restrictions. Some devices enforce their own size limits, while all the carriers have their own size requirements for applications to be released in their deck space.
My question is, is t... |
You have to concat both the text of your message and the uuencoded attachment:
$ subject="Something happened"
$ to="somebody@somewhere.com"
$ body="Attachment Test"
$
$ cat >msg.txt <<EOF
> The message is ready to be sent with the following file or link attachments:
>
> somefil... |
You have to concat both the text of your message and the uuencoded attachment:
$ subject="Something happened"
$ to="somebody@somewhere.com"
$ body="Attachment Test"
$ attachment=/path/to/somefile.csv
$
$ cat >msg.txt <<EOF
> The message is ready to be sent with the following file or... |
You have to concat both the text of your message and the uuencoded attachment:
$ subject="Something happened"
$ to="somebody@somewhere.com"
$ body="Attachment Test"
$ attachment=/path/to/somefile.csv
$
$ cat >msg.txt <<EOF
> The message is ready to be sent with the following file or... |
Some examples:
**Ressource management**, non ideomatic:
StreamReader sr = File.OpenText(path);
string content = sr.ReadToEnd();
sr.Close();
Ideomatic:
string content;
using (StreamReader sr = File.OpenText(path)) {
content = sr.ReadToEnd();
}
**Iteration**, non ideoma... |
Get IFile from IWorkspaceRoot and location String |
|java|eclipse| |
This is an Eclipse question, and you can assume the Java package for all these Eclipse classes is `org.eclipse.core.resources`.
I want to get an `IFile` corresponding to a location `String` I have:
"platform:/resource/Tracbility_All_Supported_lib/processes/gastuff/globalht/GlobalHTInterface.wsdl"
I have... |
I'm a big fan of structuring the test namespace like this:
**Company.Tests.Website.xxx**
**Company.Tests.Website.Controls**
Like you, I think of the tests as a parallel namespace structure to the main code and this provides you with that. It also has the advantage that, since the namespace still starts with yo... |
The searching for %ENV is a feature of the pager named 'less', not of perldoc. So if perldoc uses a different pager, this might not work.
Activestate Perl comes with HTML documentation, you can open perlvar in your browser, hit Ctrl+f and type %ENV, then hit enter. |
I'm not a PERL programmer, but here's a little extra feature you might want to investigate. Have a look at the concept of external tables in Oracle. You create a table with a definition of something similar to the following:-
> CREATE TABLE MY_TABLE
(
COL1 NUMBER(2),
COL2 VARCHAR2(20 BYTE)... |
I don't have any experience with Hyperion, but can use make use of the Script Task in SSIS? |
TCP is fine if your run on a LAN. But if you want to play online, you must use UDP and implement your own TCP-like layer: it's necessary to pass throw NAT routers.
You need to choose between Peer-to-peer or Client-Server communication. In Client-Server model, synchronisation and state of the world are easier to impl... |
You can specify this in your application's manifest file.
Check out [this link][1] and [this link][2] and [this link][3] too.
[1]: http://petesbloggerama.blogspot.com/2007/04/making-your-assembly-run-as.html
[2]: http://www.enusbaum.com/blog/2007/08/26/how-to-run-your-c-application-as-administrator-in-wind... |
I would also recommend using DataSets. They are really easy to use, just few mouse clicks, without writing any code and good enough for small apps. |
Does anything on the [s3 library page][1] cover what you need? There are loads of examples there.
[1]: http://amazon.rubyforge.org/ |