I'm using S3 in this application for uploaded files, as Heroku has a read-only filesystem. How can I give my s3.yml to Heroku, but avoid checking it into the main repository?
I have the following input to a perl script and I wish to get the first occurrence of NAME="..." strings in each of the ... structures.
The entire file is read into a single string and the reg exp acts on that input.
However, the regex always returns the LAST occurrence of NAME="..." strings. Can anyone explain what is going on and how this can…
Hello. I've got the following code:
import time
import threading
class BaseWrapper: #static class
lock = threading.Lock()
@staticmethod
def synchronized_def():
BaseWrapper.lock.acquire()
time.sleep(5)
BaseWrapper.lock.release()
def test():
print time.ctime()
if __name__ is '__main__':
for i in…
Hi all,
I have used the crypt function in c to encrypt the given string.
I have written the following code,
#include<stdio.h>
#include<unistd.h>
int main()
{
printf("%s\n",crypt("passwd",1000));
}
But the above code threw an error ,"undefined reference to `crypt'".
What is the problem in the above code.
Thanks in advance.
I am having some problems setting up Tomcat for JMX. I added the following properties to
CATALINA_OPTS="-Dcom.sun.management.jmxremote.port=18070 -Dcom.sun.management.jmxremote.password.file=$CATALINA_BASE/conf/jmxremote.password -Dcom.sun
.management.jmxremote.ssl=false"
And have added the jmxremote.password file in to…
Hi,
I'm just wondering should I use std::size_t for loops and stuff instead of int?
For instance:
#include <cstdint
int main()
{
for (std::size_t i = 0; i < 10; ++i)
// std::size_t OK here? Or should I use, say, unsigned int instead?
}
In general, what is the the best practice regarding when to use std::size_t?
Project: http://design.vitalbmx.com/fave/news.html
When I click "Add to favorites" button (under main pic), in Chrome it animates UL,
while in Firefox and IE it does not work.
Can't figure out why it works differently. Please help.
If I want to create a button control like that, is it supposed to be a User Control or a Custom Control? I am not sure maybe something else? Ideally I want to be able style/animate the main button and the inner button separately; also obviously Ill need to process their events separately. These buttons will be created at run-time and Ill…
Is it possible to have a global event handler for ajax requests that automatically gets called when any ajax request returns ?
I'm interested in this because I'm making a greasemonkey script for an ajax site. In previous scripts I either ran the main function every few seconds or overwrote parts of the site's javascript, both things that…
I have this problem: I want to pass a whole C code from a php textbox onto server and want to compile it with gcc and want the output back on php page. Is it possible?
Sample code:
php page input
<textarea>
#include<stdio.h>
void main()
{
printf("hello world");
}
Compiled on server terminal/shell
php page output:
hello…
Hello,
I'm writing a multi-threaded application, where there is a main thread which distributes tasks to the worker threads. According to the task, a worker thread creates a connection, by using a global occi environment. When a worker thread completes its task, it closes the connection (I'm sure, there is no exception thrown while…
Hello,
I would like to have .class and .java files in a JAR. Thus, I have "bin" and "src" pastes in that JAR. How should I edit the MANIFEST.MF?
JAR
|
-- bin -- .class files
|
-- src -- .java files
|
-- META-INF -- MANIFEST.FM
Im doing this:
Manifest-Version: 1.0
Class-Path: ./bin/
Main-Class: simul.Simulador
But…
i want to untar file from source to destination
with below statement
`def untar(source,destination):
run("tar -xf {0} {1}".format(source,destination))
`
i am getting Error
C:\Users\test\Desktop\fabric>fab -H user@host-p pass untar:source
=/shared/sample.tar,destination=/home/
Traceback (most recent call last):
File…
I'm trying to develop an invitation system for my website which runs on CakePHP 1.3.4.
I am trying to use the built in EmailComponent to send an email. I'm getting this error (expanded):
Notice (8): Undefined property: EmailComponent::$Controller [CORE/cake/libs/controller/components/email.php, line 428]
Code | Context
…
Consider this situation:
I get an object of type A which has the function f. I.e:
class A:
def f():
print 'in f'
def h():
print 'in h'
and I get an instance of this class but I want to override the f function but save the rest of the functionality of A. So what I was thinking was something of the…
In Access 2007 I want to be able to click on a name field in a report and call a separate report with personal information about the person who's name was clicked to start the event. This would be as an alternative to creating a subreport or including the subreport fields in the main report in the interest of saving…
Hi,
I'm having problems in adding a picture into JFrame, something is missing probebly or written wrong.
here are the classes:
main class:
public class Tester
{
public static void main(String args[])
{
BorderLayoutFrame borderLayoutFrame = new BorderLayoutFrame();
…
I have developed an addin for Visual Studio 2008, which extends the main menu with custom menu items.
These menu items have custom images and I finally managed to have them displayed correctly using transparency masks.
The only problem that still persists is, that the icons look really ugly and unprofessional,…
I have a bunch of standard MBeans which I need to convert to dynamic MBeans, (main purpose is to add user friendly descriptions to attributes, operations and operation parameters). I was wondering if there is any tool which can make my job easier by generating skeleton code for dynamic MBeans from the existing…
Hi everyone,
I'm trying to create a simple thumbnail viewer with jQuery. Here goes the code:
$(function(){
$("ul.thumbnails li").click(function(e){
var imgAlt = $(this).find('img').attr("alt"); //Get Alt Tag of Image
var imgTitle = $(this).find('a').attr("href"); //Get Main…
Hello, I have no access to the httpd.conf. How can I redirect the users if the type one folder more like - http://www.example.com/folder/folder2/ -- redirect 404 to the main page.
The users should only have access to this root http://www.example.com/link+custom1+custom2/
and if they type something like…
I'm playing with Objective-C Distributed Objects and I'm having some problems understanding how memory management works under the system. The example given below illustrates my problem:
Protocol.h
#import <Foundation/Foundation.h>
@protocol DOServer
- (byref id)createTarget;
@end
Server.m
…
how do i add a if statement when the right image is at +400px then animate back to -400px... when hovering the right image?
$('#left img').mouseenter(function() {
$('#right img').animate({
left: '+=400px'
}, 700);
});
$('#right img').mouseenter(function() {
…
Hi everyone,
SELECT * FROM jobs WHERE (SELECT DISTINCT jobs.* FROM jobs, job_requests WHERE (jobs.user_id = 1) OR (job_requests.user_id = 1 AND job_requests.job_id = jobs.id))
This sql gives me Mysql::Error: Operand should contain 1 column(s). If i execute the select from the where clause it…
Is there a way to know whether a variable is defined, by looking at the executable.
Lets say I declare
int i;
in the main function. By compiling and linking I get an executable my_program.exe.
Now, by looking inside my_program.exe, can I say if it has an int eger variable i ?