I have to write a UDP client. Unfortunately, the source system is not always available
Is there a simple tool out there that I can use to create a fake UDP server/traffic on my machine?
Hey,
I need a method to get the data from an external editor.
def _get_content():
from subprocess import call
file = open(file, "w").write(some_name)
call(editor + " " + file, shell=True)
file.close()
file = open(file)
x = file.readlines()
[snip]
I personally think this is a very ugly way. You see I need to interact with an external editor and get the data.
Do you know any better approaches/have better ideas?
I know this is a strange question but the idea is simple: I prefer C# syntax rather than C++:
-Setters and getters directly inside a property
-interfaces
-foreach statement
-possibility to declare an implicit cast operator
other small things...
What I really don't know is if is possible to import a c++ dll (expecially std libraries) in C# if I don't use any namespace (even System)
The idea is just to write a program using everything that you will normally use in C++ (nothing from CLR so), even printf for example
Thanks for any answer
I know how to do plugins, but how do I do nested options like:
var defaults = {
spacing:10,
shorten_to:50,
from_start:0,
from_end:2,
classes: {
test:'testing'
}
};
i know that isn't right, i just dont know how to write the proper syntax when I want to do something like this:
$('#breadcrumbs').breadcrumbs({classes{test:'new_example'},spacing:12})
other suggestions are welcome, im in need of the ability to custom class names and there are 7, so rather than making something like test_class, example_class, etc id like it cleaner and neater like the example above.
It's been ages since I last used Access as a back end but I'm being forced to. I'm using Enterprise Library 4.1, the Data Access Application Block.. with .NET 3.5 and I wanted to know the best way (code sample if possible) to write an insert query that will automatically give me the newly inserted auto-number back..or if it's not possible to do it in one step, how do you recommend doing it?
thanks for your help.
page contents:
aa<b>1;2'3</b>hh<b>aaa</b>..
.<b>bbb</b>
blabla..
i want to get resulet:
1;2'3aaabbb
match tag is <b> and </b>
how to write this regex use javascript?
thanks!
I need to write a sql statement to select all users ordered by lastname, firstname. This is the part I know how to do :) What I don't know how to do is to order by non-null values first. Right now I get this:
null, null
null, null
p1Last, p1First
p2Last, p2First
etc
I need to get:
p1Last, p1First
p2Last, p2First
null, null
null, null
Any thoughts?
I know this is probably possible using Streams, but I wasn't sure the correct syntax.
I would like to pass a string to the Save method and have it gzip the string and upload it to Amazon S3 without ever being written to disk. The current method inefficiently reads/writes to disk in between.
The S3 PutObjectRequest has a constructor with InputStream input as an option.
import java.io.*;
import java.util.zip.GZIPOutputStream;
import com.amazonaws.auth.PropertiesCredentials;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.services.s3.model.PutObjectRequest;
public class FileStore {
public static void Save(String data) throws IOException
{
File file = File.createTempFile("filemaster-", ".htm");
file.deleteOnExit();
Writer writer = new OutputStreamWriter(new FileOutputStream(file));
writer.write(data);
writer.flush();
writer.close();
String zippedFilename = gzipFile(file.getAbsolutePath());
File zippedFile = new File(zippedFilename);
zippedFile.deleteOnExit();
AmazonS3 s3 = new AmazonS3Client(new PropertiesCredentials(
new FileInputStream("AwsCredentials.properties")));
String bucketName = "mybucket";
String key = "test/" + zippedFile.getName();
s3.putObject(new PutObjectRequest(bucketName, key, zippedFile));
}
public static String gzipFile(String filename) throws IOException
{
try {
// Create the GZIP output stream
String outFilename = filename + ".gz";
GZIPOutputStream out = new GZIPOutputStream(new FileOutputStream(outFilename));
// Open the input file
FileInputStream in = new FileInputStream(filename);
// Transfer bytes from the input file to the GZIP output stream
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
in.close();
// Complete the GZIP file
out.finish();
out.close();
return outFilename;
} catch (IOException e) {
throw e;
}
}
}
I have a WPF textBox that is declared as ReadOnly
<TextBox IsReadOnly="True" IsTabStop="False" Width="200" />
So, User can not write anything into the TextBox or delete the content but it still allows user to drag the text from this textbox and drop it in any other textbox that caused the text removed from the first textbox(the read-only one) and thats unexpected. Is it a bug?
how can I get rid of this?
Dear Gurus,
I'm working on a Kernel module and i'm trying to Uniquely identify each one of the users trying to open() the module ( can be either processes or threads ).
what is the best way to identify them? is there an ID i can get from a system call?
i wish to get all users in a list that specifies whether they're trying to open the module for read \ write and i need to know which one tried acting...
many many thanks.
in regards,
IK
I'm playing around trying to write a client for a site which provides data as an HTTP stream (aka HTTP server push). However, urllib2.urlopen() grabs the stream in its current state and then closes the connection. I tried skipping urllib2 and using httplib directly, but this seems to have the same behaviour.
Is there a way to get the stream to stay open, so it can be checked each program loop for new contents, rather than waiting for the whole thing to be redownloaded every few seconds, introducing lag?
Fill in the X,Y,Z please.
Software validation has X,Y,Z steps.
Client have to provide X,Y,Z to the developer before starting to write software.
When software finished, validation completes with doing X,Y,Z (sign, approval, test
pictures, logs etc.).
If we buy a general software like invoice management tool or SAP module which can modify/change for every customer, who should make the software validation?
I don't seem to find a tool for it, nor an odbc driver.
Thanks
UPDATE : I'm aware of the sql scripting possibilities. But than again : how to script a sql 2k table? (not just ddl, but data also?)
Of course you can write this all by yourself, but importing data into CE cannot be such a hassle, or can it ?
UPDATE2 : I don't seem to be able to choose the right dialect for inserting
Hi,
I have an application that write huge .csv files about the size ranging from 1 GB to 2 GB.
I need to color code the file and save it as .xlsx.
So I have tried using Excel Interop and it works great for small files, but when I try to open a 1.3 GB .csv file with Excel, I get an Hresult error.
Any ideas as to how I could accomplish this task either with using Excel, or if there is any other way of doing it.
Thanks!
Hi,
I run the following to unzip and want to over write the current files if they exist but the microsoft solution found here(http://msdn.microsoft.com/en-us/library/ms723207%28VS.85%29.aspx) doesn't seem to work. I haven't found anything that says it works so is there a work around to select the 'yes to all' option?
$zipPackage = (new-object -com shell.application).NameSpace($zipfilename)
$destinationFolder = (new-object -com shell.application).NameSpace($destination)
$destinationFolder.CopyHere($zipPackage.Items(),16)
Thanks
I'm trying to write a rule to make that one can generalize, since multiple pages to pass the values are different. Right now I could do:
RewriteRule ^forum/([^/]{1,255})/([\+]{1})/((([a-z]+)([_]{1})([a-zA-Z0-9]+)([/]?))+)$ forum.php?name=$1&$5=$7 [L]
To address such as:
Nome+del+Forum/+/page_1/action_do
Should return:
forum.php?name=Nome+del+Forum&page=1&action=do
Instead, take only the last parameter (in this case action=do):
forum.php?name=Nome+del+Forum&action=do
How can I fix? Thanks in advance!
How do you sink both the console input and the console output to a text file?
Take the following code:
sink("temp.txt")
1:10
sink()
It will write a text file that looks like this:
[1] 1 2 3 4 5 6 7 8 9 10
But how do I create a text file that looks like this:
> 1:10
[1] 1 2 3 4 5 6 7 8 9 10
I've looked at ?sink and searched R-help.
I'm having the following problem; I have a clk at 50MHz, but I want something else to run with a posedge signal whenever ready, but for some reason it always goes at the 50MHz, although I explicitly write otherwise, do you guys have any suggestions?
Is there a kind of "between" check I can use in an if-statement that verifies whether a given float value is between two others?
Can I write something like
if (floatConstA <= checkFloatValue < foatConstB) {
or must I do this using AND/OR constructs?
This is a simple one. I want to replace a sub-string with another sub-string on client-side using Javascript.
Original string is 'original READ ONLY'
I want to replace the 'READ ONLY' with 'READ WRITE'
Any quick answer please? Possibly with a javascript code snippet...
Hello;
I need to write an application which is to calculate the estimated driving distance between two UK addresses; I think I can use Google as following:
http://maps.google.com/maps/nav?q=from:London%20to:Dover
However, anyone knows what is the daily/monthly limit of querying the database from a single IP address?
I need to implement in a commercial application (freight services), is there any reliable alternative?
Development language/platform: C#, .NET
Regards,
hey folks,
Can someone help me with this Java problem?
I want to write a method that takes two strings as arguments and returns true if each character (including space and punctuation) that appears in one string also appears in the other.
Thanks
I am doing something like this in javascript to print a section of my page on click of a link
function printDiv() {
var divToPrint = document.getElementById('printArea');
newWin= window.open();
newWin.document.write(divToPrint.innerHTML);
newWin.print();
newWin.close();
}
It works great in Firefox but not in IE.
Could someone please help
Is it possible to talk to Microsoft's Crypto API from a client side application in a browser? What should I know? Where should I start? I am looking to make a dummy application where a user can write a message and sign it with his private key, all through his browser using CAPI.
Thanks