PostId
int64 4
11.8M
| PostCreationDate
stringlengths 19
19
| OwnerUserId
int64 1
1.57M
| OwnerCreationDate
stringlengths 10
19
| ReputationAtPostCreation
int64 -55
461k
| OwnerUndeletedAnswerCountAtPostTime
int64 0
21.5k
| Title
stringlengths 3
250
| BodyMarkdown
stringlengths 5
30k
⌀ | Tag1
stringlengths 1
25
⌀ | Tag2
stringlengths 1
25
⌀ | Tag3
stringlengths 1
25
⌀ | Tag4
stringlengths 1
25
⌀ | Tag5
stringlengths 1
25
⌀ | PostClosedDate
stringlengths 19
19
⌀ | OpenStatus
stringclasses 5
values | unified_texts
stringlengths 32
30.1k
| OpenStatus_id
int64 0
4
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11,350,191 | 07/05/2012 18:18:08 | 1,101,481 | 12/16/2011 07:43:56 | 42 | 0 | android, mapview, draw ballon tip, how to clear the canvas | When I tap on then marker the ballon tip is drawing, but there is a lot of layers this ballon tip (bitmap). How can I clear canvas? I tried drawing transperent color on full screen but no result, I tried also drawing color with mode but I get blank screen (no mapview)
canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);
@Override
public void draw(android.graphics.Canvas canvas, MapView mapView,
boolean shadow)
{
super.draw(canvas, mapView, shadow);
if(index >= 0){
Log.d("overlay", "draw");
GeoPoint point = overlays.get(index).getPoint();
Point markerBottomCenterCoords = new Point();
mapView.getProjection().toPixels(point, markerBottomCenterCoords);
TextPaint paintTitle = new TextPaint();
TextPaint paintSubtitle = new TextPaint();
Paint paintRect = new Paint();
Rect rect = new Rect();
paintTitle.getTextBounds(overlays.get(index).getTitle(), 0, overlays.get(index).getTitle().length(), rect);
paintSubtitle.getTextBounds(overlays.get(index).getSnippet(), 0, overlays.get(index).getSnippet().length(), rect);
rect.offsetTo(markerBottomCenterCoords.x - rect.width()/2, markerBottomCenterCoords.y - 50 - rect.height());
paintTitle.setTextAlign(Paint.Align.CENTER);
paintTitle.setTextSize(TITLE_SIZE);
paintTitle.setARGB(255, 255, 255, 255);
paintSubtitle.setTextAlign(Paint.Align.CENTER);
paintSubtitle.setTextSize(SUBTITLE_SIZE);
paintSubtitle.setARGB(255, 255, 255, 255);
canvas.drawBitmap(marker, markerBottomCenterCoords.x - marker.getWidth()/2, markerBottomCenterCoords.y - marker.getHeight() - marker.getHeight()/2, null);
canvas.drawText(overlays.get(index).getTitle(), rect.left + rect.width() / 2, markerBottomCenterCoords.y - marker.getHeight() - marker.getHeight()/3, paintTitle);
canvas.drawText(context.getString(R.string.distancePoi)+ " " + overlays.get(index).getSnippet(), rect.left + rect.width() / 2, markerBottomCenterCoords.y - marker.getHeight(), paintSubtitle);
}
} | android | google-maps | canvas | bitmap | balloon-tip | null | open | android, mapview, draw ballon tip, how to clear the canvas
===
When I tap on then marker the ballon tip is drawing, but there is a lot of layers this ballon tip (bitmap). How can I clear canvas? I tried drawing transperent color on full screen but no result, I tried also drawing color with mode but I get blank screen (no mapview)
canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);
@Override
public void draw(android.graphics.Canvas canvas, MapView mapView,
boolean shadow)
{
super.draw(canvas, mapView, shadow);
if(index >= 0){
Log.d("overlay", "draw");
GeoPoint point = overlays.get(index).getPoint();
Point markerBottomCenterCoords = new Point();
mapView.getProjection().toPixels(point, markerBottomCenterCoords);
TextPaint paintTitle = new TextPaint();
TextPaint paintSubtitle = new TextPaint();
Paint paintRect = new Paint();
Rect rect = new Rect();
paintTitle.getTextBounds(overlays.get(index).getTitle(), 0, overlays.get(index).getTitle().length(), rect);
paintSubtitle.getTextBounds(overlays.get(index).getSnippet(), 0, overlays.get(index).getSnippet().length(), rect);
rect.offsetTo(markerBottomCenterCoords.x - rect.width()/2, markerBottomCenterCoords.y - 50 - rect.height());
paintTitle.setTextAlign(Paint.Align.CENTER);
paintTitle.setTextSize(TITLE_SIZE);
paintTitle.setARGB(255, 255, 255, 255);
paintSubtitle.setTextAlign(Paint.Align.CENTER);
paintSubtitle.setTextSize(SUBTITLE_SIZE);
paintSubtitle.setARGB(255, 255, 255, 255);
canvas.drawBitmap(marker, markerBottomCenterCoords.x - marker.getWidth()/2, markerBottomCenterCoords.y - marker.getHeight() - marker.getHeight()/2, null);
canvas.drawText(overlays.get(index).getTitle(), rect.left + rect.width() / 2, markerBottomCenterCoords.y - marker.getHeight() - marker.getHeight()/3, paintTitle);
canvas.drawText(context.getString(R.string.distancePoi)+ " " + overlays.get(index).getSnippet(), rect.left + rect.width() / 2, markerBottomCenterCoords.y - marker.getHeight(), paintSubtitle);
}
} | 0 |
11,571,658 | 07/20/2012 01:29:47 | 317,785 | 04/15/2010 17:30:45 | 1,099 | 27 | iOS can we reuse a NSTimer | I want to use an NSTimer to play a sound effect every 2.5 seconds if a specific condition is met. Once that condition changes, the sound will stop playing. But if it goes back, can I reuse an NSTimer?
If the condition is met then
if ([batteryControlTimer isValid]) {
[batteryControlTimer invalidate];
batteryControlTimer = [NSTimer scheduledTimerWithTimeInterval:2.5 target:self selector:@selector(playSound) userInfo:nil repeats:YES];
} else {
batteryControlTimer = [NSTimer scheduledTimerWithTimeInterval:2.5 target:self selector:@selector(playSound) userInfo:nil repeats:YES];
}
if it's not met,
[batteryControlTimer invalidate];
break; | ios | ios5 | ios4 | timer | nstimer | null | open | iOS can we reuse a NSTimer
===
I want to use an NSTimer to play a sound effect every 2.5 seconds if a specific condition is met. Once that condition changes, the sound will stop playing. But if it goes back, can I reuse an NSTimer?
If the condition is met then
if ([batteryControlTimer isValid]) {
[batteryControlTimer invalidate];
batteryControlTimer = [NSTimer scheduledTimerWithTimeInterval:2.5 target:self selector:@selector(playSound) userInfo:nil repeats:YES];
} else {
batteryControlTimer = [NSTimer scheduledTimerWithTimeInterval:2.5 target:self selector:@selector(playSound) userInfo:nil repeats:YES];
}
if it's not met,
[batteryControlTimer invalidate];
break; | 0 |
11,571,659 | 07/20/2012 01:30:15 | 643,084 | 03/03/2011 13:45:07 | 149 | 12 | pygtk: a row of clickable images | I have several hboxes of images contained inside a vbox
How do I make the images clickable?
I tried containing each image inside a EventBox. If this is the right approach, how do I resize the EventBox to the the same size as its image? I tried `.set_size_request` but it does not do anything
| python | gtk | pygtk | null | null | null | open | pygtk: a row of clickable images
===
I have several hboxes of images contained inside a vbox
How do I make the images clickable?
I tried containing each image inside a EventBox. If this is the right approach, how do I resize the EventBox to the the same size as its image? I tried `.set_size_request` but it does not do anything
| 0 |
11,571,660 | 07/20/2012 01:30:30 | 1,538,099 | 07/19/2012 13:48:01 | 1 | 0 | Where can i learn debugging on code blocks | ok so i want to learn how to debug on code blocks.
im new to the ide and have little experience with debugging on visual studio.
please give me a good source to learn debugging for code blocks. | c++ | null | null | null | null | 07/20/2012 11:43:18 | not constructive | Where can i learn debugging on code blocks
===
ok so i want to learn how to debug on code blocks.
im new to the ide and have little experience with debugging on visual studio.
please give me a good source to learn debugging for code blocks. | 4 |
11,571,723 | 07/20/2012 01:41:38 | 1,452,370 | 06/12/2012 22:15:05 | 1 | 0 | vim installing pathogin plugin in windows | I was going to install the pathogen plugin in GVIM for windows but the instructions say to install in the \vimfiles\autoload folder which I don't have. How would I install pathogen? | windows | vim | vi | vim-plugin | pathogen | null | open | vim installing pathogin plugin in windows
===
I was going to install the pathogen plugin in GVIM for windows but the instructions say to install in the \vimfiles\autoload folder which I don't have. How would I install pathogen? | 0 |
11,571,195 | 07/20/2012 00:19:57 | 1,384,374 | 05/09/2012 10:51:37 | 118 | 17 | Playing with the url when editting a post | I use the following url when I edit a post from the user :
../post/edit/3 //If the id of the post is 3 for example
To avoid that the user modifies the url intentionally, for example `/post/edit/5`, I use the following logic to make sure the user doesn't edit the post when he doesn't have permission:
if (//user is allowed to edit post){
//edit post
}
else {
throw new AccessDeniedException('You do not have the permission to edit this post');
}
Is this the general approach that you use when editing a post? Is there a way to do something cleaner so that the user cannot play with the id of the post in the url?
| php | symfony-2.0 | symfony-2.1 | null | null | null | open | Playing with the url when editting a post
===
I use the following url when I edit a post from the user :
../post/edit/3 //If the id of the post is 3 for example
To avoid that the user modifies the url intentionally, for example `/post/edit/5`, I use the following logic to make sure the user doesn't edit the post when he doesn't have permission:
if (//user is allowed to edit post){
//edit post
}
else {
throw new AccessDeniedException('You do not have the permission to edit this post');
}
Is this the general approach that you use when editing a post? Is there a way to do something cleaner so that the user cannot play with the id of the post in the url?
| 0 |
11,571,734 | 07/20/2012 01:43:21 | 771,702 | 05/26/2011 16:47:04 | 14 | 0 | jQuery element is removed from DOM but seems to be stored in memory? | I have a button click event that grabs names associated with checkboxes that are checked and adds them to a <ul> with checkboxes on the right side of the page. This works fine I then have another button that will remove and <li>'s with checked checkboxes from the <ul>. This works to. The problem comes when you go to add back an item that has been deleted from the right side. The item is not on the page, so it obviously removed from the DOM, but it's as if it's stored in browser memory still. How do I go about clearing it out of memory? Code is below.
$('.add-people').click(function () {
$('.add-names:checked').each(function () {
var name = $(this).parent().siblings('td.name-cell').html();
if ($('ul.group-list').find(':contains(' + name + ')').length) {
//Name is already in list
} else {
var newLi = '<li><input id="name" class="remove-names" type="checkbox" name="' + name + '"><span>' + name + '</span></li>'
$('ul.group-list').append(newLi);
}
});
});
$('.remove-people').click(function () {
$('.remove-names:checked').each(function () {
$(this).parent().remove();
});
}); | jquery | memory | browser | remove | null | null | open | jQuery element is removed from DOM but seems to be stored in memory?
===
I have a button click event that grabs names associated with checkboxes that are checked and adds them to a <ul> with checkboxes on the right side of the page. This works fine I then have another button that will remove and <li>'s with checked checkboxes from the <ul>. This works to. The problem comes when you go to add back an item that has been deleted from the right side. The item is not on the page, so it obviously removed from the DOM, but it's as if it's stored in browser memory still. How do I go about clearing it out of memory? Code is below.
$('.add-people').click(function () {
$('.add-names:checked').each(function () {
var name = $(this).parent().siblings('td.name-cell').html();
if ($('ul.group-list').find(':contains(' + name + ')').length) {
//Name is already in list
} else {
var newLi = '<li><input id="name" class="remove-names" type="checkbox" name="' + name + '"><span>' + name + '</span></li>'
$('ul.group-list').append(newLi);
}
});
});
$('.remove-people').click(function () {
$('.remove-names:checked').each(function () {
$(this).parent().remove();
});
}); | 0 |
11,571,739 | 07/20/2012 01:43:51 | 1,179,018 | 01/30/2012 21:20:19 | 30 | 2 | Find the min time interval between rows for a MySQL dataset | I have a MySQL table that records the events received for a user and the Date a event is received.
Date User
2012-01-21 18:30:02 AAA
2012-01-21 18:30:05 AAA
2012-01-21 18:30:08 AAA
2012-01-21 18:30:11 AAA
2012-01-21 18:30:15 AAA
2012-01-21 18:30:18 AAA
2012-01-21 18:30:21 AAA
2012-01-21 18:30:23 AAA
2012-01-21 18:30:26 AAA
2012-01-21 18:30:29 BBB
2012-01-21 18:30:32 BBB
2012-01-21 18:30:33 BBB
2012-01-21 18:30:37 BBB
2012-01-21 18:30:40 BBB
2012-01-21 18:30:42 BBB
2012-01-21 18:30:44 BBB
2012-01-21 18:31:01 BBB
2012-01-21 18:31:04 BBB
2012-01-21 18:31:07 BBB
2012-01-21 18:31:10 BBB
The events are not sorted by Date or User.
I would like to find out the min of the time interval (in seconds) between two successive events for a single user. So the result set would look like this:
MIN_INTERVAL USER
3 AAA
5 BBB
Can anyone help me come up a SQL query that generate this? I don't think a GROUP BY will help. | mysql | sql | timestamp | null | null | null | open | Find the min time interval between rows for a MySQL dataset
===
I have a MySQL table that records the events received for a user and the Date a event is received.
Date User
2012-01-21 18:30:02 AAA
2012-01-21 18:30:05 AAA
2012-01-21 18:30:08 AAA
2012-01-21 18:30:11 AAA
2012-01-21 18:30:15 AAA
2012-01-21 18:30:18 AAA
2012-01-21 18:30:21 AAA
2012-01-21 18:30:23 AAA
2012-01-21 18:30:26 AAA
2012-01-21 18:30:29 BBB
2012-01-21 18:30:32 BBB
2012-01-21 18:30:33 BBB
2012-01-21 18:30:37 BBB
2012-01-21 18:30:40 BBB
2012-01-21 18:30:42 BBB
2012-01-21 18:30:44 BBB
2012-01-21 18:31:01 BBB
2012-01-21 18:31:04 BBB
2012-01-21 18:31:07 BBB
2012-01-21 18:31:10 BBB
The events are not sorted by Date or User.
I would like to find out the min of the time interval (in seconds) between two successive events for a single user. So the result set would look like this:
MIN_INTERVAL USER
3 AAA
5 BBB
Can anyone help me come up a SQL query that generate this? I don't think a GROUP BY will help. | 0 |
11,571,730 | 07/20/2012 01:42:54 | 1,539,493 | 07/20/2012 01:36:44 | 1 | 0 | opencv complie bug about " cvloadimage" ,referenced from:_main in main.o | by the way, I have a problem
about complie
undefined symbols for architecture x86_64
" cvloadimage" ,referenced from:_main in main.o
please help me
how can I slove it | xcode | osx | opencv | x86-64 | null | null | open | opencv complie bug about " cvloadimage" ,referenced from:_main in main.o
===
by the way, I have a problem
about complie
undefined symbols for architecture x86_64
" cvloadimage" ,referenced from:_main in main.o
please help me
how can I slove it | 0 |
10,903,422 | 06/05/2012 19:12:58 | 1,268,941 | 03/14/2012 12:13:13 | 19 | 1 | matlab - get vectors from a matrix (quiverplot) | I am reading in an image and storing it into a 2d matrix. after doing some computation on it as shown here:
im = rgb2gray(imread('ellipse.png'));
im = im(:,:,1);
w = size(im,1);
h = size(im,2);
[dx,dy] = gradient(double(im));
[x y] = meshgrid(1:h,1:w);
a = zeros(temp);
lambda = 1;
Ox =-1.^lambda.* -x;
Oy =-1.^lambda.* y;
hold on
quiver(x,y,Ox,Oy)
I get the following image from the quiverplot:
https://docs.google.com/file/d/0B0iDswLYaZ0zR2lUQ2NkZnd1QXM/edit?pli=1
My question is, how do I access those vectors (arrows) from the quiverplot? I need to use those vectors in a cross product later on. Thanks. | matlab | null | null | null | null | null | open | matlab - get vectors from a matrix (quiverplot)
===
I am reading in an image and storing it into a 2d matrix. after doing some computation on it as shown here:
im = rgb2gray(imread('ellipse.png'));
im = im(:,:,1);
w = size(im,1);
h = size(im,2);
[dx,dy] = gradient(double(im));
[x y] = meshgrid(1:h,1:w);
a = zeros(temp);
lambda = 1;
Ox =-1.^lambda.* -x;
Oy =-1.^lambda.* y;
hold on
quiver(x,y,Ox,Oy)
I get the following image from the quiverplot:
https://docs.google.com/file/d/0B0iDswLYaZ0zR2lUQ2NkZnd1QXM/edit?pli=1
My question is, how do I access those vectors (arrows) from the quiverplot? I need to use those vectors in a cross product later on. Thanks. | 0 |
11,320,452 | 07/03/2012 23:09:14 | 624,869 | 02/20/2011 00:37:44 | 912 | 4 | Regular expression for "Some text repeating: XXhYYmZZs" | I want to construct a regular expression that will, for every line of text input I give it, pick out what XX, YY, and ZZ are, preferably returning the values to me in variables that I can add up or put in an array or whatever.
The thing is I'm fairly new to both regular expressions and shell scripting (I will be using csh for this task). So I was wondering how to do this with csh regex, and if it's different than say perl regex.
Just to reiterate the pattern is as follows:
Some text repeating: 23h04m31s
...
Some text repeating: 12h13m22s
...
EDIT - my script will need to look into particular files for this. I'm thinking I can use the GREP tool in my csh script, with the correct regex.
Thank you for any help! | regex | shell | scripting | null | null | null | open | Regular expression for "Some text repeating: XXhYYmZZs"
===
I want to construct a regular expression that will, for every line of text input I give it, pick out what XX, YY, and ZZ are, preferably returning the values to me in variables that I can add up or put in an array or whatever.
The thing is I'm fairly new to both regular expressions and shell scripting (I will be using csh for this task). So I was wondering how to do this with csh regex, and if it's different than say perl regex.
Just to reiterate the pattern is as follows:
Some text repeating: 23h04m31s
...
Some text repeating: 12h13m22s
...
EDIT - my script will need to look into particular files for this. I'm thinking I can use the GREP tool in my csh script, with the correct regex.
Thank you for any help! | 0 |
11,320,489 | 07/03/2012 23:14:30 | 1,497,323 | 07/02/2012 22:57:35 | 1 | 0 | Rotate Progress View and change height | I am using Xcode 4.3.
I need a progress view bar that is vertical. I applied a CGAffineTransformMakeRotation to the UIProgressView and it now appears as a small dot...
Any way I try to rotate it it appears this way. I tried to change its height by scaling with CGAffineTransformMakeScale and it doesn't change.
Thanks for the help!! | xcode | rotation | scale | uiprogressview | null | null | open | Rotate Progress View and change height
===
I am using Xcode 4.3.
I need a progress view bar that is vertical. I applied a CGAffineTransformMakeRotation to the UIProgressView and it now appears as a small dot...
Any way I try to rotate it it appears this way. I tried to change its height by scaling with CGAffineTransformMakeScale and it doesn't change.
Thanks for the help!! | 0 |
11,320,473 | 07/03/2012 23:11:31 | 1,388,017 | 05/10/2012 19:56:28 | 191 | 16 | Why does this only work once on reload, then stops working? | This script should prevent the popup from closing if you mouseover it, or the button, but it only works once on reload, then it stops working. arrrgh! Anyway, help is greatly appreciated, here is the [fiddle!!!!!](http://jsfiddle.net/MnpWV/1/). | javascript | jquery | twitter-bootstrap | null | null | null | open | Why does this only work once on reload, then stops working?
===
This script should prevent the popup from closing if you mouseover it, or the button, but it only works once on reload, then it stops working. arrrgh! Anyway, help is greatly appreciated, here is the [fiddle!!!!!](http://jsfiddle.net/MnpWV/1/). | 0 |
11,320,341 | 07/03/2012 22:56:07 | 654,754 | 03/11/2011 04:48:46 | 1,378 | 77 | VisualSVN, SVN Locks and Datasets | We are using Visual SVN and VS2010, we have a data project with several Datasets in it. To avoid having to try and merge the XSD files we have set them to require a lock so only one person can edit at a time.
The only problem is, when someone expands the TableAdapters and DataTables in the designer it asks for a lock, I have excluded the layout files (xss,xsc) from the "requires-lock" property, but is still asks for the lock.
Any ideas? | svn | dataset | tortoisesvn | visualsvn | null | null | open | VisualSVN, SVN Locks and Datasets
===
We are using Visual SVN and VS2010, we have a data project with several Datasets in it. To avoid having to try and merge the XSD files we have set them to require a lock so only one person can edit at a time.
The only problem is, when someone expands the TableAdapters and DataTables in the designer it asks for a lock, I have excluded the layout files (xss,xsc) from the "requires-lock" property, but is still asks for the lock.
Any ideas? | 0 |
11,320,342 | 07/03/2012 22:56:18 | 445,613 | 09/12/2010 14:44:58 | 63 | 1 | Capturing still images using AVFoundation's AVCaptureSession is slow (iPhone 4S camera) | I'm experiencing performance issues when taking still images with AVCaptureSession. The captureStillImageAsynchronouslyFromConnection method of AVCaptureStillImageOutput seems to be quite slow with larger images (AVCaptureSessionPresetPhoto on iPhone 4S). It works perfect though for the lower presets/resolutions (including iPod touch's camera). I also tried the WWDC sample code AVCam and also got a delay from when the picture was taken to the point when I could actually display it in an UIImageView.
Is there a faster, more efficient way than making a UIImage from NSData (got from [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageSampleBuffer])?
I could alternatively display a HUD message that the image is being processed or set a lower quality preset, but the fact that I'm actually even experiencing a delay is annoying me.
Just to mention - I'm also cropping/resizing the image after the user snaps it and that adds a bit more to the delay, but not much.
Thanks for all the suggestions/anwsers!
| ios | performance | image | avfoundation | avcapturesession | null | open | Capturing still images using AVFoundation's AVCaptureSession is slow (iPhone 4S camera)
===
I'm experiencing performance issues when taking still images with AVCaptureSession. The captureStillImageAsynchronouslyFromConnection method of AVCaptureStillImageOutput seems to be quite slow with larger images (AVCaptureSessionPresetPhoto on iPhone 4S). It works perfect though for the lower presets/resolutions (including iPod touch's camera). I also tried the WWDC sample code AVCam and also got a delay from when the picture was taken to the point when I could actually display it in an UIImageView.
Is there a faster, more efficient way than making a UIImage from NSData (got from [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageSampleBuffer])?
I could alternatively display a HUD message that the image is being processed or set a lower quality preset, but the fact that I'm actually even experiencing a delay is annoying me.
Just to mention - I'm also cropping/resizing the image after the user snaps it and that adds a bit more to the delay, but not much.
Thanks for all the suggestions/anwsers!
| 0 |
11,541,962 | 07/18/2012 12:58:35 | 1,122,834 | 12/30/2011 11:23:03 | 118 | 8 | Reduce database connections | I am currently making a small webpage for my server, where it shows some stats of the players who play on it. It works pretty good, but I was just wondering if I could reduce the amount of connections to the database. Currently, I have some JQuery code in the page which refreshes parts of it to show the latest data. Now, I've never used JQuery before, so I did it like this:
<script>
$(document).ready(function() {
$("#blocks").load("blocks.php<? if($usePlayer){echo("?player=" . $player);} ?>");
$("#global_stats").load("globalstats.php<? if($usePlayer){echo("?player=" . $player);} ?>");
$("#top_entities").load("entities.php<? if($usePlayer){echo("?player=" . $player);} ?>");
var blockRefresh = setInterval(function() {
$("#blocks").load("blocks.php<? if($usePlayer){echo("?player=" . $player);} ?>");
}, 5000);
var globalStatsRefresh = setInterval(function() {
$("#global_stats").load("globalstats.php<? if($usePlayer){echo("?player=" . $player);} ?>");
}, 30000);
$.ajaxSetup({ cache: false });
});
</script>
The thing is, all three parts of the page I am reloading need a MySQL database connection. Currently, I am including db.php on every page, but that seems rather inefficient. What would be a good way to do this instead?
Oh, the page can be seen here: http://mc.centrility.nl/stats/ | php | jquery | mysql | database-connection | null | null | open | Reduce database connections
===
I am currently making a small webpage for my server, where it shows some stats of the players who play on it. It works pretty good, but I was just wondering if I could reduce the amount of connections to the database. Currently, I have some JQuery code in the page which refreshes parts of it to show the latest data. Now, I've never used JQuery before, so I did it like this:
<script>
$(document).ready(function() {
$("#blocks").load("blocks.php<? if($usePlayer){echo("?player=" . $player);} ?>");
$("#global_stats").load("globalstats.php<? if($usePlayer){echo("?player=" . $player);} ?>");
$("#top_entities").load("entities.php<? if($usePlayer){echo("?player=" . $player);} ?>");
var blockRefresh = setInterval(function() {
$("#blocks").load("blocks.php<? if($usePlayer){echo("?player=" . $player);} ?>");
}, 5000);
var globalStatsRefresh = setInterval(function() {
$("#global_stats").load("globalstats.php<? if($usePlayer){echo("?player=" . $player);} ?>");
}, 30000);
$.ajaxSetup({ cache: false });
});
</script>
The thing is, all three parts of the page I am reloading need a MySQL database connection. Currently, I am including db.php on every page, but that seems rather inefficient. What would be a good way to do this instead?
Oh, the page can be seen here: http://mc.centrility.nl/stats/ | 0 |
11,541,966 | 07/18/2012 12:58:44 | 220,413 | 10/02/2009 23:25:17 | 153 | 2 | phpquery codeigniter howto | good day y'all,
I have a question? having googled this I felt it would be beneficial to ask here direct, is there anyone that has a howto and tutorial on using phpquery with codeigniter. I ask because I would like to manipulate certain css attributes and swap out certain css values. I could have done this with javascript but its tough mixing php and javascript so it means finding a way to manipulate html and css to do this. Hope y'all can help in anyway.
so I am looking to load phpquery and use it like any other library
<code><pre>
$this->load->libary('phpquery');
$this->phpquery->pq('div > p')->findall();
</pre></code> | php | codeigniter | phpquery | null | null | null | open | phpquery codeigniter howto
===
good day y'all,
I have a question? having googled this I felt it would be beneficial to ask here direct, is there anyone that has a howto and tutorial on using phpquery with codeigniter. I ask because I would like to manipulate certain css attributes and swap out certain css values. I could have done this with javascript but its tough mixing php and javascript so it means finding a way to manipulate html and css to do this. Hope y'all can help in anyway.
so I am looking to load phpquery and use it like any other library
<code><pre>
$this->load->libary('phpquery');
$this->phpquery->pq('div > p')->findall();
</pre></code> | 0 |
11,541,973 | 07/18/2012 12:58:56 | 1,462,299 | 06/17/2012 19:49:55 | 63 | 1 | Frequent http requests | I need to send a series of http requests: 1 per second during 1 minute. AFAIK it gonna impact battery usage. Is there any special strategy for handling this kind of issue ? | android | null | null | null | null | null | open | Frequent http requests
===
I need to send a series of http requests: 1 per second during 1 minute. AFAIK it gonna impact battery usage. Is there any special strategy for handling this kind of issue ? | 0 |
11,539,327 | 07/18/2012 10:30:31 | 1,501,285 | 07/04/2012 10:28:43 | 1 | 1 | Magento indexController doesn't trigger | I'm working on a massgrid option in Magento. The problem is that my indexController doesn't get loaded. I think that there is a problem in the declaration of my classes.
This is my Grid.php
class Comp_Dhl_Block_Sales_Order_Grid extends Mage_Adminhtml_Block_Sales_Order_Grid
{
protected function _prepareMassaction()
{
parent::_prepareMassaction();
$this->getMassactionBlock()->addItem(
'to_dhl',
array('label' => $this->__('Sent to [DHL]'),
'url' => $this->getUrl('/*/*/toDhl'),
)
);
}
}
The mass option: "Sent to [DHL]" shows up fine. Because I have this in my url: `$this->getUrl('/*/*/toDhl')` I have to add: `public function toDhlAction()` to my indexController.php
My indexController.php looks like:
class Comp_Dhl_IndexController extends Mage_Adminhtml_Controller_Action
{
public function toDhlAction(){
mail('[email protected]', 'controller works', 'the mass action controller works');
$this->_redirect('*/*/index');
}
}
And here is the problem, because I don't get the email that the indexController.php should trigger.
Any thoughts? | magento | controller | null | null | null | null | open | Magento indexController doesn't trigger
===
I'm working on a massgrid option in Magento. The problem is that my indexController doesn't get loaded. I think that there is a problem in the declaration of my classes.
This is my Grid.php
class Comp_Dhl_Block_Sales_Order_Grid extends Mage_Adminhtml_Block_Sales_Order_Grid
{
protected function _prepareMassaction()
{
parent::_prepareMassaction();
$this->getMassactionBlock()->addItem(
'to_dhl',
array('label' => $this->__('Sent to [DHL]'),
'url' => $this->getUrl('/*/*/toDhl'),
)
);
}
}
The mass option: "Sent to [DHL]" shows up fine. Because I have this in my url: `$this->getUrl('/*/*/toDhl')` I have to add: `public function toDhlAction()` to my indexController.php
My indexController.php looks like:
class Comp_Dhl_IndexController extends Mage_Adminhtml_Controller_Action
{
public function toDhlAction(){
mail('[email protected]', 'controller works', 'the mass action controller works');
$this->_redirect('*/*/index');
}
}
And here is the problem, because I don't get the email that the indexController.php should trigger.
Any thoughts? | 0 |
11,541,978 | 07/18/2012 12:59:05 | 1,534,806 | 07/18/2012 12:42:07 | 1 | 0 | How to write big files with BinaryWriter(C#)& | I have some program which write a large binary files. And I meet the problem: sometimes my programm crash on file writing without throwing any error (block catch don't execute. I write some test console application to find and fix this problem. Somthing like this:
static void Main(string[] args)
{
for (int j = 0; j < 100; j++)
{
string fileName = @"D:\Users\nimci\Desktop\buf\"+j+".bin";
using (var output =
new BinaryWriter(File.Open(fileName, FileMode.Create, FileAccess.Write)))
{
for (int i = 0; i < 4000000; i++)
{
output.Write(i);
//if(i%1000==0) Thread.Sleep(1);
}
}
}
}
And i have such results: Some files have 0 size. For example the files with numbers 8, 10, 15, 17,...
On my home (less powerfull) computer all the files have been written correctly, byt on my work computer some of them have 0 size. If I uncomment Thread.Sleep(1); (or slow my program in other way) all the files correct on my work computer too, but such "fix" don't work on my server computer.
Can anybody explain what the error occured and how can I fix it?
I try to use try-cath-finally instead using, but catch block don't catch this error. | c# | binaryfiles | binarywriter | null | null | null | open | How to write big files with BinaryWriter(C#)&
===
I have some program which write a large binary files. And I meet the problem: sometimes my programm crash on file writing without throwing any error (block catch don't execute. I write some test console application to find and fix this problem. Somthing like this:
static void Main(string[] args)
{
for (int j = 0; j < 100; j++)
{
string fileName = @"D:\Users\nimci\Desktop\buf\"+j+".bin";
using (var output =
new BinaryWriter(File.Open(fileName, FileMode.Create, FileAccess.Write)))
{
for (int i = 0; i < 4000000; i++)
{
output.Write(i);
//if(i%1000==0) Thread.Sleep(1);
}
}
}
}
And i have such results: Some files have 0 size. For example the files with numbers 8, 10, 15, 17,...
On my home (less powerfull) computer all the files have been written correctly, byt on my work computer some of them have 0 size. If I uncomment Thread.Sleep(1); (or slow my program in other way) all the files correct on my work computer too, but such "fix" don't work on my server computer.
Can anybody explain what the error occured and how can I fix it?
I try to use try-cath-finally instead using, but catch block don't catch this error. | 0 |
11,537,365 | 07/18/2012 08:37:29 | 1,474,949 | 06/22/2012 13:27:18 | 1 | 0 | Embedded charts in google doc from google spreadsheet | I have a spreadsheet with a chart embedded in it. This was done through the UI. What I would like to do is programatically, through the API, embed the same chart in a separate google doc.
A Can this be done?
B How do you do it?
I have looked through the google API documentation and cant find a way to do it. Can anyone help? | google-api | null | null | null | null | null | open | Embedded charts in google doc from google spreadsheet
===
I have a spreadsheet with a chart embedded in it. This was done through the UI. What I would like to do is programatically, through the API, embed the same chart in a separate google doc.
A Can this be done?
B How do you do it?
I have looked through the google API documentation and cant find a way to do it. Can anyone help? | 0 |
11,628,169 | 07/24/2012 09:43:26 | 387,981 | 07/09/2010 17:21:44 | 2,329 | 94 | JSF 2.0: <f:viewParam> and default converters | I would like to use a standard JSF converter (`javax.faces.convert.DateTimeConverter`) for a view parameter
From the documentation:
> You can refer to the converter by class or by its ID using the
> component tag's converter attribute. The ID is defined in the
> application configuration resource file
I then tried:
<f:viewParam
name = "rangeStartCreationDate"
value = "#{doiListController.model.rangeStartCreationDate}"
converter = "javax.faces.convert.DateTimeConverter"
/>
but I get
javax.faces.FacesException: Expression Error: Named Object: javax.faces.convert.DateTimeConverter not found.
I then tried the second option (by ID). I defined the converter in `faces-config.xml`
<converter>
<converter-id>DateTimeConverter</converter-id>
<converter-class>javax.faces.convert.DateTimeConverter</converter-class>
</converter>
and used the ID
<f:viewParam
name = "rangeStartCreationDate"
value = "#{doiListController.model.rangeStartCreationDate}"
converterId = "DateTimeConverter"
/>
In this case I get
Conversion Error setting value 'Tue Jul 24 00:00:00 CEST 2012' for 'null Converter'.
Is there a way to let JSF instantiate the converter or to I have to instantiate it manually (in some bean)?
| datetime | jsf-2.0 | converter | null | null | null | open | JSF 2.0: <f:viewParam> and default converters
===
I would like to use a standard JSF converter (`javax.faces.convert.DateTimeConverter`) for a view parameter
From the documentation:
> You can refer to the converter by class or by its ID using the
> component tag's converter attribute. The ID is defined in the
> application configuration resource file
I then tried:
<f:viewParam
name = "rangeStartCreationDate"
value = "#{doiListController.model.rangeStartCreationDate}"
converter = "javax.faces.convert.DateTimeConverter"
/>
but I get
javax.faces.FacesException: Expression Error: Named Object: javax.faces.convert.DateTimeConverter not found.
I then tried the second option (by ID). I defined the converter in `faces-config.xml`
<converter>
<converter-id>DateTimeConverter</converter-id>
<converter-class>javax.faces.convert.DateTimeConverter</converter-class>
</converter>
and used the ID
<f:viewParam
name = "rangeStartCreationDate"
value = "#{doiListController.model.rangeStartCreationDate}"
converterId = "DateTimeConverter"
/>
In this case I get
Conversion Error setting value 'Tue Jul 24 00:00:00 CEST 2012' for 'null Converter'.
Is there a way to let JSF instantiate the converter or to I have to instantiate it manually (in some bean)?
| 0 |
11,628,116 | 07/24/2012 09:39:30 | 1,547,913 | 07/24/2012 07:38:02 | 1 | 0 | User profile restriction in php with 4 level | I was trying to create restrction on profile view by the member value that is for low value of members say 1 will see other members with value say 2, 3, 4 and lower members say 4 can't see 1,2,3 .
I did it the way by adding a column to registered table where user will have thier membersvalue from 1-4 and low membersvalue will see higher but oppsite is not true. I did it by feteching the same which i asked in question [here][1] There problem is not solve.
What is happening that First the search page is there all users are or the searched user with criteria is shown with the link to their profile. I want to restrict user with high membervalue to not able to see the low membersvalue profile. I did it as i said above. I compared the member value of the login user and all the user searched(with $row) but either the every profile is get restricted or neither of them. How to solve this problem?
I desprite need something. Do i need to changes some logic here? Help me out. I am still beginer in php and mysql.
[1]: http://stackoverflow.com/questions/11626316/error-in-comparing-the-same-column-in-mysql | php | mysql | profile | null | null | 07/25/2012 15:10:20 | not a real question | User profile restriction in php with 4 level
===
I was trying to create restrction on profile view by the member value that is for low value of members say 1 will see other members with value say 2, 3, 4 and lower members say 4 can't see 1,2,3 .
I did it the way by adding a column to registered table where user will have thier membersvalue from 1-4 and low membersvalue will see higher but oppsite is not true. I did it by feteching the same which i asked in question [here][1] There problem is not solve.
What is happening that First the search page is there all users are or the searched user with criteria is shown with the link to their profile. I want to restrict user with high membervalue to not able to see the low membersvalue profile. I did it as i said above. I compared the member value of the login user and all the user searched(with $row) but either the every profile is get restricted or neither of them. How to solve this problem?
I desprite need something. Do i need to changes some logic here? Help me out. I am still beginer in php and mysql.
[1]: http://stackoverflow.com/questions/11626316/error-in-comparing-the-same-column-in-mysql | 1 |
11,628,117 | 07/24/2012 09:39:35 | 1,548,205 | 07/24/2012 09:31:16 | 1 | 0 | Combining two commands on one line | is there any way I can combine these two commands:
sed -i 's/test=.*$/test=NEXTCOMMAND/' filename.cfg
tail -1 file2.txt | cut -f 7-
into something like this:
sed -i 's/test=.*$/test=`tail -1 file2.txt | cut -f 7-/`' filename.cfg
without assigning
"tail -1 file2.txt | cut -f 7-"
to a variable. My question is, if I can wrap somehow mentioned command to be a correct one?
Many thanks! | unix | sed | search-and-replace | cut | null | null | open | Combining two commands on one line
===
is there any way I can combine these two commands:
sed -i 's/test=.*$/test=NEXTCOMMAND/' filename.cfg
tail -1 file2.txt | cut -f 7-
into something like this:
sed -i 's/test=.*$/test=`tail -1 file2.txt | cut -f 7-/`' filename.cfg
without assigning
"tail -1 file2.txt | cut -f 7-"
to a variable. My question is, if I can wrap somehow mentioned command to be a correct one?
Many thanks! | 0 |
11,628,172 | 07/24/2012 09:43:45 | 1,014,631 | 10/26/2011 13:19:55 | 81 | 8 | Converting an ArrayAdapter to CursorAdapter for use in a SearchView | How can I convert an `ArrayAdapter<String>` of static data into a `CursorAdapter` for using Suggestion Listener in `SearchView`?
I have constructed the `ArrayAdapter<String>` from static data (`allString`)
ArrayAdapter<String> searchAdapter = new ArrayAdapter<String>(context, R.layout.listitem, allString);
and I use it for an `MultiAutoCompleteTextView` which works fine in devices with API level less than 11
MultiAutoCompleteTextView findTextView.setAdapter(searchAdapter);
However my target API is level is 11 and for API>10 I use an `ActionBar` within which I would like to have a SearchView instead.
Here's what I have tried: It does show the `ActionBar` with the embedded `SearchView` but does not give any suggestions as it would in the `MultiAutoCompleteTextView`.
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
if (android.os.Build.VERSION.SDK_INT > 10){
inflater.inflate(R.menu.menu11, menu);
searchView = (SearchView) menu.findItem(R.id.MENU_SEARCH).getActionView();
int[] to = {0};
CursorAdapter cursorAdapter = new SimpleCursorAdapter(context, R.layout.listitem, null, allBusStopString, to);
searchView.setSuggestionsAdapter(cursorAdapter);
searchView.setOnSuggestionListener(new OnSuggestionListener() {
@Override
public boolean onSuggestionClick(int position) {
String selectedItem = (String)cursorAdapter.getItem(position);
Log.v("search view", selectedItem);
}
return false;
}
@Override
public boolean onSuggestionSelect(int position) {
return false;
}
});
}else{
inflater.inflate(R.menu.menu, menu);
}
return true;
} | android | android-actionbar | simplecursoradapter | autocompletetextview | android-cursoradapter | null | open | Converting an ArrayAdapter to CursorAdapter for use in a SearchView
===
How can I convert an `ArrayAdapter<String>` of static data into a `CursorAdapter` for using Suggestion Listener in `SearchView`?
I have constructed the `ArrayAdapter<String>` from static data (`allString`)
ArrayAdapter<String> searchAdapter = new ArrayAdapter<String>(context, R.layout.listitem, allString);
and I use it for an `MultiAutoCompleteTextView` which works fine in devices with API level less than 11
MultiAutoCompleteTextView findTextView.setAdapter(searchAdapter);
However my target API is level is 11 and for API>10 I use an `ActionBar` within which I would like to have a SearchView instead.
Here's what I have tried: It does show the `ActionBar` with the embedded `SearchView` but does not give any suggestions as it would in the `MultiAutoCompleteTextView`.
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
if (android.os.Build.VERSION.SDK_INT > 10){
inflater.inflate(R.menu.menu11, menu);
searchView = (SearchView) menu.findItem(R.id.MENU_SEARCH).getActionView();
int[] to = {0};
CursorAdapter cursorAdapter = new SimpleCursorAdapter(context, R.layout.listitem, null, allBusStopString, to);
searchView.setSuggestionsAdapter(cursorAdapter);
searchView.setOnSuggestionListener(new OnSuggestionListener() {
@Override
public boolean onSuggestionClick(int position) {
String selectedItem = (String)cursorAdapter.getItem(position);
Log.v("search view", selectedItem);
}
return false;
}
@Override
public boolean onSuggestionSelect(int position) {
return false;
}
});
}else{
inflater.inflate(R.menu.menu, menu);
}
return true;
} | 0 |
11,628,173 | 07/24/2012 09:43:44 | 480,262 | 10/19/2010 08:57:27 | 505 | 30 | How many simultaneous downloads make sense on iOS | I have an iOS app which synchronizes a certain number of assets at startup. I'm using AFNetworking and set up an NSOperationQueue to handle all of the downloads. I was wondering, how many simultaneous downloads make sense. Is there a limit where network performance will drop if I have to many at the same time? At the moment I'm doing max 5 downloads at a time. | ios | networking | afnetworking | null | null | null | open | How many simultaneous downloads make sense on iOS
===
I have an iOS app which synchronizes a certain number of assets at startup. I'm using AFNetworking and set up an NSOperationQueue to handle all of the downloads. I was wondering, how many simultaneous downloads make sense. Is there a limit where network performance will drop if I have to many at the same time? At the moment I'm doing max 5 downloads at a time. | 0 |
11,628,176 | 07/24/2012 09:43:58 | 1,548,214 | 07/24/2012 09:33:26 | 1 | 0 | Strange error with OpenSSL 1.0.0e/1.0.1 DTLS | I'm starting DTLS test server using next command line:
openssl s_server -accept 4433 -www -dtls1 -cert server.pem -key key.pem -pass stdin -debug -state -msg
and trying to connect using third-party library, but get next error:
Error print-screen : https://dl.dropbox.com/u/28311951/dtlserr.png
The question is what does "error in SSLv3 write certificate A" mean and what could be the reason? Everything works fine if I use -tls1 instead of -dtls1. | encryption | ssl | cryptography | openssl | tls | null | open | Strange error with OpenSSL 1.0.0e/1.0.1 DTLS
===
I'm starting DTLS test server using next command line:
openssl s_server -accept 4433 -www -dtls1 -cert server.pem -key key.pem -pass stdin -debug -state -msg
and trying to connect using third-party library, but get next error:
Error print-screen : https://dl.dropbox.com/u/28311951/dtlserr.png
The question is what does "error in SSLv3 write certificate A" mean and what could be the reason? Everything works fine if I use -tls1 instead of -dtls1. | 0 |
11,628,179 | 07/24/2012 09:44:12 | 498,688 | 11/05/2010 18:55:53 | 1,347 | 103 | list need double click to toggle a class | Refer at this Fiddle: **[http://jsfiddle.net/toroncino/7Yag9/2/][1]**
Why if I click on the row nothing happen?
I need to double click to highlight the element.
It works only if I click on the select on the right.
Thanks for help.
[1]: http://jsfiddle.net/toroncino/7Yag9/2/ | jquery | css | null | null | null | null | open | list need double click to toggle a class
===
Refer at this Fiddle: **[http://jsfiddle.net/toroncino/7Yag9/2/][1]**
Why if I click on the row nothing happen?
I need to double click to highlight the element.
It works only if I click on the select on the right.
Thanks for help.
[1]: http://jsfiddle.net/toroncino/7Yag9/2/ | 0 |
11,628,180 | 07/24/2012 09:44:13 | 149,237 | 08/02/2009 09:05:22 | 2,071 | 77 | What does this C# snippet mean? | struct MyStruct : int
{
.../...
}
The [MSDN][1] states that after the `:` is the list of the implemented interfaces, but `int`is quite a curious interface to me...
Is it maybe a way to define the size of the struct? Someting like a bitfield?
[1]: http://msdn.microsoft.com/en-us/library/ah19swz4%28v=vs.71%29.aspx | c# | null | null | null | null | null | open | What does this C# snippet mean?
===
struct MyStruct : int
{
.../...
}
The [MSDN][1] states that after the `:` is the list of the implemented interfaces, but `int`is quite a curious interface to me...
Is it maybe a way to define the size of the struct? Someting like a bitfield?
[1]: http://msdn.microsoft.com/en-us/library/ah19swz4%28v=vs.71%29.aspx | 0 |
11,628,181 | 07/24/2012 09:44:15 | 653,806 | 03/10/2011 15:25:40 | 25 | 0 | AD is creating multiple profiles for same user on local machine | Whenever a user logs into his machine using his AD credentials, the AD creates a new profile on the machine.
So under C:\Users\ there are multiple profiles with his name
-jsmith
-jsmith.DO.000
-jsmith.DO.001
-jsmith.DO.002
Everytime he logs on he gets a new profile.
He has a large amount of data in his profile and this is filling up the space on his machine.
This is happening to just one of our users. Does anyone know why this could be happening?
Thanks | active-directory | profile | null | null | null | null | open | AD is creating multiple profiles for same user on local machine
===
Whenever a user logs into his machine using his AD credentials, the AD creates a new profile on the machine.
So under C:\Users\ there are multiple profiles with his name
-jsmith
-jsmith.DO.000
-jsmith.DO.001
-jsmith.DO.002
Everytime he logs on he gets a new profile.
He has a large amount of data in his profile and this is filling up the space on his machine.
This is happening to just one of our users. Does anyone know why this could be happening?
Thanks | 0 |
11,628,182 | 07/24/2012 09:44:17 | 1,480,233 | 06/25/2012 14:08:53 | 6 | 0 | Why does this only display one of my records? | I am trying to get pagination working on my website. Everything should be working but this only displays one product, however that should be 8 products. Anybody know what's wrong?
Thanks in advance.
else {
$query = "SELECT COUNT(*) FROM products";
$result = mysql_query($query) or die(mysql_error());
$num_rows = mysql_fetch_row($result);
$pages = new Paginator;
$pages->items_total = $num_rows[0];
$pages->mid_range = 9;
$pages->paginate();
$query = "SELECT serial, name, description, price, picture FROM products WHERE serial != '' ORDER BY serial ASC $pages->limit";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_row($result);
{
echo '<div style="margin-bottom:10px;display:inline-block;background-color:#E3E3E3;width:190px;height:200px;"><a href="'.$_SERVER['PHP_SELF'].'?serial='.$row[0].'"><img style="padding-top:10px;padding-left:25px;width:150px;height:150px;" src="'.htmlspecialchars($row[4]).'"></a><br><div align="center"><b>'.htmlspecialchars($row[1]).'</b><br><h6>€'.htmlspecialchars($row[3]).'</h6></div></div>';
};
echo ' ';
echo '<br><br><div style="margin-left:330px;">';
echo $pages->display_pages();
echo '</div>';
}
?> | php | pagination | null | null | null | null | open | Why does this only display one of my records?
===
I am trying to get pagination working on my website. Everything should be working but this only displays one product, however that should be 8 products. Anybody know what's wrong?
Thanks in advance.
else {
$query = "SELECT COUNT(*) FROM products";
$result = mysql_query($query) or die(mysql_error());
$num_rows = mysql_fetch_row($result);
$pages = new Paginator;
$pages->items_total = $num_rows[0];
$pages->mid_range = 9;
$pages->paginate();
$query = "SELECT serial, name, description, price, picture FROM products WHERE serial != '' ORDER BY serial ASC $pages->limit";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_row($result);
{
echo '<div style="margin-bottom:10px;display:inline-block;background-color:#E3E3E3;width:190px;height:200px;"><a href="'.$_SERVER['PHP_SELF'].'?serial='.$row[0].'"><img style="padding-top:10px;padding-left:25px;width:150px;height:150px;" src="'.htmlspecialchars($row[4]).'"></a><br><div align="center"><b>'.htmlspecialchars($row[1]).'</b><br><h6>€'.htmlspecialchars($row[3]).'</h6></div></div>';
};
echo ' ';
echo '<br><br><div style="margin-left:330px;">';
echo $pages->display_pages();
echo '</div>';
}
?> | 0 |
6,841,719 | 07/27/2011 08:51:55 | 826,904 | 07/03/2011 13:14:24 | 55 | 1 | NoSuchAlgorithmException: KeyGenerator AES/CBC/PKCS5Padding implementation not found | I'm trying to decrypt an encrypted image in Android using this code :
package com.cryptooo.lol;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.security.SecureRandom;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import android.app.Activity;
import android.content.res.AssetManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.util.Log;
import android.widget.ImageView;
import android.widget.TextView;
public class SimpleCryptoActivity extends Activity {
private static final int IO_BUFFER_SIZE = 4 * 1024;
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
try {
AssetManager am = this.getAssets();
InputStream is = am.open("2000_1.jpg_encrypted"); // get the encrypted image from assets folder
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] b = new byte[IO_BUFFER_SIZE];
int read;
while ((read = is.read(b)) != -1) { //convert inputstream to bytearrayoutputstream
baos.write(b, 0, read);
}
byte[] keys = "MARTIN_123_MARTIN_123".getBytes("UTF-8");
byte[] iv = "1234567890123456".getBytes("UTF-8");
KeyGenerator kgen = KeyGenerator.getInstance("AES/CBC/PKCS5Padding"); //aes
SecureRandom sr = SecureRandom.getInstance("SHA1PRNG");
sr.setSeed(keys);
kgen.init(128, sr);
SecretKey skey = kgen.generateKey();
byte[] key = skey.getEncoded();
long start = System.currentTimeMillis()/1000L; // start
byte[] decryptedData = decrypt(key, iv, b);
//END
long end = System.currentTimeMillis()/1000L; // end
Log.d("TEST","Time start "+ String.valueOf(start)); //showing the start in ms
Log.d("TEST","Time end "+ String.valueOf(end)); //showing the end in ms
Bitmap bitmap = BitmapFactory.decodeByteArray(decryptedData , 0, decryptedData .length); //decoding bytearrayoutputstream to bitmap
int i = bitmap.getRowBytes() * bitmap.getHeight() ;
TextView txt = (TextView) findViewById(R.id.text);
txt.setText(String.valueOf(i));
is.close(); // close the inputstream
baos.close(); // close the bytearrayoutputstream
}
catch(Exception e){
e.fillInStackTrace();
Log.e("error","err",e);
}
}
//decrypt
private byte[] decrypt(byte[] raw, byte[] iv, byte[] encrypted) throws Exception {
SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
IvParameterSpec ivspec = new IvParameterSpec(iv);
cipher.init(Cipher.DECRYPT_MODE, skeySpec, ivspec);
byte[] decrypted = cipher.doFinal(encrypted);
return decrypted;
}
}
But it's throwing me this exception :
07-27 08:46:38.980: ERROR/error(2712): err
07-27 08:46:38.980: ERROR/error(2712): java.security.NoSuchAlgorithmException: KeyGenerator AES/CBC/PKCS5Padding implementation not found
07-27 08:46:38.980: ERROR/error(2712): at com.cryptooo.lol.SimpleCryptoActivity.onCreate(SimpleCryptoActivity.java:75)
07-27 08:46:38.980: ERROR/error(2712): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-27 08:46:38.980: ERROR/error(2712): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
07-27 08:46:38.980: ERROR/error(2712): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
07-27 08:46:38.980: ERROR/error(2712): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
07-27 08:46:38.980: ERROR/error(2712): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
07-27 08:46:38.980: ERROR/error(2712): at android.os.Handler.dispatchMessage(Handler.java:99)
07-27 08:46:38.980: ERROR/error(2712): at android.os.Looper.loop(Looper.java:123)
07-27 08:46:38.980: ERROR/error(2712): at android.app.ActivityThread.main(ActivityThread.java:4363)
07-27 08:46:38.980: ERROR/error(2712): at java.lang.reflect.Method.invokeNative(Native Method)
07-27 08:46:38.980: ERROR/error(2712): at java.lang.reflect.Method.invoke(Method.java:521)
07-27 08:46:38.980: ERROR/error(2712): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
07-27 08:46:38.980: ERROR/error(2712): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
07-27 08:46:38.980: ERROR/error(2712): at dalvik.system.NativeStart.main(Native Method)
Any suggestions how can I fix that problem? | android | image | exception | encryption | null | null | open | NoSuchAlgorithmException: KeyGenerator AES/CBC/PKCS5Padding implementation not found
===
I'm trying to decrypt an encrypted image in Android using this code :
package com.cryptooo.lol;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.security.SecureRandom;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import android.app.Activity;
import android.content.res.AssetManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.util.Log;
import android.widget.ImageView;
import android.widget.TextView;
public class SimpleCryptoActivity extends Activity {
private static final int IO_BUFFER_SIZE = 4 * 1024;
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
try {
AssetManager am = this.getAssets();
InputStream is = am.open("2000_1.jpg_encrypted"); // get the encrypted image from assets folder
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] b = new byte[IO_BUFFER_SIZE];
int read;
while ((read = is.read(b)) != -1) { //convert inputstream to bytearrayoutputstream
baos.write(b, 0, read);
}
byte[] keys = "MARTIN_123_MARTIN_123".getBytes("UTF-8");
byte[] iv = "1234567890123456".getBytes("UTF-8");
KeyGenerator kgen = KeyGenerator.getInstance("AES/CBC/PKCS5Padding"); //aes
SecureRandom sr = SecureRandom.getInstance("SHA1PRNG");
sr.setSeed(keys);
kgen.init(128, sr);
SecretKey skey = kgen.generateKey();
byte[] key = skey.getEncoded();
long start = System.currentTimeMillis()/1000L; // start
byte[] decryptedData = decrypt(key, iv, b);
//END
long end = System.currentTimeMillis()/1000L; // end
Log.d("TEST","Time start "+ String.valueOf(start)); //showing the start in ms
Log.d("TEST","Time end "+ String.valueOf(end)); //showing the end in ms
Bitmap bitmap = BitmapFactory.decodeByteArray(decryptedData , 0, decryptedData .length); //decoding bytearrayoutputstream to bitmap
int i = bitmap.getRowBytes() * bitmap.getHeight() ;
TextView txt = (TextView) findViewById(R.id.text);
txt.setText(String.valueOf(i));
is.close(); // close the inputstream
baos.close(); // close the bytearrayoutputstream
}
catch(Exception e){
e.fillInStackTrace();
Log.e("error","err",e);
}
}
//decrypt
private byte[] decrypt(byte[] raw, byte[] iv, byte[] encrypted) throws Exception {
SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
IvParameterSpec ivspec = new IvParameterSpec(iv);
cipher.init(Cipher.DECRYPT_MODE, skeySpec, ivspec);
byte[] decrypted = cipher.doFinal(encrypted);
return decrypted;
}
}
But it's throwing me this exception :
07-27 08:46:38.980: ERROR/error(2712): err
07-27 08:46:38.980: ERROR/error(2712): java.security.NoSuchAlgorithmException: KeyGenerator AES/CBC/PKCS5Padding implementation not found
07-27 08:46:38.980: ERROR/error(2712): at com.cryptooo.lol.SimpleCryptoActivity.onCreate(SimpleCryptoActivity.java:75)
07-27 08:46:38.980: ERROR/error(2712): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-27 08:46:38.980: ERROR/error(2712): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
07-27 08:46:38.980: ERROR/error(2712): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
07-27 08:46:38.980: ERROR/error(2712): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
07-27 08:46:38.980: ERROR/error(2712): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
07-27 08:46:38.980: ERROR/error(2712): at android.os.Handler.dispatchMessage(Handler.java:99)
07-27 08:46:38.980: ERROR/error(2712): at android.os.Looper.loop(Looper.java:123)
07-27 08:46:38.980: ERROR/error(2712): at android.app.ActivityThread.main(ActivityThread.java:4363)
07-27 08:46:38.980: ERROR/error(2712): at java.lang.reflect.Method.invokeNative(Native Method)
07-27 08:46:38.980: ERROR/error(2712): at java.lang.reflect.Method.invoke(Method.java:521)
07-27 08:46:38.980: ERROR/error(2712): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
07-27 08:46:38.980: ERROR/error(2712): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
07-27 08:46:38.980: ERROR/error(2712): at dalvik.system.NativeStart.main(Native Method)
Any suggestions how can I fix that problem? | 0 |
11,626,286 | 07/24/2012 07:42:55 | 771,077 | 05/26/2011 09:58:40 | 550 | 1 | How to clear form data so refresh doesn't duplicate data without forwarding? | I created a guestbook, in which users can add entries via an HTML form. After submitting data to the guestbook, some users refresh the page. All browsers I know resubmit the data. afterwards. Is there a way to tell the browser, that the data should not be resubmitted?
I used to have a redirect after sucessfully storig the data to the database. But, now I want to promt some additional information to the user, e.g. "Thanks for your entry entitled '...'.", or "A coy of the entry was sent to your e-Mail-Adress...". I really like to avoid adding all the values to GET-Parameters to be able to use the information after the forwarding.
Is there another way (without a forward!) to prevnt the browser from submitting the data again after the user click on the "refresh" button? | php | html | browser | refresh | null | null | open | How to clear form data so refresh doesn't duplicate data without forwarding?
===
I created a guestbook, in which users can add entries via an HTML form. After submitting data to the guestbook, some users refresh the page. All browsers I know resubmit the data. afterwards. Is there a way to tell the browser, that the data should not be resubmitted?
I used to have a redirect after sucessfully storig the data to the database. But, now I want to promt some additional information to the user, e.g. "Thanks for your entry entitled '...'.", or "A coy of the entry was sent to your e-Mail-Adress...". I really like to avoid adding all the values to GET-Parameters to be able to use the information after the forwarding.
Is there another way (without a forward!) to prevnt the browser from submitting the data again after the user click on the "refresh" button? | 0 |
11,472,059 | 07/13/2012 14:03:41 | 1,365,247 | 04/30/2012 07:17:15 | 6 | 0 | Dynamic table name in entity framework linq | I am currently using entity framework (.net 4) to read from a 3rd party database using LINQ statements. Unfortunately, at compile time i do not know from which table i will be reading - in fact, new tables can be added to this database after my application is compiled. The table name to read from will be passed as a string parameter to my method.
How should one approach this situation when the table name is not know at compile time? i cannot even add these tables to my data model since they might not yet exist. whilst i like the convenience of linq, i am after a simple approach.
thanks! | linq | entity-framework | entity-framework-4 | null | null | null | open | Dynamic table name in entity framework linq
===
I am currently using entity framework (.net 4) to read from a 3rd party database using LINQ statements. Unfortunately, at compile time i do not know from which table i will be reading - in fact, new tables can be added to this database after my application is compiled. The table name to read from will be passed as a string parameter to my method.
How should one approach this situation when the table name is not know at compile time? i cannot even add these tables to my data model since they might not yet exist. whilst i like the convenience of linq, i am after a simple approach.
thanks! | 0 |
11,472,063 | 07/13/2012 14:04:03 | 1,318,422 | 04/06/2012 23:47:13 | 8 | 0 | Anyway of using before time function and equal to? | i am using the code below:
endTimeEntryCal2.before(addTimeEntryCale)
to check if user set time is before current time but i also want it to be before or equal to is there anyway of doing this here eg something like before=(); | android | null | null | null | null | null | open | Anyway of using before time function and equal to?
===
i am using the code below:
endTimeEntryCal2.before(addTimeEntryCale)
to check if user set time is before current time but i also want it to be before or equal to is there anyway of doing this here eg something like before=(); | 0 |
11,472,065 | 07/13/2012 14:04:10 | 1,336,654 | 04/16/2012 15:24:04 | 1,261 | 49 | In C#, why can a single cast perform both an unboxing and an enum conversion? | Normally, one would expect, and hope, that **two** casts are needed to first unbox a value type and then perform some kind of value type conversion into another value type. Here's an example where this holds:
// create boxed int
IFormattable box = 42; // box.GetType() == typeof(int)
// unbox and narrow
short x1 = (short)box; // fails runtime :-)
short x2 = (short)(int)box; // OK
// unbox and make unsigned
uint y1 = (uint)box; // fails runtime :-)
uint y2 = (uint)(int)box; // OK
// unbox and widen
long z1 = (long)box; // fails runtime :-)
long z2 = (long)(int)box; // OK (cast to long could be made implicit)
As you can see from my smileys, I'm happy that these conversions will fail if I use only one cast. After all, it's probably a coding mistake to try to unbox a value type into a different value type in one operation.
(There's nothing special with the `IFormattable` interface; you could also use the `object` class if you prefer.)
However, today I realized that this is different with enums (when (and only when) the enums have the same underlying type). Here's an example:
// create boxed DayOfWeek
IFormattable box = DayOfWeek.Monday; // box.GetType() == typeof(DayOfWeek)
// unbox and convert to other
// enum type in one cast
DateTimeKind dtk = (DateTimeKind)box; // succeeds runtime :-(
Console.WriteLine(box); // writes Monday
Console.WriteLine(dtk); // writes Utc
I think this behavior is unfortunate. It should really be compulsory to say `(DateTimeKind)(DayOfWeek)box`. Reading the C# specification, I see no justification of this difference between numeric conversions and enum conversions. It feels like the type safety is lost in this situation.
**Do you think this is "unspecified behavior" that could be improved (without spec changes) in a future .NET version?** It would be a breaking change.
Also, if the supplier of either of the enum types (either `DayOfWeek` or `DateTimeKind` in my example) decides to change the underlying type of one of the enum types from `int` to something else (could be `long`, `short`, ...), then all of a sudden the above one-cast code would stop working, which seems silly.
Of course, the enums `DayOfWeek` and `DateTimeKind` are not special. These could be any enum types, including user-defined ones.
Somewhat related: [Why does unboxing enums yield odd results?](http://stackoverflow.com/questions/4026374/) (unboxes an `int` directly into an enum) | c# | enums | specifications | boxing | type-safety | null | open | In C#, why can a single cast perform both an unboxing and an enum conversion?
===
Normally, one would expect, and hope, that **two** casts are needed to first unbox a value type and then perform some kind of value type conversion into another value type. Here's an example where this holds:
// create boxed int
IFormattable box = 42; // box.GetType() == typeof(int)
// unbox and narrow
short x1 = (short)box; // fails runtime :-)
short x2 = (short)(int)box; // OK
// unbox and make unsigned
uint y1 = (uint)box; // fails runtime :-)
uint y2 = (uint)(int)box; // OK
// unbox and widen
long z1 = (long)box; // fails runtime :-)
long z2 = (long)(int)box; // OK (cast to long could be made implicit)
As you can see from my smileys, I'm happy that these conversions will fail if I use only one cast. After all, it's probably a coding mistake to try to unbox a value type into a different value type in one operation.
(There's nothing special with the `IFormattable` interface; you could also use the `object` class if you prefer.)
However, today I realized that this is different with enums (when (and only when) the enums have the same underlying type). Here's an example:
// create boxed DayOfWeek
IFormattable box = DayOfWeek.Monday; // box.GetType() == typeof(DayOfWeek)
// unbox and convert to other
// enum type in one cast
DateTimeKind dtk = (DateTimeKind)box; // succeeds runtime :-(
Console.WriteLine(box); // writes Monday
Console.WriteLine(dtk); // writes Utc
I think this behavior is unfortunate. It should really be compulsory to say `(DateTimeKind)(DayOfWeek)box`. Reading the C# specification, I see no justification of this difference between numeric conversions and enum conversions. It feels like the type safety is lost in this situation.
**Do you think this is "unspecified behavior" that could be improved (without spec changes) in a future .NET version?** It would be a breaking change.
Also, if the supplier of either of the enum types (either `DayOfWeek` or `DateTimeKind` in my example) decides to change the underlying type of one of the enum types from `int` to something else (could be `long`, `short`, ...), then all of a sudden the above one-cast code would stop working, which seems silly.
Of course, the enums `DayOfWeek` and `DateTimeKind` are not special. These could be any enum types, including user-defined ones.
Somewhat related: [Why does unboxing enums yield odd results?](http://stackoverflow.com/questions/4026374/) (unboxes an `int` directly into an enum) | 0 |
11,472,067 | 07/13/2012 14:04:11 | 1,394,482 | 05/14/2012 18:58:11 | 21 | 0 | How to change a CSS dynamically(Is it possible?) | i need my admin to be able to change/update the banner of my site.
This is the banner code
`<div class="containertop">This depends on the background of the div</div>`
and this is the CSS for that
`.containertop{
width:1000px;
height:300px;
**background:url(../images/1.png) no-repeat center;**
margin: 0 auto;
margin-top: 40px;
}`
what i want to happen is the same as the Facebook cover photo.
When a new banner is uploaded, the css will be updated(something like that).
But of course, the new banner must be fetched from the database.
So i am thinking that the css would become like this:
fetch the saved banner source and then:
`background:url(<?php echo $row['image']; ?>);`
but can i do the PHP connection to database (include 'dbname.php') inside a css txt? | php | javascript | jquery | html | null | null | open | How to change a CSS dynamically(Is it possible?)
===
i need my admin to be able to change/update the banner of my site.
This is the banner code
`<div class="containertop">This depends on the background of the div</div>`
and this is the CSS for that
`.containertop{
width:1000px;
height:300px;
**background:url(../images/1.png) no-repeat center;**
margin: 0 auto;
margin-top: 40px;
}`
what i want to happen is the same as the Facebook cover photo.
When a new banner is uploaded, the css will be updated(something like that).
But of course, the new banner must be fetched from the database.
So i am thinking that the css would become like this:
fetch the saved banner source and then:
`background:url(<?php echo $row['image']; ?>);`
but can i do the PHP connection to database (include 'dbname.php') inside a css txt? | 0 |
11,472,074 | 07/13/2012 14:05:02 | 984,165 | 10/07/2011 14:22:45 | 20 | 0 | MS Word crashes after ListTemplate applied | I'm using Excel 2010 VBA to programmatically generate a Word 2010 document. The program crashes when I attempt to apply a ListTemplate to one of the paragraphs I've inserted (Line 5 in the code below). The error thrown is shown below the code.
thisValue = tempSheet.Cells(i, 1).Value
.Content.InsertAfter thisValue
.Content.InsertParagraphAfter
Set thisRange = .Paragraphs(i).Range
thisRange.ListFormat.ApplyListTemplate ListTemplate:=ListGalleries(wdBulletGallery).ListTemplates(1)
Run-time error "-2147023170 (800706be)"
Automation Error
The remote procedure call failed. | vba | excel-vba | ms-word | word-vba | null | null | open | MS Word crashes after ListTemplate applied
===
I'm using Excel 2010 VBA to programmatically generate a Word 2010 document. The program crashes when I attempt to apply a ListTemplate to one of the paragraphs I've inserted (Line 5 in the code below). The error thrown is shown below the code.
thisValue = tempSheet.Cells(i, 1).Value
.Content.InsertAfter thisValue
.Content.InsertParagraphAfter
Set thisRange = .Paragraphs(i).Range
thisRange.ListFormat.ApplyListTemplate ListTemplate:=ListGalleries(wdBulletGallery).ListTemplates(1)
Run-time error "-2147023170 (800706be)"
Automation Error
The remote procedure call failed. | 0 |
11,472,075 | 07/13/2012 14:05:06 | 787,832 | 06/07/2011 16:12:37 | 307 | 5 | DataTables Error: "Requested unknown parameter" | I'm new to the DataTables.net jquery plugin. After discovering that IE 8 had performance issues with Javascript I decided to change the way I use DataTables to do server side processing. I'm getting this error message when my JSP loads ( I'm using Spring 3 ):
DataTables warning (table id = 'results_table'): Requested unknown parameter '0' from the data source for row 0
I Googled around and found that many causes of that error message come down to malformed JSON so I found a way to output my JSON from my Spring 3 controller function to take a look at the JSON it makes and I changed my code to get it to be pretty close to what the [DataTables.net][1] site says it should look like.
Still no joy, still getting that error message.
The server side processing examples I found for DataTables.net didn't include code for specifying the columns used on the client side, so I assumed I don't need it. Do I?
**Here are the relevant parts of my results.jsp:**
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>ACME: search results in a nice DataTables.net Plugin</title>
</head>
<body>
<link rel="stylesheet" type="text/css" href="css/jquery.dataTables.css" />
<script language = "JavaScript" type = "text/javascript" src = "../nsd/js/jquery-1.7.js"></script>
<script language = "JavaScript" type = "text/javascript" src = "../nsd/js/jquery.dataTables.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#results_table').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sScrollX": "600px",
"sServerMethod": "POST",
"sAjaxSource": "/acme/resultstable",
} );
} );
</script>
<form id="command" name="f" action="employee" method="post">
<div id = "results">
<table id = "results_table">
<thead>
<tr>
<th> </th>
<th>ID</th>
<th>NO_PRINT</th>
<th>Full Name</th>
<th>Email Address</th>
<th>Phone Number</th>
<th>Organization</th>
<th>Organization Code</th>
<th>Position</th>
<th>Employee Type</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</body>
</html>
**Here is the JSON response I've been sending to it:**
{
"sEcho" : 1,
"iTotalRecords" : 1,
"iTotalDisplayRecords" : 1,
"aaData" : [ {
"person_id" : "888888",
"ID" : "999999",
"no_print" : " ",
"fullname" : "Obama, Willard",
"email_address" : "<a href = \"mailto:[email protected]\">[email protected]</a>",
"current_phone_number" : "303-867-5309",
"title" : " ",
"office" : " ",
"position" : "Contractor",
"empl_code" : "CONT"
} ]
}
Here is my Spring controller function I am using to send the JSON response via Jackson. This includes code to output my JSON so I can see what it looks like. Could the JSON it outputs to stdout and what I am sending back to DataTables be different?
@RequestMapping(value = "/resultstable", method = RequestMethod.POST)
public @ResponseBody LinkedHashMap resultstable(ModelMap model,
HttpSession session,
@RequestParam (required=true) int sEcho,
@RequestParam (required=true) int iDisplayStart,
@RequestParam (required=true) int iDisplayLength,
@RequestParam (required=true) int iColumns,
@RequestParam (required=true) int iSortCol_0,
@RequestParam (required=false)String sSortDir_0,
@RequestParam (required=true) String sSearch ) {
/*
**********************************************************************
** These come from the DataTables.net Jquery plugin on results.jsp
**********************************************************************
** sEcho, - just send it back, used by DataTables for synching
** iDisplayStart - index of the record to start with, ie 3 for the 3rd of 100 records
** iDisplayLength - number of records to send back starting with iDisplayStart
** iColumns - number of columns to be displayed in the table
** iSortCol_0 - the number of thee column to be sorted on
** sSortDir_0 - direction of sorting: asc or desc
** sSearch - from the search box, filter results further on this term
**********************************************************************
*/
String nextView = "results";
String usertype = (String)session.getAttribute("usertype");
Search search = new Search(usertype);
List<LinkedHashMap> records = null;
String results = null;
int number_of_records = (Integer)session.getAttribute("number_of_records_found");
ResultsView rv = new ResultsView();
ResultsScreenTableHolder rstrh = null;
SearchScreenDataHolder ssdh2 = (SearchScreenDataHolder)session.getAttribute("search_screen_data_holder");
ObjectMapper mapper = new ObjectMapper();
logger.debug("started");
logger.debug("sEcho, == " + sEcho );
logger.debug("iDisplayStart == " + iDisplayStart );
logger.debug("iDisplayLength == " + iDisplayLength );
logger.debug("iColumns == " + iColumns );
logger.debug("iSortCol_0 == " + iSortCol_0 );
logger.debug("sSortDir_0 == " + sSortDir_0 );
logger.debug("sSearch == " + sSearch );
try {
records = search.searchForAnEmployee(ssdh2,usertype,sSearch,"asc",
iSortCol_0,iDisplayStart,
iDisplayLength);
LinkedHashMap lhm= new java.util.LinkedHashMap();
lhm.put("sEcho", sEcho);
lhm.put("iTotalRecords",number_of_records);
lhm.put("iTotalDisplayRecords",9);
lhm.put("aaData",records);
// convert user object to json string, and save to a file
mapper.writeValue(new File("c:\\Downloads\\rstrh.json.txt"), lhm);
// display to console
logger.debug("My JSON: " + mapper.defaultPrettyPrintingWriter().writeValueAsString(lhm));
}
catch (Exception e) {
logger.debug("\n",e);
}
return lhm;
}// end function
[1]: http://datatables.net/usage/server-side
Thanks in advance for any help resolving this error.
Steve
| json | spring-mvc | jackson | datatables.net | null | null | open | DataTables Error: "Requested unknown parameter"
===
I'm new to the DataTables.net jquery plugin. After discovering that IE 8 had performance issues with Javascript I decided to change the way I use DataTables to do server side processing. I'm getting this error message when my JSP loads ( I'm using Spring 3 ):
DataTables warning (table id = 'results_table'): Requested unknown parameter '0' from the data source for row 0
I Googled around and found that many causes of that error message come down to malformed JSON so I found a way to output my JSON from my Spring 3 controller function to take a look at the JSON it makes and I changed my code to get it to be pretty close to what the [DataTables.net][1] site says it should look like.
Still no joy, still getting that error message.
The server side processing examples I found for DataTables.net didn't include code for specifying the columns used on the client side, so I assumed I don't need it. Do I?
**Here are the relevant parts of my results.jsp:**
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>ACME: search results in a nice DataTables.net Plugin</title>
</head>
<body>
<link rel="stylesheet" type="text/css" href="css/jquery.dataTables.css" />
<script language = "JavaScript" type = "text/javascript" src = "../nsd/js/jquery-1.7.js"></script>
<script language = "JavaScript" type = "text/javascript" src = "../nsd/js/jquery.dataTables.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#results_table').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sScrollX": "600px",
"sServerMethod": "POST",
"sAjaxSource": "/acme/resultstable",
} );
} );
</script>
<form id="command" name="f" action="employee" method="post">
<div id = "results">
<table id = "results_table">
<thead>
<tr>
<th> </th>
<th>ID</th>
<th>NO_PRINT</th>
<th>Full Name</th>
<th>Email Address</th>
<th>Phone Number</th>
<th>Organization</th>
<th>Organization Code</th>
<th>Position</th>
<th>Employee Type</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</body>
</html>
**Here is the JSON response I've been sending to it:**
{
"sEcho" : 1,
"iTotalRecords" : 1,
"iTotalDisplayRecords" : 1,
"aaData" : [ {
"person_id" : "888888",
"ID" : "999999",
"no_print" : " ",
"fullname" : "Obama, Willard",
"email_address" : "<a href = \"mailto:[email protected]\">[email protected]</a>",
"current_phone_number" : "303-867-5309",
"title" : " ",
"office" : " ",
"position" : "Contractor",
"empl_code" : "CONT"
} ]
}
Here is my Spring controller function I am using to send the JSON response via Jackson. This includes code to output my JSON so I can see what it looks like. Could the JSON it outputs to stdout and what I am sending back to DataTables be different?
@RequestMapping(value = "/resultstable", method = RequestMethod.POST)
public @ResponseBody LinkedHashMap resultstable(ModelMap model,
HttpSession session,
@RequestParam (required=true) int sEcho,
@RequestParam (required=true) int iDisplayStart,
@RequestParam (required=true) int iDisplayLength,
@RequestParam (required=true) int iColumns,
@RequestParam (required=true) int iSortCol_0,
@RequestParam (required=false)String sSortDir_0,
@RequestParam (required=true) String sSearch ) {
/*
**********************************************************************
** These come from the DataTables.net Jquery plugin on results.jsp
**********************************************************************
** sEcho, - just send it back, used by DataTables for synching
** iDisplayStart - index of the record to start with, ie 3 for the 3rd of 100 records
** iDisplayLength - number of records to send back starting with iDisplayStart
** iColumns - number of columns to be displayed in the table
** iSortCol_0 - the number of thee column to be sorted on
** sSortDir_0 - direction of sorting: asc or desc
** sSearch - from the search box, filter results further on this term
**********************************************************************
*/
String nextView = "results";
String usertype = (String)session.getAttribute("usertype");
Search search = new Search(usertype);
List<LinkedHashMap> records = null;
String results = null;
int number_of_records = (Integer)session.getAttribute("number_of_records_found");
ResultsView rv = new ResultsView();
ResultsScreenTableHolder rstrh = null;
SearchScreenDataHolder ssdh2 = (SearchScreenDataHolder)session.getAttribute("search_screen_data_holder");
ObjectMapper mapper = new ObjectMapper();
logger.debug("started");
logger.debug("sEcho, == " + sEcho );
logger.debug("iDisplayStart == " + iDisplayStart );
logger.debug("iDisplayLength == " + iDisplayLength );
logger.debug("iColumns == " + iColumns );
logger.debug("iSortCol_0 == " + iSortCol_0 );
logger.debug("sSortDir_0 == " + sSortDir_0 );
logger.debug("sSearch == " + sSearch );
try {
records = search.searchForAnEmployee(ssdh2,usertype,sSearch,"asc",
iSortCol_0,iDisplayStart,
iDisplayLength);
LinkedHashMap lhm= new java.util.LinkedHashMap();
lhm.put("sEcho", sEcho);
lhm.put("iTotalRecords",number_of_records);
lhm.put("iTotalDisplayRecords",9);
lhm.put("aaData",records);
// convert user object to json string, and save to a file
mapper.writeValue(new File("c:\\Downloads\\rstrh.json.txt"), lhm);
// display to console
logger.debug("My JSON: " + mapper.defaultPrettyPrintingWriter().writeValueAsString(lhm));
}
catch (Exception e) {
logger.debug("\n",e);
}
return lhm;
}// end function
[1]: http://datatables.net/usage/server-side
Thanks in advance for any help resolving this error.
Steve
| 0 |
11,471,859 | 07/13/2012 13:51:30 | 1,420,819 | 05/28/2012 02:00:59 | 1 | 0 | .htaccess multiple php handlers based on URL - fatfree framework multiple route files | I'm a bit of a noob when it comes to htaccess files, so I need some assistance.
I'm using PHP's fatfree framework (f3), and have modified its htaccess file to suit my needs, until now.
What I'm looking to do is split up/organize fatfree's routing system... so not all routes live in one PHP file.
Here's what I'm hoping to achieve.
1. URLS that contain /api/* to get handled by /api/index.php.
2. URLS that contain /auth/* to get handled by /auth/index.php
3. Any other URL's outside of the above 2 to get handled by /index.php.
With the following .htaccess file, I've been able to achieve #1 & #2 above. #3, not too sure about.
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^api/.* api/index.php [L,QSA]
RewriteRule ^auth/.* auth/index.php [L,QSA]
Any tips are appreciated! | php | apache | .htaccess | fat-free-framework | null | null | open | .htaccess multiple php handlers based on URL - fatfree framework multiple route files
===
I'm a bit of a noob when it comes to htaccess files, so I need some assistance.
I'm using PHP's fatfree framework (f3), and have modified its htaccess file to suit my needs, until now.
What I'm looking to do is split up/organize fatfree's routing system... so not all routes live in one PHP file.
Here's what I'm hoping to achieve.
1. URLS that contain /api/* to get handled by /api/index.php.
2. URLS that contain /auth/* to get handled by /auth/index.php
3. Any other URL's outside of the above 2 to get handled by /index.php.
With the following .htaccess file, I've been able to achieve #1 & #2 above. #3, not too sure about.
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^api/.* api/index.php [L,QSA]
RewriteRule ^auth/.* auth/index.php [L,QSA]
Any tips are appreciated! | 0 |
11,471,862 | 07/13/2012 13:51:36 | 1,252,768 | 03/06/2012 16:48:29 | 14 | 0 | MVC 3 - unobtrusive clientside validation of a list | I previously asked this question on stackoverflow:- http://stackoverflow.com/questions/11458790/mvc-3-validating-values-on-multiple-rows
The basic scenario was the ability total up all the Quantity values for every row in a List grouped by the GroupNo field. If the sum of any of the groups was more than 10 then an error should be displayed.
I was kindly given an answer in the previous post which works perfectly. Here it is...
The model:
public class ItemDetails
{
public int SerialNo { get; set; }
public string Description { get; set; }
public int GroupNo { get; set; }
public decimal Price { get; set; }
public int Quantity { get; set; }
}
public class MyViewModel
{
[EnsureMaxGroupItems(10, ErrorMessage = "You cannot have more than 10 items in each group")]
public IList<ItemDetails> Items { get; set; }
}
and the validation attribute itself:
[AttributeUsage(AttributeTargets.Property)]
public class EnsureMaxGroupItemsAttribute : ValidationAttribute
{
public int MaxItems { get; private set; }
public EnsureMaxGroupItemsAttribute(int maxItems)
{
MaxItems = maxItems;
}
public override bool IsValid(object value)
{
var items = value as IEnumerable<ItemDetails>;
if (items == null)
{
return true;
}
return items
.GroupBy(x => x.GroupNo)
.Select(g => g.Sum(x => x.Quantity))
.All(quantity => quantity <= MaxItems);
}
}
and finally your controller actions will work with the view model:
public ActionResult ListItems()
{
var model = new MyViewModel
{
Items = ItemsRepository.GetItems()
};
return View(model);
}
[HttpPost]
public ActionResult ListItems(MyViewModel model)
{
if (!ModelState.IsValid)
{
return View(model);
}
...
}
and next the corresponding strongly typed view:
@model MyViewModel
@Html.ValidationSummary()
@using (Html.BeginForm())
{
@Html.EditorFor(x => x.Items)
<button type="submit">Go go go</button>
}
and the last bit is the corresponding editor template that will automatically be rendered for each element of the Items collection so that you don't even need to write for loops (`~/Views/Shared/EditorTemplates/ItemDetails.cshtml`):
@model ItemDetails
@Html.HiddenFor(x => x.SerialNo)
@Html.LabelFor(x => x.Description)
@Html.HiddenFor(x => x.GroupNo)
@Html.LabelFor(x => x.Price)
@Html.TextBoxFor(x => x.Quantity)
**The new problem**
As well as server-side validation I would like this to work client-side. I have written the jQuery to perform this and it works. However as well as this List level validation I will have additional property level validation. For example let's assume I also have a Required attribute on the Quantity field.
I would like it all to validate using unobtrusive MVC validation. But I cannot figure out how to unobtrusively validate the EnsureMaxGroupItemsAttribute attribute against the list as a whole.
I've implemented IClientValidatable in this way:
Public Function GetClientValidationRules(metadata As System.Web.Mvc.ModelMetadata, context As System.Web.Mvc.ControllerContext) As System.Collections.Generic.IEnumerable(Of System.Web.Mvc.ModelClientValidationRule) Implements System.Web.Mvc.IClientValidatable.GetClientValidationRules
Dim result = New List(Of ModelClientValidationRule)
Dim rule = New ModelClientValidationRule() With { _
.ErrorMessage = "You cannot have more than 10 items in each group", _
.ValidationType = "itemscheck"}
result.Add(rule)
Return result
End Function
I've created the adaptor in my JS file:
jQuery.validator.unobtrusive.adapters.addBool("itemscheck");
... and ...
jQuery.validator.addMethod("itemscheck", function (value, element, params) {
// The check has been omitted for the sake of saving space. However this method never gets called
return false;
});
Is there a way to hook this up to work unobtrusively?
| asp.net-mvc-3 | unobtrusive-validation | null | null | null | null | open | MVC 3 - unobtrusive clientside validation of a list
===
I previously asked this question on stackoverflow:- http://stackoverflow.com/questions/11458790/mvc-3-validating-values-on-multiple-rows
The basic scenario was the ability total up all the Quantity values for every row in a List grouped by the GroupNo field. If the sum of any of the groups was more than 10 then an error should be displayed.
I was kindly given an answer in the previous post which works perfectly. Here it is...
The model:
public class ItemDetails
{
public int SerialNo { get; set; }
public string Description { get; set; }
public int GroupNo { get; set; }
public decimal Price { get; set; }
public int Quantity { get; set; }
}
public class MyViewModel
{
[EnsureMaxGroupItems(10, ErrorMessage = "You cannot have more than 10 items in each group")]
public IList<ItemDetails> Items { get; set; }
}
and the validation attribute itself:
[AttributeUsage(AttributeTargets.Property)]
public class EnsureMaxGroupItemsAttribute : ValidationAttribute
{
public int MaxItems { get; private set; }
public EnsureMaxGroupItemsAttribute(int maxItems)
{
MaxItems = maxItems;
}
public override bool IsValid(object value)
{
var items = value as IEnumerable<ItemDetails>;
if (items == null)
{
return true;
}
return items
.GroupBy(x => x.GroupNo)
.Select(g => g.Sum(x => x.Quantity))
.All(quantity => quantity <= MaxItems);
}
}
and finally your controller actions will work with the view model:
public ActionResult ListItems()
{
var model = new MyViewModel
{
Items = ItemsRepository.GetItems()
};
return View(model);
}
[HttpPost]
public ActionResult ListItems(MyViewModel model)
{
if (!ModelState.IsValid)
{
return View(model);
}
...
}
and next the corresponding strongly typed view:
@model MyViewModel
@Html.ValidationSummary()
@using (Html.BeginForm())
{
@Html.EditorFor(x => x.Items)
<button type="submit">Go go go</button>
}
and the last bit is the corresponding editor template that will automatically be rendered for each element of the Items collection so that you don't even need to write for loops (`~/Views/Shared/EditorTemplates/ItemDetails.cshtml`):
@model ItemDetails
@Html.HiddenFor(x => x.SerialNo)
@Html.LabelFor(x => x.Description)
@Html.HiddenFor(x => x.GroupNo)
@Html.LabelFor(x => x.Price)
@Html.TextBoxFor(x => x.Quantity)
**The new problem**
As well as server-side validation I would like this to work client-side. I have written the jQuery to perform this and it works. However as well as this List level validation I will have additional property level validation. For example let's assume I also have a Required attribute on the Quantity field.
I would like it all to validate using unobtrusive MVC validation. But I cannot figure out how to unobtrusively validate the EnsureMaxGroupItemsAttribute attribute against the list as a whole.
I've implemented IClientValidatable in this way:
Public Function GetClientValidationRules(metadata As System.Web.Mvc.ModelMetadata, context As System.Web.Mvc.ControllerContext) As System.Collections.Generic.IEnumerable(Of System.Web.Mvc.ModelClientValidationRule) Implements System.Web.Mvc.IClientValidatable.GetClientValidationRules
Dim result = New List(Of ModelClientValidationRule)
Dim rule = New ModelClientValidationRule() With { _
.ErrorMessage = "You cannot have more than 10 items in each group", _
.ValidationType = "itemscheck"}
result.Add(rule)
Return result
End Function
I've created the adaptor in my JS file:
jQuery.validator.unobtrusive.adapters.addBool("itemscheck");
... and ...
jQuery.validator.addMethod("itemscheck", function (value, element, params) {
// The check has been omitted for the sake of saving space. However this method never gets called
return false;
});
Is there a way to hook this up to work unobtrusively?
| 0 |
11,650,709 | 07/25/2012 13:22:17 | 17,758 | 09/18/2008 14:33:23 | 102 | 4 | Autowiring bean - eclipse debug is null | I have come across a project that will allow me to learn spring mvc. i want a session bean (User) to be autowired into the controller (ChatController). the below code example appears to do that, however when i set a breakpoint i notice that all attributes of User remain null. The printlns, however, print the first name as expected.
Any idea what i'm doing incorrectly?
ChatController
@Controller
public class ChatController {
@Autowired
private User user;
@RequestMapping(value="/chat")
public ModelAndView start()
{
System.out.println("pre" + user.getFirstName());
user.setFirstName(user.getFirstName() + " foo");
System.out.println("post"+user.getFirstName());
return new ModelAndView("/WEB-INF/views/error.jsp");
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
}
User
@Component("user")
@Scope(value="session")
public class User {
private String firstName;
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
}
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>ContactUs</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>springServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/spring-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
spring-context.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
">
<context:component-scan base-package="com" scoped-proxy="targetClass" />
<mvc:annotation-driven />
<context:annotation-config/>
<!-- <bean id="user" class="User" scope="session" autowire="byName">
<aop:scoped-proxy/>
</bean>
-->
</beans>
| spring | spring-mvc | null | null | null | null | open | Autowiring bean - eclipse debug is null
===
I have come across a project that will allow me to learn spring mvc. i want a session bean (User) to be autowired into the controller (ChatController). the below code example appears to do that, however when i set a breakpoint i notice that all attributes of User remain null. The printlns, however, print the first name as expected.
Any idea what i'm doing incorrectly?
ChatController
@Controller
public class ChatController {
@Autowired
private User user;
@RequestMapping(value="/chat")
public ModelAndView start()
{
System.out.println("pre" + user.getFirstName());
user.setFirstName(user.getFirstName() + " foo");
System.out.println("post"+user.getFirstName());
return new ModelAndView("/WEB-INF/views/error.jsp");
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
}
User
@Component("user")
@Scope(value="session")
public class User {
private String firstName;
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
}
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>ContactUs</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>springServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/spring-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
spring-context.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
">
<context:component-scan base-package="com" scoped-proxy="targetClass" />
<mvc:annotation-driven />
<context:annotation-config/>
<!-- <bean id="user" class="User" scope="session" autowire="byName">
<aop:scoped-proxy/>
</bean>
-->
</beans>
| 0 |
11,650,655 | 07/25/2012 13:19:44 | 951,389 | 09/18/2011 16:09:42 | 1 | 0 | createObjectURL() can't be found in either IE or Firefox | In Javascript, I am trying to generate a URL for an image stored as an array of bytes so I can generate an <IMG> tag for it. However, no matter what I try, createObjectURL(blob) always seems to throw some sort of "method not recognized" exception. I have tried window.URL.createObjectURL, window.webkitURL.createObjectURL, and straightforward window.createObjectURL (and yes, I realize that different browsers will need different versions, and I even tried mozURL at some point).
This happens with IE 8.0.7601 and Firefox 14.0.1. Does createObjectURL exist in these releases, and if so, in what libraries? | javascript | null | null | null | null | null | open | createObjectURL() can't be found in either IE or Firefox
===
In Javascript, I am trying to generate a URL for an image stored as an array of bytes so I can generate an <IMG> tag for it. However, no matter what I try, createObjectURL(blob) always seems to throw some sort of "method not recognized" exception. I have tried window.URL.createObjectURL, window.webkitURL.createObjectURL, and straightforward window.createObjectURL (and yes, I realize that different browsers will need different versions, and I even tried mozURL at some point).
This happens with IE 8.0.7601 and Firefox 14.0.1. Does createObjectURL exist in these releases, and if so, in what libraries? | 0 |
11,650,656 | 07/25/2012 13:19:48 | 1,548,646 | 07/24/2012 12:11:13 | 38 | 1 | beanstalk beanstalk misconfigured | I deployed a war file into the elastic beanstalk but i keep getting this error, health check URL misconfigured and my environment is set to red. Please help in resolving this issue as I am new to AWS. I gave my applications first html page as the URL for health checkup. Is there anything missing? Please help
thanks | web-services | amazon-web-services | beanstalk | null | null | null | open | beanstalk beanstalk misconfigured
===
I deployed a war file into the elastic beanstalk but i keep getting this error, health check URL misconfigured and my environment is set to red. Please help in resolving this issue as I am new to AWS. I gave my applications first html page as the URL for health checkup. Is there anything missing? Please help
thanks | 0 |
11,650,713 | 07/25/2012 13:22:25 | 1,551,682 | 07/25/2012 12:57:49 | 1 | 0 | codeigniter mod_rewrite | I'm trying to set up some routing rules for my web application which I am developing with CodeIgniter.
I've come face to face with a rather strange mod_rewrite/Codeigniter issue and hope that someone could help me resolve it.
I'm using the following rewrite rule in my .htaccess file:
RewriteCond $1 (^profile$)
RewriteRule ^(.*)$ /user/$1 [L,NC]
What this is supposed to do is redirect all requests to http://example.com/profile to http://example.com/user/profile, but there is a problem:
I also have the rule to remove index.php from codeigniter URIs:
RewriteCond $1 !^(index\.php|images|captcha|css|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L,NC]
If I request /user/profile, it works just fine and displays the page. But if I request just /profile, CodeIgniter spits out a 404.
I'm using RewriteLog to debug the rewrite rules, and have confirmed that in both requests, the final internal redirect is identical:
internal redirect with /index.php/user/profile [INTERNAL REDIRECT]
When adding the [R] flag to the rewrite rule and requesting /profile, it successfully redirects to /user/profile and displays the page, but with an internal redirect it always spits out a 404.
Any help would be greatly appreciated, as this issue has had me stumped for hours.
Thank you!
| .htaccess | codeigniter | mod-rewrite | url-routing | null | null | open | codeigniter mod_rewrite
===
I'm trying to set up some routing rules for my web application which I am developing with CodeIgniter.
I've come face to face with a rather strange mod_rewrite/Codeigniter issue and hope that someone could help me resolve it.
I'm using the following rewrite rule in my .htaccess file:
RewriteCond $1 (^profile$)
RewriteRule ^(.*)$ /user/$1 [L,NC]
What this is supposed to do is redirect all requests to http://example.com/profile to http://example.com/user/profile, but there is a problem:
I also have the rule to remove index.php from codeigniter URIs:
RewriteCond $1 !^(index\.php|images|captcha|css|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L,NC]
If I request /user/profile, it works just fine and displays the page. But if I request just /profile, CodeIgniter spits out a 404.
I'm using RewriteLog to debug the rewrite rules, and have confirmed that in both requests, the final internal redirect is identical:
internal redirect with /index.php/user/profile [INTERNAL REDIRECT]
When adding the [R] flag to the rewrite rule and requesting /profile, it successfully redirects to /user/profile and displays the page, but with an internal redirect it always spits out a 404.
Any help would be greatly appreciated, as this issue has had me stumped for hours.
Thank you!
| 0 |
11,650,714 | 07/25/2012 13:22:31 | 1,392,501 | 05/13/2012 18:45:02 | 4 | 0 | Login system in JSP, what "sessionListners", "servletFilter", and "contextListeners" may I need? | i'm working on sending sms project
in order to build an efficient login system in JSP, beside the main functionality
i will to use "session listener" as "activeUsersListener" to trace all active users
what other session listeners i may need "activeUsers","loggedOutUsers" ?
what servlet filters i may need "fileFilter","pageFilter" ?
and what context listners i may need "sentMessage" ?
| java | jsp | session | login | servlet-listeners | null | open | Login system in JSP, what "sessionListners", "servletFilter", and "contextListeners" may I need?
===
i'm working on sending sms project
in order to build an efficient login system in JSP, beside the main functionality
i will to use "session listener" as "activeUsersListener" to trace all active users
what other session listeners i may need "activeUsers","loggedOutUsers" ?
what servlet filters i may need "fileFilter","pageFilter" ?
and what context listners i may need "sentMessage" ?
| 0 |
11,650,699 | 07/25/2012 13:21:59 | 1,185,854 | 02/02/2012 18:28:33 | 36 | 8 | OpenGL: Does glBindTexture() require a GLuint pointer? (v8/JavaScript) | I'm trying to implement OpenGL bindings for Texture usage in OpenGL/V8/JavaScript.
**My question is pretty simple:**
Does OpenGL's glBindTexture() method require a pointer to a GLuint or does it only require a valid GLuint?
The khronos docs here says it only requires a GLuint.
http://www.khronos.org/opengles/documentation/opengles1_0/html/glBindTexture.html
**The problem is the following:**
I'm having a custom data type in v8 (new Texture(url)) that is used for initializing and loading the textures. After loading, the textures were generated via:
GLuint texture;
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, (GLvoid*) image_data);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
So this method returns the GLuint from the c++ side and attaches the casted Integer value (float due to JavaScript having nothing like typedef int/uint) to an object in the JavaScript context:
var texture = new Texture('./texture.png');
gl.bindTexture(gl.TEXTURE_2D, texture.id); // this is the casted v8::Integer value
When using the bindTexture method on the global gl (namespace) object in v8, it does the following on the native side:
v8::Handle<v8::Value> GLglBindTextureCallback(const v8::Arguments& args) {
// blabla...
int arg0 = args[0]->IntegerValue();
unsigned int arg1 = args[1]->Uint32Value();
glBindTexture((GLenum) arg0, (GLuint) arg1);
// ... blabla
}
Thanks for helping!
~Cheers, Chris | javascript | c++ | opengl | v8 | embedded-v8 | null | open | OpenGL: Does glBindTexture() require a GLuint pointer? (v8/JavaScript)
===
I'm trying to implement OpenGL bindings for Texture usage in OpenGL/V8/JavaScript.
**My question is pretty simple:**
Does OpenGL's glBindTexture() method require a pointer to a GLuint or does it only require a valid GLuint?
The khronos docs here says it only requires a GLuint.
http://www.khronos.org/opengles/documentation/opengles1_0/html/glBindTexture.html
**The problem is the following:**
I'm having a custom data type in v8 (new Texture(url)) that is used for initializing and loading the textures. After loading, the textures were generated via:
GLuint texture;
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, (GLvoid*) image_data);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
So this method returns the GLuint from the c++ side and attaches the casted Integer value (float due to JavaScript having nothing like typedef int/uint) to an object in the JavaScript context:
var texture = new Texture('./texture.png');
gl.bindTexture(gl.TEXTURE_2D, texture.id); // this is the casted v8::Integer value
When using the bindTexture method on the global gl (namespace) object in v8, it does the following on the native side:
v8::Handle<v8::Value> GLglBindTextureCallback(const v8::Arguments& args) {
// blabla...
int arg0 = args[0]->IntegerValue();
unsigned int arg1 = args[1]->Uint32Value();
glBindTexture((GLenum) arg0, (GLuint) arg1);
// ... blabla
}
Thanks for helping!
~Cheers, Chris | 0 |
11,650,700 | 07/25/2012 13:21:59 | 1,385,385 | 05/09/2012 18:34:05 | 165 | 4 | BeautifulSoup does not work for some web sites | I have this sript:
import urrlib2
from bs4 import BeautifulSoup
url = "http://www.shoptop.ru/"
page = urllib2.urlopen(url).read()
soup = BeautifulSoup(page)
divs = soup.findAll('a')
print divs
For [this][1] web site, it prints empty list? What can be problem? I am running on Ubuntu 12.04
[1]: http://www.shoptop.ru | python | web-crawler | web-scraping | beautifulsoup | null | null | open | BeautifulSoup does not work for some web sites
===
I have this sript:
import urrlib2
from bs4 import BeautifulSoup
url = "http://www.shoptop.ru/"
page = urllib2.urlopen(url).read()
soup = BeautifulSoup(page)
divs = soup.findAll('a')
print divs
For [this][1] web site, it prints empty list? What can be problem? I am running on Ubuntu 12.04
[1]: http://www.shoptop.ru | 0 |
11,650,716 | 07/25/2012 13:22:33 | 1,267,125 | 03/13/2012 17:27:44 | 430 | 2 | Why does Java's `indexOf` return negative numbers other than (-1) | I have a multi-line text input file: If the String "Log Number:" is present, it is immediately followed by a log number. If the String "Log Number:" is not present, there is no log number in that record. There is ALWAYS the String "Log Date:". It follows "Log Number:" if present and appears at that position in the file if it does not.
My `inputLine` comes out of a `BufferedReader` that's reading my file line-by-line.
...
if((inputLine.indexOf("Log Number:"))>-1) {
logNumRecStart = inputLine.indexOf("Log Number:")+12;}
else
logNumRecStart = 0;
logNumRecEnd = inputLine.indexOf("Log Date:");
...
logNumber = inputLine.substring(logNumRecStart,logNumRecEnd);
...
and when I output the Start and End indeces, here's a sample of what I get.
49>>> -0 to 357
50>>> -0 to 361
51>>> -0 to 384
52>>> -371 to 390
53>>> -315 to 334
54>>> -325 to 352
Records 49-51 are cases where "Log Number:" does not appear in the input line, and as expected, `logNumRecStart` is set to 0. Records 52 - 54 *do* include "Log Number:", but the index is being set to a negative number, resulting in my substring getting an out-of-bounds exception. Visually inspecting the file demonstrated the presence (or absence) of the test values in the appropriate lines. My `logNumRecEnd` value is correct in ALL cases.
By counting characters in the source file for `inputLine`, I've verified that if the negative value of `logNumRecStart` were POSITIVE, it'd be the correct number.
I'm not using `lastIndexOf` so I have no idea why I'm getting the negative values. Can anyone see something I'm missing or soemthing I need to check that I've not mentioned? | java | indexof | null | null | null | null | open | Why does Java's `indexOf` return negative numbers other than (-1)
===
I have a multi-line text input file: If the String "Log Number:" is present, it is immediately followed by a log number. If the String "Log Number:" is not present, there is no log number in that record. There is ALWAYS the String "Log Date:". It follows "Log Number:" if present and appears at that position in the file if it does not.
My `inputLine` comes out of a `BufferedReader` that's reading my file line-by-line.
...
if((inputLine.indexOf("Log Number:"))>-1) {
logNumRecStart = inputLine.indexOf("Log Number:")+12;}
else
logNumRecStart = 0;
logNumRecEnd = inputLine.indexOf("Log Date:");
...
logNumber = inputLine.substring(logNumRecStart,logNumRecEnd);
...
and when I output the Start and End indeces, here's a sample of what I get.
49>>> -0 to 357
50>>> -0 to 361
51>>> -0 to 384
52>>> -371 to 390
53>>> -315 to 334
54>>> -325 to 352
Records 49-51 are cases where "Log Number:" does not appear in the input line, and as expected, `logNumRecStart` is set to 0. Records 52 - 54 *do* include "Log Number:", but the index is being set to a negative number, resulting in my substring getting an out-of-bounds exception. Visually inspecting the file demonstrated the presence (or absence) of the test values in the appropriate lines. My `logNumRecEnd` value is correct in ALL cases.
By counting characters in the source file for `inputLine`, I've verified that if the negative value of `logNumRecStart` were POSITIVE, it'd be the correct number.
I'm not using `lastIndexOf` so I have no idea why I'm getting the negative values. Can anyone see something I'm missing or soemthing I need to check that I've not mentioned? | 0 |
11,650,723 | 07/25/2012 13:23:08 | 831,219 | 07/06/2011 09:02:54 | 322 | 18 | Costs of reading data in transaction on SQL Server | I am copying some data from sql server to firebird over the network. Because of integrity I need to use transactions, but I am transferring about 9k of rows. Has reading in opened transaction some negative influence on reading costs, against reading in non transaction mode? | sql-server | transactions | null | null | null | null | open | Costs of reading data in transaction on SQL Server
===
I am copying some data from sql server to firebird over the network. Because of integrity I need to use transactions, but I am transferring about 9k of rows. Has reading in opened transaction some negative influence on reading costs, against reading in non transaction mode? | 0 |
11,650,291 | 07/25/2012 12:59:44 | 1,131,926 | 01/05/2012 10:48:53 | 23 | 1 | update modelobject in a controller | I am trying to update user in my model object
public ActionResult AddJob(JobQueue job,HttpPostedFileBase file)
{
job.User = "itdev";
TryUpdateModel(job)
if (ModelState.IsValid)//Always returns false
{
}
}
I tried using TryUpdateModel(job) and UpdateModel(job) after assigning the values.Both of these does not seem to update the model because ModelState.IsValid return false.Can someone point me in the right directions?I am using MVC3
Thanks,
Sab | asp.net-mvc-3 | c#-4.0 | asp.net-mvc-controller | null | null | null | open | update modelobject in a controller
===
I am trying to update user in my model object
public ActionResult AddJob(JobQueue job,HttpPostedFileBase file)
{
job.User = "itdev";
TryUpdateModel(job)
if (ModelState.IsValid)//Always returns false
{
}
}
I tried using TryUpdateModel(job) and UpdateModel(job) after assigning the values.Both of these does not seem to update the model because ModelState.IsValid return false.Can someone point me in the right directions?I am using MVC3
Thanks,
Sab | 0 |
11,373,139 | 07/07/2012 07:27:07 | 1,508,387 | 07/07/2012 07:09:18 | 1 | 0 | C++ class object pointers and accessing member functions | I'm bit new to C++ and try to work things with Qt and came across this confusing thing:
The concepts on various tutorials state something like:
`Class *obj;`
*obj - will display the value of object stored at the referenced memory
obj - will be address of memory to which it is pointing
1.
so, i'll would do something like
*obj=new Class();
but if i want to access a function, i have to do obj->function1();
instead of *obj->function1();
-- not sure why, since with normal objects [ normalObj.function1();] would work,since thats the value directly.
So, for pointer objects why do we use memory reference to access the function,
or is it that in case of normal objects also, its always references
P.S: Can someone guide me to a good tutorial of usage of pointers in C++, so that my queries like these can be directly addressed in it.
| c++ | class | object | pointers | null | null | open | C++ class object pointers and accessing member functions
===
I'm bit new to C++ and try to work things with Qt and came across this confusing thing:
The concepts on various tutorials state something like:
`Class *obj;`
*obj - will display the value of object stored at the referenced memory
obj - will be address of memory to which it is pointing
1.
so, i'll would do something like
*obj=new Class();
but if i want to access a function, i have to do obj->function1();
instead of *obj->function1();
-- not sure why, since with normal objects [ normalObj.function1();] would work,since thats the value directly.
So, for pointer objects why do we use memory reference to access the function,
or is it that in case of normal objects also, its always references
P.S: Can someone guide me to a good tutorial of usage of pointers in C++, so that my queries like these can be directly addressed in it.
| 0 |
11,373,140 | 07/07/2012 07:27:08 | 741,404 | 05/06/2011 08:54:23 | 578 | 23 | converting list to tuple | I have few command-line options (5 for example) and I want to convert them to tuple. The problem is that I expect them to appear in correct order, so tuple can be easily built from list using pattern-match, but in real life options can be provided in random order, so I don't know if head of the list contain Verbose option or log file name?
I tried to think how to do that using continuation-passing style, however nothing useful comes into my mind.
Is that ever possible?
I think that I can "sort" the list to have it in predicted order, but it does not look good.
Also I could get rid of the tuple and create data record - however that will still lead up to checking the type of attribute and set the correct field of the record. Still a lot of typing. | list | haskell | tuples | cps | null | null | open | converting list to tuple
===
I have few command-line options (5 for example) and I want to convert them to tuple. The problem is that I expect them to appear in correct order, so tuple can be easily built from list using pattern-match, but in real life options can be provided in random order, so I don't know if head of the list contain Verbose option or log file name?
I tried to think how to do that using continuation-passing style, however nothing useful comes into my mind.
Is that ever possible?
I think that I can "sort" the list to have it in predicted order, but it does not look good.
Also I could get rid of the tuple and create data record - however that will still lead up to checking the type of attribute and set the correct field of the record. Still a lot of typing. | 0 |
11,373,144 | 07/07/2012 07:27:23 | 1,506,363 | 07/06/2012 09:51:01 | 1 | 0 | Put UILabel text inside a tooltip-like UIImage | I have searching various ways to put text on an image. I tried things like [this][1] already, but it shows label as separate object along with image.
I want that text is just on the image (something like transparent label with just its text visible, but I don't know how objective C does it).
This is because the image I am talking about is a custom tooltip, and the text is variable, so I can't statically put it there.
[1]: http://stackoverflow.com/questions/8497311/uiimageview-only-displays-when-i-call-initwithimage | uiimageview | uiimage | uilabel | null | null | null | open | Put UILabel text inside a tooltip-like UIImage
===
I have searching various ways to put text on an image. I tried things like [this][1] already, but it shows label as separate object along with image.
I want that text is just on the image (something like transparent label with just its text visible, but I don't know how objective C does it).
This is because the image I am talking about is a custom tooltip, and the text is variable, so I can't statically put it there.
[1]: http://stackoverflow.com/questions/8497311/uiimageview-only-displays-when-i-call-initwithimage | 0 |
11,373,146 | 07/07/2012 07:27:29 | 629,127 | 02/22/2011 21:28:54 | 162 | 1 | Drawing cubic lattice in Python | So I want to draw a simple cubic lattice in Python using visual package.
I have a simple way of making a lattice with small spheres which all have the same color, but I want the colors to alternate: to make NaCl lattice I need to have a sphere of one color surrounded by 6 spheres of other color.
So I did this:
from __future__ import division
from visual import sphere,color
L = 5
R = 0.3
even = []
odd = []
for i in range(-L,L+1):
if i%2==0:
even.append(i)
else:
odd.append(i)
for i in even:
for j in even:
for k in even:
sphere(pos=[i,j+1,k+1],radius=R,color=color.green)
for i in odd:
for j in odd:
for k in odd:
sphere(pos=[i,j,k],radius=R,color=color.yellow)
And I get spheres of one color next to speres of different color, but they are in rows:
![lattice][1]
But I need them to alternate :\ The correct placement is only in the i direction. How do I correct the others to make a simple cubic lattice? I tried fiddling with the positions of the spheres (i,j,k+-number), but that way I got bcc lattice (one green sphere in the middle, others around it).
I'm stuck...
[1]: http://i.stack.imgur.com/q3AWk.png | python | drawing | null | null | null | null | open | Drawing cubic lattice in Python
===
So I want to draw a simple cubic lattice in Python using visual package.
I have a simple way of making a lattice with small spheres which all have the same color, but I want the colors to alternate: to make NaCl lattice I need to have a sphere of one color surrounded by 6 spheres of other color.
So I did this:
from __future__ import division
from visual import sphere,color
L = 5
R = 0.3
even = []
odd = []
for i in range(-L,L+1):
if i%2==0:
even.append(i)
else:
odd.append(i)
for i in even:
for j in even:
for k in even:
sphere(pos=[i,j+1,k+1],radius=R,color=color.green)
for i in odd:
for j in odd:
for k in odd:
sphere(pos=[i,j,k],radius=R,color=color.yellow)
And I get spheres of one color next to speres of different color, but they are in rows:
![lattice][1]
But I need them to alternate :\ The correct placement is only in the i direction. How do I correct the others to make a simple cubic lattice? I tried fiddling with the positions of the spheres (i,j,k+-number), but that way I got bcc lattice (one green sphere in the middle, others around it).
I'm stuck...
[1]: http://i.stack.imgur.com/q3AWk.png | 0 |
11,373,116 | 07/07/2012 07:22:52 | 1,481,713 | 06/26/2012 05:22:46 | 54 | 1 | Remove next row cell if rowspan is found | <table id="mytable" runat="server" bgcolor="gray">
<tr class="csstablelisttd">
<td>
</td>
<td class="csstdgreen">
30
</td>
<td class="csstdgreen" rowspan="3">
<span>john</span>
</td>
</tr>
<tr class="csstablelisttd">
<td>
</td>
<td class="csstdgreen">
45
</td>
<td>Remove me</td>
</tr>
<tr class="csstablelisttd">
<td>
09:00
</td>
<td class="csstdgreen">
00
</td>
<td>Remove me</td>
</tr>
</table>
//i have to loop through table in every tr if td have csstdgreen and have attribute rowspan.
//i have to remove cell have text Remove Me//i have to loop through table in every tr if td have csstdgreen and have attribute rowspan.
//i have to remove cell have text Remove Me
function clearTable()
{
if ($("tr").has("td.csstdhighlight").length > 0)
{
if ($('td[rowSpan]') == 1 || $('td[rowSpan]') == 2 || $('td[rowSpan]') == 3)
{
var $this = $(this);
var i = $this.index();
}
}
}
| jquery | html | css | null | null | null | open | Remove next row cell if rowspan is found
===
<table id="mytable" runat="server" bgcolor="gray">
<tr class="csstablelisttd">
<td>
</td>
<td class="csstdgreen">
30
</td>
<td class="csstdgreen" rowspan="3">
<span>john</span>
</td>
</tr>
<tr class="csstablelisttd">
<td>
</td>
<td class="csstdgreen">
45
</td>
<td>Remove me</td>
</tr>
<tr class="csstablelisttd">
<td>
09:00
</td>
<td class="csstdgreen">
00
</td>
<td>Remove me</td>
</tr>
</table>
//i have to loop through table in every tr if td have csstdgreen and have attribute rowspan.
//i have to remove cell have text Remove Me//i have to loop through table in every tr if td have csstdgreen and have attribute rowspan.
//i have to remove cell have text Remove Me
function clearTable()
{
if ($("tr").has("td.csstdhighlight").length > 0)
{
if ($('td[rowSpan]') == 1 || $('td[rowSpan]') == 2 || $('td[rowSpan]') == 3)
{
var $this = $(this);
var i = $this.index();
}
}
}
| 0 |
11,373,153 | 07/07/2012 07:28:24 | 938,350 | 09/10/2011 16:03:36 | 1,310 | 91 | How to set a background image in full size of a div that doesn't fill page | i need to put an image in background of a div at the center position of it, like:
![Example][1]
What i've tried is:
<div id="container">
...
</div
<div id="background">
<img src="images/bg.png"/>
</div>
with this css:
div#container {
margin: 0 auto;
width: 52em;
}
div#bg img {
z-index: -999;
width: 100%;
height: 100%;
position: absolute;
top: 22%;
}
In my browser, with my screen size, i put 22% and all is ok, but if i try on another screen with different size background img isn't in the center of div. What can i do? can someonehelp me?
[1]: http://i.stack.imgur.com/sLIEL.png | html | css | div | background-image | img | null | open | How to set a background image in full size of a div that doesn't fill page
===
i need to put an image in background of a div at the center position of it, like:
![Example][1]
What i've tried is:
<div id="container">
...
</div
<div id="background">
<img src="images/bg.png"/>
</div>
with this css:
div#container {
margin: 0 auto;
width: 52em;
}
div#bg img {
z-index: -999;
width: 100%;
height: 100%;
position: absolute;
top: 22%;
}
In my browser, with my screen size, i put 22% and all is ok, but if i try on another screen with different size background img isn't in the center of div. What can i do? can someonehelp me?
[1]: http://i.stack.imgur.com/sLIEL.png | 0 |
11,373,160 | 07/07/2012 07:29:42 | 1,226,223 | 02/22/2012 15:34:24 | 36 | 2 | jQuery ajaxSubmit() API issue with 'iframe: true' | I am using [jQuery Form Plugin][1] to make an ajax call and target the response to an iFrame.
Here's the piece of code:
function getResponse(requestData) {
$('#myForm').ajaxSubmit({
type: "POST",
url: "servlet/myServletPath",
data: {requestData: requestData},
timeout: 10000000,
iframe: true
});
}
This works just fine except my servlet can't find any parameter with the name 'requestData'. The same starts working when I remove 'iframe: true'. But I need to post my response to an iframe.
Any idea what exactly is happening here?
Thanks
[1]: http://jquery.malsup.com/form/ | jquery | jquery-plugins | jquery-forms-plugin | null | null | null | open | jQuery ajaxSubmit() API issue with 'iframe: true'
===
I am using [jQuery Form Plugin][1] to make an ajax call and target the response to an iFrame.
Here's the piece of code:
function getResponse(requestData) {
$('#myForm').ajaxSubmit({
type: "POST",
url: "servlet/myServletPath",
data: {requestData: requestData},
timeout: 10000000,
iframe: true
});
}
This works just fine except my servlet can't find any parameter with the name 'requestData'. The same starts working when I remove 'iframe: true'. But I need to post my response to an iframe.
Any idea what exactly is happening here?
Thanks
[1]: http://jquery.malsup.com/form/ | 0 |
11,373,161 | 07/07/2012 07:29:56 | 868,935 | 07/29/2011 07:55:08 | 195 | 10 | Why is my IDE creating infinite loop of windows after building? | I've tested this in **Eclipse** and **Netbeans**, but got the same result.
I was following this tutorial: http://www.youtube.com/watch?v=D1I2FJ60bFY
and when I built the project, my IDE created the window, but then started creating windows on top of windows in an unknown infinite loop.
Does anyone understand why this is happening? I'm using Eclipse Indigo and Netbeans 7.1.2. | eclipse | netbeans | null | null | null | null | open | Why is my IDE creating infinite loop of windows after building?
===
I've tested this in **Eclipse** and **Netbeans**, but got the same result.
I was following this tutorial: http://www.youtube.com/watch?v=D1I2FJ60bFY
and when I built the project, my IDE created the window, but then started creating windows on top of windows in an unknown infinite loop.
Does anyone understand why this is happening? I'm using Eclipse Indigo and Netbeans 7.1.2. | 0 |
11,373,162 | 07/07/2012 07:30:04 | 1,239,834 | 02/29/2012 09:20:09 | 294 | 5 | how to call global function in jquery | i have make two global function now i want to call them in my HTML page. i have make separate file for global function and calling them it into our HTML page but it seems that something wrong with my code
<head>
<script type="text/javascript" src="jquery-1.7.2.js"></script>
<script type="text/javascript" src="pro.js"></script>
//pro.js
//(function( $ ){
//jQuery.functionOne = function() {
//var text="i am first"
//};
//jQuery.functionTwo = function(param) {
// var text="i am second"
//};
//})( jQuery );
<script type="text/javascript">
$('.first').text().functionOne();
$('.second').text().functionTwo();
</script>
<style>
.first { width:100px; height:100px; border:solid 1px #000; margin-bottom:30px;}
.second { width:100px; height:100px; border:solid 1px #000; margin-bottom:30px;}
</style>
</head>
<body>
<div class="first"></div>
<div class="second"></div>
</body>
| jquery | null | null | null | null | null | open | how to call global function in jquery
===
i have make two global function now i want to call them in my HTML page. i have make separate file for global function and calling them it into our HTML page but it seems that something wrong with my code
<head>
<script type="text/javascript" src="jquery-1.7.2.js"></script>
<script type="text/javascript" src="pro.js"></script>
//pro.js
//(function( $ ){
//jQuery.functionOne = function() {
//var text="i am first"
//};
//jQuery.functionTwo = function(param) {
// var text="i am second"
//};
//})( jQuery );
<script type="text/javascript">
$('.first').text().functionOne();
$('.second').text().functionTwo();
</script>
<style>
.first { width:100px; height:100px; border:solid 1px #000; margin-bottom:30px;}
.second { width:100px; height:100px; border:solid 1px #000; margin-bottom:30px;}
</style>
</head>
<body>
<div class="first"></div>
<div class="second"></div>
</body>
| 0 |
11,320,496 | 07/03/2012 23:15:48 | 1,197,044 | 02/08/2012 11:26:31 | 181 | 4 | Reading NSMutableArray | How can I read an Array that contains objects in this format:
Second pair: {
latitude = "26.499023";
longitude = "42.326061";
}
?? | objective-c | xcode | null | null | null | null | open | Reading NSMutableArray
===
How can I read an Array that contains objects in this format:
Second pair: {
latitude = "26.499023";
longitude = "42.326061";
}
?? | 0 |
11,312,536 | 07/03/2012 13:57:35 | 1,208,862 | 02/14/2012 10:44:06 | 4 | 1 | Telerik report, Is there a zoom property to exported PDF? | Is there a zoom property for exported PDF in telerik report? I want to add zoom property programmatically to exported PDF. Is that possible? | telerik-reporting | null | null | null | null | null | open | Telerik report, Is there a zoom property to exported PDF?
===
Is there a zoom property for exported PDF in telerik report? I want to add zoom property programmatically to exported PDF. Is that possible? | 0 |
11,320,501 | 07/03/2012 23:16:32 | 1,457,005 | 06/14/2012 18:21:00 | 3 | 0 | How do I use middleware, specifically Formidable, with Bogart to create a server response? | I'm building a node.js app using the [Bogart](https://github.com/nrstott/bogart) framework, and I would like to handle file uploads with [Formidable](https://github.com/felixge/node-formidable).
Here's my HTML (copied more or less straight from the Formidable docs):
<form action="/upload" enctype="multipart/form-data" method="post">
<input type="text" name="title"><br>
<input type="file" name="upload" multiple="multiple"><br>
<input type="submit" value="Upload">
</form>
And here's my server code:
var bogart = require('bogart'),
formidable = require('formidable');
var router = bogart.router();
router.post('/upload', function(req) {
var form = new formidable.IncomingForm();
var res = bogart.res();
console.log("Beginning to parse files.");
form.parse(req, function(err, fields, files) {
console.log("Completed parsing files.");
res.setHeader('Content-Type', 'text/plain');
if (err) {
console.log("Upload error.")
res.status(500);
res.send('Error');
return res.end();
}
res.status(200);
res.send("Success.");
res.end();
});
return res;
});
var app = bogart.app();
app.use(bogart.batteries);
app.use(router);
app.start(8991, '127.0.0.1');
When I submit the data, my node server logs `"Beginning to parse files."`, indicating it has received the POST, but `"Completed parsing files."`, in the form.parse() callback, never gets logged, so I figure something must be going wrong with the parse. I get no other errors--the client just waits for a server response indefinitely.
My hunch is that I don't understand how to use middleware properly, but I'm also not sure if it's correct to call Formidable middleware, though it does appear to be in the middle of things... | node.js | middleware | null | null | null | null | open | How do I use middleware, specifically Formidable, with Bogart to create a server response?
===
I'm building a node.js app using the [Bogart](https://github.com/nrstott/bogart) framework, and I would like to handle file uploads with [Formidable](https://github.com/felixge/node-formidable).
Here's my HTML (copied more or less straight from the Formidable docs):
<form action="/upload" enctype="multipart/form-data" method="post">
<input type="text" name="title"><br>
<input type="file" name="upload" multiple="multiple"><br>
<input type="submit" value="Upload">
</form>
And here's my server code:
var bogart = require('bogart'),
formidable = require('formidable');
var router = bogart.router();
router.post('/upload', function(req) {
var form = new formidable.IncomingForm();
var res = bogart.res();
console.log("Beginning to parse files.");
form.parse(req, function(err, fields, files) {
console.log("Completed parsing files.");
res.setHeader('Content-Type', 'text/plain');
if (err) {
console.log("Upload error.")
res.status(500);
res.send('Error');
return res.end();
}
res.status(200);
res.send("Success.");
res.end();
});
return res;
});
var app = bogart.app();
app.use(bogart.batteries);
app.use(router);
app.start(8991, '127.0.0.1');
When I submit the data, my node server logs `"Beginning to parse files."`, indicating it has received the POST, but `"Completed parsing files."`, in the form.parse() callback, never gets logged, so I figure something must be going wrong with the parse. I get no other errors--the client just waits for a server response indefinitely.
My hunch is that I don't understand how to use middleware properly, but I'm also not sure if it's correct to call Formidable middleware, though it does appear to be in the middle of things... | 0 |
11,320,510 | 07/03/2012 23:17:40 | 754,865 | 05/15/2011 21:36:26 | 380 | 8 | Checking if an array element has a particular value | Am trying to put together a method that looks through a Codeigniter shopping cart and determines the type of transaction based on the id of the items in the cart
Heres the method
function parse_transaction_type() {
$card_skus = array("MYU_SC1","MYU_SC2","MYU_SC3");
$fee_skus = array("MYU_SF1","MYU_AD1","MYU_AD2");
foreach ($this->cart->contents() as $key => $item) {
if(in_array($item['id'], $card_skus) && in_array($item['id'], $fee_skus))
{
$type = "fees-cards";
}
if (in_array($item['id'], $card_skus) && !in_array($item['id'], $fee_skus))
{
$type ="cards";
}
if (in_array($item['id'], $fee_skus) && !in_array($item['id'], $card_skus))
{
$type ="fees";
}
}
echo $type;
}
The method only returns either "cards" or "fees" even when both are present. What am doing wrong?
| php | arrays | codeigniter | null | null | null | open | Checking if an array element has a particular value
===
Am trying to put together a method that looks through a Codeigniter shopping cart and determines the type of transaction based on the id of the items in the cart
Heres the method
function parse_transaction_type() {
$card_skus = array("MYU_SC1","MYU_SC2","MYU_SC3");
$fee_skus = array("MYU_SF1","MYU_AD1","MYU_AD2");
foreach ($this->cart->contents() as $key => $item) {
if(in_array($item['id'], $card_skus) && in_array($item['id'], $fee_skus))
{
$type = "fees-cards";
}
if (in_array($item['id'], $card_skus) && !in_array($item['id'], $fee_skus))
{
$type ="cards";
}
if (in_array($item['id'], $fee_skus) && !in_array($item['id'], $card_skus))
{
$type ="fees";
}
}
echo $type;
}
The method only returns either "cards" or "fees" even when both are present. What am doing wrong?
| 0 |
11,320,514 | 07/03/2012 23:17:58 | 1,492,561 | 06/30/2012 04:41:43 | 1 | 1 | Jython: include custom java class [oanda] | >>> import sys
>>> sys.path.append("/usr/local/oanda_fxtrade.jar") # add the jar to your path
>>>
>>> import com.oanda.fxtrade.api.test.Example1 as main1
>>> import com.oanda.fxtrade.api.test.Example2 as cancel
main()
TypeError: main(): expected 0 args; got 3
This seems OK
>>> cancel()
Thread[Thread-0,5,main] | java | jython | null | null | null | null | open | Jython: include custom java class [oanda]
===
>>> import sys
>>> sys.path.append("/usr/local/oanda_fxtrade.jar") # add the jar to your path
>>>
>>> import com.oanda.fxtrade.api.test.Example1 as main1
>>> import com.oanda.fxtrade.api.test.Example2 as cancel
main()
TypeError: main(): expected 0 args; got 3
This seems OK
>>> cancel()
Thread[Thread-0,5,main] | 0 |
11,320,519 | 07/03/2012 23:19:23 | 1,488,928 | 06/28/2012 14:49:49 | 1 | 0 | NoReverseMatch in GAE | I am using GAE version 1.7.0
and the django_example app downloaded from Google sample apps.
If I run this app using 'dev_appserver.py', it works fine.
After I modified the app to use django 1.2 (by default it uses 0.96)
I login, then click 'Create new gift', then I get
"Caught NoReverseMatch while rendering: Reverse for 'views.edit' with arguments '('',)' and keyword arguments '{}' not found."
The debug screen shows the offending line (in gift.html) as
<form action="<span class="specific">{%url views.edit gift.key.id%}</span>" method="post">
With the 'Create new gift' button 'gift.key.id' equals None
I also tried using django 1.3 and got a similar error.
Can someone tell me why it works for 0.96, but not for 1.2 or 1.3?
| django | google-app-engine | null | null | null | null | open | NoReverseMatch in GAE
===
I am using GAE version 1.7.0
and the django_example app downloaded from Google sample apps.
If I run this app using 'dev_appserver.py', it works fine.
After I modified the app to use django 1.2 (by default it uses 0.96)
I login, then click 'Create new gift', then I get
"Caught NoReverseMatch while rendering: Reverse for 'views.edit' with arguments '('',)' and keyword arguments '{}' not found."
The debug screen shows the offending line (in gift.html) as
<form action="<span class="specific">{%url views.edit gift.key.id%}</span>" method="post">
With the 'Create new gift' button 'gift.key.id' equals None
I also tried using django 1.3 and got a similar error.
Can someone tell me why it works for 0.96, but not for 1.2 or 1.3?
| 0 |
11,541,984 | 07/18/2012 12:59:27 | 1,382,205 | 04/21/2010 04:54:32 | 94 | 8 | ElasticSearch Query issue | I have this query with range, text and sort in it. When I use range with sort or text with sort it works but when I try to use all three together it throws an error:
"Parse failure: failed to parse source"
I am not sure why it's not working as the error is not very clear. I checked the JSON using jsonlint.com and it's valid. Can I not use a combination of text and range query?
{
"query" : {
"text" : {
"Content" : "fight"
},
"range" : {
"UpdateTime" : {
"from" : "20120601T000000",
"to" : "20120630T235959"
}
}
},
"sort" : [{ "UpdateTime" : {"order" : "desc"} }]
} | query | text | range | elasticsearch | null | null | open | ElasticSearch Query issue
===
I have this query with range, text and sort in it. When I use range with sort or text with sort it works but when I try to use all three together it throws an error:
"Parse failure: failed to parse source"
I am not sure why it's not working as the error is not very clear. I checked the JSON using jsonlint.com and it's valid. Can I not use a combination of text and range query?
{
"query" : {
"text" : {
"Content" : "fight"
},
"range" : {
"UpdateTime" : {
"from" : "20120601T000000",
"to" : "20120630T235959"
}
}
},
"sort" : [{ "UpdateTime" : {"order" : "desc"} }]
} | 0 |
11,541,986 | 07/18/2012 12:59:31 | 1,534,824 | 07/18/2012 12:49:35 | 1 | 0 | Android socket programming emulator connection fault | I am writing a server client application on android for my internship project. All of the client can send message eachothers with server permission on the local host. First of all i wrote server and client side but i cant connect emulator on the local host and ı have to run all emulator on the same computer. I examine other question and answers but they dont work for me. My question is how to connect emulators(clients and server) with eachothers?I tried 10.0.2.2 and redirecting port but doesnt work. Can anobody help me just a simple project connect client and server and send and recieve just a simple string?thanks a lots.... | android | android-emulator | null | null | null | null | open | Android socket programming emulator connection fault
===
I am writing a server client application on android for my internship project. All of the client can send message eachothers with server permission on the local host. First of all i wrote server and client side but i cant connect emulator on the local host and ı have to run all emulator on the same computer. I examine other question and answers but they dont work for me. My question is how to connect emulators(clients and server) with eachothers?I tried 10.0.2.2 and redirecting port but doesnt work. Can anobody help me just a simple project connect client and server and send and recieve just a simple string?thanks a lots.... | 0 |
11,541,987 | 07/18/2012 12:59:31 | 1,534,617 | 07/18/2012 11:30:24 | 1 | 0 | JQuery Cycle layout changes on page refresh - Safari | I'm having frustrating issues with JQuery Cycle. I am trying to set up 4 instances of the cycle, each in a separate <div>.
In Safari, the layout is temperamental. Sometimes it seems to display correctly at first, but refresh the page and the layout goes completely wrong. At other times the last image disappears completely.
I can get this working if I have all 4 instances running at the same time as follows:
<script type="text/javascript">
$(document).ready(function(){
$('.slides').cycle({
fx: 'zoom',
speed: 500,
timeout: 3500,
sync: 0
});
});
</script>
But what I actually want to do is to have a delay on the second, third and 4th images to create a nice effect. I have coded this as follows:
`script type="text/javascript">
$(document).ready(function(){
$('#myslides').cycle({
fx: 'zoom',
speed: 500,
timeout: 3500,
sync: 0
});
$('#myslides2').cycle({
fx: 'zoom',
speed: 500,
timeout: 3500,
sync: 0,
delay: 500
});
$('#myslides3').cycle({
fx: 'zoom',
speed: 500,
timeout: 3500,
sync: 0,
delay: 1000
});
$('#myslides4').cycle({
fx: 'zoom',
speed: 500,
timeout: 3500,
sync: 0,
delay: 1500
});
});
</script>`
Is there some mistake in the Javascript?
The address of this testing site is: http://www.luketaylorevents.co.uk/sandbox/testindex.html
Thanks very much in advance. | jquery | layout | safari | cycle | null | null | open | JQuery Cycle layout changes on page refresh - Safari
===
I'm having frustrating issues with JQuery Cycle. I am trying to set up 4 instances of the cycle, each in a separate <div>.
In Safari, the layout is temperamental. Sometimes it seems to display correctly at first, but refresh the page and the layout goes completely wrong. At other times the last image disappears completely.
I can get this working if I have all 4 instances running at the same time as follows:
<script type="text/javascript">
$(document).ready(function(){
$('.slides').cycle({
fx: 'zoom',
speed: 500,
timeout: 3500,
sync: 0
});
});
</script>
But what I actually want to do is to have a delay on the second, third and 4th images to create a nice effect. I have coded this as follows:
`script type="text/javascript">
$(document).ready(function(){
$('#myslides').cycle({
fx: 'zoom',
speed: 500,
timeout: 3500,
sync: 0
});
$('#myslides2').cycle({
fx: 'zoom',
speed: 500,
timeout: 3500,
sync: 0,
delay: 500
});
$('#myslides3').cycle({
fx: 'zoom',
speed: 500,
timeout: 3500,
sync: 0,
delay: 1000
});
$('#myslides4').cycle({
fx: 'zoom',
speed: 500,
timeout: 3500,
sync: 0,
delay: 1500
});
});
</script>`
Is there some mistake in the Javascript?
The address of this testing site is: http://www.luketaylorevents.co.uk/sandbox/testindex.html
Thanks very much in advance. | 0 |
11,541,998 | 07/18/2012 12:59:54 | 1,206,713 | 02/13/2012 11:57:35 | 1 | 0 | Not able to connect to bluehost server for reading mail from php script using imap_open | I am trying to connect to bluehost to read my email (on one of the domains on bluehost). I tried the following code:
imap_open("{mail.domain.com:993/imap/ssl}INBOX", $email, $password);
and also tried
imap_open("{box***.bluehost.com:993/imap/ssl}INBOX", $email, $password);
imap_open("{box***.bluehost.com:995/imap/ssl}INBOX", $email, $password);
but it shows connection timed out error.
I have checked using phpinfo(), imap and ssl support is enabled.
I have used ports, 995, 993 110 and 143.
I use microsoft outlook as my email client. I tried to get details from outlook and that shows the server as pop3 server.
Can anybody please help? | php | imap | bluehost | null | null | null | open | Not able to connect to bluehost server for reading mail from php script using imap_open
===
I am trying to connect to bluehost to read my email (on one of the domains on bluehost). I tried the following code:
imap_open("{mail.domain.com:993/imap/ssl}INBOX", $email, $password);
and also tried
imap_open("{box***.bluehost.com:993/imap/ssl}INBOX", $email, $password);
imap_open("{box***.bluehost.com:995/imap/ssl}INBOX", $email, $password);
but it shows connection timed out error.
I have checked using phpinfo(), imap and ssl support is enabled.
I have used ports, 995, 993 110 and 143.
I use microsoft outlook as my email client. I tried to get details from outlook and that shows the server as pop3 server.
Can anybody please help? | 0 |
11,542,001 | 07/18/2012 13:00:03 | 1,534,829 | 07/18/2012 12:53:56 | 1 | 0 | Connecting Server-Side Java to Front-End Javascript for iOS App | I am writing a web app for iOS using Sencha Touch 2.0 and am using Javascript primarily on the front end however I plan on using Sencha to "package" the app into what is nearly a native app.
I need to access java code on a server - some functions are used to query a database, another is used to run a barcode scanner. For the carcode scanner, I also need to pass the server a picture taken from the iOS Library.
I am very new to both of these languages and need specific instruction at a basic level on how to connect the databases and then run these java functions, send the picture to the database, and return results (alphanumerics) to the javascript. Thank you much! | java | javascript | ios | sencha-touch-2 | server-side | null | open | Connecting Server-Side Java to Front-End Javascript for iOS App
===
I am writing a web app for iOS using Sencha Touch 2.0 and am using Javascript primarily on the front end however I plan on using Sencha to "package" the app into what is nearly a native app.
I need to access java code on a server - some functions are used to query a database, another is used to run a barcode scanner. For the carcode scanner, I also need to pass the server a picture taken from the iOS Library.
I am very new to both of these languages and need specific instruction at a basic level on how to connect the databases and then run these java functions, send the picture to the database, and return results (alphanumerics) to the javascript. Thank you much! | 0 |
11,542,003 | 07/18/2012 13:00:10 | 1,474,682 | 06/22/2012 11:36:20 | 27 | 0 | Eclipse android configuration issue | I've been setting up my Android SDK and ADT Plugin in Eclipse this morning and my first couple of tests when building an android app have worked fine.
However now I'm starting to get a pop-up everytime I click on something saying 'AN ERROR HAS OCCURED - JAVA.NULLPOINTER.EXCEPTION'.
I understand a nullpointer exception in Java is when something has been created but I haven't even typed in any code yet its just a standard mainactivity class created by the app creation wizard when you click new project.
The problems started when I ran the program and it seemed to have had an issue with 'sctivity_mainlayout.out.xml' or whatever its called.
Anyone got any ideas as to why this happening it was working before and I haven't begun to code my application.
Few details:
Eclipse using the Android ADT Plugin and Android SDK with an Android Virtual Device for testing.
Thanks guys.
P.s. I deleted the project in windows explorer and in Eclipse so got rid of it completely and any new project now is producing the same pop-up error. | java | android | xml | eclipse | null | null | open | Eclipse android configuration issue
===
I've been setting up my Android SDK and ADT Plugin in Eclipse this morning and my first couple of tests when building an android app have worked fine.
However now I'm starting to get a pop-up everytime I click on something saying 'AN ERROR HAS OCCURED - JAVA.NULLPOINTER.EXCEPTION'.
I understand a nullpointer exception in Java is when something has been created but I haven't even typed in any code yet its just a standard mainactivity class created by the app creation wizard when you click new project.
The problems started when I ran the program and it seemed to have had an issue with 'sctivity_mainlayout.out.xml' or whatever its called.
Anyone got any ideas as to why this happening it was working before and I haven't begun to code my application.
Few details:
Eclipse using the Android ADT Plugin and Android SDK with an Android Virtual Device for testing.
Thanks guys.
P.s. I deleted the project in windows explorer and in Eclipse so got rid of it completely and any new project now is producing the same pop-up error. | 0 |
11,542,007 | 07/18/2012 13:00:21 | 1,235,024 | 02/27/2012 07:13:26 | 538 | 29 | issue with Editor position in extjs | I am trying to give Ext.Editor for a panel to inline edit the title of a panel.
var editor = new Ext.Editor({
updateEl: true,
ignoreNoChange: true,
revertInvalid: true,
width: 235,
shadow: false,
//offsets: [25, 10],
field: {
xtype: 'textfield',
allowBlank: false
}
});
editor.startEdit(myPanel,myData.value);
but the editor is shown 0,0 position, not on my panel as i expected.
How to solve this editor position issue?
| extjs | extjs4.1 | null | null | null | null | open | issue with Editor position in extjs
===
I am trying to give Ext.Editor for a panel to inline edit the title of a panel.
var editor = new Ext.Editor({
updateEl: true,
ignoreNoChange: true,
revertInvalid: true,
width: 235,
shadow: false,
//offsets: [25, 10],
field: {
xtype: 'textfield',
allowBlank: false
}
});
editor.startEdit(myPanel,myData.value);
but the editor is shown 0,0 position, not on my panel as i expected.
How to solve this editor position issue?
| 0 |
11,542,010 | 07/18/2012 13:00:23 | 1,534,821 | 07/18/2012 12:48:19 | 1 | 0 | %*c in turbo c means ? | I tried to run this program in Turbo C.But couldn't decipher the output. What does this %*c means here ?Any help would be appreciated.
int dd,mm,yy;
printf("\n\tEnter day,month and year");
scanf("%d %*c %d %*c %d",&dd,&mm,&yy); // what does %*c mean ?
printf("\n\tThe date is : %d %d %d",dd,mm,yy);
**OUTPUT**
Enter day, month and year 23
2
1991
3
5
The date is: 23 1991 5 | c | printf | null | null | null | null | open | %*c in turbo c means ?
===
I tried to run this program in Turbo C.But couldn't decipher the output. What does this %*c means here ?Any help would be appreciated.
int dd,mm,yy;
printf("\n\tEnter day,month and year");
scanf("%d %*c %d %*c %d",&dd,&mm,&yy); // what does %*c mean ?
printf("\n\tThe date is : %d %d %d",dd,mm,yy);
**OUTPUT**
Enter day, month and year 23
2
1991
3
5
The date is: 23 1991 5 | 0 |
11,542,012 | 07/18/2012 13:00:39 | 791,953 | 06/10/2011 01:10:25 | 48 | 1 | How do you call javascript inside of XUL through Firebreath? | I have written some javascript for my firefox extension in the XUL. This overlay has some cleanup functionality and I would like to be able to call the function through my NPAPI dll created via Firebreath.
I know that Firebreath has an example calling the "alert" function by doing the following:
// Retrieve a reference to the DOM Window
FB::DOM::WindowPtr window = m_host->getDOMWindow();
// Check if the DOM Window has an alert peroperty
if (window && window->getJSObject()->HasProperty("window")) {
// Create a reference to alert
FB::JSObjectPtr obj = window->getProperty<FB::JSObjectPtr>("window");
// Invoke alert with some text
obj->Invoke("alert", FB::variant_list_of("This is a test alert invoked from an NPAPI Plugin"));
}
The above code works so I've modified the Invoke to call my javascript function.
obj->Invoke("cleanupCode", FB::variant_list_of("0"));
This does not work and is confusing me on how I should be calling my javascript function. | javascript | firefox-addon | npapi | firebreath | null | null | open | How do you call javascript inside of XUL through Firebreath?
===
I have written some javascript for my firefox extension in the XUL. This overlay has some cleanup functionality and I would like to be able to call the function through my NPAPI dll created via Firebreath.
I know that Firebreath has an example calling the "alert" function by doing the following:
// Retrieve a reference to the DOM Window
FB::DOM::WindowPtr window = m_host->getDOMWindow();
// Check if the DOM Window has an alert peroperty
if (window && window->getJSObject()->HasProperty("window")) {
// Create a reference to alert
FB::JSObjectPtr obj = window->getProperty<FB::JSObjectPtr>("window");
// Invoke alert with some text
obj->Invoke("alert", FB::variant_list_of("This is a test alert invoked from an NPAPI Plugin"));
}
The above code works so I've modified the Invoke to call my javascript function.
obj->Invoke("cleanupCode", FB::variant_list_of("0"));
This does not work and is confusing me on how I should be calling my javascript function. | 0 |
11,350,167 | 07/05/2012 18:17:00 | 193,799 | 10/21/2009 13:10:04 | 318 | 5 | Speeding up slow function with lots of SQL Calls | I need to generate a report which returns a set of numbers for a given time scale.
For instance I need to return the minutes watched for a given month. Here is what I run at the moment
presentation = Presentation.find(1)
presentation.video.stats.minutes_by_date(Date.new(2012,6,1),Date.new(2012,6,30))
def self.by_date(start_date,end_date)
vals = Array.new
(start_date..end_date).map { |date|
yesterdays_stat = daily_watched(date.yesterday)
todays_stat = daily_watched(date)
if todays_stat > 0
if yesterdays_stat > 0
difference = todays_stat - yesterdays_stat
else
difference = todays_stat
end
watched_in_meg = (difference / 1024).round(2)
vals.push (watched_in_meg / first.video.meg_per_minute).round(2)
else
vals.push 0
end
}
vals
end
def self.daily_watched(date)
# get the total bytes for the from both flash and mp4
total_bytes = 0
bytes = where(["DATE(generated_date) = ?", date]).group("kbytes")
.order('generated_date')
bytes.each do |byte|
total_bytes += byte.kbytes
end
total_bytes
# Get the bytes of both flash and mp4
end
The output needs to looks like this:
`[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54.09, 54.09, 54.09, 54.09, 54.09, 54.09, 54.09, 54.09, 54.09, 54.09, 0]`
The problem is this has to run 30 times per presentation and I have anywhere from 10 to 500 presentations.
Is there a way of making this more efficient? | mysql | ruby-on-rails | ruby | null | null | null | open | Speeding up slow function with lots of SQL Calls
===
I need to generate a report which returns a set of numbers for a given time scale.
For instance I need to return the minutes watched for a given month. Here is what I run at the moment
presentation = Presentation.find(1)
presentation.video.stats.minutes_by_date(Date.new(2012,6,1),Date.new(2012,6,30))
def self.by_date(start_date,end_date)
vals = Array.new
(start_date..end_date).map { |date|
yesterdays_stat = daily_watched(date.yesterday)
todays_stat = daily_watched(date)
if todays_stat > 0
if yesterdays_stat > 0
difference = todays_stat - yesterdays_stat
else
difference = todays_stat
end
watched_in_meg = (difference / 1024).round(2)
vals.push (watched_in_meg / first.video.meg_per_minute).round(2)
else
vals.push 0
end
}
vals
end
def self.daily_watched(date)
# get the total bytes for the from both flash and mp4
total_bytes = 0
bytes = where(["DATE(generated_date) = ?", date]).group("kbytes")
.order('generated_date')
bytes.each do |byte|
total_bytes += byte.kbytes
end
total_bytes
# Get the bytes of both flash and mp4
end
The output needs to looks like this:
`[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54.09, 54.09, 54.09, 54.09, 54.09, 54.09, 54.09, 54.09, 54.09, 54.09, 0]`
The problem is this has to run 30 times per presentation and I have anywhere from 10 to 500 presentations.
Is there a way of making this more efficient? | 0 |
11,350,179 | 07/05/2012 18:17:35 | 1,504,802 | 07/05/2012 17:49:13 | 1 | 0 | jquery - how to remove all rows from a table except first two and last? | I've seen a lot of questions about how to select all but the first and last rows of a table, but I want to know how to select everything except the first TWO rows and the last. Right now I have this to select all but the first two:
$("#sometable").find("tr:gt(1)").remove();
and I need some way to get the last one as well. Maybe some way to combine with
:not(:last)
?
I'm fairly new to jquery and any help would be appreciated. Thanks! | jquery | table | jquery-selectors | null | null | null | open | jquery - how to remove all rows from a table except first two and last?
===
I've seen a lot of questions about how to select all but the first and last rows of a table, but I want to know how to select everything except the first TWO rows and the last. Right now I have this to select all but the first two:
$("#sometable").find("tr:gt(1)").remove();
and I need some way to get the last one as well. Maybe some way to combine with
:not(:last)
?
I'm fairly new to jquery and any help would be appreciated. Thanks! | 0 |
11,350,175 | 07/05/2012 18:17:12 | 1,485,852 | 06/27/2012 13:47:34 | 11 | 0 | @Transactional does not seem to create any transactions | I am trying to use @Transactional in a Spring MVC application to gain atomicity. The problem is that it seems like whenever an annotated function is called, it does not create a transaction. Here is my current set up:
Application context:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd" >
<!-- Root Context: defines shared resources visible to all other web components -->
<tx:annotation-driven transaction-manager="txManager"/>
<bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" >
<property name="driverClassName" value="org.postgresql.Driver" />
<property name="url" value="jdbc:postgresql://localhost:5432/qas" />
<property name="username" value="postgres" />
<property name="password" value="P0stgr3s" />
</bean>
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate" >
<constructor-arg name="dataSource" ref="dataSource" />
</bean>
</beans>
Controller file:
package com.silverthorn.txtest;
import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* Handles requests for the application home page.
*/
@Controller
public class HomeController {
private static final Logger logger = LoggerFactory.getLogger(HomeController.class);
@Autowired
private TagsDAO tagsDAO;
/**
* Simply selects the home view to render by returning its name.
*/
@RequestMapping(value = "/", method = RequestMethod.GET)
public String home(Locale locale, Model model) {
logger.info("Welcome home! the client locale is "+ locale.toString());
Date date = new Date();
DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);
String formattedDate = dateFormat.format(date);
model.addAttribute("serverTime", formattedDate );
return "home";
}
@RequestMapping(value="/tags", method=RequestMethod.GET)
public @ResponseBody ResponseDocument addTags(@RequestParam("tag") String[] tags) {
ResponseDocument doc = new ResponseDocument();
try {
tagsDAO.addTags(tags);
} catch ( RuntimeException e ) {
doc.setError("Could not add tags");
}
return doc;
}
}
and DAO file:
package com.silverthorn.txtest;
import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@Repository("tagsDAO")
public class TagsDAO {
@Autowired
private NamedParameterJdbcTemplate jdbcTemplate;
@Transactional(propagation = Propagation.REQUIRED)
public void addTags(String[] tags) {
Map<String, Object> params = new HashMap<String, Object>();
for(String tag : tags) {
params.put("tag", tag);
jdbcTemplate.update("INSERT INTO qas.tags (tag) VALUES (:tag)", params);
}
}
}
Here is an example of the output log when a transaction is supposed to fail:
DEBUG: org.springframework.jdbc.core.JdbcTemplate - Executing prepared SQL update
DEBUG: org.springframework.jdbc.core.JdbcTemplate - Executing prepared SQL statement [INSERT INTO qas.tags (tag) VALUES (?)]
DEBUG: org.springframework.jdbc.datasource.DataSourceUtils - Fetching JDBC Connection from DataSource
DEBUG: org.springframework.jdbc.core.JdbcTemplate - SQL update affected 1 rows
DEBUG: org.springframework.jdbc.datasource.DataSourceUtils - Returning JDBC Connection to DataSource
DEBUG: org.springframework.jdbc.core.JdbcTemplate - Executing prepared SQL update
DEBUG: org.springframework.jdbc.core.JdbcTemplate - Executing prepared SQL statement [INSERT INTO qas.tags (tag) VALUES (?)]
DEBUG: org.springframework.jdbc.datasource.DataSourceUtils - Fetching JDBC Connection from DataSource
DEBUG: org.springframework.jdbc.datasource.DataSourceUtils - Returning JDBC Connection to DataSource
INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
INFO : org.springframework.jdbc.support.SQLErrorCodesFactory - SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase]
DEBUG: org.springframework.jdbc.support.SQLErrorCodesFactory - Looking up default SQLErrorCodes for DataSource [org.apache.commons.dbcp.BasicDataSource@704fb]
DEBUG: org.springframework.jdbc.datasource.DataSourceUtils - Fetching JDBC Connection from DataSource
DEBUG: org.springframework.jdbc.datasource.DataSourceUtils - Returning JDBC Connection to DataSource
DEBUG: org.springframework.jdbc.support.SQLErrorCodesFactory - Database product name cached for DataSource [org.apache.commons.dbcp.BasicDataSource@704fb]: name is 'PostgreSQL'
DEBUG: org.springframework.jdbc.support.SQLErrorCodesFactory - SQL error codes for 'PostgreSQL' found
DEBUG: org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator - Translating SQLException with SQL state '23505', error code '0', message [ERROR: duplicate key value violates unique constraint "tags_pkey"
Detail: Key (tag)=(hello) already exists.]; SQL was [INSERT INTO qas.tags (tag) VALUES (?)] for task [PreparedStatementCallback]
As you can see from the log file, it looks like there is no transaction being created. With no transaction being created, there is obviously no way to roll back the updates to the database. I have been banging my head against a wall on this for 2 days now, and have not been able to get any closer to getting the desired behavior. Any help I can get on this would be greatly appreciated. | spring-mvc | postgresql-9.1 | transactional | null | null | null | open | @Transactional does not seem to create any transactions
===
I am trying to use @Transactional in a Spring MVC application to gain atomicity. The problem is that it seems like whenever an annotated function is called, it does not create a transaction. Here is my current set up:
Application context:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd" >
<!-- Root Context: defines shared resources visible to all other web components -->
<tx:annotation-driven transaction-manager="txManager"/>
<bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" >
<property name="driverClassName" value="org.postgresql.Driver" />
<property name="url" value="jdbc:postgresql://localhost:5432/qas" />
<property name="username" value="postgres" />
<property name="password" value="P0stgr3s" />
</bean>
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate" >
<constructor-arg name="dataSource" ref="dataSource" />
</bean>
</beans>
Controller file:
package com.silverthorn.txtest;
import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* Handles requests for the application home page.
*/
@Controller
public class HomeController {
private static final Logger logger = LoggerFactory.getLogger(HomeController.class);
@Autowired
private TagsDAO tagsDAO;
/**
* Simply selects the home view to render by returning its name.
*/
@RequestMapping(value = "/", method = RequestMethod.GET)
public String home(Locale locale, Model model) {
logger.info("Welcome home! the client locale is "+ locale.toString());
Date date = new Date();
DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);
String formattedDate = dateFormat.format(date);
model.addAttribute("serverTime", formattedDate );
return "home";
}
@RequestMapping(value="/tags", method=RequestMethod.GET)
public @ResponseBody ResponseDocument addTags(@RequestParam("tag") String[] tags) {
ResponseDocument doc = new ResponseDocument();
try {
tagsDAO.addTags(tags);
} catch ( RuntimeException e ) {
doc.setError("Could not add tags");
}
return doc;
}
}
and DAO file:
package com.silverthorn.txtest;
import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@Repository("tagsDAO")
public class TagsDAO {
@Autowired
private NamedParameterJdbcTemplate jdbcTemplate;
@Transactional(propagation = Propagation.REQUIRED)
public void addTags(String[] tags) {
Map<String, Object> params = new HashMap<String, Object>();
for(String tag : tags) {
params.put("tag", tag);
jdbcTemplate.update("INSERT INTO qas.tags (tag) VALUES (:tag)", params);
}
}
}
Here is an example of the output log when a transaction is supposed to fail:
DEBUG: org.springframework.jdbc.core.JdbcTemplate - Executing prepared SQL update
DEBUG: org.springframework.jdbc.core.JdbcTemplate - Executing prepared SQL statement [INSERT INTO qas.tags (tag) VALUES (?)]
DEBUG: org.springframework.jdbc.datasource.DataSourceUtils - Fetching JDBC Connection from DataSource
DEBUG: org.springframework.jdbc.core.JdbcTemplate - SQL update affected 1 rows
DEBUG: org.springframework.jdbc.datasource.DataSourceUtils - Returning JDBC Connection to DataSource
DEBUG: org.springframework.jdbc.core.JdbcTemplate - Executing prepared SQL update
DEBUG: org.springframework.jdbc.core.JdbcTemplate - Executing prepared SQL statement [INSERT INTO qas.tags (tag) VALUES (?)]
DEBUG: org.springframework.jdbc.datasource.DataSourceUtils - Fetching JDBC Connection from DataSource
DEBUG: org.springframework.jdbc.datasource.DataSourceUtils - Returning JDBC Connection to DataSource
INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
INFO : org.springframework.jdbc.support.SQLErrorCodesFactory - SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase]
DEBUG: org.springframework.jdbc.support.SQLErrorCodesFactory - Looking up default SQLErrorCodes for DataSource [org.apache.commons.dbcp.BasicDataSource@704fb]
DEBUG: org.springframework.jdbc.datasource.DataSourceUtils - Fetching JDBC Connection from DataSource
DEBUG: org.springframework.jdbc.datasource.DataSourceUtils - Returning JDBC Connection to DataSource
DEBUG: org.springframework.jdbc.support.SQLErrorCodesFactory - Database product name cached for DataSource [org.apache.commons.dbcp.BasicDataSource@704fb]: name is 'PostgreSQL'
DEBUG: org.springframework.jdbc.support.SQLErrorCodesFactory - SQL error codes for 'PostgreSQL' found
DEBUG: org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator - Translating SQLException with SQL state '23505', error code '0', message [ERROR: duplicate key value violates unique constraint "tags_pkey"
Detail: Key (tag)=(hello) already exists.]; SQL was [INSERT INTO qas.tags (tag) VALUES (?)] for task [PreparedStatementCallback]
As you can see from the log file, it looks like there is no transaction being created. With no transaction being created, there is obviously no way to roll back the updates to the database. I have been banging my head against a wall on this for 2 days now, and have not been able to get any closer to getting the desired behavior. Any help I can get on this would be greatly appreciated. | 0 |
11,350,189 | 07/05/2012 18:18:05 | 1,080,957 | 12/05/2011 05:33:59 | 14 | 0 | Silverlight database using XML | I am working on porting an old application to Silverlight (version 5). The application has many forms with combo boxes who's items are conditionally populated. This is being handled in the old application through an Access database stored within the application and queried using the DAO object library. I was thinking Silverlight would let me mimic this functionality, but I found out that Silverlight does not allow for local database storage and manipulation (please correct me if I am wrong). I cannot go the web service route for database manipulation because this app has to work offline and Out of Browser on Mac and Windows.
So, I am looking for alternatives. It seems that I can use XML and LINQ to achieve a sort of quasi-database. My question regarding this is will it still work on Mac and Windows platforms? Any other alternatives are also welcome. | xml | silverlight | linq | null | null | null | open | Silverlight database using XML
===
I am working on porting an old application to Silverlight (version 5). The application has many forms with combo boxes who's items are conditionally populated. This is being handled in the old application through an Access database stored within the application and queried using the DAO object library. I was thinking Silverlight would let me mimic this functionality, but I found out that Silverlight does not allow for local database storage and manipulation (please correct me if I am wrong). I cannot go the web service route for database manipulation because this app has to work offline and Out of Browser on Mac and Windows.
So, I am looking for alternatives. It seems that I can use XML and LINQ to achieve a sort of quasi-database. My question regarding this is will it still work on Mac and Windows platforms? Any other alternatives are also welcome. | 0 |
11,350,210 | 07/05/2012 18:19:43 | 1,436,471 | 06/05/2012 03:56:28 | 1 | 0 | Whats Is Wrong With This? | Can someone please help me fix this code up? I am getting some weird error:
Wrong parameter count for in_array() in /home/dearyout/public_html/lib/header.php on line 128
<?php $pages = array("random-number-generator", "calculator"); if (in_array(stripos($_SERVER['REQUEST_URI'], $pages))) { echo "active"; } ?> | php | null | null | null | null | 07/05/2012 19:04:14 | too localized | Whats Is Wrong With This?
===
Can someone please help me fix this code up? I am getting some weird error:
Wrong parameter count for in_array() in /home/dearyout/public_html/lib/header.php on line 128
<?php $pages = array("random-number-generator", "calculator"); if (in_array(stripos($_SERVER['REQUEST_URI'], $pages))) { echo "active"; } ?> | 3 |
11,350,211 | 07/05/2012 18:19:46 | 837,046 | 07/09/2011 19:46:01 | 59 | 6 | ssl install from .crt - how do I get public and private from this file? | I was provided with a .crt file that looks like this:
-----BEGIN CERTIFICATE-----
...etc.etc....
-----END CERTIFICATE-----
In my nginx settings I have a location for a public and private key files.
How do I generate those two files from this? Is that how it usually works? | ssl | ssl-certificate | null | null | null | null | open | ssl install from .crt - how do I get public and private from this file?
===
I was provided with a .crt file that looks like this:
-----BEGIN CERTIFICATE-----
...etc.etc....
-----END CERTIFICATE-----
In my nginx settings I have a location for a public and private key files.
How do I generate those two files from this? Is that how it usually works? | 0 |
11,350,212 | 07/05/2012 18:19:50 | 688,161 | 04/01/2011 19:24:22 | 584 | 28 | Why does my JAR file not create a serialization? | I created a jar file from a Java project. I can even run it now, but it does not save the serialization file that is stored correctly when I run the program from *normal* binary code outside of the JAR file.
Can’t you create new files when you have a jar file?
This is how I write the file:
FileOutputStream fileOut = new FileOutputStream("data/vocabulary.ser");
ObjectOutputStream out = new ObjectOutputStream(fileOut);
out.writeObject(this);
out.close();
fileOut.close();
My JAR file looks like this:
META-INF
MANIFEST.MF
name
stefankoch
…
where name/stefankoch/… is my project namespace.
I tried creating a `data` directory in the jar-file (root), but it did not work either. There also is a `data` directory within the directory the jar-file resides in, but that one is not taken either.
How can I allow jar files to create files? | jar | null | null | null | null | null | open | Why does my JAR file not create a serialization?
===
I created a jar file from a Java project. I can even run it now, but it does not save the serialization file that is stored correctly when I run the program from *normal* binary code outside of the JAR file.
Can’t you create new files when you have a jar file?
This is how I write the file:
FileOutputStream fileOut = new FileOutputStream("data/vocabulary.ser");
ObjectOutputStream out = new ObjectOutputStream(fileOut);
out.writeObject(this);
out.close();
fileOut.close();
My JAR file looks like this:
META-INF
MANIFEST.MF
name
stefankoch
…
where name/stefankoch/… is my project namespace.
I tried creating a `data` directory in the jar-file (root), but it did not work either. There also is a `data` directory within the directory the jar-file resides in, but that one is not taken either.
How can I allow jar files to create files? | 0 |
11,410,637 | 07/10/2012 09:46:31 | 535,637 | 12/08/2010 21:42:55 | 1,871 | 1 | HIding behind a proxy did not seem to work? | I often visit various sites and like to do so anonymously from behind a proxy. However, it seems as if some websites are still able to detect my real IP address. I know this because they use the IP address to attempt to geolocate me for services.
1. How did they actually get my real IP Address if I am using a proxy?
2. How can I truly hide myself? | proxy | webbrowser | ip-address | anonymous | null | null | open | HIding behind a proxy did not seem to work?
===
I often visit various sites and like to do so anonymously from behind a proxy. However, it seems as if some websites are still able to detect my real IP address. I know this because they use the IP address to attempt to geolocate me for services.
1. How did they actually get my real IP Address if I am using a proxy?
2. How can I truly hide myself? | 0 |
11,410,641 | 07/10/2012 09:46:44 | 1,037,524 | 11/09/2011 11:14:01 | 20 | 3 | UITableViewCell rendering issue | I have created a sort of GRID using uitableView. For that I have taken various labels for showing grid type line I am using line image. So by considering Grid my tableview is having around 88 columns.
My issue is when I scroll it down, I am getting jerky effect. Its performance s very poor. I am creating around 108 label and each row is having 88 labels and 86 image views.
What step do I need to follow to improve scrolling performance???
I was using clearColor for label background. But later on I have removed those background colors.
Any help????
Thank you in Advance. | ios | uitableview | uitableviewcell | ios5-sdk | null | null | open | UITableViewCell rendering issue
===
I have created a sort of GRID using uitableView. For that I have taken various labels for showing grid type line I am using line image. So by considering Grid my tableview is having around 88 columns.
My issue is when I scroll it down, I am getting jerky effect. Its performance s very poor. I am creating around 108 label and each row is having 88 labels and 86 image views.
What step do I need to follow to improve scrolling performance???
I was using clearColor for label background. But later on I have removed those background colors.
Any help????
Thank you in Advance. | 0 |
11,410,642 | 07/10/2012 09:46:48 | 1,514,352 | 07/10/2012 09:38:52 | 1 | 0 | Xcode Tab Storyboard Cocos2d | I'm really new to Xcode and really not an expert yet.
I made a step sequencer music iphone application in cocos 2d and it works fine so far..
Now I want to make this app one of my tabs in an iphone musician app I'm working on..
I found a good sample project that shows 3 different tabs but I simply don't find a way how to include my cocos2d app into that project and show it as one of the tabs…
Let's say i use the first tab showing an general information text, the second shows some other content and the third tab is my cocos2d app..
I really need help on this!
Thanks so much
phil | xcode | cocos2d | null | null | null | null | open | Xcode Tab Storyboard Cocos2d
===
I'm really new to Xcode and really not an expert yet.
I made a step sequencer music iphone application in cocos 2d and it works fine so far..
Now I want to make this app one of my tabs in an iphone musician app I'm working on..
I found a good sample project that shows 3 different tabs but I simply don't find a way how to include my cocos2d app into that project and show it as one of the tabs…
Let's say i use the first tab showing an general information text, the second shows some other content and the third tab is my cocos2d app..
I really need help on this!
Thanks so much
phil | 0 |
11,410,651 | 07/10/2012 09:47:20 | 985,465 | 10/08/2011 15:06:29 | 11 | 2 | Can we Upgrade samsung galaxy ace device OS form 2.3 to 4.0 or any other higher versions? | i am using samsung galaxy ace with 2.3.3 OS i want to upgrade my device OS to higher versions, is it possible?.if possible then tell me the procedure please... | android | null | null | null | null | 07/10/2012 13:07:23 | off topic | Can we Upgrade samsung galaxy ace device OS form 2.3 to 4.0 or any other higher versions?
===
i am using samsung galaxy ace with 2.3.3 OS i want to upgrade my device OS to higher versions, is it possible?.if possible then tell me the procedure please... | 2 |
11,410,653 | 07/10/2012 09:47:33 | 1,189,762 | 02/04/2012 19:01:54 | 97 | 9 | Restlet - Post Object (even with Jaxb) doesnt work | I tried both: post a object as object or wrapped into JAXBElement. Nothing works for me.
//Create Object
Estate DTO estateOne = new EstateDTO("Hotel", "StreetOne", 1, 111111, "England", 1);
///setting up xstream
XStream xstream = new XStream();
xstream.processAnnotations(EstateResourceIF.class);
xstream.processAnnotations(EstateDTO.class);
xstream.autodetectAnnotations(true);
xstream.setClassLoader(new EstateDTO().getClass().getClassLoader());
xstream.alias("estateDTO", EstateDTO.class);
xstream.alias("estateId", Integer.class);
xstream.alias("estateName", String.class);
//post object
service.post(estateOne).write(System.out);
Thats what I get as response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<estateDTO>
<estateId>d5447cc9-d459-4712-a020-2866b1148e45</estateId>
<owner>admin</owner>
<number>0</number>
<zip>0</zip>
<space>0</space>
</estateDTO>
Problems:
A. estateName, street, country are missing. So all String types, but estateId.
B. all Values are null. Just the values generated on server side are not null.
I even tried wrapping it up in JAXB:
JAXBElement<EstateDTO> estate = new JAXBElement<EstateDTO>(new QName("estate"), EstateDTO.class, estateOne);
Same issues.
When I try to wrap up a Interface with:
EstateResourceIF estateResource = service.wrap(EstateResourceIF.class);
List<Preference<MediaType>> acceptedMediaTypes = new ArrayList<Preference<MediaType>>();
acceptedMediaTypes.add(new Preference(MediaType.APPLICATION_JSON));
service.getClientInfo().setAcceptedMediaTypes(acceptedMediaTypes);
estateResource.postEstate(estateOne);
I get:
Internal Server Error (500) - estateId : estateId
at org.restlet.resource.UniformResource.toObject(UniformResource.java:697)
at org.restlet.resource.ClientResource$1.invoke(ClientResource.java:1829)
at $Proxy17.postEstate(Unknown Source)
at com.bachelor.restlet.RestletConnectedTest.postEstate(RestletConnectedTest.java:113)
----
Some more facts for solution:
EstateDTO class:
@XmlRootElement
//JAX-RS supports an automatic mapping from JAXB annotated class to XML and JSON
@XmlAccessorType(XmlAccessType.FIELD)
public class EstateDTO implements Serializable{
/**
*
*/
private static final long serialVersionUID = -8545841080597549468L;
@XmlElement(name="estateId")
private String estateId;
@XmlElement(name="owner")
private String owner;
@XmlElement(name="estateName")
private String estateName;
@XmlElement(name="street")
private String street;
@XmlElement(name="number")
private int number;
@XmlElement(name="extraAddressLine")
private String extraAddressLine;
@XmlElement(name="zip")
private int zip;
@XmlElement(name="country")
private String country;
private int space;
private List<String> tenants = new ArrayList<String>();
public EstateDTO() {
}
public EstateDTO(String estateName, String street, int number, int zip, String country, int space) {
this.estateName = estateName;
this.street = street;
this.number = number;
this.zip = zip;
this.country = country;
this.space = space;
}
| rest | jaxb | restlet | xstream | null | null | open | Restlet - Post Object (even with Jaxb) doesnt work
===
I tried both: post a object as object or wrapped into JAXBElement. Nothing works for me.
//Create Object
Estate DTO estateOne = new EstateDTO("Hotel", "StreetOne", 1, 111111, "England", 1);
///setting up xstream
XStream xstream = new XStream();
xstream.processAnnotations(EstateResourceIF.class);
xstream.processAnnotations(EstateDTO.class);
xstream.autodetectAnnotations(true);
xstream.setClassLoader(new EstateDTO().getClass().getClassLoader());
xstream.alias("estateDTO", EstateDTO.class);
xstream.alias("estateId", Integer.class);
xstream.alias("estateName", String.class);
//post object
service.post(estateOne).write(System.out);
Thats what I get as response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<estateDTO>
<estateId>d5447cc9-d459-4712-a020-2866b1148e45</estateId>
<owner>admin</owner>
<number>0</number>
<zip>0</zip>
<space>0</space>
</estateDTO>
Problems:
A. estateName, street, country are missing. So all String types, but estateId.
B. all Values are null. Just the values generated on server side are not null.
I even tried wrapping it up in JAXB:
JAXBElement<EstateDTO> estate = new JAXBElement<EstateDTO>(new QName("estate"), EstateDTO.class, estateOne);
Same issues.
When I try to wrap up a Interface with:
EstateResourceIF estateResource = service.wrap(EstateResourceIF.class);
List<Preference<MediaType>> acceptedMediaTypes = new ArrayList<Preference<MediaType>>();
acceptedMediaTypes.add(new Preference(MediaType.APPLICATION_JSON));
service.getClientInfo().setAcceptedMediaTypes(acceptedMediaTypes);
estateResource.postEstate(estateOne);
I get:
Internal Server Error (500) - estateId : estateId
at org.restlet.resource.UniformResource.toObject(UniformResource.java:697)
at org.restlet.resource.ClientResource$1.invoke(ClientResource.java:1829)
at $Proxy17.postEstate(Unknown Source)
at com.bachelor.restlet.RestletConnectedTest.postEstate(RestletConnectedTest.java:113)
----
Some more facts for solution:
EstateDTO class:
@XmlRootElement
//JAX-RS supports an automatic mapping from JAXB annotated class to XML and JSON
@XmlAccessorType(XmlAccessType.FIELD)
public class EstateDTO implements Serializable{
/**
*
*/
private static final long serialVersionUID = -8545841080597549468L;
@XmlElement(name="estateId")
private String estateId;
@XmlElement(name="owner")
private String owner;
@XmlElement(name="estateName")
private String estateName;
@XmlElement(name="street")
private String street;
@XmlElement(name="number")
private int number;
@XmlElement(name="extraAddressLine")
private String extraAddressLine;
@XmlElement(name="zip")
private int zip;
@XmlElement(name="country")
private String country;
private int space;
private List<String> tenants = new ArrayList<String>();
public EstateDTO() {
}
public EstateDTO(String estateName, String street, int number, int zip, String country, int space) {
this.estateName = estateName;
this.street = street;
this.number = number;
this.zip = zip;
this.country = country;
this.space = space;
}
| 0 |
11,410,654 | 07/10/2012 09:47:33 | 1,458,650 | 06/15/2012 12:28:18 | 1 | 0 | getting error id can not be resolved or is not a field | hi i m new to android so plz help
i m getting an error of "id can not be resolved or not a field"
further in private View.OnClickListner onSave = new View.OnclickListner()
m getting an error of "Illegal modifier for parameter onSave; only final is permitted"
ID's in activity.java file and layout file are also same ..
thnx in advance
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button save =(Button) findViewById(R.id.save);
save.setOnClickListener(onSave);
private View.OnClickListener onSave =new View.OnClickListener() {
public void onClick(View arg0) {
// TODO Auto-generated method stub
EditText name=(EditText)findViewById(R.id.name);
EditText address=(EditText)findViewById(R.id.add);
**LAYOUT CODE**
<TableRow
<TextView android:text="Name: " />
<EditText android:id="@+id/name">
></TableRow>
<TableRow
<TextView android:text="Address:"/>
<EditText android:id="@+id/add"
></TableRow>
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Save" />
></TableLayout>
| android | null | null | null | null | null | open | getting error id can not be resolved or is not a field
===
hi i m new to android so plz help
i m getting an error of "id can not be resolved or not a field"
further in private View.OnClickListner onSave = new View.OnclickListner()
m getting an error of "Illegal modifier for parameter onSave; only final is permitted"
ID's in activity.java file and layout file are also same ..
thnx in advance
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button save =(Button) findViewById(R.id.save);
save.setOnClickListener(onSave);
private View.OnClickListener onSave =new View.OnClickListener() {
public void onClick(View arg0) {
// TODO Auto-generated method stub
EditText name=(EditText)findViewById(R.id.name);
EditText address=(EditText)findViewById(R.id.add);
**LAYOUT CODE**
<TableRow
<TextView android:text="Name: " />
<EditText android:id="@+id/name">
></TableRow>
<TableRow
<TextView android:text="Address:"/>
<EditText android:id="@+id/add"
></TableRow>
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Save" />
></TableLayout>
| 0 |
11,410,663 | 07/10/2012 09:48:14 | 1,100,658 | 12/15/2011 19:54:49 | 22 | 4 | how to retrieve Today, Yesterday, last Week, this month , previous month records from mysql table | I have a table which is shown in picture
![mySql Table][1]
[1]: http://i.stack.imgur.com/0Lbc3.jpg
I want to retrieve this information.
1) Today's , Yesterday's , Last_week records grouped by country
2) Till this date(whatever it is) This month total 'page_views' of all ip's
3) From this date(whatever it is) previous month total 'page_views' of all ip's
3) Today's 'page_views' grouped by 'page' (expample: id=7 have page =index.php having page_views =12 But in the same date id=13 have same page = index.php and page_views = 1) So they must show page_view of index.php = 13
| mysql | null | null | null | null | null | open | how to retrieve Today, Yesterday, last Week, this month , previous month records from mysql table
===
I have a table which is shown in picture
![mySql Table][1]
[1]: http://i.stack.imgur.com/0Lbc3.jpg
I want to retrieve this information.
1) Today's , Yesterday's , Last_week records grouped by country
2) Till this date(whatever it is) This month total 'page_views' of all ip's
3) From this date(whatever it is) previous month total 'page_views' of all ip's
3) Today's 'page_views' grouped by 'page' (expample: id=7 have page =index.php having page_views =12 But in the same date id=13 have same page = index.php and page_views = 1) So they must show page_view of index.php = 13
| 0 |
11,659,382 | 07/25/2012 22:07:20 | 851,951 | 07/19/2011 12:31:15 | 34 | 1 | How kill FM Radio APP in Android? | I want kill Radio FM app from my app.
Now, I kill com.htc.fm process successfully, but have same problem that "Advanced Task Killer" app.
I kill com.htc.fm process, radio image disappear from menu context but radio sound continue.
Why?. Any solution?
My code to kill process, with KILL_BACKGROUND_PROCESSES permission in manifest.
actvityManager.killBackgroundProcesses("com.htc.fm"); | android | null | null | null | null | null | open | How kill FM Radio APP in Android?
===
I want kill Radio FM app from my app.
Now, I kill com.htc.fm process successfully, but have same problem that "Advanced Task Killer" app.
I kill com.htc.fm process, radio image disappear from menu context but radio sound continue.
Why?. Any solution?
My code to kill process, with KILL_BACKGROUND_PROCESSES permission in manifest.
actvityManager.killBackgroundProcesses("com.htc.fm"); | 0 |
11,660,441 | 07/25/2012 23:57:22 | 350,542 | 05/26/2010 05:03:49 | 4,278 | 189 | Dynamodb requestHandler acception | I code that
- Succesfully inserts data into dynamodb when run from my local machines, but
- Fails abruptly due to authentication when running in the cloud in a mapreduce job.
I Recently encountered this cryptic exception when running dynamo inserts in the cloud :
Exception in thread "main" java.lang.NoSuchFieldError: requestHandlers
at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.init(AWSSecurityTokenServiceClient.java:214)
at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:160)
at com.amazonaws.auth.STSSessionCredentialsProvider.<init>(STSSessionCredentialsProvider.java:73)
at com.amazonaws.auth.SessionCredentialsProviderFactory.getSessionCredentialsProvider(SessionCredentialsProviderFactory.java:96)
at com.amazonaws.services.dynamodb.AmazonDynamoDBClient.setEndpoint(AmazonDynamoDBClient.java:857)
at com.amazonaws.services.dynamodb.AmazonDynamoDBClient.init(AmazonDynamoDBClient.java:262)
at com.amazonaws.services.dynamodb.AmazonDynamoDBClient.<init>(AmazonDynamoDBClient.java:181)
at com.amazonaws.services.dynamodb.AmazonDynamoDBClient.<init>(AmazonDynamoDBClient.java:142) | java | amazon-web-services | dynamodb | aws-security | null | null | open | Dynamodb requestHandler acception
===
I code that
- Succesfully inserts data into dynamodb when run from my local machines, but
- Fails abruptly due to authentication when running in the cloud in a mapreduce job.
I Recently encountered this cryptic exception when running dynamo inserts in the cloud :
Exception in thread "main" java.lang.NoSuchFieldError: requestHandlers
at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.init(AWSSecurityTokenServiceClient.java:214)
at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:160)
at com.amazonaws.auth.STSSessionCredentialsProvider.<init>(STSSessionCredentialsProvider.java:73)
at com.amazonaws.auth.SessionCredentialsProviderFactory.getSessionCredentialsProvider(SessionCredentialsProviderFactory.java:96)
at com.amazonaws.services.dynamodb.AmazonDynamoDBClient.setEndpoint(AmazonDynamoDBClient.java:857)
at com.amazonaws.services.dynamodb.AmazonDynamoDBClient.init(AmazonDynamoDBClient.java:262)
at com.amazonaws.services.dynamodb.AmazonDynamoDBClient.<init>(AmazonDynamoDBClient.java:181)
at com.amazonaws.services.dynamodb.AmazonDynamoDBClient.<init>(AmazonDynamoDBClient.java:142) | 0 |
11,660,444 | 07/25/2012 23:57:32 | 437,368 | 09/01/2010 21:21:29 | 119 | 16 | jQuery UI Not being loaded properly? Dialog method not found | I'm having an issue with my jQuery UI dialog on this page (and this page only):
http://www.satelliteinternet.com/
I'm not sure what the issue is as it's working on all the other pages on the site. The error I'm getting is the $("#DealerSearch") object has no dialog method. Very odd indeed.
Has anyone else experienced this issue? | javascript | jquery | null | null | null | null | open | jQuery UI Not being loaded properly? Dialog method not found
===
I'm having an issue with my jQuery UI dialog on this page (and this page only):
http://www.satelliteinternet.com/
I'm not sure what the issue is as it's working on all the other pages on the site. The error I'm getting is the $("#DealerSearch") object has no dialog method. Very odd indeed.
Has anyone else experienced this issue? | 0 |
11,660,445 | 07/25/2012 23:57:36 | 841,721 | 07/12/2011 22:58:26 | 150 | 7 | R row indices as strings? | Given this dataframe:
b a d c
3 -2 1 3 2
4 1 1 3 2
5 1 1 3 2
Is it possible to rename the row indices like so?
b a d c
xxx -2 1 3 2
yyy 1 1 3 2
zzz 1 1 3 2
Essentially, instead of having numeric indices, I have strings as id's, like a hash table. | r | matrix | row | hashtable | data.frame | null | open | R row indices as strings?
===
Given this dataframe:
b a d c
3 -2 1 3 2
4 1 1 3 2
5 1 1 3 2
Is it possible to rename the row indices like so?
b a d c
xxx -2 1 3 2
yyy 1 1 3 2
zzz 1 1 3 2
Essentially, instead of having numeric indices, I have strings as id's, like a hash table. | 0 |
11,660,446 | 07/25/2012 23:57:43 | 1,229,202 | 02/23/2012 19:31:44 | 45 | 0 | Syntax errors in ajax calls/javascript not appearing in rails application | Say I have something like this in my js.erb file.
$(div_id + <%= @line_num %>).html("<%=j render :partial => "quant_change_form" %>");
That works fine but if I have a syntax error like say (i.e. method does not exist):
$(div_id + <%= @line_num %>).htmlabcd("<%=j render :partial => "quant_change_form" %>");
I don't get a syntax error in my editor (I'm using RubyMine) and I don't get an error in Firebug. It simply doesn't work without telling me why. Isn't this the recommended way you're supposed to make an ajax call in rails?
| jquery | ruby-on-rails | ajax | firebug | syntax-error | null | open | Syntax errors in ajax calls/javascript not appearing in rails application
===
Say I have something like this in my js.erb file.
$(div_id + <%= @line_num %>).html("<%=j render :partial => "quant_change_form" %>");
That works fine but if I have a syntax error like say (i.e. method does not exist):
$(div_id + <%= @line_num %>).htmlabcd("<%=j render :partial => "quant_change_form" %>");
I don't get a syntax error in my editor (I'm using RubyMine) and I don't get an error in Firebug. It simply doesn't work without telling me why. Isn't this the recommended way you're supposed to make an ajax call in rails?
| 0 |
11,660,447 | 07/25/2012 23:58:01 | 405,013 | 07/28/2010 20:46:57 | 1,265 | 56 | GenericDao with Guice | I have a interface `DAO<T>`, and a Generic implementation of it (`GenericDAO<T> implements DAO<T>`).
I'll like to do something like this:
public interface UserDao extends Dao<User> {
// code
}
// module
bind(UserDao.class).to(GenericDao.class);
Is it possible?
I managed to work a inject of Dao<User> to GenericDao<User> automagically (I didnt create the specific userdao implementation), but, can't get this working...
| generics | guice | dao | null | null | null | open | GenericDao with Guice
===
I have a interface `DAO<T>`, and a Generic implementation of it (`GenericDAO<T> implements DAO<T>`).
I'll like to do something like this:
public interface UserDao extends Dao<User> {
// code
}
// module
bind(UserDao.class).to(GenericDao.class);
Is it possible?
I managed to work a inject of Dao<User> to GenericDao<User> automagically (I didnt create the specific userdao implementation), but, can't get this working...
| 0 |
11,660,449 | 07/25/2012 23:58:18 | 1,553,096 | 07/25/2012 23:36:18 | 1 | 0 | get javasrcipt below fixed div | http://www.haymsalomonhome.com/recovery.html
the blue button on the far right is a fixed div. how can i get it to float ABOVE the javascript slideshow? z-index does not work in this case...
on a page that has just an image with no javascript, the fixed button does float above it:
http://www.haymsalomonhome.com/cultural.html | javascript | css | null | null | null | null | open | get javasrcipt below fixed div
===
http://www.haymsalomonhome.com/recovery.html
the blue button on the far right is a fixed div. how can i get it to float ABOVE the javascript slideshow? z-index does not work in this case...
on a page that has just an image with no javascript, the fixed button does float above it:
http://www.haymsalomonhome.com/cultural.html | 0 |
11,660,451 | 07/25/2012 23:58:27 | 1,038,783 | 11/10/2011 00:33:03 | 11 | 0 | Attempting to sent Push Notifications to iOS device - not receiving them | I have so far done the following:
- Generated certificate and private key as .pem, also cat'd them together. Successfully connected to gateway.sandbox.push.apple.com.
- Using the provisional profile with push notifications is enabled for development, I have a basic app that successfully prompted "Do you want to allow push notifications", so this is working correctly
- Obtained the device token
- I have tried pulling a few pre-made files for SSLing into sandbox from the internet just to see if I can get them running before I start development.
The files are the php file posted here: http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12. I actually got a "Message successfully sent"
The python file posted here: http://stackoverflow.com/questions/1052645/apple-pns-push-notification-services-sample-code; I had to edit the Python 3 command "fromhash" line to str(float.fromhash(...))
I also tried using the PyAPNs API: https://github.com/simonwhitaker/PyAPNs. I still have use_sandbox set to true.
Obviously I changed the device tokens and public keys/certificates to my own. Sadly I have not received any pushed notifications yet, and I'm not receiving any concrete errors to tell me why. If anyone can shed some light, that would be amazing. | ios | ssl | push-notification | apple-push-notifications | devicetoken | null | open | Attempting to sent Push Notifications to iOS device - not receiving them
===
I have so far done the following:
- Generated certificate and private key as .pem, also cat'd them together. Successfully connected to gateway.sandbox.push.apple.com.
- Using the provisional profile with push notifications is enabled for development, I have a basic app that successfully prompted "Do you want to allow push notifications", so this is working correctly
- Obtained the device token
- I have tried pulling a few pre-made files for SSLing into sandbox from the internet just to see if I can get them running before I start development.
The files are the php file posted here: http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12. I actually got a "Message successfully sent"
The python file posted here: http://stackoverflow.com/questions/1052645/apple-pns-push-notification-services-sample-code; I had to edit the Python 3 command "fromhash" line to str(float.fromhash(...))
I also tried using the PyAPNs API: https://github.com/simonwhitaker/PyAPNs. I still have use_sandbox set to true.
Obviously I changed the device tokens and public keys/certificates to my own. Sadly I have not received any pushed notifications yet, and I'm not receiving any concrete errors to tell me why. If anyone can shed some light, that would be amazing. | 0 |
11,660,452 | 07/25/2012 23:58:28 | 1,553,098 | 07/25/2012 23:37:42 | 1 | 0 | Fabric windows client put command not converting directory separators when target is Linux | I have a fabfile that I run on Windows. I am using the put(...) command to move files where the target OS is Linux...
put('*', '/home/somedir/')
The result is I get on the target Linux system...
/home/somedir/directoryFromWindows\\file
So fabric does not seem to realize the client is windows but the target is Linux and the directory separators are not being converted from that DOS \ to the Linux /
Is there a technique that I can use to get this to work? Where I work, some people are on Mac (unix) but others are on Windows. The fabfile put (or course) works find going Mac -> Linux, but the fabfile put going from Windows -> Linux has the above issue.
Any suggestions? | python | fabric | null | null | null | null | open | Fabric windows client put command not converting directory separators when target is Linux
===
I have a fabfile that I run on Windows. I am using the put(...) command to move files where the target OS is Linux...
put('*', '/home/somedir/')
The result is I get on the target Linux system...
/home/somedir/directoryFromWindows\\file
So fabric does not seem to realize the client is windows but the target is Linux and the directory separators are not being converted from that DOS \ to the Linux /
Is there a technique that I can use to get this to work? Where I work, some people are on Mac (unix) but others are on Windows. The fabfile put (or course) works find going Mac -> Linux, but the fabfile put going from Windows -> Linux has the above issue.
Any suggestions? | 0 |
11,660,462 | 07/25/2012 23:59:24 | 1,553,076 | 07/25/2012 23:24:34 | 1 | 0 | Erlang and Yaws setup on MacOS X | I'm trying to run Yaws 1.94 on my Mac OS X 10.8 and it crashes. I'm running Erlang R15B01
I am using macports to install this with the commands:
sudo port selfupdate
sudo port install erlang +ssl yaws
export ERL_LIBS=/opt/local/lib/yaws/
sudo mkdir /etc/yaws/
sudo cp /opt/local/etc/yaws/yaws.conf.template /etc/yaws/yaws.conf
When I run yaws, it crashes
$ sudo yaws -i --conf /etc/yaws/yaws.conf
Erlang R15B01 (erts-5.9.1) [source] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel- poll:true]
Eshell V5.9.1 (abort with ^G)
1>
=INFO REPORT==== 25-Jul-2012::16:36:20 ===
Yaws: Using config file /etc/yaws/yaws.conf
=INFO REPORT==== 25-Jul-2012::16:36:20 ===
yaws debug:Add path "/opt/local/var/yaws/ebin"
=INFO REPORT==== 25-Jul-2012::16:36:20 ===
yaws debug:Add path "/opt/local/lib/yaws/ebin"
=INFO REPORT==== 25-Jul-2012::16:36:20 ===
yaws debug:Add path "/opt/local/lib/yaws/examples/ebin"
=INFO REPORT==== 25-Jul-2012::16:36:20 ===
yaws debug:Running with id="default" (localinstall=false)
Running with debug checks turned on (slower server)
to directory "/opt/local/var/log/yaws"
=INFO REPORT==== 25-Jul-2012::16:36:20 ===
application: yaws
exited: {shutdown,{yaws_app,start,[normal,[]]}}
type: permanent
{"Kernel pid terminated",application_controller,"{application_start_failure,yaws,{shutdown,{yaws_app,start,[normal,[]]}}}"}
Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,yaws,{shutdown,{yaws_app,start,[normal,[]]}}})
# As a result #
When I check to see if there is a yaws process around (ps -efw | grep yaws) and there is none
What am I missing here? I would love to be able to use Yaws on Mac OS X. Thanks | osx | erlang | yaws | null | null | null | open | Erlang and Yaws setup on MacOS X
===
I'm trying to run Yaws 1.94 on my Mac OS X 10.8 and it crashes. I'm running Erlang R15B01
I am using macports to install this with the commands:
sudo port selfupdate
sudo port install erlang +ssl yaws
export ERL_LIBS=/opt/local/lib/yaws/
sudo mkdir /etc/yaws/
sudo cp /opt/local/etc/yaws/yaws.conf.template /etc/yaws/yaws.conf
When I run yaws, it crashes
$ sudo yaws -i --conf /etc/yaws/yaws.conf
Erlang R15B01 (erts-5.9.1) [source] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel- poll:true]
Eshell V5.9.1 (abort with ^G)
1>
=INFO REPORT==== 25-Jul-2012::16:36:20 ===
Yaws: Using config file /etc/yaws/yaws.conf
=INFO REPORT==== 25-Jul-2012::16:36:20 ===
yaws debug:Add path "/opt/local/var/yaws/ebin"
=INFO REPORT==== 25-Jul-2012::16:36:20 ===
yaws debug:Add path "/opt/local/lib/yaws/ebin"
=INFO REPORT==== 25-Jul-2012::16:36:20 ===
yaws debug:Add path "/opt/local/lib/yaws/examples/ebin"
=INFO REPORT==== 25-Jul-2012::16:36:20 ===
yaws debug:Running with id="default" (localinstall=false)
Running with debug checks turned on (slower server)
to directory "/opt/local/var/log/yaws"
=INFO REPORT==== 25-Jul-2012::16:36:20 ===
application: yaws
exited: {shutdown,{yaws_app,start,[normal,[]]}}
type: permanent
{"Kernel pid terminated",application_controller,"{application_start_failure,yaws,{shutdown,{yaws_app,start,[normal,[]]}}}"}
Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,yaws,{shutdown,{yaws_app,start,[normal,[]]}}})
# As a result #
When I check to see if there is a yaws process around (ps -efw | grep yaws) and there is none
What am I missing here? I would love to be able to use Yaws on Mac OS X. Thanks | 0 |
11,567,762 | 07/19/2012 19:16:21 | 1,422,412 | 05/28/2012 20:30:46 | 28 | 0 | Website display issues depending on the computer | using the same resolution on five different computers, the same browser (firefox 14.01), 1 of them is mac, 3 are running on ubuntu and the last one is on Windows 7.
All of the test were executed on a clean browser without any plugins...
We also tried to swap screen, and nothing is different, it the browser had the problem, it still have it.
Also, using firebug, I compared every elements and all of them are the same, except that my link (<a />) have 2 more pixels on 2 computer.
I tried on every browser (Opera, Chrome, Firefox, Safari, IE 7-8-9) and I don't have the problems when I don't have it on Firefox, but when I do, I do have the problem on every browser...
I have display issues of many html elements.
So here is my question : What could cause this?
**Here is my HTML Code :**
<td style="text-align:center">
<a style="margin-right: 10px;" href="#" class="_visionnerRessource {idRessource:619}">
<img alt="Voir" src="/statics/images/Formulaire/view.png">
</a>
<a style="margin-right: 10px;" class="_modifierRessource {idRessource:619}">
<img alt="Modifier" src="/statics/images/Formulaire/edit.png">
</a>
<a style="margin-right: 10px;" href="#" class="_deleteRessource {idRessource: 619}">
<img alt="Supprimer" src="/statics/images/Formulaire/delete.png">
</a>
</td>
**Here is my CSS code for the a**
a {
margin-right: 10px;
cursor: pointer;
text-decoration: underline;
}
**Here is the pics :**
When it is not working :
![Not Working][1]
When it is working : ![Working][2]
[1]: http://i.stack.imgur.com/ndDpv.png
[2]: http://i.stack.imgur.com/To5Bo.png
Any suggestions is appreciated!
Thank you guys... | html | css | xhtml | null | null | null | open | Website display issues depending on the computer
===
using the same resolution on five different computers, the same browser (firefox 14.01), 1 of them is mac, 3 are running on ubuntu and the last one is on Windows 7.
All of the test were executed on a clean browser without any plugins...
We also tried to swap screen, and nothing is different, it the browser had the problem, it still have it.
Also, using firebug, I compared every elements and all of them are the same, except that my link (<a />) have 2 more pixels on 2 computer.
I tried on every browser (Opera, Chrome, Firefox, Safari, IE 7-8-9) and I don't have the problems when I don't have it on Firefox, but when I do, I do have the problem on every browser...
I have display issues of many html elements.
So here is my question : What could cause this?
**Here is my HTML Code :**
<td style="text-align:center">
<a style="margin-right: 10px;" href="#" class="_visionnerRessource {idRessource:619}">
<img alt="Voir" src="/statics/images/Formulaire/view.png">
</a>
<a style="margin-right: 10px;" class="_modifierRessource {idRessource:619}">
<img alt="Modifier" src="/statics/images/Formulaire/edit.png">
</a>
<a style="margin-right: 10px;" href="#" class="_deleteRessource {idRessource: 619}">
<img alt="Supprimer" src="/statics/images/Formulaire/delete.png">
</a>
</td>
**Here is my CSS code for the a**
a {
margin-right: 10px;
cursor: pointer;
text-decoration: underline;
}
**Here is the pics :**
When it is not working :
![Not Working][1]
When it is working : ![Working][2]
[1]: http://i.stack.imgur.com/ndDpv.png
[2]: http://i.stack.imgur.com/To5Bo.png
Any suggestions is appreciated!
Thank you guys... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.