THere are a lot of wrappers for toolkits like Qt, Cocoa or WxWidgets for D, Python, Ruby and other languages.
I wonder if anyone has ever written a binding for MFC ?
I need to get the minimum and maximum values in a collection of floating point values, after applying an absolute value conversion. In python I would do this
min(map(abs, [-5, -7, 10, 2]))
how can I perform the same operation in java in the most elegant way?
Is there a way to describe the feature of a programming language that allows you to do something like the following:
$foo = return_an_array()[0];
I love this feature in python, and I hate that it's missing in PHP. Is there a name for this?
I'm trying to set up Subversion on Ubuntu Linux. It seems to be working, except that when I made one change and tried svn status, I found about 100 files had been changed, in the .metadata directory.
My ~/.subversion/config file currently contains the following line:
global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo *.rej *~ .*.swp .DS_Store
What do I need to add to ignore the .metadata files?
The directory under consideration is used by Eclipse for Python development using PyDev, if that matters.
for instance in python it is possible to assign a method to a variable:
class MyClass
def myMethod(self):
return "Hi"
x = MyClass()
method = x.myMethod
print method() # prints Hi
I know this should be possible in Ruby, but I don't know what's the syntax.
hi everybody,
I need to do a countdown clock, that counts down the days, hours, minutes and seconds that are left to a date of my choice,Using jquery or google app engine(Python).
I created a timer using Javascript,But in that i used system time.
I need to use server time.Can any body give me ideas to build up a count down Timer using server UTC time.
Dear all,
I'm a newbie in bash and I would like to pass as parameter to a python function all files in a directory that don't match a given pattern. sth. like:
$myscripts/myprog.py $myfiles/!(bonjovi)
The above example should retrieve all files that don't match to "bonjovi".
Best wishes
So I know that C++ is strongly typed and was just wondering if there was any library (or any thing for that fact of the matter) that would allow you to make a variable that has no initial specific type like var in Python.
I am a fairly capable Ruby scripter/programmer, but have been feeling pressure to branch out into C++. I haven't been able to find any sites along the lines of "C++ for Ruby Programmers". This site exists for Python (which is quite similar, I know). Does anyone know of a guide that can help me translate my Ruby 'thoughts' into C++?
Does anyone have any clue why this doesn't work as expected.
If i use the python shell and do
team.game_set
or
team.games
It returns an error
AttributeError: 'Team' object has no attribute 'game'
If i create a Game object and call
game.home_team
it returns the correct team object
Heres my model
class Team(models.Model):
name = models.CharField(blank=True, max_length=100)
class Game(models.Model):
home_team = models.ForeignKey(Team, related_name="home_team")
So I have a little (musical) keyboard that has USB midi interface. I know you can program to this (many programs accept input from the midi device via USB interface) but where do you begin to program a midi device?
Ideally I'm looking for a platform-independent api, through Python or something.
The following code raise a keyError exception:
addr_list_formatted = []
addr_list_idx = 0
for addr in addr_list: # addr_list is a list
addr_list_idx = addr_list_idx + 1
addr_list_formatted.append("""
"{0}"
{
"gamedir" "str"
"address" "{1}"
}
""".format(addr_list_idx, addr))
Why?
Using python 3.1. Thanks.
I need to learn programming ASP.NET with C# but I can't find a good online book to do so.
Is there an ASP.NET equivalent to Diving into python?
All of the books are quite expensive.
I already know Java and C++, are there any major differences between them and C#?
If so are there materials that cover only the differences and what I should learn?
Just installed django-db-log module and trying to make it work properly. 'python manage.py syncdb' command created databases, it seems like logging works, but there is nothing about it in admin panel. As I found in documentation, it should add itself in admin panel without any additional configuration, but then I added 'djangodblog.middleware.DBLogMiddleware' in MIDDLEWARE_CLASSES and 'djangodblog' in INSTALLED_APPS it looks like nothing happens. What I'm doing wrong?
Is it possible to capture all the sound from a computer and have it pass through a equalizer before reaching the speakers?
How can you program a band pass filter on it?
EDIT: I'm trying to get this on Windows (with Python? heh) but if there is a generic, cross-platform approach that would be great.
I'm looking for a library that simplify tempo/bpm audio detection.
Something similar to this http://adionsoft.net/bpm/ , but to use on *NIX machines.
Any language, but preference goes to php, perl, python.
Hi, guys,
I find stackoverflow is very friendly, professional and easy to use. Goole webiste is great too.
I knows little of web site development, since most of my time was working on C++.
There are many choices, so where is the start point, asp, jsp, python, php, etc?
Which technology I should use?
Which books are essential to website dev?
As far as I understand, the "Getting Started" guide of GAE with Python uses the webapp framework. However, it seems like it uses Django to render templates.
Does that mean that I can use the Django template engine without using its application framework?
So I want to make a batch file that will sleep my computer after a period of time.
The closest thing I have found is placing it in standby, but seems to work differently then the sleep button on my keyboard (longer bootup, doesn't wake on mouse click). Any ideas? Would it be easier in python or c#?
I have a python script that'll be checking a queue and performing an action on each item:
# checkqueue.py
while True:
check_queue()
do_something()
How do I write a bash script that will check if it's running, and if not, start it. Roughly the following pseudo code (or maybe it should do something like ps | grep?):
# keepalivescript.sh
if processidfile exists:
if processid is running:
exit, all ok
run checkqueue.py
write processid to processidfile
I'll call that from a crontab:
# crontab
*/5 * * * * /path/to/keepalivescript.sh
Thanks in advance.
I need a regular expression to validate string with one or more of these characters:
a-z
A-Z
'
àòèéùì
simple white space
FOR EXAMPLE these string are valide:
D' argon calabrò
maryòn l' Ancol
these string are NOT valide:
hello38239
my_house
work [tab] with me
I tryed this:
re.match(r"^[a-zA-Z 'òàèéìù]+$", self.cleaned_data['title'].strip())
It seems to work in my python shell but in Django I get this error:
SyntaxError at /home/
("Non-ASCII character '\\xc3' ...
Why ?
How do you programmatically generate T-SQL CREATE statements for existing indexes in a database? SQL Studio provides a "Script Index as-Create to" command that generates code in the form:
IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name = N'IX_myindex')
CREATE NONCLUSTERED INDEX [IX_myindex] ON [dbo].[mytable]
(
[my_id] ASC
)WITH (SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF) ON [PRIMARY]
GO
How would you do this programmatically (ideally through Python)?
I need to know how to start writing an application based on plug-in architecture. I mean how to write a base code an let others develop the application by adding the plug-ins they write.
I know that there is some problems in doing such in c++. most people use another language such as python to add plug-ins to their c++ application.