randomly generate n of each of two types
I need access to 2*n random choices for two types
subject to a constraint that in the end I have
drawn n of each. I first tried::
types = typelist*n
for next_type in types:
This works but has some obvious costs.
To avoid those I considered this instead::
type0, type1 = typelist
ct0, ct1 = 0,0
if random.random() < ((n-ct0)/(2*n-ct0-ct1)):
next_type = type0
ct0 += 1
...Two-NIC, two-gateway setup
We have a setup in a colocation facility with a server running Windows
2003 (Web Edition) and a Netscreen-5GT firewall/VPN. The Windows
machine has two network cards, one of which is plugged directly to the
Internet, the other of which is plugged into the Netscreen. Here is a
------------------ NIC1| | NS = Netscreen-5GT FW
/ | | W = W2K3 server
Internet | W | NIC1 = 1st NIC (live net)
\ | | NIC2 = 2nd NIC (private net)
...Mainframe SAS program sample
Can someone publish here a sample of SAS mainframe program? I worked
with a maiframe SAS long time ago and want to prepare for an
...How to just plot the intersection of two regions?
Sorry, I post this message again because I really need know if there
is a solution in MATLAB about the following question.
It is easy to overlay(that is, union) two graphs in MATLAB. Who knows
how to just plot the intersection area of two graphs in MATLAB? Is
there a built-in function that we can use?
This question comes from that I have a contour plot, which is a
rectangle. But I want to plot just a part of a contour that is
restricted by a circle or an ellipse (anyway, the boundary is
...Keeping two lists aligned after processing #2
I have a population of five algorithms. Each Alg has a method,
Alg.accuracy(), which calculates its accuracy. Running the accuracy
method on each Alg, I end up with a list of accuracies like [0.75,
0.10, 0.45, 0.80, 0.45]
Now I want to store the algorithms and associated accuracies in a
file, in descending order of accuracy.
Here's how I do it now. There must be a better way! This method is
inelegant, and does not handle at all the issue of what to do with
duplicate accuracies, such as the two different algorithms with 0.45
accuracies in the example above. It merely sa...Two-column layout
I am experiencing a problem with a two-column layout -- apparently I
am not the first person, but the solutions I found in GG did not
give me what I was looking for.
The page should be as follows:
.. +----------+-------+ .
.. I Logo + sloganI .
.. +----+-----+-------+ .
.. I I I .
.. I N I I .
.. I I content I .
.. +----+ I .
.. I I .
.. I I .
.. I I .
.. +-----...Hotsyncing two PDAs on one PC?
My wife has a Sony Clie, which she hotsyncs on our HP. I want to get a PDA
myself. Do PDAs come with something akin to a signature so that desktops can
distinguish one handheld from the next? To minimize frustration, should I by
default stick with the same brand already on my PC? Would we be able to
share a cradle?
i am syncing a TT and a T2 to my pc. as long as you call them something
different then you are ok. you can also chose which pda to install new
software to by chosing which name in the drop down list. so i assume that
you can get different make pda's as well
&qu...Compiling wxWindows program as static
Im trying to compile my application as static, but without good results.
Im trying doing: `wx-config --static --libs --gl-libs`
It compiles, in fact the binary file is bigger, mas but on execution
does: Segmentation fault
With the flag -static in g++ does:
/usr/lib/libgmodule.a(gmodule.o)(.text+0x42): In function
: warning: Using 'dlopen' in statically linked applications requires at
runtime the shared libraries from the glibc version used for linking
/usr/lib/libwx_gtk-2.4.a(utilsunx.o)(.text+0x1221): In function
`wxGetUserHome(wxString const...Final CFP: Workshop on Generic Programming (WGP) 2014
Apologies for multiple postings.
CALL FOR PAPERS
10th ACM SIGPLAN Workshop on Generic Programming
Sunday, August 31, 2014
Co-located with t...what has python added to programming languages? (lets be esoteric, shall we ;)
Over the time I've seen lots of remarks about python that read like "a
lot like lists in lisp" or "like the hashtable in java" or any other
form of "like <feature> in <language>".
Are there any concepts that python has not borrowed, concepts that were
not even inspired by other languages? I'm just interested if it is
"merely" a best-of collection of language features or if there are
actually inventions that have not - or hardly - existed in programming
Wildemar Wildenburger wrote:
> Over the time I&...calling other programs
can you tell me any function that can call other programs within my
something like: CallProg("rar", "a -s -md4096);
i need something that can call progs with parameters/arguments
thanks in advance
> can you tell me any function that can call other programs within my
> something like: CallProg("rar", "a -s -md4096);
> i need something that can call progs with parameters/arguments
Simplest is system(3), but it accepts only a single command string.
More elaborate is fork...Re: A list of compression programs and their algorithms?
>Where can I find a list of compression programs and what algoritm
>does each program use? Can you help me?
Have a look at:
...US-KA-Kansas City: APP PROGRAMMING, Java, WSAD, Unix, Korn Shell, 6mo+ (45354233441)
US-KA-Kansas City: APP PROGRAMMING, Java, WSAD, Unix, Korn Shell, 6mo+ (45354233441)
Position: APP PROGRAMMING
Location: Kansas City KA
Skills: IBM VisualAge for Java 3.5.3 with Envy repository
Unix (Solaris), Korn Shell
BEA Weblogic 6.1 sp6 and 8.1 sp2
WSAD 5.1 / RAD 6.0
Scope: Maintain multiple code branches
Since the c...Two instances?
Consider a single machine (Sun V480/Solaris 10) running Oracle 10g. Two
parties are interested in cooperating (one brings the machine, the other
brings the Oracle license). Disk space (>500 GB) is more than enough for
both. Memory (16 GB) is more than enough for both. There are no common
users. There are no common applications. There are no common schemas.
There will be separate administration with possibly separate DBAs. Each
party will have several schemas (total of 10 - 20 schemas). Three of one
party's schemas each have in excess of 1000 tables and 1000 stored
procedu...compare two databases
there is any utility or command for compare two databases,
tables structure (schema).
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to firstname.lastname@example.org)
Maybe you can use :
pg_dump -s -t Thetable firstdatabasename > first
pg_dump -s -t Thetable seconddatabasename > second
diff first second
Ashok Chauhan wrote:
>there is any utility or command for compare two databases,
>tables structure (schema).
&...Comparing two sets of data
I have the following situation. One set of data has 274 rows (set2)
and anther has 264 (set1). Both data sets are similar in structure as
well as values for both of them were extracts from the same parent
table. Hope the info would substitute DDL. I need to find the "gap"
rows between these two sets.
Attempted to run a query like
where not exists
did not yield what I desired. What else to try?
> I have the following situation. One set of data has 274 rows (set2)
> and anther has 264 (set1). Both data ...My first Python program -- a lexer
I started to write a lexer in Python -- my first attempt to do something
useful with Python (rather than trying out snippets from tutorials). It
is not complete yet, but I would like some feedback -- I'm a Python
newbie and it seems that, with Python, there is always a simpler and
better way to do it than you think.
### Begin ###
def __init__( self, source, tokens ):
self.source = re.sub( r"\r?\n|\r\n", "\n", source )
self.tokens = tokens
self.offset = 0
self.result = 
self...How to compare two datasets, or retrieve data
I have a large dataset A, and a small dataset B. I need to compare dataset B and dataset A, if A inclues B, then in B the new variable will be coded 'yes', others in B, will be coded as 'no'.
In A, it includes the same data multi-times, so I use ID and a date to find if the B's data are in A datasets.
I did use 'merge' by dataset B, but after merging, alway some multi-data were merged to the B, and B has more data then it has before the merge. Could someone help me on code this problem.
1 11/...Socket Programming in Python
For the uninitiated: "Socket Programming in Python" at
Yahoo! India Insurance Special: Be informed on the best policies, services, tools and more.
Go to: http://in.insurance.yahoo.com/licspecial/index.html
Premshree Pillai wrote:
> For the uninitiated: "Socket Programming in Python" at
> evolt.org: http://evolt.org/article/Socket_Programming_in_Python/17/60276/ind...US-TX-Austin: Application Programming, Web Apps, COM/COM+, 2.5 years. (45351757602)
US-TX-Austin: Application Programming, Web Apps, COM/COM+, 2.5 years. (45351757602)
Position: Web Developer
Location: Austin TX
Duration: 6 mos. (Extensions to 2.5 yrs)
System design and development projects
Web applications with COM/COM+, Java scripting, HTML and IIS
Use of generally accepted software development methodology
I am using TkTable right now (90 rows and 45 columns). I am thinking
two implement 2 vertical scrollbars and two horizontal scrollbars in
Can somebody help me? Thank you very much!
> I am using TkTable right now (90 rows and 45 columns). I am thinking
> two implement 2 vertical scrollbars and two horizontal scrollbars in
> my table?
> Can somebody help me? Thank you very much!
You're going to have to be more specific. Why do you need two vertical
scrollbars? Why won't one work for you? What will the...programmed agents
Client Lotus notes 4.6.
i want to program an agent to execute every hour.
i jus activate local agents programmed in configuration and, i configure
the agent to execute programatically. But nothing occurs.
The agent has to be signed by the same id that is running it.
"kintango" <email@example.com> wrote in message
> Client Lotus notes 4.6.
> i want to program an agent to execute every hour.
> i jus activate local agents programmed in configuration and, i configure
>...FMCO 2004: program and last cfp
Our apologies if you receive multiple copies of this e-mail.
****************** LAST CALL FOR PARTICIPATION ********************
Third International Symposium on
Formal Methods for Components and Objects
DATES 2 - 5 November 2004
PLACE Lorentz Center, Leiden University, Leiden, The Netherlands
Registration form and more information at the FMCO site
TUESDAY 2nd, November 2004
8:45 - 9:00 Welcome
9:00 - 10:00 Keynote: Robin Milner (Cambridge University,...authority for domains: how to verify from program?
I'd like to use bind API in my program to obtain a list of zones the
server is authorative for (let is be the server where program is
Are there any functions (bind8 preferable)?
In article <firstname.lastname@example.org>,
Roman Mashak <email@example.com> wrote:
> I'd like to use bind API in my program to obtain a list of zones the
> server is authorative for (let is be the server where program is
> Are there any functions (bind8 preferable)?
The only API that BIND comes with is a r...how to see the detailed running process of matlab program?
I have one question now. I have a long long program and a lot of loops inside the program. It may take the whole night to run the program. When the program stop, I want to see the whole process of the program. However, I printed the whole thing and suddenly found that it only gave me the lastest 150 pages. It's not enough for me. How can I see the whole thing, maybe it's thousands of pages. Thanks
"Yi" <firstname.lastname@example.org> wrote in message <email@example.com>...
> Hey guys:
> I have one question now. I have a lon...