Programming :: Equivalent Function On Eclipselink Of Hibernate + Import.sql?
Feb 19, 2010Exist an equivalent on eclipselink 2.0?
View 2 RepliesExist an equivalent on eclipselink 2.0?
View 2 RepliesIs there a python equivalent for the "array_unique" function in php?
I have to run a query on a very large table (1.5 million records, with no index!) and php can't beat the max execution time. So I am converting my php script to python, which I have never used before.
my php script basically does this:
gets results from database
gets the number of unique values in column "X"
counts how many times each unique value in column "X" occurs
echos the results
My php script was originally running on a smaller version of the table, I would have started in python if I would have known the "real" table was so large, python is the only language I have access to in my current environment (besides php).
In Fedora 8
File: /etc/inittab contained
S0:2345:respawn:/usr/sbin/faxgetty ttyS0
S1:2345:respawn:/sbin/vgetty ttyS1
In Fedora 13
Created folder: /etc/event.d
Created files: /etc/event.d/ttyS0
[Code]....
Neither faxgetty or vgetty start on reboot or changing runlevel. How do you implement the equivalent of the old inittab function?
I upgraded from Lenny to Squeeze.
I use Fluxbox as the window manager in X Window. I installed hibernate packages and gnome power management. I set the idle time at 30 minutes using the gnome power management program. It doesn't suspend at all. The monitor only shuts off during idle.
So, I logged in as root, started X. Without .xinitrc gnome desktop manager launched. As I clicked shutdown, it showed a dialog box asking hibernate / suspend / restart / etc. And then, I chose the [hibernate], the system shut down and came back to previous status when system restarted.
Which gnome program does control hibernate / suspend?
Is there anyway that I can control hibernate / suspend in command? I just need to make a little script and assign it to a launch key so that I can suspend the system when it's on idle.
I have been using Linux Mint with great success for about 5 months. The other day when I went to turn off my computer instead of selecting shut down, I accidentally clicked on "Hibernate". Now my computer will not turn on, even after a hard shut down. Nothing comes up, not even the BIOs screen. It did this once before and my Linux-guru ex was able to fix it, but I will be dammed if I remember what he did.
View 14 Replies View RelatedCode:
#include <iostream>
using namespace std;
[code]...
I am doing some Linux kernel programming for my research project. I need to record the timestamp (by using cpuid and rdtsc) when an interrupt handler (top half) is first invoked. Due to the time critical nature of the problem itself, I have to do the timestamping inside the interrupt handler itself (the first operation when the handler is called). However, I understand that tasks that are not so time critical should be deferred to a tasklet function (bottom half) for processing because other interrupts are disabled in a (top-half) interrupt handler. I am currently out of idea on how I can pass the timestamp information that I have obtained in the interrupt handler to the corresponding tasklet function.
View 2 Replies View RelatedI want to declare a function in a function, but had no success till now, see the error code below and visit the project at sourceforge
[Code]...
I looked on the net for such function or example and didin't find anything, thus after having made one i guess it would be legitimate to drop it to see what others thinks of it.
#!/bin/bash
addelementtoarray()
{
local arrayname=$1
[code]....
Is there a compiler compatibility flag for C++ like -std=c99 ? Or is there some other way to get new g++ compilers to not choke on old code?
View 5 Replies View RelatedWhat is the equivalent of 'uint8_t' to windows?When I tried to compile a program with variables declared as 'uint8_t' I got this errors.
Code:
'uint8_t' : undeclared identifier
'uint32_t' : undeclared identifier
I've been reading and googling, etc. I've seen some things, but not a definite explanation of this. What is the appropriate way to mimic a C ternary operator using Python? Isn't there an exact proper way to do it? Any difference for using lambda functions? I'm sorry, but I've been searching and it's ambiguous to me how this should be handled. I would appreciate a person's help on this. I came up with this link, but I'm wondering if I'm missing something.[URL]...
So, is that it? In Dive Into Python, it's using the and-or trick. Well, if the above post is the full explanation,
I am new to pygame and Linux and I am using Red Hat Linux and I cannot import pygame. I thought I installed it but when I open up Python IDLE It says "No module named pygame". Does anyone know what is wrong?? I downloaded pygame1.9.1.release.tar.gz from URL...I might not have installed it or maybe I need something else too, I don't know.
View 6 Replies View Relatedfit a surface i.e. W(x,y) using svdfit() provided by "Numerical Recipes in C". svdfit() is written for curve fitting and not for surface fitting.But one can use svdfit(), as claimed by authors of NR book, to do surface fitting. On page 680 of NR book, authors have given a hint on how to use svdfit() for fitting a surface. But I have not understood it.This link may be helpful (Chapter 15 th is relevant here.):[URL]This is my problem:
Code:
I have a set of 100 numbers. I want to fit a 2-Dimensional function W(x,y) to these numbers.
[code]....
I have this simple code written in python:
Code:
import os
os.system("xterm -e 'ls /usr/lib'")
Is there anyway I can hide the xterm window that is opening ?
I want the LAMP server to present an upload page to the user The user uploads a zip file containing txt files which are tables in clear-text format The server : opens the zip validates the text files (going to skip this for now, but will try to make later) converts the files as here imports them to MYSQL tables All this is supposed to happen automatically, then the user can immediately use the website with the updated data How to implement this (esp. the first part with the zip file)
View 1 Replies View RelatedI have installled eyeD3. It works on the commandline (bash). But I want use it in python3.
I did get this error:
Code: Select all>>> import eyed3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named eyed3
Why cant I use this module for reading and writing tag information to mp3 files?
I have been trying to write a simple snip of bash shell code to import from 1 to 100 records into a Bash array.
I have a CSV file that is structured like:
record1,item1,item2,item3,item4
record2,item1,item2,item3,item4
record3,item1,item2,item3,item4
record4,item1,item2,item3,item4
And would like to get this data into corresponding arrays as such:
$record1[item1-4]
$record2[item1-4]
$record3[item1-4]
$record4[item1-4]
I'm trying to make a java application in netbeans 6.9.1 (ubuntu 10.10) and I need to use the webcam on the system. Now I found this project: [URL] I am able to run the program and see the vid imput from the webcam using: "java -cp /usr/share/java/v4l4j.jar -Djava.library.path=/usr/lib/jni au.edu.jcu.v4l4j.examples.DeviceChooser" The problem is how to import the libaries into netbeans, there is an explanation on the site how to do it with eclipse but I don't have any experience with ecplipse and judging from what people have to say about how it works I don't want that either. I get the following error as output:
[Code]...
I'm using pm-hibernate, and would like to reboot the machine after it's done hibernating, rather than having the machine turn off.Is there a way to do this with pm-hibernate, or any other Linux hibernate thing?
View 2 Replies View RelatedI have a question about calling an asm function from C....It doesn't work unless I create an asm variable to hold the value of the function in....Why?Here's the code that doesn't work...
asmfile.s - version one Code: .section .data
mydata: .ascii "this is the message!
.equ mylen, . - mydata
[code]...
I want to use backtrace() function to debug a crash issue. I tried this sample code to see how backtrace works. backtrace() function always returns 0 with the below code. Is there any kernel configuration that needs to be set for proper working of backtrace?
#include <execinfo.h>
#include <stdio.h>
#include <stdlib.h>
/* Obtain a backtrace and print it to stdout. */
void
print_trace (void)
[Code]...
Can you offer me the code about fmod() in C. I want to know how this function work, i am very interested in it because i have no idea to implement it, i want to know... how to write the function... not 'how to use the function' can anyone post the source codes of this function here?
View 6 Replies View Relatedi have an open source application that was developed in C++ (it uses objects and namespaces all over the place). I also have another application that was developed in C. Now i am trying to insert the code made in C into C++ application, but when i do that , i get this error on compilation of the source code:
Code:
error: 'mpi_init_vars' was not declared in this scope the function mpi_init_vars() is not part of object oriented programming and it doesn't belong to any scope, it was compiled into an object file and i am linking it with all objects of C++ application.
How can invoke the C function from C++ object oriented code?
I am trying to build a function inside a script.
Code:
#!/bin/sh
#System commands and other configurable.
IPT=/sbin/iptables
IP6T=/sbin/ip6tables
IPST=/usr/sbin/ipset
MODP=/sbin/modprobe
GET=/usr/bin/wget
INT_NET=192.168.1.0/24 .....
I can find lots of tutorials in how to use if, then, else. However, how do I define a variable inside the function?
SEE>>
Code:
for c in $ISO
Also, am I using the 'test' command correctly( -/+ week as valid test)?
I am doing a web site program and what I need is to call a C program in the PHP cloud.Do u think it would be possible? The web site would get the user input from PHP UI and pass to the C program , the C program would process the function with the user input and output the a PHP page.
View 2 Replies View RelatedI ask if a c++/c function is able to know its name from inside itself:
example:
Code:
int funct1(int a,b)
{
printf("%s ",funct_name());
}
or with a trick.
Code:
#!/bin/ksh
(...)
# FILL UP PARTITION
diskfillerfunction () {
[Code]....
Test 15: fill up partition /usr/bin/time: cannot run diskfillerfunction: No such file or directory
I am obviously omitting (...) a lot of the code, but the relevant part is all there. How do I 'time' a function?
I wrote a spinner in Perl and when I did a spinner in shell I could just run the subroutine in the background.
[code]...
In Perl, how do you run a function in a background and get the PID for that? I know PID in Perl is $$
I know what is the functionality of the sleep() method.
for(i = 0; i < length; i++){
sleep(1000);
printf("%c
", message[i]);
}
Result :every print of the message will be takes 1000sec of gap but i want to know why wee need to use the Sleep function. where exactly it is useful