instruction stringlengths 0 30k ⌀ |
|---|
For writing scripts for process automisation in Linux platform, which scripting language will be better? Shell script, Perl or Python or is there anything else? I am new to all of them. So, am just thinking to which one to go for? |
|scripting|language| |
Does it have to be distributed? Supposedly the one big benefit subversion has to the newer, distributed VCSes is its superior ability to deal with binary files. |
I have been getting Python recommended all the time. It's supposed to let you do anything. For the small tasks i use shell scripts though. |
I'd recommend **bash, awk, and sed.**
**bash** - http://tldp.org/LDP/abs/html/
**awk** - http://www.uga.edu/~ucns/wsg/unix/awk/
**sed** - http://www.ce.berkeley.edu/~kayyum/unix_tips/sedtips.html
Just some ideas. |
On Linux? Choose your poison, basically. I like Python, others Ruby, still others Perl. Pick one and go for it. :-) |
You can use SSL connection between Oracle client and Oracle database. To configure SSL between oracle client and server using JDBC:
At server side:
1) First of all, the listener must be configured to use the TCPS protocol:
LISTENER = (ADDRESS_LIST= (ADDRESS=(PROTOCOL=tcps)(HOST=servername)(PORT=2484)))
WALL... |
You really have to weigh your worst case senario of someone obtaining those email addresses, the likelihood of someone obtaining them, and your extra effort/time needed to impliement the change. |
You can achieve that. Think of two components that communicate with each other through network. One component can run on Windows while other on Unix. Isn't that 100% decoupling?
|
I think it depends on how complex the tasks are you want to automate. Personally, I've always gone with shell-scripts, which enables you to call on awk, sed, grep, find, ls, cat, etc. which can be combined together to do pretty much anything you can achieve using perl or python. On the other hand, if the processes you ... |
http://www.projectsprouts.org is something you should definitely look at. It automates project creation for as2 and as3, downloads libraries if you don't have them (like mtasc, or the Flex compiler) and so allows you to compile swfs without the Flash IDE.
Of course this is not exactly what you were asking - I'd say ... |
If all cases of T derive from a known base class you can let the compiler know that with:
public void MyMethod<T>(T myArgument) with T : MyBase
The compile then recognizes how to perform operations on `MyBase` and will not throw the "Operator '==' cannot be applied to operands of type 'T' and 'T'" error that ... |
I was able to locate a [Microsoft Connect article][1] that discusses this issue in some detail:
> Unfortunately, this behavior is by design and there is not an easy solution to enable use of with type parameters that may contain value types.
>If the types are known to be reference types, the default overload of d... |
I was able to locate a [Microsoft Connect article][1] that discusses this issue in some detail:
> Unfortunately, this behavior is by design and there is not an easy solution to enable use of with type parameters that may contain value types.
>If the types are known to be reference types, the default overload of d... |
Use the following (remember to include System.Configuration assembly)
ConfigurationManager.OpenExeConfiguration(exePath) |
An alternative is to not just dump the return from the Ajax call into the DOM using InnerHTML.
You can insert each node dynamically, and then the script will run.
Otherwise, the browser just assumes you are inserting a text node, and ignores the scripts.
Using Eval is rather evil, because it requires another i... |
How to play WMV in a WindowMediaPlayer activeX controlled by a flash component? |
|flash|video|wmp| |
How to play WMV in a WindowMediaPlayer activeX controlled by a flash component?
I've seen it done here: http://sport5.co.il/
Does anyone know how?
|
With Java 5 variable args, so you don't have to stuff all your strings into a collection or array explicitly:
import junit.framework.Assert;
import org.junit.Test;
public class StringUtil
{
public static String join(String delim, String... strings)
{
StringBuilde... |
You can set it by creating a new app domain:
AppDomainSetup domainSetup = new AppDomainSetup();
domainSetup.ConfigurationFile = fileLocation;
AppDomain add = AppDomain.CreateDomain("myNewAppDomain", securityInfo, domainSetup);
|
How can I delete a service in Windows? |
|windows|system-administration|service|administration| |
I have a couple old services that I want to completely uninstall. How can I do this? |
Yes, you can redefine the syntax so that Lisp becomes a compiler. You do this using "Reader Macros," which are different from the normal "Compiler Macros" that you're probably thinking of.
Common Lisp has the built-in facility to define new syntax for the reader and reader macros to process that syntax. This process... |
It really depends on why you are asking in the first place.
If you just want to parse a number and don't know if it is a float or an integer, then just parse a float, it will correctly parse an integer as well.
If you actually want to know the type, maybe for triage, then you should really consider testing the t... |
Nothing prevents the provider from holding your account to ransom. You should pick a provider that you know to be reliable. Or, if you trust nobody but yourself, you can be your own provider:
[http://wiki.openid.net/Run_your_own_identity_server][1]
[1]: http://wiki.openid.net/Run_your_own_identity_server |
See the Stack Trace facility in [ACE][1] (ADAPTIVE Communication Environment). It's already written to cover all major platforms (and more). The library is BSD-style licensed so you can even copy/paste the code if you don't want to use ACE.
[1]: http://www.cs.wustl.edu/~schmidt/ACE.html |
$$ is the pid (process id) of the shell interpreter running your script. It's different for each process running on a system at the moment, but over time the pid wraps around, and after you exit there will be another process with same pid eventually.As long as you're running, the pid is unique to you.
From the defin... |
Passing data to Master Page in ASP.NET MVC |
|c#|.net|asp.net|asp.net-mvc| |
What is your way of passing data to Master Page (using ASP.NET MVC) without breaking MVC rules?
Personally, I prefer to code abstract controller (base controller) or base class which is passed to all views. |
In general, you implement the ICloneable interface and implement Clone yourself.
C# objects have a built-in MemberwiseClone method that performs a shallow copy that can help you out for all the primitives.
For a deep copy, there is no way it can know how to automatically do it. |
Note that one source of leaks with **reference-counting smart pointers** are pointers with **circular dependancies**. For example, A have a smart pointer to B, and B have a smart pointer to A. Neither A nor B will be destroyed. You will have to find, and then break the dependancies.
If possible, use boost smart poin... |
It looks to me that `KP_P`, `KP_G`, `KP_Q` are for DSS keys (Digital Signature Standard?). For Diffie-Hellman it looks like you're supposed to use `KP_PUB_PARAMS` and pass a `DATA_BLOB` that points to a `DHPUBKEY_VER3` structure.
Note that the article you're pointing to is from the Windows Mobile/Windows CE SDK. It ... |
There are dozens of C++ implementations of the XML-RPC specification. For example, besides XmlRpc++ there is also [XML-RPC for C and C++][1]. The actual XML-RPC specification is rather simple so it would be possible, with a cup of coffee and a rainy day, to implement your own XML-RPC client library. Not to mention, it ... |
There are dozens of implementations of the XML-RPC [implementations][1], some in C++, but most in other languages. For example, besides XmlRpc++ there is also [XML-RPC for C and C++][2]. Here is a [HOWTO][3] on how the XML-RPC for C and C++ library can be used.
The XML-RPC specification is somewhat simple and it wou... |
Does anyone have a good resource for mobile CSS templates that work on most phones/devices? |
|css|templates|mobile| |
More and more mobile devices are consuming content on my eCommerce sites. IPhones, Blackberries, PSPs, Windows Mobile, etc and I need some ideas how to handle repurposing my data using CSS templates for these devices. Any ideas would be great. |
You can achieve what you want by using a generic with an appropriate constraint, like the following:
abstract class Animal<LegType> where LegType : Leg
{
public abstract LegType GetLeg();
}
abstract class Leg { }
class Dog : Animal<DogLeg>
{
public override ... |
1. Why: Because in previous versions of Delphi the typed constants were assignable by default to preserve compatibility with older versions where they were always writeable (Delphi 1 up to early Pascal).
The default has now been changed to make constants really constant…
2. Compiler switch: {$J+} or {$J-} {$WRITE... |
Any IDE will work fine.
Netbeans and Eclipse are java based but have plugins for C/C++ |
I am not sure if you are building web applications without the need for JavaScript, but if you are I have found the wikibooks very helpful:
http://en.wikibooks.org/wiki/XQuery
http://en.wikibooks.org/wiki/XForms
The XQuery book uses the eXist-db.org XML database which I have found to be a great learning tool.
... |
FWIW: I have never had good luck with GCJ, I have had a lot of problems using it and have has some obscure issues pop up that took forever to diagnose to GCJ rather than me (I am always very very reluctant to blame things on external libraries). I will openly admit this happened several years ago and I have never wante... |
FWIW: I have never had good luck with GCJ, I have had a lot of problems using it and have had some obscure issues pop up that took forever to diagnose to GCJ rather than me (I am always very very reluctant to blame things on external libraries). I will openly admit this happened several years ago and I have never wante... |
While, as has been said, it doesn't make THAT much difference if you get it wrong, some folks do use correct capitalization (or at least, NOT referring to 'PERL' or any of the more sensible backcronyms) as a shibboleth for clue in job ads. :) |
Escaping the path with apostrophes is correct, but the start command takes a parameter containing the title of the new window. This parameter is detected by the surrounding apostrophes, so your application is not executed.
Try something like this:
start "Dummy Title" "c:\path with spaces\app.exe" param1 "param... |
"I Don’t see ya..".Replace( "’", string.Empty);
How did that junk get in there the first place? That's the real question. |
There is never any need for conversion. A `BSTR` pointer points to the first character of the string and it is null-terminated. The length is stored before the first character in memory. `BSTR`s are always Unicode (UTF-16/UCS-2). There was at one stage something called an 'ANSI BSTR' - there are some references in lega... |
Professional Excel Development
This book showed how to make high quality applications within one of the most ubiquitous programming platforms available. |
There is no single-best Perl distribution. [Vanilla Perl](http://vanillaperl.com) (relocatable, redistributable Perl), and it's more-developer-friendly [Strawberry Perl](http://strawberryperl.com/) have significant potential.
However, there is a very good reason why [ActivePerl](http://activestate.com/perl) is so ve... |
Is there a good .net library for 3-way comparison of HTML that can be used for merge? |
|c#|.net|merge|class-library|difference| |
In order to merge independant HTML changes, I'm looking for recomendations for a 3-way comparison / merge library for HTML. The common 3-way text merge algorithms perform poorly because they do not understand the tree like structure of HTML and XML. Of course, such a library must understand the looser syntax of HTML,... |
|.net|merge|class-library|diff| |
|.net|diff|merge| |
Sometimes the simplest things works best.
Can you just add an id field to the Vertex object and assign it a number in order of construction?
static int sNextId = 0;
int getNextId() { return ++sNextId; }
|
<div style="position: relative; width: 250px;">
<div style="position: absolute; top: 0; right: 0; width: 100px; text-align:right;">
here
</div>
<div style="position: absolute; bottom: 0; right: 0; width: 100px; text-align:right;">
and here
</div>
... |
The problem with "select *" is the possibility of bringing data you don't really need. During the actual database query, the selected columns don't really add to the computation. What's really "heavy" is the data transport back to your client, and any column that you don't really need is just wasting network bandwidth ... |
[Resharper][1] does this, and not just with methods. It also does it with using statements, variables etcetera.
HTH,
Kent
[1]: http://www.jetbrains.com/resharper/ |
While explicitly listing columns is good for performance, don't get crazy.
So if you use all the data, try SELECT * for simplicity (imagine having many columns and doing a JOIN... query may get awful). Then - measure. Compare with query with column names listed explicitly.
Don't speculate about performance, **mea... |
"Java Property Support" is proposed for Java 7.
See [http://tech.puredanger.com/java7#property][1] for more links and info, if interested.
[1]: http://tech.puredanger.com/java7#property |
You'll encounter a very subtle problem here because most video and audio formats (especially in ordinary containers) use "global headers," meaning at the start of the file they have a single header which specifies compression information (like width, height, etc) for the whole file. Concatting two streams will clearly... |
Testing ladder logic |
|testing|logic|plc|ladder| |
We all know the various ways of testing OO systems. However, it looks like I'll be going to do a project where I'll be dealing with PLC ladder logic (don't ask :/), and I was wondering if there's a good way of testing the validity of the system.
The only way I see so far is simply constructing a huge table with all ... |
For gcc, this is rather easy:
LazyType* GetMyLazyGlobal() {
static const LazyType* instance = new LazyType();
return instance;
}
GCC will make sure that the initialization is atomic. For VC++, this is not the case. :-(
One major issue with this mechanism is the lack of testability: i... |
There was an effort to bring mixins into Java. Check this link out: [http://www.disi.unige.it/person/LagorioG/jam/][1]
[1]: http://www.disi.unige.it/person/LagorioG/jam/ |
I've had great success using doxygen. For best results (particularly when creating documentation for c++) install graphviz and enable in your doxygen configuration file.
This will automatically generate dependency maps and class diagrams that are linked to the rest of the html documentation.
|
Help in creating Zip files from .Net and reading them from Java |
|.net|java|interop|zip| |
I'm trying to create a Zip file from .Net that can be read from Java code.
I've used SharpZipLib to create the Zip file but also if the file generated is valid according to the CheckZip function of the #ZipLib library and can be successfully uncompressed via WinZip or WinRar I always get an error when trying to unco... |
It looks to me that `KP_P`, `KP_G`, `KP_Q` are for DSS keys (Digital Signature Standard?). For Diffie-Hellman it looks like you're supposed to use `KP_PUB_PARAMS` and pass a `DATA_BLOB` that points to a `DHPUBKEY_VER3` structure.
Note that the article you're pointing to is from the Windows Mobile/Windows CE SDK. It ... |
From marketing point of view:
1) Make it template*able*.
2) Make CMS SEF and have SEOed URLs. |
Have you tried using the aspnet_compiler.exe in your .net framework directory? I'm pretty sure you can create a "deploy ready" version of a web application or web site. |
- pointers to class methods
- The "typename" keyword |
I have seen it done with other implementations of TDataSet, namely in the [Asta][1] components. These would contact the server, return immediately, and then fire an event once the data had been loaded.
However, I believe it depends very much on the component. For example, those same Asta components could not be op... |
The only time I've seen Visual Studio do something close to this is when the XML/HTML in question is invalid, for example you are missing a closing tag somewhere. |
What the best way to remotely reset the server cache in a web farm? |
|caching| |
Each of our production web servers maintains its own cache for separate web sites (ASP.NET Web Applications). Currently to clear a cache we log into the server and "touch" the web.config file.
Does anyone have an example of a safe/secure way to **remotely** reset the cache for a specific web application? Ideally ... |
Each of our production web servers maintains its own cache for separate web sites (ASP.NET Web Applications). Currently to clear a cache we log into the server and "touch" the web.config file.
Does anyone have an example of a safe/secure way to **remotely** reset the cache for a specific web application? Ideally ... |
What is the best way to remotely reset the server cache in a web farm? |
I'm using NetBeans with success right now.
|
[Eclipse][1] and [NetBeans][2] are both good options. If you don't mind paying a little, so is [IntelliJ IDEA][3] (an academic license costs $99).
[1]: http://eclipse.org
[2]: http://netbeans.org
[3]: http://jetbrains.org |
It's to minimize the difference between methods and functions. It allows you to easily generate methods in metaclasses, or add methods at runtime to pre-existing classes.
e.g.
>>> class C(object):
... def foo(self):
... print "Hi!"
...
>>>
>>> def bar(self):
... p... |
I like to quote Peters' Zen of Python. "Explicit is better than implicit."
In Java and C++, 'this.' can be deduced, except when you have variable names that make it impossible to deduce. So you sometimes need it and sometimes don't.
Python elects to make things like this explicit rather than based on a rule. ... |
Change command Method for Tkinter Button in Python |
|python|user-interface|tkinter| |
I create a new Button object but did not specify the `command` option upon creation. Is there a way in Tkinter to change the command (onclick) function after the object has been created? |
You're trading off database size with query simplicity (and probably performance)
Your current model gives simple queries, as its pretty easy to query for number of guests, vacancies in room X on night n, and so on, but the database size will increase fairly rapidly.
Moving to a start/stop or start/num nights model w... |
You're trading off database size with query simplicity (and probably performance)
Your current model gives simple queries, as its pretty easy to query for number of guests, vacancies in room X on night n, and so on, but the database size will increase fairly rapidly.
Moving to a start/stop or start/num nights mod... |
You could perform all of your queries against a view that contains the `WHERE IS_DELETED='0'` clause. |
There is also another very simple answer: according to the [zen of python](http://www.python.org/dev/peps/pep-0020/), "explicit is better than implicit". |
Java editing tends to go one of two ways; people either stick with a simple editor and use a terminal to compile/run their programs, or they use a big IDE with a zillion features.
I usually go the simple route and just use a plain text editor and terminal, but there's still a lot to be said for IDEs. This is especi... |
Yes, you can redefine the syntax so that Lisp becomes a compiler. You do this using "Reader Macros," which are different from the normal "Compiler Macros" that you're probably thinking of.
Common Lisp has the built-in facility to define new syntax for the reader and reader macros to process that syntax. This process... |
Computationally efficient three dimensional arrays in C |
|c|arrays|numerical|multidimensional-array| |
I am trying to solve numerically a set of partial differential equations in three dimensions. In each of the equations the next value of the unknown in a point depends on the current value of each unknown in the closest points.
To write an efficient code I need to keep the points close in the three dimensions close ... |