How can I execute c programs in ubuntu 13.04
I upgraded my ubuntu to 13.04 version. After this upgrade I am not able to
execute c programs in terminal. When I try to execute, it shows an error
as shown below
bash: ./cd: Permission denied
where cd is my executable file which is working fine in lower versions of
ubuntu.
Monday, 30 September 2013
How to know which user killed a process
How to know which user killed a process
Is there a way in linux to find out which user or which process killed
another process? Maybe a log?
I searched through /var/log and specifically on auth.log.* but I didn't
find anything interesting..
I suppose that the process was killed using htop but as far as I know it
doesn't keep activities logs.
Thanks
Is there a way in linux to find out which user or which process killed
another process? Maybe a log?
I searched through /var/log and specifically on auth.log.* but I didn't
find anything interesting..
I suppose that the process was killed using htop but as far as I know it
doesn't keep activities logs.
Thanks
where should i paste my html form code in joomla?
where should i paste my html form code in joomla?
I'm working in joomla i have one custom contact form i have created that
in html code and when user click on submit button i should get all textbox
values email to me.
so i write php code for that.
for e.g there are only two fields in html code in php code like below
<?php
if(isset($_POST['email'])) {
$email_to = "test@gmail.com";
$email_subject = "mail";
function died($error) {
// your error code can go here
echo "We are very sorry, but there were error(s) found with the
form you submitted. ";
echo "These errors appear below.<br /><br />";
echo $error."<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
die();
}
// add validation for other fields if needed
if(!isset($_POST['Applicant_name']) ||
!isset($_POST['email']))) {
died('We are sorry, but there appears to be a problem with the
form you submitted.');
}
//all fields with there name to send in email
$name = $_POST['name']; // required
$email= $_POST['email']; // required
$error_message = "";
if(strlen($error_message) > 0) {
died($error_message);
}
$email_message = "Form details below.\n\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
//show all fields in message body
$email_message .= "Applicant_name: ".clean_string($Applicant_name)."\n";
$email_message .= "name: ".clean_string($dob)."\n";
$email_message .= "email: ".clean_string($sex)."\n";
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
?>
Thank you for contacting us. We will be in touch with you very soon.
<?php
}
?>
where and how I need to paste this code in Joomla?
I'm working in joomla i have one custom contact form i have created that
in html code and when user click on submit button i should get all textbox
values email to me.
so i write php code for that.
for e.g there are only two fields in html code in php code like below
<?php
if(isset($_POST['email'])) {
$email_to = "test@gmail.com";
$email_subject = "mail";
function died($error) {
// your error code can go here
echo "We are very sorry, but there were error(s) found with the
form you submitted. ";
echo "These errors appear below.<br /><br />";
echo $error."<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
die();
}
// add validation for other fields if needed
if(!isset($_POST['Applicant_name']) ||
!isset($_POST['email']))) {
died('We are sorry, but there appears to be a problem with the
form you submitted.');
}
//all fields with there name to send in email
$name = $_POST['name']; // required
$email= $_POST['email']; // required
$error_message = "";
if(strlen($error_message) > 0) {
died($error_message);
}
$email_message = "Form details below.\n\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
//show all fields in message body
$email_message .= "Applicant_name: ".clean_string($Applicant_name)."\n";
$email_message .= "name: ".clean_string($dob)."\n";
$email_message .= "email: ".clean_string($sex)."\n";
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
?>
Thank you for contacting us. We will be in touch with you very soon.
<?php
}
?>
where and how I need to paste this code in Joomla?
Uploadify Not Uploading Files although there are no errors and alert is successful
Uploadify Not Uploading Files although there are no errors and alert is
successful
I have just downloaded the latest version of Uploadify (swf) ... uploaded
the uploadify folder into the server root and created a folder called
uploads and set it's permissions to 777. (I've tried 755 too).
This is my code:
$("#edit_image1_form").uploadify({
height : 30,
swf : '/uploadify/uploadify.swf',
uploader : '/uploadify/uploadify.php',
width : 120,
folder : '/uploads',
buttonText : 'Upload Image 1',
auto : true,
'onUploadComplete' : function(file) {
alert('The file ' + file.name + ' finished processing.');
}
});
Uploadify.php looks like this:
<?php
/*
Uploadify
Copyright (c) 2012 Reactive Apps, Ronnie Garcia
Released under the MIT License
<http://www.opensource.org/licenses/mit-license.php>
*/
// Define a destination
$targetFolder = '/uploads'; // Relative to the root
//$targetFolder = '/var/www/vhosts/busybar/httpdocs/uploads';
$verifyToken = md5('unique_salt' . $_POST['timestamp']);
if (!empty($_FILES) && $_POST['token'] == $verifyToken) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $targetFolder;
$targetFile = rtrim($targetPath,'/') . '/' . $_FILES['Filedata']['name'];
// Validate the file type
$fileTypes = array('jpg','jpeg','gif','png'); // File extensions
$fileParts = pathinfo($_FILES['Filedata']['name']);
if (in_array($fileParts['extension'],$fileTypes)) {
move_uploaded_file($tempFile,$targetFile);
echo '1';
} else {
echo 'Invalid file type.';
}
}
?>
I'm trying to upload a small .png file so that should work.
When I try to upload the file everything looks like it's uploading. I even
get The Successful alert from "alert('The file ' + file.name + ' finished
processing.');"...
But the image is just not there.
What I'm I doing wrong here...forgotten something?
successful
I have just downloaded the latest version of Uploadify (swf) ... uploaded
the uploadify folder into the server root and created a folder called
uploads and set it's permissions to 777. (I've tried 755 too).
This is my code:
$("#edit_image1_form").uploadify({
height : 30,
swf : '/uploadify/uploadify.swf',
uploader : '/uploadify/uploadify.php',
width : 120,
folder : '/uploads',
buttonText : 'Upload Image 1',
auto : true,
'onUploadComplete' : function(file) {
alert('The file ' + file.name + ' finished processing.');
}
});
Uploadify.php looks like this:
<?php
/*
Uploadify
Copyright (c) 2012 Reactive Apps, Ronnie Garcia
Released under the MIT License
<http://www.opensource.org/licenses/mit-license.php>
*/
// Define a destination
$targetFolder = '/uploads'; // Relative to the root
//$targetFolder = '/var/www/vhosts/busybar/httpdocs/uploads';
$verifyToken = md5('unique_salt' . $_POST['timestamp']);
if (!empty($_FILES) && $_POST['token'] == $verifyToken) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $targetFolder;
$targetFile = rtrim($targetPath,'/') . '/' . $_FILES['Filedata']['name'];
// Validate the file type
$fileTypes = array('jpg','jpeg','gif','png'); // File extensions
$fileParts = pathinfo($_FILES['Filedata']['name']);
if (in_array($fileParts['extension'],$fileTypes)) {
move_uploaded_file($tempFile,$targetFile);
echo '1';
} else {
echo 'Invalid file type.';
}
}
?>
I'm trying to upload a small .png file so that should work.
When I try to upload the file everything looks like it's uploading. I even
get The Successful alert from "alert('The file ' + file.name + ' finished
processing.');"...
But the image is just not there.
What I'm I doing wrong here...forgotten something?
Sunday, 29 September 2013
What is the best method to write user "log files" of an android application to a file in a remote server or a table in a remote database?
What is the best method to write user "log files" of an android
application to a file in a remote server or a table in a remote database?
I am creating a multi user android application and it is connected to a
php web service in a remote server and to a remote database via that web
service. I want to keep a track of all the important activities done by
the users. For an example if a user logged in to the app and changed his
profile details and then logged out, a brief description of what he has
done should be recorded(with time) somewhere. So then the admin of the
system can see what the users are doing. So I think it is better to use
log cat files and then flush all those data to a unique file in the server
or a table in the database, when the user logs out or exists from his
account. I it is appropriate How to do it?
application to a file in a remote server or a table in a remote database?
I am creating a multi user android application and it is connected to a
php web service in a remote server and to a remote database via that web
service. I want to keep a track of all the important activities done by
the users. For an example if a user logged in to the app and changed his
profile details and then logged out, a brief description of what he has
done should be recorded(with time) somewhere. So then the admin of the
system can see what the users are doing. So I think it is better to use
log cat files and then flush all those data to a unique file in the server
or a table in the database, when the user logs out or exists from his
account. I it is appropriate How to do it?
RSS: errors in the java code or in the site?
RSS: errors in the java code or in the site?
With Android studio, I worked on a code that reads RSS feeds and shows
them to me on the phone. I did several tests and the code is fine, except
that when I open any news from the list view gives me only bit part of the
description of the news, I have the space on the screen of the phone
because I put a scroll view but the problem is that in description quit in
the middle of the speech. Can you help me? (If it helps I put the code).
Thanks
With Android studio, I worked on a code that reads RSS feeds and shows
them to me on the phone. I did several tests and the code is fine, except
that when I open any news from the list view gives me only bit part of the
description of the news, I have the space on the screen of the phone
because I put a scroll view but the problem is that in description quit in
the middle of the speech. Can you help me? (If it helps I put the code).
Thanks
How to pipe POST requests
How to pipe POST requests
I'm a bit confused about how to pipe some data.
I've got some pipes working and chained such that I not have an output
stream containing the data I want to input to a request POST
var options = {
host: 'localhost',
port: 8529,
path: '/_api/cursor',
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': data.length
}
}
var req = http.request(options);
I would normally just action 'mystreams2.pipe(req)' but how do I set the
'data.length' value ?
(I'm using the streams2 interface not the old stream format)
I'm a bit confused about how to pipe some data.
I've got some pipes working and chained such that I not have an output
stream containing the data I want to input to a request POST
var options = {
host: 'localhost',
port: 8529,
path: '/_api/cursor',
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': data.length
}
}
var req = http.request(options);
I would normally just action 'mystreams2.pipe(req)' but how do I set the
'data.length' value ?
(I'm using the streams2 interface not the old stream format)
Passing from a listview to a gridview
Passing from a listview to a gridview
I have an activity with a list, whose items are made of an image+text. I
need to allow the user to change the view and have a gridview instead of
it (whose elements are still made of the same image+text).
The user can do it through an icon menu:
public boolean onOptionsItemSelected(MenuItem item)
{
if(item.getItemId()== R.id.change_view)
{
// ?
}
...
I tried to just set the new adapter but it doesn't work..do I have to
create a new activity to do that?
I have an activity with a list, whose items are made of an image+text. I
need to allow the user to change the view and have a gridview instead of
it (whose elements are still made of the same image+text).
The user can do it through an icon menu:
public boolean onOptionsItemSelected(MenuItem item)
{
if(item.getItemId()== R.id.change_view)
{
// ?
}
...
I tried to just set the new adapter but it doesn't work..do I have to
create a new activity to do that?
Saturday, 28 September 2013
cakephp multiple domains & Configure::write
cakephp multiple domains & Configure::write
Running multiple domains on one install. In bootstrap I have:
Configure::write('Application.name', 'example1.com');
Configure::write('Application.name', 'example2.com');
What's the best way to define these variables so that I can check my main
domain and set them up all at once?
Running multiple domains on one install. In bootstrap I have:
Configure::write('Application.name', 'example1.com');
Configure::write('Application.name', 'example2.com');
What's the best way to define these variables so that I can check my main
domain and set them up all at once?
How do I run multiple Python test cases in a loop?
How do I run multiple Python test cases in a loop?
I am new to Python and trying to do something I do often in Ruby. Namely,
iterating over a set of indices, using them as argument to function and
comparing its results with an array of fixture outputs.
So I wrote it up like I normally do in Ruby, but this resulted in just one
test case.
def test_output(self):
for i in range(1,11):
....
self.assertEqual(fn(i),output[i])
I'm trying to get the test for every item in the range. How can I do that?
I am new to Python and trying to do something I do often in Ruby. Namely,
iterating over a set of indices, using them as argument to function and
comparing its results with an array of fixture outputs.
So I wrote it up like I normally do in Ruby, but this resulted in just one
test case.
def test_output(self):
for i in range(1,11):
....
self.assertEqual(fn(i),output[i])
I'm trying to get the test for every item in the range. How can I do that?
Looking an efficient alternative for [myTableView reloadData] in objective c
Looking an efficient alternative for [myTableView reloadData] in objective c
I have a refresh button to get current data and reload the tableView. I'm
using this method to do this:
[self getCurrentData];
[self changeArrayObjectsWithNewDatas];
[self.myTableView reloadData];
But after a while, the application is slowing down. That's why I'm looking
an efficient alternative for [myTableView reloadData]
I have a refresh button to get current data and reload the tableView. I'm
using this method to do this:
[self getCurrentData];
[self changeArrayObjectsWithNewDatas];
[self.myTableView reloadData];
But after a while, the application is slowing down. That's why I'm looking
an efficient alternative for [myTableView reloadData]
iOS CABasicAnimation fillMode breaks hitTest. Why?
iOS CABasicAnimation fillMode breaks hitTest. Why?
I use CABasicAnimation to change transform value back to Identity
If I use transformAnimation.fillMode = kCAFillModeForwards;(I have to use)
after the UIView transform becomes Identity (animation finishes), UIView
becomes untouchable outside a small diameter from the center. (it doesn't
receive touch events near to the border).
If I set fillMode to something else than kCAFillModeForwards, UIView stays
clickable at every point but it breaks the animation as I want it to stay
at the identity matrix.
It is strange that It only allows me to click to the points near to the
center of the view and prevents me from touching any other parts of the
view.
What can be the reason for this?
update: If I use [UIView beginAnimations:@"abc" context:nil]; instead of
CABasicAnimation, this strange problem does not occur.
I use CABasicAnimation to change transform value back to Identity
If I use transformAnimation.fillMode = kCAFillModeForwards;(I have to use)
after the UIView transform becomes Identity (animation finishes), UIView
becomes untouchable outside a small diameter from the center. (it doesn't
receive touch events near to the border).
If I set fillMode to something else than kCAFillModeForwards, UIView stays
clickable at every point but it breaks the animation as I want it to stay
at the identity matrix.
It is strange that It only allows me to click to the points near to the
center of the view and prevents me from touching any other parts of the
view.
What can be the reason for this?
update: If I use [UIView beginAnimations:@"abc" context:nil]; instead of
CABasicAnimation, this strange problem does not occur.
Friday, 27 September 2013
installation of ruby-1.8.7-p249 on rvm
installation of ruby-1.8.7-p249 on rvm
i have a problem with installation of ruby-1.8.7-p249 on rvm under Ubuntu
13.04. Have tryed also to do so can not install ruby-1.8.7-p249 on rvm,
but come always to the same results :(
olga@olga-ThinkPad:~$ rvm install 1.8.7-p249
Searching for binary rubies, this might take some time.
No binary rubies available for: ubuntu/13.04/x86_64/ruby-1.8.7-p249.
Continuing with compilation. Please read 'rvm help mount' to get more
information on binary rubies.
Checking requirements for ubuntu.
Requirements installation successful.
Installing Ruby from source to: /home/olga/.rvm/rubies/ruby-1.8.7-p249,
this may take a while depending on your cpu(s)...
ruby-1.8.7-p249 - #downloading ruby-1.8.7-p249, this may take a while
depending on your connection...
ruby-1.8.7-p249 - #extracted to /home/olga/.rvm/src/ruby-1.8.7-p249
(already extracted)
Patch stdout-rouge-fix was already applied.
Patch no_sslv2 was already applied.
ruby-1.8.7-p249 -
#configuring..................................................................................................................................................................................................................................................................................................
ruby-1.8.7-p249 - #post-configuration
ruby-1.8.7-p249 -
#compiling......................................................................................................................................................................................
Error running '__rvm_make -j4',
please read /home/olga/.rvm/log/1380327224_ruby-1.8.7-p249/make.log
There has been an error while running make. Halting the installation.
make.log content:
[2013-09-28 01:52:31] __rvm_make
__rvm_make ()
{
\make "$@" || return $?
}
current path: /home/olga/.rvm/src/ruby-1.8.7-p249
command(2): __rvm_make -j4
gcc -O3 -O2 -fno-tree-dce -fno-optimize-sibling-calls -fPIC
-DRUBY_EXPORT -D_GNU_SOURCE=1 -L. -rdynamic -Wl,-export-dynamic main.o
libruby-static.a -lrt -ldl -lcrypt -lm -o miniruby
gcc -shared -Wl,-soname,libruby.so.1.8 array.o bignum.o class.o compar.o
dir.o dln.o enum.o enumerator.o error.o eval.o file.o gc.o hash.o inits.o
io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o prec.o
random.o range.o re.o regex.o ruby.o signal.o sprintf.o st.o string.o
struct.o time.o util.o variable.o version.o dmyext.o -lrt -ldl -lcrypt
-lm -o libruby.so.1.8.7
rbconfig.rb updated
compiling Win32API
compiling bigdecimal
make[1]: Betrete Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/bigdecimal'
gcc -shared -o ../../.ext/x86_64-linux/bigdecimal.so bigdecimal.o -L.
-L../.. -L. -rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lrt -ldl -lcrypt -lm
-lc
make[1]: Verlasse Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/bigdecimal'
compiling curses
make[1]: Betrete Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/curses'
gcc -shared -o ../../.ext/x86_64-linux/curses.so curses.o -L. -L../.. -L.
-rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lncurses -ltinfo
-lrt -ldl -lcrypt -lm -lc
make[1]: Verlasse Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/curses'
compiling dbm
make[1]: Betrete Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/dbm'
gcc -shared -o ../../.ext/x86_64-linux/dbm.so dbm.o -L. -L../.. -L.
-rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lgdbm_compat -lgdbm
-lrt -ldl -lcrypt -lm -lc
make[1]: Verlasse Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/dbm'
compiling digest
make[1]: Betrete Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/digest'
cp ../.././ext/digest/digest.h ../../.ext/x86_64-linux
gcc -shared -o ../../.ext/x86_64-linux/digest.so digest.o -L. -L../.. -L.
-rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lrt -ldl -lcrypt -lm
-lc
make[1]: Verlasse Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/digest'
compiling digest/bubblebabble
make[1]: Betrete Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/digest/bubblebabble'
gcc -shared -o ../../../.ext/x86_64-linux/digest/bubblebabble.so
bubblebabble.o -L. -L../../.. -L. -rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lrt -ldl -lcrypt -lm
-lc
make[1]: Verlasse Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/digest/bubblebabble'
compiling digest/md5
make[1]: Betrete Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/digest/md5'
gcc -shared -o ../../../.ext/x86_64-linux/digest/md5.so md5init.o
md5ossl.o -L. -L../../.. -L/home/olga/.rvm/usr/lib
-Wl,-R/home/olga/.rvm/usr/lib -L. -rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lcrypto -lrt -ldl
-lcrypt -lm -lc
make[1]: Verlasse Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/digest/md5'
compiling digest/rmd160
make[1]: Betrete Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/digest/rmd160'
gcc -shared -o ../../../.ext/x86_64-linux/digest/rmd160.so rmd160init.o
rmd160ossl.o -L. -L../../.. -L/home/olga/.rvm/usr/lib
-Wl,-R/home/olga/.rvm/usr/lib -L. -rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lcrypto -lrt -ldl
-lcrypt -lm -lc
make[1]: Verlasse Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/digest/rmd160'
compiling digest/sha1
make[1]: Betrete Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/digest/sha1'
gcc -shared -o ../../../.ext/x86_64-linux/digest/sha1.so sha1init.o
sha1ossl.o -L. -L../../.. -L/home/olga/.rvm/usr/lib
-Wl,-R/home/olga/.rvm/usr/lib -L. -rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lcrypto -lrt -ldl
-lcrypt -lm -lc
make[1]: Verlasse Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/digest/sha1'
compiling digest/sha2
make[1]: Betrete Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/digest/sha2'
gcc -shared -o ../../../.ext/x86_64-linux/digest/sha2.so sha2.o sha2init.o
-L. -L../../.. -L. -rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lrt -ldl -lcrypt -lm
-lc
make[1]: Verlasse Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/digest/sha2'
compiling dl
make[1]: Betrete Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/dl'
cp dlconfig.h ../../.ext/x86_64-linux
cp ../.././ext/dl/dl.h ../../.ext/x86_64-linux
gcc -shared -o ../../.ext/x86_64-linux/dl.so dl.o handle.o ptr.o sym.o -L.
-L../.. -L. -rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -ldl -lrt -ldl
-lcrypt -lm -lc
make[1]: Verlasse Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/dl'
compiling etc
make[1]: Betrete Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/etc'
gcc -shared -o ../../.ext/x86_64-linux/etc.so etc.o -L. -L../.. -L.
-rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lrt -ldl -lcrypt -lm
-lc
make[1]: Verlasse Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/etc'
compiling fcntl
make[1]: Betrete Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/fcntl'
gcc -shared -o ../../.ext/x86_64-linux/fcntl.so fcntl.o -L. -L../.. -L.
-rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lrt -ldl -lcrypt -lm
-lc
make[1]: Verlasse Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/fcntl'
compiling gdbm
make[1]: Betrete Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/gdbm'
gcc -shared -o ../../.ext/x86_64-linux/gdbm.so gdbm.o -L. -L../.. -L.
-rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lgdbm -lrt -ldl
-lcrypt -lm -lc
make[1]: Verlasse Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/gdbm'
compiling iconv
make[1]: Betrete Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/iconv'
gcc -shared -o ../../.ext/x86_64-linux/iconv.so iconv.o -L. -L../.. -L.
-rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lrt -ldl -lcrypt -lm
-lc
make[1]: Verlasse Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/iconv'
compiling io/wait
make[1]: Betrete Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/io/wait'
gcc -shared -o ../../../.ext/x86_64-linux/io/wait.so wait.o -L. -L../../..
-L. -rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lrt -ldl -lcrypt -lm
-lc
make[1]: Verlasse Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/io/wait'
compiling nkf
make[1]: Betrete Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/nkf'
gcc -shared -o ../../.ext/x86_64-linux/nkf.so nkf.o -L. -L../.. -L.
-rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lrt -ldl -lcrypt -lm
-lc
make[1]: Verlasse Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/nkf'
compiling openssl
make[1]: Betrete Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/openssl'
gcc -I. -I../.. -I../../. -I../.././ext/openssl
-DRUBY_EXTCONF_H=\"extconf.h\" -I/home/olga/.rvm/usr/include -fPIC -O3
-O2 -fno-tree-dce -fno-optimize-sibling-calls -fPIC -c ossl_pkcs7.c
gcc -I. -I../.. -I../../. -I../.././ext/openssl
-DRUBY_EXTCONF_H=\"extconf.h\" -I/home/olga/.rvm/usr/include -fPIC -O3
-O2 -fno-tree-dce -fno-optimize-sibling-calls -fPIC -c ossl_ssl.c
gcc -I. -I../.. -I../../. -I../.././ext/openssl
-DRUBY_EXTCONF_H=\"extconf.h\" -I/home/olga/.rvm/usr/include -fPIC -O3
-O2 -fno-tree-dce -fno-optimize-sibling-calls -fPIC -c ossl.c
gcc -I. -I../.. -I../../. -I../.././ext/openssl
-DRUBY_EXTCONF_H=\"extconf.h\" -I/home/olga/.rvm/usr/include -fPIC -O3
-O2 -fno-tree-dce -fno-optimize-sibling-calls -fPIC -c ossl_x509cert.c
ossl_pkcs7.c: In Funktion »ossl_pkcs7si_new«:
ossl_pkcs7.c:89:5: Warnung: Übergabe des Arguments 2 von »ASN1_dup« von
inkompatiblem Zeigertyp [standardmäßig aktiviert]
In file included from /home/olga/.rvm/usr/include/openssl/asn1_mac.h:62:0,
from ossl.h:57,
from ossl_pkcs7.c:11:
/home/olga/.rvm/usr/include/openssl/asn1.h:954:7: Anmerkung: »void *
(*)(void **, const unsigned char **, long int)« erwartet, aber Argument
hat Typ »char * (*)()«
ossl_pkcs7.c: In Funktion »DupPKCS7SignerPtr«:
ossl_pkcs7.c:102:5: Warnung: Übergabe des Arguments 2 von »ASN1_dup« von
inkompatiblem Zeigertyp [standardmäßig aktiviert]
In file included from /home/olga/.rvm/usr/include/openssl/asn1_mac.h:62:0,
from ossl.h:57,
from ossl_pkcs7.c:11:
/home/olga/.rvm/usr/include/openssl/asn1.h:954:7: Anmerkung: »void *
(*)(void **, const unsigned char **, long int)« erwartet, aber Argument
hat Typ »char * (*)()«
ossl_pkcs7.c: In Funktion »ossl_pkcs7ri_new«:
ossl_pkcs7.c:115:5: Warnung: Übergabe des Arguments 2 von »ASN1_dup« von
inkompatiblem Zeigertyp [standardmäßig aktiviert]
In file included from /home/olga/.rvm/usr/include/openssl/asn1_mac.h:62:0,
from ossl.h:57,
from ossl_pkcs7.c:11:
/home/olga/.rvm/usr/include/openssl/asn1.h:954:7: Anmerkung: »void *
(*)(void **, const unsigned char **, long int)« erwartet, aber Argument
hat Typ »char * (*)()«
ossl.c:118:1: Fehler: unbekannter Typname: »STACK«
ossl.c:119:1: Fehler: unbekannter Typname: »STACK«
ossl_pkcs7.c: In Funktion »DupPKCS7RecipientPtr«:
ossl_pkcs7.c:128:5: Warnung: Übergabe des Arguments 2 von »ASN1_dup« von
inkompatiblem Zeigertyp [standardmäßig aktiviert]
In file included from /home/olga/.rvm/usr/include/openssl/asn1_mac.h:62:0,
from ossl.h:57,
from ossl_pkcs7.c:11:
/home/olga/.rvm/usr/include/openssl/asn1.h:954:7: Anmerkung: »void *
(*)(void **, const unsigned char **, long int)« erwartet, aber Argument
hat Typ »char * (*)()«
ossl_ssl.c:101:5: Warnung: Initialisierung von inkompatiblem Zeigertyp
[standardmäßig aktiviert]
ossl_ssl.c:101:5: Warnung: (nahe der Initialisierung für
»ossl_ssl_method_tab[0].func«) [standardmäßig aktiviert]
ossl_ssl.c:102:5: Warnung: Initialisierung von inkompatiblem Zeigertyp
[standardmäßig aktiviert]
ossl_ssl.c:102:5: Warnung: (nahe der Initialisierung für
»ossl_ssl_method_tab[1].func«) [standardmäßig aktiviert]
ossl_ssl.c:103:5: Warnung: Initialisierung von inkompatiblem Zeigertyp
[standardmäßig aktiviert]
ossl_ssl.c:103:5: Warnung: (nahe der Initialisierung für
»ossl_ssl_method_tab[2].func«) [standardmäßig aktiviert]
ossl_ssl.c:110:5: Warnung: Initialisierung von inkompatiblem Zeigertyp
[standardmäßig aktiviert]
ossl_ssl.c:110:5: Warnung: (nahe der Initialisierung für
»ossl_ssl_method_tab[3].func«) [standardmäßig aktiviert]
ossl_ssl.c:111:5: Warnung: Initialisierung von inkompatiblem Zeigertyp
[standardmäßig aktiviert]
ossl_ssl.c:111:5: Warnung: (nahe der Initialisierung für
»ossl_ssl_method_tab[4].func«) [standardmäßig aktiviert]
ossl_ssl.c:112:5: Warnung: Initialisierung von inkompatiblem Zeigertyp
[standardmäßig aktiviert]
ossl_ssl.c:112:5: Warnung: (nahe der Initialisierung für
»ossl_ssl_method_tab[5].func«) [standardmäßig aktiviert]
ossl_ssl.c:113:5: Warnung: Initialisierung von inkompatiblem Zeigertyp
[standardmäßig aktiviert]
ossl_ssl.c:113:5: Warnung: (nahe der Initialisierung für
»ossl_ssl_method_tab[6].func«) [standardmäßig aktiviert]
ossl_ssl.c:114:5: Warnung: Initialisierung von inkompatiblem Zeigertyp
[standardmäßig aktiviert]
ossl_ssl.c:114:5: Warnung: (nahe der Initialisierung für
»ossl_ssl_method_tab[7].func«) [standardmäßig aktiviert]
ossl_ssl.c:115:5: Warnung: Initialisierung von inkompatiblem Zeigertyp
[standardmäßig aktiviert]
ossl_ssl.c:115:5: Warnung: (nahe der Initialisierung für
»ossl_ssl_method_tab[8].func«) [standardmäßig aktiviert]
ossl_pkcs7.c: Auf höchster Ebene:
ossl_pkcs7.c:573:1: Fehler: unbekannter Typname: »STACK«
ossl_pkcs7.c: In Funktion »pkcs7_get_certs_or_crls«:
ossl_pkcs7.c:593:15: Warnung: Zuweisung von inkompatiblem Zeigertyp
[standardmäßig aktiviert]
ossl_pkcs7.c:596:31: Warnung: Zeigertyp passt nicht in bedingtem Ausdruck
[standardmäßig aktiviert]
ossl_pkcs7.c: In Funktion »ossl_pkcs7_set_certificates«:
ossl_pkcs7.c:611:11: Warnung: Zuweisung von inkompatiblem Zeigertyp
[standardmäßig aktiviert]
ossl_pkcs7.c: In Funktion »ossl_pkcs7_get_certificates«:
ossl_pkcs7.c:621:5: Warnung: Übergabe des Arguments 1 von
»ossl_x509_sk2ary« von inkompatiblem Zeigertyp [standardmäßig aktiviert]
In file included from ossl_pkcs7.c:11:0:
ossl.h:121:7: Anmerkung: »struct stack_st_X509 *« erwartet, aber Argument
hat Typ »int *«
ossl_pkcs7.c: In Funktion »ossl_pkcs7_set_crls«:
ossl_pkcs7.c:651:10: Warnung: Zuweisung von inkompatiblem Zeigertyp
[standardmäßig aktiviert]
ossl_pkcs7.c: In Funktion »ossl_pkcs7_get_crls«:
ossl_pkcs7.c:661:5: Warnung: Übergabe des Arguments 1 von
»ossl_x509crl_sk2ary« von inkompatiblem Zeigertyp [standardmäßig
aktiviert]
In file included from ossl_pkcs7.c:11:0:
ossl.h:122:7: Anmerkung: »struct stack_st_X509_CRL *« erwartet, aber
Argument hat Typ »int *«
make[1]: *** [ossl.o] Fehler 1
make[1]: *** Warte auf noch nicht beendete Prozesse...
ossl_ssl.c: In Funktion »ossl_sslctx_get_ciphers«:
ossl_ssl.c:629:19: Fehler: »STACK« nicht deklariert (erste Benutzung in
dieser Funktion)
ossl_ssl.c:629:19: Anmerkung: jeder nicht deklarierte Bezeichner wird nur
einmal für jede Funktion, in der er vorkommt, gemeldet
ossl_ssl.c:629:25: Fehler: expected expression before »)« token
ossl_ssl.c:632:47: Fehler: expected expression before »)« token
ossl_ssl.c:632:47: Fehler: Zu wenige Argumente für Funktion »sk_value«
In file included from /home/olga/.rvm/usr/include/openssl/crypto.h:128:0,
from /home/olga/.rvm/usr/include/openssl/bio.h:69,
from /home/olga/.rvm/usr/include/openssl/err.h:124,
from ossl.h:56,
from ossl_ssl.c:13:
/home/olga/.rvm/usr/include/openssl/stack.h:80:7: Anmerkung: hier deklariert
ossl_ssl.c: In Funktion »ossl_ssl_get_peer_cert_chain«:
ossl_ssl.c:1202:5: Warnung: Übergabe des Arguments 1 von »sk_num« von
inkompatiblem Zeigertyp [standardmäßig aktiviert]
In file included from /home/olga/.rvm/usr/include/openssl/crypto.h:128:0,
from /home/olga/.rvm/usr/include/openssl/bio.h:69,
from /home/olga/.rvm/usr/include/openssl/err.h:124,
from ossl.h:56,
from ossl_ssl.c:13:
/home/olga/.rvm/usr/include/openssl/stack.h:79:5: Anmerkung: »const struct
_STACK *« erwartet, aber Argument hat Typ »struct stack_st_X509 *«
ossl_ssl.c:1205:2: Warnung: Übergabe des Arguments 1 von »sk_value« von
inkompatiblem Zeigertyp [standardmäßig aktiviert]
In file included from /home/olga/.rvm/usr/include/openssl/crypto.h:128:0,
from /home/olga/.rvm/usr/include/openssl/bio.h:69,
from /home/olga/.rvm/usr/include/openssl/err.h:124,
from ossl.h:56,
from ossl_ssl.c:13:
/home/olga/.rvm/usr/include/openssl/stack.h:80:7: Anmerkung: »const struct
_STACK *« erwartet, aber Argument hat Typ »struct stack_st_X509 *«
ossl_ssl.c: In Funktion »ossl_ssl_get_cipher«:
ossl_ssl.c:1227:12: Warnung: Zuweisung streicht Qualifizierer »const« von
Zeiger-Zieltyp [standardmäßig aktiviert]
make[1]: *** [ossl_pkcs7.o] Fehler 1
make[1]: *** [ossl_ssl.o] Fehler 1
ossl_x509cert.c: In Funktion »ossl_x509_inspect«:
ossl_x509cert.c:693:19: Warnung: Initialisierung streicht Qualifizierer
»const« von Zeiger-Zieltyp [standardmäßig aktiviert]
make[1]: Verlasse Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/openssl'
make: *** [all] Fehler 1
What can I do?
thanks forward!
i have a problem with installation of ruby-1.8.7-p249 on rvm under Ubuntu
13.04. Have tryed also to do so can not install ruby-1.8.7-p249 on rvm,
but come always to the same results :(
olga@olga-ThinkPad:~$ rvm install 1.8.7-p249
Searching for binary rubies, this might take some time.
No binary rubies available for: ubuntu/13.04/x86_64/ruby-1.8.7-p249.
Continuing with compilation. Please read 'rvm help mount' to get more
information on binary rubies.
Checking requirements for ubuntu.
Requirements installation successful.
Installing Ruby from source to: /home/olga/.rvm/rubies/ruby-1.8.7-p249,
this may take a while depending on your cpu(s)...
ruby-1.8.7-p249 - #downloading ruby-1.8.7-p249, this may take a while
depending on your connection...
ruby-1.8.7-p249 - #extracted to /home/olga/.rvm/src/ruby-1.8.7-p249
(already extracted)
Patch stdout-rouge-fix was already applied.
Patch no_sslv2 was already applied.
ruby-1.8.7-p249 -
#configuring..................................................................................................................................................................................................................................................................................................
ruby-1.8.7-p249 - #post-configuration
ruby-1.8.7-p249 -
#compiling......................................................................................................................................................................................
Error running '__rvm_make -j4',
please read /home/olga/.rvm/log/1380327224_ruby-1.8.7-p249/make.log
There has been an error while running make. Halting the installation.
make.log content:
[2013-09-28 01:52:31] __rvm_make
__rvm_make ()
{
\make "$@" || return $?
}
current path: /home/olga/.rvm/src/ruby-1.8.7-p249
command(2): __rvm_make -j4
gcc -O3 -O2 -fno-tree-dce -fno-optimize-sibling-calls -fPIC
-DRUBY_EXPORT -D_GNU_SOURCE=1 -L. -rdynamic -Wl,-export-dynamic main.o
libruby-static.a -lrt -ldl -lcrypt -lm -o miniruby
gcc -shared -Wl,-soname,libruby.so.1.8 array.o bignum.o class.o compar.o
dir.o dln.o enum.o enumerator.o error.o eval.o file.o gc.o hash.o inits.o
io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o prec.o
random.o range.o re.o regex.o ruby.o signal.o sprintf.o st.o string.o
struct.o time.o util.o variable.o version.o dmyext.o -lrt -ldl -lcrypt
-lm -o libruby.so.1.8.7
rbconfig.rb updated
compiling Win32API
compiling bigdecimal
make[1]: Betrete Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/bigdecimal'
gcc -shared -o ../../.ext/x86_64-linux/bigdecimal.so bigdecimal.o -L.
-L../.. -L. -rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lrt -ldl -lcrypt -lm
-lc
make[1]: Verlasse Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/bigdecimal'
compiling curses
make[1]: Betrete Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/curses'
gcc -shared -o ../../.ext/x86_64-linux/curses.so curses.o -L. -L../.. -L.
-rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lncurses -ltinfo
-lrt -ldl -lcrypt -lm -lc
make[1]: Verlasse Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/curses'
compiling dbm
make[1]: Betrete Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/dbm'
gcc -shared -o ../../.ext/x86_64-linux/dbm.so dbm.o -L. -L../.. -L.
-rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lgdbm_compat -lgdbm
-lrt -ldl -lcrypt -lm -lc
make[1]: Verlasse Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/dbm'
compiling digest
make[1]: Betrete Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/digest'
cp ../.././ext/digest/digest.h ../../.ext/x86_64-linux
gcc -shared -o ../../.ext/x86_64-linux/digest.so digest.o -L. -L../.. -L.
-rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lrt -ldl -lcrypt -lm
-lc
make[1]: Verlasse Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/digest'
compiling digest/bubblebabble
make[1]: Betrete Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/digest/bubblebabble'
gcc -shared -o ../../../.ext/x86_64-linux/digest/bubblebabble.so
bubblebabble.o -L. -L../../.. -L. -rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lrt -ldl -lcrypt -lm
-lc
make[1]: Verlasse Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/digest/bubblebabble'
compiling digest/md5
make[1]: Betrete Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/digest/md5'
gcc -shared -o ../../../.ext/x86_64-linux/digest/md5.so md5init.o
md5ossl.o -L. -L../../.. -L/home/olga/.rvm/usr/lib
-Wl,-R/home/olga/.rvm/usr/lib -L. -rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lcrypto -lrt -ldl
-lcrypt -lm -lc
make[1]: Verlasse Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/digest/md5'
compiling digest/rmd160
make[1]: Betrete Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/digest/rmd160'
gcc -shared -o ../../../.ext/x86_64-linux/digest/rmd160.so rmd160init.o
rmd160ossl.o -L. -L../../.. -L/home/olga/.rvm/usr/lib
-Wl,-R/home/olga/.rvm/usr/lib -L. -rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lcrypto -lrt -ldl
-lcrypt -lm -lc
make[1]: Verlasse Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/digest/rmd160'
compiling digest/sha1
make[1]: Betrete Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/digest/sha1'
gcc -shared -o ../../../.ext/x86_64-linux/digest/sha1.so sha1init.o
sha1ossl.o -L. -L../../.. -L/home/olga/.rvm/usr/lib
-Wl,-R/home/olga/.rvm/usr/lib -L. -rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lcrypto -lrt -ldl
-lcrypt -lm -lc
make[1]: Verlasse Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/digest/sha1'
compiling digest/sha2
make[1]: Betrete Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/digest/sha2'
gcc -shared -o ../../../.ext/x86_64-linux/digest/sha2.so sha2.o sha2init.o
-L. -L../../.. -L. -rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lrt -ldl -lcrypt -lm
-lc
make[1]: Verlasse Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/digest/sha2'
compiling dl
make[1]: Betrete Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/dl'
cp dlconfig.h ../../.ext/x86_64-linux
cp ../.././ext/dl/dl.h ../../.ext/x86_64-linux
gcc -shared -o ../../.ext/x86_64-linux/dl.so dl.o handle.o ptr.o sym.o -L.
-L../.. -L. -rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -ldl -lrt -ldl
-lcrypt -lm -lc
make[1]: Verlasse Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/dl'
compiling etc
make[1]: Betrete Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/etc'
gcc -shared -o ../../.ext/x86_64-linux/etc.so etc.o -L. -L../.. -L.
-rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lrt -ldl -lcrypt -lm
-lc
make[1]: Verlasse Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/etc'
compiling fcntl
make[1]: Betrete Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/fcntl'
gcc -shared -o ../../.ext/x86_64-linux/fcntl.so fcntl.o -L. -L../.. -L.
-rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lrt -ldl -lcrypt -lm
-lc
make[1]: Verlasse Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/fcntl'
compiling gdbm
make[1]: Betrete Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/gdbm'
gcc -shared -o ../../.ext/x86_64-linux/gdbm.so gdbm.o -L. -L../.. -L.
-rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lgdbm -lrt -ldl
-lcrypt -lm -lc
make[1]: Verlasse Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/gdbm'
compiling iconv
make[1]: Betrete Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/iconv'
gcc -shared -o ../../.ext/x86_64-linux/iconv.so iconv.o -L. -L../.. -L.
-rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lrt -ldl -lcrypt -lm
-lc
make[1]: Verlasse Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/iconv'
compiling io/wait
make[1]: Betrete Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/io/wait'
gcc -shared -o ../../../.ext/x86_64-linux/io/wait.so wait.o -L. -L../../..
-L. -rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lrt -ldl -lcrypt -lm
-lc
make[1]: Verlasse Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/io/wait'
compiling nkf
make[1]: Betrete Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/nkf'
gcc -shared -o ../../.ext/x86_64-linux/nkf.so nkf.o -L. -L../.. -L.
-rdynamic -Wl,-export-dynamic -Wl,-R
-Wl,/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib
-L/home/olga/.rvm/rubies/ruby-1.8.7-p249/lib -lruby -lrt -ldl -lcrypt -lm
-lc
make[1]: Verlasse Verzeichnis '/home/olga/.rvm/src/ruby-1.8.7-p249/ext/nkf'
compiling openssl
make[1]: Betrete Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/openssl'
gcc -I. -I../.. -I../../. -I../.././ext/openssl
-DRUBY_EXTCONF_H=\"extconf.h\" -I/home/olga/.rvm/usr/include -fPIC -O3
-O2 -fno-tree-dce -fno-optimize-sibling-calls -fPIC -c ossl_pkcs7.c
gcc -I. -I../.. -I../../. -I../.././ext/openssl
-DRUBY_EXTCONF_H=\"extconf.h\" -I/home/olga/.rvm/usr/include -fPIC -O3
-O2 -fno-tree-dce -fno-optimize-sibling-calls -fPIC -c ossl_ssl.c
gcc -I. -I../.. -I../../. -I../.././ext/openssl
-DRUBY_EXTCONF_H=\"extconf.h\" -I/home/olga/.rvm/usr/include -fPIC -O3
-O2 -fno-tree-dce -fno-optimize-sibling-calls -fPIC -c ossl.c
gcc -I. -I../.. -I../../. -I../.././ext/openssl
-DRUBY_EXTCONF_H=\"extconf.h\" -I/home/olga/.rvm/usr/include -fPIC -O3
-O2 -fno-tree-dce -fno-optimize-sibling-calls -fPIC -c ossl_x509cert.c
ossl_pkcs7.c: In Funktion »ossl_pkcs7si_new«:
ossl_pkcs7.c:89:5: Warnung: Übergabe des Arguments 2 von »ASN1_dup« von
inkompatiblem Zeigertyp [standardmäßig aktiviert]
In file included from /home/olga/.rvm/usr/include/openssl/asn1_mac.h:62:0,
from ossl.h:57,
from ossl_pkcs7.c:11:
/home/olga/.rvm/usr/include/openssl/asn1.h:954:7: Anmerkung: »void *
(*)(void **, const unsigned char **, long int)« erwartet, aber Argument
hat Typ »char * (*)()«
ossl_pkcs7.c: In Funktion »DupPKCS7SignerPtr«:
ossl_pkcs7.c:102:5: Warnung: Übergabe des Arguments 2 von »ASN1_dup« von
inkompatiblem Zeigertyp [standardmäßig aktiviert]
In file included from /home/olga/.rvm/usr/include/openssl/asn1_mac.h:62:0,
from ossl.h:57,
from ossl_pkcs7.c:11:
/home/olga/.rvm/usr/include/openssl/asn1.h:954:7: Anmerkung: »void *
(*)(void **, const unsigned char **, long int)« erwartet, aber Argument
hat Typ »char * (*)()«
ossl_pkcs7.c: In Funktion »ossl_pkcs7ri_new«:
ossl_pkcs7.c:115:5: Warnung: Übergabe des Arguments 2 von »ASN1_dup« von
inkompatiblem Zeigertyp [standardmäßig aktiviert]
In file included from /home/olga/.rvm/usr/include/openssl/asn1_mac.h:62:0,
from ossl.h:57,
from ossl_pkcs7.c:11:
/home/olga/.rvm/usr/include/openssl/asn1.h:954:7: Anmerkung: »void *
(*)(void **, const unsigned char **, long int)« erwartet, aber Argument
hat Typ »char * (*)()«
ossl.c:118:1: Fehler: unbekannter Typname: »STACK«
ossl.c:119:1: Fehler: unbekannter Typname: »STACK«
ossl_pkcs7.c: In Funktion »DupPKCS7RecipientPtr«:
ossl_pkcs7.c:128:5: Warnung: Übergabe des Arguments 2 von »ASN1_dup« von
inkompatiblem Zeigertyp [standardmäßig aktiviert]
In file included from /home/olga/.rvm/usr/include/openssl/asn1_mac.h:62:0,
from ossl.h:57,
from ossl_pkcs7.c:11:
/home/olga/.rvm/usr/include/openssl/asn1.h:954:7: Anmerkung: »void *
(*)(void **, const unsigned char **, long int)« erwartet, aber Argument
hat Typ »char * (*)()«
ossl_ssl.c:101:5: Warnung: Initialisierung von inkompatiblem Zeigertyp
[standardmäßig aktiviert]
ossl_ssl.c:101:5: Warnung: (nahe der Initialisierung für
»ossl_ssl_method_tab[0].func«) [standardmäßig aktiviert]
ossl_ssl.c:102:5: Warnung: Initialisierung von inkompatiblem Zeigertyp
[standardmäßig aktiviert]
ossl_ssl.c:102:5: Warnung: (nahe der Initialisierung für
»ossl_ssl_method_tab[1].func«) [standardmäßig aktiviert]
ossl_ssl.c:103:5: Warnung: Initialisierung von inkompatiblem Zeigertyp
[standardmäßig aktiviert]
ossl_ssl.c:103:5: Warnung: (nahe der Initialisierung für
»ossl_ssl_method_tab[2].func«) [standardmäßig aktiviert]
ossl_ssl.c:110:5: Warnung: Initialisierung von inkompatiblem Zeigertyp
[standardmäßig aktiviert]
ossl_ssl.c:110:5: Warnung: (nahe der Initialisierung für
»ossl_ssl_method_tab[3].func«) [standardmäßig aktiviert]
ossl_ssl.c:111:5: Warnung: Initialisierung von inkompatiblem Zeigertyp
[standardmäßig aktiviert]
ossl_ssl.c:111:5: Warnung: (nahe der Initialisierung für
»ossl_ssl_method_tab[4].func«) [standardmäßig aktiviert]
ossl_ssl.c:112:5: Warnung: Initialisierung von inkompatiblem Zeigertyp
[standardmäßig aktiviert]
ossl_ssl.c:112:5: Warnung: (nahe der Initialisierung für
»ossl_ssl_method_tab[5].func«) [standardmäßig aktiviert]
ossl_ssl.c:113:5: Warnung: Initialisierung von inkompatiblem Zeigertyp
[standardmäßig aktiviert]
ossl_ssl.c:113:5: Warnung: (nahe der Initialisierung für
»ossl_ssl_method_tab[6].func«) [standardmäßig aktiviert]
ossl_ssl.c:114:5: Warnung: Initialisierung von inkompatiblem Zeigertyp
[standardmäßig aktiviert]
ossl_ssl.c:114:5: Warnung: (nahe der Initialisierung für
»ossl_ssl_method_tab[7].func«) [standardmäßig aktiviert]
ossl_ssl.c:115:5: Warnung: Initialisierung von inkompatiblem Zeigertyp
[standardmäßig aktiviert]
ossl_ssl.c:115:5: Warnung: (nahe der Initialisierung für
»ossl_ssl_method_tab[8].func«) [standardmäßig aktiviert]
ossl_pkcs7.c: Auf höchster Ebene:
ossl_pkcs7.c:573:1: Fehler: unbekannter Typname: »STACK«
ossl_pkcs7.c: In Funktion »pkcs7_get_certs_or_crls«:
ossl_pkcs7.c:593:15: Warnung: Zuweisung von inkompatiblem Zeigertyp
[standardmäßig aktiviert]
ossl_pkcs7.c:596:31: Warnung: Zeigertyp passt nicht in bedingtem Ausdruck
[standardmäßig aktiviert]
ossl_pkcs7.c: In Funktion »ossl_pkcs7_set_certificates«:
ossl_pkcs7.c:611:11: Warnung: Zuweisung von inkompatiblem Zeigertyp
[standardmäßig aktiviert]
ossl_pkcs7.c: In Funktion »ossl_pkcs7_get_certificates«:
ossl_pkcs7.c:621:5: Warnung: Übergabe des Arguments 1 von
»ossl_x509_sk2ary« von inkompatiblem Zeigertyp [standardmäßig aktiviert]
In file included from ossl_pkcs7.c:11:0:
ossl.h:121:7: Anmerkung: »struct stack_st_X509 *« erwartet, aber Argument
hat Typ »int *«
ossl_pkcs7.c: In Funktion »ossl_pkcs7_set_crls«:
ossl_pkcs7.c:651:10: Warnung: Zuweisung von inkompatiblem Zeigertyp
[standardmäßig aktiviert]
ossl_pkcs7.c: In Funktion »ossl_pkcs7_get_crls«:
ossl_pkcs7.c:661:5: Warnung: Übergabe des Arguments 1 von
»ossl_x509crl_sk2ary« von inkompatiblem Zeigertyp [standardmäßig
aktiviert]
In file included from ossl_pkcs7.c:11:0:
ossl.h:122:7: Anmerkung: »struct stack_st_X509_CRL *« erwartet, aber
Argument hat Typ »int *«
make[1]: *** [ossl.o] Fehler 1
make[1]: *** Warte auf noch nicht beendete Prozesse...
ossl_ssl.c: In Funktion »ossl_sslctx_get_ciphers«:
ossl_ssl.c:629:19: Fehler: »STACK« nicht deklariert (erste Benutzung in
dieser Funktion)
ossl_ssl.c:629:19: Anmerkung: jeder nicht deklarierte Bezeichner wird nur
einmal für jede Funktion, in der er vorkommt, gemeldet
ossl_ssl.c:629:25: Fehler: expected expression before »)« token
ossl_ssl.c:632:47: Fehler: expected expression before »)« token
ossl_ssl.c:632:47: Fehler: Zu wenige Argumente für Funktion »sk_value«
In file included from /home/olga/.rvm/usr/include/openssl/crypto.h:128:0,
from /home/olga/.rvm/usr/include/openssl/bio.h:69,
from /home/olga/.rvm/usr/include/openssl/err.h:124,
from ossl.h:56,
from ossl_ssl.c:13:
/home/olga/.rvm/usr/include/openssl/stack.h:80:7: Anmerkung: hier deklariert
ossl_ssl.c: In Funktion »ossl_ssl_get_peer_cert_chain«:
ossl_ssl.c:1202:5: Warnung: Übergabe des Arguments 1 von »sk_num« von
inkompatiblem Zeigertyp [standardmäßig aktiviert]
In file included from /home/olga/.rvm/usr/include/openssl/crypto.h:128:0,
from /home/olga/.rvm/usr/include/openssl/bio.h:69,
from /home/olga/.rvm/usr/include/openssl/err.h:124,
from ossl.h:56,
from ossl_ssl.c:13:
/home/olga/.rvm/usr/include/openssl/stack.h:79:5: Anmerkung: »const struct
_STACK *« erwartet, aber Argument hat Typ »struct stack_st_X509 *«
ossl_ssl.c:1205:2: Warnung: Übergabe des Arguments 1 von »sk_value« von
inkompatiblem Zeigertyp [standardmäßig aktiviert]
In file included from /home/olga/.rvm/usr/include/openssl/crypto.h:128:0,
from /home/olga/.rvm/usr/include/openssl/bio.h:69,
from /home/olga/.rvm/usr/include/openssl/err.h:124,
from ossl.h:56,
from ossl_ssl.c:13:
/home/olga/.rvm/usr/include/openssl/stack.h:80:7: Anmerkung: »const struct
_STACK *« erwartet, aber Argument hat Typ »struct stack_st_X509 *«
ossl_ssl.c: In Funktion »ossl_ssl_get_cipher«:
ossl_ssl.c:1227:12: Warnung: Zuweisung streicht Qualifizierer »const« von
Zeiger-Zieltyp [standardmäßig aktiviert]
make[1]: *** [ossl_pkcs7.o] Fehler 1
make[1]: *** [ossl_ssl.o] Fehler 1
ossl_x509cert.c: In Funktion »ossl_x509_inspect«:
ossl_x509cert.c:693:19: Warnung: Initialisierung streicht Qualifizierer
»const« von Zeiger-Zieltyp [standardmäßig aktiviert]
make[1]: Verlasse Verzeichnis
'/home/olga/.rvm/src/ruby-1.8.7-p249/ext/openssl'
make: *** [all] Fehler 1
What can I do?
thanks forward!
update sql table xml column with xml of each row
update sql table xml column with xml of each row
All I want is to update rowXml column as shown below so that table
contains xml for > each row.
`Declare @tbl table (id int, name varchar(50), rowXml xml)
insert into @tbl (id, name)
values (1,'A'), (2, 'B'), (3,'C'),(4,'D')
Select * from @tbl
update @tbl set rowXml = '<row><id>1</id><name>A</name> </row>' where id = 1
update @tbl set rowXml = '<row><id>2</id><name>B</name> </row>' where id = 2
update @tbl set rowXml = '<row><id>3</id><name>C</name> </row>' where id = 3
update @tbl set rowXml = '<row><id>4</id><name>D</name> </row>' where id = 4
Select * from @tbl
`
What I want as output is the output from @tbl. I know that there is a lot
of xml support in sql server 2008 r2, just want to know the most efficient
way to achieve this
All I want is to update rowXml column as shown below so that table
contains xml for > each row.
`Declare @tbl table (id int, name varchar(50), rowXml xml)
insert into @tbl (id, name)
values (1,'A'), (2, 'B'), (3,'C'),(4,'D')
Select * from @tbl
update @tbl set rowXml = '<row><id>1</id><name>A</name> </row>' where id = 1
update @tbl set rowXml = '<row><id>2</id><name>B</name> </row>' where id = 2
update @tbl set rowXml = '<row><id>3</id><name>C</name> </row>' where id = 3
update @tbl set rowXml = '<row><id>4</id><name>D</name> </row>' where id = 4
Select * from @tbl
`
What I want as output is the output from @tbl. I know that there is a lot
of xml support in sql server 2008 r2, just want to know the most efficient
way to achieve this
Prompting for a double and reading in until user has correctly entered a floating point number
Prompting for a double and reading in until user has correctly entered a
floating point number
I don't quite understand this question. It wants me to write a code that
prompts for and reads a double and repeats that process until the user has
correctly entered a floating point number.
Isn't double a type of floating point? So how would this code end?
floating point number
I don't quite understand this question. It wants me to write a code that
prompts for and reads a double and repeats that process until the user has
correctly entered a floating point number.
Isn't double a type of floating point? So how would this code end?
Caller id java program. I have no idea where or how to start
Caller id java program. I have no idea where or how to start
I have to create essentially a java program for Caller ID and I am
overwhelmed. I dont know where to start and I have to have this done by 12
midnight tonight. I am fairly new to programing and I can usually code
well, but when it comes to linked lists and arrays and such im completely
lost. Ill type down the criteria and hopefully get some direction. . . .
When displaying the menu, use an abbreviated form (like (R)eceive,
(D)elete, (S)how,...) to get it to fit in as few lines as possible. Along
with the menu, you should display the last received call (number and
name). Give an appropriate message if there are no stored calls. After an
option is executed, redisplay the menu and the last call unless the user
decides to quit.
Receive a call: Prompt for the phone number and the name of the caller.
Store this data in a way to make further processing as efficient as
possible. Note that the call may be immediately blocked (see option 6). A
caller with the name "Unknown Caller" should automatically be blocked.
Delete last call: Prompt the user to make sure they want to do this. If
so, remove the most recent call from memory. This should give an error
message (and not prompt for confirmation) if there are no numbers in
memory.
Show previous calls: Prompt for a number k; display the last k calls. If
there are no calls in memory, do not prompt for k. If k is larger than the
number of calls in memory, display all the calls, and print the message:
"No more calls".
Purge call: Removes all copies of the first call that appear somewhere
else in the list. So, for example, if the list were A, B, C, A, D, B, A
this option would turn the list into A, B, C, D, B. If it were A, B, C, D,
B, it would remain as is. There should be no output from this option.
Find number: Prompt the user for a name. Return the number associated with
that name if it appears in the call list; print an appropriate response if
not. Do not prompt for a name if the call list is empty.
Block call: Add the last call to a "block list" (removing it from the
regular list). If that number/name combination is ever received again, it
should not be added to the call list (print an appropriate message
instead).
Quit the program
For the normal "call list", you should use a list class similar to that
built in chapter 2. It must be something you code "from scratch". For the
"block list", you should use a class that is coded for you already in Java
(like ArrayList or LinkedList). Please be sure to comment appropriately. .
. .
I have to create essentially a java program for Caller ID and I am
overwhelmed. I dont know where to start and I have to have this done by 12
midnight tonight. I am fairly new to programing and I can usually code
well, but when it comes to linked lists and arrays and such im completely
lost. Ill type down the criteria and hopefully get some direction. . . .
When displaying the menu, use an abbreviated form (like (R)eceive,
(D)elete, (S)how,...) to get it to fit in as few lines as possible. Along
with the menu, you should display the last received call (number and
name). Give an appropriate message if there are no stored calls. After an
option is executed, redisplay the menu and the last call unless the user
decides to quit.
Receive a call: Prompt for the phone number and the name of the caller.
Store this data in a way to make further processing as efficient as
possible. Note that the call may be immediately blocked (see option 6). A
caller with the name "Unknown Caller" should automatically be blocked.
Delete last call: Prompt the user to make sure they want to do this. If
so, remove the most recent call from memory. This should give an error
message (and not prompt for confirmation) if there are no numbers in
memory.
Show previous calls: Prompt for a number k; display the last k calls. If
there are no calls in memory, do not prompt for k. If k is larger than the
number of calls in memory, display all the calls, and print the message:
"No more calls".
Purge call: Removes all copies of the first call that appear somewhere
else in the list. So, for example, if the list were A, B, C, A, D, B, A
this option would turn the list into A, B, C, D, B. If it were A, B, C, D,
B, it would remain as is. There should be no output from this option.
Find number: Prompt the user for a name. Return the number associated with
that name if it appears in the call list; print an appropriate response if
not. Do not prompt for a name if the call list is empty.
Block call: Add the last call to a "block list" (removing it from the
regular list). If that number/name combination is ever received again, it
should not be added to the call list (print an appropriate message
instead).
Quit the program
For the normal "call list", you should use a list class similar to that
built in chapter 2. It must be something you code "from scratch". For the
"block list", you should use a class that is coded for you already in Java
(like ArrayList or LinkedList). Please be sure to comment appropriately. .
. .
Parenthesis with object initializers
Parenthesis with object initializers
In C#, I can have a class such as:
class MyClass {
public void DoStuff();
}
I can initialize this class like:
MyClass mc = new MyClass();
Or:
MyClass mc = new MyClass { };
If I don't need the parenthesis, and there are no properties to be set by
an object initializer, why can't I do this?
MyClass mc = new MyClass;
In C#, I can have a class such as:
class MyClass {
public void DoStuff();
}
I can initialize this class like:
MyClass mc = new MyClass();
Or:
MyClass mc = new MyClass { };
If I don't need the parenthesis, and there are no properties to be set by
an object initializer, why can't I do this?
MyClass mc = new MyClass;
How to access a specific key from an associative array in PHP?
How to access a specific key from an associative array in PHP?
I'm a newbie to this associative array concept in PHP. Now I'm having an
array named $sample as follows:
Array
(
[name] => definitions
[text] =>
[attributes] => Array
(
[name] => Mediation_Soap_Server_Reporting
[targetnamespace] => https://mediation.moceanmobile.net/soap/reporting
)
[children] => Array
(
[types] => Array
(
[0] => Array
(
[name] => types
[text] =>
[attributes] => Array
(
)
[children] => Array
(
[xsd:schema] => Array
(
[0] => Array
(
[name] => schema
[text] =>
[attributes] => Array
(
[targetnamespace] =>
https://mediation.moceanmobile.net/soap/reporting
)
[children] => Array
(
[xsd:complextype] => Array
(
[0] => Array
(
[name] => complextype
[text] =>
[attributes] => Array
(
[name] => Mediation_Soap_FaultMessage
)
[children] => Array
(
[xsd:sequence] => Array
(
[0] => Array
(
[name] => sequence
[text] =>
[attributes] => Array
(
)
)
)
)
)
)
)
)
)
)
)
)
)
)
From the above array I want to refer(or access) to the key xsd:schema. But
I'm not able to do it. Can you please tell me how should I access or refer
this key from the associative array names $sample? Thanks in advance.
I'm a newbie to this associative array concept in PHP. Now I'm having an
array named $sample as follows:
Array
(
[name] => definitions
[text] =>
[attributes] => Array
(
[name] => Mediation_Soap_Server_Reporting
[targetnamespace] => https://mediation.moceanmobile.net/soap/reporting
)
[children] => Array
(
[types] => Array
(
[0] => Array
(
[name] => types
[text] =>
[attributes] => Array
(
)
[children] => Array
(
[xsd:schema] => Array
(
[0] => Array
(
[name] => schema
[text] =>
[attributes] => Array
(
[targetnamespace] =>
https://mediation.moceanmobile.net/soap/reporting
)
[children] => Array
(
[xsd:complextype] => Array
(
[0] => Array
(
[name] => complextype
[text] =>
[attributes] => Array
(
[name] => Mediation_Soap_FaultMessage
)
[children] => Array
(
[xsd:sequence] => Array
(
[0] => Array
(
[name] => sequence
[text] =>
[attributes] => Array
(
)
)
)
)
)
)
)
)
)
)
)
)
)
)
From the above array I want to refer(or access) to the key xsd:schema. But
I'm not able to do it. Can you please tell me how should I access or refer
this key from the associative array names $sample? Thanks in advance.
Thursday, 26 September 2013
read js file using ajax not working
read js file using ajax not working
i have js file contains following :
MyApp.STR = {"Hi":"Hi","By":"By", };
i want to read it on HTML page using ajax.
$(document).ready(function() {
var f = "lib/string-en.js";
loadString(f);
function loadString(fileName) {
try {
console.log('called');
$.getScript("lib/string-en.js", function(data) {
console.log("data is"+data);
// Data returned
});
//We don't use the async callback, because we need
the translation in the next method
// console.log('value is '+MyApp.STR.Hi)
} catch (e) {
console.error('Error while loading : ' + fileName);
}
}
i have js file contains following :
MyApp.STR = {"Hi":"Hi","By":"By", };
i want to read it on HTML page using ajax.
$(document).ready(function() {
var f = "lib/string-en.js";
loadString(f);
function loadString(fileName) {
try {
console.log('called');
$.getScript("lib/string-en.js", function(data) {
console.log("data is"+data);
// Data returned
});
//We don't use the async callback, because we need
the translation in the next method
// console.log('value is '+MyApp.STR.Hi)
} catch (e) {
console.error('Error while loading : ' + fileName);
}
}
Wednesday, 25 September 2013
MS SQL Join Relational Table with a Where Clause
MS SQL Join Relational Table with a Where Clause
If I take out the WHERE clause the Join seems to work fine on glance...
and the imageID 485 does exist... however, when I insert the WHERE clause
below I come back with 0 results.
How do I add the WHERE clause to properly work with 3 tables joining?
declare @imageID int
set @imageID = 485
SELECT Image.imageID, Image.filename, Image.imageFile
FROM MovieHasImage
JOIN Movie
ON MovieHasImage.movieID = Movie.movieID
JOIN Image
ON MovieHasImage.imageID = Image.imageID
WHERE Image.imageID = @imageID --HERE IS THE CAUSE OF THE ISSUE
GO
If I take out the WHERE clause the Join seems to work fine on glance...
and the imageID 485 does exist... however, when I insert the WHERE clause
below I come back with 0 results.
How do I add the WHERE clause to properly work with 3 tables joining?
declare @imageID int
set @imageID = 485
SELECT Image.imageID, Image.filename, Image.imageFile
FROM MovieHasImage
JOIN Movie
ON MovieHasImage.movieID = Movie.movieID
JOIN Image
ON MovieHasImage.imageID = Image.imageID
WHERE Image.imageID = @imageID --HERE IS THE CAUSE OF THE ISSUE
GO
Thursday, 19 September 2013
Single Page Application - Large DOM - SLOW
Single Page Application - Large DOM - SLOW
I'm developing a single page application that uses a lot of widgets
(mainly grids and tabs) from the jqWidgets library that are all loaded
upon page load. It's getting quite large and I've started to notice after
using the site for a couple minutes the UI becomes quite slow and
sometimes non-responsive, when the page is refreshed everything works
smooth again for a few minutes then back to laggy. I'm still testing on
localhost. My initial reaction was that the DOM has too many elements
(each grid creates hundreds of divs! And I have a lot of them) so event
listeners which are tied to IDs have to search through too many elements
and become slow. If this is the case it won't be too hard to fix, is my
assumption likely to be the culprit or do I have worse things to fear?
I'm developing a single page application that uses a lot of widgets
(mainly grids and tabs) from the jqWidgets library that are all loaded
upon page load. It's getting quite large and I've started to notice after
using the site for a couple minutes the UI becomes quite slow and
sometimes non-responsive, when the page is refreshed everything works
smooth again for a few minutes then back to laggy. I'm still testing on
localhost. My initial reaction was that the DOM has too many elements
(each grid creates hundreds of divs! And I have a lot of them) so event
listeners which are tied to IDs have to search through too many elements
and become slow. If this is the case it won't be too hard to fix, is my
assumption likely to be the culprit or do I have worse things to fear?
Access violation reading location location 0x1D5C4C2F
Access violation reading location location 0x1D5C4C2F
This function is throwing an access violation when reading raw pixel
values and I can't figure out why. Can consider this as the only part of
my code running, I've run this solo with the same result.
string filenames[]={"firstclick.raw",
"secondclick.raw","thirdclick.raw","fourthclick.raw","fifthclick.raw","sixthclick.raw","seventhclick.raw","eighthclick.raw"};
FILE *file;
int height= 750, width = 453, bbp=3;
unsigned char ****images;
images = (unsigned char ****)malloc(sizeof(unsigned char ***)*8);
for(int j = 0; j<8; j++){
images[j] = (unsigned char ***)malloc(sizeof(unsigned char**)*height);
for(int i = 0; i<height; i++){
images[j][i]= (unsigned char **)malloc(sizeof(unsigned char*)*width);
for(int k = 0; k<bbp; k++)
images[j][i][k]= (unsigned char *)malloc(sizeof(unsigned
char)*bbp);
}
}
for (int i = 0; i<8; i++){
if (!(file=fopen(filenames[i].c_str(),"rb"))){
cout << "Cannot open file: "<<filenames[i].c_str() <<endl;
exit(1);
}
fread(images[i], sizeof(unsigned char), height*width*bbp, file);
fclose(file);
}
This function is throwing an access violation when reading raw pixel
values and I can't figure out why. Can consider this as the only part of
my code running, I've run this solo with the same result.
string filenames[]={"firstclick.raw",
"secondclick.raw","thirdclick.raw","fourthclick.raw","fifthclick.raw","sixthclick.raw","seventhclick.raw","eighthclick.raw"};
FILE *file;
int height= 750, width = 453, bbp=3;
unsigned char ****images;
images = (unsigned char ****)malloc(sizeof(unsigned char ***)*8);
for(int j = 0; j<8; j++){
images[j] = (unsigned char ***)malloc(sizeof(unsigned char**)*height);
for(int i = 0; i<height; i++){
images[j][i]= (unsigned char **)malloc(sizeof(unsigned char*)*width);
for(int k = 0; k<bbp; k++)
images[j][i][k]= (unsigned char *)malloc(sizeof(unsigned
char)*bbp);
}
}
for (int i = 0; i<8; i++){
if (!(file=fopen(filenames[i].c_str(),"rb"))){
cout << "Cannot open file: "<<filenames[i].c_str() <<endl;
exit(1);
}
fread(images[i], sizeof(unsigned char), height*width*bbp, file);
fclose(file);
}
SQL for rowsource of listbox needs to change when moved to subform
SQL for rowsource of listbox needs to change when moved to subform
I have a FindClientsNavigation form which contains a listbox lstbxclients
populated with client names and IDs. lstbxclients is filtered based on
text entered by the user in a textbox txtFilterClients. lstbxclients is
populated by having its rowsource set to the following query:
SELECT c.ClientNumber, c.FullName FROM Clients AS c
WHERE (((c.FullName) Like '*' &
[Forms]![FindClientsNavigation]![txtFilterClients].[Text] & '*'))
ORDER BY c.FullName;
This works perfectly. However, a problem emerged when I created a Main
form containing a navigation control, and dragged the
FindClientsNavigation form onto one of the tabs in the navigation control
and tried to run the Main form in form view. I am pretty sure the problem
is in the SQL in the rowsource of lstbxClients, so I changed that SQL to:
SELECT c.ClientNumber, c.FullName FROM Clients AS c
WHERE (((c.FullName) Like '*' &
[Forms]![Main]![FindClientsNavigation]![txtFilterClients].[Text] & '*'))
ORDER BY c.FullName;
However, I still get the same error message, which you can see in the
following printscreen:
Can anyone show me how to fix the SQL so that it does not trigger this
dialog box? I don't know if this has to do with the fact that
FindClientsNavigation is only one of a number of possible subforms that
are within the NavigationSubForm of the Main form.
I have a FindClientsNavigation form which contains a listbox lstbxclients
populated with client names and IDs. lstbxclients is filtered based on
text entered by the user in a textbox txtFilterClients. lstbxclients is
populated by having its rowsource set to the following query:
SELECT c.ClientNumber, c.FullName FROM Clients AS c
WHERE (((c.FullName) Like '*' &
[Forms]![FindClientsNavigation]![txtFilterClients].[Text] & '*'))
ORDER BY c.FullName;
This works perfectly. However, a problem emerged when I created a Main
form containing a navigation control, and dragged the
FindClientsNavigation form onto one of the tabs in the navigation control
and tried to run the Main form in form view. I am pretty sure the problem
is in the SQL in the rowsource of lstbxClients, so I changed that SQL to:
SELECT c.ClientNumber, c.FullName FROM Clients AS c
WHERE (((c.FullName) Like '*' &
[Forms]![Main]![FindClientsNavigation]![txtFilterClients].[Text] & '*'))
ORDER BY c.FullName;
However, I still get the same error message, which you can see in the
following printscreen:
Can anyone show me how to fix the SQL so that it does not trigger this
dialog box? I don't know if this has to do with the fact that
FindClientsNavigation is only one of a number of possible subforms that
are within the NavigationSubForm of the Main form.
MySQL: my.ini not read
MySQL: my.ini not read
I have MySQL 5.6 installed on Windows 7 64 Bit and I can't seem to get it
to read my my.ini file. I've put the file into the base installation
directory, the Windows directory and C:\, but it doesn't look like it's
being read, even though all paths are listed here:
http://dev.mysql.com/doc/refman/5.1/en/option-files.html
My my.ini file doesn't do much, I just took the my-default.ini as a base
and added [mysqld] max_allowed_packet=100000000 because that default limit
of 4MB is bad for BLOBs.
When I start mysql.exe and check the variable I find that it's still at
4MB, even after restarting the server (both via the services menu in the
control panel and via mysqld -shutdown + mysqld -startup) and restarting
Windows.
I have Windows 7, 64 bit. Can anyone help me, please?
Thanks in advance!
Alex
I have MySQL 5.6 installed on Windows 7 64 Bit and I can't seem to get it
to read my my.ini file. I've put the file into the base installation
directory, the Windows directory and C:\, but it doesn't look like it's
being read, even though all paths are listed here:
http://dev.mysql.com/doc/refman/5.1/en/option-files.html
My my.ini file doesn't do much, I just took the my-default.ini as a base
and added [mysqld] max_allowed_packet=100000000 because that default limit
of 4MB is bad for BLOBs.
When I start mysql.exe and check the variable I find that it's still at
4MB, even after restarting the server (both via the services menu in the
control panel and via mysqld -shutdown + mysqld -startup) and restarting
Windows.
I have Windows 7, 64 bit. Can anyone help me, please?
Thanks in advance!
Alex
C++ Vector like class in C#
C++ Vector like class in C#
What is the analogous class of C++ std::vector in C#?
I want a class where it keeps an internal array inside and supports
insertion at the back in O(1) time.
What is the analogous class of C++ std::vector in C#?
I want a class where it keeps an internal array inside and supports
insertion at the back in O(1) time.
Search form, capital letters
Search form, capital letters
Can someone help me with this. The form needs to make no difference
between capital letters and normal letters.
$raw_results = mysql_query("SELECT * FROM product
WHERE (`naam` LIKE '%".$query."%') OR (`titel` LIKE
'%".$query."%') OR (`druk` LIKE '%".$query."%')") or
die(mysql_error());
Can someone help me with this. The form needs to make no difference
between capital letters and normal letters.
$raw_results = mysql_query("SELECT * FROM product
WHERE (`naam` LIKE '%".$query."%') OR (`titel` LIKE
'%".$query."%') OR (`druk` LIKE '%".$query."%')") or
die(mysql_error());
How can we center an iframe inside an absolute positionned div
How can we center an iframe inside an absolute positionned div
I tried to put the iframe tag inside an a tag and set its css to
text-align:center, but it didn't work
Edit Sorry, I mislead I have an iframe
<div>
<iframe type="text/html" width="640" height="360"
src="https://www.youtube.com/..." frameborder="0"
allowfullscreen=""></iframe>
<button type="button">Ajouter la vidéo...</button>
</div>
the div is itself centered and has class
width: 500px;
position: absolute;
top: 35%;
left: 30%;
margin-left: -200px;
z-index: 3;
I tried to put the iframe tag inside an a tag and set its css to
text-align:center, but it didn't work
Edit Sorry, I mislead I have an iframe
<div>
<iframe type="text/html" width="640" height="360"
src="https://www.youtube.com/..." frameborder="0"
allowfullscreen=""></iframe>
<button type="button">Ajouter la vidéo...</button>
</div>
the div is itself centered and has class
width: 500px;
position: absolute;
top: 35%;
left: 30%;
margin-left: -200px;
z-index: 3;
Wednesday, 18 September 2013
Accessing specific member of an ArrayList using Javascript
Accessing specific member of an ArrayList using Javascript
So, I have a table in a jsp page which shows the data fetched from a
database via an ArrayList forwarded to the page. Each row of the table has
a radio button corressponding to it. Now, I would like to access the
elements in the row (the ArrayList's members on the selection of the
corresponding radio button and then click of an 'edit' button) Any
thoughts as to how to achieve this would be very much appreciated. Here's
my code for a bit intro.
<%
ArrayList<requestbean> reqjsp = new ArrayList<requestbean>();
reqjsp = (ArrayList<requestbean>) (request.getAttribute("reqdb"));
%>
<script type ="text/javascript">
function x()
{
var ele = document.getElementsByName('reqradio');
var i = ele.length;
for (var j = 0; j < i; j++)
{
if (ele[j].checked)
{
document.getElementById("edireq").disabled = false;
alert('request '+(j+1)+' selected');
//Here is where the functionality is desired to access
reqjsp.get(j)
}
}
}
</script>
<input type="button" name="edireq" id="edireq" onclick="x()" value="Edit
Request">
These are a few columns in my table.
<%
for(int i=0;i<reqjsp.size();i++)
{
%>
<tr>
<td> <input type="radio" name="reqradio" id="req<%=(i+1) %>"></td>
<td><%= reqjsp.get(i).getRequestid() %></td>
<td><%= reqjsp.get(i).getRequestor() %></td>
<td><%= reqjsp.get(i).getApprover() %></td>
</tr>
<%} %>
So, I have a table in a jsp page which shows the data fetched from a
database via an ArrayList forwarded to the page. Each row of the table has
a radio button corressponding to it. Now, I would like to access the
elements in the row (the ArrayList's members on the selection of the
corresponding radio button and then click of an 'edit' button) Any
thoughts as to how to achieve this would be very much appreciated. Here's
my code for a bit intro.
<%
ArrayList<requestbean> reqjsp = new ArrayList<requestbean>();
reqjsp = (ArrayList<requestbean>) (request.getAttribute("reqdb"));
%>
<script type ="text/javascript">
function x()
{
var ele = document.getElementsByName('reqradio');
var i = ele.length;
for (var j = 0; j < i; j++)
{
if (ele[j].checked)
{
document.getElementById("edireq").disabled = false;
alert('request '+(j+1)+' selected');
//Here is where the functionality is desired to access
reqjsp.get(j)
}
}
}
</script>
<input type="button" name="edireq" id="edireq" onclick="x()" value="Edit
Request">
These are a few columns in my table.
<%
for(int i=0;i<reqjsp.size();i++)
{
%>
<tr>
<td> <input type="radio" name="reqradio" id="req<%=(i+1) %>"></td>
<td><%= reqjsp.get(i).getRequestid() %></td>
<td><%= reqjsp.get(i).getRequestor() %></td>
<td><%= reqjsp.get(i).getApprover() %></td>
</tr>
<%} %>
In AngularJS how do I pass variables between controllers with a service?
In AngularJS how do I pass variables between controllers with a service?
I want to pass a variable between controllers with a service. Here is the
service to pass the variable (in this case a song id):
'use strict';
angular.module('PortalApp')
.service('ActionbarService', ['$window', function
ActionbarService(window) {
var song;
return {
getSong: function () {
return song;
},
setSong: function(value) {
song = value;
}
};
}]);
Here is the relevant part of the controller I am setting the song from:
$scope.actionbarSetSong = function(song_id) {
ActionbarService.setSong(song_id);
}
and here is the service I am getting the song id from:
'use strict';
angular.module('PortalApp')
.controller('ActionbarCtrl', function ($scope, $rootScope, MediaService,
ActionbarService, $location, $routeParams, AudioPlayerAPI) {
// $scope.contentTemplate = '/views/album.html';
$scope.song_id = ActionbarService.getSong();
console.log($scope);
$scope.openPlaylistModal = function (song_id) {
$("#addToPlaylist").modal('show');
}
});
It is being set in the service because when I do getSong in my view it
worked (I forget where), but then when I try to set it in my 2nd
controller it doesn't work. Here's the relevant part of my view for
reference:
<div class="cell action-bar" ng-click="actionbarSetSong(song.id);"
ng-repeat="song in media.data">
<div class="offset-container pull-left">
<i ng-class="{'icon':true,'play-icon-fav':true,'on':song.favorite}"
data-ng-click="toggleFaves(song);"></i>
<i class="play-icon play-icon-play"
data-ng-click="player.setSong(song.id);" data-ng-class="{'active':
(song.id == currentSong.id && isPlaying == true), 'paused': (song.id
== currentSong.id && isPaused == true)}"></i>
</div>
I want to pass a variable between controllers with a service. Here is the
service to pass the variable (in this case a song id):
'use strict';
angular.module('PortalApp')
.service('ActionbarService', ['$window', function
ActionbarService(window) {
var song;
return {
getSong: function () {
return song;
},
setSong: function(value) {
song = value;
}
};
}]);
Here is the relevant part of the controller I am setting the song from:
$scope.actionbarSetSong = function(song_id) {
ActionbarService.setSong(song_id);
}
and here is the service I am getting the song id from:
'use strict';
angular.module('PortalApp')
.controller('ActionbarCtrl', function ($scope, $rootScope, MediaService,
ActionbarService, $location, $routeParams, AudioPlayerAPI) {
// $scope.contentTemplate = '/views/album.html';
$scope.song_id = ActionbarService.getSong();
console.log($scope);
$scope.openPlaylistModal = function (song_id) {
$("#addToPlaylist").modal('show');
}
});
It is being set in the service because when I do getSong in my view it
worked (I forget where), but then when I try to set it in my 2nd
controller it doesn't work. Here's the relevant part of my view for
reference:
<div class="cell action-bar" ng-click="actionbarSetSong(song.id);"
ng-repeat="song in media.data">
<div class="offset-container pull-left">
<i ng-class="{'icon':true,'play-icon-fav':true,'on':song.favorite}"
data-ng-click="toggleFaves(song);"></i>
<i class="play-icon play-icon-play"
data-ng-click="player.setSong(song.id);" data-ng-class="{'active':
(song.id == currentSong.id && isPlaying == true), 'paused': (song.id
== currentSong.id && isPaused == true)}"></i>
</div>
Parsing webpage with Jsoup. why is the behaviour on Android different?
Parsing webpage with Jsoup. why is the behaviour on Android different?
Document doc = Jsoup.connect(url).get();
If I run this code in Android I get a html code with 535 lines
(length:42599).
If I run this code in a sample desktop application get a html code with
2050 lines (length:292782, that is CORRECT. Same JSoup library of course.
Can anyone explain me why?
Document doc = Jsoup.connect(url).get();
If I run this code in Android I get a html code with 535 lines
(length:42599).
If I run this code in a sample desktop application get a html code with
2050 lines (length:292782, that is CORRECT. Same JSoup library of course.
Can anyone explain me why?
Gwt Server Side Logging
Gwt Server Side Logging
I have created GWT app, in which I have a Vertical Panel where I log the
details.
Client side logging I'm doing using logger
sample code is:
public static VerticalPanel customLogArea = new VerticalPanel();
public static Logger rootLogger = Logger.getLogger("");
logerPanel.setTitle("Log");
scrollPanel.add(customLogArea);
logerPanel.add(scrollPanel);
if (LogConfiguration.loggingIsEnabled()) {
rootLogger.addHandler(new HasWidgetsLogHandler(customLogArea));
}
And I'm updating my vertical log panel using this code
rootLogger.log(Level.INFO,
"Already Present in Process Workspace\n");
But now my question is , I have to log server side details also into my
vertical log panel.
My serverside GreetingServiceImpl code is:
public boolean createDirectory(String fileName)
throws IllegalArgumentException {
Boolean result = false;
try {
rootLogger.log(Level.INFO,
"I want to log this to my UI vertical log Panel");
system.out.println("log this to UI");
File dir = new File("D:/GenomeSamples/" + fileName);
if (!dir.exists()) {
result = dir.mkdir();
}
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
Now I want to log sysoutprt statements to my UI from here. How can I
achieve this. Now using rootLogger.log(Level.INFO, "I want to log this to
my UI vertical log Panel"); code it is logging this to eclipse console .
But how to log this to my UI in client side.
Please let me know If anything wrong in this question.
I have created GWT app, in which I have a Vertical Panel where I log the
details.
Client side logging I'm doing using logger
sample code is:
public static VerticalPanel customLogArea = new VerticalPanel();
public static Logger rootLogger = Logger.getLogger("");
logerPanel.setTitle("Log");
scrollPanel.add(customLogArea);
logerPanel.add(scrollPanel);
if (LogConfiguration.loggingIsEnabled()) {
rootLogger.addHandler(new HasWidgetsLogHandler(customLogArea));
}
And I'm updating my vertical log panel using this code
rootLogger.log(Level.INFO,
"Already Present in Process Workspace\n");
But now my question is , I have to log server side details also into my
vertical log panel.
My serverside GreetingServiceImpl code is:
public boolean createDirectory(String fileName)
throws IllegalArgumentException {
Boolean result = false;
try {
rootLogger.log(Level.INFO,
"I want to log this to my UI vertical log Panel");
system.out.println("log this to UI");
File dir = new File("D:/GenomeSamples/" + fileName);
if (!dir.exists()) {
result = dir.mkdir();
}
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
Now I want to log sysoutprt statements to my UI from here. How can I
achieve this. Now using rootLogger.log(Level.INFO, "I want to log this to
my UI vertical log Panel"); code it is logging this to eclipse console .
But how to log this to my UI in client side.
Please let me know If anything wrong in this question.
How to disable dates after current date
How to disable dates after current date
i have two views with twho js files,and one datepicker in eatch view, i
make this line to disable dates after current date in the two datepickers,
but this work in the first one and don't work in the second.
this work
var yesterday = new Date();
yesterday.setTime(yesterday.valueOf() - 24 * 60 * 60 * 1000);
$("#date_naissance_patient").datepicker('option','maxDate',yesterday );
this don"t work :
var yesterday = new Date();
yesterday.setTime(yesterday.valueOf() - 24 * 60 * 60 * 1000);
$("#date_naissance").datepicker('option','maxDate',yesterday );
i have two views with twho js files,and one datepicker in eatch view, i
make this line to disable dates after current date in the two datepickers,
but this work in the first one and don't work in the second.
this work
var yesterday = new Date();
yesterday.setTime(yesterday.valueOf() - 24 * 60 * 60 * 1000);
$("#date_naissance_patient").datepicker('option','maxDate',yesterday );
this don"t work :
var yesterday = new Date();
yesterday.setTime(yesterday.valueOf() - 24 * 60 * 60 * 1000);
$("#date_naissance").datepicker('option','maxDate',yesterday );
scalatra squeryl select where parameter type missing
scalatra squeryl select where parameter type missing
I am a Scalatra beginner and I have the following route:
get("/todos") {
contentType = formats("json")
val userid : Int = params.getOrElse("userid", halt(400)).toInt
val limit : Int = params.getOrElse("limit", "0").toInt
val offset : Int = params.getOrElse("offset", "0").toInt
if(limit != 0 && offset != 0)
from(TodoDb.todos)(todo => where(todo => todo.userid == userid)
select(todo)).toList
else {
from(TodoDb.todos)(todo => where(todo => todo.userid == userid)
select(todo) orderBy(todo.modified)).page(offset, limit).toList
}
}
I can't compile it, I got the following error messages:
[info] Compiling 1 Scala source to
/home/coelho/www/p.zomg.hu/gfmwa-todo-app/target/scala-2.10/classes...
[error]
/home/coelho/www/app/src/main/scala/hu/gfmwa/todoapp/TodoScalatraServlet.scala:25:
missing parameter type
[error] from(TodoDb.todos)(todo => where(todo => todo.userid ==
userid) select(todo)).toList
[error] ^
[error]
/home/coelho/www/app/src/main/scala/hu/gfmwa/todoapp/TodoScalatraServlet.scala:27:
missing parameter type
[error] from(TodoDb.todos)(todo => where(todo => todo.userid ==
userid) select(todo) orderBy(todo.modified)).page(offset, limit).toList
[error] ^
[error] two errors found
[error] (compile:compile) Compilation failed
I learn from here: http://squeryl.org/selects.html and here:
http://squeryl.org/pagination.html
I can't see parameter type information on these pages, I can't figure out,
what can be the problem. What I am doing wrong?
I am a Scalatra beginner and I have the following route:
get("/todos") {
contentType = formats("json")
val userid : Int = params.getOrElse("userid", halt(400)).toInt
val limit : Int = params.getOrElse("limit", "0").toInt
val offset : Int = params.getOrElse("offset", "0").toInt
if(limit != 0 && offset != 0)
from(TodoDb.todos)(todo => where(todo => todo.userid == userid)
select(todo)).toList
else {
from(TodoDb.todos)(todo => where(todo => todo.userid == userid)
select(todo) orderBy(todo.modified)).page(offset, limit).toList
}
}
I can't compile it, I got the following error messages:
[info] Compiling 1 Scala source to
/home/coelho/www/p.zomg.hu/gfmwa-todo-app/target/scala-2.10/classes...
[error]
/home/coelho/www/app/src/main/scala/hu/gfmwa/todoapp/TodoScalatraServlet.scala:25:
missing parameter type
[error] from(TodoDb.todos)(todo => where(todo => todo.userid ==
userid) select(todo)).toList
[error] ^
[error]
/home/coelho/www/app/src/main/scala/hu/gfmwa/todoapp/TodoScalatraServlet.scala:27:
missing parameter type
[error] from(TodoDb.todos)(todo => where(todo => todo.userid ==
userid) select(todo) orderBy(todo.modified)).page(offset, limit).toList
[error] ^
[error] two errors found
[error] (compile:compile) Compilation failed
I learn from here: http://squeryl.org/selects.html and here:
http://squeryl.org/pagination.html
I can't see parameter type information on these pages, I can't figure out,
what can be the problem. What I am doing wrong?
Tuesday, 17 September 2013
Form seemingly not returning post values or saving to DB on Django
Form seemingly not returning post values or saving to DB on Django
I've found several posts with questions practically identical to this, but
I've spent many hours trying to figure out my problem based on these posts
and just cannot for the life of me figure this out. I am trying to take
values from a form and put them into my database (and then list what's in
the database underneath my form, but that's more for me to see if it's
working). It seems that either the form values aren't being extracted or
I'm not properly saving to the database.
Here are my models:
from django.db import models
from django.forms import ModelForm
class Users(models.Model):
user_first_name = models.CharField(max_length=255)
user_last_name = models.CharField(max_length=255)
email_address = models.CharField(max_length=255)
class UserForm(ModelForm):
class Meta:
model = Users
fields = ['user_first_name', 'user_last_name', 'email_address']
views:
from django.shortcuts import render
from django.http import HttpResponseRedirect
from manage_users.models import Users, UserForm
def index(request):
users_list = Users.objects.all()
if request.method == 'POST':
form = UserForm(request.POST)
if form.is_valid():
user_first_name = request.POST.get('user_first_name', '')
user_last_name = request.POST.get('user_last_name', '')
email_address = request.POST.get('email_address', '')
users_obj = Users(user_first_name=user_first_name,
user_last_name=user_last_name, email_address=email_address)
users_obj.save()
return HttpResponseRedirect('/')
else:
form = UserForm()
return render(request, 'home.html', {
'form': form, 'users_list': users_list
})
And lastly, my html:
<body>
<form action="" method="post"> {% csrf_token %}
<div>
<label for="user_first_name">First Name:</label>
<input type="text" id="user_first_name" />
<br><label for="user_last_name">Last Name:</label>
<input type="text" id="user_last_name" />
<br><label for="email_address">Email Address:</label>
<input type="text" id="email_address" />
</div>
<button id ="add" type="submit">Submit</button>
</form>
{% if users_list %}
<ul>
{% for user in users_list %}
<li>{{ user }}</li>
{% endfor %}
</ul>
{% else %}
<p>No users are currently in the system</p>
{% endif %}
</body>
I've found several posts with questions practically identical to this, but
I've spent many hours trying to figure out my problem based on these posts
and just cannot for the life of me figure this out. I am trying to take
values from a form and put them into my database (and then list what's in
the database underneath my form, but that's more for me to see if it's
working). It seems that either the form values aren't being extracted or
I'm not properly saving to the database.
Here are my models:
from django.db import models
from django.forms import ModelForm
class Users(models.Model):
user_first_name = models.CharField(max_length=255)
user_last_name = models.CharField(max_length=255)
email_address = models.CharField(max_length=255)
class UserForm(ModelForm):
class Meta:
model = Users
fields = ['user_first_name', 'user_last_name', 'email_address']
views:
from django.shortcuts import render
from django.http import HttpResponseRedirect
from manage_users.models import Users, UserForm
def index(request):
users_list = Users.objects.all()
if request.method == 'POST':
form = UserForm(request.POST)
if form.is_valid():
user_first_name = request.POST.get('user_first_name', '')
user_last_name = request.POST.get('user_last_name', '')
email_address = request.POST.get('email_address', '')
users_obj = Users(user_first_name=user_first_name,
user_last_name=user_last_name, email_address=email_address)
users_obj.save()
return HttpResponseRedirect('/')
else:
form = UserForm()
return render(request, 'home.html', {
'form': form, 'users_list': users_list
})
And lastly, my html:
<body>
<form action="" method="post"> {% csrf_token %}
<div>
<label for="user_first_name">First Name:</label>
<input type="text" id="user_first_name" />
<br><label for="user_last_name">Last Name:</label>
<input type="text" id="user_last_name" />
<br><label for="email_address">Email Address:</label>
<input type="text" id="email_address" />
</div>
<button id ="add" type="submit">Submit</button>
</form>
{% if users_list %}
<ul>
{% for user in users_list %}
<li>{{ user }}</li>
{% endfor %}
</ul>
{% else %}
<p>No users are currently in the system</p>
{% endif %}
</body>
XCODE App has memory crash after
XCODE App has memory crash after
I have a problem, I have written my first app which is just about finished.
There is one VC (the start up) with a button to take the user to a game in
another VC.
The user can return to the first (menu) VC by clicking on a button in the
second VC.
During testing i noticed that when the home button is clicked and then the
app is bought back into view and the PLAY button is clicked the app
crashes and the device restarts.
To try and isolate the cause, i removed the iAD and Games Centre from the
game VC. The same problem occurs but now only after repeating the home
button/bring back to focus/PLAY around 2-3 times.
Below is the device console but I'm new to this so its not clear to me.
When it crashes it shows the second VB for a millisecond or partly
displays before it crashes.
From what it can read online something is using a lot of memory but i cant
see anything in the code (viewdidload etc).
I ran the Analyze and only Dead stores were detected.
I cant emulate the same problem on the simulator, it only occurs on the
devise (iPhone 3). I suspect because the Mac has more memory.
When i use the Analyse Instrument it doesn't show any spike in memory.
Please let me know if you need any other information. I've "nutted" out a
lot of problems to this point, I cant wait to get it into the store!!
Sep 18 13:08:38 Andys-iPhone mobile_house_arrest[178] <Error>: Max open
files: 78
I have a problem, I have written my first app which is just about finished.
There is one VC (the start up) with a button to take the user to a game in
another VC.
The user can return to the first (menu) VC by clicking on a button in the
second VC.
During testing i noticed that when the home button is clicked and then the
app is bought back into view and the PLAY button is clicked the app
crashes and the device restarts.
To try and isolate the cause, i removed the iAD and Games Centre from the
game VC. The same problem occurs but now only after repeating the home
button/bring back to focus/PLAY around 2-3 times.
Below is the device console but I'm new to this so its not clear to me.
When it crashes it shows the second VB for a millisecond or partly
displays before it crashes.
From what it can read online something is using a lot of memory but i cant
see anything in the code (viewdidload etc).
I ran the Analyze and only Dead stores were detected.
I cant emulate the same problem on the simulator, it only occurs on the
devise (iPhone 3). I suspect because the Mac has more memory.
When i use the Analyse Instrument it doesn't show any spike in memory.
Please let me know if you need any other information. I've "nutted" out a
lot of problems to this point, I cant wait to get it into the store!!
Sep 18 13:08:38 Andys-iPhone mobile_house_arrest[178] <Error>: Max open
files: 78
hightlight datatable jquery
hightlight datatable jquery
I searched a lot on the internet and have not found the solution to my
problem.
Im working with AJAX, PHP and Datatables. The pluing works fine. I could
display the records in my Datatable.
I want to do that does not work is that when mouse over each row, it
"lights" and removing the mouse back to normal.
As far as I managed to find out, what is happening to me is that the event
does not detect row. That is, the code I use is as follows ...
$("#tabla tbody tr").each(function(){
$(this).mouseover(function(){
$(this).addClass("ui-state-hover");
}).mouseout(function(){
$(this).removeClass("ui-state-hover");
});
});
Html code:
<table id="tabla">
<thead>
<tr>
<th>Id</th>
<th>Titulo</th>
<th>Subtitulo</th>
<th>Fecha</th>
<th>Acceder</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
If I add to the page manually a row, IT WORKS the mouseover Example:
<table id="tabla">
<thead>
<tr>
<th>Id</th>
<th>Titulo</th>
<th>Subtitulo</th>
<th>Fecha</th>
<th>Acceder</th>
</tr>
</thead>
<tbody>
<tr >
<td>4</td>
<td>Titulo</td>
<td>Subtitulo</td>
<td>2013-09-11 00:00:00</td>
<td>4</td>
</tr>
</tbody>
</table>
THE PROBLEM is that I DO NOT WORK when the rows are inserted through AJAX
function.
AJAX Code:
$.ajax({
url:'./listahistorias_proceso.php',
type:'post',
data:{ tag: 'getData'},
dataType: 'json',
success: function(data){
if(data.success){
$.each(data, function(index,record){
if($.isNumeric(index)){
var row = $("<tr />");
$("<td
/>").text(record.idhistoria).appendTo(row);
$("<td />").text(record.titulo).appendTo(row);
$("<td />").text(record.subtitulo).appendTo(row);
$("<td />").text(record.fecha).appendTo(row);
$("<td />").text(record.acceder).appendTo(row);
$("<tr>");
row.appendTo('table tbody');
}
})
}
oTable = $('table').dataTable({
"bjQueryUI": true,
"sPaginationType": "full_numbers",
"oLanguage": {
"sLengthMenu": "Mostrar _MENU_ filas
por pagina",
"sZeroRecords": "Datos no encontrados",
"sInfo": "Mostrando _START_ a _END_ de
_TOTAL_ filas",
"sInfoEmpty": "Sin entradas para
mostrar",
"sInfoFiltered": "",
"sSearch": "Buscar",
"sProcessing": "Buscando...",
"sLoadingRecords": "Por favor espere -
Cargando...",
"sEmptyTable": "No se obtuvieron datos",
"oPaginate": {
"sFirst": "Primera",
"sPrevious": "Anterior",
"sNext": "Siguiente",
"sLast": "Ultima"
}
},
"aoColumns":[
{'sname':'id', 'sType':'numeric',
'bVisible':true},
{'sName':'Titulo',
'sType':'string','bVisible':true},
{'sName':'Subtitulo',
'sType':'string','bVisible':true},
{'sName':'Fecha',
'sType':'date','bVisible':true},
{'sName':'Acceder',
'sType':'numeric','bVisible':true}
],
"oTableTools": {
"sRowSelect": "single",
"fnRowSelected": function( node ) {
alert("Clicked");
}
}
})
},
error: function(jqXHR, textStatus, errorThrown){
alert("error ==>" + jqXHR.responseText);
alert("error ==>" + jqXHR.textStatus);
alert("excepcion ==>" + errorThrown);
}
}); //ajax
Note: I tied with .live(), .on(), .click() and doesn't work.
Again, I think the problem is that it doesn't detect rows inserted by ajax.
From already thank you very much. I hope I was clear. I await your comments.
Thank you again. Regards.
I searched a lot on the internet and have not found the solution to my
problem.
Im working with AJAX, PHP and Datatables. The pluing works fine. I could
display the records in my Datatable.
I want to do that does not work is that when mouse over each row, it
"lights" and removing the mouse back to normal.
As far as I managed to find out, what is happening to me is that the event
does not detect row. That is, the code I use is as follows ...
$("#tabla tbody tr").each(function(){
$(this).mouseover(function(){
$(this).addClass("ui-state-hover");
}).mouseout(function(){
$(this).removeClass("ui-state-hover");
});
});
Html code:
<table id="tabla">
<thead>
<tr>
<th>Id</th>
<th>Titulo</th>
<th>Subtitulo</th>
<th>Fecha</th>
<th>Acceder</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
If I add to the page manually a row, IT WORKS the mouseover Example:
<table id="tabla">
<thead>
<tr>
<th>Id</th>
<th>Titulo</th>
<th>Subtitulo</th>
<th>Fecha</th>
<th>Acceder</th>
</tr>
</thead>
<tbody>
<tr >
<td>4</td>
<td>Titulo</td>
<td>Subtitulo</td>
<td>2013-09-11 00:00:00</td>
<td>4</td>
</tr>
</tbody>
</table>
THE PROBLEM is that I DO NOT WORK when the rows are inserted through AJAX
function.
AJAX Code:
$.ajax({
url:'./listahistorias_proceso.php',
type:'post',
data:{ tag: 'getData'},
dataType: 'json',
success: function(data){
if(data.success){
$.each(data, function(index,record){
if($.isNumeric(index)){
var row = $("<tr />");
$("<td
/>").text(record.idhistoria).appendTo(row);
$("<td />").text(record.titulo).appendTo(row);
$("<td />").text(record.subtitulo).appendTo(row);
$("<td />").text(record.fecha).appendTo(row);
$("<td />").text(record.acceder).appendTo(row);
$("<tr>");
row.appendTo('table tbody');
}
})
}
oTable = $('table').dataTable({
"bjQueryUI": true,
"sPaginationType": "full_numbers",
"oLanguage": {
"sLengthMenu": "Mostrar _MENU_ filas
por pagina",
"sZeroRecords": "Datos no encontrados",
"sInfo": "Mostrando _START_ a _END_ de
_TOTAL_ filas",
"sInfoEmpty": "Sin entradas para
mostrar",
"sInfoFiltered": "",
"sSearch": "Buscar",
"sProcessing": "Buscando...",
"sLoadingRecords": "Por favor espere -
Cargando...",
"sEmptyTable": "No se obtuvieron datos",
"oPaginate": {
"sFirst": "Primera",
"sPrevious": "Anterior",
"sNext": "Siguiente",
"sLast": "Ultima"
}
},
"aoColumns":[
{'sname':'id', 'sType':'numeric',
'bVisible':true},
{'sName':'Titulo',
'sType':'string','bVisible':true},
{'sName':'Subtitulo',
'sType':'string','bVisible':true},
{'sName':'Fecha',
'sType':'date','bVisible':true},
{'sName':'Acceder',
'sType':'numeric','bVisible':true}
],
"oTableTools": {
"sRowSelect": "single",
"fnRowSelected": function( node ) {
alert("Clicked");
}
}
})
},
error: function(jqXHR, textStatus, errorThrown){
alert("error ==>" + jqXHR.responseText);
alert("error ==>" + jqXHR.textStatus);
alert("excepcion ==>" + errorThrown);
}
}); //ajax
Note: I tied with .live(), .on(), .click() and doesn't work.
Again, I think the problem is that it doesn't detect rows inserted by ajax.
From already thank you very much. I hope I was clear. I await your comments.
Thank you again. Regards.
C++ typedef union compile error
C++ typedef union compile error
I'm getting some interesting errors in VC++2010 Express when I try to
define a couple of unions and inline functions for those unions. I'm
trying to build a static library to use in a number of programs.
typedef union
{
double data[3];
struct { double x, y, z; };
} VECTOR3;
inline VECTOR3 _V3(double x, double y, double z)
{
VECTOR3 vec = { x, y, z };
return vec;
}
typedef union
{
double data[9];
struct { double x0, y0, z0, x1, y1, z1, x2, y2, z2; };
} MATRIX3;
inline MATRIX3 _M3(double x0, double y0, double z0, double x1, double y1,
double z1, double x2, double y2, double z2)
{
MATRIX3 mat3 = { x0, y0, z0, x1, y1, z1, x2, y2, z2 };
return mat3;
}
This code is producing error "C2371: redefinition; different basic types"
but this is the only place where these unions are defined.
The inline functions produce error "C2084: function
'FunctionName(ArgumentType)' already has a body" yet there are no other
bodies defined. Either in this file, or in any files that are referenced.
Furthermore, code like the one shown here is in an SDK for another
application. And builds using that SDK do not produce any of these errors.
None of my searches have been of any help.
I'm getting some interesting errors in VC++2010 Express when I try to
define a couple of unions and inline functions for those unions. I'm
trying to build a static library to use in a number of programs.
typedef union
{
double data[3];
struct { double x, y, z; };
} VECTOR3;
inline VECTOR3 _V3(double x, double y, double z)
{
VECTOR3 vec = { x, y, z };
return vec;
}
typedef union
{
double data[9];
struct { double x0, y0, z0, x1, y1, z1, x2, y2, z2; };
} MATRIX3;
inline MATRIX3 _M3(double x0, double y0, double z0, double x1, double y1,
double z1, double x2, double y2, double z2)
{
MATRIX3 mat3 = { x0, y0, z0, x1, y1, z1, x2, y2, z2 };
return mat3;
}
This code is producing error "C2371: redefinition; different basic types"
but this is the only place where these unions are defined.
The inline functions produce error "C2084: function
'FunctionName(ArgumentType)' already has a body" yet there are no other
bodies defined. Either in this file, or in any files that are referenced.
Furthermore, code like the one shown here is in an SDK for another
application. And builds using that SDK do not produce any of these errors.
None of my searches have been of any help.
Select2 tag re-ordering and 'acts as taggable on' gem
Select2 tag re-ordering and 'acts as taggable on' gem
I have an options list in my params hash which I have re-ordered using
select2 as such:
"option_list"=>["3,1,2"]
Unfortunately this seems to have no effect on the ordering of the tags
saved by the gem:
Style.last.options
=> [#<ActsAsTaggableOn::Tag id: 20, name: "1">, #<ActsAsTaggableOn::Tag
id: 18, name: "2">, #<ActsAsTaggableOn::Tag id: 17, name: "3">]
I have an options list in my params hash which I have re-ordered using
select2 as such:
"option_list"=>["3,1,2"]
Unfortunately this seems to have no effect on the ordering of the tags
saved by the gem:
Style.last.options
=> [#<ActsAsTaggableOn::Tag id: 20, name: "1">, #<ActsAsTaggableOn::Tag
id: 18, name: "2">, #<ActsAsTaggableOn::Tag id: 17, name: "3">]
Can't find Microsoft Expression Blend launcher
Can't find Microsoft Expression Blend launcher
I go to microsoft official website and download "Microsoft Expression
Blend 3 SDK". But then how do I launch the program ? When I search for
files and input "Expression Blend" the only result I get is "Expression
Blend SDK Documentation". I have visual studio 2012 express for desktop
installed and I want to use expression blend for WPF application
developement.
I go to microsoft official website and download "Microsoft Expression
Blend 3 SDK". But then how do I launch the program ? When I search for
files and input "Expression Blend" the only result I get is "Expression
Blend SDK Documentation". I have visual studio 2012 express for desktop
installed and I want to use expression blend for WPF application
developement.
Sunday, 15 September 2013
How to create attribute for Underline on UILabel?
How to create attribute for Underline on UILabel?
I already have this attribute on my code, but how to add attribute for
underline?
NSDictionary *attrs = [NSDictionary dictionaryWithObjectsAndKeys:
boldFont, NSFontAttributeName, foregroundColor,
NSForegroundColorAttributeName, nil];
thank you.
I already have this attribute on my code, but how to add attribute for
underline?
NSDictionary *attrs = [NSDictionary dictionaryWithObjectsAndKeys:
boldFont, NSFontAttributeName, foregroundColor,
NSForegroundColorAttributeName, nil];
thank you.
thread won't stop?
thread won't stop?
Am creating a program that is based on mixing and making perturbation in a
population containing solutions Vector so i created a for loop that stops
after a certain time given by the user. Inside the loop, am going to call
5 procedures ant i thought that if i put each procedure in a thread will
make the program making more solutions in a same time than calling normal
methods, Here i created the 5 threads, but when i start them the don't
want to stop even if i use the Thread.stop, Thread.suspend,
Thread.interrupt or Thread.destroy
Here is my code and could u help me with your ideas ?
Thread CrossOp = new Thread(new Runnable() {
public void run() {
while(true){
int rdmCross2=(int) (Math.random() * allPopulation.size()) ;
// Crossover 1st vector
int rdmCross1=(int) (Math.random() * allPopulation.size()) ;
Vector muted = new Vector();
Vector copy = copi((Vector) allPopulation.get(rdmCross2));
Vector callp = copi((Vector) allPopulation.get(rdmCross1));
muted = crossover(callp, copy);
System.out.println("cross over Between two Randoms
----------->");
affiche_resultat(muted);
allPopulation.add(muted);
}
}
});
The loop :
CrossOp.setDaemon(true);
int loop = 1;
long StartTime = System.currentTimeMillis() / 1000;
for (int i = 0; i < loop; ++i) {
CrossOp.start();
loop++;
if (timevalue < ((System.currentTimeMillis() / 1000) -
StartTime)) {
loop = 0;
}
}
CrossOp.stop();
Am creating a program that is based on mixing and making perturbation in a
population containing solutions Vector so i created a for loop that stops
after a certain time given by the user. Inside the loop, am going to call
5 procedures ant i thought that if i put each procedure in a thread will
make the program making more solutions in a same time than calling normal
methods, Here i created the 5 threads, but when i start them the don't
want to stop even if i use the Thread.stop, Thread.suspend,
Thread.interrupt or Thread.destroy
Here is my code and could u help me with your ideas ?
Thread CrossOp = new Thread(new Runnable() {
public void run() {
while(true){
int rdmCross2=(int) (Math.random() * allPopulation.size()) ;
// Crossover 1st vector
int rdmCross1=(int) (Math.random() * allPopulation.size()) ;
Vector muted = new Vector();
Vector copy = copi((Vector) allPopulation.get(rdmCross2));
Vector callp = copi((Vector) allPopulation.get(rdmCross1));
muted = crossover(callp, copy);
System.out.println("cross over Between two Randoms
----------->");
affiche_resultat(muted);
allPopulation.add(muted);
}
}
});
The loop :
CrossOp.setDaemon(true);
int loop = 1;
long StartTime = System.currentTimeMillis() / 1000;
for (int i = 0; i < loop; ++i) {
CrossOp.start();
loop++;
if (timevalue < ((System.currentTimeMillis() / 1000) -
StartTime)) {
loop = 0;
}
}
CrossOp.stop();
How to do this selection on multiple rows in same table
How to do this selection on multiple rows in same table
I have the following fields in a table in mysql:
Name
Playing round
Points
So this table contains the following records:
Name Playing round Points
Test1 1 1
Test1 2 5
Test1 3 6
The points are build up cumulative, so I want to do the following selection:
Select for example playing round 1 and playing round 3 and do an minus on
the points for every unique name. So I'm expecting this result:
Name Points
Test1 5 (6-1)
How do I do this in an php query when I receive the 2 playing round
variables through an php form?
I have the following fields in a table in mysql:
Name
Playing round
Points
So this table contains the following records:
Name Playing round Points
Test1 1 1
Test1 2 5
Test1 3 6
The points are build up cumulative, so I want to do the following selection:
Select for example playing round 1 and playing round 3 and do an minus on
the points for every unique name. So I'm expecting this result:
Name Points
Test1 5 (6-1)
How do I do this in an php query when I receive the 2 playing round
variables through an php form?
A timer with c# console
A timer with c# console
Im using c# console . I have a timer like : int TimeElasped = 0 ,,,, to
show and update times . it can resolve with a
for( ; ; )
but computer cant do other codes !!! so I am using this code :
using System.Threading;
public class Test
{
static int TimeElasped = 0;
static void Main(string[] args)
{
Timer tm = new
Timer(tm_tick,null,TimeSpan.FromSeconds(1),TimeSpan.FromSeconds(1));
Console.Write("");
Console.ReadKey();
}
static void tm_tick(object obj)
{
Console.Clear();
Console.WriteLine("Timer:{0}", TimeElasped );
Counter++;
}
}
I Cannot use Console.Clear() because it clear all data in console , when i
remove Console.Clear() timer is showing line by line !!!
so how can i have a timer that update time ?
thanks ,
Im using c# console . I have a timer like : int TimeElasped = 0 ,,,, to
show and update times . it can resolve with a
for( ; ; )
but computer cant do other codes !!! so I am using this code :
using System.Threading;
public class Test
{
static int TimeElasped = 0;
static void Main(string[] args)
{
Timer tm = new
Timer(tm_tick,null,TimeSpan.FromSeconds(1),TimeSpan.FromSeconds(1));
Console.Write("");
Console.ReadKey();
}
static void tm_tick(object obj)
{
Console.Clear();
Console.WriteLine("Timer:{0}", TimeElasped );
Counter++;
}
}
I Cannot use Console.Clear() because it clear all data in console , when i
remove Console.Clear() timer is showing line by line !!!
so how can i have a timer that update time ?
thanks ,
mod_rewrite "virtual subdomain" redirect not working
mod_rewrite "virtual subdomain" redirect not working
I've just moved from a Litespeed hosting to an Apache's one. However such
redirects stopped working.
RewriteCond %{HTTP_HOST} ^nix.foo.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.nix.foo.com$
RewriteRule ^(.*)$ "http\:\/\/www\.foo\.com\/nix\.php" [R=301,L]
On Firefox, I get a "failed to connect to the server" message. I tried
simpler mod_rewrite redirects such as
RewriteRule ^foo.php$ bar.php
and they work, so mod_rewrite seems to be already enabled thanks to
RewriteEngine on.
Any hints? Thanks
I've just moved from a Litespeed hosting to an Apache's one. However such
redirects stopped working.
RewriteCond %{HTTP_HOST} ^nix.foo.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.nix.foo.com$
RewriteRule ^(.*)$ "http\:\/\/www\.foo\.com\/nix\.php" [R=301,L]
On Firefox, I get a "failed to connect to the server" message. I tried
simpler mod_rewrite redirects such as
RewriteRule ^foo.php$ bar.php
and they work, so mod_rewrite seems to be already enabled thanks to
RewriteEngine on.
Any hints? Thanks
NumericMatrix returns a matrix of all zeros?
NumericMatrix returns a matrix of all zeros?
I'm trying to implement a simple code in Rcpp that calculates and
populates the entries of a distance matrix. The problem is that the Rcpp
code (below) returns a matrix D with all elements having a value of zero.
This issue does not seem to be addressed anywhere in the forums - I'd
appreciate some advice!
src_d_err_c <- '
using namespace Rcpp;
double d_err_c(NumericVector cx, NumericVector csx, NumericVector cy,
NumericVector csy) {
using namespace Rcpp;
NumericVector d = (cx - cy)*(cx - cy) / csx;
double s = std::accumulate(d.begin(), d.end(), 0.0);
return s;
}'
src_d_mat = '
using namespace Rcpp;
// input
Rcpp::NumericMatrix cX(X);
Rcpp::NumericMatrix cY(Y);
Rcpp::NumericMatrix cSX(SX);
Rcpp::NumericMatrix cSY(SY);
int N1 = cX.nrow();
int N2 = cY.nrow();
NumericMatrix D(N1, N2);
NumericVector v(N1);
for (int x = 0; x++; x<N1){
v[x] = x;
for (int y = 0; y++; y<N2) {
D(x,y) = d_err_c(cX(x,_), cSX(x,_), cY(y,_), cSY(y,_));
};
};
return wrap(v);'
fun <- cxxfunction(signature(X = "numeric", SX = "numeric",
Y = "numeric", SY = "numeric"),
body = src_d_mat, includes = src_d_err_c,
plugin = "Rcpp")
I'm trying to implement a simple code in Rcpp that calculates and
populates the entries of a distance matrix. The problem is that the Rcpp
code (below) returns a matrix D with all elements having a value of zero.
This issue does not seem to be addressed anywhere in the forums - I'd
appreciate some advice!
src_d_err_c <- '
using namespace Rcpp;
double d_err_c(NumericVector cx, NumericVector csx, NumericVector cy,
NumericVector csy) {
using namespace Rcpp;
NumericVector d = (cx - cy)*(cx - cy) / csx;
double s = std::accumulate(d.begin(), d.end(), 0.0);
return s;
}'
src_d_mat = '
using namespace Rcpp;
// input
Rcpp::NumericMatrix cX(X);
Rcpp::NumericMatrix cY(Y);
Rcpp::NumericMatrix cSX(SX);
Rcpp::NumericMatrix cSY(SY);
int N1 = cX.nrow();
int N2 = cY.nrow();
NumericMatrix D(N1, N2);
NumericVector v(N1);
for (int x = 0; x++; x<N1){
v[x] = x;
for (int y = 0; y++; y<N2) {
D(x,y) = d_err_c(cX(x,_), cSX(x,_), cY(y,_), cSY(y,_));
};
};
return wrap(v);'
fun <- cxxfunction(signature(X = "numeric", SX = "numeric",
Y = "numeric", SY = "numeric"),
body = src_d_mat, includes = src_d_err_c,
plugin = "Rcpp")
SQL - SELECT statement with a JOIN
SQL - SELECT statement with a JOIN
I'm using the Northwind database, and I can't manage to get the following
query to work -
select *
from customers
join orders
on orders.customerID = customers.customerID
join [Order Details]
on orders.OrderID = [Order Details].orderID
join Products (select Products.productID, Products.ProductName from
Products)
on [Order Details].productID = Products.productID
order by customers.customerID
I get an error saying that there's incorrect syntax near the select in
line 7.
What I'm trying to do is that when joining the Products table, it won't
bring all the columns but rather just the ProductName and ProductID.
Could somebody please explain what I'm doing wrong? Thanks!
I'm using the Northwind database, and I can't manage to get the following
query to work -
select *
from customers
join orders
on orders.customerID = customers.customerID
join [Order Details]
on orders.OrderID = [Order Details].orderID
join Products (select Products.productID, Products.ProductName from
Products)
on [Order Details].productID = Products.productID
order by customers.customerID
I get an error saying that there's incorrect syntax near the select in
line 7.
What I'm trying to do is that when joining the Products table, it won't
bring all the columns but rather just the ProductName and ProductID.
Could somebody please explain what I'm doing wrong? Thanks!
Saturday, 14 September 2013
How do we Move/ Drag a Stage accross the screen in JAVAFX?
How do we Move/ Drag a Stage accross the screen in JAVAFX?
I've been trying to move my project from JAVA's Swing to JAVA-FX but have
been unsuccessful because of one detail. I've had my Stage set
undecorated, which disables the "Drag via Title Bar feature". I'd like to
get that back (the drag feature), which is where I am totally stuck.
The way I'd like to do it to have Drag effected via a call to a method in
the Controller Class, like how I did with the WindowClose() method.
Please, if you can, could you show how to do so by integrating your ideas
around this problem somewhere in my code below. I just started studying
JAVA-FX and I'm having difficulties integrating the other many examples
I've come accross that solve this dilemma in my code.
Any help will be much appreciated.
post script:
Any ideas are welcome, even those implementing the drag via a method
placed in the main Class (I've noted that there seems to be more
difficulty calling methods on the Stage from another external Class/
Controller Class). I'll be much glad with anything I can get - any help is
useful. I'd, however, like to learn how to share data between Classes in
JAVA-FX.
The CODE:
// Main Class
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
public class Fxmltableview extends Application {
public static String pageSource = "fxml_tableview.fxml";
public static Scene scene;
@Override
public void start(Stage stage) throws Exception {
stage.initStyle(StageStyle.UNDECORATED);
stage.initStyle(StageStyle.TRANSPARENT);
Parent root = FXMLLoader.load(getClass().getResource(pageSource));
scene = new Scene(root, Color.TRANSPARENT);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
// Controller
import javafx.application.Platform;
import javafx.event.ActionEvent;
public class FXMLTableViewController {
public void WindowClose (ActionEvent event) {
Platform.exit();
}
}
I've been trying to move my project from JAVA's Swing to JAVA-FX but have
been unsuccessful because of one detail. I've had my Stage set
undecorated, which disables the "Drag via Title Bar feature". I'd like to
get that back (the drag feature), which is where I am totally stuck.
The way I'd like to do it to have Drag effected via a call to a method in
the Controller Class, like how I did with the WindowClose() method.
Please, if you can, could you show how to do so by integrating your ideas
around this problem somewhere in my code below. I just started studying
JAVA-FX and I'm having difficulties integrating the other many examples
I've come accross that solve this dilemma in my code.
Any help will be much appreciated.
post script:
Any ideas are welcome, even those implementing the drag via a method
placed in the main Class (I've noted that there seems to be more
difficulty calling methods on the Stage from another external Class/
Controller Class). I'll be much glad with anything I can get - any help is
useful. I'd, however, like to learn how to share data between Classes in
JAVA-FX.
The CODE:
// Main Class
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
public class Fxmltableview extends Application {
public static String pageSource = "fxml_tableview.fxml";
public static Scene scene;
@Override
public void start(Stage stage) throws Exception {
stage.initStyle(StageStyle.UNDECORATED);
stage.initStyle(StageStyle.TRANSPARENT);
Parent root = FXMLLoader.load(getClass().getResource(pageSource));
scene = new Scene(root, Color.TRANSPARENT);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
// Controller
import javafx.application.Platform;
import javafx.event.ActionEvent;
public class FXMLTableViewController {
public void WindowClose (ActionEvent event) {
Platform.exit();
}
}
how to place a character where it was after manipulating the string?
how to place a character where it was after manipulating the string?
So I am doing a pig latin assignment, and lets say the user gives you "Car"
so the end result is "arCay" the original word, take first letter, put it
to the end, and add an "ay". i have done all this so far.
But i'm stuck at the punctuation part. How can I do it so that if the user
tells me "Car!" the end result will be "arCay!". For example, "!Hello!"
should be "!Ellohay!"
Code: [code][java]if(Character.isUpperCase(s.charAt(0))) {
if((s.charAt(0)==a2) || (s.charAt(0)==e2) || (s.charAt(0)==i2) ||
(s.charAt(0)==o2) || (s.charAt(0)==u2)) { if(s.contains(exc)) {
excMarkLocation=s.indexOf(excMark); s=s.replaceAll("[^a-zA-Z]", ""); temp2
= (s+"way"); s=temp2; s=s+'!'; } else { temp2 = (s+"way"); s=temp2;
}[/java][/code]
exc is the CharSequence "!" excMark is the char '!' excMarkLocation is
it's location
Sorry, what are the tags I should use?
So I am doing a pig latin assignment, and lets say the user gives you "Car"
so the end result is "arCay" the original word, take first letter, put it
to the end, and add an "ay". i have done all this so far.
But i'm stuck at the punctuation part. How can I do it so that if the user
tells me "Car!" the end result will be "arCay!". For example, "!Hello!"
should be "!Ellohay!"
Code: [code][java]if(Character.isUpperCase(s.charAt(0))) {
if((s.charAt(0)==a2) || (s.charAt(0)==e2) || (s.charAt(0)==i2) ||
(s.charAt(0)==o2) || (s.charAt(0)==u2)) { if(s.contains(exc)) {
excMarkLocation=s.indexOf(excMark); s=s.replaceAll("[^a-zA-Z]", ""); temp2
= (s+"way"); s=temp2; s=s+'!'; } else { temp2 = (s+"way"); s=temp2;
}[/java][/code]
exc is the CharSequence "!" excMark is the char '!' excMarkLocation is
it's location
Sorry, what are the tags I should use?
How to draw disappearing rectangles in Java
How to draw disappearing rectangles in Java
I want to make a program in Java. What I am trying to do is, when the user
click the screen a small square is drawn. One by one ten more squares are
displayed with the previous square in the center. When the sixth square is
drawn the first disappears, when the seventh square is drawn the second
square disappears etc. until all the squares are gone.
I have had problems with positioning, timing, and clearing the rectangles.
This is the MainActivity:
import java.awt.Color;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class MainActivity {
public static int width = 900;
public static int height = width / 16 * 9;
static HandlerClass handler = new HandlerClass();
static JFrame window;
static JPanel windowInner;
public static void main(String[] args) {
window = new JFrame("Squarmony 1.0");
window.setSize(width, height);
window.setVisible(true);
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
windowInner = new JPanel();
windowInner.setSize(width, height);
windowInner.setBackground(Color.BLACK);
window.add(windowInner);
windowInner.addMouseListener(handler);
}
private static class HandlerClass implements MouseListener {
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
GraphicsActivity g = new GraphicsActivity();
g.drawRectRipple(window.getGraphics(), e);
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
}
}
}
And here is the GraphicsActivity:
import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.MouseEvent;
public class GraphicsActivity {
public void drawRectRipple(Graphics g, MouseEvent e) {
g.setColor(Color.WHITE);
for (int i = 0; i <= 10; i++) {
for (int j = 0; j <= 250; j += 10) {
g.drawRect(e.getX() + j / 2, e.getY() - j / 2, j - j / 2, j +
j / 2);
try {
Thread.sleep(250);
} catch (InterruptedException e1) {
}
}
}
}
}
Any help would be greatly appreciated.
Thanks,
John
I want to make a program in Java. What I am trying to do is, when the user
click the screen a small square is drawn. One by one ten more squares are
displayed with the previous square in the center. When the sixth square is
drawn the first disappears, when the seventh square is drawn the second
square disappears etc. until all the squares are gone.
I have had problems with positioning, timing, and clearing the rectangles.
This is the MainActivity:
import java.awt.Color;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class MainActivity {
public static int width = 900;
public static int height = width / 16 * 9;
static HandlerClass handler = new HandlerClass();
static JFrame window;
static JPanel windowInner;
public static void main(String[] args) {
window = new JFrame("Squarmony 1.0");
window.setSize(width, height);
window.setVisible(true);
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
windowInner = new JPanel();
windowInner.setSize(width, height);
windowInner.setBackground(Color.BLACK);
window.add(windowInner);
windowInner.addMouseListener(handler);
}
private static class HandlerClass implements MouseListener {
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
GraphicsActivity g = new GraphicsActivity();
g.drawRectRipple(window.getGraphics(), e);
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
}
}
}
And here is the GraphicsActivity:
import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.MouseEvent;
public class GraphicsActivity {
public void drawRectRipple(Graphics g, MouseEvent e) {
g.setColor(Color.WHITE);
for (int i = 0; i <= 10; i++) {
for (int j = 0; j <= 250; j += 10) {
g.drawRect(e.getX() + j / 2, e.getY() - j / 2, j - j / 2, j +
j / 2);
try {
Thread.sleep(250);
} catch (InterruptedException e1) {
}
}
}
}
}
Any help would be greatly appreciated.
Thanks,
John
reached end of file while parsing but there is no missing brace
reached end of file while parsing but there is no missing brace
So when i compile this program java gives an error message :reached end of
file while parsing public class MohoscopeEngine implements
HoroscopeEngine{ ^
//MohoscopeEngine.java
public class MohoscopeEngine implements HoroscopeEngine{
final String[] constant ={"Bring your friends from ", "and ", "to go to
party at "};
String[] fiveplaces = {"Rocky", "Safford", "Chapin", "Art Museum", "Mead"};
/** generate random index for array without repeating*/
public String randomIndex(){
int index = (int)(Math.floor(Math.random()*5));
return fiveplaces[index];
}
public String getHoroscope(){
//for(int i =0; i < index.length; i++)
String mohoscope = constant[0] + randomIndex() + constant[1] +
randomIndex() + constant[2] + randomIndex();
return mohoscope;
}
}
i don't think i didn't enclose the class and i checked every bracket and
brace and found nothing wrong. Why did the problem occur and how should i
fix it?
So when i compile this program java gives an error message :reached end of
file while parsing public class MohoscopeEngine implements
HoroscopeEngine{ ^
//MohoscopeEngine.java
public class MohoscopeEngine implements HoroscopeEngine{
final String[] constant ={"Bring your friends from ", "and ", "to go to
party at "};
String[] fiveplaces = {"Rocky", "Safford", "Chapin", "Art Museum", "Mead"};
/** generate random index for array without repeating*/
public String randomIndex(){
int index = (int)(Math.floor(Math.random()*5));
return fiveplaces[index];
}
public String getHoroscope(){
//for(int i =0; i < index.length; i++)
String mohoscope = constant[0] + randomIndex() + constant[1] +
randomIndex() + constant[2] + randomIndex();
return mohoscope;
}
}
i don't think i didn't enclose the class and i checked every bracket and
brace and found nothing wrong. Why did the problem occur and how should i
fix it?
Twitter Bootstrap 3 Responsive menu not working
Twitter Bootstrap 3 Responsive menu not working
I've just started using Twitter Bootstrap 3.0, I've been reading the
documentation and I'm trying to create a responsive navigation bar, my
code is the same structure as the example in the documentation but it
doesn't seem to be working for some reason.
Below is the HTML code I'm using, I'm just using the default CSS and
Javascript files.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Efar Communication Services</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media
queries -->
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<script src="js/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<nav class="navbar navbar-default" role="navigation">
<!-- For screen readers and mobiles -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse"
data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand">Efar</a>
<p class="navbar-text">Business Infrastructure Solutions</p>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Products</a></li>
<li><a href="#">Client Area</a></li>
<li><a href="#">FAQ</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
</div>
</nav>
</div> <!-- End of container -->
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="//code.jquery.com/jquery.js"></script>
<!-- Include all compiled plugins (below), or include individual files
as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>
I've just started using Twitter Bootstrap 3.0, I've been reading the
documentation and I'm trying to create a responsive navigation bar, my
code is the same structure as the example in the documentation but it
doesn't seem to be working for some reason.
Below is the HTML code I'm using, I'm just using the default CSS and
Javascript files.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Efar Communication Services</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media
queries -->
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<script src="js/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<nav class="navbar navbar-default" role="navigation">
<!-- For screen readers and mobiles -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse"
data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand">Efar</a>
<p class="navbar-text">Business Infrastructure Solutions</p>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Products</a></li>
<li><a href="#">Client Area</a></li>
<li><a href="#">FAQ</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
</div>
</nav>
</div> <!-- End of container -->
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="//code.jquery.com/jquery.js"></script>
<!-- Include all compiled plugins (below), or include individual files
as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>
dropdownlist select a row when the id is the same in row id to fill it
dropdownlist select a row when the id is the same in row id to fill it
I use this syntax to fill dropdownlist from database but i want to select
a row if the ID is the same
command.CommandText = "select area_name from area where area_name !='' and
cast (gov_id as varchar) ='" + DropDownList1.SelectedValue + "'";
The problem is the dropdown list is empty
I use this syntax to fill dropdownlist from database but i want to select
a row if the ID is the same
command.CommandText = "select area_name from area where area_name !='' and
cast (gov_id as varchar) ='" + DropDownList1.SelectedValue + "'";
The problem is the dropdown list is empty
Invent a type to allocate a static obejct?
Invent a type to allocate a static obejct?
In TC++PL, the author said,
Sometimes when you design a library, it is necessary, or simply
convenient, to invent a type with a constructor and a destructor with the
sole purpose of initialization and cleanup. Such a type would be used once
only: to allocate a static object so that the constructor and the
destructor are called.
This topic was already discussed in here. To sum up, It's about the
ambiguous allocational order before the main() starts. In other words, the
author presents his solution to make sure that, in the situation where one
object depend on another, the another is already allocated when the one
tries to access the another. Therefore, the solution the author proposed
attempt to secure the allocational order.
However, I really can't understand how it works. I mean, It seems the aims
as I mentioned above is irrelevant to the codes that the author gives us
as an example. Apparently, I must have missed some critical understanding.
Would you please explain it to me in a kindly manner? FYI, the codes that
I mentioned is in here.
In TC++PL, the author said,
Sometimes when you design a library, it is necessary, or simply
convenient, to invent a type with a constructor and a destructor with the
sole purpose of initialization and cleanup. Such a type would be used once
only: to allocate a static object so that the constructor and the
destructor are called.
This topic was already discussed in here. To sum up, It's about the
ambiguous allocational order before the main() starts. In other words, the
author presents his solution to make sure that, in the situation where one
object depend on another, the another is already allocated when the one
tries to access the another. Therefore, the solution the author proposed
attempt to secure the allocational order.
However, I really can't understand how it works. I mean, It seems the aims
as I mentioned above is irrelevant to the codes that the author gives us
as an example. Apparently, I must have missed some critical understanding.
Would you please explain it to me in a kindly manner? FYI, the codes that
I mentioned is in here.
Friday, 13 September 2013
Checksum serial message
Checksum serial message
I must calculated a checksum, but i'm very news on hardware programing...
the doc say :
All the serial command are 12-byte command packet format
The values of the first 11 bytes of the packet (excluding the checksum
byte) are summed and then divided by 0x0100 (256). This will create a
1-byte shift. The remaining value from this shift is the checksum byte.
during word transmission the high word value is transmitted followed by
the low word value
example of command :
0x00 0x05 0x0000 0x0000 0x0000 0x0000 0x00 Chksum
0x00 : channel
0x05 : command
0x0000 : param1
0x0000 : param2
0x0000 : lwExtraData
0x0000 : hwExtraData
0x00 : ErrorCode
????? : check sum
i have this code in python :
ser = serial.Serial('/dev/ttyUSB0', 115200,parity='N',timeout=1)
ser.open()
ser.write(chr(0x00)) # channel 1 byte (alway the same)
ser.write(chr(0x05)) # command 1 byte
ser.write(chr(0x00)) # param1 2 bytes (byte low)
ser.write(chr(0x00)) # param1 2 bytes (byte hight)
ser.write(chr(0x00)) # param2 2 bytes (byte low)
ser.write(chr(0x00)) # param2 2 bytes (byte hight)
ser.write(chr(0x00)) # lwExtraData 2 bytes (byte low)
ser.write(chr(0x00)) # lwExtraData 2 bytes (byte hight)
ser.write(chr(0x00)) # hwExtraData 2 bytes (byte low)
ser.write(chr(0x00)) # hwExtraData 2 bytes (byte hight)
ser.write(chr(0x00)) # ErrorCode 1 byte
How i can calculated my checksum ?? if i sum i have 5 but how i can divide
?????
I must calculated a checksum, but i'm very news on hardware programing...
the doc say :
All the serial command are 12-byte command packet format
The values of the first 11 bytes of the packet (excluding the checksum
byte) are summed and then divided by 0x0100 (256). This will create a
1-byte shift. The remaining value from this shift is the checksum byte.
during word transmission the high word value is transmitted followed by
the low word value
example of command :
0x00 0x05 0x0000 0x0000 0x0000 0x0000 0x00 Chksum
0x00 : channel
0x05 : command
0x0000 : param1
0x0000 : param2
0x0000 : lwExtraData
0x0000 : hwExtraData
0x00 : ErrorCode
????? : check sum
i have this code in python :
ser = serial.Serial('/dev/ttyUSB0', 115200,parity='N',timeout=1)
ser.open()
ser.write(chr(0x00)) # channel 1 byte (alway the same)
ser.write(chr(0x05)) # command 1 byte
ser.write(chr(0x00)) # param1 2 bytes (byte low)
ser.write(chr(0x00)) # param1 2 bytes (byte hight)
ser.write(chr(0x00)) # param2 2 bytes (byte low)
ser.write(chr(0x00)) # param2 2 bytes (byte hight)
ser.write(chr(0x00)) # lwExtraData 2 bytes (byte low)
ser.write(chr(0x00)) # lwExtraData 2 bytes (byte hight)
ser.write(chr(0x00)) # hwExtraData 2 bytes (byte low)
ser.write(chr(0x00)) # hwExtraData 2 bytes (byte hight)
ser.write(chr(0x00)) # ErrorCode 1 byte
How i can calculated my checksum ?? if i sum i have 5 but how i can divide
?????
Lock Pages in Memory keep SQL database engine stuck at allocating 60MB ram?
Lock Pages in Memory keep SQL database engine stuck at allocating 60MB ram?
I'm using Window Server 2003 Enterprise. Microsoft SQL Server 2005
Standard Edition.
The problem is the SQL server memory always stuck at allocating 1.7GB ram
max even i have 11GB ram left.
According to this thread, which the thread starter have them same issues:
http://www.sqlservercentral.com/Forums/Topic499500-146-1.aspx#bm499829 . I
tried adding /APE to my boot.ini, add the network service account which is
running sqlserv.exe to Lock Pages in Memory option. And reconfigure SQL
use AWE to allocate memory.
But i have no lucky, after restart the server. The SQL database engine
cannot allocating more than 60MB ram. Which is terrible failure as my
expected.
So after that, i must to restore my setting - remove the network service
account from Lock Pages in Memory option, restart my server and it come
back to the first problem. The SQL server database engine always stuck at
allocating 1.7GB ram. So the Lock Pages in Memory keep SQL database engine
stuck at allocating 60MB ram ? And how to resolve the first problem now ?
I'm using Window Server 2003 Enterprise. Microsoft SQL Server 2005
Standard Edition.
The problem is the SQL server memory always stuck at allocating 1.7GB ram
max even i have 11GB ram left.
According to this thread, which the thread starter have them same issues:
http://www.sqlservercentral.com/Forums/Topic499500-146-1.aspx#bm499829 . I
tried adding /APE to my boot.ini, add the network service account which is
running sqlserv.exe to Lock Pages in Memory option. And reconfigure SQL
use AWE to allocate memory.
But i have no lucky, after restart the server. The SQL database engine
cannot allocating more than 60MB ram. Which is terrible failure as my
expected.
So after that, i must to restore my setting - remove the network service
account from Lock Pages in Memory option, restart my server and it come
back to the first problem. The SQL server database engine always stuck at
allocating 1.7GB ram. So the Lock Pages in Memory keep SQL database engine
stuck at allocating 60MB ram ? And how to resolve the first problem now ?
Task 1 - Arithmetic operations and Math functions
Task 1 - Arithmetic operations and Math functions
radius must be declared as 'double': double radius; I think radius is
declared as radius = in.nextDouble(); but im not entirely sure Calculate
circumference and area (must be declared as 'double' as well) I am new to
programming and would like to see a simple program I could try out; any
feedback would be helpful
radius must be declared as 'double': double radius; I think radius is
declared as radius = in.nextDouble(); but im not entirely sure Calculate
circumference and area (must be declared as 'double' as well) I am new to
programming and would like to see a simple program I could try out; any
feedback would be helpful
Perform count on similar values in using Pig for multiple line of dataset
Perform count on similar values in using Pig for multiple line of dataset
I am new in PIG and trying to solve a problem on wordcount (website) for
multiple line of input(websites). For example my input dataset has the
value
Input data
Email websites
e1 web1 web2 web3 web1 ....
e2 web2 web3 web2 web2 web4 ...
e3 web1 web2 web1 web4 .....
and my desired output will be
Email websites
e1 web1(2) web2(1) web3(1) ....
e2 web2(3) web3(1) web4(1) ...
e3 web1(2) web2(1) web4(1) .....
In my dataset i have almost 50000 email id(user)
I am new in PIG and trying to solve a problem on wordcount (website) for
multiple line of input(websites). For example my input dataset has the
value
Input data
Email websites
e1 web1 web2 web3 web1 ....
e2 web2 web3 web2 web2 web4 ...
e3 web1 web2 web1 web4 .....
and my desired output will be
Email websites
e1 web1(2) web2(1) web3(1) ....
e2 web2(3) web3(1) web4(1) ...
e3 web1(2) web2(1) web4(1) .....
In my dataset i have almost 50000 email id(user)
Initializing static global constants with enum value. Is this safe? Pitfalls?
Initializing static global constants with enum value. Is this safe? Pitfalls?
If you want to wrap some enum type with a class, e.g., to build some
functions around it, you could end up with the following situation:
main.cpp:
#include "WrappedEnumConstants.h"
int main(int argc, char * argv[])
{
WrappedZero.print();
WrappedOne.print();
}
WrappedEnumConstants.h
#ifndef WRAPEDENUMCONSTANTS_H
#define WRAPEDENUMCONSTANTS_H
#include "WrappedEnum.h"
#include "InternalEnum.h"
static const WrappedEnum WrappedZero(ZeroEnum);
static const WrappedEnum WrappedOne(OneEnum);
If you want to wrap some enum type with a class, e.g., to build some
functions around it, you could end up with the following situation:
main.cpp:
#include "WrappedEnumConstants.h"
int main(int argc, char * argv[])
{
WrappedZero.print();
WrappedOne.print();
}
WrappedEnumConstants.h
#ifndef WRAPEDENUMCONSTANTS_H
#define WRAPEDENUMCONSTANTS_H
#include "WrappedEnum.h"
#include "InternalEnum.h"
static const WrappedEnum WrappedZero(ZeroEnum);
static const WrappedEnum WrappedOne(OneEnum);
Dependency Injection, need factory like functionality
Dependency Injection, need factory like functionality
I'm developing a Web application using Spring.
I have a common abstract class and many implementions of it.
Now, in a controller, depending on some parameter, I need different
implementations of it.
This can be easily implemented with Factory Pattern.
For example:
abstract class Animal{
public abstract void run(){
}
}
class Dog extends Animal{
...
}
Class Cat extends Animal{
...
}
Now with factory pattern, I can create a factory class with a factory
method which creates Animals based on some parameter. But I don't want to
create instances on my own.
I need the same functionality, but I want Spring to manage everything.
Because different implementations have their dependencies and I want them
to be injected by Spring.
What is the best way of handling this situation?
I'm developing a Web application using Spring.
I have a common abstract class and many implementions of it.
Now, in a controller, depending on some parameter, I need different
implementations of it.
This can be easily implemented with Factory Pattern.
For example:
abstract class Animal{
public abstract void run(){
}
}
class Dog extends Animal{
...
}
Class Cat extends Animal{
...
}
Now with factory pattern, I can create a factory class with a factory
method which creates Animals based on some parameter. But I don't want to
create instances on my own.
I need the same functionality, but I want Spring to manage everything.
Because different implementations have their dependencies and I want them
to be injected by Spring.
What is the best way of handling this situation?
Thursday, 12 September 2013
FadeIn div content one by one
FadeIn div content one by one
I have some content in div, basically div will be hide, now i want when i
press button the div content will be show with fadeIn function, now my
problem i want show the div content one by one means one alphabet fadeIn
then other but in my case it will be done word by word.
HTML
<div>
<span> THIS IS EXAMPLE OF FADE IN WORLD ONE BY ONE IN ALPHABETIC ORDER
</span>
</div>
<input type='button' value='click me'/>
JS
$("input[type=button]").click(function(){
$("div").show();
$("span").each(function(index) {
$(this).delay(400*index).fadeIn(300);
});
});
CSS
div
{
display:none
}
I have some content in div, basically div will be hide, now i want when i
press button the div content will be show with fadeIn function, now my
problem i want show the div content one by one means one alphabet fadeIn
then other but in my case it will be done word by word.
HTML
<div>
<span> THIS IS EXAMPLE OF FADE IN WORLD ONE BY ONE IN ALPHABETIC ORDER
</span>
</div>
<input type='button' value='click me'/>
JS
$("input[type=button]").click(function(){
$("div").show();
$("span").each(function(index) {
$(this).delay(400*index).fadeIn(300);
});
});
CSS
div
{
display:none
}
Can't change the css properties of jQuery UI dialog titlebar
Can't change the css properties of jQuery UI dialog titlebar
I can't change the background color of jQuery UI dialog titlebar. I am
coding like this:
jQuery("#divId").dialog({
title: 'Information'
});
jQuery("#divId.ui-dialog-titlebar").css("background-color", "red");
By the way, my application will open only in IE. I tried to detect
titlebar and footer css properties with IE developer tools, but it won't
detect titlebar and footer. But it recognizes css properties of
ui-dialog-content. Please suggest me.
I can't change the background color of jQuery UI dialog titlebar. I am
coding like this:
jQuery("#divId").dialog({
title: 'Information'
});
jQuery("#divId.ui-dialog-titlebar").css("background-color", "red");
By the way, my application will open only in IE. I tried to detect
titlebar and footer css properties with IE developer tools, but it won't
detect titlebar and footer. But it recognizes css properties of
ui-dialog-content. Please suggest me.
how to use "setFieldHint" in CRUD form?
how to use "setFieldHint" in CRUD form?
I want to add hint to the CRUD form but I receive error.
$temp_crud->getElement('pin')->setFieldHint('the hint');
I want to add hint to the CRUD form but I receive error.
$temp_crud->getElement('pin')->setFieldHint('the hint');
Wednesday, 11 September 2013
How to get the id or name for the login and password textfield
How to get the id or name for the login and password textfield
I need to get the name and id for this textbox of this website
http://www.328328.net/Login/ The textbox are Login ID and Password. Can
anyone teach me how to get it?
I need to get the name and id for this textbox of this website
http://www.328328.net/Login/ The textbox are Login ID and Password. Can
anyone teach me how to get it?
Linked Lists in C, Random output?
Linked Lists in C, Random output?
#include <stdio.h>
struct list
{
int data;
struct list *next;
};
struct list *start, *end;
void add(struct list *head, struct list *list, int data);
void delete(struct list *head, struct list *tail);
int main(void)
{
start=end=NULL;
add(start, end, NULL);
add(start, end, NULL);
printf("First element: %d");
delete(start, end);
return 0;
}
void add(struct list *head, struct list *tail, int data)
{
if(tail==NULL)
{
head=tail=malloc(sizeof(struct list));
head->data=data; head->next=NULL;
} else {
tail->next=malloc(sizeof(struct list));
tail=tail->next;
tail->data=data;
tail->next=NULL;
}
}
void delete(struct list *head, struct list *tail)
{
struct list *temp;
if(head==tail)
{
free(head);
head=tail=NULL;
} else {
temp=head->next;
free(head);
head=temp;
}
}
I am aiming to return an output of 3 but keep getting random results. Any
insight is greatly appreciated
#include <stdio.h>
struct list
{
int data;
struct list *next;
};
struct list *start, *end;
void add(struct list *head, struct list *list, int data);
void delete(struct list *head, struct list *tail);
int main(void)
{
start=end=NULL;
add(start, end, NULL);
add(start, end, NULL);
printf("First element: %d");
delete(start, end);
return 0;
}
void add(struct list *head, struct list *tail, int data)
{
if(tail==NULL)
{
head=tail=malloc(sizeof(struct list));
head->data=data; head->next=NULL;
} else {
tail->next=malloc(sizeof(struct list));
tail=tail->next;
tail->data=data;
tail->next=NULL;
}
}
void delete(struct list *head, struct list *tail)
{
struct list *temp;
if(head==tail)
{
free(head);
head=tail=NULL;
} else {
temp=head->next;
free(head);
head=temp;
}
}
I am aiming to return an output of 3 but keep getting random results. Any
insight is greatly appreciated
Nested subdocument array embed or link?
Nested subdocument array embed or link?
So, my question is the same as MongoDB relationships: embed or reference?
however I was wondering if one should embed or link with adding another
level of nesting, like answers, into the schema.
Like so:
Question
body: "This is my question"
Comments: [
comment: {
_id: ObjectId
body: "This is a comment on the question"
}
]
Answers: [
answer: {
_id: ObjectId
body: "This is an answer"
Comments: [
comment: {
_id: ObjectId
body: "This is a comment on this answer"
}
]
}
]
My schema doesn't actually have anything to do with questions, answers, or
comments but the schema structure is identical in terms of the nesting and
types of queries such as editing and sorting that one would do in this
case.
Also, I realized that it's not possible to do use positional notation
beyond a single level of array nesting. So answers.$.comments.$.body
wouldn't be possible...
https://jira.mongodb.org/browse/SERVER-831?page=com.atlassian.streams.streams-jira-plugin:activity-stream-issue-tab
So, my question is the same as MongoDB relationships: embed or reference?
however I was wondering if one should embed or link with adding another
level of nesting, like answers, into the schema.
Like so:
Question
body: "This is my question"
Comments: [
comment: {
_id: ObjectId
body: "This is a comment on the question"
}
]
Answers: [
answer: {
_id: ObjectId
body: "This is an answer"
Comments: [
comment: {
_id: ObjectId
body: "This is a comment on this answer"
}
]
}
]
My schema doesn't actually have anything to do with questions, answers, or
comments but the schema structure is identical in terms of the nesting and
types of queries such as editing and sorting that one would do in this
case.
Also, I realized that it's not possible to do use positional notation
beyond a single level of array nesting. So answers.$.comments.$.body
wouldn't be possible...
https://jira.mongodb.org/browse/SERVER-831?page=com.atlassian.streams.streams-jira-plugin:activity-stream-issue-tab
Subscribe to:
Comments (Atom)