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,568,025 | 07/19/2012 19:35:57 | 1,528,883 | 07/16/2012 12:29:22 | 1 | 0 | how to program hold event in silverlight/wp7 | I got a little problem with button events. I programmed one button to decrease specific value by 1 (click), and I want to decrease it over time while holding button pressed. I'm using Silverlight, not XNA.
myTimer.Change(0, 100);
private void OnMyTimerDone(object state)
{
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
if (rightButton.IsPressed)
{
rightButton_Click(null, null);
}
});
}
this code is correctly working at the beginning, but then I am unable to single tap as it is always calling hold event. | silverlight | windows-phone-7 | null | null | null | null | open | how to program hold event in silverlight/wp7
===
I got a little problem with button events. I programmed one button to decrease specific value by 1 (click), and I want to decrease it over time while holding button pressed. I'm using Silverlight, not XNA.
myTimer.Change(0, 100);
private void OnMyTimerDone(object state)
{
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
if (rightButton.IsPressed)
{
rightButton_Click(null, null);
}
});
}
this code is correctly working at the beginning, but then I am unable to single tap as it is always calling hold event. | 0 |
11,411,209 | 07/10/2012 10:18:48 | 1,510,985 | 07/09/2012 04:19:12 | 1 | 0 | BitmapFactory.decodeStream cannot decode png type from ftp |
- What was my mistake? How I show png from FTP?
I'm newby for android and try to show image from difference connection/source.
Then I already show image which load from drawable and HTTP.
Now, I'm try to show from FTP, I get message "--- decoder->decode returned false" when I use..`BitmapFactory.decodeStream(ins, null, options);`
Then I found solution..
static class FlushedInputStream extends FilterInputStream {
public FlushedInputStream(InputStream inputStream) {
super(inputStream);
}
@Override
public long skip(long n) throws IOException {
long totalBytesSkipped = 0L;
while (totalBytesSkipped < n) {
long bytesSkipped = in.skip(n - totalBytesSkipped);
if (bytesSkipped == 0L) {
int b = read();
if (b < 0) {
break; // we reached EOF
} else {
bytesSkipped = 1; // we read one byte
}
}
totalBytesSkipped += bytesSkipped;
}
return totalBytesSkipped;
}
}
Then it can load/decode file type "Jpeg, jpg", there are show completely.
But log cat say "--- decoder->decode returned false" when bitmap load file type "PNG" again.
Thank for advice...
ImageView bmImage = (ImageView) findViewById(R.id.faceImageView);
BitmapFactory.Options bmOptions;
bmOptions = new BitmapFactory.Options();
bmOptions.inSampleSize = 1;
Bitmap bm = LoadImage(image_URL, bmOptions);
bmImage.setImageBitmap(bm);
...
private Bitmap LoadImage(String URL, BitmapFactory.Options options) {
Bitmap bitmap = null;
InputStream in = null;
FlushedInputStream fIns = null;
try {
if (isFTP) {
in = downloadFile("");
if (remoteFile.toLowerCase().contains(".png")) {
fIns = new FlushedInputStream(in);
bitmap = BitmapFactory.decodeStream(fIns, null, options);
// byte[] bMapArray = new byte[buf.available()];
// buf.read(bMapArray);
// bitmap = BitmapFactory.decodeByteArray(bMapArray, 0,
// bMapArray.length);
} else {
fIns = new FlushedInputStream(in);
bitmap = BitmapFactory.decodeStream(fIns);
}
} else { // HTTP
in = OpenHttpConnection(URL);
fIns = new FlushedInputStream(in);
bitmap = BitmapFactory.decodeStream(fIns);
}
in.close();
} catch (IOException e1) {
}
return bitmap;
}
public synchronized InputStream downloadFile(String localfilename) {
InputStream inputStream = null;
String user = "aaa";
String pass = "8888";
String host = "xxx.xxx.xxx.xxx";
try {
FTPClient mFTPClient = new FTPClient();
mFTPClient.connect(host);
mFTPClient.login(user, pass);
mFTPClient.enterLocalPassiveMode();
mFTPClient.changeWorkingDirectory("/DroidPic");
String[] aa = mFTPClient.listNames();
String strTmp = "";
do {
strTmp = aa[(new Random()).nextInt(aa.length)];
} while (remoteFile == strTmp);
remoteFile = strTmp;
inputStream = mFTPClient.retrieveFileStream(remoteFile);
} catch (Exception ex) {
Toast.makeText(this, "Err:" + ex.getMessage(), Toast.LENGTH_LONG)
.show();
}
return inputStream;
} | android | ftp | png | imageview | null | null | open | BitmapFactory.decodeStream cannot decode png type from ftp
===
- What was my mistake? How I show png from FTP?
I'm newby for android and try to show image from difference connection/source.
Then I already show image which load from drawable and HTTP.
Now, I'm try to show from FTP, I get message "--- decoder->decode returned false" when I use..`BitmapFactory.decodeStream(ins, null, options);`
Then I found solution..
static class FlushedInputStream extends FilterInputStream {
public FlushedInputStream(InputStream inputStream) {
super(inputStream);
}
@Override
public long skip(long n) throws IOException {
long totalBytesSkipped = 0L;
while (totalBytesSkipped < n) {
long bytesSkipped = in.skip(n - totalBytesSkipped);
if (bytesSkipped == 0L) {
int b = read();
if (b < 0) {
break; // we reached EOF
} else {
bytesSkipped = 1; // we read one byte
}
}
totalBytesSkipped += bytesSkipped;
}
return totalBytesSkipped;
}
}
Then it can load/decode file type "Jpeg, jpg", there are show completely.
But log cat say "--- decoder->decode returned false" when bitmap load file type "PNG" again.
Thank for advice...
ImageView bmImage = (ImageView) findViewById(R.id.faceImageView);
BitmapFactory.Options bmOptions;
bmOptions = new BitmapFactory.Options();
bmOptions.inSampleSize = 1;
Bitmap bm = LoadImage(image_URL, bmOptions);
bmImage.setImageBitmap(bm);
...
private Bitmap LoadImage(String URL, BitmapFactory.Options options) {
Bitmap bitmap = null;
InputStream in = null;
FlushedInputStream fIns = null;
try {
if (isFTP) {
in = downloadFile("");
if (remoteFile.toLowerCase().contains(".png")) {
fIns = new FlushedInputStream(in);
bitmap = BitmapFactory.decodeStream(fIns, null, options);
// byte[] bMapArray = new byte[buf.available()];
// buf.read(bMapArray);
// bitmap = BitmapFactory.decodeByteArray(bMapArray, 0,
// bMapArray.length);
} else {
fIns = new FlushedInputStream(in);
bitmap = BitmapFactory.decodeStream(fIns);
}
} else { // HTTP
in = OpenHttpConnection(URL);
fIns = new FlushedInputStream(in);
bitmap = BitmapFactory.decodeStream(fIns);
}
in.close();
} catch (IOException e1) {
}
return bitmap;
}
public synchronized InputStream downloadFile(String localfilename) {
InputStream inputStream = null;
String user = "aaa";
String pass = "8888";
String host = "xxx.xxx.xxx.xxx";
try {
FTPClient mFTPClient = new FTPClient();
mFTPClient.connect(host);
mFTPClient.login(user, pass);
mFTPClient.enterLocalPassiveMode();
mFTPClient.changeWorkingDirectory("/DroidPic");
String[] aa = mFTPClient.listNames();
String strTmp = "";
do {
strTmp = aa[(new Random()).nextInt(aa.length)];
} while (remoteFile == strTmp);
remoteFile = strTmp;
inputStream = mFTPClient.retrieveFileStream(remoteFile);
} catch (Exception ex) {
Toast.makeText(this, "Err:" + ex.getMessage(), Toast.LENGTH_LONG)
.show();
}
return inputStream;
} | 0 |
11,411,214 | 07/10/2012 10:18:59 | 267,679 | 02/06/2010 10:27:39 | 2,529 | 11 | text listen(speech) in java how to | Does anyone know any good API or LIBRARY that can listen(speech) text. I try to listen(speech) text in three languages and I would like to know where and how is best to start. Can I use general voice for all three languages? I will use `eclipse` and `java` for language.
Thank you.
| java | null | null | null | null | null | open | text listen(speech) in java how to
===
Does anyone know any good API or LIBRARY that can listen(speech) text. I try to listen(speech) text in three languages and I would like to know where and how is best to start. Can I use general voice for all three languages? I will use `eclipse` and `java` for language.
Thank you.
| 0 |
11,411,029 | 07/10/2012 10:09:27 | 938,058 | 09/10/2011 09:53:54 | 39 | 3 | ASP.Net Web API and KnockoutJS | I'm developing an ASP Web API project and using KnockoutJS as the client side technology. To the best of my knowledge there are no examples projects or any kind of sources available in internet for these two technologies yet. If someone has used these two technologies for their development, it is great if you can provide some links here (If there are online sources). I am posing this not as a question but to get some online sources about these technologies to one place (Because as I know there are no online sources yet). If someone know any sources about the projects which have used these two technologies in there architecture, it will be a great help for me (Since there are no online sources).
Thank you. | asp.net | knockout.js | asp.net-web-api | null | null | 07/10/2012 18:23:44 | not a real question | ASP.Net Web API and KnockoutJS
===
I'm developing an ASP Web API project and using KnockoutJS as the client side technology. To the best of my knowledge there are no examples projects or any kind of sources available in internet for these two technologies yet. If someone has used these two technologies for their development, it is great if you can provide some links here (If there are online sources). I am posing this not as a question but to get some online sources about these technologies to one place (Because as I know there are no online sources yet). If someone know any sources about the projects which have used these two technologies in there architecture, it will be a great help for me (Since there are no online sources).
Thank you. | 1 |
11,411,030 | 07/10/2012 10:09:29 | 1,352,755 | 04/24/2012 03:38:24 | 75 | 9 | Add some files and commit in Git | I have some files
> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
And I want to commit files 1-5 only, so I have added files 1-5
> Changes to be committed:
>
> (use "git reset HEAD <file>..." to unstage)
>
> 1, 2, 3, 4, 5
and leave files 6-10 in changes "not staged for commit" list.
But then, when I want to commit using
> git commit -a
I also see those files 6-10
> Changes to be committed:
>
> (use "git reset HEAD <file>..." to unstage)
>
I think when I have manually added files 1-5, files 6-10 won't be also added in "changes to be committed" list right? | git | github | null | null | null | null | open | Add some files and commit in Git
===
I have some files
> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
And I want to commit files 1-5 only, so I have added files 1-5
> Changes to be committed:
>
> (use "git reset HEAD <file>..." to unstage)
>
> 1, 2, 3, 4, 5
and leave files 6-10 in changes "not staged for commit" list.
But then, when I want to commit using
> git commit -a
I also see those files 6-10
> Changes to be committed:
>
> (use "git reset HEAD <file>..." to unstage)
>
I think when I have manually added files 1-5, files 6-10 won't be also added in "changes to be committed" list right? | 0 |
11,411,219 | 07/10/2012 10:19:09 | 1,073,117 | 11/30/2011 10:24:30 | 719 | 23 | CSS to stop text wrapping | I have the following markup:
<li id="CN2787">
<img class="fav_star" src="images/fav.png">
<span>Text, text and more text</span>
</li>
I want it so that if the text wraps, it doesn't go into the 'column' for the image. I know I can do it with a `table` (which I was doing) but this is not workable for [this reason][1].
I've tried the following without success:
li span {width: 100px; margin-left: 20px}
.fav_star {width: 20px}
I also tried `float: right`.
Thanks.
[1]: http://stackoverflow.com/questions/11406964/jquery-counting-visible-elements-efficiency-speed-problems | css | null | null | null | null | null | open | CSS to stop text wrapping
===
I have the following markup:
<li id="CN2787">
<img class="fav_star" src="images/fav.png">
<span>Text, text and more text</span>
</li>
I want it so that if the text wraps, it doesn't go into the 'column' for the image. I know I can do it with a `table` (which I was doing) but this is not workable for [this reason][1].
I've tried the following without success:
li span {width: 100px; margin-left: 20px}
.fav_star {width: 20px}
I also tried `float: right`.
Thanks.
[1]: http://stackoverflow.com/questions/11406964/jquery-counting-visible-elements-efficiency-speed-problems | 0 |
11,411,223 | 07/10/2012 10:19:21 | 1,514,442 | 07/10/2012 10:14:31 | 1 | 0 | Android APK resign.jar is getting hanged | Actually i am working on android platform,I am using robotium for automation testing.In my scenario i dont have the code i only have the apk file of an application which i can resign it and do my automation testing.For resigning of signature of apk i am using resign.jar ,i got stuck up over here.
Actually i have set Android_Home and every other variables are set but when i drop the apk file and save it by some name the .jar file is getting hanged up.
What might be the issue.!
| android-emulator | null | null | null | null | null | open | Android APK resign.jar is getting hanged
===
Actually i am working on android platform,I am using robotium for automation testing.In my scenario i dont have the code i only have the apk file of an application which i can resign it and do my automation testing.For resigning of signature of apk i am using resign.jar ,i got stuck up over here.
Actually i have set Android_Home and every other variables are set but when i drop the apk file and save it by some name the .jar file is getting hanged up.
What might be the issue.!
| 0 |
11,411,231 | 07/10/2012 10:19:53 | 1,503,496 | 07/05/2012 09:20:24 | 6 | 0 | Display image in a cocoa status app | Hi I developed a cocoa status app. when I put a long title for example , it can't be shown and if i put an image as icon too it can't be shown , but if i put a small title it works correctly.
How can I fix this problem and make the image shown? | objective-c | cocoa | nsimage | nsstatusitem | null | null | open | Display image in a cocoa status app
===
Hi I developed a cocoa status app. when I put a long title for example , it can't be shown and if i put an image as icon too it can't be shown , but if i put a small title it works correctly.
How can I fix this problem and make the image shown? | 0 |
11,411,232 | 07/10/2012 10:19:59 | 1,165,036 | 01/23/2012 13:36:03 | 388 | 27 | How to highlight edited cell in a datagrid | How can I highlight a cell in DataGrid that has been edited? XAML solution through some style using triggers is preferable. But if not possible, then a code behind approach would be good enough.
I am not posting any code as I did not have any break through with the problem. | datagrid | cell | wpf-4.0 | null | null | null | open | How to highlight edited cell in a datagrid
===
How can I highlight a cell in DataGrid that has been edited? XAML solution through some style using triggers is preferable. But if not possible, then a code behind approach would be good enough.
I am not posting any code as I did not have any break through with the problem. | 0 |
11,411,233 | 07/10/2012 10:20:00 | 1,211,663 | 02/15/2012 15:08:16 | 31 | 0 | Android: FrameLayout squeezes View |
I am using the following layout:
![enter image description here][1]
FrameLayout fills the entire Viewport, i.e. width and height are set to MATCH_PARENT
Width and height of RelativeLayout are set to WRAP_CONTENT
View1 to View5 have fixed dimensions e.g. width = 500, height = 50
View 5 lies near the border of FrameLayout and is squeezed by Android,
so that it lies fully within FrameLayout. The height of View5 should be 50 but unfortunately Android changes it to a smaller value.
How can I avoid, that Android changes the height of View5 ?
When I scroll RelativeLayout, the error is still existing.
A similar behavior is described here:
http://stackoverflow.com/questions/10760011/button-is-squeezed-when-it-exceeds-layout
[1]: http://i.stack.imgur.com/drMMb.jpg | android | framelayout | null | null | null | null | open | Android: FrameLayout squeezes View
===
I am using the following layout:
![enter image description here][1]
FrameLayout fills the entire Viewport, i.e. width and height are set to MATCH_PARENT
Width and height of RelativeLayout are set to WRAP_CONTENT
View1 to View5 have fixed dimensions e.g. width = 500, height = 50
View 5 lies near the border of FrameLayout and is squeezed by Android,
so that it lies fully within FrameLayout. The height of View5 should be 50 but unfortunately Android changes it to a smaller value.
How can I avoid, that Android changes the height of View5 ?
When I scroll RelativeLayout, the error is still existing.
A similar behavior is described here:
http://stackoverflow.com/questions/10760011/button-is-squeezed-when-it-exceeds-layout
[1]: http://i.stack.imgur.com/drMMb.jpg | 0 |
11,411,234 | 07/10/2012 10:20:01 | 1,492,799 | 06/30/2012 09:14:31 | 1 | 0 | Search a file with a zimage file extension in Qt | I am writing a program to upgrade a firmware using a flash drive. I need to upgrade the Kernel with the image present in the flash device. But I am not getting any idea of how to find a file with zimage file extension in a directory.
I am new to Qt and Linux. So I dont know whether it is possible to find the file with particular format. Can anyone help on this.
Thanks in advance. | c++ | linux | qt | null | null | null | open | Search a file with a zimage file extension in Qt
===
I am writing a program to upgrade a firmware using a flash drive. I need to upgrade the Kernel with the image present in the flash device. But I am not getting any idea of how to find a file with zimage file extension in a directory.
I am new to Qt and Linux. So I dont know whether it is possible to find the file with particular format. Can anyone help on this.
Thanks in advance. | 0 |
11,373,482 | 07/07/2012 08:23:50 | 1,391,118 | 05/12/2012 13:53:56 | 58 | 0 | calculating total retweets TO a user by JSON Parsing | I am calculating total number of retweets in C#,My Idea is to calulate the `retweeted_status` field in the JSON response.I am using JSON.NET.Is there any shorter way to calculate it?
Other way would be to create the classes and populate the Response and iterate theough the object.But I am looking for a shorter way because Its just a simple count.
Any one who can help me,
[This is JSON response][1]
[1]: http://jsonviewer.stack.hu/#http://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&include_rts=true&screen_name=uxmangjx&count=200 | c# | json | c#-4.0 | json.net | null | null | open | calculating total retweets TO a user by JSON Parsing
===
I am calculating total number of retweets in C#,My Idea is to calulate the `retweeted_status` field in the JSON response.I am using JSON.NET.Is there any shorter way to calculate it?
Other way would be to create the classes and populate the Response and iterate theough the object.But I am looking for a shorter way because Its just a simple count.
Any one who can help me,
[This is JSON response][1]
[1]: http://jsonviewer.stack.hu/#http://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&include_rts=true&screen_name=uxmangjx&count=200 | 0 |
11,373,483 | 07/07/2012 08:23:53 | 1,044,394 | 11/13/2011 17:13:41 | 127 | 7 | How to change a javascript variable to PHP | I have a Javascript variable `screenName` for twitter users. When they connect to my site, I want a php script to write their name in a txt file. How could I do this. I looked into writing files with AJAX but no luck.
<script type="text/javascript">
twttr.anywhere(function (T) {
var currentUser,
screenName,
profileImage,
profileImageTag;
if (T.isConnected()) {
currentUser = T.currentUser;
screenName = currentUser.data('screen_name');
$('#twitter-connect-placeholder').append("<p style='color:white;text-shadow:none;'>Howdy " +" " + screenName + "!");
var screenName = "<?= $js ?>";
}
});
</script>
<?php
$check = $_GET['track'];
if ($check == '1') {
$fp = fopen('data.txt', 'a');
fwrite($fp, "{$js}");
fclose($fp);
}
?>
If you view the source `screenName` equals ""
Any ideas on this? | php | javascript | ajax | twitter | null | null | open | How to change a javascript variable to PHP
===
I have a Javascript variable `screenName` for twitter users. When they connect to my site, I want a php script to write their name in a txt file. How could I do this. I looked into writing files with AJAX but no luck.
<script type="text/javascript">
twttr.anywhere(function (T) {
var currentUser,
screenName,
profileImage,
profileImageTag;
if (T.isConnected()) {
currentUser = T.currentUser;
screenName = currentUser.data('screen_name');
$('#twitter-connect-placeholder').append("<p style='color:white;text-shadow:none;'>Howdy " +" " + screenName + "!");
var screenName = "<?= $js ?>";
}
});
</script>
<?php
$check = $_GET['track'];
if ($check == '1') {
$fp = fopen('data.txt', 'a');
fwrite($fp, "{$js}");
fclose($fp);
}
?>
If you view the source `screenName` equals ""
Any ideas on this? | 0 |
11,352,404 | 07/05/2012 20:52:46 | 1,505,134 | 07/05/2012 20:31:55 | 1 | 0 | Form post data from checkboxes lost in Firefox using cakePHP Formhelper | I'm developping my first cakePHP application and I encountered my first major problem. I have a Search/Filter form which submits data to the Index action of my controller. This is all done using cakePHP's Formhelper. I then access this data using $this->data. It works fine in chrome and IE, but in Firefox all my fields are empty. According to the post data from Firebug, the HTML is fine.
http://i.imgur.com/SznRc.png
What am I missing? | html | firefox | cakephp | null | null | null | open | Form post data from checkboxes lost in Firefox using cakePHP Formhelper
===
I'm developping my first cakePHP application and I encountered my first major problem. I have a Search/Filter form which submits data to the Index action of my controller. This is all done using cakePHP's Formhelper. I then access this data using $this->data. It works fine in chrome and IE, but in Firefox all my fields are empty. According to the post data from Firebug, the HTML is fine.
http://i.imgur.com/SznRc.png
What am I missing? | 0 |
11,373,531 | 07/07/2012 08:33:43 | 1,416,975 | 05/25/2012 08:54:17 | 1 | 0 | quartz with eclipse source not found error | Hai friends i want to run the Helloworld quartz program in eclipse as a java application. when i run this in eclipse i got the following source not found error.
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at org.quartz.impl.StdSchedulerFactory.<init>(StdSchedulerFactory.java:274)
at org.quartz.impl.StdSchedulerFactory.getDefaultScheduler(StdSchedulerFactory.java:1498)
at testing.QuartzTest.main(QuartzTest.java:18)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 3 more
My Hellojob.java is
package testing;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
public class Hellojob implements Job {
public Hellojob() {
}
public void execute(JobExecutionContext context)
throws JobExecutionException
{
System.err.println("Hello! HelloJob is executing.");
System.out.println("HellowJob is executing");
}
}
And my Quartztest.java
package testing;
import static org.quartz.JobBuilder.*;
import static org.quartz.SimpleScheduleBuilder.*;
import static org.quartz.TriggerBuilder.*;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.Trigger;
import org.quartz.impl.StdSchedulerFactory;
public class QuartzTest {
public static void main(String[] args) throws InterruptedException {
System.out.println("MAIN!!!!");
try {
// Grab the Scheduler instance from the Factory
Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();
// define the job and tie it to our HelloJob class
JobDetail job = newJob (Hellojob.class)
.withIdentity("job1", "group1")
.build();
// Trigger the job to run now, and then repeat every 40 seconds
Trigger trigger = newTrigger()
.withIdentity("trigger1", "group1")
.startNow()
.withSchedule(simpleSchedule()
.withIntervalInSeconds(40)
.repeatForever())
.build();
scheduler.scheduleJob(job, trigger);
// and start it off
scheduler.start();
Thread.sleep(60000);
//scheduler.shutdown();
} catch (SchedulerException se) {
se.printStackTrace();
}
}
}
And i have already attach those jar files and set path to those jars. What else i m missing.
Pls enyone help to me....
| eclipse | quartz | null | null | null | null | open | quartz with eclipse source not found error
===
Hai friends i want to run the Helloworld quartz program in eclipse as a java application. when i run this in eclipse i got the following source not found error.
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at org.quartz.impl.StdSchedulerFactory.<init>(StdSchedulerFactory.java:274)
at org.quartz.impl.StdSchedulerFactory.getDefaultScheduler(StdSchedulerFactory.java:1498)
at testing.QuartzTest.main(QuartzTest.java:18)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 3 more
My Hellojob.java is
package testing;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
public class Hellojob implements Job {
public Hellojob() {
}
public void execute(JobExecutionContext context)
throws JobExecutionException
{
System.err.println("Hello! HelloJob is executing.");
System.out.println("HellowJob is executing");
}
}
And my Quartztest.java
package testing;
import static org.quartz.JobBuilder.*;
import static org.quartz.SimpleScheduleBuilder.*;
import static org.quartz.TriggerBuilder.*;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.Trigger;
import org.quartz.impl.StdSchedulerFactory;
public class QuartzTest {
public static void main(String[] args) throws InterruptedException {
System.out.println("MAIN!!!!");
try {
// Grab the Scheduler instance from the Factory
Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();
// define the job and tie it to our HelloJob class
JobDetail job = newJob (Hellojob.class)
.withIdentity("job1", "group1")
.build();
// Trigger the job to run now, and then repeat every 40 seconds
Trigger trigger = newTrigger()
.withIdentity("trigger1", "group1")
.startNow()
.withSchedule(simpleSchedule()
.withIntervalInSeconds(40)
.repeatForever())
.build();
scheduler.scheduleJob(job, trigger);
// and start it off
scheduler.start();
Thread.sleep(60000);
//scheduler.shutdown();
} catch (SchedulerException se) {
se.printStackTrace();
}
}
}
And i have already attach those jar files and set path to those jars. What else i m missing.
Pls enyone help to me....
| 0 |
11,373,534 | 07/07/2012 08:34:32 | 1,487,826 | 06/28/2012 07:53:59 | 11 | 0 | How to select multiple deep DOM using JQUERY | I have multiple level DOM elements, But I still finding how to select DOM element.
My html here.
<div class="data"><div class="item"><form class="comment" method="post" action=""><div class="d1"><a href="">Tree</a><p></p></div><div class="d2"><p class="quote"></div><div class="col p3"><input type="hidden" name="token" value=""/><input type="hidden" name="u" value=""/><input type="button" class="button" name="submit"/><br><abbr class="selected_dom" title="2012-07-05T11:29:22Z">July 1, 2012</abbr></div></form></div></div>
Can you please help me how to select this `<abbr class="selected_dom" title="2012-07-05T11:29:22Z">July 1, 2012</abbr>` ?
| jquery | dom | null | null | null | null | open | How to select multiple deep DOM using JQUERY
===
I have multiple level DOM elements, But I still finding how to select DOM element.
My html here.
<div class="data"><div class="item"><form class="comment" method="post" action=""><div class="d1"><a href="">Tree</a><p></p></div><div class="d2"><p class="quote"></div><div class="col p3"><input type="hidden" name="token" value=""/><input type="hidden" name="u" value=""/><input type="button" class="button" name="submit"/><br><abbr class="selected_dom" title="2012-07-05T11:29:22Z">July 1, 2012</abbr></div></form></div></div>
Can you please help me how to select this `<abbr class="selected_dom" title="2012-07-05T11:29:22Z">July 1, 2012</abbr>` ?
| 0 |
11,373,536 | 07/07/2012 08:34:52 | 230,809 | 12/13/2009 19:57:52 | 395 | 7 | Play framework hangs on startup at: "Loading project definition from" | I am just getting started with Play Framework. I have downloaded and installed play and created a sample java application. When I try to start the play console in the application directory it hangs at "Loading project definition".
PS C:\dev\play\javatest> play.bat
Getting org.scala-sbt sbt_2.9.1 0.11.3 ...
:: retrieving :: org.scala-sbt#boot-app
confs: [default]
37 artifacts copied, 0 already retrieved (7245kB/283ms)
[info] Loading project definition from C:\dev\play\myFirstApp\project
When i try running a Scala application i get a message about it waiting for a lock:
PS C:\dev\play\scalatest> play
[info] Loading project definition from C:\dev\play\test1\project
Waiting for lock on C:\lib\play\repository\.sbt.ivy.lock to be available...
Running Windows 7, JDK 1.7.0_05 and Play Framework 2.0.2. Any ideas? | playframework | null | null | null | null | null | open | Play framework hangs on startup at: "Loading project definition from"
===
I am just getting started with Play Framework. I have downloaded and installed play and created a sample java application. When I try to start the play console in the application directory it hangs at "Loading project definition".
PS C:\dev\play\javatest> play.bat
Getting org.scala-sbt sbt_2.9.1 0.11.3 ...
:: retrieving :: org.scala-sbt#boot-app
confs: [default]
37 artifacts copied, 0 already retrieved (7245kB/283ms)
[info] Loading project definition from C:\dev\play\myFirstApp\project
When i try running a Scala application i get a message about it waiting for a lock:
PS C:\dev\play\scalatest> play
[info] Loading project definition from C:\dev\play\test1\project
Waiting for lock on C:\lib\play\repository\.sbt.ivy.lock to be available...
Running Windows 7, JDK 1.7.0_05 and Play Framework 2.0.2. Any ideas? | 0 |
11,373,541 | 07/07/2012 08:36:08 | 1,465,903 | 06/19/2012 09:00:20 | 1 | 0 | makedict in ICS keyboard Android | I try to use main.dict from gingerbread keyboard but it's not working. then I try to makedict from xml file to main.dict base on ics source code. The problem is if word in xml file is not much(10-20) I can use it but if I try to add more it has error said that cannot open resource file.Logcat said it has been compressed. I don't know why and how to fix it. | android | dictionary | keyboard | binary | ics | null | open | makedict in ICS keyboard Android
===
I try to use main.dict from gingerbread keyboard but it's not working. then I try to makedict from xml file to main.dict base on ics source code. The problem is if word in xml file is not much(10-20) I can use it but if I try to add more it has error said that cannot open resource file.Logcat said it has been compressed. I don't know why and how to fix it. | 0 |
11,373,546 | 07/07/2012 08:36:48 | 1,163,760 | 01/22/2012 18:28:44 | 36 | 3 | iOS - when to use strong or weak for properties | I have a `tableView` as an `IBOutlet`, and by default XCode set it's property to `strong` rather than `weak`. sometimes I get receiveMemoryWarning message. So I tried to change many properties from `strong` to `weak`. and it doesn't seem to affect the process and things work smooth n fine. should I set the outlets to weak? or am I wrong?
and most importantly, should I set **ALL** properties to 'nil' in the `viewDidUnload` method? or only the `IBOutlets`? | properties | weak-references | null | null | null | null | open | iOS - when to use strong or weak for properties
===
I have a `tableView` as an `IBOutlet`, and by default XCode set it's property to `strong` rather than `weak`. sometimes I get receiveMemoryWarning message. So I tried to change many properties from `strong` to `weak`. and it doesn't seem to affect the process and things work smooth n fine. should I set the outlets to weak? or am I wrong?
and most importantly, should I set **ALL** properties to 'nil' in the `viewDidUnload` method? or only the `IBOutlets`? | 0 |
11,373,549 | 07/07/2012 08:38:00 | 1,150,619 | 06/29/2011 07:43:03 | 1,710 | 117 | MySQL COUNT query in join | I have two tables.
The first table is the member table
MEMBER TABLE
ID | NAME
1 | User
2 | Another User
3 | Some other User
and the second table is friends
FRIENDS TABLE
ID | member_id | Friend Name | Notified
1 | 1 | Friend #1 | 0
2 | 1 | Friend #1 | 1
3 | 2 | Friend #1 | 0
4 | 1 | Friend #1 | 1
5 | 2 | Friend #1 | 1
What I like to do is to get the member table information but also to get the total notified friends for each member.
What I have done until now is that
SELECT
M.ID
M.NAME
COUNT(F.notified)
FROM
MEMBER AS M
LEFT JOIN
FRIENDS AS F
ON
F.member_id = M.id
WHERE
F.notified = 1
GROUP BY
M.id
But this, not working for me, because if I have a member with not notified friends, the query does not included in the results.
In the above code for example the member with ID 3 will not included in my results.
Any idea on how to modify that query in order to return even members with no notified friends ?
Kind regards
Merianos Nikos | mysql | sql | query | null | null | null | open | MySQL COUNT query in join
===
I have two tables.
The first table is the member table
MEMBER TABLE
ID | NAME
1 | User
2 | Another User
3 | Some other User
and the second table is friends
FRIENDS TABLE
ID | member_id | Friend Name | Notified
1 | 1 | Friend #1 | 0
2 | 1 | Friend #1 | 1
3 | 2 | Friend #1 | 0
4 | 1 | Friend #1 | 1
5 | 2 | Friend #1 | 1
What I like to do is to get the member table information but also to get the total notified friends for each member.
What I have done until now is that
SELECT
M.ID
M.NAME
COUNT(F.notified)
FROM
MEMBER AS M
LEFT JOIN
FRIENDS AS F
ON
F.member_id = M.id
WHERE
F.notified = 1
GROUP BY
M.id
But this, not working for me, because if I have a member with not notified friends, the query does not included in the results.
In the above code for example the member with ID 3 will not included in my results.
Any idea on how to modify that query in order to return even members with no notified friends ?
Kind regards
Merianos Nikos | 0 |
11,542,468 | 07/18/2012 13:24:20 | 1,534,892 | 07/18/2012 13:17:18 | 1 | 0 | writing a mobile version of a web service in vb.net | I've been asked to take an api call -for getting search results- which is present as a web service on a particular website, then to write a mobile version of it. I have no idea where to start though, and was hoping someone could point me in the right direction. Thank you, any help is greatly appreciated. | vb.net | web-services | mobile | null | null | null | open | writing a mobile version of a web service in vb.net
===
I've been asked to take an api call -for getting search results- which is present as a web service on a particular website, then to write a mobile version of it. I have no idea where to start though, and was hoping someone could point me in the right direction. Thank you, any help is greatly appreciated. | 0 |
11,542,470 | 07/18/2012 13:24:27 | 1,478,133 | 06/24/2012 13:36:46 | 21 | 0 | chack gps, cell tower and wifi availability - blackberry | I am acquiring the current location in my BlackBerry app through GPS and it is working fine. This location is being updated every few seconds. I would like to introduce a logic to check the availability of GPS, wifi and cell tower and based on that start tracking the location. If for instance, it starts to get location from cell tower and suddenly GPS is now available, I want it to switch to GPS to get coordinates and so on. How should I determine which is available. Please help. | blackberry | gps | location | null | null | null | open | chack gps, cell tower and wifi availability - blackberry
===
I am acquiring the current location in my BlackBerry app through GPS and it is working fine. This location is being updated every few seconds. I would like to introduce a logic to check the availability of GPS, wifi and cell tower and based on that start tracking the location. If for instance, it starts to get location from cell tower and suddenly GPS is now available, I want it to switch to GPS to get coordinates and so on. How should I determine which is available. Please help. | 0 |
11,542,533 | 07/18/2012 13:27:51 | 1,140,759 | 01/10/2012 11:47:21 | 13 | 0 | Wicket : Check of CheckGroup not getting the selected options and perform the submit action | I'm a newbie to WICKET and got stuck using PageableListView.
For selection of individual checkboxes I'm using Check and for group selection CheckGroupSelector .
Now inspite of using Check if I use CheckBox my code works fine but unable to get selectall working......
Pasting the piece of code for reference.
final CheckGroup<DriveInfo> group = new CheckGroup<DriveInfo>("group", new ArrayList<DriveInfo>());
driveSearchForm.add(group);
group.add(new CheckGroupSelector("allSelected"));
group.setOutputMarkupId(true);
PageableListView<DashboardModel> pageableListView = new PageableListView<DashboardModel>("searchResults",
driveDataModel, 50) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<DashboardModel> item) {
DashboardModel model = item.getModelObject();
item.add(new Check("selected", new PropertyModel(model, "selected")));
item.add(new Label("name", item.getModelObject().getName()));
item.add(new Label("status", item.getModelObject().getStatus().toString()));
item.add(new Label("driveUrl", item.getModelObject().getDriveURL()));
}
};
pageableListView.setReuseItems(true);
Now instead of item.add(new Check("selected", new PropertyModel(model, "selected")));
if i use item.add(new CheckBox("selected", new PropertyModel(model, "selected")));
it's working fine......but how should I get selectall(i.e. CheckGroupSelector) also working . | java | wicket | null | null | null | null | open | Wicket : Check of CheckGroup not getting the selected options and perform the submit action
===
I'm a newbie to WICKET and got stuck using PageableListView.
For selection of individual checkboxes I'm using Check and for group selection CheckGroupSelector .
Now inspite of using Check if I use CheckBox my code works fine but unable to get selectall working......
Pasting the piece of code for reference.
final CheckGroup<DriveInfo> group = new CheckGroup<DriveInfo>("group", new ArrayList<DriveInfo>());
driveSearchForm.add(group);
group.add(new CheckGroupSelector("allSelected"));
group.setOutputMarkupId(true);
PageableListView<DashboardModel> pageableListView = new PageableListView<DashboardModel>("searchResults",
driveDataModel, 50) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<DashboardModel> item) {
DashboardModel model = item.getModelObject();
item.add(new Check("selected", new PropertyModel(model, "selected")));
item.add(new Label("name", item.getModelObject().getName()));
item.add(new Label("status", item.getModelObject().getStatus().toString()));
item.add(new Label("driveUrl", item.getModelObject().getDriveURL()));
}
};
pageableListView.setReuseItems(true);
Now instead of item.add(new Check("selected", new PropertyModel(model, "selected")));
if i use item.add(new CheckBox("selected", new PropertyModel(model, "selected")));
it's working fine......but how should I get selectall(i.e. CheckGroupSelector) also working . | 0 |
11,542,535 | 07/18/2012 13:27:55 | 652,669 | 03/10/2011 00:30:52 | 1,087 | 89 | Asynchronous call with AJAX or ASP.NET? | #Context
I have this function which synchronize a list of sites between a table and several remote IIS:
namespace Dashboard.Controllers
{
public class SiteController : Controller
{
public ActionResult Synchronize()
{
SiteModel.synchronizeDBWithIIS();
return Content("Cool.");
}
}
}
I want to call this function asynchronously when the dashboard is starting and running.
#Questions
- You advise me to do a `$.get()` with jQuery or to use a specific asp.net method?
- May be use `Application_start()` in `Global.asax`?
- Furthermore, can I improve this controller for synchronization go faster? | c# | asp.net | ajax | asp.net-mvc | asynchronous | null | open | Asynchronous call with AJAX or ASP.NET?
===
#Context
I have this function which synchronize a list of sites between a table and several remote IIS:
namespace Dashboard.Controllers
{
public class SiteController : Controller
{
public ActionResult Synchronize()
{
SiteModel.synchronizeDBWithIIS();
return Content("Cool.");
}
}
}
I want to call this function asynchronously when the dashboard is starting and running.
#Questions
- You advise me to do a `$.get()` with jQuery or to use a specific asp.net method?
- May be use `Application_start()` in `Global.asax`?
- Furthermore, can I improve this controller for synchronization go faster? | 0 |
11,542,537 | 07/18/2012 13:27:57 | 1,341,214 | 04/18/2012 11:44:12 | 1 | 0 | Apple pushNotification with Javapns "Invalid certificate chain" | I making web services for apple pushnotification but on pushing the notification
Push.alert("notification test", "C:/Temp/myCertificates.p12", "myPassword", false, TokenId);
i got error:
javapns.notification.PushNotificationManager? - Delivery error: javapns.communication.exceptions.InvalidCertificateChainException?: Invalid certificate chain (Received fatal alert: certificate_unknown)! Verify that the keystore you provided was produced according to specs...
I am using jdk version 1.6.And i am testing notification in developement not in production. why this problem is occurring,what will be solution..?? please suggest me as soon as possible.
Thanks in advance!!!!! | apple | apple-push-notifications | java-api | null | null | null | open | Apple pushNotification with Javapns "Invalid certificate chain"
===
I making web services for apple pushnotification but on pushing the notification
Push.alert("notification test", "C:/Temp/myCertificates.p12", "myPassword", false, TokenId);
i got error:
javapns.notification.PushNotificationManager? - Delivery error: javapns.communication.exceptions.InvalidCertificateChainException?: Invalid certificate chain (Received fatal alert: certificate_unknown)! Verify that the keystore you provided was produced according to specs...
I am using jdk version 1.6.And i am testing notification in developement not in production. why this problem is occurring,what will be solution..?? please suggest me as soon as possible.
Thanks in advance!!!!! | 0 |
11,542,538 | 07/18/2012 13:27:57 | 633,676 | 02/25/2011 06:38:02 | 3,772 | 221 | How to show Image editing screen with custom camera overlay with takePicture method | In my application I have to show a custom camera overlay.It is showing perfectly.
On that view , I have a button which hits the method `takePicture` which is responsible for capturing image from camera.
My problem is after I shoot a photo, I need to show the image editing screen as it is shown when we used the default camera.
Please help me how to show the image editing screen which appears after taking image from camera when the camera overlay is nil but in my case it is necessary to customize the camera overlay.
So please suggest me how to show the image preview(editing)screen with custom camera overlay view.
Any help would be highly appreciated!
Thanks in advance. | iphone | objective-c | ios | overlay | uiimagepickercontroller | null | open | How to show Image editing screen with custom camera overlay with takePicture method
===
In my application I have to show a custom camera overlay.It is showing perfectly.
On that view , I have a button which hits the method `takePicture` which is responsible for capturing image from camera.
My problem is after I shoot a photo, I need to show the image editing screen as it is shown when we used the default camera.
Please help me how to show the image editing screen which appears after taking image from camera when the camera overlay is nil but in my case it is necessary to customize the camera overlay.
So please suggest me how to show the image preview(editing)screen with custom camera overlay view.
Any help would be highly appreciated!
Thanks in advance. | 0 |
11,542,548 | 07/18/2012 13:28:17 | 1,395,109 | 05/15/2012 03:22:08 | 16 | 0 | Jboss7.1 Change Server Banner response header | For some security reasons in out project the normal server banner header
Server : Apache-Coyote/1.1
Needs to be changed, I have tried adding following in the standalone.xml system properties
<property name="org.apache.coyote.http11.Http11Protocol.SERVER" value="secureserver"/>
But this doesn't seems to work, is there any other setting or property change to achive this? | httpresponse | jboss7.x | null | null | null | null | open | Jboss7.1 Change Server Banner response header
===
For some security reasons in out project the normal server banner header
Server : Apache-Coyote/1.1
Needs to be changed, I have tried adding following in the standalone.xml system properties
<property name="org.apache.coyote.http11.Http11Protocol.SERVER" value="secureserver"/>
But this doesn't seems to work, is there any other setting or property change to achive this? | 0 |
11,542,554 | 07/18/2012 13:28:29 | 1,534,879 | 07/18/2012 13:12:57 | 1 | 0 | Box-shadow, border doesn't show on top-bottom of element | Alright so, I have a carousel slider using a public jquery script and it seems like I'm dealing with some problems with the style of the boxes for the slider.
Everything is fine except that the border and the shadow isn't appearing on the top and on the bottom of the box. (Like it's cut there).
I've tried to add bigger height on my ul or padding, on the li too.. and nothing seemed to work.
Here's the HTML:
<div class="carousel">
<ul id="carousel-list">
<li>
<img src="img/img1.png" width="200" height="150" />
<div class="mask">
<a href="#" class="info">+</a> </div>
</li>
<li>
<img src="img/img2.png" width="200" height="150" />
<div class="mask">
<a href="#" class="info">+</a> </div>
</li>
<li>
<img src="img/img3.png" width="200" height="150" />
<div class="mask">
<a href="#" class="info">+</a> </div>
</li>
<li>
<img src="img/img4.png" width="200" height="150" />
<div class="mask">
<a href="#" class="info">+</a> </div>
</li>
<li>
<img src="img/img5.png" width="200" height="150" />
<div class="mask">
<a href="#" class="info">+</a> </div>
</li>
<li>
<img src="img/img6.png" width="200" height="150" />
<div class="mask">
<a href="#" class="info">+</a> </div>
</li>
<li>
<img src="img/img6.png" width="200" height="150" />
<div class="mask">
<a href="#" class="info">+</a> </div>
</li>
</ul>
<a href="#" class="prev-btn">Prev</a>
<a href="#" class="next-btn">Next</a>
</div>
And the CSS here (Where I believe to be the issue):
-> I know its kind of dirty right now, I was supposed to clean it up as soon as I find out what's wrong with the boxes.
.carousel {
width:870px;
position:relative;
}
.carousel ul {
list-style-type:none;
margin: 0;
padding: 0;
display: block;
overflow:hidden;
}
.carousel ul li {
float:left;
padding:0;
margin:0 14px 0 0;
overflow: hidden;
position: relative;
left:2px;
text-align: center;
cursor: default;
box-shadow: 0 0 6px rgba(0,0,0, .2), 0 0 0 1px #d6d6d6;
border: solid #fff 3px;
}
.carousel ul li:last-child {
margin-right:0;
}
a.next-btn, a.prev-btn {
position:absolute;
top:-58px;
left:788px;
width:39px;
height:25px;
display:block;
text-indent:-9999px;
}
a.next-btn {
left:830px;
background-image:url(../img/carousel-next.png);
}
a.next-btn:hover {
background-image:url(../img/carousel-next-hover.png);
}
a.prev-btn {
background-image:url(../img/carousel-prev.png);
}
a.prev-btn:hover {
background-image:url(../img/carousel-prev-hover.png);
}
.carousel ul li:hover {
box-shadow: 0 0 12px rgba(0,0,0, .3), 0 0 0 1px #d6d6d6;
}
.carousel ul li img {
width: 200px;
height: 150px;
display: block;
float: left;
position: relative;
}
.carousel ul li .mask {
width: 200px;
height: 150px;
overflow: hidden;
position:absolute;
top: 0;
left: 0;
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
opacity: 0;
background-color: rgba(255,102,0, 0.7);
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
-ms-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
}
.carousel ul li:hover .mask {
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=100)";
filter: alpha(opacity=100);
opacity: 1;
}
.carousel ul li a.info {
font-family: 'PT Sans', sans-serif;
font-size:1.063em;
display: inline-block;
margin:auto;
padding: 3px 12px;
background: rgba(0, 0, 0, 0.8);
color: #fff;
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
opacity: 0;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
-ms-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.carousel ul li a.info:hover {
background: rgba(255, 255, 255, 0.8);
color:#ff6600;
text-shadow:none;
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=100)";
filter: alpha(opacity=100);
opacity: 1;
-webkit-transform: translateY(0px);
-moz-transform: translateY(0px);
-o-transform: translateY(0px);
-ms-transform: translateY(0px);
transform: translateY(0px);
}
.carousel ul li:hover a.info {
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=100)";
filter: alpha(opacity=100);
opacity: 1;
-webkit-transform: translateY(100px);
-moz-transform: translateY(100px);
-o-transform: translateY(100px);
-ms-transform: translateY(100px);
transform: translateY(100px);
-webkit-transition-delay: 0.2s;
-moz-transition-delay: 0.2s;
-o-transition-delay: 0.2s;
-ms-transition-delay: 0.2s;
transition-delay: 0.2s;
}
Here's an image of the issue: i.stack.imgur.com/Sh9K4.png
Thank you in advance, I'm hoping it's just something I missed and can be fixed easily! | slider | border | padding | box | box-shadow | null | open | Box-shadow, border doesn't show on top-bottom of element
===
Alright so, I have a carousel slider using a public jquery script and it seems like I'm dealing with some problems with the style of the boxes for the slider.
Everything is fine except that the border and the shadow isn't appearing on the top and on the bottom of the box. (Like it's cut there).
I've tried to add bigger height on my ul or padding, on the li too.. and nothing seemed to work.
Here's the HTML:
<div class="carousel">
<ul id="carousel-list">
<li>
<img src="img/img1.png" width="200" height="150" />
<div class="mask">
<a href="#" class="info">+</a> </div>
</li>
<li>
<img src="img/img2.png" width="200" height="150" />
<div class="mask">
<a href="#" class="info">+</a> </div>
</li>
<li>
<img src="img/img3.png" width="200" height="150" />
<div class="mask">
<a href="#" class="info">+</a> </div>
</li>
<li>
<img src="img/img4.png" width="200" height="150" />
<div class="mask">
<a href="#" class="info">+</a> </div>
</li>
<li>
<img src="img/img5.png" width="200" height="150" />
<div class="mask">
<a href="#" class="info">+</a> </div>
</li>
<li>
<img src="img/img6.png" width="200" height="150" />
<div class="mask">
<a href="#" class="info">+</a> </div>
</li>
<li>
<img src="img/img6.png" width="200" height="150" />
<div class="mask">
<a href="#" class="info">+</a> </div>
</li>
</ul>
<a href="#" class="prev-btn">Prev</a>
<a href="#" class="next-btn">Next</a>
</div>
And the CSS here (Where I believe to be the issue):
-> I know its kind of dirty right now, I was supposed to clean it up as soon as I find out what's wrong with the boxes.
.carousel {
width:870px;
position:relative;
}
.carousel ul {
list-style-type:none;
margin: 0;
padding: 0;
display: block;
overflow:hidden;
}
.carousel ul li {
float:left;
padding:0;
margin:0 14px 0 0;
overflow: hidden;
position: relative;
left:2px;
text-align: center;
cursor: default;
box-shadow: 0 0 6px rgba(0,0,0, .2), 0 0 0 1px #d6d6d6;
border: solid #fff 3px;
}
.carousel ul li:last-child {
margin-right:0;
}
a.next-btn, a.prev-btn {
position:absolute;
top:-58px;
left:788px;
width:39px;
height:25px;
display:block;
text-indent:-9999px;
}
a.next-btn {
left:830px;
background-image:url(../img/carousel-next.png);
}
a.next-btn:hover {
background-image:url(../img/carousel-next-hover.png);
}
a.prev-btn {
background-image:url(../img/carousel-prev.png);
}
a.prev-btn:hover {
background-image:url(../img/carousel-prev-hover.png);
}
.carousel ul li:hover {
box-shadow: 0 0 12px rgba(0,0,0, .3), 0 0 0 1px #d6d6d6;
}
.carousel ul li img {
width: 200px;
height: 150px;
display: block;
float: left;
position: relative;
}
.carousel ul li .mask {
width: 200px;
height: 150px;
overflow: hidden;
position:absolute;
top: 0;
left: 0;
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
opacity: 0;
background-color: rgba(255,102,0, 0.7);
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
-ms-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
}
.carousel ul li:hover .mask {
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=100)";
filter: alpha(opacity=100);
opacity: 1;
}
.carousel ul li a.info {
font-family: 'PT Sans', sans-serif;
font-size:1.063em;
display: inline-block;
margin:auto;
padding: 3px 12px;
background: rgba(0, 0, 0, 0.8);
color: #fff;
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
opacity: 0;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
-ms-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.carousel ul li a.info:hover {
background: rgba(255, 255, 255, 0.8);
color:#ff6600;
text-shadow:none;
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=100)";
filter: alpha(opacity=100);
opacity: 1;
-webkit-transform: translateY(0px);
-moz-transform: translateY(0px);
-o-transform: translateY(0px);
-ms-transform: translateY(0px);
transform: translateY(0px);
}
.carousel ul li:hover a.info {
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=100)";
filter: alpha(opacity=100);
opacity: 1;
-webkit-transform: translateY(100px);
-moz-transform: translateY(100px);
-o-transform: translateY(100px);
-ms-transform: translateY(100px);
transform: translateY(100px);
-webkit-transition-delay: 0.2s;
-moz-transition-delay: 0.2s;
-o-transition-delay: 0.2s;
-ms-transition-delay: 0.2s;
transition-delay: 0.2s;
}
Here's an image of the issue: i.stack.imgur.com/Sh9K4.png
Thank you in advance, I'm hoping it's just something I missed and can be fixed easily! | 0 |
11,542,555 | 07/18/2012 13:28:29 | 614,800 | 02/13/2011 04:39:37 | 123 | 4 | Is it possible to state in one place that all outbound jms messages should have certain outbound property? | I would like my outbound jms messages (either to queues or topics) to contain certain outbound property. Is it possible to state that in one place (say, for example, at the connector level)? | mule | null | null | null | null | null | open | Is it possible to state in one place that all outbound jms messages should have certain outbound property?
===
I would like my outbound jms messages (either to queues or topics) to contain certain outbound property. Is it possible to state that in one place (say, for example, at the connector level)? | 0 |
11,542,557 | 07/18/2012 13:28:34 | 1,113,435 | 12/23/2011 12:49:20 | 658 | 44 | DOMDocument getElementsByTagName not working | I'm trying to use the `DOMDocument` function `getElementsByTagName()`, but it keeps returning an empty object. I'm using the following code:
// Create some HTML
$output = '
<html>
<body>
<a href="foo">Bar</a>
</body>
</html>';
// Load the HTML
$dom = new DOMDocument;
$dom->loadHTML($output);
// Find all links (a tags)
$links = $dom->getElementsByTagName('a');
var_dump($links); // object(DOMNodeList)#31 (0) { } - empty object
What am I missing? Looking at the documentation, it looks like I'm using the function correctly. | php | xml-parsing | domdocument | null | null | null | open | DOMDocument getElementsByTagName not working
===
I'm trying to use the `DOMDocument` function `getElementsByTagName()`, but it keeps returning an empty object. I'm using the following code:
// Create some HTML
$output = '
<html>
<body>
<a href="foo">Bar</a>
</body>
</html>';
// Load the HTML
$dom = new DOMDocument;
$dom->loadHTML($output);
// Find all links (a tags)
$links = $dom->getElementsByTagName('a');
var_dump($links); // object(DOMNodeList)#31 (0) { } - empty object
What am I missing? Looking at the documentation, it looks like I'm using the function correctly. | 0 |
11,542,541 | 07/18/2012 13:28:05 | 1,452,868 | 06/13/2012 05:44:43 | 37 | 4 | Issues of the subreport with add to main report | I have report that contains a subreport,the reports in the main are created dynamicaly depending on the parameter values,i have a subreport that contain textboxs,the problem with this subreport when add to the main report that is shown on a given parameter and it collapse on other!!!,knowing that when this subreport is empty(the dataset return no rows) is shown on a parameter and on other parameter is hide............i need this subreport to be shown even if empty and not to collapse | ssrs-2008 | null | null | null | null | null | open | Issues of the subreport with add to main report
===
I have report that contains a subreport,the reports in the main are created dynamicaly depending on the parameter values,i have a subreport that contain textboxs,the problem with this subreport when add to the main report that is shown on a given parameter and it collapse on other!!!,knowing that when this subreport is empty(the dataset return no rows) is shown on a parameter and on other parameter is hide............i need this subreport to be shown even if empty and not to collapse | 0 |
11,542,543 | 07/18/2012 13:28:10 | 1,534,910 | 07/18/2012 13:24:18 | 1 | 0 | Preserving line breaks from text area before or after php filter sanitize | Im having trouble understanding how to go about this.
I have content in a <textarea> tag which i want to save in a database.
Im using FILTER_SANITIZE_STRING to escape XSS attacks however its getting rid of the line breaks in my textarea content.
Im wondering how do i go about sanitizing my content (Preventing XSS risk) but yet keeping the breaks so i can add it to my database and pull it from the database with the breaks intact
Thanks :) | php | line-breaks | sanitize | null | null | null | open | Preserving line breaks from text area before or after php filter sanitize
===
Im having trouble understanding how to go about this.
I have content in a <textarea> tag which i want to save in a database.
Im using FILTER_SANITIZE_STRING to escape XSS attacks however its getting rid of the line breaks in my textarea content.
Im wondering how do i go about sanitizing my content (Preventing XSS risk) but yet keeping the breaks so i can add it to my database and pull it from the database with the breaks intact
Thanks :) | 0 |
11,351,062 | 07/05/2012 19:18:11 | 1,504,973 | 07/05/2012 19:12:08 | 1 | 0 | Binding knockout to external html | I have a button in my app that when clicked pops up a dialog window that will query data. This windows uses jquery to call a $.get and load in a html form and add it to the DOM. Once done it will use jQuery UI to show a modal dialog window. I have a button on this form that submits the form data to the server. Once I get the data back I want to bind this data to a table. I am having trouble binding the button a view model and I have no clue how to bind the results after I retrieve them. Can anyone get me started with how to do this?
| knockout.js | null | null | null | null | null | open | Binding knockout to external html
===
I have a button in my app that when clicked pops up a dialog window that will query data. This windows uses jquery to call a $.get and load in a html form and add it to the DOM. Once done it will use jQuery UI to show a modal dialog window. I have a button on this form that submits the form data to the server. Once I get the data back I want to bind this data to a table. I am having trouble binding the button a view model and I have no clue how to bind the results after I retrieve them. Can anyone get me started with how to do this?
| 0 |
11,351,054 | 07/05/2012 19:17:09 | 1,188,930 | 02/04/2012 05:33:51 | 80 | 0 | Compiling java code within .net | I need to compile java code from a .net application. I tried running a cmd process and giving arguments but it didn't work. Any idea on how to get this to work? | java | .net | compilation | null | null | 07/05/2012 20:32:45 | not a real question | Compiling java code within .net
===
I need to compile java code from a .net application. I tried running a cmd process and giving arguments but it didn't work. Any idea on how to get this to work? | 1 |
11,351,055 | 07/05/2012 19:17:20 | 892,387 | 08/12/2011 19:44:09 | 547 | 37 | warnings when casting to void** | I'm trying to cast a struct pointer to a `void**` for a function that takes a `void**`;
typedef struct {
uint64_t key; // the key in the key/value pair
void *value; // the value in the key/value pair
} HTKeyValue, *HTKeyValuePtr;
HTKeyValuePtr payload = (HTKeyValuePtr)malloc(sizeof(HTKeyValue));
int success = (HTKeyValuePtr) LLIteratorGetPayload(i, (void**) &payload);
gives me the warnings:
hashtable.c:161:19: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
hashtable.c:161:19: warning: initialization makes integer from pointer without a cast [enabled by default]
What's going on? How do I fix this?
p.s. sorry if this is a dup of any other question. There were a lot of similar questions but I couldn't find one that fit my situation and that I understood.
| c | gcc | gcc-warning | null | null | null | open | warnings when casting to void**
===
I'm trying to cast a struct pointer to a `void**` for a function that takes a `void**`;
typedef struct {
uint64_t key; // the key in the key/value pair
void *value; // the value in the key/value pair
} HTKeyValue, *HTKeyValuePtr;
HTKeyValuePtr payload = (HTKeyValuePtr)malloc(sizeof(HTKeyValue));
int success = (HTKeyValuePtr) LLIteratorGetPayload(i, (void**) &payload);
gives me the warnings:
hashtable.c:161:19: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
hashtable.c:161:19: warning: initialization makes integer from pointer without a cast [enabled by default]
What's going on? How do I fix this?
p.s. sorry if this is a dup of any other question. There were a lot of similar questions but I couldn't find one that fit my situation and that I understood.
| 0 |
11,351,065 | 07/05/2012 19:18:16 | 214,405 | 11/19/2009 08:06:02 | 162 | 5 | Regular expression to find " but not the ones that have "," | I just cant get the hang of regular expressions, trying to find the " , but not the ones with , on either side
I ","can haz ","kittens. "Mmmm". Tasty, tasty kittens.
Thanks in advance | regex | null | null | null | null | null | open | Regular expression to find " but not the ones that have ","
===
I just cant get the hang of regular expressions, trying to find the " , but not the ones with , on either side
I ","can haz ","kittens. "Mmmm". Tasty, tasty kittens.
Thanks in advance | 0 |
11,351,068 | 07/05/2012 19:18:31 | 608,674 | 02/08/2011 19:20:01 | 11 | 1 | Load Telerik MVC Grid (with data) into master Grid DataView using jQuery | For reasons of dynamics, I need to load different grids into the detailview of a telerik mvc gridview.
I am using partial views and jQuery to call the controller while passing in the id to return the partial view and binding model.
I can display the grid in the correct rows, pass in the correct parameter from the ajax call and return the correct (filled) model from the controller. I can also render the correct grid from the partial view BUT it will NOT databind.
What am I missing?
![Grid loading without data][1]
[1]: http://i.stack.imgur.com/JG6zG.png
**Master Grid Calls Partial Grid on RowExpand**
@(Html.Telerik().Grid<TelerikAjaxGrid.ViewModels.EmployeeViewModel>()
.Name("Employees")
.Columns(columns =>
{
columns.Bound(e => e.EmployeeID).Hidden();
columns.Bound(e => e.FirstName).Width(140);
columns.Bound(e => e.LastName).Width(140);
columns.Bound(e => e.Title).Width(200);
columns.Bound(e => e.Country).Width(200);
columns.Bound(e => e.City);
})
.Selectable()
//.ClientEvents(events => events.OnRowSelect("showOrderID"))
.DataBinding(dataBinding => dataBinding.Ajax().Select("_EmployeesHierarchyAjax", "Grid"))
.DetailView(details => details.ClientTemplate("<div id='result_<#= EmployeeID #>'></div>"))
.ClientEvents(events => events.OnDetailViewExpand("detailGrid_dataBinding"))
.Pageable(paging => paging.PageSize(5))
.Scrollable(scrolling => scrolling.Height(580))
.Sortable()
)
<script type="text/javascript">
function detailGrid_dataBinding(e) {
var teleriksMasterRow = e.masterRow;
var idValue = teleriksMasterRow.cells[1].innerHTML;
var link = '@Url.Action("_OrdersForEmployeeHierarchyAjax", "Grid", new { id = "replace" })';
link = link.replace("/replace", "?employeeID=" + idValue);
alert(link);
$(this).find('#result_' + idValue).load(link);
}
</script>
The function "detailGrid_dataBinding" makes a url call to the controller which looks like this...
//[GridAction(EnableCustomBinding = true)]
public ActionResult _OrdersForEmployeeHierarchyAjax(int employeeID)
{
IQueryable<OrderViewModel> orders = service.GetOrdersFromCache(employeeID);
return PartialView("_PartialGrid", new GridModel(orders));
}
Notice that I have the attribute commented out... the grid will not render with this attribute in place, which is counter-intuitive given Telerik's instructions.
The controller then calls this Partial View to be loaded... notice the DataBinding!
@(Html.Telerik().Grid<TelerikAjaxGrid.ViewModels.OrderViewModel>()
.Name("Orders_<#= EmployeeID #>")
.Columns(columns =>
{
columns.Bound(o => o.OrderID).Width(101).HtmlAttributes(new { name = "OrderID" });
columns.Bound(o => o.ShipCountry).Width(140);
columns.Bound(o => o.ShipAddress).Width(200);
columns.Bound(o => o.ShipName).Width(200);
columns.Bound(o => o.ShippedDate).Format("{0:d}");
})
.DetailView(ordersDetailView => ordersDetailView.ClientTemplate(
Html.Telerik().Grid<TelerikAjaxGrid.ViewModels.OrderDetailsViewModel>()
.Name("OrderDetails_<#= OrderID #>")
.Columns(columns =>
{
columns.Bound(od => od.ProductName).Width(233);
columns.Bound(od => od.Quantity).Width(200);
columns.Bound(od => od.UnitPrice).Width(200);
columns.Bound(od => od.Discount);
})
.DataBinding(dataBinding => dataBinding.Ajax()
.Select("_OrderDetailsForOrderHierarchyAjax", "Grid", new { orderID = "<#= OrderID #>" }))
.Pageable()
.Sortable()
.ToHtmlString()
)).Name("OrdersDetailView")
.DataBinding(dataBinding => dataBinding.Ajax().Select("_OrdersForEmployeeHierarchyAjax", "Grid"))
.Pageable()
.Sortable()
.Filterable()
//.ToHtmlString()
)
Even though all documentation indicates that a ClientTemplate needs to be passed a HTML string and therefore the grid needs to be rendered into html, you will notice that it is commented out. The grid does not render with this line included but sends back a string of (non-Html) text. | mvc | data-binding | telerik | grid | partialview | null | open | Load Telerik MVC Grid (with data) into master Grid DataView using jQuery
===
For reasons of dynamics, I need to load different grids into the detailview of a telerik mvc gridview.
I am using partial views and jQuery to call the controller while passing in the id to return the partial view and binding model.
I can display the grid in the correct rows, pass in the correct parameter from the ajax call and return the correct (filled) model from the controller. I can also render the correct grid from the partial view BUT it will NOT databind.
What am I missing?
![Grid loading without data][1]
[1]: http://i.stack.imgur.com/JG6zG.png
**Master Grid Calls Partial Grid on RowExpand**
@(Html.Telerik().Grid<TelerikAjaxGrid.ViewModels.EmployeeViewModel>()
.Name("Employees")
.Columns(columns =>
{
columns.Bound(e => e.EmployeeID).Hidden();
columns.Bound(e => e.FirstName).Width(140);
columns.Bound(e => e.LastName).Width(140);
columns.Bound(e => e.Title).Width(200);
columns.Bound(e => e.Country).Width(200);
columns.Bound(e => e.City);
})
.Selectable()
//.ClientEvents(events => events.OnRowSelect("showOrderID"))
.DataBinding(dataBinding => dataBinding.Ajax().Select("_EmployeesHierarchyAjax", "Grid"))
.DetailView(details => details.ClientTemplate("<div id='result_<#= EmployeeID #>'></div>"))
.ClientEvents(events => events.OnDetailViewExpand("detailGrid_dataBinding"))
.Pageable(paging => paging.PageSize(5))
.Scrollable(scrolling => scrolling.Height(580))
.Sortable()
)
<script type="text/javascript">
function detailGrid_dataBinding(e) {
var teleriksMasterRow = e.masterRow;
var idValue = teleriksMasterRow.cells[1].innerHTML;
var link = '@Url.Action("_OrdersForEmployeeHierarchyAjax", "Grid", new { id = "replace" })';
link = link.replace("/replace", "?employeeID=" + idValue);
alert(link);
$(this).find('#result_' + idValue).load(link);
}
</script>
The function "detailGrid_dataBinding" makes a url call to the controller which looks like this...
//[GridAction(EnableCustomBinding = true)]
public ActionResult _OrdersForEmployeeHierarchyAjax(int employeeID)
{
IQueryable<OrderViewModel> orders = service.GetOrdersFromCache(employeeID);
return PartialView("_PartialGrid", new GridModel(orders));
}
Notice that I have the attribute commented out... the grid will not render with this attribute in place, which is counter-intuitive given Telerik's instructions.
The controller then calls this Partial View to be loaded... notice the DataBinding!
@(Html.Telerik().Grid<TelerikAjaxGrid.ViewModels.OrderViewModel>()
.Name("Orders_<#= EmployeeID #>")
.Columns(columns =>
{
columns.Bound(o => o.OrderID).Width(101).HtmlAttributes(new { name = "OrderID" });
columns.Bound(o => o.ShipCountry).Width(140);
columns.Bound(o => o.ShipAddress).Width(200);
columns.Bound(o => o.ShipName).Width(200);
columns.Bound(o => o.ShippedDate).Format("{0:d}");
})
.DetailView(ordersDetailView => ordersDetailView.ClientTemplate(
Html.Telerik().Grid<TelerikAjaxGrid.ViewModels.OrderDetailsViewModel>()
.Name("OrderDetails_<#= OrderID #>")
.Columns(columns =>
{
columns.Bound(od => od.ProductName).Width(233);
columns.Bound(od => od.Quantity).Width(200);
columns.Bound(od => od.UnitPrice).Width(200);
columns.Bound(od => od.Discount);
})
.DataBinding(dataBinding => dataBinding.Ajax()
.Select("_OrderDetailsForOrderHierarchyAjax", "Grid", new { orderID = "<#= OrderID #>" }))
.Pageable()
.Sortable()
.ToHtmlString()
)).Name("OrdersDetailView")
.DataBinding(dataBinding => dataBinding.Ajax().Select("_OrdersForEmployeeHierarchyAjax", "Grid"))
.Pageable()
.Sortable()
.Filterable()
//.ToHtmlString()
)
Even though all documentation indicates that a ClientTemplate needs to be passed a HTML string and therefore the grid needs to be rendered into html, you will notice that it is commented out. The grid does not render with this line included but sends back a string of (non-Html) text. | 0 |
11,351,073 | 07/05/2012 19:18:41 | 1,463,765 | 06/18/2012 13:09:39 | 5 | 1 | Disable close button of MSBuild child process | I have a PowerShell script that launches an MSBuild child process. I would like to disable the "close" button on the child process window, so that the user cannot interrupt the process. However, I have not been able to find any information indicating whether this is possible.
If someone could either confirm (and tell me how I would go about doing this) or deny whether this is possible I would greatly appreciate it. | powershell | msbuild | null | null | null | null | open | Disable close button of MSBuild child process
===
I have a PowerShell script that launches an MSBuild child process. I would like to disable the "close" button on the child process window, so that the user cannot interrupt the process. However, I have not been able to find any information indicating whether this is possible.
If someone could either confirm (and tell me how I would go about doing this) or deny whether this is possible I would greatly appreciate it. | 0 |
11,350,537 | 07/05/2012 18:41:38 | 906,490 | 08/22/2011 19:06:00 | 5,678 | 196 | Convert a factor column to multiple boolean columns | Given data that looks like:
library(data.table)
DT <- data.table(x=rep(1:5, 2))
I would like to split this data into 5 boolean columns that indicate the presence of each number.
I can do this like this:
new.names <- sort(unique(DT$x))
DT[, paste0('col', new.names) := lapply(new.names, function(i) DT$x==i), with=FALSE]
But this uses a pesky `lapply` which is probably slower than the data.table alternative and this solutions strikes me as not very "data.table-ish".
Is there a better and/or faster way to create these new columns?
| r | data.table | null | null | null | null | open | Convert a factor column to multiple boolean columns
===
Given data that looks like:
library(data.table)
DT <- data.table(x=rep(1:5, 2))
I would like to split this data into 5 boolean columns that indicate the presence of each number.
I can do this like this:
new.names <- sort(unique(DT$x))
DT[, paste0('col', new.names) := lapply(new.names, function(i) DT$x==i), with=FALSE]
But this uses a pesky `lapply` which is probably slower than the data.table alternative and this solutions strikes me as not very "data.table-ish".
Is there a better and/or faster way to create these new columns?
| 0 |
11,351,091 | 07/05/2012 19:19:33 | 274,502 | 02/16/2010 16:09:11 | 1,458 | 55 | Git and binary files history | <sup>This is a follow up on some similar "*answered*" questions about [git handling binary files][1] and how [git can't follow file history very well][2].</sup>
As far as I currently understand this, after few hours of researching, *git can't properly follow file history*. Heck, even `git log --follow -M100% --name-only -- path-to-my-file` won't properly follow the file, and I'm [supposedly][3] telling it to only follow files that are 100% similar!
So [we should be using other ways][4] to find who to *blame*, such as *bisecting*. Problem is, those doesn't seem to work with binaries - so maybe a properly working `git log --follow` would have some usage after all (though probably [Linus would still disagree][5]).
I guess **my question here is**: Do we have any automated way to enable git to follow binary files that have been moved / renamed? Or is there any similar Version Controlling System with this functionality?
As an example of a kind of solution would be [using `filter-branch`][6], but I never toyed with it and got no idea how dangerous it might be. I mean I'd accept any safe way to automate this.
[1]: http://stackoverflow.com/questions/4697216/is-git-good-with-binary
[2]: http://stackoverflow.com/a/6797099/274502
[3]: http://stackoverflow.com/questions/3520023/how-does-git-track-history-during-a-refactoring/3520055#3520055
[4]: http://git.661346.n2.nabble.com/Directory-renames-without-breaking-git-log-td837434.html
[5]: https://groups.google.com/forum/?fromgroups#!topic/git-version-control/07oWjHiQTtg
[6]: http://stackoverflow.com/questions/5656404/git-move-files-in-history-too | git | version-control | git-log | null | null | null | open | Git and binary files history
===
<sup>This is a follow up on some similar "*answered*" questions about [git handling binary files][1] and how [git can't follow file history very well][2].</sup>
As far as I currently understand this, after few hours of researching, *git can't properly follow file history*. Heck, even `git log --follow -M100% --name-only -- path-to-my-file` won't properly follow the file, and I'm [supposedly][3] telling it to only follow files that are 100% similar!
So [we should be using other ways][4] to find who to *blame*, such as *bisecting*. Problem is, those doesn't seem to work with binaries - so maybe a properly working `git log --follow` would have some usage after all (though probably [Linus would still disagree][5]).
I guess **my question here is**: Do we have any automated way to enable git to follow binary files that have been moved / renamed? Or is there any similar Version Controlling System with this functionality?
As an example of a kind of solution would be [using `filter-branch`][6], but I never toyed with it and got no idea how dangerous it might be. I mean I'd accept any safe way to automate this.
[1]: http://stackoverflow.com/questions/4697216/is-git-good-with-binary
[2]: http://stackoverflow.com/a/6797099/274502
[3]: http://stackoverflow.com/questions/3520023/how-does-git-track-history-during-a-refactoring/3520055#3520055
[4]: http://git.661346.n2.nabble.com/Directory-renames-without-breaking-git-log-td837434.html
[5]: https://groups.google.com/forum/?fromgroups#!topic/git-version-control/07oWjHiQTtg
[6]: http://stackoverflow.com/questions/5656404/git-move-files-in-history-too | 0 |
11,430,000 | 07/11/2012 09:53:02 | 1,517,352 | 07/11/2012 09:44:49 | 1 | 0 | multipications table? | hey everyone so i need to Write 2 web pages with the following attributes:
Form (decide if this should be html or jsp file).
Form contains an HTML form with two fields:a text input (called "size") and a button.
When the button is clicked, another page appears..
Table (decide if this is HTML or JSP)
Table shows the multipications table up to the "size" in the previous page.
example:
If 3 was clicked, then the output will be:
1 2 3
2 4 6
3 6 9
Also, add a button to Table so that pressing this button will make the table disappear.
can anyone help me to begin this? | java | javascript | html | jsp | null | null | open | multipications table?
===
hey everyone so i need to Write 2 web pages with the following attributes:
Form (decide if this should be html or jsp file).
Form contains an HTML form with two fields:a text input (called "size") and a button.
When the button is clicked, another page appears..
Table (decide if this is HTML or JSP)
Table shows the multipications table up to the "size" in the previous page.
example:
If 3 was clicked, then the output will be:
1 2 3
2 4 6
3 6 9
Also, add a button to Table so that pressing this button will make the table disappear.
can anyone help me to begin this? | 0 |
11,430,001 | 07/11/2012 09:53:12 | 9,707 | 09/15/2008 19:43:36 | 1,740 | 13 | Listening for volume up and down key events have reversed effect on Acer Iconia 7" tablet | I'm capturing the VOLUME_UP and VOLUME_DOWN keys to increase respectively decrease a value in my app. I use the following code:
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
int action = event.getAction();
int keyCode = event.getKeyCode();
switch (keyCode) {
case KeyEvent.KEYCODE_VOLUME_UP:
if (action == KeyEvent.ACTION_UP) {
// Do something to increase a value
}
return true;
case KeyEvent.KEYCODE_VOLUME_DOWN:
if (action == KeyEvent.ACTION_DOWN) {
// Do something to decrease a value
}
return true;
default:
return super.dispatchKeyEvent(event);
}
}
This works fine on most devices, however, one of our users reports that on the Acer Iconia 7" tablet the buttons have a reversed effect?! I.e. volume up decreases the value, where volume down increases it. The app is fixed in portrait, so no orientation changes. What might cause this effect? How can I test this without having the actual device at hand? Can I work around this in a generic (preferred) or specific way for this device?
Thanks for sharing your thoughts,
Cheers,
Johan | android | volume | keyevent | null | null | null | open | Listening for volume up and down key events have reversed effect on Acer Iconia 7" tablet
===
I'm capturing the VOLUME_UP and VOLUME_DOWN keys to increase respectively decrease a value in my app. I use the following code:
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
int action = event.getAction();
int keyCode = event.getKeyCode();
switch (keyCode) {
case KeyEvent.KEYCODE_VOLUME_UP:
if (action == KeyEvent.ACTION_UP) {
// Do something to increase a value
}
return true;
case KeyEvent.KEYCODE_VOLUME_DOWN:
if (action == KeyEvent.ACTION_DOWN) {
// Do something to decrease a value
}
return true;
default:
return super.dispatchKeyEvent(event);
}
}
This works fine on most devices, however, one of our users reports that on the Acer Iconia 7" tablet the buttons have a reversed effect?! I.e. volume up decreases the value, where volume down increases it. The app is fixed in portrait, so no orientation changes. What might cause this effect? How can I test this without having the actual device at hand? Can I work around this in a generic (preferred) or specific way for this device?
Thanks for sharing your thoughts,
Cheers,
Johan | 0 |
11,430,562 | 07/11/2012 10:23:01 | 425,260 | 08/19/2010 13:05:49 | 1,026 | 96 | where is my Sql Sevrer 2008 instance? | Folks
I have Sql Sevrer 2005 and Sql Server 2008 R2 insatlled on my machine.
whenver I start `SQL Server Management Studio` from Server 2008 R2 Menu.
where `ServerName - .\SqlExpress or mymachine\SqlExpress`
and run `select @@version` - i always see `Microsoft SQL Server 2005 - 9.00.5057.00 (Intel X86)`
How can i access my `Sql Server 2008 instance?` Reading all the existing questions on SO
Think I have messed up between `Default Instance and Named Instance`?
could you please advice what can be done in this case.
Except to `reinstall Sql Sevrer 2008 or remove Sql Server 2005 instance`
![enter image description here][1]![enter image description here][2]
[1]: http://i.stack.imgur.com/VKKk2.png
[2]: http://i.stack.imgur.com/J7flt.png | sql | visual-studio-2010 | sql-server-2008 | sql-server-2005 | instance | null | open | where is my Sql Sevrer 2008 instance?
===
Folks
I have Sql Sevrer 2005 and Sql Server 2008 R2 insatlled on my machine.
whenver I start `SQL Server Management Studio` from Server 2008 R2 Menu.
where `ServerName - .\SqlExpress or mymachine\SqlExpress`
and run `select @@version` - i always see `Microsoft SQL Server 2005 - 9.00.5057.00 (Intel X86)`
How can i access my `Sql Server 2008 instance?` Reading all the existing questions on SO
Think I have messed up between `Default Instance and Named Instance`?
could you please advice what can be done in this case.
Except to `reinstall Sql Sevrer 2008 or remove Sql Server 2005 instance`
![enter image description here][1]![enter image description here][2]
[1]: http://i.stack.imgur.com/VKKk2.png
[2]: http://i.stack.imgur.com/J7flt.png | 0 |
11,430,563 | 07/11/2012 10:23:06 | 1,334,531 | 04/15/2012 12:58:27 | 7 | 0 | Invalid Path in Cookie constructor C# | When adding new aquired cookies from RestResponse I have strange problem with cookies from wiedzmin.wikia.com .
The Exception Message is
" The 'Path'='/wiki/Specjalna:Nowe_pliki' part of the cookie is invalid. "
foreach (RestSharp.RestResponseCookie buiscuit in responce.Cookies)
{
cookies.Add(new Uri(pageURL), new Cookie(buiscuit.Name, buiscuit.Value,
buiscuit.Path, buiscuit.Domain));
}
The values of buiscuit are:
Name = loadtime
Value = S1342001743.657154083
Path = /wiki/Specjalna:Nowe_pliki
Domain = wiedzmin.wikia.com
MS VS 10 say it may be something with a size of a cookie. Is it true? | c# | exception | cookies | restsharp | null | null | open | Invalid Path in Cookie constructor C#
===
When adding new aquired cookies from RestResponse I have strange problem with cookies from wiedzmin.wikia.com .
The Exception Message is
" The 'Path'='/wiki/Specjalna:Nowe_pliki' part of the cookie is invalid. "
foreach (RestSharp.RestResponseCookie buiscuit in responce.Cookies)
{
cookies.Add(new Uri(pageURL), new Cookie(buiscuit.Name, buiscuit.Value,
buiscuit.Path, buiscuit.Domain));
}
The values of buiscuit are:
Name = loadtime
Value = S1342001743.657154083
Path = /wiki/Specjalna:Nowe_pliki
Domain = wiedzmin.wikia.com
MS VS 10 say it may be something with a size of a cookie. Is it true? | 0 |
11,430,564 | 07/11/2012 10:23:14 | 1,517,269 | 07/11/2012 09:13:22 | 1 | 0 | Cube 3D rotation - direction bug (Javascript - CSS3) | I'm doing a 3D cube with CSS3 animating with touch events. Here's the link (you can activate "touch events" in Chrome): <http://adevby.me/cube/> .
I made two diffents functions (cube1 & cube2). The only change is line 254 for the second cube.
**First cube:**
When you make a 180 deg rotation on the Y axis (red face at the bottom), then a rotation on the X axis, the direction is reversed (relative to the cursor / finger movement).
**Second cube:**
So i tried to make a condition when we are less than -90deg && more than 90deg on the Y axis, but we see a bad transition ...
I hope I'm clear ... | javascript | css3 | cube | null | null | null | open | Cube 3D rotation - direction bug (Javascript - CSS3)
===
I'm doing a 3D cube with CSS3 animating with touch events. Here's the link (you can activate "touch events" in Chrome): <http://adevby.me/cube/> .
I made two diffents functions (cube1 & cube2). The only change is line 254 for the second cube.
**First cube:**
When you make a 180 deg rotation on the Y axis (red face at the bottom), then a rotation on the X axis, the direction is reversed (relative to the cursor / finger movement).
**Second cube:**
So i tried to make a condition when we are less than -90deg && more than 90deg on the Y axis, but we see a bad transition ...
I hope I'm clear ... | 0 |
11,430,565 | 07/11/2012 10:23:18 | 1,517,426 | 07/11/2012 10:17:54 | 1 | 0 | AUTO SUBMIT FORM SHOWING AN ERROR | PLEASE HELP ME CREATING Curl auto submit script to submit
http://resultsarchives.nic.in/cbseresults/cbseresults2009/class10/cbse10.htm
form | curl | null | null | null | null | null | open | AUTO SUBMIT FORM SHOWING AN ERROR
===
PLEASE HELP ME CREATING Curl auto submit script to submit
http://resultsarchives.nic.in/cbseresults/cbseresults2009/class10/cbse10.htm
form | 0 |
11,430,546 | 07/11/2012 10:22:09 | 1,059,350 | 11/22/2011 08:18:55 | 19 | 2 | How can I find the first and last date in a month | How can I find the first and last date in a month in previous 2 years.For example, today is 07-01-2012(mm-dd-yyyy); I want to find data from 2011 ...
01-01-2011
01-31-2011
02-01-2011
02-28-2011. Something like that
Thanks. | java | php | mysql | sql | null | null | open | How can I find the first and last date in a month
===
How can I find the first and last date in a month in previous 2 years.For example, today is 07-01-2012(mm-dd-yyyy); I want to find data from 2011 ...
01-01-2011
01-31-2011
02-01-2011
02-28-2011. Something like that
Thanks. | 0 |
11,430,571 | 07/11/2012 10:23:31 | 1,474,577 | 06/22/2012 10:48:16 | 18 | 1 | copy directory, but only update files if needed | I am using the following code:
my.Computer.FileSystem.CopyDirectory(path, path, true)
However I think this copies the entire directory even if one single file is changed in a directory. Is this true?
If so is there any validation I can put it to say only update the file not the entire folder. My application is going to be run on a network with about 300 computers each copying over 300Mb so it could cause the network to crash or slow if it is trying to copy over ever directory everytime even if only one file is changed. | vb.net | null | null | null | null | null | open | copy directory, but only update files if needed
===
I am using the following code:
my.Computer.FileSystem.CopyDirectory(path, path, true)
However I think this copies the entire directory even if one single file is changed in a directory. Is this true?
If so is there any validation I can put it to say only update the file not the entire folder. My application is going to be run on a network with about 300 computers each copying over 300Mb so it could cause the network to crash or slow if it is trying to copy over ever directory everytime even if only one file is changed. | 0 |
11,430,574 | 07/11/2012 10:23:35 | 897,041 | 08/16/2011 15:52:15 | 106 | 9 | How to have an unbound sortable queue utilized by a fixed amount of threads? | Please assume the following:
public static void main(String[] args) {
ThreadPoolExecutor pool = new ThreadPoolExecutor(0, 5, 1L, TimeUnit.SECONDS, new PriorityBlockingQueue<Runnable>());
DashboardHtmlExport d = new DashboardHtmlExport();
for (int i = 0; i < 40; i++) {
System.out.println("Submitting: " + i);
try {
Thread.sleep(cooldown);
} catch (InterruptedException e) {
e.printStackTrace();
}
pool.submit(d.new A(i));
}
}
private class A implements Runnable, Comparable<A> {
private int order;
public A(int order) {
this.order = order;
}
public void run() {
try {
Thread.sleep(busyTime);
} catch (InterruptedException e) {
System.out.println(e.getMessage());
}
System.out.println(new Date());
}
public int compareTo(A o) {
return Integer.valueOf(o.order).compareTo(Integer.valueOf(order));
}
}
This produced the following error:
Submitting: 0
Submitting: 1
Exception in thread "main" java.lang.ClassCastException: java.util.concurrent.FutureTask cannot be cast to java.lang.Comparable
at java.util.PriorityQueue.siftUpComparable(PriorityQueue.java:578)
at java.util.PriorityQueue.siftUp(PriorityQueue.java:574)
at java.util.PriorityQueue.offer(PriorityQueue.java:274)
at java.util.concurrent.PriorityBlockingQueue.offer(PriorityBlockingQueue.java:164)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:653)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:78)
at com.skycomm.cth.pages.test.DashboardHtmlExport.main(DashboardHtmlExport.java:133)
Tue Jul 10 23:48:45 GMT+02:00 2012
Why is this happening ?!
This only works if the `busyTime` is **less** that the `cooldown` time. Meaning that the queue can't handle more than 2 submitted tasks !!
Basically what I'm trying to do is to have a pool with **UNBOUND** size and sortable whether by comparable or a comparator. I can only achieve an **UNBOUND** queue using a `LinkedBlockingQueue` but that's of course not sortable !
Thank you. | java | threadpool | priority-queue | null | null | null | open | How to have an unbound sortable queue utilized by a fixed amount of threads?
===
Please assume the following:
public static void main(String[] args) {
ThreadPoolExecutor pool = new ThreadPoolExecutor(0, 5, 1L, TimeUnit.SECONDS, new PriorityBlockingQueue<Runnable>());
DashboardHtmlExport d = new DashboardHtmlExport();
for (int i = 0; i < 40; i++) {
System.out.println("Submitting: " + i);
try {
Thread.sleep(cooldown);
} catch (InterruptedException e) {
e.printStackTrace();
}
pool.submit(d.new A(i));
}
}
private class A implements Runnable, Comparable<A> {
private int order;
public A(int order) {
this.order = order;
}
public void run() {
try {
Thread.sleep(busyTime);
} catch (InterruptedException e) {
System.out.println(e.getMessage());
}
System.out.println(new Date());
}
public int compareTo(A o) {
return Integer.valueOf(o.order).compareTo(Integer.valueOf(order));
}
}
This produced the following error:
Submitting: 0
Submitting: 1
Exception in thread "main" java.lang.ClassCastException: java.util.concurrent.FutureTask cannot be cast to java.lang.Comparable
at java.util.PriorityQueue.siftUpComparable(PriorityQueue.java:578)
at java.util.PriorityQueue.siftUp(PriorityQueue.java:574)
at java.util.PriorityQueue.offer(PriorityQueue.java:274)
at java.util.concurrent.PriorityBlockingQueue.offer(PriorityBlockingQueue.java:164)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:653)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:78)
at com.skycomm.cth.pages.test.DashboardHtmlExport.main(DashboardHtmlExport.java:133)
Tue Jul 10 23:48:45 GMT+02:00 2012
Why is this happening ?!
This only works if the `busyTime` is **less** that the `cooldown` time. Meaning that the queue can't handle more than 2 submitted tasks !!
Basically what I'm trying to do is to have a pool with **UNBOUND** size and sortable whether by comparable or a comparator. I can only achieve an **UNBOUND** queue using a `LinkedBlockingQueue` but that's of course not sortable !
Thank you. | 0 |
11,430,575 | 07/11/2012 10:23:38 | 1,505,027 | 07/05/2012 19:36:05 | 6 | 0 | jQuery how to select things between .first() and .(last) | I've got this code
<ul>
<li><a href="index.php">Web Development</a></li>
<span data-landing_count="1">
<li class="subli"><a href="1.html">E-shop</a></li>
<li class="subli"><a href="2.html">Prezentations</a></li>
<li class="subli"><a href="3.html">Custom CMS</a></li>
<li class="subli"><a href="4.html">WordPress & Joomla!</a></li>
<li class="subli"><a href="5.html">Web apps</a></li>
<li class="subli lastsl"><a href="index-b.html">Design</a></li>
</span>
<li><a href="6.html">E-courses</a></li>
<span data-landing_count="2">
<li class="subli"><a href="7.html">Design & Graphics</a></li>
<li class="subli lastsl"><a href="8.html">Web Development</a></li>
</span>
<li><a href="9.html">SEO</a></li>
<span data-landing_count="3">
<li class="subli"><a href="91.html">On-page SEO</a></li>
<li class="subli"><a href="92.html">W3C validation</a></li>
<li class="subli"><a href="93.html">Linking</a></li>
<li class="subli lastsl"><a href="94.html"><img src="img/star.png" alt="star" width="12" class="star">Copywriting</a></li>
</span>
<li data-landing_count="4"><a href="95.html">Web hosting</a></li>
<li data-landing_count="5"><a href="96.html"><img src="img/star.png" alt="star" width="12" class="star">Pricing</a></li>
<li data-landing_count="6"><a href="97.html">Contact us</a></li>
</ul>
There are 3 spans, I now i can target the first one by .first() and the last one with .last(). But how do I target the middle one?
Thanks for reply | jquery | nth-child | null | null | null | null | open | jQuery how to select things between .first() and .(last)
===
I've got this code
<ul>
<li><a href="index.php">Web Development</a></li>
<span data-landing_count="1">
<li class="subli"><a href="1.html">E-shop</a></li>
<li class="subli"><a href="2.html">Prezentations</a></li>
<li class="subli"><a href="3.html">Custom CMS</a></li>
<li class="subli"><a href="4.html">WordPress & Joomla!</a></li>
<li class="subli"><a href="5.html">Web apps</a></li>
<li class="subli lastsl"><a href="index-b.html">Design</a></li>
</span>
<li><a href="6.html">E-courses</a></li>
<span data-landing_count="2">
<li class="subli"><a href="7.html">Design & Graphics</a></li>
<li class="subli lastsl"><a href="8.html">Web Development</a></li>
</span>
<li><a href="9.html">SEO</a></li>
<span data-landing_count="3">
<li class="subli"><a href="91.html">On-page SEO</a></li>
<li class="subli"><a href="92.html">W3C validation</a></li>
<li class="subli"><a href="93.html">Linking</a></li>
<li class="subli lastsl"><a href="94.html"><img src="img/star.png" alt="star" width="12" class="star">Copywriting</a></li>
</span>
<li data-landing_count="4"><a href="95.html">Web hosting</a></li>
<li data-landing_count="5"><a href="96.html"><img src="img/star.png" alt="star" width="12" class="star">Pricing</a></li>
<li data-landing_count="6"><a href="97.html">Contact us</a></li>
</ul>
There are 3 spans, I now i can target the first one by .first() and the last one with .last(). But how do I target the middle one?
Thanks for reply | 0 |
11,430,579 | 07/11/2012 10:23:47 | 1,238,499 | 02/28/2012 17:57:48 | 1 | 0 | Redirect www to non-www is redirecting to script instead of nice URL | My domain **domain.com is redirected to www.domain.com** but, due to internal redirects, it only works in some cases:
- ***domain.com/folder/*** should redirect **to www.domain.com/folder/** but it is redirected to ***www.domain.com/blog/index.php***
The issue here is that internally, ***www.domain.com/folder/*** uses that **blog/index.php** throught a RewriteRule:
RewriteRule ^$ ../blog/index.php
I don't know why, but you are redirected to the script instead of the nice URL.
IT WORKS here (redirection from **domain.com/folder/** to **www.domain.com/folder**, when all code within same "Directory" entry):
<Directory /var/www/vhosts/domain.com/httpdocs/>
Options -All +FollowSymLinks
RewriteEngine on
# redirect non-www to www
RewriteCond %{HTTP_HOST} ^domain\.com
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
RewriteRule ^folder/$ ../blog/index.php
</Directory>
It does NOT WORK here (redirection from **domain.com/folder/** to **www.domain.com/blog/index.php**, when 2 "Directory" entries are used):
<Directory /var/www/vhosts/domain.com/httpdocs/>
Options -All +FollowSymLinks
RewriteEngine on
# redirect non-www to www
RewriteCond %{HTTP_HOST} ^domain\.com
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
</Directory>
<Directory /var/www/vhosts/sonidon.com/httpdocs/folder/>
RewriteEngine on
RewriteRule ^$ ../blog/index.php
</Directory>
Tested also using **Options +FollowSymLinks +SymLinksIfOwnerMatch** in both directories with no luck :(
I saw a solution here using VirtualHosts instead of Directory:
http://stackoverflow.com/questions/234723/generic-htaccess-redirect-www-to-non-www
but think that it should be a way to do this because this trouble is not only related to "non-www to www" but to any redirection. | mod-rewrite | null | null | null | null | null | open | Redirect www to non-www is redirecting to script instead of nice URL
===
My domain **domain.com is redirected to www.domain.com** but, due to internal redirects, it only works in some cases:
- ***domain.com/folder/*** should redirect **to www.domain.com/folder/** but it is redirected to ***www.domain.com/blog/index.php***
The issue here is that internally, ***www.domain.com/folder/*** uses that **blog/index.php** throught a RewriteRule:
RewriteRule ^$ ../blog/index.php
I don't know why, but you are redirected to the script instead of the nice URL.
IT WORKS here (redirection from **domain.com/folder/** to **www.domain.com/folder**, when all code within same "Directory" entry):
<Directory /var/www/vhosts/domain.com/httpdocs/>
Options -All +FollowSymLinks
RewriteEngine on
# redirect non-www to www
RewriteCond %{HTTP_HOST} ^domain\.com
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
RewriteRule ^folder/$ ../blog/index.php
</Directory>
It does NOT WORK here (redirection from **domain.com/folder/** to **www.domain.com/blog/index.php**, when 2 "Directory" entries are used):
<Directory /var/www/vhosts/domain.com/httpdocs/>
Options -All +FollowSymLinks
RewriteEngine on
# redirect non-www to www
RewriteCond %{HTTP_HOST} ^domain\.com
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
</Directory>
<Directory /var/www/vhosts/sonidon.com/httpdocs/folder/>
RewriteEngine on
RewriteRule ^$ ../blog/index.php
</Directory>
Tested also using **Options +FollowSymLinks +SymLinksIfOwnerMatch** in both directories with no luck :(
I saw a solution here using VirtualHosts instead of Directory:
http://stackoverflow.com/questions/234723/generic-htaccess-redirect-www-to-non-www
but think that it should be a way to do this because this trouble is not only related to "non-www to www" but to any redirection. | 0 |
11,430,580 | 07/11/2012 10:23:52 | 1,517,436 | 07/11/2012 10:20:01 | 1 | 0 | apps script not found error | I had the snooze app script working on gmail for some time but it seems that after converting to google drive, the spreadsheet vanished (not in trash) and I get emails every night telling me that my script "Not Found" failed to finish successfully etc etc.
The Error message is that a server error occurred - not particularly informative and any attempt to view triggers results in the same error.
Is there any way to get rid of these messages apart from setting up some kind of filter which is counter intuitive as if I decide to run other scripts I may want to see the output.
Thanks
Darren | gmail | google-apps-script | null | null | null | null | open | apps script not found error
===
I had the snooze app script working on gmail for some time but it seems that after converting to google drive, the spreadsheet vanished (not in trash) and I get emails every night telling me that my script "Not Found" failed to finish successfully etc etc.
The Error message is that a server error occurred - not particularly informative and any attempt to view triggers results in the same error.
Is there any way to get rid of these messages apart from setting up some kind of filter which is counter intuitive as if I decide to run other scripts I may want to see the output.
Thanks
Darren | 0 |
11,430,581 | 07/11/2012 10:23:52 | 1,465,825 | 06/19/2012 08:28:29 | 21 | 0 | MIgrated from EJB2 to ejb3 now build is getting failed, | I recenlty migrated to EJB 2 to EJB3 , but now I am not able to build the project (application), Please anyone tell me what are the modification we have to make in build.xml? Or what are the points I need to take care to make a successful buld?? Using ANT for build. | ant | jboss | ejb-3.0 | ejb-2.x | null | null | open | MIgrated from EJB2 to ejb3 now build is getting failed,
===
I recenlty migrated to EJB 2 to EJB3 , but now I am not able to build the project (application), Please anyone tell me what are the modification we have to make in build.xml? Or what are the points I need to take care to make a successful buld?? Using ANT for build. | 0 |
11,628,534 | 07/24/2012 10:04:47 | 825,143 | 07/01/2011 15:34:52 | 12 | 0 | Trying to install pre-configured virtual box using vagrant. Init failing | first of all I'm pretty new at this but i'm trying to follow along installing an open source crowd funding platform using a guide
https://github.com/danielweinmann/catarse/wiki/Pre-Configured-Catarse-Virtual-Box-using-Vagrant-%28Ubuntu-11.10-AMD64%29
I installed vagrant and virtual box all fine including the download of the image.
The problem is when I try to initialize it using the command:
vagrant init Ubuntu_11.10_amd64-Catarse-Master
The system responds with the following error:
Tiagos-MacBook-Pro:catarse_vagrant tiagomartins$ vagrant init Ubuntu_11.10_amd64-Catarse-Master
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.3/lib/vagrant/command/init.rb:28:in `initialize': Permission denied - /Users/tiagomartins/catarse_vagrant/Vagrantfile (Errno::EACCES)
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.0.3/lib/vagrant/command/init.rb:28:in `open'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.0.3/lib/vagrant/command/init.rb:28:in `open'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.0.3/lib/vagrant/command/init.rb:28:in `execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.0.3/lib/vagrant/cli.rb:42:in `execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.0.3/lib/vagrant/environment.rb:167:in `cli'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.0.3/bin/vagrant:43:in `<top (required)>'
from /Applications/Vagrant/bin/../embedded/gems/bin/vagrant:19:in `load'
from /Applications/Vagrant/bin/../embedded/gems/bin/vagrant:19:in `<main>'
What am I doing wrong and what's the best approach to fix it.
Thanks a lot!!
Tiago | ruby-on-rails | ruby | osx | virtualbox | vagrant | null | open | Trying to install pre-configured virtual box using vagrant. Init failing
===
first of all I'm pretty new at this but i'm trying to follow along installing an open source crowd funding platform using a guide
https://github.com/danielweinmann/catarse/wiki/Pre-Configured-Catarse-Virtual-Box-using-Vagrant-%28Ubuntu-11.10-AMD64%29
I installed vagrant and virtual box all fine including the download of the image.
The problem is when I try to initialize it using the command:
vagrant init Ubuntu_11.10_amd64-Catarse-Master
The system responds with the following error:
Tiagos-MacBook-Pro:catarse_vagrant tiagomartins$ vagrant init Ubuntu_11.10_amd64-Catarse-Master
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.3/lib/vagrant/command/init.rb:28:in `initialize': Permission denied - /Users/tiagomartins/catarse_vagrant/Vagrantfile (Errno::EACCES)
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.0.3/lib/vagrant/command/init.rb:28:in `open'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.0.3/lib/vagrant/command/init.rb:28:in `open'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.0.3/lib/vagrant/command/init.rb:28:in `execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.0.3/lib/vagrant/cli.rb:42:in `execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.0.3/lib/vagrant/environment.rb:167:in `cli'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.0.3/bin/vagrant:43:in `<top (required)>'
from /Applications/Vagrant/bin/../embedded/gems/bin/vagrant:19:in `load'
from /Applications/Vagrant/bin/../embedded/gems/bin/vagrant:19:in `<main>'
What am I doing wrong and what's the best approach to fix it.
Thanks a lot!!
Tiago | 0 |
11,628,538 | 07/24/2012 10:04:57 | 286,579 | 03/04/2010 20:02:57 | 731 | 1 | Unix:Recursively unzipping .zip file in respective folder | I have a number of zipped files say <code>a.zip b.zip</code> etc in a folder. I would like to unzip those and put into a respective directory like <code>a,b</code>.Can you suggest me some unix script for it.? | bash | unix | unzip | null | null | null | open | Unix:Recursively unzipping .zip file in respective folder
===
I have a number of zipped files say <code>a.zip b.zip</code> etc in a folder. I would like to unzip those and put into a respective directory like <code>a,b</code>.Can you suggest me some unix script for it.? | 0 |
11,628,539 | 07/24/2012 10:05:03 | 354,000 | 05/30/2010 13:24:26 | 169 | 4 | HowTo parse this (see description) text file in Pharo Smalltalk | I want to parse a textfile in Pharo Smalltalk, that has the structure outlined below into a Smalltalk object called TestResults, that has instance variables for all the data elements:
Properties:
Name: Value
Name: Value
...
Settings:
Category
SubCategory
Name=Value
SubCategory
Name=Value
Name=Value
...
Column1 Column2 Column3 ...
Value Value Value...
...
I thought about using [NeoCSV][1] for the tab-separated-value part at the end of the file, but i do not know how to parse the beginning of the file and how to combine this (if this approach is possible) with NeoCSV.
[1]: https://github.com/svenvc/docs/blob/master/neo/neo-csv-paper.md | parsing | text | csv | smalltalk | pharo | null | open | HowTo parse this (see description) text file in Pharo Smalltalk
===
I want to parse a textfile in Pharo Smalltalk, that has the structure outlined below into a Smalltalk object called TestResults, that has instance variables for all the data elements:
Properties:
Name: Value
Name: Value
...
Settings:
Category
SubCategory
Name=Value
SubCategory
Name=Value
Name=Value
...
Column1 Column2 Column3 ...
Value Value Value...
...
I thought about using [NeoCSV][1] for the tab-separated-value part at the end of the file, but i do not know how to parse the beginning of the file and how to combine this (if this approach is possible) with NeoCSV.
[1]: https://github.com/svenvc/docs/blob/master/neo/neo-csv-paper.md | 0 |
11,628,541 | 07/24/2012 10:05:09 | 1,359,306 | 04/26/2012 17:09:47 | 77 | 5 | Unusual inactive uitableview after scroll | I have a strange issue and I am not sure what is causing it. I have a horizontal scroll view which has an unknown width (paging is enabled):
myScrollView.contentSize = CGSizeMake(320 * count, myScrollView.frame.size.height);
Inside this scroll view is a single table (myTable) which updates depending what the current page is. In the scrollViewDidScroll method - the int page is set, pageControl (UIPageControl) is updated and then I shift the table so that it is still in view. After moving the table I update the data and reload the table.
- (void)scrollViewDidScroll:(UIScrollView *)sender {
CGFloat pageWidth = myScrollView.frame.size.width;
page = floor((tableScroll.contentOffset.x - pageWidth / 2) / pageWidth) + 1;
pageControl.currentPage = page;
[myTable setFrame:CGRectMake(tableScroll.contentOffset.x, 0, 320, 213)];
//[myTable bringSubviewToFront:tableScroll];
//[tableScroll bringSubviewToFront:self.view];
[self getMyData];
[myTable reloadData];
This works fine and the table is visible after scrolling and the data has been updated. The issue I am having is that all interactivity of the table is lost. I cannot click any buttons on the cell or click the cell itself. Interaction is only working on the very first page.
Does anyone know what may be causing this or how to solve it. Cheers | iphone | ios | uitableview | uitableviewcell | uiscrollview | null | open | Unusual inactive uitableview after scroll
===
I have a strange issue and I am not sure what is causing it. I have a horizontal scroll view which has an unknown width (paging is enabled):
myScrollView.contentSize = CGSizeMake(320 * count, myScrollView.frame.size.height);
Inside this scroll view is a single table (myTable) which updates depending what the current page is. In the scrollViewDidScroll method - the int page is set, pageControl (UIPageControl) is updated and then I shift the table so that it is still in view. After moving the table I update the data and reload the table.
- (void)scrollViewDidScroll:(UIScrollView *)sender {
CGFloat pageWidth = myScrollView.frame.size.width;
page = floor((tableScroll.contentOffset.x - pageWidth / 2) / pageWidth) + 1;
pageControl.currentPage = page;
[myTable setFrame:CGRectMake(tableScroll.contentOffset.x, 0, 320, 213)];
//[myTable bringSubviewToFront:tableScroll];
//[tableScroll bringSubviewToFront:self.view];
[self getMyData];
[myTable reloadData];
This works fine and the table is visible after scrolling and the data has been updated. The issue I am having is that all interactivity of the table is lost. I cannot click any buttons on the cell or click the cell itself. Interaction is only working on the very first page.
Does anyone know what may be causing this or how to solve it. Cheers | 0 |
11,628,379 | 07/24/2012 09:54:55 | 1,263,978 | 03/12/2012 11:27:14 | 267 | 1 | How to know if an object is an instance of a TypeTag's type? | I have a function which is able to know if an object is an instance of a `Manifest`'s type. I would like to migrate it to a `TypeTag` version. The old function is the following one:
def myIsInstanceOf[T: Manifest](that: Any) =
implicitly[Manifest[T]].erasure.isInstance(that)
I have been experimenting with the TypeTags and now I have this TypeTag version:
// Involved definitions
def myInstanceToTpe[T: TypeTag](x: T) = typeOf[T]
def myIsInstanceOf[T: TypeTag, U: TypeTag](tag: TypeTag[T], that: U) =
myInstanceToTpe(that) stat_<:< tag.tpe
// Some invocation examples
class A
class B extends A
class C
myIsInstanceOf(typeTag[A], new A) /* true */
myIsInstanceOf(typeTag[A], new B) /* true */
myIsInstanceOf(typeTag[A], new C) /* false */
Is there any better way to achieve this task? Can the parameterized `U` be omitted, using an `Any` instead (just as it is done in the old function)? | scala | instanceof | scala-2.10 | null | null | null | open | How to know if an object is an instance of a TypeTag's type?
===
I have a function which is able to know if an object is an instance of a `Manifest`'s type. I would like to migrate it to a `TypeTag` version. The old function is the following one:
def myIsInstanceOf[T: Manifest](that: Any) =
implicitly[Manifest[T]].erasure.isInstance(that)
I have been experimenting with the TypeTags and now I have this TypeTag version:
// Involved definitions
def myInstanceToTpe[T: TypeTag](x: T) = typeOf[T]
def myIsInstanceOf[T: TypeTag, U: TypeTag](tag: TypeTag[T], that: U) =
myInstanceToTpe(that) stat_<:< tag.tpe
// Some invocation examples
class A
class B extends A
class C
myIsInstanceOf(typeTag[A], new A) /* true */
myIsInstanceOf(typeTag[A], new B) /* true */
myIsInstanceOf(typeTag[A], new C) /* false */
Is there any better way to achieve this task? Can the parameterized `U` be omitted, using an `Any` instead (just as it is done in the old function)? | 0 |
11,628,474 | 07/24/2012 10:00:56 | 1,303,127 | 03/30/2012 11:30:10 | 6 | 0 | eclipse is not finding plugin in dependencies | i have to add a plugin in dependencies tab. but after click on add in required plugins when i enter that plugin name it does not show that plugin in matching items.but that plugin is available in my target platform content . anyone know what is happening and how to resolve this.
Thanks | eclipse | eclipse-plugin | null | null | null | null | open | eclipse is not finding plugin in dependencies
===
i have to add a plugin in dependencies tab. but after click on add in required plugins when i enter that plugin name it does not show that plugin in matching items.but that plugin is available in my target platform content . anyone know what is happening and how to resolve this.
Thanks | 0 |
11,628,542 | 07/24/2012 10:05:11 | 1,142,160 | 01/11/2012 01:59:46 | 166 | 0 | Python csv: preserve headers when writing to file | I wrote a simple function that acts depending on the number of rows of the CSV the user is supplying, by either adding or removing columns:
def sanExt(ifpath, ofpath):
with open(ifpath, "rb") as fin, open(ofpath, "wb") as fout:
csvin = csv.reader(fin)
csvout = csv.writer(fout, delimiter=",")
fline = csvin.next()
if len(fline) == 33:
for row in csvin:
row.insert(10, "NULL")
csvout.writerow(row)
print "AG"
elif len(fline) == 35:
print "AI"
elif len(fline) == 36:
print "AJ"
else:
print "Unknown"
I've stopped at the first `if` statement, just to make sure my code works. The column is properly added in this case, but the headers are missing.
How do I make sure every row is written to the file, not just `[1:len(rows)]`?
Is my method the proper pythonic way to do the desired job? | python | csv | null | null | null | null | open | Python csv: preserve headers when writing to file
===
I wrote a simple function that acts depending on the number of rows of the CSV the user is supplying, by either adding or removing columns:
def sanExt(ifpath, ofpath):
with open(ifpath, "rb") as fin, open(ofpath, "wb") as fout:
csvin = csv.reader(fin)
csvout = csv.writer(fout, delimiter=",")
fline = csvin.next()
if len(fline) == 33:
for row in csvin:
row.insert(10, "NULL")
csvout.writerow(row)
print "AG"
elif len(fline) == 35:
print "AI"
elif len(fline) == 36:
print "AJ"
else:
print "Unknown"
I've stopped at the first `if` statement, just to make sure my code works. The column is properly added in this case, but the headers are missing.
How do I make sure every row is written to the file, not just `[1:len(rows)]`?
Is my method the proper pythonic way to do the desired job? | 0 |
11,628,549 | 07/24/2012 10:05:36 | 1,548,225 | 07/24/2012 09:39:25 | 1 | 0 | Forms Authentication cookie passing passing in some servers not others on multiple servers and sub domains | I am trying to set up forms authentication across multiple servers and subdomains but I am finding an issue where it works on some of our boxes and not others. We are passing 2 cookies from one server to another. One the Forms Authentication encrypted cookie and the other an non encrypted cookie.
We have the correct keys set on both boxes:
<authentication mode="Forms" >
<forms name=".MSLA" protection="All" timeout="30" slidingExpiration="true" path="/"
enableCrossAppRedirects="true" />
</authentication>
<machineKey
decryption="AES"
decryptionKey="CAB....."
validation="AES"
validationKey="A2........."
/>
We are setting the correct cookie domain eg. .bbbb.com as one site will be login.bbbb.com and the other being standard.bbbb.com.
On the boxes that do work I am finding that the isAutenticated is true and the Forms Authentication username is decrypted, however in the other sets of boxes that do not work I am finding that the non forms authentication cookie is passed correctly and read but the forms authentication cookie is passed (I can see this with Firebug) but the second site is unable to decrypt it and isAuthenicated is therefore False.
We are using Windows server 2008 and updates where applied a month ago.
I have seen this similar article to my problem ad I have tried this but this doesn't work for me.
[Similar Article with same issue but doesn't work][1]
[1]: http://stackoverflow.com/questions/9281419/setting-up-persistent-forms-authentication-on-multiple-servers-and-subdomains
(MS security bulletin MS11-100)
Has anyone come across this issue before? I am thinking that it must be more of a server setup issue rather than the code as I am able to get it working in some servers not others.
Is there feature that might need to be added to these servers?
| forms-authentication | session-cookies | subdomains | null | null | null | open | Forms Authentication cookie passing passing in some servers not others on multiple servers and sub domains
===
I am trying to set up forms authentication across multiple servers and subdomains but I am finding an issue where it works on some of our boxes and not others. We are passing 2 cookies from one server to another. One the Forms Authentication encrypted cookie and the other an non encrypted cookie.
We have the correct keys set on both boxes:
<authentication mode="Forms" >
<forms name=".MSLA" protection="All" timeout="30" slidingExpiration="true" path="/"
enableCrossAppRedirects="true" />
</authentication>
<machineKey
decryption="AES"
decryptionKey="CAB....."
validation="AES"
validationKey="A2........."
/>
We are setting the correct cookie domain eg. .bbbb.com as one site will be login.bbbb.com and the other being standard.bbbb.com.
On the boxes that do work I am finding that the isAutenticated is true and the Forms Authentication username is decrypted, however in the other sets of boxes that do not work I am finding that the non forms authentication cookie is passed correctly and read but the forms authentication cookie is passed (I can see this with Firebug) but the second site is unable to decrypt it and isAuthenicated is therefore False.
We are using Windows server 2008 and updates where applied a month ago.
I have seen this similar article to my problem ad I have tried this but this doesn't work for me.
[Similar Article with same issue but doesn't work][1]
[1]: http://stackoverflow.com/questions/9281419/setting-up-persistent-forms-authentication-on-multiple-servers-and-subdomains
(MS security bulletin MS11-100)
Has anyone come across this issue before? I am thinking that it must be more of a server setup issue rather than the code as I am able to get it working in some servers not others.
Is there feature that might need to be added to these servers?
| 0 |
11,472,724 | 07/13/2012 14:40:31 | 1,489,566 | 06/28/2012 19:12:26 | 28 | 0 | Jquery Coin Slider - not working at all | I'm trying to integrate the Coin Slider (http://workshop.rs/projects/coin-slider/)
into my page, and I've downloaded and attached the latest Jquery to my header, along with all of the necessary Coin-slider files. However, the page simply stacks the images as if I had simply inserted <img> tags.
The paths for all of the files are correct. I tried following his instructions to the letter on the "how to install" page, with no success. It won't work in IE8, or the latest versions of Chrome or Firefox.
<!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>
<link rel="stylesheet" href="css/paradigm.css" type="text/css" />
<link rel="stylesheet" href="css/coin-slider-styles.css" type="text/css" />
<script type="text/javascript" src="js/coin-slider.min.js"></script>
<script type="text/javascript" src="js/coin-slider.js"></script>
<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Paradigm Solutions</title>
</head>
<body>
<div id="container">
<div id="header"></div>
<div id="navbar"></div>
<div id="leftMenu"></div>
<div id="coin-slider">
<a href="http://windows.microsoft.com/en-us/internet-explorer/products/ie/home/" target="_blank">
<img src="http://www.vexite.com/images/2011/06/browser-war-illustration.jpg" alt="IESucks" />
<span>
<b>Don't Use IE</b><br />
Internet Explorer is an inferior product that should be destroyed.
</span>
</a>
<a href="http://windows.microsoft.com/en-us/internet-explorer/products/ie/home/" target="_blank">
<img src="http://www.vexite.com/images/2011/06/browser-war-illustration.jpg" alt="IESucks" />
<span>
<b>Don't Use IE</b><br />
Internet Explorer is an inferior product that should be destroyed.
</span>
</a>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('#coin-slider').coinslider();
});
</script>
</body>
</html>
| javascript | jquery | html | slider | null | null | open | Jquery Coin Slider - not working at all
===
I'm trying to integrate the Coin Slider (http://workshop.rs/projects/coin-slider/)
into my page, and I've downloaded and attached the latest Jquery to my header, along with all of the necessary Coin-slider files. However, the page simply stacks the images as if I had simply inserted <img> tags.
The paths for all of the files are correct. I tried following his instructions to the letter on the "how to install" page, with no success. It won't work in IE8, or the latest versions of Chrome or Firefox.
<!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>
<link rel="stylesheet" href="css/paradigm.css" type="text/css" />
<link rel="stylesheet" href="css/coin-slider-styles.css" type="text/css" />
<script type="text/javascript" src="js/coin-slider.min.js"></script>
<script type="text/javascript" src="js/coin-slider.js"></script>
<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Paradigm Solutions</title>
</head>
<body>
<div id="container">
<div id="header"></div>
<div id="navbar"></div>
<div id="leftMenu"></div>
<div id="coin-slider">
<a href="http://windows.microsoft.com/en-us/internet-explorer/products/ie/home/" target="_blank">
<img src="http://www.vexite.com/images/2011/06/browser-war-illustration.jpg" alt="IESucks" />
<span>
<b>Don't Use IE</b><br />
Internet Explorer is an inferior product that should be destroyed.
</span>
</a>
<a href="http://windows.microsoft.com/en-us/internet-explorer/products/ie/home/" target="_blank">
<img src="http://www.vexite.com/images/2011/06/browser-war-illustration.jpg" alt="IESucks" />
<span>
<b>Don't Use IE</b><br />
Internet Explorer is an inferior product that should be destroyed.
</span>
</a>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('#coin-slider').coinslider();
});
</script>
</body>
</html>
| 0 |
11,472,725 | 07/13/2012 14:40:32 | 1,321,564 | 04/09/2012 09:29:42 | 59 | 4 | Getting String from server into GWT DateBox/DatePicker OR writing my own DateTimeFormat? | I'm currently writing some Localization-Package for GWT, which retrieves its translations fly from server. Now I'm building my `LocaleAwareDateBox` and `LocaleAwareDatePicker` and I have to modify the source for the month-Strings and the dateFormat-String.
As far as I can tell (looked at GWT source code) the data flow is like that:
1. `DateBox` creates a `DatePicker`
2. `DatePicker`creates `DefaultMonthSelector`, `DefaultCalendarView` and `CalendarModel`.
3. `DefaultMonthSelector` creates the visible Grid of `DatePicker`
4. `DefaultMonthSelector` calls `getModel().formatCurrentMonth()` to receive the displayed string for the month (`Jan`, `Feb`, etc.)
And now inside `CalendarModel` the fun begins: There are 3 methods that return the Strings for Month (`formatCurrentMonth()`), DayOfMonth (`formatDayOfMonth(Date date)`), DayInWeek (`formatDayOfWeek(int dayInWeek)`).
Let's start with the easy one:
- `formatDayOfWeek(int dayInWeek)` simply does `return dayOfWeekNames[dayInWeek];`. So I have to overwrite `dayOfWeekNames[7]` with my strings from the server. The GWT implementation uses `DateTimeFormat.getFormat("ccccc");`.
- `formatDayOfMonth(Date date)` simply does `dayOfMonthNames[date.getDate()];`. Here I also could fill `dayOfMonthNames[32]` with my strings from the server. And here again the GWT implementation calling `DateTimeFormat.getFormat(PredefinedFormat.DAY);`.
- Here it's getting hard: `formatCurrentMonth()`. It does `return getMonthAndYearFormatter().format(currentMonth);`. Where `getMonthAndYearFormatter` does: `return DateTimeFormat.getFormat(PredefinedFormat.YEAR_MONTH_ABBR);`. And here I just can't tell what's going on.
Is there another way of getting my own Strings into it?
Somewhere I read that there exists an Interface calles `CustomDateTimeFormat`, but I don't know if it could help me. Are there any examples?
Would be very nice if someone can tell me what's the easiest way of using my own Strings with `CalendarModel` and `DatePicker`. | gwt | datepicker | locale | datetime-format | datebox | null | open | Getting String from server into GWT DateBox/DatePicker OR writing my own DateTimeFormat?
===
I'm currently writing some Localization-Package for GWT, which retrieves its translations fly from server. Now I'm building my `LocaleAwareDateBox` and `LocaleAwareDatePicker` and I have to modify the source for the month-Strings and the dateFormat-String.
As far as I can tell (looked at GWT source code) the data flow is like that:
1. `DateBox` creates a `DatePicker`
2. `DatePicker`creates `DefaultMonthSelector`, `DefaultCalendarView` and `CalendarModel`.
3. `DefaultMonthSelector` creates the visible Grid of `DatePicker`
4. `DefaultMonthSelector` calls `getModel().formatCurrentMonth()` to receive the displayed string for the month (`Jan`, `Feb`, etc.)
And now inside `CalendarModel` the fun begins: There are 3 methods that return the Strings for Month (`formatCurrentMonth()`), DayOfMonth (`formatDayOfMonth(Date date)`), DayInWeek (`formatDayOfWeek(int dayInWeek)`).
Let's start with the easy one:
- `formatDayOfWeek(int dayInWeek)` simply does `return dayOfWeekNames[dayInWeek];`. So I have to overwrite `dayOfWeekNames[7]` with my strings from the server. The GWT implementation uses `DateTimeFormat.getFormat("ccccc");`.
- `formatDayOfMonth(Date date)` simply does `dayOfMonthNames[date.getDate()];`. Here I also could fill `dayOfMonthNames[32]` with my strings from the server. And here again the GWT implementation calling `DateTimeFormat.getFormat(PredefinedFormat.DAY);`.
- Here it's getting hard: `formatCurrentMonth()`. It does `return getMonthAndYearFormatter().format(currentMonth);`. Where `getMonthAndYearFormatter` does: `return DateTimeFormat.getFormat(PredefinedFormat.YEAR_MONTH_ABBR);`. And here I just can't tell what's going on.
Is there another way of getting my own Strings into it?
Somewhere I read that there exists an Interface calles `CustomDateTimeFormat`, but I don't know if it could help me. Are there any examples?
Would be very nice if someone can tell me what's the easiest way of using my own Strings with `CalendarModel` and `DatePicker`. | 0 |
11,472,726 | 07/13/2012 14:40:32 | 1,020,097 | 10/29/2011 19:43:03 | 1 | 0 | Inputting XSD to Rails Forms | I have been happily creating forms in Rails that accept XML and JSON examples, but now I am stuck with related XSD files.
The XSDs are accepted by the form, but are not displayed on the resultant show page.
Any direction on how to display the XSD would be great. . .
Thanks | ruby-on-rails | forms | xsd | null | null | null | open | Inputting XSD to Rails Forms
===
I have been happily creating forms in Rails that accept XML and JSON examples, but now I am stuck with related XSD files.
The XSDs are accepted by the form, but are not displayed on the resultant show page.
Any direction on how to display the XSD would be great. . .
Thanks | 0 |
11,472,728 | 07/13/2012 14:40:46 | 1,523,802 | 07/13/2012 14:15:02 | 1 | 0 | Creating PDF from photos on a Facebook Rails app | I'm creating a Facebook app using Rails and hosted on Heroku and I'm having a bit of trouble finding the ideal way to solve a problem. I want the user to be able to move their photos around on the screen, position them, and then download that as either a PDF or a PNG file to be emailed or printed. I have the app getting the user's facebook photos and they can drag them on to a HTML5 Canvas element to position them. Taking this canvas, however, and converting it into something printable is where I'm hitting a dead end.
Basically I have a few ideas I have tried:
**Convert the Canvas to a PNG using toDataURL() -** Would work perfectly but since the photos are external, the canvas is "dirty" and will throw up a security issue. I've thought about trying to copy the pixels of each image to a pixel array but I've heard this may not work either due to security issues. Since the app is dealing with people's facebook images I really don't want to store them on the app's server.
**Use PDFKit/wkhtmltopdf to create a PDF using Rails -** I've tried this, but since the app is a Sinatra app (I think), it's confusing me a lot. It's throwing errors with the to_pdf call saying 'Command Failed'. I've tried adding a config.middleware.use line but I'm not 100% sure where to put it and everywhere seems to be failing saying "config" is an undefined variable. Also installing wkhtmltopdf seems to fail on Heroku once I test it outside localhost.
**Use Prawn to create a PDF using Rails -** I've tried prawn but it seems to have a similar problem to PDFKit and I get confused about what goes where on a Sinatra app. I'm sure I read as well that people were having problems with it too.
Have I missed any obvious solutions to this, or is there something I'm not thinking of? All I want to do is create some kind of easily printable file with positioning intact that can be easily downloaded and printed by the user but I've come across so many problems that I don't know where to go next and I'm going round in circles.
If anyone had any advice for me about how I could get around this problem I'd really appreciate it.
| ruby-on-rails | canvas | heroku | pdf-generation | pdfkit | null | open | Creating PDF from photos on a Facebook Rails app
===
I'm creating a Facebook app using Rails and hosted on Heroku and I'm having a bit of trouble finding the ideal way to solve a problem. I want the user to be able to move their photos around on the screen, position them, and then download that as either a PDF or a PNG file to be emailed or printed. I have the app getting the user's facebook photos and they can drag them on to a HTML5 Canvas element to position them. Taking this canvas, however, and converting it into something printable is where I'm hitting a dead end.
Basically I have a few ideas I have tried:
**Convert the Canvas to a PNG using toDataURL() -** Would work perfectly but since the photos are external, the canvas is "dirty" and will throw up a security issue. I've thought about trying to copy the pixels of each image to a pixel array but I've heard this may not work either due to security issues. Since the app is dealing with people's facebook images I really don't want to store them on the app's server.
**Use PDFKit/wkhtmltopdf to create a PDF using Rails -** I've tried this, but since the app is a Sinatra app (I think), it's confusing me a lot. It's throwing errors with the to_pdf call saying 'Command Failed'. I've tried adding a config.middleware.use line but I'm not 100% sure where to put it and everywhere seems to be failing saying "config" is an undefined variable. Also installing wkhtmltopdf seems to fail on Heroku once I test it outside localhost.
**Use Prawn to create a PDF using Rails -** I've tried prawn but it seems to have a similar problem to PDFKit and I get confused about what goes where on a Sinatra app. I'm sure I read as well that people were having problems with it too.
Have I missed any obvious solutions to this, or is there something I'm not thinking of? All I want to do is create some kind of easily printable file with positioning intact that can be easily downloaded and printed by the user but I've come across so many problems that I don't know where to go next and I'm going round in circles.
If anyone had any advice for me about how I could get around this problem I'd really appreciate it.
| 0 |
11,472,731 | 07/13/2012 14:40:54 | 457,208 | 06/10/2010 09:12:31 | 489 | 29 | Base64 InputStream to String | I have been trying to get an input stream reading a file, which isa plain text and has embeded some images and another files in `base64` and write it again in a String. But keeping the encoding, I mean, I want to have in the String something like:
/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFhEYIx8lJCIf
IiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/2wBDAQoLCw4NDhwQEBw7KCIoOzs7Ozs7
I have been trying with the classes `Base64InputStream` and more from packages as `org.apache.commons.codec` but I just can not fiugure it out. Any kind of help would be really appreciated. Thanks in advance!
| java | base64 | null | null | null | null | open | Base64 InputStream to String
===
I have been trying to get an input stream reading a file, which isa plain text and has embeded some images and another files in `base64` and write it again in a String. But keeping the encoding, I mean, I want to have in the String something like:
/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFhEYIx8lJCIf
IiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/2wBDAQoLCw4NDhwQEBw7KCIoOzs7Ozs7
I have been trying with the classes `Base64InputStream` and more from packages as `org.apache.commons.codec` but I just can not fiugure it out. Any kind of help would be really appreciated. Thanks in advance!
| 0 |
11,472,733 | 07/13/2012 14:41:02 | 1,523,825 | 07/13/2012 14:25:21 | 1 | 0 | .Net App only redirects user to authenticate if they visit the root url | I'm running into a strange issue. I have a .Net application deploying to Azure which is using Azure ACS for authentication. While the project is set up as a web application, we are primarily serving static .html and .js files. The problem is that the user is redirected to authenticate through ACS ONLY when they visit our root url directly.
For example, I have this set up locally through the Azure emulator. If the user goes to 127.0.0.1:81/ they are redirected to log in, but if they go directly to 127.0.0.1:81/Index.html, they are able to load up the page without being redirected to ACS. (although subsequent .js calls during the page load to a .svc service fail)
Here is my web.config file:
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
<section name="microsoft.identityModel" type="Microsoft.IdentityModel.Configuration.MicrosoftIdentityModelSection, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</configSections>
<location path="FederationMetadata">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<system.web>
<httpRuntime requestValidationMode ="2.0"/>
<authorization>
<deny users="?" />
</authorization>
<authentication mode="None" />
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add assembly="Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
</system.web>
<connectionStrings>
<add name="ExperienceBrowserEntities" connectionString="metadata=res://*/ExperienceBrowser.csdl|res://*/ExperienceBrowser.ssdl|res://*/ExperienceBrowser.msl;provider=System.Data.SqlClient;provider connection string="Data Source=tmbwb1mnyn.database.windows.net;Initial Catalog=ExperienceBrowser;Persist Security Info=True;User ID=ExperienceBrowserUser;Password=Pariveda1;MultipleActiveResultSets=True;Application Name=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
</system.serviceModel>
<appSettings>
<add key="FederationMetadataLocation" value="https://appCentral.accesscontrol.windows.net/FederationMetadata/2007-06/FederationMetadata.xml" />
</appSettings>
<system.webServer>
<modules>
<add name="WSFederationAuthenticationModule" type="Microsoft.IdentityModel.Web.WSFederationAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler" />
<add name="SessionAuthenticationModule" type="Microsoft.IdentityModel.Web.SessionAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler" />
</modules>
</system.webServer>
<microsoft.identityModel>
<service>
<audienceUris>
<add value="http://127.0.0.1:81/" />
</audienceUris>
<federatedAuthentication>
<wsFederation passiveRedirectEnabled="true" issuer="https://appCentral.accesscontrol.windows.net/v2/wsfederation" realm="http://127.0.0.1:81/" requireHttps="false" />
<cookieHandler requireSsl="false" />
</federatedAuthentication>
<applicationService>
<claimTypeRequired>
<!--Following are the claims offered by STS 'https://appCentral.accesscontrol.windows.net/'. Add or uncomment claims that you require by your application and then update the federation metadata of this application.-->
<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name" optional="true" />
<claimType type="http://schemas.microsoft.com/ws/2008/06/identity/claims/role" optional="true" />
<!--<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier" optional="true" />-->
<!--<claimType type="http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider" optional="true" />-->
</claimTypeRequired>
</applicationService>
<issuerNameRegistry type="Microsoft.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<trustedIssuers>
<add thumbprint="D6DAB54F4A47E88FFF206E6796A3367DA6033B0C" name="https://appCentral.accesscontrol.windows.net/" />
</trustedIssuers>
</issuerNameRegistry>
<certificateValidation certificateValidationMode="None" />
</service>
</microsoft.identityModel>
</configuration> | .net | azure | wif | acs | null | null | open | .Net App only redirects user to authenticate if they visit the root url
===
I'm running into a strange issue. I have a .Net application deploying to Azure which is using Azure ACS for authentication. While the project is set up as a web application, we are primarily serving static .html and .js files. The problem is that the user is redirected to authenticate through ACS ONLY when they visit our root url directly.
For example, I have this set up locally through the Azure emulator. If the user goes to 127.0.0.1:81/ they are redirected to log in, but if they go directly to 127.0.0.1:81/Index.html, they are able to load up the page without being redirected to ACS. (although subsequent .js calls during the page load to a .svc service fail)
Here is my web.config file:
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
<section name="microsoft.identityModel" type="Microsoft.IdentityModel.Configuration.MicrosoftIdentityModelSection, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</configSections>
<location path="FederationMetadata">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<system.web>
<httpRuntime requestValidationMode ="2.0"/>
<authorization>
<deny users="?" />
</authorization>
<authentication mode="None" />
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add assembly="Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
</system.web>
<connectionStrings>
<add name="ExperienceBrowserEntities" connectionString="metadata=res://*/ExperienceBrowser.csdl|res://*/ExperienceBrowser.ssdl|res://*/ExperienceBrowser.msl;provider=System.Data.SqlClient;provider connection string="Data Source=tmbwb1mnyn.database.windows.net;Initial Catalog=ExperienceBrowser;Persist Security Info=True;User ID=ExperienceBrowserUser;Password=Pariveda1;MultipleActiveResultSets=True;Application Name=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
</system.serviceModel>
<appSettings>
<add key="FederationMetadataLocation" value="https://appCentral.accesscontrol.windows.net/FederationMetadata/2007-06/FederationMetadata.xml" />
</appSettings>
<system.webServer>
<modules>
<add name="WSFederationAuthenticationModule" type="Microsoft.IdentityModel.Web.WSFederationAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler" />
<add name="SessionAuthenticationModule" type="Microsoft.IdentityModel.Web.SessionAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler" />
</modules>
</system.webServer>
<microsoft.identityModel>
<service>
<audienceUris>
<add value="http://127.0.0.1:81/" />
</audienceUris>
<federatedAuthentication>
<wsFederation passiveRedirectEnabled="true" issuer="https://appCentral.accesscontrol.windows.net/v2/wsfederation" realm="http://127.0.0.1:81/" requireHttps="false" />
<cookieHandler requireSsl="false" />
</federatedAuthentication>
<applicationService>
<claimTypeRequired>
<!--Following are the claims offered by STS 'https://appCentral.accesscontrol.windows.net/'. Add or uncomment claims that you require by your application and then update the federation metadata of this application.-->
<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name" optional="true" />
<claimType type="http://schemas.microsoft.com/ws/2008/06/identity/claims/role" optional="true" />
<!--<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier" optional="true" />-->
<!--<claimType type="http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider" optional="true" />-->
</claimTypeRequired>
</applicationService>
<issuerNameRegistry type="Microsoft.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<trustedIssuers>
<add thumbprint="D6DAB54F4A47E88FFF206E6796A3367DA6033B0C" name="https://appCentral.accesscontrol.windows.net/" />
</trustedIssuers>
</issuerNameRegistry>
<certificateValidation certificateValidationMode="None" />
</service>
</microsoft.identityModel>
</configuration> | 0 |
11,472,736 | 07/13/2012 14:41:12 | 1,424,192 | 05/29/2012 16:18:39 | 8 | 1 | How can i add multiple values to localstorage array? | **My Problem**: The code below stores one value to the regId, When i click the buton again this value gets overwritten. How can i store a new value in the regId without overwriting the other values in the regId array ?
$('.btn-joinContest').live('click', function(e){
if (Modernizr.localstorage) {
var id = getUrlVars()["id"],
regId = [ ],
currentlist = localStorage.getItem("contest");
if(currentlist == null) {
console.log('Nothing in store');
regId.push(id);
localStorage['contest']=JSON.stringify(regId);
}
else if (currentlist.length === 0) {
console.log('Store contains empty value');
regId.push(id);
localStorage['contest']=JSON.stringify(regId);
} else {
console.log('er zit al wat in dit ophalen en vergelijken');
var storedIds = JSON.parse(localStorage['contest']);
$.each(storedIds, function(index, contestId){
//console.log('val' + index + 'key' + contestId);
if(id == contestId){
console.log('ids zijn gelijk');
} else {
console.log('niet gelijk toevoegen');
regId.push(id);
localStorage['contest']=JSON.stringify(regId);
}
});
}
} else {
console.log('localstorage word NIET deze browser ondersteund u kunt geen contests toevoegen')
}
});
| jquery | local-storage | null | null | null | null | open | How can i add multiple values to localstorage array?
===
**My Problem**: The code below stores one value to the regId, When i click the buton again this value gets overwritten. How can i store a new value in the regId without overwriting the other values in the regId array ?
$('.btn-joinContest').live('click', function(e){
if (Modernizr.localstorage) {
var id = getUrlVars()["id"],
regId = [ ],
currentlist = localStorage.getItem("contest");
if(currentlist == null) {
console.log('Nothing in store');
regId.push(id);
localStorage['contest']=JSON.stringify(regId);
}
else if (currentlist.length === 0) {
console.log('Store contains empty value');
regId.push(id);
localStorage['contest']=JSON.stringify(regId);
} else {
console.log('er zit al wat in dit ophalen en vergelijken');
var storedIds = JSON.parse(localStorage['contest']);
$.each(storedIds, function(index, contestId){
//console.log('val' + index + 'key' + contestId);
if(id == contestId){
console.log('ids zijn gelijk');
} else {
console.log('niet gelijk toevoegen');
regId.push(id);
localStorage['contest']=JSON.stringify(regId);
}
});
}
} else {
console.log('localstorage word NIET deze browser ondersteund u kunt geen contests toevoegen')
}
});
| 0 |
11,472,737 | 07/13/2012 14:41:22 | 1,240,320 | 02/29/2012 13:06:06 | 1,028 | 52 | UiHandler doesn't work with SuggestBox SuggestionEvent | I am using a SuggestBox and trying to capture the SuggestionEvent that is fired when the user selects a Suggestion. I can do this with normal event handlers easily enough:
itemInputBox.addEventHandler(new SuggestionHandler() {
@Override
public void onSuggestionSelect(SuggestionEvent event) {
Window.alert(event.getSelectedSuggestion().getReplacementString());
}
});
That works fine, event fires with the correct replacement string. However, I like to use UiHandler whenever possible due to how much cleaner the code is. So I've tried the following:
@UiHandler("itemInputBox")
void onSuggestionSelect(SuggestionEvent event) {
Window.alert(event.getSelectedSuggestion().getReplacementString());
}
But this results in the following errors:
[WARN] [jsonp] - Method 'getAssociatedType()' could not be found in the event 'SuggestionEvent'.
[ERROR] [jsonp] - Parameter 'SuggestionEvent' is not an event (subclass of GwtEvent).
I have a different UiHandler working correctly on the same SuggestBox so I am kind of confused where I'm going wrong:
@UiHandler("itemInputBox")
void onKeyUp(KeyUpEvent event) {
Window.alert("Key up event firing.");
}
I don't understand why one UiHandler fires correctly, while the other results in a error. | gwt | uibinder | null | null | null | null | open | UiHandler doesn't work with SuggestBox SuggestionEvent
===
I am using a SuggestBox and trying to capture the SuggestionEvent that is fired when the user selects a Suggestion. I can do this with normal event handlers easily enough:
itemInputBox.addEventHandler(new SuggestionHandler() {
@Override
public void onSuggestionSelect(SuggestionEvent event) {
Window.alert(event.getSelectedSuggestion().getReplacementString());
}
});
That works fine, event fires with the correct replacement string. However, I like to use UiHandler whenever possible due to how much cleaner the code is. So I've tried the following:
@UiHandler("itemInputBox")
void onSuggestionSelect(SuggestionEvent event) {
Window.alert(event.getSelectedSuggestion().getReplacementString());
}
But this results in the following errors:
[WARN] [jsonp] - Method 'getAssociatedType()' could not be found in the event 'SuggestionEvent'.
[ERROR] [jsonp] - Parameter 'SuggestionEvent' is not an event (subclass of GwtEvent).
I have a different UiHandler working correctly on the same SuggestBox so I am kind of confused where I'm going wrong:
@UiHandler("itemInputBox")
void onKeyUp(KeyUpEvent event) {
Window.alert("Key up event firing.");
}
I don't understand why one UiHandler fires correctly, while the other results in a error. | 0 |
11,472,739 | 07/13/2012 14:41:33 | 547,345 | 12/18/2010 23:50:07 | 304 | 15 | Use git svn on an orphaned branch | I have created an empty orphan branch on my git repo called 'docs' by doing the following:
cd my-git-repo
git checkout --orphan docs
git rm -rf .
How do I populate this clean orphan branch from an old SVN repo?
Thanks in advance! | git | svn | git-svn | null | null | null | open | Use git svn on an orphaned branch
===
I have created an empty orphan branch on my git repo called 'docs' by doing the following:
cd my-git-repo
git checkout --orphan docs
git rm -rf .
How do I populate this clean orphan branch from an old SVN repo?
Thanks in advance! | 0 |
11,472,740 | 07/13/2012 14:41:42 | 1,455,957 | 06/14/2012 10:25:58 | 101 | 5 | Influence of amount element range indexes on memory consumption | I am interested, how amount element range indexes influence on system performance? I mean those indexes which are used very rarely. Maybe I should remove they, or they do not affect on RAM memory consumption? | marklogic | null | null | null | null | null | open | Influence of amount element range indexes on memory consumption
===
I am interested, how amount element range indexes influence on system performance? I mean those indexes which are used very rarely. Maybe I should remove they, or they do not affect on RAM memory consumption? | 0 |
11,472,747 | 07/13/2012 14:42:06 | 267,702 | 02/06/2010 11:52:45 | 650 | 24 | Macports warning when installing automake: Warning: Deactivate forced. Proceeding despite dependencies | I just installed MacPorts and issued the command:
sudo port install automake
Throughout the process I see this message:
Warning: Deactivate forced. Proceeding despite dependencies.
What does it mean? Why did it happen? Is it critical and, if so, should I do anything about it?
Thanks,
gb
| macports | automake | null | null | null | null | open | Macports warning when installing automake: Warning: Deactivate forced. Proceeding despite dependencies
===
I just installed MacPorts and issued the command:
sudo port install automake
Throughout the process I see this message:
Warning: Deactivate forced. Proceeding despite dependencies.
What does it mean? Why did it happen? Is it critical and, if so, should I do anything about it?
Thanks,
gb
| 0 |
11,472,748 | 07/13/2012 14:42:08 | 863,637 | 07/26/2011 14:21:25 | 205 | 14 | Add text to Action Link | Simple question:
Using `ActionLink`, how to create a hyperlink like this?
<a href="#"
class="dropdown-toggle"
data-toggle="dropdown">
test
<b class="caret"></b></a>
I am trying to add a drop down using bootstrap. Thank you. | asp.net-mvc | twitter-bootstrap | html.actionlink | null | null | null | open | Add text to Action Link
===
Simple question:
Using `ActionLink`, how to create a hyperlink like this?
<a href="#"
class="dropdown-toggle"
data-toggle="dropdown">
test
<b class="caret"></b></a>
I am trying to add a drop down using bootstrap. Thank you. | 0 |
11,594,373 | 07/21/2012 17:31:14 | 963,514 | 09/25/2011 10:35:20 | 124 | 14 | Select multiple elements with multiple attributes (language switcher) | Why is `$('*[lang|="de"][lang|="sv"]').hide();` not selecting and then hiding all my h1s, h2s and ps with the lang="de" and lang="se" attributes? For example with
<p lang="de">Lorem Ipsum ist ein einfacher Blindtext für die Druckindustrie.</p>
<p lang="en">Lorem Ipsum is simply dummy text of the printing industry.</p>
<p lang="sv">Lorem Ipsum är en utfyllnadstext från tryckindustrin.</p>
I'm after a very simple triple language switch (English visible by default) like
<script type="text/javascript">
$('*[lang|="de"][lang|="sv"]').hide();
$("#lang_de").click(function (event) {
event.preventDefault();
$('*[lang|="en"][lang|="sv"]').hide();
$('*[lang|="de"]').show();
});
$("#lang_sv").click(function (event) {
event.preventDefault();
$('*[lang|="de"][lang|="en"]').hide();
$('*[lang|="sv"]').show();
});
</script>
Can attribute selectors not be combined this way? | jquery | attributes | click | null | null | null | open | Select multiple elements with multiple attributes (language switcher)
===
Why is `$('*[lang|="de"][lang|="sv"]').hide();` not selecting and then hiding all my h1s, h2s and ps with the lang="de" and lang="se" attributes? For example with
<p lang="de">Lorem Ipsum ist ein einfacher Blindtext für die Druckindustrie.</p>
<p lang="en">Lorem Ipsum is simply dummy text of the printing industry.</p>
<p lang="sv">Lorem Ipsum är en utfyllnadstext från tryckindustrin.</p>
I'm after a very simple triple language switch (English visible by default) like
<script type="text/javascript">
$('*[lang|="de"][lang|="sv"]').hide();
$("#lang_de").click(function (event) {
event.preventDefault();
$('*[lang|="en"][lang|="sv"]').hide();
$('*[lang|="de"]').show();
});
$("#lang_sv").click(function (event) {
event.preventDefault();
$('*[lang|="de"][lang|="en"]').hide();
$('*[lang|="sv"]').show();
});
</script>
Can attribute selectors not be combined this way? | 0 |
11,594,605 | 07/21/2012 17:59:13 | 1,451,238 | 06/12/2012 12:38:25 | 13 | 0 | Python excepting input only if in range | Hi I want to get a number from user and only except input within a certain range.
The below appears to work but I am a noob and thought whilst it works there is no doubt a more elegant example... just trying not to fall into bad habits!
One thing I have noticed is when I run the program CTL+C will not break me out of the loop and raises the exception instead.
while True:
try:
input = int(raw_input('Pick a number in range 1-10 >>> '))
# Check if input is in range
if input in range(1,10):
break
else:
print 'Out of range. Try again'
except:
print ("That's not a number")
All help greatly appreciated.
| python | error-handling | user-input | null | null | null | open | Python excepting input only if in range
===
Hi I want to get a number from user and only except input within a certain range.
The below appears to work but I am a noob and thought whilst it works there is no doubt a more elegant example... just trying not to fall into bad habits!
One thing I have noticed is when I run the program CTL+C will not break me out of the loop and raises the exception instead.
while True:
try:
input = int(raw_input('Pick a number in range 1-10 >>> '))
# Check if input is in range
if input in range(1,10):
break
else:
print 'Out of range. Try again'
except:
print ("That's not a number")
All help greatly appreciated.
| 0 |
11,594,610 | 07/21/2012 17:59:56 | 952,608 | 09/19/2011 11:56:58 | 186 | 6 | Objective C: Storing hidden information into a UIView | I've been reading up a lot about Gesture Recognizers on SO - and have managed to write a working code which when a long-press is recognised on an UIImage, an action sheet appears:
{ ...
UILongPressGestureRecognizer *longPressWall = [[[UILongPressGestureRecognizer alloc]
initWithTarget:self action:@selector(deleteImage:)] autorelease];
longPressWall.minimumPressDuration = 0.4;
l.userInteractionEnabled=YES;
[l addGestureRecognizer:longPressWall];
... }
-(void)deleteImage:(UILongPressGestureRecognizer*)sender {
if(UIGestureRecognizerStateBegan == sender.state) {
UIActionSheet *as = [[UIActionSheet alloc] initWithTitle:@"" delegate:self cancelButtonTitle:@"Close" destructiveButtonTitle:@"Delete Screenshot" otherButtonTitles: nil];
[as showInView:masterView];
[as release];
}
}
So, sending information to the Selector `deleteImage:` is a little tricky in this situation.
I want to send a HTTP request to a server when deleteImage is called, so I need some information from the view.
Is there anyway to store information into the `UIImageView` and retrieve it from `sender.view.myinfo` (for example) ?
Thanks!
| iphone | objective-c | ios | xcode | null | null | open | Objective C: Storing hidden information into a UIView
===
I've been reading up a lot about Gesture Recognizers on SO - and have managed to write a working code which when a long-press is recognised on an UIImage, an action sheet appears:
{ ...
UILongPressGestureRecognizer *longPressWall = [[[UILongPressGestureRecognizer alloc]
initWithTarget:self action:@selector(deleteImage:)] autorelease];
longPressWall.minimumPressDuration = 0.4;
l.userInteractionEnabled=YES;
[l addGestureRecognizer:longPressWall];
... }
-(void)deleteImage:(UILongPressGestureRecognizer*)sender {
if(UIGestureRecognizerStateBegan == sender.state) {
UIActionSheet *as = [[UIActionSheet alloc] initWithTitle:@"" delegate:self cancelButtonTitle:@"Close" destructiveButtonTitle:@"Delete Screenshot" otherButtonTitles: nil];
[as showInView:masterView];
[as release];
}
}
So, sending information to the Selector `deleteImage:` is a little tricky in this situation.
I want to send a HTTP request to a server when deleteImage is called, so I need some information from the view.
Is there anyway to store information into the `UIImageView` and retrieve it from `sender.view.myinfo` (for example) ?
Thanks!
| 0 |
11,594,611 | 07/21/2012 18:00:13 | 325,578 | 04/25/2010 21:59:12 | 385 | 4 | Table View: setEditing programmatically | `NSMutableArray *objects` holds some objects which I use to display the content of my table view cells. If `objects.count` is 0 I would like to enable the editing mode of my table view when `viewDidLoad`:
- (void)viewDidLoad {
[self setEditing:YES animated:YES];
}
This toggles the `self.editButtonItem` and inserts a new row (stating "Tap here to add a new element") into my table view:
- (void)setEditing:(BOOL)editing animated:(BOOL)animated {
[super setEditing:editing animated:animated];
[self.tableView setEditing:editing animated:animated];
if (self.editing) {
[self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:[self.objects count] inSection:0]]
withRowAnimation:UITableViewRowAnimationAutomatic];
}
else {
[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:[self.objects count] inSection:0]]
withRowAnimation:UITableViewRowAnimationAutomatic];
}
}
Unfortunately this setup results in a crash:
> *** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit/UIKit-1914.85/UITableView.m:833
Is it not possible to toggle the editing mode programmatically? If the user touches the `self.editButtonItem` everything works fine – and as far as I know, this editButton does the same I'm doing in `viewDidLoad`.
What am I doing wrong? | objective-c | null | null | null | null | null | open | Table View: setEditing programmatically
===
`NSMutableArray *objects` holds some objects which I use to display the content of my table view cells. If `objects.count` is 0 I would like to enable the editing mode of my table view when `viewDidLoad`:
- (void)viewDidLoad {
[self setEditing:YES animated:YES];
}
This toggles the `self.editButtonItem` and inserts a new row (stating "Tap here to add a new element") into my table view:
- (void)setEditing:(BOOL)editing animated:(BOOL)animated {
[super setEditing:editing animated:animated];
[self.tableView setEditing:editing animated:animated];
if (self.editing) {
[self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:[self.objects count] inSection:0]]
withRowAnimation:UITableViewRowAnimationAutomatic];
}
else {
[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:[self.objects count] inSection:0]]
withRowAnimation:UITableViewRowAnimationAutomatic];
}
}
Unfortunately this setup results in a crash:
> *** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit/UIKit-1914.85/UITableView.m:833
Is it not possible to toggle the editing mode programmatically? If the user touches the `self.editButtonItem` everything works fine – and as far as I know, this editButton does the same I'm doing in `viewDidLoad`.
What am I doing wrong? | 0 |
11,594,618 | 07/21/2012 18:01:01 | 962,900 | 09/24/2011 18:18:58 | 1 | 0 | apache serving tomcat proxy ajp, images with https not displaying | i'm using apache in front of tomcat with mod_proxy_ajp, i have a tomcat and a site with spring security. My static contents are delivered by tomcat this is my ajp config:
...
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /images !
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/
<IfModule alias_module>
AliasMatch ^/images/?(.*) "/home/data/$1"
<Directory "/home/data/">
Options -Indexes
Order allow,deny
Allow from all
</Directory>
</IfModule>
...
everything works great http, https... but when i call a https page i can't show the images because i can't access the images by https but with http i can.
Is there something missing with images when you configure apache tomcat proxy ajp and https???
| image | https | proxy | ajp | null | null | open | apache serving tomcat proxy ajp, images with https not displaying
===
i'm using apache in front of tomcat with mod_proxy_ajp, i have a tomcat and a site with spring security. My static contents are delivered by tomcat this is my ajp config:
...
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /images !
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/
<IfModule alias_module>
AliasMatch ^/images/?(.*) "/home/data/$1"
<Directory "/home/data/">
Options -Indexes
Order allow,deny
Allow from all
</Directory>
</IfModule>
...
everything works great http, https... but when i call a https page i can't show the images because i can't access the images by https but with http i can.
Is there something missing with images when you configure apache tomcat proxy ajp and https???
| 0 |
11,594,607 | 07/21/2012 17:59:27 | 1,543,020 | 07/21/2012 17:51:32 | 1 | 0 | CSS: Why are images shifted slightly down in Chrome? | I've got some images in a DIV tag and in firefox, things look lined up nicely but when viewed in chrome they are not. I can't figure out why they get slightly pushed down in chrome.
Site located at www realstockphotos com
http://i.stack.imgur com/FRhg0.jpg <-- view in firefox
http://i.stack.imgur com/IP4rB.jpg <-- view in chrome
this wonderful spam system won't let me post links.. so I've done it the hard way :S | css | div | null | null | null | null | open | CSS: Why are images shifted slightly down in Chrome?
===
I've got some images in a DIV tag and in firefox, things look lined up nicely but when viewed in chrome they are not. I can't figure out why they get slightly pushed down in chrome.
Site located at www realstockphotos com
http://i.stack.imgur com/FRhg0.jpg <-- view in firefox
http://i.stack.imgur com/IP4rB.jpg <-- view in chrome
this wonderful spam system won't let me post links.. so I've done it the hard way :S | 0 |
11,651,162 | 07/25/2012 13:44:29 | 939,213 | 08/30/2011 15:46:38 | 1,913 | 125 | Why do asp:ContentPlaceHolders have opening and closing tags? | I tried googling. (And MSDN-ing.)
I also tried putting text there, but it didn't have any effect.
| asp.net | null | null | null | null | 07/26/2012 14:03:40 | not constructive | Why do asp:ContentPlaceHolders have opening and closing tags?
===
I tried googling. (And MSDN-ing.)
I also tried putting text there, but it didn't have any effect.
| 4 |
11,651,164 | 07/25/2012 13:44:33 | 883,460 | 08/08/2011 05:09:33 | 1 | 0 | While retrieving image from datastore i am getting this error | I am new to google appengine.
I have stored the image in blob field. I am trying to get the image it shows error.
Below i have pasted my code and output.
main.py
import cgi
import webapp2
from google.appengine.api import users
from google.appengine.ext.webapp.template \
import render
from os import path
from google.appengine.ext import db
from google.appengine.api import images
import urllib
import re
import datetime
class imgstore(db.Model):
name=db.StringProperty(multiline=True, default='')
image=db.BlobProperty()
class MainHandler(webapp2.RequestHandler):
def get(self):
moviequery=db.GqlQuery('SELECT * FROM imgstore')
context={
'list':moviequery
}
tmpl = path.join(path.dirname(__file__), 'static/html/index.html')
self.response.out.write(render(tmpl, context))
def post(self):
name1 =images.resize(self.request.get("file"), 32, 32)
formdata = db.Blob(name1)
insert = imgstore()
insert.name="name"
insert.image=formdata
insert.put()
routes=[
(r'/', MainHandler),
]
app = webapp2.WSGIApplication(routes=routes,debug=True)
index.html
> <html>
> <head><title>test</title></head>
> <body>hello
> <form id="form" action="/" method="post" ENCTYPE="multipart/form-data">
> <input type="file" name="file" >
> <input type="submit" name="submit">
> </form>
> {% for lis in list%}
> <img src="{{lis.image}}">
> {% endfor %}
> </body>
> </html>
Output
Traceback (most recent call last):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 1536, in __call__
rv = self.handle_exception(request, response, e)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 1530, in __call__
rv = self.router.dispatch(request, response)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 1278, in default_dispatcher
return route.handler_adapter(request, response)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 1102, in __call__
return handler.dispatch()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 572, in dispatch
return self.handle_exception(e, self.app.debug)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 570, in dispatch
return method(*args, **kwargs)
File "/Users/saravase/test/main.py", line 44, in get
self.response.out.write(render(tmpl, context))
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/template.py", line 92, in render
return t.render(Context(template_dict))
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/template.py", line 172, in wrap_render
return orig_render(context)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/_internal/django/template/__init__.py", line 173, in render
return self._render(context)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/_internal/django/template/__init__.py", line 167, in _render
return self.nodelist.render(context)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/_internal/django/template/__init__.py", line 794, in render
bits.append(self.render_node(node, context))
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/_internal/django/template/__init__.py", line 807, in render_node
return node.render(context)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/_internal/django/template/defaulttags.py", line 173, in render
nodelist.append(node.render(context))
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/_internal/django/template/__init__.py", line 847, in render
return _render_value_in_context(output, context)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/_internal/django/template/__init__.py", line 827, in _render_value_in_context
value = force_unicode(value)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/_internal/django/utils/encoding.py", line 88, in force_unicode
raise DjangoUnicodeDecodeError(s, *e.args)
DjangoUnicodeDecodeError: 'utf8' codec can't decode byte 0x89 in position 0: invalid start byte. You passed in '\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00 \x00\x00\x00\x14\x08\x06\x00\x00\x00\xec\x91?O\x00\x00\x066IDATx\x9c\xad\xd6i\x8c\x95W\x19\x07\xf0\xffs\xce}\xdf\xf7ns/\xb3\xdc;03\xcc\xc0\xb0\xcc\x1d\x8a\xb4\x99\xb2:\x05KS\xa8\xa4M\x00\x95\x8e\xd3\xfa\xc1%\xe9W5\xa9\xf1\x83\x89F\xe3\x17hP\x96\x84hCB\x14k\xc4b\x04\xaa\xb5j\xd0V\xa4\xd0\xa1(\x85P\x18(\xcc\xc2,\xf7\xce\x1d\xee\xdc}}\xcf\xf3\xf8\x81E\x88\xadv\xf1|?y~\xf9\xff\x9f\x9c\x1c\x12\x11\x00\x80\x08+aQJ+\x06\x88\x01\xa0\\\xae\xea\xb1\xe1+\xab*\xf9\xcc\xa2\xba\xc6\xd6\xe3\xed\xf3\xe7\x8d\x01 aV\x02\x81R\xda\xe0\x13\x1ebf\x05\x08\x88\x14\x03\x801\x8c\xc4\x8d\xe1\xee\x91\xc1\xb7\xb6M\\;\xf5\xb9Rvt)\x8c\xe8\x91\x1b\x95t\xe3\xdc\x15\xbf\xda\xf4t\xff\xee\x8eEK.\x03 \x11&\x11\xa1O\x02!\x11!\x01djrb\xee\x85\xb7^\xdf:6x\xaa_J#+,OI\xdb\xb6\x03\xed\xb1\x85\xd9\x15\x9fch|<I\xa9\x8c\xc7\x9d\xbd\xe0\x91\xa3\xab7\xf4m\xef\xfaT\xcf\x19\xa5\x08"\xa2DX)\xa5\xdd\x8f\x0c\x18\xba\xf4^\xec\x97\xfb^\xd8\x11\xf2\x8fo\xf0\xeb\x927P\xe7@\xdb>Q\x8a\x8cV\xae\xb2-V\x8e#\x10\xe3\nC\x99\xe4tE\xb3\xa9\x10\xa0\xc4\xd8\xb1\xe3]\xbd\xcfl_\xb1\xfa\x91\xe3Z+\x11\x11%\xccJie\x00\x92\x0f\x05\xb8\xfc\xee\xa5\r\x07\xf7>\xff\xa7\xdc\xf8$Z\xe6\xd4\xbb\xd19\x01j\x8e\xdaZ\x00@\x04\x86\x05\x95\xb2\x0b\xd75\xf0X\n\xa1:\r\xdb\xb1\xdcBA\xa9|6\xa7\xd2\x99<\x9cP\xe7\xe9\x07{\xb7m\x7f`\xe5\xe3\xaf8^\xdb\x88\x08\t\xb3VJ\x19\xd0\x7f\x87\x90\x88`\xaa4\xb8\xe3\xec\x89C\xdf\x1a8v\xb6\x96\x9d\x98\xb0ZZ\x03X\x1c\x8b\xc00\xa1RfX\xb6\x86\xe5\x01<\x1e\x8dR\xb9\x8aJ\xc5\xc0\xf1\x06\xe1x\xaaF\xab\x1a\x15KU\x8aON\x13\xac\xf9\xe7\x97\xac\xe9\xdb\xbe\xe6\xf1\'\x0e;^_\xf5\x0e\x84\x942\xf4\x01\x10\x12f\xb8\x02gd\xe4\xd8I\xedM<|\xfdb\xbav\xf27oX\xd5\\\x12\xdd\xb1F45\xcfB6\'0\xb5*|\xfe H\tr\xe9\x0cf\xd5\xdb(\x95\xca(\x96\x14\x0c+\xe3\xa8\x12\x88\\\x95L\xe6\xc9\x0e\xce\xbd\xb2\xacw\xeb\x0b=\x8fn~\xc9\xf1\x05K\x10!\x16\xd6D\xff\t!fVD\xc4\xc9\x1b\xc3\xb1k\xe7\xf7\xfc\xad\xe7\xb3]\x91\xa2;\xcf}\xe3\xc8\xdb\xfa\xc4\x91?\x92\xc3\x05,\x8e\xb5"\x10\xf2\x02b \x0cd\xf35\x84\xc3\x01dRi\x04\x82\x16\x08\x04f\x03\xcbr\rA!\x93.\xa8\xa9D\x96\xac@\xf3\xf0\xb2\xb5\x9f\xff\xf1\xea\x8d\xdb\x0e\xd4\x85g\xe5\x00!\xe6\xfb!$"\x10\x11ED<=v}\xf1\xd4\xd0\xfe\x83\xb3c\xee\xca\x86\xc8g\xccT\x9a\xf0\xfb\x9f\xbd\xa2/\xfe\xfdm\xb4D\x1dD"Ax}!T\xdd*\xaa\x15\x83B\xae\x86`\xd0F\xa4\xb9\x1e\xf9\xecMT\xaa.&\xe3%h\xcba\xadXl\x95W\xe5R\x91*\xdc4\xb1\xf0\xe1/\xec\xd9\xb8\xf5\x8b/\xce\x8a6\xcc\x88\x08\xdd\x99I\xff~\x88D\x11\x91T\xcbU\x15\xbfz\xec\xeb.\xff\xf9\xfb\xd1E\x9d\xc1\xa0\xbf\xc7\x0c\r\x0f\xd1\xb1\xfd\xaf\xaa\xf3\xa7\xaf`v\xc4\x8bh4\x00\xcbr\xe0\xf5Y "d3\x15\x14+\x04\xad\x05\xe1\x90\rK\x0b|^A6W\xe1t\xc6p\xb1lt\xb1X\xa6j-\x90\\\xbf\xb9o\xcf\xba\xa7\x9e\xdd\xd7\xd0T\x9f\x02\x84\xee\x02\xee" \x04Rf&>:/9rp\x97\xbfqt\xf3\x9c\xce\x1e\xd1j\x8e9w\xfa\xac>\xfc\xe2_(~#\x89\xeeX\x14A\xbf\x03Q6\xf2\x05\x83P\x90\xe1\xf1\x10<\x9a\x90\xcd\xd6\x90H\xe6\x90\xc9\xb9\xc8\x97\x04\x8e\xad9\x1a\xf1K\xd0g\xd4\xe8p\x9c\xaa\xd2\x9cZ\xf7d\xff\x0f\xb7|\xe5\xb9\xbd\xf7\x01n3n\xc7\xa3\xd8\xb8\x90\xf8\xb5\xd7\xb7\xe6S/\xef\x8a,\xd0\xed\r\xd1\x1e6F\xc9_\x8f\x9e\xd6\x87\x0f\x9cB\xb9P\xc4\xc2\x05\x8dhj\x0c\xa2\\)#\x9d1\x98\x9e\xa9\xa0P\xac\xc2\xb1=\xf0\xfb-\xd4\x05m\x84\x02\x1a\xa5R\x05#\xe3y\xa9Q\xc04DZt]\x98\xe8\xab\xdf\xfc\xc1\x86\xf7\x01\xdcI\x83\x15\x01\x04R\xa6\x90\xc9\xd4%\xaf\xff\xfa;\xa0\x13\xdfhZ\xd0\xe6\x04\xeb\x16\x98\xd4t\x86\x0e\xfd\xf4\xa4:z\xe8\x9f\xd0\x9a\xd1\xda\x12\x023A\x88\x00\x114\xd4\xfb0\xbb\xc9\x01\xc4 q\xb3\x8c\xa1q\x17\xb67\x8c\x9e5\x8by\xd5\xc6v\xb5p\xe9\x923\x91\xe0\x965\x1f\x08\xb8\x07\xa2om,q:~56s\xe3\xe7?\xb2}W6E\x17v\x88\xe5\x8d\xf2\xe8\xa5\xb4:\xb0\xf7,]\xf8\xc7\x08b]MplA\xa1PF8\xe4\xc1\xf4L\x19\xc94\x83t\x1d:\x16\xb7\xe0\xb1M\xed\xe8^\x1a2\\\xcdh+\xd0\xfftSt\xf9\xcb\xff\x13p{7\x08\xb8S\x8b\xc8\xf8\xe5\xe3[\xf2\x93\x07v\x86\xc3\xc9\xce\xe6\xaen\xf6\x84\xda\xe4\xd4kc\xfa\xc8/."\x9e\x98\x81\xd7o!\x9f\xad@\xd96b=\xf3\xf1\xe9\xc7\xda\xd0\xd5m\xc3\xaa\x95j\xf1+\xa3\xd6t\xb2\xf5\xc4\xba\xfe\xdd\xeb\xb4\x87\xe8C\x01\xee\xad\x05\x00\x11)\x93\xcf\xe6\xfcc\xe7\x0e>_\x9a8\xfc\xed\xb9\xb1\xa0\xbf\xe9\xa1\xe5&\x9d\x04\xbd\xf9\x87\x1959\xec"S\xcb\xe0\xa1G\xdb\xd0\xd5\xe9\xc2\xaa\xa487]\xe4\xe1\x8b\xe3\x9e\xab\x97s\xc5\xb5\xcf\xfcd\xfd\x03+V\x0e\x08\xb3\xfaH\x80\xf7\xabej\xf4Z\xe7\xe8\xc0\xae=\xb3\x02\xef<\xd9\xfe`\x07\xdb\x8d\xcd29\xdd\xa1\xb57\x07\xdbMq\xe2\x9d\xabr3\x91UC\x83q\xaa\xd0\xa23k\xb7}\xf7\xb9E\xcb\x96\x9f\x13aE\xa4\xf8c\x01n!\x84\x00\xd6D\xda\x18\x86\x8c\x9c\xfdm\xdf\xd4\x85}\xbb[Z3\xcds\xd7?\xcb\x89\xa1Q\x0c\x0f\x0c\xd0{\xef&\xa8(-C\xb1\xde\xaf}o\xd5\xc6\xbe\x97\x1c\xc7faV\xa4n\xfd?>6\xe0\x9e4\xee\xd6\x92\x99N6^xm\xe7\x0e\xe2s_N\xa5\xf2*1\xa9G\xda\x96\xf5\xed\xec}\xeaK\xfb\xeb\xc2\xa1\x92\x08k\x08\xe4\xce\xf0\xff\x0b\xe0.\x84\x8d&\xa5\x98\x85d\xf0\xcc\x9b\xbd\xe9\xd4d\xfb\x92U\xeb\x7f\x17\xaeo\xc8AD\xf1\xad\xc8]"\xba\xef\xde\xbf\x00E\x15c\xc0\xf90\xc3\xa2\x00\x00\x00\x00IEND\xaeB`\x82' (<class 'google.appengine.api.datastore_types.Blob'>)
Please guide me how to proceed further.
| google-app-engine | null | null | null | null | null | open | While retrieving image from datastore i am getting this error
===
I am new to google appengine.
I have stored the image in blob field. I am trying to get the image it shows error.
Below i have pasted my code and output.
main.py
import cgi
import webapp2
from google.appengine.api import users
from google.appengine.ext.webapp.template \
import render
from os import path
from google.appengine.ext import db
from google.appengine.api import images
import urllib
import re
import datetime
class imgstore(db.Model):
name=db.StringProperty(multiline=True, default='')
image=db.BlobProperty()
class MainHandler(webapp2.RequestHandler):
def get(self):
moviequery=db.GqlQuery('SELECT * FROM imgstore')
context={
'list':moviequery
}
tmpl = path.join(path.dirname(__file__), 'static/html/index.html')
self.response.out.write(render(tmpl, context))
def post(self):
name1 =images.resize(self.request.get("file"), 32, 32)
formdata = db.Blob(name1)
insert = imgstore()
insert.name="name"
insert.image=formdata
insert.put()
routes=[
(r'/', MainHandler),
]
app = webapp2.WSGIApplication(routes=routes,debug=True)
index.html
> <html>
> <head><title>test</title></head>
> <body>hello
> <form id="form" action="/" method="post" ENCTYPE="multipart/form-data">
> <input type="file" name="file" >
> <input type="submit" name="submit">
> </form>
> {% for lis in list%}
> <img src="{{lis.image}}">
> {% endfor %}
> </body>
> </html>
Output
Traceback (most recent call last):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 1536, in __call__
rv = self.handle_exception(request, response, e)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 1530, in __call__
rv = self.router.dispatch(request, response)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 1278, in default_dispatcher
return route.handler_adapter(request, response)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 1102, in __call__
return handler.dispatch()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 572, in dispatch
return self.handle_exception(e, self.app.debug)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 570, in dispatch
return method(*args, **kwargs)
File "/Users/saravase/test/main.py", line 44, in get
self.response.out.write(render(tmpl, context))
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/template.py", line 92, in render
return t.render(Context(template_dict))
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/template.py", line 172, in wrap_render
return orig_render(context)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/_internal/django/template/__init__.py", line 173, in render
return self._render(context)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/_internal/django/template/__init__.py", line 167, in _render
return self.nodelist.render(context)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/_internal/django/template/__init__.py", line 794, in render
bits.append(self.render_node(node, context))
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/_internal/django/template/__init__.py", line 807, in render_node
return node.render(context)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/_internal/django/template/defaulttags.py", line 173, in render
nodelist.append(node.render(context))
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/_internal/django/template/__init__.py", line 847, in render
return _render_value_in_context(output, context)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/_internal/django/template/__init__.py", line 827, in _render_value_in_context
value = force_unicode(value)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/_internal/django/utils/encoding.py", line 88, in force_unicode
raise DjangoUnicodeDecodeError(s, *e.args)
DjangoUnicodeDecodeError: 'utf8' codec can't decode byte 0x89 in position 0: invalid start byte. You passed in '\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00 \x00\x00\x00\x14\x08\x06\x00\x00\x00\xec\x91?O\x00\x00\x066IDATx\x9c\xad\xd6i\x8c\x95W\x19\x07\xf0\xffs\xce}\xdf\xf7ns/\xb3\xdc;03\xcc\xc0\xb0\xcc\x1d\x8a\xb4\x99\xb2:\x05KS\xa8\xa4M\x00\x95\x8e\xd3\xfa\xc1%\xe9W5\xa9\xf1\x83\x89F\xe3\x17hP\x96\x84hCB\x14k\xc4b\x04\xaa\xb5j\xd0V\xa4\xd0\xa1(\x85P\x18(\xcc\xc2,\xf7\xce\x1d\xee\xdc}}\xcf\xf3\xf8\x81E\x88\xadv\xf1|?y~\xf9\xff\x9f\x9c\x1c\x12\x11\x00\x80\x08+aQJ+\x06\x88\x01\xa0\\\xae\xea\xb1\xe1+\xab*\xf9\xcc\xa2\xba\xc6\xd6\xe3\xed\xf3\xe7\x8d\x01 aV\x02\x81R\xda\xe0\x13\x1ebf\x05\x08\x88\x14\x03\x801\x8c\xc4\x8d\xe1\xee\x91\xc1\xb7\xb6M\\;\xf5\xb9Rvt)\x8c\xe8\x91\x1b\x95t\xe3\xdc\x15\xbf\xda\xf4t\xff\xee\x8eEK.\x03 \x11&\x11\xa1O\x02!\x11!\x01djrb\xee\x85\xb7^\xdf:6x\xaa_J#+,OI\xdb\xb6\x03\xed\xb1\x85\xd9\x15\x9fch|<I\xa9\x8c\xc7\x9d\xbd\xe0\x91\xa3\xab7\xf4m\xef\xfaT\xcf\x19\xa5\x08"\xa2DX)\xa5\xdd\x8f\x0c\x18\xba\xf4^\xec\x97\xfb^\xd8\x11\xf2\x8fo\xf0\xeb\x927P\xe7@\xdb>Q\x8a\x8cV\xae\xb2-V\x8e#\x10\xe3\nC\x99\xe4tE\xb3\xa9\x10\xa0\xc4\xd8\xb1\xe3]\xbd\xcfl_\xb1\xfa\x91\xe3Z+\x11\x11%\xccJie\x00\x92\x0f\x05\xb8\xfc\xee\xa5\r\x07\xf7>\xff\xa7\xdc\xf8$Z\xe6\xd4\xbb\xd19\x01j\x8e\xdaZ\x00@\x04\x86\x05\x95\xb2\x0b\xd75\xf0X\n\xa1:\r\xdb\xb1\xdcBA\xa9|6\xa7\xd2\x99<\x9cP\xe7\xe9\x07{\xb7m\x7f`\xe5\xe3\xaf8^\xdb\x88\x08\t\xb3VJ\x19\xd0\x7f\x87\x90\x88`\xaa4\xb8\xe3\xec\x89C\xdf\x1a8v\xb6\x96\x9d\x98\xb0ZZ\x03X\x1c\x8b\xc00\xa1RfX\xb6\x86\xe5\x01<\x1e\x8dR\xb9\x8aJ\xc5\xc0\xf1\x06\xe1x\xaaF\xab\x1a\x15KU\x8aON\x13\xac\xf9\xe7\x97\xac\xe9\xdb\xbe\xe6\xf1\'\x0e;^_\xf5\x0e\x84\x942\xf4\x01\x10\x12f\xb8\x02gd\xe4\xd8I\xedM<|\xfdb\xbav\xf27oX\xd5\\\x12\xdd\xb1F45\xcfB6\'0\xb5*|\xfe H\tr\xe9\x0cf\xd5\xdb(\x95\xca(\x96\x14\x0c+\xe3\xa8\x12\x88\\\x95L\xe6\xc9\x0e\xce\xbd\xb2\xacw\xeb\x0b=\x8fn~\xc9\xf1\x05K\x10!\x16\xd6D\xff\t!fVD\xc4\xc9\x1b\xc3\xb1k\xe7\xf7\xfc\xad\xe7\xb3]\x91\xa2;\xcf}\xe3\xc8\xdb\xfa\xc4\x91?\x92\xc3\x05,\x8e\xb5"\x10\xf2\x02b \x0cd\xf35\x84\xc3\x01dRi\x04\x82\x16\x08\x04f\x03\xcbr\rA!\x93.\xa8\xa9D\x96\xac@\xf3\xf0\xb2\xb5\x9f\xff\xf1\xea\x8d\xdb\x0e\xd4\x85g\xe5\x00!\xe6\xfb!$"\x10\x11ED<=v}\xf1\xd4\xd0\xfe\x83\xb3c\xee\xca\x86\xc8g\xccT\x9a\xf0\xfb\x9f\xbd\xa2/\xfe\xfdm\xb4D\x1dD"Ax}!T\xdd*\xaa\x15\x83B\xae\x86`\xd0F\xa4\xb9\x1e\xf9\xecMT\xaa.&\xe3%h\xcba\xadXl\x95W\xe5R\x91*\xdc4\xb1\xf0\xe1/\xec\xd9\xb8\xf5\x8b/\xce\x8a6\xcc\x88\x08\xdd\x99I\xff~\x88D\x11\x91T\xcbU\x15\xbfz\xec\xeb.\xff\xf9\xfb\xd1E\x9d\xc1\xa0\xbf\xc7\x0c\r\x0f\xd1\xb1\xfd\xaf\xaa\xf3\xa7\xaf`v\xc4\x8bh4\x00\xcbr\xe0\xf5Y "d3\x15\x14+\x04\xad\x05\xe1\x90\rK\x0b|^A6W\xe1t\xc6p\xb1lt\xb1X\xa6j-\x90\\\xbf\xb9o\xcf\xba\xa7\x9e\xdd\xd7\xd0T\x9f\x02\x84\xee\x02\xee" \x04Rf&>:/9rp\x97\xbfqt\xf3\x9c\xce\x1e\xd1j\x8e9w\xfa\xac>\xfc\xe2_(~#\x89\xeeX\x14A\xbf\x03Q6\xf2\x05\x83P\x90\xe1\xf1\x10<\x9a\x90\xcd\xd6\x90H\xe6\x90\xc9\xb9\xc8\x97\x04\x8e\xad9\x1a\xf1K\xd0g\xd4\xe8p\x9c\xaa\xd2\x9cZ\xf7d\xff\x0f\xb7|\xe5\xb9\xbd\xf7\x01n3n\xc7\xa3\xd8\xb8\x90\xf8\xb5\xd7\xb7\xe6S/\xef\x8a,\xd0\xed\r\xd1\x1e6F\xc9_\x8f\x9e\xd6\x87\x0f\x9cB\xb9P\xc4\xc2\x05\x8dhj\x0c\xa2\\)#\x9d1\x98\x9e\xa9\xa0P\xac\xc2\xb1=\xf0\xfb-\xd4\x05m\x84\x02\x1a\xa5R\x05#\xe3y\xa9Q\xc04DZt]\x98\xe8\xab\xdf\xfc\xc1\x86\xf7\x01\xdcI\x83\x15\x01\x04R\xa6\x90\xc9\xd4%\xaf\xff\xfa;\xa0\x13\xdfhZ\xd0\xe6\x04\xeb\x16\x98\xd4t\x86\x0e\xfd\xf4\xa4:z\xe8\x9f\xd0\x9a\xd1\xda\x12\x023A\x88\x00\x114\xd4\xfb0\xbb\xc9\x01\xc4 q\xb3\x8c\xa1q\x17\xb67\x8c\x9e5\x8by\xd5\xc6v\xb5p\xe9\x923\x91\xe0\x965\x1f\x08\xb8\x07\xa2om,q:~56s\xe3\xe7?\xb2}W6E\x17v\x88\xe5\x8d\xf2\xe8\xa5\xb4:\xb0\xf7,]\xf8\xc7\x08b]MplA\xa1PF8\xe4\xc1\xf4L\x19\xc94\x83t\x1d:\x16\xb7\xe0\xb1M\xed\xe8^\x1a2\\\xcdh+\xd0\xfftSt\xf9\xcb\xff\x13p{7\x08\xb8S\x8b\xc8\xf8\xe5\xe3[\xf2\x93\x07v\x86\xc3\xc9\xce\xe6\xaen\xf6\x84\xda\xe4\xd4kc\xfa\xc8/."\x9e\x98\x81\xd7o!\x9f\xad@\xd96b=\xf3\xf1\xe9\xc7\xda\xd0\xd5m\xc3\xaa\x95j\xf1+\xa3\xd6t\xb2\xf5\xc4\xba\xfe\xdd\xeb\xb4\x87\xe8C\x01\xee\xad\x05\x00\x11)\x93\xcf\xe6\xfcc\xe7\x0e>_\x9a8\xfc\xed\xb9\xb1\xa0\xbf\xe9\xa1\xe5&\x9d\x04\xbd\xf9\x87\x1959\xec"S\xcb\xe0\xa1G\xdb\xd0\xd5\xe9\xc2\xaa\xa487]\xe4\xe1\x8b\xe3\x9e\xab\x97s\xc5\xb5\xcf\xfcd\xfd\x03+V\x0e\x08\xb3\xfaH\x80\xf7\xabej\xf4Z\xe7\xe8\xc0\xae=\xb3\x02\xef<\xd9\xfe`\x07\xdb\x8d\xcd29\xdd\xa1\xb57\x07\xdbMq\xe2\x9d\xabr3\x91UC\x83q\xaa\xd0\xa23k\xb7}\xf7\xb9E\xcb\x96\x9f\x13aE\xa4\xf8c\x01n!\x84\x00\xd6D\xda\x18\x86\x8c\x9c\xfdm\xdf\xd4\x85}\xbb[Z3\xcds\xd7?\xcb\x89\xa1Q\x0c\x0f\x0c\xd0{\xef&\xa8(-C\xb1\xde\xaf}o\xd5\xc6\xbe\x97\x1c\xc7faV\xa4n\xfd?>6\xe0\x9e4\xee\xd6\x92\x99N6^xm\xe7\x0e\xe2s_N\xa5\xf2*1\xa9G\xda\x96\xf5\xed\xec}\xeaK\xfb\xeb\xc2\xa1\x92\x08k\x08\xe4\xce\xf0\xff\x0b\xe0.\x84\x8d&\xa5\x98\x85d\xf0\xcc\x9b\xbd\xe9\xd4d\xfb\x92U\xeb\x7f\x17\xaeo\xc8AD\xf1\xad\xc8]"\xba\xef\xde\xbf\x00E\x15c\xc0\xf90\xc3\xa2\x00\x00\x00\x00IEND\xaeB`\x82' (<class 'google.appengine.api.datastore_types.Blob'>)
Please guide me how to proceed further.
| 0 |
11,651,167 | 07/25/2012 13:44:40 | 1,176,316 | 01/29/2012 10:14:11 | 6 | 1 | Connection R to Cassandra using RCassandra | I have an instance of Cassandra running on my localhost. For this example I have used the default configuration provided in conf\cassandra.yaml
I tried to connect R to Cassandra using the RCassandra package.
Basically, i have just installed the RCassandra package in R and tried to connect.
library("RCassandra")
RC.connect('localhost','9160')
RC.connect('127.0.0.1','9160')
None of those are working. Here is the error I get:
Error in RC.connect("locahost", port = "9160") :
cannot connect to locahost:9160
Using Cassandra-cli with the same parameters work. Can you please help on that.
Thank you
| r | cassandra | null | null | null | null | open | Connection R to Cassandra using RCassandra
===
I have an instance of Cassandra running on my localhost. For this example I have used the default configuration provided in conf\cassandra.yaml
I tried to connect R to Cassandra using the RCassandra package.
Basically, i have just installed the RCassandra package in R and tried to connect.
library("RCassandra")
RC.connect('localhost','9160')
RC.connect('127.0.0.1','9160')
None of those are working. Here is the error I get:
Error in RC.connect("locahost", port = "9160") :
cannot connect to locahost:9160
Using Cassandra-cli with the same parameters work. Can you please help on that.
Thank you
| 0 |
11,651,170 | 07/25/2012 13:44:44 | 947,779 | 09/15/2011 21:45:49 | 38 | 2 | Using composer to install third party symfony bundle | Ok. Composer seems great.
But is more complex that deps method to add new bundles. I still don´t get it.
Please someone give me a complete example on how to add a third party bundle to a symfony2 2.1.0-BETA4 installation.
The bundle I want to add is this:
https://github.com/doctrine/data-fixtures/ | symfony | composer-php | null | null | null | null | open | Using composer to install third party symfony bundle
===
Ok. Composer seems great.
But is more complex that deps method to add new bundles. I still don´t get it.
Please someone give me a complete example on how to add a third party bundle to a symfony2 2.1.0-BETA4 installation.
The bundle I want to add is this:
https://github.com/doctrine/data-fixtures/ | 0 |
11,651,173 | 07/25/2012 13:45:08 | 1,514,369 | 07/10/2012 09:46:27 | 1 | 0 | how to prevent concatenation in javascript while using $_GET in ajax function | i am having a html <form> on my page having a textarea ......i want to send the textvalue entered by using ajax XMLHttp object......the text goes to other php page from where i insert it into sql..........but problem i am facing is that whenever i write '+' or '&' in textarea....the javascript assumes is as concatenations of url........
function getMessageResponse()
{
var xmlHttp;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("Your browser does not support AJAX!");
return false;
}
}
}
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
{
document.getElementById('response').innerHTML=xmlHttp.responseText;
document.myform.post.value = '';
retrieve();
}
}
var url="wall4.php";
url=url+"?post="+document.myform.post.value;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
| php | javascript | html | ajax | null | null | open | how to prevent concatenation in javascript while using $_GET in ajax function
===
i am having a html <form> on my page having a textarea ......i want to send the textvalue entered by using ajax XMLHttp object......the text goes to other php page from where i insert it into sql..........but problem i am facing is that whenever i write '+' or '&' in textarea....the javascript assumes is as concatenations of url........
function getMessageResponse()
{
var xmlHttp;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("Your browser does not support AJAX!");
return false;
}
}
}
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
{
document.getElementById('response').innerHTML=xmlHttp.responseText;
document.myform.post.value = '';
retrieve();
}
}
var url="wall4.php";
url=url+"?post="+document.myform.post.value;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
| 0 |
11,651,174 | 07/25/2012 13:45:13 | 1,249,664 | 03/05/2012 11:06:44 | 333 | 2 | What is the id=xxx next to variable entries in the Eclipse Debugger | What is the `id=xxx` next to variable entries in the Eclipse Debugger> I know it seems to uniquely identify the object. But what I can't tell is what it's relationship to the object is. | java | null | null | null | null | null | open | What is the id=xxx next to variable entries in the Eclipse Debugger
===
What is the `id=xxx` next to variable entries in the Eclipse Debugger> I know it seems to uniquely identify the object. But what I can't tell is what it's relationship to the object is. | 0 |
11,651,027 | 07/25/2012 13:37:45 | 1,480,190 | 06/25/2012 13:54:55 | 32 | 0 | Min Enclosing for a bounding rect? | I would like to compute the minumum enclosing circle of a bounding rectangle (a window) using opencv? | c++ | math | opencv | geometry | null | null | open | Min Enclosing for a bounding rect?
===
I would like to compute the minumum enclosing circle of a bounding rectangle (a window) using opencv? | 0 |
11,651,029 | 07/25/2012 13:37:47 | 545,138 | 12/16/2010 18:02:20 | 324 | 6 | How to connect to a mysql database located on a different system on a intranet using wamp | Can anyone tell how to connect to a mysql database located on a different system on a intranet using wamp!!! | mysql | wamp | dreamweaver | null | null | null | open | How to connect to a mysql database located on a different system on a intranet using wamp
===
Can anyone tell how to connect to a mysql database located on a different system on a intranet using wamp!!! | 0 |
11,651,058 | 07/25/2012 13:39:02 | 1,346,418 | 04/20/2012 11:30:54 | 183 | 1 | Implement SSL protocol with Spring MVC | my project implements a RESTful client which connects to a repository in order to retrieve and send data (XML). However,when a user provide personal information i want to use SSL encryption.
The user completes a form:
<table>
<tr>
<td>Complete your card number</td>
<td><form:input path="card_number" /></td>
</tr>
<tr>
<td>Complete your personal id</td>
<td><form:input path="personal_id" /></td>
</tr>
<table>
The Controller (restul client):
try {
ResponseEntity<MyClass> result = template.exchange(Url, HttpMethod.POST, entity, MyClass.class);
} catch (Exception e) {
System.out.println(e);
}
The MyClass is class where JAXB annotations are used in order to make an automatic bind.
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class MyClass{
@XmlElement
private String card_number;
@XmlElement
private String personal_id;
//get/set methods
}
So, according to this way i can send and retrieve XML to and from a repository respectively. But how can i add to this procces SSL encryption? Actually i want to do this only when a user tries to complete this form and nowhere else. Moreover, i know that Spring offers the Spring Security but i don't really understand the tutorials i follow on internet. Can anyone describes me what i have to do?
| spring | ssl | spring-security | null | null | null | open | Implement SSL protocol with Spring MVC
===
my project implements a RESTful client which connects to a repository in order to retrieve and send data (XML). However,when a user provide personal information i want to use SSL encryption.
The user completes a form:
<table>
<tr>
<td>Complete your card number</td>
<td><form:input path="card_number" /></td>
</tr>
<tr>
<td>Complete your personal id</td>
<td><form:input path="personal_id" /></td>
</tr>
<table>
The Controller (restul client):
try {
ResponseEntity<MyClass> result = template.exchange(Url, HttpMethod.POST, entity, MyClass.class);
} catch (Exception e) {
System.out.println(e);
}
The MyClass is class where JAXB annotations are used in order to make an automatic bind.
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class MyClass{
@XmlElement
private String card_number;
@XmlElement
private String personal_id;
//get/set methods
}
So, according to this way i can send and retrieve XML to and from a repository respectively. But how can i add to this procces SSL encryption? Actually i want to do this only when a user tries to complete this form and nowhere else. Moreover, i know that Spring offers the Spring Security but i don't really understand the tutorials i follow on internet. Can anyone describes me what i have to do?
| 0 |
11,651,059 | 07/25/2012 13:39:03 | 1,472,566 | 06/21/2012 15:17:16 | 1 | 0 | android speech recognition emotion detector | i would like to create an emotion speech recognition application in android which will detect the emotion of the users through getting the sound of their voice. is it possible to make this kind of app in android?if yes, can you give me links that will help me to make this possible. thanks! | android | speech-recognition | null | null | null | null | open | android speech recognition emotion detector
===
i would like to create an emotion speech recognition application in android which will detect the emotion of the users through getting the sound of their voice. is it possible to make this kind of app in android?if yes, can you give me links that will help me to make this possible. thanks! | 0 |
11,646,733 | 07/25/2012 09:31:08 | 644,420 | 03/04/2011 09:17:11 | 181 | 1 | closing connection in web sql | Is it required to close the web sql connection?. I am not able to access the DB second time when i run the same code.I am able to run and retrieve the data first time. Please share the code if it Closing connection in web sql is required.
| sql | web-sql | tizen | null | null | null | open | closing connection in web sql
===
Is it required to close the web sql connection?. I am not able to access the DB second time when i run the same code.I am able to run and retrieve the data first time. Please share the code if it Closing connection in web sql is required.
| 0 |
11,411,242 | 07/10/2012 10:20:16 | 828,757 | 07/04/2011 21:43:58 | 914 | 41 | Can someone please explain the right way to use SBT? | I'm getting out off the closet on this! I don't understand SBT. There, I said it, now help me please.
All roads lead to Rome, and that is the same for SBT: To get started with SBT there is SBT, SBT Launcher, SBT-extras, etc, and then there are different ways to include and decide on repositories. Is there a 'best' way?
I'm asking because sometimes I get a little lost. The SBT documentation is very thorough and complete, but I find myself not knowing when to use build.sbt or project/build.properties or project/Build.scala or project/plugins.sbt.
Then it becomes fun, there is the Scala-IDE and SBT - What is the correct way of using them together? What comes first, the chicken or the egg?
Most importantly is probably, how do you find the right repositories and versions to include in your project? Do I just pull out a machette and start hacking my way forward? I quite often find projects that include everything and the kitchen sink, and then I realize - I'm not the only one who gets a little lost.
As a simple example, right now, I'm starting a brand new project. I want to use the latest features of SLICK and Scala and this will probably require the latest version of SBT. What is the sane point to get started, and why? In what file should I define it and how should it look? I know I can get this working, but I would really like an expert opinion on where everything should go (why it should go there will be a bonus).
I've been using SBT for small projects for well over a year now. I used SBT and then SBT Extras (as it made some headaches magically disappear), but I'm not sure why I should be using the one or the other. I'm just getting a little frustrated for not understanding how things fit together (SBT and repositories), and think it will save the next guy coming this way a lot of hardship if this could be explained in human terms. | scala | sbt | null | null | null | null | open | Can someone please explain the right way to use SBT?
===
I'm getting out off the closet on this! I don't understand SBT. There, I said it, now help me please.
All roads lead to Rome, and that is the same for SBT: To get started with SBT there is SBT, SBT Launcher, SBT-extras, etc, and then there are different ways to include and decide on repositories. Is there a 'best' way?
I'm asking because sometimes I get a little lost. The SBT documentation is very thorough and complete, but I find myself not knowing when to use build.sbt or project/build.properties or project/Build.scala or project/plugins.sbt.
Then it becomes fun, there is the Scala-IDE and SBT - What is the correct way of using them together? What comes first, the chicken or the egg?
Most importantly is probably, how do you find the right repositories and versions to include in your project? Do I just pull out a machette and start hacking my way forward? I quite often find projects that include everything and the kitchen sink, and then I realize - I'm not the only one who gets a little lost.
As a simple example, right now, I'm starting a brand new project. I want to use the latest features of SLICK and Scala and this will probably require the latest version of SBT. What is the sane point to get started, and why? In what file should I define it and how should it look? I know I can get this working, but I would really like an expert opinion on where everything should go (why it should go there will be a bonus).
I've been using SBT for small projects for well over a year now. I used SBT and then SBT Extras (as it made some headaches magically disappear), but I'm not sure why I should be using the one or the other. I'm just getting a little frustrated for not understanding how things fit together (SBT and repositories), and think it will save the next guy coming this way a lot of hardship if this could be explained in human terms. | 0 |
11,411,246 | 07/10/2012 10:20:29 | 370,286 | 06/18/2010 12:35:50 | 9,167 | 104 | Google Maps API V3 - Prevent ImageMapType from wrapping | **Please note:**
This question is very similar to this one I found on stackoverflow.
http://stackoverflow.com/questions/10898279/google-maps-v3-imagemaptype-prevent-wrapping
However, the above question and answer did not work for my example / issue as I need to be able to view all of my image at any zoom level and more importantly i need the drawing tools to work correctly.
----------
**My Scenario:**
I have a custom google map using `ImageMapType`, it also has the `DrawingManager` library and tools.
**My issue:**
At first glance all works nicely, however if you are to draw any markers or polygons and then pan the map the markers / polygons repeat or move across the area of map in view.
The same issue occurs when drawing large polygons on the map, as you are drawing the polygon, you will notice the line you are drawing will suddenly snap to the wrong side of your polygon.
**My question:**
How do I go about preventing the wrapping issues so that all of the markers do not move, or duplicate, and so that the drawing tools work without snapping to the other side of your polygon?
----------
**Online example:**
http://jsbin.com/ecujug/5/edit#javascript,live
**Video of the issues:**
https://dl.dropbox.com/u/14037764/Development/stackoverflow/map-drawing/issue.html | google-maps | google-maps-api-3 | imagemap | google-maps-drawing-tools | null | null | open | Google Maps API V3 - Prevent ImageMapType from wrapping
===
**Please note:**
This question is very similar to this one I found on stackoverflow.
http://stackoverflow.com/questions/10898279/google-maps-v3-imagemaptype-prevent-wrapping
However, the above question and answer did not work for my example / issue as I need to be able to view all of my image at any zoom level and more importantly i need the drawing tools to work correctly.
----------
**My Scenario:**
I have a custom google map using `ImageMapType`, it also has the `DrawingManager` library and tools.
**My issue:**
At first glance all works nicely, however if you are to draw any markers or polygons and then pan the map the markers / polygons repeat or move across the area of map in view.
The same issue occurs when drawing large polygons on the map, as you are drawing the polygon, you will notice the line you are drawing will suddenly snap to the wrong side of your polygon.
**My question:**
How do I go about preventing the wrapping issues so that all of the markers do not move, or duplicate, and so that the drawing tools work without snapping to the other side of your polygon?
----------
**Online example:**
http://jsbin.com/ecujug/5/edit#javascript,live
**Video of the issues:**
https://dl.dropbox.com/u/14037764/Development/stackoverflow/map-drawing/issue.html | 0 |
11,411,172 | 07/10/2012 10:16:59 | 1,351,939 | 04/23/2012 17:40:45 | 13 | 1 | Phone freezes when listening for incong sms's | Why does the following code freeze all operations on the phone? The app reads the incoming sms's, but the app doesn't open. Right after the app is clicked, the phone freezes. What am I doing wrong. I would appreciate any help.
try {
DatagramConnection _dc =
(DatagramConnection)Connector.open("sms://"); //A DatagramConnection is created to listen for any incoming sms's.
Datagram d = _dc.newDatagram(_dc.getMaximumLength());
_dc.receive(d);
byte[] bytes = d.getData();
String address = d.getAddress(); //The address of the sms is put on a string.
String msg = new String(bytes); //The body of the sms is put on a string.
}catch (Exception me) {
} | blackberry | sms | null | null | null | null | open | Phone freezes when listening for incong sms's
===
Why does the following code freeze all operations on the phone? The app reads the incoming sms's, but the app doesn't open. Right after the app is clicked, the phone freezes. What am I doing wrong. I would appreciate any help.
try {
DatagramConnection _dc =
(DatagramConnection)Connector.open("sms://"); //A DatagramConnection is created to listen for any incoming sms's.
Datagram d = _dc.newDatagram(_dc.getMaximumLength());
_dc.receive(d);
byte[] bytes = d.getData();
String address = d.getAddress(); //The address of the sms is put on a string.
String msg = new String(bytes); //The body of the sms is put on a string.
}catch (Exception me) {
} | 0 |
11,411,247 | 07/10/2012 10:20:42 | 584,140 | 01/21/2011 07:55:36 | 62 | 5 | Android NdefFormattable tag write error | 07-10 15:27:48.158: W/System.err(1300): java.io.IOException
07-10 15:27:48.158: W/System.err(1300): at android.nfc.tech.BasicTagTechnology.connect(BasicTagTechnology.java:85)
07-10 15:27:48.158: W/System.err(1300): at android.nfc.tech.NdefFormatable.connect(NdefFormatable.java:47)
The above error is what i get when i try writing an NdefFormattable fresh empty tag using
NdefFormatable nf = NdefFormatable.get(localTag);
nf.connect();
nf.format(nm);
where nm is a correctly formatted `NdefMessage`.
I have no idea why this error is coming. This is android api-15.
Also, i know IO has got to do with the actual writing process. But the tag i'm trying to write is in the same place as when it is read! | android | nfc | null | null | null | null | open | Android NdefFormattable tag write error
===
07-10 15:27:48.158: W/System.err(1300): java.io.IOException
07-10 15:27:48.158: W/System.err(1300): at android.nfc.tech.BasicTagTechnology.connect(BasicTagTechnology.java:85)
07-10 15:27:48.158: W/System.err(1300): at android.nfc.tech.NdefFormatable.connect(NdefFormatable.java:47)
The above error is what i get when i try writing an NdefFormattable fresh empty tag using
NdefFormatable nf = NdefFormatable.get(localTag);
nf.connect();
nf.format(nm);
where nm is a correctly formatted `NdefMessage`.
I have no idea why this error is coming. This is android api-15.
Also, i know IO has got to do with the actual writing process. But the tag i'm trying to write is in the same place as when it is read! | 0 |
11,411,249 | 07/10/2012 10:20:50 | 85,606 | 04/01/2009 10:59:21 | 2,630 | 57 | Greek character are not displayed in winform combobox | I am working on a winform application, where I have grid with column displaying certain length measurement units. I have defined a column as below.
var unitColumn = new DataGridViewComboBoxColumn
{
Name = "UnitColumn",
HeaderText = "UnitColumnHeader",
Width = 80,
DataSource = new[] { "nm", "mm", "μm" },
};
_calibGrid.Columns.Add(unitColumn);
As you can see the second item in the combobox suppose to display `μm`, but it displays the ` m`. After I choose the item text in the cell displayed correctly.
I am quite new to winform development, can any one suggest the fix/solution?
![enter image description here][1]
[1]: http://i.stack.imgur.com/blZ6S.png | winforms | unicode | datagrid | .net-2.0 | null | null | open | Greek character are not displayed in winform combobox
===
I am working on a winform application, where I have grid with column displaying certain length measurement units. I have defined a column as below.
var unitColumn = new DataGridViewComboBoxColumn
{
Name = "UnitColumn",
HeaderText = "UnitColumnHeader",
Width = 80,
DataSource = new[] { "nm", "mm", "μm" },
};
_calibGrid.Columns.Add(unitColumn);
As you can see the second item in the combobox suppose to display `μm`, but it displays the ` m`. After I choose the item text in the cell displayed correctly.
I am quite new to winform development, can any one suggest the fix/solution?
![enter image description here][1]
[1]: http://i.stack.imgur.com/blZ6S.png | 0 |
11,411,250 | 07/10/2012 10:20:54 | 1,310,223 | 04/03/2012 10:54:14 | 30 | 3 | For tab panel iconCls is not working on Android | I have created tab panel and I have used iconCls property to show different icons on tab buttons. This works fine on chrome browser on desktop and on safari on iPad. But these icon images are not displaying on andorid tab, instead it displays blank square. | sencha-touch-2 | null | null | null | null | null | open | For tab panel iconCls is not working on Android
===
I have created tab panel and I have used iconCls property to show different icons on tab buttons. This works fine on chrome browser on desktop and on safari on iPad. But these icon images are not displaying on andorid tab, instead it displays blank square. | 0 |
11,411,251 | 07/10/2012 10:20:54 | 80,111 | 03/19/2009 16:26:14 | 6,347 | 266 | Relocate error labels using jQuery validation | So I'm using [jQuery validation][1] and have managed (despite some out of date documentation) to get a group of required radio boxes working. The problem is the plugin is appending the error label directly after the first radio (the first of that group that has the required class).
With this in mind is it possible to set a custom location for each error label?
For reference this is the HTML:
<tr>
<td width="200">
<label>Title2 *</label>
</td>
<td width="505">
>>> <label><input type="radio" class="required" name="Title2" value="Mr" /> <!-- ERROR APPEARS HERE -->Mr</label>
<label><input type="radio" class="required" name="Title2" value="Miss" />Miss</label>
<label><input type="radio" class="required" name="Title2" value="Mrs" />Mrs</label>
<label><input type="radio" class="required" name="Title2" value="Ms" />Ms</label>
<!-- I WANT ERROR LABEL HERE -->
</td>
</tr>
Scroll across on the line marked `>>>` and you'll see the comment that shows there the plugin is putting the error label, just before the closing `</td>` you'll see where I want the label to go.
Any help appreciated,
Thanks.
[1]: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ | jquery | validation | jquery-validation-plugin | jquery-validation | null | null | open | Relocate error labels using jQuery validation
===
So I'm using [jQuery validation][1] and have managed (despite some out of date documentation) to get a group of required radio boxes working. The problem is the plugin is appending the error label directly after the first radio (the first of that group that has the required class).
With this in mind is it possible to set a custom location for each error label?
For reference this is the HTML:
<tr>
<td width="200">
<label>Title2 *</label>
</td>
<td width="505">
>>> <label><input type="radio" class="required" name="Title2" value="Mr" /> <!-- ERROR APPEARS HERE -->Mr</label>
<label><input type="radio" class="required" name="Title2" value="Miss" />Miss</label>
<label><input type="radio" class="required" name="Title2" value="Mrs" />Mrs</label>
<label><input type="radio" class="required" name="Title2" value="Ms" />Ms</label>
<!-- I WANT ERROR LABEL HERE -->
</td>
</tr>
Scroll across on the line marked `>>>` and you'll see the comment that shows there the plugin is putting the error label, just before the closing `</td>` you'll see where I want the label to go.
Any help appreciated,
Thanks.
[1]: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ | 0 |
11,411,252 | 07/10/2012 10:20:55 | 1,089,989 | 12/09/2011 15:24:00 | 11 | 0 | Export xml data to Excel using OpenXML | I had tried doing as u sujested to my previous post, it downloading an xlsx file for me. but when i tried to open the file it is saying file is corrupted. here is the code i'm trying to use please let me know if any changes has to be done for the following.
private void button1_Click(object sender, EventArgs e)
{
ArrayList DataNode = new ArrayList();
XmlDocument xmlobj = new XmlDocument();
ArrayList FinalXML = new ArrayList();
XslCompiledTransform xXslt = new XslCompiledTransform();
xmlobj.Load(@"D:\ExcelImport\Input.xml");
xXslt.Load(@"D:\ExcelImport\demoxsl.xslt");
XmlNodeList DN ;
DN = xmlobj.DocumentElement.GetElementsByTagName("Data");
for (int i = 0; i < DN.Count; i++)
{
DataNode.Add("<ShaleDataExport><Data Flag = '" + i + "' >" + DN.Item(i).InnerXml + "</Data></ShaleDataExport>");
}
string ShaleDataExportXML;
int k = 0 ;
while (k < DN.Count)
{
ShaleDataExportXML = DataNode[k].ToString();
XmlDocument xml = new XmlDocument();
xml.LoadXml(ShaleDataExportXML);
StringWriter sw = new StringWriter();
xXslt.Transform(xml, null, sw);
FinalXML.Add(sw);
sw.Close();
k++;
}
using (SpreadsheetDocument doc = SpreadsheetDocument.Create(@"D:\ExcelImport\OutPut\OutPut.xlsx", DocumentFormat.OpenXml.SpreadsheetDocumentType.Workbook))
{
WorkbookPart workbook = doc.AddWorkbookPart();
string XML;
string WorbookXML;
WorbookXML = @"<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes""?><workbook xmlns=""schemas.openxmlformats.org/.../main"" xmlns:r=""schemas.openxmlformats.org/.../relationships""><sheets>";
for (int j = 0; j < DN.Count; j++)
{
WorksheetPart[] sheet = new WorksheetPart[DN.Count];
sheet[j] = workbook.AddNewPart<WorksheetPart>();
string sheetId = workbook.GetIdOfPart(sheet[j]);
XML = @"<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes""?><worksheet xmlns=""schemas.openxmlformats.org/.../main"" >";
XML += FinalXML[j].ToString() + "</worksheet>";
string SheetXML = XML.ToString();
XmlDocument SXML = new XmlDocument();
SXML.LoadXml(SheetXML);
byte[] byteArray = Encoding.ASCII.GetBytes(SXML.OuterXml);
MemoryStream stream = new MemoryStream(byteArray);
StreamReader reader = new StreamReader(stream);
string text = reader.ReadToEnd();
WorbookXML += "<sheet name="+ AddPartXml(sheet[j], text) + " sheetId=" + j.ToString() + " r:id=" + sheetId.ToString() + " />";
}
WorbookXML += "</sheets></workbook>";
AddPartXml(workbook, WorbookXML);
doc.Close();
}
}
public string AddPartXml(OpenXmlPart part, string xml)
{
Uri uri = part.Uri;
String[] sheetNames = uri.OriginalString.Split('/');
string sheetName = sheetNames[sheetNames.Length - 1].Split('.')[0];
using (Stream stream = part.GetStream())
{
byte[] buffer = (new UTF8Encoding()).GetBytes(xml);
stream.Write(buffer, 0, buffer.Length);
}
return sheetName;
}
Thanks in advance
Vineet Mangal | excel | openxml | export-to-excel | xmldatasource | null | null | open | Export xml data to Excel using OpenXML
===
I had tried doing as u sujested to my previous post, it downloading an xlsx file for me. but when i tried to open the file it is saying file is corrupted. here is the code i'm trying to use please let me know if any changes has to be done for the following.
private void button1_Click(object sender, EventArgs e)
{
ArrayList DataNode = new ArrayList();
XmlDocument xmlobj = new XmlDocument();
ArrayList FinalXML = new ArrayList();
XslCompiledTransform xXslt = new XslCompiledTransform();
xmlobj.Load(@"D:\ExcelImport\Input.xml");
xXslt.Load(@"D:\ExcelImport\demoxsl.xslt");
XmlNodeList DN ;
DN = xmlobj.DocumentElement.GetElementsByTagName("Data");
for (int i = 0; i < DN.Count; i++)
{
DataNode.Add("<ShaleDataExport><Data Flag = '" + i + "' >" + DN.Item(i).InnerXml + "</Data></ShaleDataExport>");
}
string ShaleDataExportXML;
int k = 0 ;
while (k < DN.Count)
{
ShaleDataExportXML = DataNode[k].ToString();
XmlDocument xml = new XmlDocument();
xml.LoadXml(ShaleDataExportXML);
StringWriter sw = new StringWriter();
xXslt.Transform(xml, null, sw);
FinalXML.Add(sw);
sw.Close();
k++;
}
using (SpreadsheetDocument doc = SpreadsheetDocument.Create(@"D:\ExcelImport\OutPut\OutPut.xlsx", DocumentFormat.OpenXml.SpreadsheetDocumentType.Workbook))
{
WorkbookPart workbook = doc.AddWorkbookPart();
string XML;
string WorbookXML;
WorbookXML = @"<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes""?><workbook xmlns=""schemas.openxmlformats.org/.../main"" xmlns:r=""schemas.openxmlformats.org/.../relationships""><sheets>";
for (int j = 0; j < DN.Count; j++)
{
WorksheetPart[] sheet = new WorksheetPart[DN.Count];
sheet[j] = workbook.AddNewPart<WorksheetPart>();
string sheetId = workbook.GetIdOfPart(sheet[j]);
XML = @"<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes""?><worksheet xmlns=""schemas.openxmlformats.org/.../main"" >";
XML += FinalXML[j].ToString() + "</worksheet>";
string SheetXML = XML.ToString();
XmlDocument SXML = new XmlDocument();
SXML.LoadXml(SheetXML);
byte[] byteArray = Encoding.ASCII.GetBytes(SXML.OuterXml);
MemoryStream stream = new MemoryStream(byteArray);
StreamReader reader = new StreamReader(stream);
string text = reader.ReadToEnd();
WorbookXML += "<sheet name="+ AddPartXml(sheet[j], text) + " sheetId=" + j.ToString() + " r:id=" + sheetId.ToString() + " />";
}
WorbookXML += "</sheets></workbook>";
AddPartXml(workbook, WorbookXML);
doc.Close();
}
}
public string AddPartXml(OpenXmlPart part, string xml)
{
Uri uri = part.Uri;
String[] sheetNames = uri.OriginalString.Split('/');
string sheetName = sheetNames[sheetNames.Length - 1].Split('.')[0];
using (Stream stream = part.GetStream())
{
byte[] buffer = (new UTF8Encoding()).GetBytes(xml);
stream.Write(buffer, 0, buffer.Length);
}
return sheetName;
}
Thanks in advance
Vineet Mangal | 0 |
11,351,094 | 07/05/2012 19:19:42 | 1,005,656 | 10/20/2011 16:37:40 | 45 | 0 | looping through an object twice - php | I'm playing around with a zencart trying to make it do what I want but I'm a bit of a noob and I've run out of ideas of what to google.
when I query the DB using the zencart function the software returns an object which looks like:
queryFactoryResult Object
(
[is_cached] =>
[resource] => Resource id #117
[cursor] => 11
[EOF] =>
[fields] => Array
(
[products_id] => 5582
[products_description] => description here
[products_name] => Lucky magnet – Each petal...
[products_type] => 1
[products_quantity] => 0
[products_image] => EachPetalMag.jpg
[products_price] => 3.4000
[products_status] => 1
[products_ordered] => 14
[master_categories_id] => 21
[supplier_id] => 7
)
)
I have to loop through once to count how many master_categories are there before I can do anything else:
while (!$products->EOF) {
$products_count++;
$supcats[$products->fields['master_categories_id']] = $products->fields['master_categories_id'];
$products->MoveNext();
}
I then need to loop through the object again using the while loop like above, I've tried:
reset($products);
and
$products->EOF = FALSE;
but they don't work. Is there a way to do this with out having to send the query again?
thanks :)
Sarah | php | zen-cart | null | null | null | null | open | looping through an object twice - php
===
I'm playing around with a zencart trying to make it do what I want but I'm a bit of a noob and I've run out of ideas of what to google.
when I query the DB using the zencart function the software returns an object which looks like:
queryFactoryResult Object
(
[is_cached] =>
[resource] => Resource id #117
[cursor] => 11
[EOF] =>
[fields] => Array
(
[products_id] => 5582
[products_description] => description here
[products_name] => Lucky magnet – Each petal...
[products_type] => 1
[products_quantity] => 0
[products_image] => EachPetalMag.jpg
[products_price] => 3.4000
[products_status] => 1
[products_ordered] => 14
[master_categories_id] => 21
[supplier_id] => 7
)
)
I have to loop through once to count how many master_categories are there before I can do anything else:
while (!$products->EOF) {
$products_count++;
$supcats[$products->fields['master_categories_id']] = $products->fields['master_categories_id'];
$products->MoveNext();
}
I then need to loop through the object again using the while loop like above, I've tried:
reset($products);
and
$products->EOF = FALSE;
but they don't work. Is there a way to do this with out having to send the query again?
thanks :)
Sarah | 0 |
11,351,099 | 07/05/2012 19:19:57 | 1,280,092 | 03/20/2012 05:31:54 | 1 | 0 | Where is the DataContext? | I have been reviewing the MSDN article, shown at http://msdn.microsoft.com/en-us/magazine/dd419663.aspx.
The above article shows how he is using a DataTemplate to display CustomerViewModel; But looking at the actual CustomerView, there is no DataContext set! How is he calling the Save command, when there isn't any DataContext, or ViewModel wired into the View? | c# | wpf | xaml | mvvm | null | null | open | Where is the DataContext?
===
I have been reviewing the MSDN article, shown at http://msdn.microsoft.com/en-us/magazine/dd419663.aspx.
The above article shows how he is using a DataTemplate to display CustomerViewModel; But looking at the actual CustomerView, there is no DataContext set! How is he calling the Save command, when there isn't any DataContext, or ViewModel wired into the View? | 0 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.