PostId int64 13 11.8M | PostCreationDate stringlengths 19 19 | OwnerUserId int64 3 1.57M | OwnerCreationDate stringlengths 10 19 | ReputationAtPostCreation int64 -33 210k | OwnerUndeletedAnswerCountAtPostTime int64 0 5.77k | Title stringlengths 10 250 | BodyMarkdown stringlengths 12 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 47 30.1k | OpenStatus_id int64 0 4 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11,281,530 | 07/01/2012 11:22:44 | 949,336 | 09/16/2011 17:36:31 | 84 | 0 | Sending files through ssh | I need to send files to a server using ssh. I have never used ssh so this is being really frustrating to me. Mention the client (me) is using windows and the server is using Ubuntu.
I connected to the server using ssh2 ip, and then loging with an account I have. Now, I would like to send my files to a folder in the server, so, I moved to the folder and I used this command:
ssh2 test.txt user_name@host_direction server_folder_destination
And it always return that it can't do 'stat' over test.txt, the file doesn't exist, and so.
I'm assuming ssh2 can't see the file in my computer root (C:\), so I tried to specifie more and added: C:\test.txt, but apear the same error. I don't know what is happening.
Any hints please? Thanks | ubuntu | ssh | copy | null | null | 07/02/2012 06:32:42 | off topic | Sending files through ssh
===
I need to send files to a server using ssh. I have never used ssh so this is being really frustrating to me. Mention the client (me) is using windows and the server is using Ubuntu.
I connected to the server using ssh2 ip, and then loging with an account I have. Now, I would like to send my files to a folder in the server, so, I moved to the folder and I used this command:
ssh2 test.txt user_name@host_direction server_folder_destination
And it always return that it can't do 'stat' over test.txt, the file doesn't exist, and so.
I'm assuming ssh2 can't see the file in my computer root (C:\), so I tried to specifie more and added: C:\test.txt, but apear the same error. I don't know what is happening.
Any hints please? Thanks | 2 |
11,164,035 | 06/22/2012 20:58:51 | 1,475,863 | 06/22/2012 20:22:35 | 6 | 0 | Contacting an API with PHP | Are there any good functions to use with contacting an API which requires an authentication key in plain text? The PHP needs to be able to send information to verify on the API side, as well as the API address, and key. Then the API will analyze it and produce an XML result. Any good functions for interpreting XML with PHP and putting it into variables which can then be written into a SQL database? | php | mysql | sql | xml | null | 06/23/2012 03:10:00 | not a real question | Contacting an API with PHP
===
Are there any good functions to use with contacting an API which requires an authentication key in plain text? The PHP needs to be able to send information to verify on the API side, as well as the API address, and key. Then the API will analyze it and produce an XML result. Any good functions for interpreting XML with PHP and putting it into variables which can then be written into a SQL database? | 1 |
6,732,822 | 07/18/2011 12:25:52 | 849,984 | 07/18/2011 12:11:23 | 1 | 0 | Dynalically created Canvas in HTML5 created rectangle to it now wanted to add hand cursor only to rectangle | $(newCanvas).mouseover( function(e) { ux= x1;// where user click uy = y1; if( ux >=arrObjectDetail[i].pox && ux <= (arrObjectDetail[i].pox + arrObjectDetail[i].width)&& uy >= arrObjectDetail[i].poy && uy <= (arrObjectDetail[i].poy +arrObjectDetail[i].height) ) { $(newCanvas).css('cursor', 'pointer'); } else { $(newCanvas).css('cursor', 'default'); } );
On mouseover event I wanted to display hand cursor to only rectangle not entire canvas using JQUERY and HTML5.
------------------------------------------------------------------------ | jquery | html5 | null | null | null | null | open | Dynalically created Canvas in HTML5 created rectangle to it now wanted to add hand cursor only to rectangle
===
$(newCanvas).mouseover( function(e) { ux= x1;// where user click uy = y1; if( ux >=arrObjectDetail[i].pox && ux <= (arrObjectDetail[i].pox + arrObjectDetail[i].width)&& uy >= arrObjectDetail[i].poy && uy <= (arrObjectDetail[i].poy +arrObjectDetail[i].height) ) { $(newCanvas).css('cursor', 'pointer'); } else { $(newCanvas).css('cursor', 'default'); } );
On mouseover event I wanted to display hand cursor to only rectangle not entire canvas using JQUERY and HTML5.
------------------------------------------------------------------------ | 0 |
9,761,847 | 03/18/2012 20:10:57 | 499,825 | 11/07/2010 12:34:57 | 679 | 14 | Where can I find a list of timezоnes? | I use timeZoneWithName, but I don't know names of timezones. Where can I find a list of timezоnes?
[NSTimeZone timeZoneWithName:@"US/Eastern"]; | ios | nstimezone | null | null | null | 03/19/2012 02:20:40 | off topic | Where can I find a list of timezоnes?
===
I use timeZoneWithName, but I don't know names of timezones. Where can I find a list of timezоnes?
[NSTimeZone timeZoneWithName:@"US/Eastern"]; | 2 |
11,639,213 | 07/24/2012 20:59:49 | 1,118,475 | 12/28/2011 00:15:53 | 1,028 | 64 | ContentProvider, Loader and ProgressBar | I'm curious if there's a standard way to do it.
I have a `ContentProvider` which fetches data from sqlite database and loads it via `Loader`. It's updated by a `Service` which runs an `AsyncTask` to download data from server and update it in the `ContentProvider`. I hope it's clear but to be sure:
- `ListFragment` takes data from `ContentProvider` via `Loader`,
- `ContentProvider` gets updated with a `Service`.
Now, when my local sqlite database is empty the first time I launch the app, it shows that it has no events, even though they're being currently downloaded via `Service`. I would rather have a `ProgressBar` shown at this moment (the infinite spinning wheel, not a bar). But if I show a `ProgressBar` when there are no results from database, it would be there even after fetching data from sever in this specific case when there are no records in the external database (and it occurs quite often in my case). So:
- When the data is downloaded for the first time by the `Service` **I
would like to show a ProgressBar** until `ContentProvider` gives
non-empty result **OR** the `Service` finished it's job.
- When `ContentProvider` returned nothing **AND** `Service` finished
it's job (and fetched empty result) **I would like the app to show
"no results found".**
**My problem is probably:** how to notify the `ListFragment` that the `Service` is still running or that it finished ts job. I mean - I shouldn't store any reference to the calling `Fragment` inside the `Service`. It goes against the idea of `ContentProviders`, doesn't it? So how?
Note: I don't really know which fragment of code would be helpful here, so if you feel that you need to see some specific frag, just tell me in comments. Thanks! | android | android-contentprovider | android-progressbar | android-loader | null | null | open | ContentProvider, Loader and ProgressBar
===
I'm curious if there's a standard way to do it.
I have a `ContentProvider` which fetches data from sqlite database and loads it via `Loader`. It's updated by a `Service` which runs an `AsyncTask` to download data from server and update it in the `ContentProvider`. I hope it's clear but to be sure:
- `ListFragment` takes data from `ContentProvider` via `Loader`,
- `ContentProvider` gets updated with a `Service`.
Now, when my local sqlite database is empty the first time I launch the app, it shows that it has no events, even though they're being currently downloaded via `Service`. I would rather have a `ProgressBar` shown at this moment (the infinite spinning wheel, not a bar). But if I show a `ProgressBar` when there are no results from database, it would be there even after fetching data from sever in this specific case when there are no records in the external database (and it occurs quite often in my case). So:
- When the data is downloaded for the first time by the `Service` **I
would like to show a ProgressBar** until `ContentProvider` gives
non-empty result **OR** the `Service` finished it's job.
- When `ContentProvider` returned nothing **AND** `Service` finished
it's job (and fetched empty result) **I would like the app to show
"no results found".**
**My problem is probably:** how to notify the `ListFragment` that the `Service` is still running or that it finished ts job. I mean - I shouldn't store any reference to the calling `Fragment` inside the `Service`. It goes against the idea of `ContentProviders`, doesn't it? So how?
Note: I don't really know which fragment of code would be helpful here, so if you feel that you need to see some specific frag, just tell me in comments. Thanks! | 0 |
10,921,437 | 06/06/2012 20:09:13 | 409,020 | 08/02/2010 20:23:58 | 504 | 2 | I want to issue payments of $10-1000 to 10,000 people - what are my options? | Apologies if this is the wrong *overflow for this question.
Problem: I have a large website with many many users. Some of them produce creative works of great value. I would like to send each of them money. I want to do this in the most streamlined way possible from a legal/accounting standpoint. I.e. If I wanted to send $100/month to 10,000 different people, what compensation platform would you use?
I believe that once I'm sending more than $600 to one specific person, all sorts of nasty tax implications crop up (you have to send them an IRS form). Is there a service that would steamline this process for me?
I'm researching all sorts of outside-the-box solutions. There's PayPal. There's Amazon gift cards (issuable in arbitrary amount via an API?) There's Bitcoins. Maybe I could buy a giant block of Listia points. Maybe each end-user sets up an AdSense account and we run their tags for a set number of impressions. | paypal | credit-card | money | null | null | 06/07/2012 01:25:29 | off topic | I want to issue payments of $10-1000 to 10,000 people - what are my options?
===
Apologies if this is the wrong *overflow for this question.
Problem: I have a large website with many many users. Some of them produce creative works of great value. I would like to send each of them money. I want to do this in the most streamlined way possible from a legal/accounting standpoint. I.e. If I wanted to send $100/month to 10,000 different people, what compensation platform would you use?
I believe that once I'm sending more than $600 to one specific person, all sorts of nasty tax implications crop up (you have to send them an IRS form). Is there a service that would steamline this process for me?
I'm researching all sorts of outside-the-box solutions. There's PayPal. There's Amazon gift cards (issuable in arbitrary amount via an API?) There's Bitcoins. Maybe I could buy a giant block of Listia points. Maybe each end-user sets up an AdSense account and we run their tags for a set number of impressions. | 2 |
11,221,443 | 06/27/2012 07:36:22 | 633,961 | 02/25/2011 10:36:23 | 1,303 | 102 | Nightly unittest of django application | I want to run an nightly unittest of my django application. This should be done:
1. Update repositories (svn and git) to HEAD (at least my code. Django is from the stable branch)
1. run unittest
1. Report errors by email to people who committed since last successful unittest (but only to people in our company)
1. Create a HTML page with reports (last successful run, .....)
Up to now this is done by a small self made python script. But I like to use an established solution. | python | django | unit-testing | null | null | null | open | Nightly unittest of django application
===
I want to run an nightly unittest of my django application. This should be done:
1. Update repositories (svn and git) to HEAD (at least my code. Django is from the stable branch)
1. run unittest
1. Report errors by email to people who committed since last successful unittest (but only to people in our company)
1. Create a HTML page with reports (last successful run, .....)
Up to now this is done by a small self made python script. But I like to use an established solution. | 0 |
11,605,709 | 07/23/2012 02:20:28 | 280,868 | 02/25/2010 03:03:00 | 41 | 0 | Combine database partitions from separate disk drives | I have SQL server Database partitions divided over two drives D: & E:
We are now moving the DB and the application for a new server and since there's more space on each individual disk drive, need to amalgamate the partitions onto 1 drive.
how can I achieve this? | sql | sql-server | null | null | null | 07/24/2012 20:21:46 | off topic | Combine database partitions from separate disk drives
===
I have SQL server Database partitions divided over two drives D: & E:
We are now moving the DB and the application for a new server and since there's more space on each individual disk drive, need to amalgamate the partitions onto 1 drive.
how can I achieve this? | 2 |
4,266,391 | 11/24/2010 11:49:10 | 424,611 | 08/18/2010 22:39:28 | 91 | 6 | Webservices Help | I have to consume webservice. I have list of methods. How do I use them? I am consuming methods written by some one.
I have added the service using add web refernce. I can create refernce variable of the webservice class and able to see all the methods and properties.
While trying to use them in the application, No connection could be made because the target machine actively refused it 127.0.0.1:xxxx.
I think the service is not running..
Do I need to do anything else on the server to keep it running.
I can browse service in IIS and can see WSDL. But I am not sure wheather the service is running or not?
I am struck on this from two days?
Do I use SVc.util to keep the server up and running? I do not know anything about svc.util..
Many Thanks
Hari Gillala
| web-services | null | null | null | null | null | open | Webservices Help
===
I have to consume webservice. I have list of methods. How do I use them? I am consuming methods written by some one.
I have added the service using add web refernce. I can create refernce variable of the webservice class and able to see all the methods and properties.
While trying to use them in the application, No connection could be made because the target machine actively refused it 127.0.0.1:xxxx.
I think the service is not running..
Do I need to do anything else on the server to keep it running.
I can browse service in IIS and can see WSDL. But I am not sure wheather the service is running or not?
I am struck on this from two days?
Do I use SVc.util to keep the server up and running? I do not know anything about svc.util..
Many Thanks
Hari Gillala
| 0 |
9,793,303 | 03/20/2012 19:06:59 | 320,681 | 04/19/2010 19:14:43 | 866 | 25 | Rails referral / affiliate marketing gems? | I am working on implementing an affiliate marketing / reward system into an app and am at a slight impasse as to what may be a superior approach to take. I've decided to not go with solutions such as Zferral as they are simply too expensive for the pricing model.
I've seen [rack-affiliates][1] which seems to be a decent minimalistic solution. As well as perhaps a couple of others.
Ultimately I plan on making payouts via PayPal at this point as it seems most simple and clean.
**I was hoping for input as to what solutions have worked best for you in a non third party context?** Ie, rolling your own affiliate system either through a gem or from scratch.
[1]: https://github.com/alexlevin/rack-affiliates | ruby-on-rails | ruby | ruby-on-rails-3 | paypal | affiliate | 03/23/2012 15:46:15 | not constructive | Rails referral / affiliate marketing gems?
===
I am working on implementing an affiliate marketing / reward system into an app and am at a slight impasse as to what may be a superior approach to take. I've decided to not go with solutions such as Zferral as they are simply too expensive for the pricing model.
I've seen [rack-affiliates][1] which seems to be a decent minimalistic solution. As well as perhaps a couple of others.
Ultimately I plan on making payouts via PayPal at this point as it seems most simple and clean.
**I was hoping for input as to what solutions have worked best for you in a non third party context?** Ie, rolling your own affiliate system either through a gem or from scratch.
[1]: https://github.com/alexlevin/rack-affiliates | 4 |
1,719,909 | 11/12/2009 04:36:46 | 209,067 | 11/11/2009 21:42:47 | 1 | 1 | Joining Multiple Images into one with a PHP script | I have this test page [http://thechozenfew.net/projects/write_font.php][1] that generates the text in the input box as a font. Each letter is a different picture, How would i join all these pictures into one image with a php script?
This what i've tried so far but the images appear on top of each other.
Header ("Content-type: image/gif");
$image1Url = "../images/avatar.png";
$image2Url = "../images/key.png";
$image3Url = "../images/safari.png";
$image1 = imageCreateFromPNG($image1Url);
$image2 = imageCreateFromPNG($image2Url);
$image3 = imageCreateFromPNG($image3Url);
$colorTransparent = imagecolorat($image1, 0, 0);
imageColorTransparent ($image1, $colorTransparent);
$colorTransparent = imagecolorat($image2, 0, 0);
imageColorTransparent ($image2, $colorTransparent);
$colorTransparent = imagecolorat($image3, 0, 0);
imageColorTransparent ($image3, $colorTransparent);
imageCopyMerge($image1, $image2, 0, 0, 0, 0, 96, 96, 100);
imageCopyMerge($image1, $image3, 0, 0, 0, 0, 96, 96, 80);
ImagePng ($image1);
ImageDestroy ($image1);
ImageDestroy ($image2);
[1]: http://thechozenfew.net/projects/write_font.php | php | image | scripting | null | null | null | open | Joining Multiple Images into one with a PHP script
===
I have this test page [http://thechozenfew.net/projects/write_font.php][1] that generates the text in the input box as a font. Each letter is a different picture, How would i join all these pictures into one image with a php script?
This what i've tried so far but the images appear on top of each other.
Header ("Content-type: image/gif");
$image1Url = "../images/avatar.png";
$image2Url = "../images/key.png";
$image3Url = "../images/safari.png";
$image1 = imageCreateFromPNG($image1Url);
$image2 = imageCreateFromPNG($image2Url);
$image3 = imageCreateFromPNG($image3Url);
$colorTransparent = imagecolorat($image1, 0, 0);
imageColorTransparent ($image1, $colorTransparent);
$colorTransparent = imagecolorat($image2, 0, 0);
imageColorTransparent ($image2, $colorTransparent);
$colorTransparent = imagecolorat($image3, 0, 0);
imageColorTransparent ($image3, $colorTransparent);
imageCopyMerge($image1, $image2, 0, 0, 0, 0, 96, 96, 100);
imageCopyMerge($image1, $image3, 0, 0, 0, 0, 96, 96, 80);
ImagePng ($image1);
ImageDestroy ($image1);
ImageDestroy ($image2);
[1]: http://thechozenfew.net/projects/write_font.php | 0 |
807,238 | 04/30/2009 14:36:54 | 2,535 | 08/22/2008 17:36:15 | 520 | 53 | Credit Card 3 digit code - What is the official name for it? | I am working on a payment form and that 3-digit code on the back of the card, what is that called? I can't find a consistent reference as to what to call it. | credit-card | null | null | null | null | 08/15/2010 14:28:19 | off topic | Credit Card 3 digit code - What is the official name for it?
===
I am working on a payment form and that 3-digit code on the back of the card, what is that called? I can't find a consistent reference as to what to call it. | 2 |
10,255,887 | 04/21/2012 03:19:36 | 323,000 | 04/22/2010 07:27:07 | 92 | 10 | apache domain redirect not working as expected | I have the following rewrite rule in apache conf.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^([^\.]+\.[^\.]+)$
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
It redirects http://example.org/?p=18 to http://www.example.org//?p=18. It adds // at the end of domain name. How to fix this? | apache | redirect | null | null | null | null | open | apache domain redirect not working as expected
===
I have the following rewrite rule in apache conf.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^([^\.]+\.[^\.]+)$
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
It redirects http://example.org/?p=18 to http://www.example.org//?p=18. It adds // at the end of domain name. How to fix this? | 0 |
3,059,193 | 06/17/2010 05:48:38 | 165,375 | 08/29/2009 15:10:24 | 353 | 4 | Why the hell there are two slashes - forward and backward? | I'm totally confused which one to use and when, first thing I do when something goes wrong in code with a slash is replace the one with other so my test cases double with one for `/` and one for `\` .Help me to get the logic behind slashes. | programming | null | null | null | null | 06/18/2010 22:02:58 | not a real question | Why the hell there are two slashes - forward and backward?
===
I'm totally confused which one to use and when, first thing I do when something goes wrong in code with a slash is replace the one with other so my test cases double with one for `/` and one for `\` .Help me to get the logic behind slashes. | 1 |
7,576,678 | 09/27/2011 23:13:20 | 966,270 | 09/27/2011 04:42:11 | 11 | 0 | Fadein on hover then fade out to orginal state but stay on hover state when onclicked | Hello I'm new to Javascript and Jquery and don't know very much about it at all. Yesderday I asked a question and it got answered perfectly THANK YOU!!
Anyway today I have to do another Javascript and Jquery question its quite simular but I can't figure out how to change the code to meet my needs!!
What I have to create is a fadein/out of an image to show the image behind it which has text on it, the user can stay on that button by clicking it. Then it will go back to its orginal state when an other button is clicked on. But while an image has been clicked on the other buttons can be hovered over.
There is 8 images/buttons.
Please help me!! Also thank you in advance!! xo | javascript | jquery | onclick | fadein | fadeout | 09/28/2011 11:08:43 | not a real question | Fadein on hover then fade out to orginal state but stay on hover state when onclicked
===
Hello I'm new to Javascript and Jquery and don't know very much about it at all. Yesderday I asked a question and it got answered perfectly THANK YOU!!
Anyway today I have to do another Javascript and Jquery question its quite simular but I can't figure out how to change the code to meet my needs!!
What I have to create is a fadein/out of an image to show the image behind it which has text on it, the user can stay on that button by clicking it. Then it will go back to its orginal state when an other button is clicked on. But while an image has been clicked on the other buttons can be hovered over.
There is 8 images/buttons.
Please help me!! Also thank you in advance!! xo | 1 |
8,562,274 | 12/19/2011 13:49:15 | 1,106,005 | 12/19/2011 13:40:39 | 1 | 0 | Window Phone 7 ( Emulator ) . Trouble in ajax call for local files | I have used Phonegap.1.2.0.js in Window Phone 7 application. All files related html5 and javascripts are in folder called www. I have make an ajax call using jquery $.ajax({}) that call a .html file which is in www folder ( like in same folder or in local ) and it gives error "Access Denied". | jquery | ajax | windows-phone-7 | phonegap | null | 12/19/2011 15:28:06 | too localized | Window Phone 7 ( Emulator ) . Trouble in ajax call for local files
===
I have used Phonegap.1.2.0.js in Window Phone 7 application. All files related html5 and javascripts are in folder called www. I have make an ajax call using jquery $.ajax({}) that call a .html file which is in www folder ( like in same folder or in local ) and it gives error "Access Denied". | 3 |
3,254,980 | 07/15/2010 11:11:48 | 392,602 | 07/15/2010 10:59:15 | 1 | 0 | WebView creation fails | I'm trying to create WebView object programmatically:
WebView *webView = [WebView alloc]; // referencing error
:(
Any ideas ?
Thnx! | cocoa | null | null | null | null | null | open | WebView creation fails
===
I'm trying to create WebView object programmatically:
WebView *webView = [WebView alloc]; // referencing error
:(
Any ideas ?
Thnx! | 0 |
58,739 | 09/12/2008 11:36:58 | 5,147 | 09/08/2008 07:23:50 | 31 | 9 | Interview questions: WPF Developer | What should every WPF developer know?
**Entry Level**
- Strong .NET 2.0 Background & willing to learn!
- Explain dependency properties?
- What's a style?
- What's a template?
- Differences between base classes: Visual, UIElement, FrameworkElement, Control
- Visual vs Logical tree?
**Mid-level**
- Routed Events & Commands
- Binding...?
- Explain WPF's 2-pass layout engine?
- How to implement a panel?
**Senior**
- Example of attached behaviour?
- What is PRISM,CAL & CAG?
- How can worker threads update the UI?
Any other "trick" questions to ask? | wpf | interview-questions | null | null | null | 11/28/2011 18:39:35 | off topic | Interview questions: WPF Developer
===
What should every WPF developer know?
**Entry Level**
- Strong .NET 2.0 Background & willing to learn!
- Explain dependency properties?
- What's a style?
- What's a template?
- Differences between base classes: Visual, UIElement, FrameworkElement, Control
- Visual vs Logical tree?
**Mid-level**
- Routed Events & Commands
- Binding...?
- Explain WPF's 2-pass layout engine?
- How to implement a panel?
**Senior**
- Example of attached behaviour?
- What is PRISM,CAL & CAG?
- How can worker threads update the UI?
Any other "trick" questions to ask? | 2 |
4,578,270 | 01/02/2011 12:05:49 | 487,151 | 10/26/2010 03:12:03 | 6 | 0 | A good book for learning Visual C++ ! | Please suggest a book for learning visual c++ , which would help to learn about Windows programming too . | visual-c++ | null | null | null | null | 11/29/2011 05:28:32 | not constructive | A good book for learning Visual C++ !
===
Please suggest a book for learning visual c++ , which would help to learn about Windows programming too . | 4 |
11,740,317 | 07/31/2012 12:41:44 | 1,541,577 | 07/20/2012 18:49:18 | 18 | 0 | Why I get "Server Error" after this PHP if conditional? | I want to restrict any direct access to the results page, but I allow it if the user comes from the index.html. So I wrote the following code but it does not make the trick.
$selected= $_POST['selected'];
if empty($selected) {
header('Location: index.html');
} | php | null | null | null | null | 08/01/2012 04:09:11 | too localized | Why I get "Server Error" after this PHP if conditional?
===
I want to restrict any direct access to the results page, but I allow it if the user comes from the index.html. So I wrote the following code but it does not make the trick.
$selected= $_POST['selected'];
if empty($selected) {
header('Location: index.html');
} | 3 |
7,532,357 | 09/23/2011 16:51:56 | 504,998 | 11/11/2010 20:01:44 | 107 | 20 | to develop facebook app with Rails 3 | Which is the best way for to develop a facebook app (Fan page) with Ruby on Rails 3?
Thanks in advance | ruby-on-rails-3 | facebook | null | null | null | 09/23/2011 22:30:17 | not constructive | to develop facebook app with Rails 3
===
Which is the best way for to develop a facebook app (Fan page) with Ruby on Rails 3?
Thanks in advance | 4 |
5,519,458 | 04/01/2011 22:17:21 | 478,573 | 10/17/2010 14:54:01 | 577 | 22 | Languages suited for development in slow-moving institutions | I have a project which is in the R&D phase at a university institution. If this was a start-up I would use some language which is fast to work with like PHP or Ruby. Considering that speed is less of an issue in my current project and stability, support, quality, and sanity are more important, is PHP suitable here? Or is Java still the language for such projects?
Thanks,
Alex | java | php | software-engineering | enterprise | null | 04/02/2011 00:05:34 | not constructive | Languages suited for development in slow-moving institutions
===
I have a project which is in the R&D phase at a university institution. If this was a start-up I would use some language which is fast to work with like PHP or Ruby. Considering that speed is less of an issue in my current project and stability, support, quality, and sanity are more important, is PHP suitable here? Or is Java still the language for such projects?
Thanks,
Alex | 4 |
3,860,412 | 10/05/2010 02:08:03 | 466,372 | 10/05/2010 02:01:02 | 1 | 0 | Why is PHP so popular in contract work? | I've decided I'm going to learn the skills to make websites with the hopes of maybe doing contract work one day. Currently I'm dabbling with Django, but I get the impression that most contract work is done in PHP. Why is that? | php | contract | null | null | null | 10/05/2010 02:36:04 | not constructive | Why is PHP so popular in contract work?
===
I've decided I'm going to learn the skills to make websites with the hopes of maybe doing contract work one day. Currently I'm dabbling with Django, but I get the impression that most contract work is done in PHP. Why is that? | 4 |
8,638,651 | 12/26/2011 19:44:01 | 244,228 | 01/05/2010 20:33:24 | 5 | 0 | does this code look right | hi im still learning php so dont be too harsh if my code seems stupid. any ways im trying to make a contact page and add more validation to it, im using an if statment thing but i dont think it is right, any way how should the below code look?
<?php
if($name_blank == false){
echo"you left name blank";
}
else if($email_blank == false){
echo"Email blank";
}
else if($email_fake == false){
echo"Fake email";
}
else if($number_blank == false){
echo"Number blank";
}
else if($number_low == false){
echo"Number incorrect";
}
else if($number_fake == false){
echo"Fake number";
}
else if($comment_blank == false){
echo"Commant blank";
}else{
hasError = false;
}
?>
thanks. | php | validation | null | null | null | 12/26/2011 21:19:40 | not a real question | does this code look right
===
hi im still learning php so dont be too harsh if my code seems stupid. any ways im trying to make a contact page and add more validation to it, im using an if statment thing but i dont think it is right, any way how should the below code look?
<?php
if($name_blank == false){
echo"you left name blank";
}
else if($email_blank == false){
echo"Email blank";
}
else if($email_fake == false){
echo"Fake email";
}
else if($number_blank == false){
echo"Number blank";
}
else if($number_low == false){
echo"Number incorrect";
}
else if($number_fake == false){
echo"Fake number";
}
else if($comment_blank == false){
echo"Commant blank";
}else{
hasError = false;
}
?>
thanks. | 1 |
4,460,922 | 12/16/2010 12:49:23 | 331,000 | 05/02/2010 21:44:58 | 1 | 0 | PHP XMPP bot performance | Hey guys. I need to write xmpp bot which will be receiving and sending about 2000 messages per hour and work 24/7. Is it bad idea to write it on php? What about performance if i'll use php 5.3? | performance | xmpp | php-5.3 | null | null | null | open | PHP XMPP bot performance
===
Hey guys. I need to write xmpp bot which will be receiving and sending about 2000 messages per hour and work 24/7. Is it bad idea to write it on php? What about performance if i'll use php 5.3? | 0 |
2,804,645 | 05/10/2010 16:57:27 | 325,479 | 04/25/2010 17:27:11 | 13 | 1 | Why i get everytime the error-message that i've already sent the headers | i've another question about web-programming.
I programmed a login script, but everytime when i try to login it says that i've send the header informations already.
Here are the 2 files:
<?php
if($_GET['logout'] == 1) {
setcookie('authorized', 1, time()-3600);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Login - photoAdminSite</title>
</head>
<style type="text/css">
body {
text-align: center;
font-family: helvetica;
}
#loginForm {
padding: 1em;
background: #e3e3e3;
width: 260px;
margin: 3em auto 0;
text-align: left;
}
</style>
<body>
<div id="loginForm">
<form method="post" action="confirm_login_credentials.php">
<h2>LOGIN</h2>
<p>Username: <input type="text" name="username" /></p>
<p>Password: <input type="password" name="password" /></p>
<p><input type="submit" value="Login" name="submit" /></p>
</form>
</div>
</body>
</html>
<?php
$username = $_POST['username'];
$password = $_POST['password'];
require 'database.php';
$q = "SELECT id FROM users_photoadminsite WHERE user_name = '$username' AND password = '$password'";
$result = $mysqli->query($q) or die(mysqli_error());
if (mysqli_num_rows($result) == 1) {
setcookie('authorized', 1, 0);
header("Location: index.php");
} else {
header("Location: login.php");
}
?>
i would be really happy about some helpful answers. | php | mysql | html | header | null | null | open | Why i get everytime the error-message that i've already sent the headers
===
i've another question about web-programming.
I programmed a login script, but everytime when i try to login it says that i've send the header informations already.
Here are the 2 files:
<?php
if($_GET['logout'] == 1) {
setcookie('authorized', 1, time()-3600);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Login - photoAdminSite</title>
</head>
<style type="text/css">
body {
text-align: center;
font-family: helvetica;
}
#loginForm {
padding: 1em;
background: #e3e3e3;
width: 260px;
margin: 3em auto 0;
text-align: left;
}
</style>
<body>
<div id="loginForm">
<form method="post" action="confirm_login_credentials.php">
<h2>LOGIN</h2>
<p>Username: <input type="text" name="username" /></p>
<p>Password: <input type="password" name="password" /></p>
<p><input type="submit" value="Login" name="submit" /></p>
</form>
</div>
</body>
</html>
<?php
$username = $_POST['username'];
$password = $_POST['password'];
require 'database.php';
$q = "SELECT id FROM users_photoadminsite WHERE user_name = '$username' AND password = '$password'";
$result = $mysqli->query($q) or die(mysqli_error());
if (mysqli_num_rows($result) == 1) {
setcookie('authorized', 1, 0);
header("Location: index.php");
} else {
header("Location: login.php");
}
?>
i would be really happy about some helpful answers. | 0 |
8,866,158 | 01/14/2012 23:12:37 | 50,305 | 12/30/2008 20:58:06 | 2,955 | 30 | cpu usage per process? | How can I grab the percentage of cpu usage on a per process basis? So, for example, I'd like to run my program `prog` and get the cpu usage it incurred in, for example:
prog name cpu0 cpu1 cpu2 cpu3 total
prog 15 20 45 47 127%
Is there any tool for this?
Thanks. | linux | performance | null | null | null | null | open | cpu usage per process?
===
How can I grab the percentage of cpu usage on a per process basis? So, for example, I'd like to run my program `prog` and get the cpu usage it incurred in, for example:
prog name cpu0 cpu1 cpu2 cpu3 total
prog 15 20 45 47 127%
Is there any tool for this?
Thanks. | 0 |
9,104,496 | 02/01/2012 22:43:29 | 349,147 | 05/24/2010 16:58:18 | 13 | 2 | How to determine the namespace of a given attribute inside NodeChild | I'm trying to parse some Android XML using `XmlSlurper`. For a given child node, I want to detect whether or not an attribute with a particular namespace has been specified.
For example, in the following XML I would like to know whether the `EditText` node has had any attributes from the 'b' namespace declared:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:b="http://x.y.z.com">
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
b:enabled="true" />
</LinearLayout>
I start by calling:
def rootNode = new XmlSlurper().parseText(text)
to get a handle on the root `GPathResult`. As I iterate through the children, I am given an instance of `groovy.util.slurpersupport.NodeChild`. On this class I can inspect the attributes by calling `attributes()` and in the case of `EditText` above, this will return the following map: `[layout_width: "fill_parent", layout_height: "wrap_content", enabled: "true"]`.
This is all well and good. However, there doesn't seem to be a way to query the namespace of a given attribute. Am I missing something here?
| groovy | xml-parsing | null | null | null | null | open | How to determine the namespace of a given attribute inside NodeChild
===
I'm trying to parse some Android XML using `XmlSlurper`. For a given child node, I want to detect whether or not an attribute with a particular namespace has been specified.
For example, in the following XML I would like to know whether the `EditText` node has had any attributes from the 'b' namespace declared:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:b="http://x.y.z.com">
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
b:enabled="true" />
</LinearLayout>
I start by calling:
def rootNode = new XmlSlurper().parseText(text)
to get a handle on the root `GPathResult`. As I iterate through the children, I am given an instance of `groovy.util.slurpersupport.NodeChild`. On this class I can inspect the attributes by calling `attributes()` and in the case of `EditText` above, this will return the following map: `[layout_width: "fill_parent", layout_height: "wrap_content", enabled: "true"]`.
This is all well and good. However, there doesn't seem to be a way to query the namespace of a given attribute. Am I missing something here?
| 0 |
10,989,753 | 06/12/2012 02:09:16 | 1,450,181 | 06/12/2012 01:58:06 | 1 | 0 | What does x->y -= 2 in c do? | What does x->y -= 2 do in C? I'm new to C. | c | null | null | null | null | 06/12/2012 02:11:40 | not a real question | What does x->y -= 2 in c do?
===
What does x->y -= 2 do in C? I'm new to C. | 1 |
7,267,738 | 09/01/2011 08:24:50 | 923,076 | 09/01/2011 08:18:43 | 1 | 0 | SimpleXMLElement error but xml is valid | this is the error:
[01-Sep-2011 08:15:01] PHP Warning: SimpleXMLElement::__construct() [< a h ref='simplexmlelement.--construct'>simplexmlelement.--construct</a>]: ../domain/feed-yself-tips.php:1: parser error : Start tag expected, '<' not found in /home/domain/public_html/mergedrss.php on line 135
[01-Sep-2011 08:15:01] PHP Warning: SimpleXMLElement::__construct() [< a h ref='simplexmlelement.--construct'>simplexmlelement.--construct</a>]: 1f45 in /home/domain/public_html/mergedrss.php on line 135
[01-Sep-2011 08:15:01] PHP Warning: SimpleXMLElement::__construct() [< a h ref='simplexmlelement.--construct'>simplexmlelement.--construct</a>]: ^ in /home/domain/public_html/mergedrss.php on line 135
[01-Sep-2011 08:15:01] PHP Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /home/domain/public_html/mergedrss.php:135
Stack trace:
`#0 /home/domain/public_html/mergedrss.php(135): SimpleXMLElement->__construct('.../domain...', 0, true)`
`#1 /home/domain/public_html/mergedrss.php(57): MergedRSS->__fetch_rss_from_url('.../domain...')`
`#2 /home/domain/public_html/feed.php(21): MergedRSS->export(false, true, 15)`
`#3 {main}`
` thrown in /home/domain/public_html/mergedrss.php on line 135` | php | null | null | null | null | 09/01/2011 11:20:56 | not a real question | SimpleXMLElement error but xml is valid
===
this is the error:
[01-Sep-2011 08:15:01] PHP Warning: SimpleXMLElement::__construct() [< a h ref='simplexmlelement.--construct'>simplexmlelement.--construct</a>]: ../domain/feed-yself-tips.php:1: parser error : Start tag expected, '<' not found in /home/domain/public_html/mergedrss.php on line 135
[01-Sep-2011 08:15:01] PHP Warning: SimpleXMLElement::__construct() [< a h ref='simplexmlelement.--construct'>simplexmlelement.--construct</a>]: 1f45 in /home/domain/public_html/mergedrss.php on line 135
[01-Sep-2011 08:15:01] PHP Warning: SimpleXMLElement::__construct() [< a h ref='simplexmlelement.--construct'>simplexmlelement.--construct</a>]: ^ in /home/domain/public_html/mergedrss.php on line 135
[01-Sep-2011 08:15:01] PHP Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /home/domain/public_html/mergedrss.php:135
Stack trace:
`#0 /home/domain/public_html/mergedrss.php(135): SimpleXMLElement->__construct('.../domain...', 0, true)`
`#1 /home/domain/public_html/mergedrss.php(57): MergedRSS->__fetch_rss_from_url('.../domain...')`
`#2 /home/domain/public_html/feed.php(21): MergedRSS->export(false, true, 15)`
`#3 {main}`
` thrown in /home/domain/public_html/mergedrss.php on line 135` | 1 |
7,339,042 | 09/07/2011 18:54:39 | 931,583 | 09/06/2011 21:12:25 | 6 | 0 | python HTMLParser to replace some strings in the data of the html file | I need to replace some strings in the data content of my html page. I can't use replace function directly because I need changes only the data section. It shouldn't modify any of the tags or attributes. I used HTMLParser for this. But I am stuck on writing it back to file. Using HTMLParser I can parse and get data content which I will do necessary changes. But how to put it back to my html file ?
Please help. Here is my code:
class EntityHTML(HTMLParser.HTMLParser):
def __init__(self,filename):
HTMLParser.HTMLParser.__init__(self)
f = open(filename)
self.feed(f.read())
def handle_starttag(self, tag, attrs):
'''Needn't do anything here'''
def handle_data(self, data):
print data
data = data.replace(",","&sbquo")
| python | html-parsing | null | null | null | null | open | python HTMLParser to replace some strings in the data of the html file
===
I need to replace some strings in the data content of my html page. I can't use replace function directly because I need changes only the data section. It shouldn't modify any of the tags or attributes. I used HTMLParser for this. But I am stuck on writing it back to file. Using HTMLParser I can parse and get data content which I will do necessary changes. But how to put it back to my html file ?
Please help. Here is my code:
class EntityHTML(HTMLParser.HTMLParser):
def __init__(self,filename):
HTMLParser.HTMLParser.__init__(self)
f = open(filename)
self.feed(f.read())
def handle_starttag(self, tag, attrs):
'''Needn't do anything here'''
def handle_data(self, data):
print data
data = data.replace(",","&sbquo")
| 0 |
7,512,236 | 09/22/2011 09:04:25 | 1,039 | 08/11/2008 17:51:44 | 2,115 | 67 | What was the anticipated use of the reserved parameter on CoInitialize | Its been about 16 years now since it was created and I still don't know why there was a reserved parameter in the [CoInitialize][1] method. Does anyone know (or is able to make an intelligent guess about) why this parameter was added and what the anticipated use was?
[1]: http://msdn.microsoft.com/en-us/library/ms678543.aspx | windows | com | history | null | null | null | open | What was the anticipated use of the reserved parameter on CoInitialize
===
Its been about 16 years now since it was created and I still don't know why there was a reserved parameter in the [CoInitialize][1] method. Does anyone know (or is able to make an intelligent guess about) why this parameter was added and what the anticipated use was?
[1]: http://msdn.microsoft.com/en-us/library/ms678543.aspx | 0 |
6,254,888 | 06/06/2011 16:10:58 | 559,415 | 12/31/2010 18:23:38 | 227 | 9 | CSS Efficiency Questions | For the sake of this question, let "efficiency" mean, more-or-less, page rendering speed. Albeit, we should also take into account performance issues, like smooth scrolling.
Let's say you're putting a striped background on a page. From an efficiency standpoint, is it better to tile an image 100px wide (showing ten stripes), or an image 20px wide (showing two stripes)? Of course... a large image takes more time to load, but I feel like I've encountered trouble when tiling very small images. Is there an optimal point?
I'm starting to think this depends on the browser (or maybe the operating system?), especially given part two of this question:
To achieve translucency, is it more efficient to tile a translucent .png file, or work with CSS opacity attributes (again, the question of large vs. small time comes up)? From my experience, older versions of IE seem to behave better with a tiled, translucent .png than they do with CSS opacity attributes (though I've never done any scientific testing).
Rounded corners are another good example... in some browsers, the use of images instead of CSS attributes or JavaScript implementations seems to make the page much faster, with much smoother scrolling.
This is really a question broader than CSS, but it's just something I've been thinking about lately.
-Peter | css | browser | cross-browser | performance | webpage-rendering | 06/07/2011 07:10:24 | off topic | CSS Efficiency Questions
===
For the sake of this question, let "efficiency" mean, more-or-less, page rendering speed. Albeit, we should also take into account performance issues, like smooth scrolling.
Let's say you're putting a striped background on a page. From an efficiency standpoint, is it better to tile an image 100px wide (showing ten stripes), or an image 20px wide (showing two stripes)? Of course... a large image takes more time to load, but I feel like I've encountered trouble when tiling very small images. Is there an optimal point?
I'm starting to think this depends on the browser (or maybe the operating system?), especially given part two of this question:
To achieve translucency, is it more efficient to tile a translucent .png file, or work with CSS opacity attributes (again, the question of large vs. small time comes up)? From my experience, older versions of IE seem to behave better with a tiled, translucent .png than they do with CSS opacity attributes (though I've never done any scientific testing).
Rounded corners are another good example... in some browsers, the use of images instead of CSS attributes or JavaScript implementations seems to make the page much faster, with much smoother scrolling.
This is really a question broader than CSS, but it's just something I've been thinking about lately.
-Peter | 2 |
2,529,667 | 03/27/2010 14:44:53 | 51,649 | 01/05/2009 13:47:38 | 572 | 15 | CodeIgniter and Your Own Scripts | I have found a class I would like to use to get bookmarks from a users delicious account. Here is [how it is used][1].
The problem I am having is, should I be turning this into a Codeigniter library? Can I not use it on its own as this is self contained? I am guessing I am asking for the best practice here.
Thanks all for any help
[1]: http://www.ejeliot.com/samples/delicious-backup/backup-to-mysql.txt | php | codeigniter | null | null | null | null | open | CodeIgniter and Your Own Scripts
===
I have found a class I would like to use to get bookmarks from a users delicious account. Here is [how it is used][1].
The problem I am having is, should I be turning this into a Codeigniter library? Can I not use it on its own as this is self contained? I am guessing I am asking for the best practice here.
Thanks all for any help
[1]: http://www.ejeliot.com/samples/delicious-backup/backup-to-mysql.txt | 0 |
10,173,915 | 04/16/2012 12:18:20 | 1,015,551 | 10/26/2011 22:50:17 | 64 | 1 | Bind iList to DataGridView, DGV not updating | I have a simple test class:
public partial class TEST_CLASS
{
public string IP { get; set; }
public int PORT { get; set; }
}
iList<TEST_CLASS> MY_CLASS = new List<TEST_CLASS>();
And I have the following code to bind the class to DGV:
TEST_CLASS n = new TEST_CLASS();
MY_CLASS.Add(n);
grid_nodes.DataSource = MY_CLASS;
Thread t = new Thread(set1);
t.Start();
Thread t2 = new Thread(set2);
t2.Start();
And The threads that update the class to random values for testing purposes:
public void set1()
{
while (true)
{
Random r = new Random();
MY_CLASS[0].IP = r.Next(999900);
Thread.Sleep(100);
}
}
public void set2()
{
while (true)
{
Random r = new Random();
MY_CLASS[0].PORT = r.Next(999900);
Thread.Sleep(100);
}
}
The problem is that DGV is not getting updated right. I only see the updates each time a click in a cell.
I'm going to have thousands of rows and separate threads updating the MY_CLASS and I need the changes to be displayed 'live' on the DGV.
As far as I understand I need to call DGV.Update() each time I update my class? What would be the best way of doing this, since I'm going to have thousands of threads updating the class constantly? Thanks! | c# | datagridview | ilist | null | null | null | open | Bind iList to DataGridView, DGV not updating
===
I have a simple test class:
public partial class TEST_CLASS
{
public string IP { get; set; }
public int PORT { get; set; }
}
iList<TEST_CLASS> MY_CLASS = new List<TEST_CLASS>();
And I have the following code to bind the class to DGV:
TEST_CLASS n = new TEST_CLASS();
MY_CLASS.Add(n);
grid_nodes.DataSource = MY_CLASS;
Thread t = new Thread(set1);
t.Start();
Thread t2 = new Thread(set2);
t2.Start();
And The threads that update the class to random values for testing purposes:
public void set1()
{
while (true)
{
Random r = new Random();
MY_CLASS[0].IP = r.Next(999900);
Thread.Sleep(100);
}
}
public void set2()
{
while (true)
{
Random r = new Random();
MY_CLASS[0].PORT = r.Next(999900);
Thread.Sleep(100);
}
}
The problem is that DGV is not getting updated right. I only see the updates each time a click in a cell.
I'm going to have thousands of rows and separate threads updating the MY_CLASS and I need the changes to be displayed 'live' on the DGV.
As far as I understand I need to call DGV.Update() each time I update my class? What would be the best way of doing this, since I'm going to have thousands of threads updating the class constantly? Thanks! | 0 |
6,765,179 | 07/20/2011 16:22:34 | 326,518 | 04/27/2010 03:18:10 | 4,156 | 204 | Fogbugz Description | I know this has been asked time and again and numerous feature requests have been submitted, but I don't see anything from the past year. I'm using a trial of FogBugz and am evaluating whether to purchase it.
Basically, not being able to edit a case description is a complete hard deal killer and makes FogBugz unusable for my team. In TFS, there is an item history and an item description. These two fields serve separate purposes and are equally important.
Making the current edit functionality in FogBugz further inappropriate for this - the last revision of an item in FogBugz is show at the bottom, not the top...so you need to scroll all the way down...and moreover, if I edit the item in FogBugz, the box is not pre-populated with the previous existing content...
Is there any way to accomplish this? | fogbugz | null | null | null | null | 11/13/2011 11:30:49 | off topic | Fogbugz Description
===
I know this has been asked time and again and numerous feature requests have been submitted, but I don't see anything from the past year. I'm using a trial of FogBugz and am evaluating whether to purchase it.
Basically, not being able to edit a case description is a complete hard deal killer and makes FogBugz unusable for my team. In TFS, there is an item history and an item description. These two fields serve separate purposes and are equally important.
Making the current edit functionality in FogBugz further inappropriate for this - the last revision of an item in FogBugz is show at the bottom, not the top...so you need to scroll all the way down...and moreover, if I edit the item in FogBugz, the box is not pre-populated with the previous existing content...
Is there any way to accomplish this? | 2 |
5,761,977 | 04/23/2011 03:34:33 | 719,380 | 04/21/2011 13:27:57 | 6 | 0 | Calculate the distance between two points in iphone | I am creating an application that requires the user to input two places. My application will calculate the road-distance between these two points ad output the result.
I think I would have to use the google maps API and get an xml file with the result and then parse the xml file. Is my way of doing this possible? if so, could anyone help me because i not sure how to do this. if no, what other ways would there be to do this?
Appreciate all help. | iphone | xcode | google-maps | distance | null | null | open | Calculate the distance between two points in iphone
===
I am creating an application that requires the user to input two places. My application will calculate the road-distance between these two points ad output the result.
I think I would have to use the google maps API and get an xml file with the result and then parse the xml file. Is my way of doing this possible? if so, could anyone help me because i not sure how to do this. if no, what other ways would there be to do this?
Appreciate all help. | 0 |
8,020,820 | 11/05/2011 14:31:45 | 256,062 | 01/21/2010 18:16:20 | 925 | 1 | Are virtual functions safer to use than function pointers? | Are virtual functions safer to use than function pointers? By safer I mean less prone to errors by developers. And if they are safer please explain how. | c++ | function-pointers | virtual-functions | null | null | 11/05/2011 14:55:39 | not constructive | Are virtual functions safer to use than function pointers?
===
Are virtual functions safer to use than function pointers? By safer I mean less prone to errors by developers. And if they are safer please explain how. | 4 |
6,474,665 | 06/24/2011 23:17:32 | 683,194 | 03/30/2011 03:15:39 | 284 | 2 | manifest file download size limit | I am learning to use Manifest files and had this question. What if some website created a manifest file that will make me cache files for, say, 3MB. 3MB is a lot for my IPhone when I run on 3G. So some vicious website can create such manifest file and make me use up all my data allowance?
Another question is that, as a responsible developer, is there anyway to detect if a user is using 3G or not so I can serve a smaller manifest file in the former case?
Thank you | html5 | null | null | null | null | null | open | manifest file download size limit
===
I am learning to use Manifest files and had this question. What if some website created a manifest file that will make me cache files for, say, 3MB. 3MB is a lot for my IPhone when I run on 3G. So some vicious website can create such manifest file and make me use up all my data allowance?
Another question is that, as a responsible developer, is there anyway to detect if a user is using 3G or not so I can serve a smaller manifest file in the former case?
Thank you | 0 |
9,541,284 | 03/02/2012 22:30:30 | 602,183 | 02/03/2011 20:20:03 | 9 | 2 | How to include UserID and Password in the http header? | string requestPath = "http://host/user/register";
string RegJson = JsonConvert.SerializeObject(userProfile);
WebRequest request = WebRequest.Create(requestPath);
request.Headers.Add("UserID:"+ userID +";");
request.Headers.Add("Password:" + password + ";");
request.ContentType = "application/json; charset=utf-8";
request.Method = "POST";
Here userprofile i am converting to json and use that for the webrequest call. After registration and login, i need to include userID and password in the header for every request. I'm not sure weather I am passing UserID & Password properly in the header or not. | c# | asp.net | asp.net-mvc-3 | header | http-headers | null | open | How to include UserID and Password in the http header?
===
string requestPath = "http://host/user/register";
string RegJson = JsonConvert.SerializeObject(userProfile);
WebRequest request = WebRequest.Create(requestPath);
request.Headers.Add("UserID:"+ userID +";");
request.Headers.Add("Password:" + password + ";");
request.ContentType = "application/json; charset=utf-8";
request.Method = "POST";
Here userprofile i am converting to json and use that for the webrequest call. After registration and login, i need to include userID and password in the header for every request. I'm not sure weather I am passing UserID & Password properly in the header or not. | 0 |
5,621,077 | 04/11/2011 12:13:30 | 702,125 | 04/11/2011 12:13:30 | 1 | 0 | Tests of hash collision on ASCII characters | I'm currently in the process of building a caching system for some of our back end systems, which means that I'll need a hash table of some sort, to represent cached entities. In this context, I was wondering if anyone knows about any tests showing different algorithms and the minimum ASCII string length necessary to provoke a collision? Ie. what's a safe length (ASCII characters) to hash with a range of functions?
The reason is of course that I want the best trade off between size (the cache is going to be representing several million entities on relatively small servers), performance and collision safety.
Thanks in advance,
Nick | c++ | caching | hash | collision | null | null | open | Tests of hash collision on ASCII characters
===
I'm currently in the process of building a caching system for some of our back end systems, which means that I'll need a hash table of some sort, to represent cached entities. In this context, I was wondering if anyone knows about any tests showing different algorithms and the minimum ASCII string length necessary to provoke a collision? Ie. what's a safe length (ASCII characters) to hash with a range of functions?
The reason is of course that I want the best trade off between size (the cache is going to be representing several million entities on relatively small servers), performance and collision safety.
Thanks in advance,
Nick | 0 |
2,228,013 | 02/09/2010 09:34:56 | 241,853 | 01/01/2010 07:55:30 | 11 | 0 | which is the best site for learning more on php | i am using php for a while but....... i think i need to improve on my skills ....since i have problem in troublesooting
so i am searching for a article <or> site which can make me comfortable working on the language.....what is the solution to develope my skills | php | codeigniter | null | null | null | 07/16/2012 11:29:03 | not constructive | which is the best site for learning more on php
===
i am using php for a while but....... i think i need to improve on my skills ....since i have problem in troublesooting
so i am searching for a article <or> site which can make me comfortable working on the language.....what is the solution to develope my skills | 4 |
322,614 | 11/27/2008 00:28:14 | 41,110 | 11/26/2008 17:51:32 | 111 | 5 | Linq to SQL: How can I Order By a composite object? | I have the following Linq to SQL query, in which I'm trying to do a multi-column GROUP BY:
return from revision in dataContext.Revisions
where revision.BranchID == sourceBranch.BranchID-1 && !revision.HasBeenMerged
group revision by new Task(revision.TaskSourceCode.ToUpper(), revision.TaskSourceID)
into grouping
orderby grouping.Key ascending
select (ITask)grouping.Key;
This throws InvalidOperationException ("Cannot order by type 'Task'.").
Is there an interface that Task must implement (it *already* implements IComparable, IComparable<ITask>)? Does Task need to be a Linq to SQL Entity (it isn't, currently, since there's no corresponding table). Or is this just something that Linq to SQL doesn't support?
Note that I've already tried an anonymous type for the grouping, which failed with a similar InvalidOperationException:
...
group revision by new { Code = revision.TaskSourceCode.ToUpper(), Id = revision.TaskSourceID }
... | c# | linq-to-sql | order-by | null | null | null | open | Linq to SQL: How can I Order By a composite object?
===
I have the following Linq to SQL query, in which I'm trying to do a multi-column GROUP BY:
return from revision in dataContext.Revisions
where revision.BranchID == sourceBranch.BranchID-1 && !revision.HasBeenMerged
group revision by new Task(revision.TaskSourceCode.ToUpper(), revision.TaskSourceID)
into grouping
orderby grouping.Key ascending
select (ITask)grouping.Key;
This throws InvalidOperationException ("Cannot order by type 'Task'.").
Is there an interface that Task must implement (it *already* implements IComparable, IComparable<ITask>)? Does Task need to be a Linq to SQL Entity (it isn't, currently, since there's no corresponding table). Or is this just something that Linq to SQL doesn't support?
Note that I've already tried an anonymous type for the grouping, which failed with a similar InvalidOperationException:
...
group revision by new { Code = revision.TaskSourceCode.ToUpper(), Id = revision.TaskSourceID }
... | 0 |
2,714,505 | 04/26/2010 15:05:08 | 145,792 | 07/27/2009 14:36:25 | 37 | 5 | UINavigationController reset inner UIViewControllers | I have very unique problem. My app has UINavigationCnotroller with a set of UIViewController's. Most of the time everything goes fine but at some point, when I press Back button, the UIViewController to which I return suddenly reloads. i.e. the loadView called second time and the interface becomes squashed.. Prior to this I had UITabbarController in which I saw the same issue (when switching between tabs). It looks like UINavigationController/UITabBarController just reset some of UIViewController at some point. Also, this issue is visible only on device. Any ideas??
Many thanks in advance!!! | uinavigationcontroller | uitabbarcontroller | uiviewcontroller | reset | reload | null | open | UINavigationController reset inner UIViewControllers
===
I have very unique problem. My app has UINavigationCnotroller with a set of UIViewController's. Most of the time everything goes fine but at some point, when I press Back button, the UIViewController to which I return suddenly reloads. i.e. the loadView called second time and the interface becomes squashed.. Prior to this I had UITabbarController in which I saw the same issue (when switching between tabs). It looks like UINavigationController/UITabBarController just reset some of UIViewController at some point. Also, this issue is visible only on device. Any ideas??
Many thanks in advance!!! | 0 |
8,412,953 | 12/07/2011 09:24:17 | 1,085,278 | 12/07/2011 09:19:22 | 1 | 0 | logic to read fasta file in java | >seq1
GTTAACTACGTCAGGTGGCACTTTTCGGGGAAATGTGCGCGGAACCCCTATTTGTTTATTTTTCTAAATACATTCAAATA
TGTATCCGCTCATGAGACAATAACCCTGATAAATGCTTCAATAATATTGAAAAAGGAAGAGTATGAGTATTCAACATTTC
CGTGTCGCCCTTATTCCCTTTTTTGCGGCATTTTGCCTTCCTGTTTTTGCTCACCCAGAAACGCTGGTGAAAGTAAAAGA
>seq2
ATGGCACACCCAACGCAACTAGGTTTCAAGGACGCGGCCATACCCGTTATAGAGGAACTTCTTCACTTCCACGACCACGC
ATTAATAATTGTGCTCCTAATTAGCACTTTAGTTTTATATATTATTACTGCAATGGTATCAACTAAACTTACTAATAAAT
>seq3
GTTAACTACGTCAGGTGGCACTTTTCGGGGAAATGTGCGCGGAACCCCTATTTGTTTATTTTTCTAAATACATTCAAATA
TGTATCCGCTCATGAGACAATAACCCTGATAAATGCTTCAATAATATTGAAAAAGGAA
now i want to find the length of string between lines "seq1","seq2" and "seq3" in java.
please give me some direction in which i can proceed. | java | null | null | null | null | 12/07/2011 10:01:21 | not a real question | logic to read fasta file in java
===
>seq1
GTTAACTACGTCAGGTGGCACTTTTCGGGGAAATGTGCGCGGAACCCCTATTTGTTTATTTTTCTAAATACATTCAAATA
TGTATCCGCTCATGAGACAATAACCCTGATAAATGCTTCAATAATATTGAAAAAGGAAGAGTATGAGTATTCAACATTTC
CGTGTCGCCCTTATTCCCTTTTTTGCGGCATTTTGCCTTCCTGTTTTTGCTCACCCAGAAACGCTGGTGAAAGTAAAAGA
>seq2
ATGGCACACCCAACGCAACTAGGTTTCAAGGACGCGGCCATACCCGTTATAGAGGAACTTCTTCACTTCCACGACCACGC
ATTAATAATTGTGCTCCTAATTAGCACTTTAGTTTTATATATTATTACTGCAATGGTATCAACTAAACTTACTAATAAAT
>seq3
GTTAACTACGTCAGGTGGCACTTTTCGGGGAAATGTGCGCGGAACCCCTATTTGTTTATTTTTCTAAATACATTCAAATA
TGTATCCGCTCATGAGACAATAACCCTGATAAATGCTTCAATAATATTGAAAAAGGAA
now i want to find the length of string between lines "seq1","seq2" and "seq3" in java.
please give me some direction in which i can proceed. | 1 |
10,262,201 | 04/21/2012 19:20:37 | 1,225,994 | 02/22/2012 13:46:49 | 21 | 0 | Mobile gestures in backbone.js | Can I have mobile gestures like swipe, tap, pinch etc in the Backbone.js View events? To be more specific following is my code.
Backbone.View.extend({
initialize:function(){
//initialization
},
Events:{
"swipe-left #homeBtn":"homeSwipe"
},
homeSwipe:function(){
alert("Event Swipe left triggered!");
}
});
Can I have the mobile gestures like swipe, swipe-left/right, pinch, tap etc to work with backbone.js? | events | jquery-mobile | backbone.js | null | null | null | open | Mobile gestures in backbone.js
===
Can I have mobile gestures like swipe, tap, pinch etc in the Backbone.js View events? To be more specific following is my code.
Backbone.View.extend({
initialize:function(){
//initialization
},
Events:{
"swipe-left #homeBtn":"homeSwipe"
},
homeSwipe:function(){
alert("Event Swipe left triggered!");
}
});
Can I have the mobile gestures like swipe, swipe-left/right, pinch, tap etc to work with backbone.js? | 0 |
2,660,868 | 04/18/2010 02:22:16 | 261,081 | 01/28/2010 14:59:22 | 99 | 6 | Good readings about refactoring data structures | Nowadays most programmers know about code refactorings.
What about refactorings of data structures, are there any good readings about it?
One paradigm that I can think of is the normalization process of a relational database.
Are there any other good examples? | refactoring | data | null | null | null | null | open | Good readings about refactoring data structures
===
Nowadays most programmers know about code refactorings.
What about refactorings of data structures, are there any good readings about it?
One paradigm that I can think of is the normalization process of a relational database.
Are there any other good examples? | 0 |
9,654,142 | 03/11/2012 10:24:04 | 1,262,107 | 03/11/2012 10:16:29 | 1 | 0 | Can not find malware file | I user eset smart as antivirus ,
about 2 days ago it warn me about one of my own site and after that it close connection when I brows my site : http://studiopix.ir (and also http://Matbakhchi.com )
the Sucuri (http://sitecheck.sucuri.net/results/http://studiopix.ir) said me: "Malware found "
but I can not find wich file contain malware code ...
and also I can not remove it !
could anyone assist me here ? | javascript | malware | trojan | null | null | 03/11/2012 10:44:46 | off topic | Can not find malware file
===
I user eset smart as antivirus ,
about 2 days ago it warn me about one of my own site and after that it close connection when I brows my site : http://studiopix.ir (and also http://Matbakhchi.com )
the Sucuri (http://sitecheck.sucuri.net/results/http://studiopix.ir) said me: "Malware found "
but I can not find wich file contain malware code ...
and also I can not remove it !
could anyone assist me here ? | 2 |
10,421,764 | 05/02/2012 21:08:26 | 329,637 | 04/30/2010 09:27:00 | 16,609 | 552 | Why isn't my frame disposed? | I'm using the following method to display a frame:
public static void createImage(final String url, final String file, final String filetype) {
UIUtils.setPreferredLookAndFeel();
NativeInterface.open();
SwingUtilities.invokeLater(new Runnable() {
@SuppressWarnings("deprecation")
@Override
public void run() {
frame = new JFrame();
WebsiteThumbnailCreator ex = new WebsiteThumbnailCreator(url, file, filetype);
frame.getContentPane().add(ex, BorderLayout.CENTER);
frame.setSize(FRAMESIZE);
frame.setLocationByPlatform(true);
frame.setVisible(true);
frame.hide();
}
});
NativeInterface.runEventPump();
}
Then i do some calculation and after that, I want to dispose the frame again:
try {
ImageIO.write(rendered, filetype, new File(file + "." + filetype));
frame.dispose();
logger.trace("Tried to dispose the frame");
} catch (IOException e) {
logger.fatal(e.getMessage());
} finally {
logger.debug("Try to dispose the frame");
frame.dispose();
}
I can see the log messages but however, the frame isn't disposed. What am I doing wrong? | java | null | null | null | null | null | open | Why isn't my frame disposed?
===
I'm using the following method to display a frame:
public static void createImage(final String url, final String file, final String filetype) {
UIUtils.setPreferredLookAndFeel();
NativeInterface.open();
SwingUtilities.invokeLater(new Runnable() {
@SuppressWarnings("deprecation")
@Override
public void run() {
frame = new JFrame();
WebsiteThumbnailCreator ex = new WebsiteThumbnailCreator(url, file, filetype);
frame.getContentPane().add(ex, BorderLayout.CENTER);
frame.setSize(FRAMESIZE);
frame.setLocationByPlatform(true);
frame.setVisible(true);
frame.hide();
}
});
NativeInterface.runEventPump();
}
Then i do some calculation and after that, I want to dispose the frame again:
try {
ImageIO.write(rendered, filetype, new File(file + "." + filetype));
frame.dispose();
logger.trace("Tried to dispose the frame");
} catch (IOException e) {
logger.fatal(e.getMessage());
} finally {
logger.debug("Try to dispose the frame");
frame.dispose();
}
I can see the log messages but however, the frame isn't disposed. What am I doing wrong? | 0 |
10,773,756 | 05/27/2012 11:47:33 | 1,420,081 | 05/27/2012 11:38:44 | 1 | 0 | Poblem with getting multidimensional array (object) observable in KnockoutJS | I am building an application with Knockout and find it very useful.
Although, I have a problem with getting multidimensional array (object) observable.
At the moment I am using following structure:
self.form = ko.observableArray(ko.utils.arrayMap(initialData, function(section) {
var result = {
name : section.name,
code : section.code,
type : section.type,
fields: ko.observableArray(section.fields)
};
return result;
}));
It works well, but I can't get it working if the initialData is more than two levels.
I tried something like
self.form = ko.observableArray(ko.utils.arrayMap(initialData, function(block) {
var result = {
name : block.name,
code : block.code,
type : block.type,
sections: ko.observableArray(ko.utils.arrayMap(block.sections, function(section) {
var result = {
name : section.name,
code : section.code,
type : section.type,
fields: ko.observableArray(section.fields)
};
return result;
}))
};
return result;
}));
The final array structure looks good, but knockout doesn't updates DOM when I am doing push to sections array:
self.addField = function( section ) {
field = {
code: uid(),
name: "New Field",
value: '',
type: section.type
};
section.fields.push(field);
};
I also tried a knockout.mapping.js plugin (is that a right approach?) looks good first, but after a push in the function above I have my new field element not observable, just object.
The plugin doumentation says:
// Every time data is received from the server:
ko.mapping.fromJS(data, viewModel);
But I am not sure that it is my case.
If anyone has any ideas, it would be much appreciated.
Thanks.
| knockout.js | knockout-mapping-plugin | knockout-2.0 | ko.observablearray | null | null | open | Poblem with getting multidimensional array (object) observable in KnockoutJS
===
I am building an application with Knockout and find it very useful.
Although, I have a problem with getting multidimensional array (object) observable.
At the moment I am using following structure:
self.form = ko.observableArray(ko.utils.arrayMap(initialData, function(section) {
var result = {
name : section.name,
code : section.code,
type : section.type,
fields: ko.observableArray(section.fields)
};
return result;
}));
It works well, but I can't get it working if the initialData is more than two levels.
I tried something like
self.form = ko.observableArray(ko.utils.arrayMap(initialData, function(block) {
var result = {
name : block.name,
code : block.code,
type : block.type,
sections: ko.observableArray(ko.utils.arrayMap(block.sections, function(section) {
var result = {
name : section.name,
code : section.code,
type : section.type,
fields: ko.observableArray(section.fields)
};
return result;
}))
};
return result;
}));
The final array structure looks good, but knockout doesn't updates DOM when I am doing push to sections array:
self.addField = function( section ) {
field = {
code: uid(),
name: "New Field",
value: '',
type: section.type
};
section.fields.push(field);
};
I also tried a knockout.mapping.js plugin (is that a right approach?) looks good first, but after a push in the function above I have my new field element not observable, just object.
The plugin doumentation says:
// Every time data is received from the server:
ko.mapping.fromJS(data, viewModel);
But I am not sure that it is my case.
If anyone has any ideas, it would be much appreciated.
Thanks.
| 0 |
7,484,520 | 09/20/2011 11:42:21 | 587,736 | 07/30/2010 23:47:22 | 175 | 15 | iPhone App: Some users are not able to leave review? | We have just launched our new app on Apple store. Some users have downloaded the app and its working fine but out of those users some users not able to leave review about the app! They get error message saying "You have to own or installed the app" even-though they already have app installed. It's free App!
Did anyone notice same? What could I check to resolve this?
Thanks. | iphone | app-store | review | null | null | 09/20/2011 19:47:38 | off topic | iPhone App: Some users are not able to leave review?
===
We have just launched our new app on Apple store. Some users have downloaded the app and its working fine but out of those users some users not able to leave review about the app! They get error message saying "You have to own or installed the app" even-though they already have app installed. It's free App!
Did anyone notice same? What could I check to resolve this?
Thanks. | 2 |
9,410,474 | 02/23/2012 09:41:53 | 1,227,713 | 02/23/2012 07:19:53 | 1 | 0 | How to write code for get photo from photo library in android? | I want code for get the photo from photo library and add that photo into profile in android. | android | null | null | null | null | 02/23/2012 21:49:17 | not a real question | How to write code for get photo from photo library in android?
===
I want code for get the photo from photo library and add that photo into profile in android. | 1 |
8,801,445 | 01/10/2012 10:04:07 | 521,493 | 11/26/2010 14:50:55 | 59 | 6 | Reverse direction of existing "compare" in Word 2010 | Using "Review > Compare > Compare" and possibly "Review > Compare > Show Source Documents > Show Both" in Word 2010 brings up three panes titled "Compared Document", "Original Document", and "Revised Document". The Compare dialog has a button to swap the "original" and "revised" documents, reversing the direction of comparison. I would like something similar that works after the comparison has been made.
Here's why I want this. I find it convenient to use TortoiseGit's context menu to Diff two Word documents selected in my file manager -- it is easier than opening Word, clicking in three different places just to open the dialog, and having to select the files from separate nested dialogs. However, the TortoiseGit macro doesn't always agree with me on what is the "original" document.
From poking around in the VBA "immediate pane" and object reference, I see that the original and revised documents are shown in ActiveWindow.Panes(2) and ActiveWindow.Panes(3). These panes have title bars showing the respective document names. However, the ActiveWindow.Panes(2).Document.Name property seems to be empty.
If I could just get hold of the file names for those two panes, I could write a macro to call Application.CompareDocuments again, swapping the OriginalDocument and RevisedDocument arguments, and assign this macro to a button or shortcut key. Any advice on getting those file names would be highly appreciated. | ms-word | diff | word-vba | null | null | null | open | Reverse direction of existing "compare" in Word 2010
===
Using "Review > Compare > Compare" and possibly "Review > Compare > Show Source Documents > Show Both" in Word 2010 brings up three panes titled "Compared Document", "Original Document", and "Revised Document". The Compare dialog has a button to swap the "original" and "revised" documents, reversing the direction of comparison. I would like something similar that works after the comparison has been made.
Here's why I want this. I find it convenient to use TortoiseGit's context menu to Diff two Word documents selected in my file manager -- it is easier than opening Word, clicking in three different places just to open the dialog, and having to select the files from separate nested dialogs. However, the TortoiseGit macro doesn't always agree with me on what is the "original" document.
From poking around in the VBA "immediate pane" and object reference, I see that the original and revised documents are shown in ActiveWindow.Panes(2) and ActiveWindow.Panes(3). These panes have title bars showing the respective document names. However, the ActiveWindow.Panes(2).Document.Name property seems to be empty.
If I could just get hold of the file names for those two panes, I could write a macro to call Application.CompareDocuments again, swapping the OriginalDocument and RevisedDocument arguments, and assign this macro to a button or shortcut key. Any advice on getting those file names would be highly appreciated. | 0 |
1,528,791 | 10/07/2009 00:02:50 | 142,006 | 07/21/2009 13:24:27 | 40 | 0 | Best PHP framework with Admin Section | I've being developing with Django for about two years. I recently was hired by a company that has about 20 sites that are all PHP. The PHP is very old and has really bad coding practices.
I would like to switch them over to Django but that might take awhile as the site have heavy e-commerce integrations. In the meantime I would like to switch them to a PHP framework that has a nice, quick admin area like Django.
I would like to have something setup by tomorrow and Symfony is pretty much out of the question. I don't really like how it works.
Are there any PHP frameworks that have easy to configure admin areas? Frameworks with sample projects would help. | php | frameworks | admin | null | null | 09/10/2011 19:12:49 | not constructive | Best PHP framework with Admin Section
===
I've being developing with Django for about two years. I recently was hired by a company that has about 20 sites that are all PHP. The PHP is very old and has really bad coding practices.
I would like to switch them over to Django but that might take awhile as the site have heavy e-commerce integrations. In the meantime I would like to switch them to a PHP framework that has a nice, quick admin area like Django.
I would like to have something setup by tomorrow and Symfony is pretty much out of the question. I don't really like how it works.
Are there any PHP frameworks that have easy to configure admin areas? Frameworks with sample projects would help. | 4 |
8,144,033 | 11/15/2011 22:25:04 | 412,400 | 08/05/2010 20:50:22 | 5 | 0 | Serving interactive content through a cdn | So this is a more general question regarding ways to serve content. This issue is as follows: I have content that I'm looking to serve through a CDN since the content gets hit pretty heavily and requires caching. The issue is that the content is interactive and through AJAX POSTs to my server via the CDN. The issue is that I have no means of preventing a DOS attack since the AJAX requests are filtered through the CDN and my only choice is to cut my server's connection to the CDN, which severs all services (bad). The javascript has to make calls to the same domain (CDN) that the content is loaded from to prevent cross-domain issues where it would be ideal to make direct calls. My CDN is a non-intelligent caching service so any filtering on that side is out of the question.
What i'm looking for is a means to provide some accountability in this transaction. | php | javascript | ajax | cdn | null | 11/16/2011 00:35:37 | off topic | Serving interactive content through a cdn
===
So this is a more general question regarding ways to serve content. This issue is as follows: I have content that I'm looking to serve through a CDN since the content gets hit pretty heavily and requires caching. The issue is that the content is interactive and through AJAX POSTs to my server via the CDN. The issue is that I have no means of preventing a DOS attack since the AJAX requests are filtered through the CDN and my only choice is to cut my server's connection to the CDN, which severs all services (bad). The javascript has to make calls to the same domain (CDN) that the content is loaded from to prevent cross-domain issues where it would be ideal to make direct calls. My CDN is a non-intelligent caching service so any filtering on that side is out of the question.
What i'm looking for is a means to provide some accountability in this transaction. | 2 |
10,851,035 | 06/01/2012 13:15:56 | 61,996 | 02/03/2009 15:51:53 | 753 | 6 | Workflow in sharepoint designer 2010 doesn't resume after pause | I'm working on a workflow that needs to pause for a few minutes and then resume. My problem is that it never resumes after the pause. This is the workflow I'm testing it on.
Log start to the workflow history list
Pause for 0 days 0 hours 5 minutes
Log stop to the workflow history list
Stop the workflow and log completed
It never logs *stop*.
If I remove the pause the workflow works correctly.
I've read about a hotfix that has to do with timer in sharepoint http://www.microsoft.com/en-us/download/details.aspx?id=21066 . But I wasn't able to install it so I think it doesn't apply to my version of SPD.
Any ideas? | sharepoint | sharepoint2010 | workflow | sharepoint-designer | null | 06/02/2012 20:22:49 | off topic | Workflow in sharepoint designer 2010 doesn't resume after pause
===
I'm working on a workflow that needs to pause for a few minutes and then resume. My problem is that it never resumes after the pause. This is the workflow I'm testing it on.
Log start to the workflow history list
Pause for 0 days 0 hours 5 minutes
Log stop to the workflow history list
Stop the workflow and log completed
It never logs *stop*.
If I remove the pause the workflow works correctly.
I've read about a hotfix that has to do with timer in sharepoint http://www.microsoft.com/en-us/download/details.aspx?id=21066 . But I wasn't able to install it so I think it doesn't apply to my version of SPD.
Any ideas? | 2 |
10,847,934 | 06/01/2012 09:41:14 | 1,428,275 | 05/31/2012 11:32:19 | 6 | 0 | Shortcut key to modify stored procedure in ssms | In SQL Server Management Studio,
Object Explorer Details where Stored Procedure Listing shows,
I want here to press a shortcut key on any stored procedure to open its modify window. | sql-server-2008 | null | null | null | null | 06/02/2012 16:23:54 | not a real question | Shortcut key to modify stored procedure in ssms
===
In SQL Server Management Studio,
Object Explorer Details where Stored Procedure Listing shows,
I want here to press a shortcut key on any stored procedure to open its modify window. | 1 |
4,766,939 | 01/22/2011 08:46:06 | 478,205 | 10/16/2010 22:40:06 | 9 | 0 | best HTML5 book | What is the best and most comprehensive HTML5 book? Is it necessary to study HTML4 after/before the HTML5 book?
If there is no goo HTML5 book yet, what is the best HTML book in general? | html | html5 | xhtml | null | null | 11/22/2011 14:31:24 | not constructive | best HTML5 book
===
What is the best and most comprehensive HTML5 book? Is it necessary to study HTML4 after/before the HTML5 book?
If there is no goo HTML5 book yet, what is the best HTML book in general? | 4 |
11,251,851 | 06/28/2012 19:48:47 | 63,761 | 02/07/2009 22:37:28 | 4,418 | 69 | How do you index attachment in Elasticsearch with Tire? | Having difficulty indexing an attachment type in **elasticsearch** via the **Tire** gem. Not able to set attachment `type` correctly.
I've taken [ActiveModel Integration example][1] referenced from the Tire gem and added a field, `filename`, to reference name of PDFs on local filesystem that I want to index with the record.
#app/models/article.rb
class Article < ActiveRecord::Base
include Tire::Model::Search
include Tire::Model::Callbacks
attr_accessible :title, :content, :published_on, :filename
mapping do
indexes :id, :type =>'integer'
indexes :title
indexes :content
indexes :published_on, :type => 'date'
indexes :attachment, :type => 'attachment'
end
def to_indexed_json
to_json(:methods => [:attachment])
end
def attachment
if filename.present?
path_to_pdf = "/Volumes/Disk41402/test_proj/sample_pdfs/#{filename}.pdf"
Base64.encode64(open(path_to_pdf) { |pdf| pdf.read })
end
end
end
FWIW - the PDFs appear to have been added to the index:
$ curl -XGET 'http://localhost:9200/articles/_all/2?pretty=true'
{
"_index" : "articles",
"_type" : "article",
"_id" : "2",
"_version" : 1,
"exists" : true, "_source" : {"content":"Consectetur adipisicing elit, sed do eiusmod tempor incididunt. working?","created_at":"2012-06-21T17:19:03Z","filename":"sample2","id":2,"published_on":"2012-06-20","title":"Two","updated_at":"2012-06-28T00:00:59Z","attachment":"JVBERi0xLjMKJcTl8uXrp/Og0MTGCjQgMCBvYmoKPDwgL0xlbmd0aCA1IDAg\nUiAvRmlsdG... ... ...4+CnN0YXJ0eHJlZgo4\nNTAzCiUVPRgo=\n"
}
}
But the attachment type is still `"type" : "string"` when it should be `"type" : "attachment"`
$ curl -XGET 'http://localhost:9200/articles/_mapping?pretty=true'
{
"articles" : {
"article" : {
"properties" : {
"attachment" : {
"type" : "string"
},
"content" : {
"type" : "string"
},
"created_at" : {
"type" : "date",
"format" : "dateOptionalTime"
},
"filename" : {
"type" : "string"
},
"id" : {
"type" : "long"
},
"published_on" : {
"type" : "date",
"format" : "dateOptionalTime"
},
"title" : {
"type" : "string"
},
"updated_at" : {
"type" : "date",
"format" : "dateOptionalTime"
}
}
}
}
}
I've tried rebuilding the index `rake environment tire:import CLASS=Article FORCE=true` but type remains a string. Anyone see where I'm messing up?
[1]: https://github.com/karmi/tire#activemodel-integration | ruby-on-rails | attachment | elasticsearch | tire | null | null | open | How do you index attachment in Elasticsearch with Tire?
===
Having difficulty indexing an attachment type in **elasticsearch** via the **Tire** gem. Not able to set attachment `type` correctly.
I've taken [ActiveModel Integration example][1] referenced from the Tire gem and added a field, `filename`, to reference name of PDFs on local filesystem that I want to index with the record.
#app/models/article.rb
class Article < ActiveRecord::Base
include Tire::Model::Search
include Tire::Model::Callbacks
attr_accessible :title, :content, :published_on, :filename
mapping do
indexes :id, :type =>'integer'
indexes :title
indexes :content
indexes :published_on, :type => 'date'
indexes :attachment, :type => 'attachment'
end
def to_indexed_json
to_json(:methods => [:attachment])
end
def attachment
if filename.present?
path_to_pdf = "/Volumes/Disk41402/test_proj/sample_pdfs/#{filename}.pdf"
Base64.encode64(open(path_to_pdf) { |pdf| pdf.read })
end
end
end
FWIW - the PDFs appear to have been added to the index:
$ curl -XGET 'http://localhost:9200/articles/_all/2?pretty=true'
{
"_index" : "articles",
"_type" : "article",
"_id" : "2",
"_version" : 1,
"exists" : true, "_source" : {"content":"Consectetur adipisicing elit, sed do eiusmod tempor incididunt. working?","created_at":"2012-06-21T17:19:03Z","filename":"sample2","id":2,"published_on":"2012-06-20","title":"Two","updated_at":"2012-06-28T00:00:59Z","attachment":"JVBERi0xLjMKJcTl8uXrp/Og0MTGCjQgMCBvYmoKPDwgL0xlbmd0aCA1IDAg\nUiAvRmlsdG... ... ...4+CnN0YXJ0eHJlZgo4\nNTAzCiUVPRgo=\n"
}
}
But the attachment type is still `"type" : "string"` when it should be `"type" : "attachment"`
$ curl -XGET 'http://localhost:9200/articles/_mapping?pretty=true'
{
"articles" : {
"article" : {
"properties" : {
"attachment" : {
"type" : "string"
},
"content" : {
"type" : "string"
},
"created_at" : {
"type" : "date",
"format" : "dateOptionalTime"
},
"filename" : {
"type" : "string"
},
"id" : {
"type" : "long"
},
"published_on" : {
"type" : "date",
"format" : "dateOptionalTime"
},
"title" : {
"type" : "string"
},
"updated_at" : {
"type" : "date",
"format" : "dateOptionalTime"
}
}
}
}
}
I've tried rebuilding the index `rake environment tire:import CLASS=Article FORCE=true` but type remains a string. Anyone see where I'm messing up?
[1]: https://github.com/karmi/tire#activemodel-integration | 0 |
11,553,526 | 07/19/2012 03:31:46 | 1,536,663 | 07/19/2012 03:26:36 | 1 | 0 | kinect code for the software "processing", to control a puppet using face recognition | Can anyone please help me with kinect source code for the software called "processing", to replace the human face with a puppet and use facial gestures to control it using "Processing" not with Kinect SDK 1.5 | java | processing | kinect | face-recognition | null | 08/01/2012 00:50:31 | not a real question | kinect code for the software "processing", to control a puppet using face recognition
===
Can anyone please help me with kinect source code for the software called "processing", to replace the human face with a puppet and use facial gestures to control it using "Processing" not with Kinect SDK 1.5 | 1 |
286,624 | 11/13/2008 09:28:54 | 35,033 | 11/06/2008 11:17:48 | 11 | 1 | Best Collection To Use? | I am reading log files but not all lines want to be processed straight away. I am using a queue / buffer to store the lines while they wait to be processed.
This queue is regularly scanned for particular lines - when they are found, they are removed from the queue (they can be anywhere in it). When there isn't a particular line to be found, lines are taken out of the start of the queue one by one to be processed.
Therefore, the queue needs the following:
- Able to be resized (or give that impression)
- Have elements removed from anywhere
- Have elements added (will always be at the end of the queue)
- Be scanned quickly
- Depending on performance, have a pointer of where it got to on the last scan.
I initially wrote the code when I had little experience of Java or the API, and just used an ArrayList because I knew it would work (not necessarily because it was the best option).
Its performance is now becoming poor with more and more logs needing to be processed - so, what collection would you recommend to be used in this situation? There's always the possibility of writing my own too.
Thanks | java | collections | queue | buffer | performance | 09/14/2011 15:21:23 | not constructive | Best Collection To Use?
===
I am reading log files but not all lines want to be processed straight away. I am using a queue / buffer to store the lines while they wait to be processed.
This queue is regularly scanned for particular lines - when they are found, they are removed from the queue (they can be anywhere in it). When there isn't a particular line to be found, lines are taken out of the start of the queue one by one to be processed.
Therefore, the queue needs the following:
- Able to be resized (or give that impression)
- Have elements removed from anywhere
- Have elements added (will always be at the end of the queue)
- Be scanned quickly
- Depending on performance, have a pointer of where it got to on the last scan.
I initially wrote the code when I had little experience of Java or the API, and just used an ArrayList because I knew it would work (not necessarily because it was the best option).
Its performance is now becoming poor with more and more logs needing to be processed - so, what collection would you recommend to be used in this situation? There's always the possibility of writing my own too.
Thanks | 4 |
8,025,190 | 11/06/2011 04:15:43 | 719,127 | 04/21/2011 14:37:21 | 581 | 5 | Tips for iOS5 Development | iOS 5's storyboard is awesome but I've read that it would be better to not use it unless the app market audience is only iOS 5 users.
Have you other tips for the iOS 5 features? My app is targeted to iOS4/iOS5 market audience, should I continue to use only XIB files for the view design? And should I continue to use the third party JSON Framework instead the new built in JSON? | iphone | objective-c | cocoa-touch | json | ios5 | 11/06/2011 04:31:32 | not constructive | Tips for iOS5 Development
===
iOS 5's storyboard is awesome but I've read that it would be better to not use it unless the app market audience is only iOS 5 users.
Have you other tips for the iOS 5 features? My app is targeted to iOS4/iOS5 market audience, should I continue to use only XIB files for the view design? And should I continue to use the third party JSON Framework instead the new built in JSON? | 4 |
3,965,117 | 10/19/2010 03:22:54 | 48,067 | 12/20/2008 23:47:47 | 545 | 17 | multiple joins in rails | I am building a recipe app where a user can view recipes, list ingredients, get a shopping list, etc. etc.
Each Recipe is made of steps, each step has ingredients, and each ingredient has a grocery.
I was quite sure that the way to create these links was through the models, so my models look like this
<pre>
class Recipe < ActiveRecord::Base
has_many :steps, :dependent => :destroy
has_many :ingredients, :through => :steps
has_many :groceries, :through => :ingredients
end
class Step < ActiveRecord::Base
belongs_to :recipe
has_many :ingredients, :dependent => :destroy
has_many :groceries, :through => :ingredients
accepts_nested_attributes_for :ingredients
end
class Ingredient < ActiveRecord::Base
belongs_to :step
belongs_to :recipe
has_one :grocery
end
class Grocery < ActiveRecord::Base
has_and_belongs_to_many :ingredients
has_and_belongs_to_many :steps, :through => :ingredients
has_and_belongs_to_many :recipes, :through => :ingredients
end
</pre>
I can output debug @recipe.steps, @recipe.ingredients, but @recipe.groceries returns
<pre>
uninitialized constant Recipe::Grocery
</pre>
I think this is an issue with the joins, but I don't see why I should need to specify the join in the controller.
The controller is simply
<pre>
def show
@recipe = Recipe.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @recipe }
end
end
</pre>
Am i looking for my error in the right place? or am I misinterpreting the error?? | ruby-on-rails | join | null | null | null | null | open | multiple joins in rails
===
I am building a recipe app where a user can view recipes, list ingredients, get a shopping list, etc. etc.
Each Recipe is made of steps, each step has ingredients, and each ingredient has a grocery.
I was quite sure that the way to create these links was through the models, so my models look like this
<pre>
class Recipe < ActiveRecord::Base
has_many :steps, :dependent => :destroy
has_many :ingredients, :through => :steps
has_many :groceries, :through => :ingredients
end
class Step < ActiveRecord::Base
belongs_to :recipe
has_many :ingredients, :dependent => :destroy
has_many :groceries, :through => :ingredients
accepts_nested_attributes_for :ingredients
end
class Ingredient < ActiveRecord::Base
belongs_to :step
belongs_to :recipe
has_one :grocery
end
class Grocery < ActiveRecord::Base
has_and_belongs_to_many :ingredients
has_and_belongs_to_many :steps, :through => :ingredients
has_and_belongs_to_many :recipes, :through => :ingredients
end
</pre>
I can output debug @recipe.steps, @recipe.ingredients, but @recipe.groceries returns
<pre>
uninitialized constant Recipe::Grocery
</pre>
I think this is an issue with the joins, but I don't see why I should need to specify the join in the controller.
The controller is simply
<pre>
def show
@recipe = Recipe.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @recipe }
end
end
</pre>
Am i looking for my error in the right place? or am I misinterpreting the error?? | 0 |
10,187,186 | 04/17/2012 07:46:23 | 435,019 | 08/30/2010 13:54:00 | 401 | 22 | javascript sort of HTML elements in-place | in continuation for [javascript sort of HTML elements][1]
I want to sort elements in different `<ol>`( eventually in `<div>`)
the sort should preferably be in-place and not to `unwrap()`,`sort()` and `wrap`
HTML
<ol class="table" style="display: block; ">
<li class="menu__run">I</li>
<li class="menu__run">IXX</li>
<li class="menu__run">I</li>
<li class="menu__run">I</li>
<li class="menu__run">I</li>
<li class="menu__run">I</li>
<li class="menu__run">I</li>
</ol>
<ol class="table">
<li class="menu__run">I</li>
<li class="menu__run">IXX</li>
<li class="menu__run">I</li>
<li class="menu__run">I</li>
<li class="menu__run">I</li>
<li class="menu__run">I</li>
<li class="menu__run">I</li>
<li class="menu__test">st</li>
<li class="menu__test">st</li>
<li class="menu__test">st</li>
</ol>
javascript
var sort_by_name = function(a, b) {
return a.innerHTML.toLowerCase().localeCompare(b.innerHTML.toLowerCase());
}
var list = $(".table > li").get();
list.sort(sort_by_name);
for (var i = 0; i < list.length; i++) {
list[i].parentNode.appendChild(list[i]);
}
[http://jsfiddle.net/yqd3w/7/][2]
[1]: http://stackoverflow.com/questions/10186192/javascript-sort-of-html-elements
[2]: http://jsfiddle.net/yqd3w/7/ | javascript | jquery | sorting | null | null | 04/17/2012 09:50:05 | not a real question | javascript sort of HTML elements in-place
===
in continuation for [javascript sort of HTML elements][1]
I want to sort elements in different `<ol>`( eventually in `<div>`)
the sort should preferably be in-place and not to `unwrap()`,`sort()` and `wrap`
HTML
<ol class="table" style="display: block; ">
<li class="menu__run">I</li>
<li class="menu__run">IXX</li>
<li class="menu__run">I</li>
<li class="menu__run">I</li>
<li class="menu__run">I</li>
<li class="menu__run">I</li>
<li class="menu__run">I</li>
</ol>
<ol class="table">
<li class="menu__run">I</li>
<li class="menu__run">IXX</li>
<li class="menu__run">I</li>
<li class="menu__run">I</li>
<li class="menu__run">I</li>
<li class="menu__run">I</li>
<li class="menu__run">I</li>
<li class="menu__test">st</li>
<li class="menu__test">st</li>
<li class="menu__test">st</li>
</ol>
javascript
var sort_by_name = function(a, b) {
return a.innerHTML.toLowerCase().localeCompare(b.innerHTML.toLowerCase());
}
var list = $(".table > li").get();
list.sort(sort_by_name);
for (var i = 0; i < list.length; i++) {
list[i].parentNode.appendChild(list[i]);
}
[http://jsfiddle.net/yqd3w/7/][2]
[1]: http://stackoverflow.com/questions/10186192/javascript-sort-of-html-elements
[2]: http://jsfiddle.net/yqd3w/7/ | 1 |
4,868,625 | 02/01/2011 22:19:36 | 378,049 | 06/28/2010 13:08:49 | 229 | 2 | mysql_real_escape_string and Access denied for user 'ODBC'@'localhost' | I understand I need to connect to the db in order for mysql_real_escape_string to work, but not quite sure how.
I use this function to insert rows in tables.
function insert_db($conn, $table_name, $array){
//$array = array_map( 'mysql_real_escape_string' , $db ); //ERROR!
# Create the SQL Query
$query = 'INSERT INTO `'.$table_name.'` '.
'( `'.implode( '` , `' , array_keys( $array ) ).'` ) '.
'VALUES '.
'( "'.implode( '" , "' , $array ).'" )';
$result = $conn->query($query);
if (!$result){ trigger_error("mysql error: ".mysql_errno($result) . ": " . mysql_error($result)); }
}
It takes an array like this for example:
$db["to"] = $to;
$db["from"] = $username;
$db["message"] = $message;
$db["time"] = date("Y-m-d H:i:s", strtotime("+0 minutes"));
insert_db($conn, "inbox", $db)
where the array keys represent columns in a table.
But I get this error:
2011-02-01 22:21:29 : mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'ODBC'@'localhost' (using password: NO) | php | mysql | error | error-message | mysql-real-escape-string | null | open | mysql_real_escape_string and Access denied for user 'ODBC'@'localhost'
===
I understand I need to connect to the db in order for mysql_real_escape_string to work, but not quite sure how.
I use this function to insert rows in tables.
function insert_db($conn, $table_name, $array){
//$array = array_map( 'mysql_real_escape_string' , $db ); //ERROR!
# Create the SQL Query
$query = 'INSERT INTO `'.$table_name.'` '.
'( `'.implode( '` , `' , array_keys( $array ) ).'` ) '.
'VALUES '.
'( "'.implode( '" , "' , $array ).'" )';
$result = $conn->query($query);
if (!$result){ trigger_error("mysql error: ".mysql_errno($result) . ": " . mysql_error($result)); }
}
It takes an array like this for example:
$db["to"] = $to;
$db["from"] = $username;
$db["message"] = $message;
$db["time"] = date("Y-m-d H:i:s", strtotime("+0 minutes"));
insert_db($conn, "inbox", $db)
where the array keys represent columns in a table.
But I get this error:
2011-02-01 22:21:29 : mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'ODBC'@'localhost' (using password: NO) | 0 |
7,274,556 | 09/01/2011 18:09:44 | 678,189 | 03/26/2011 16:34:11 | 38 | 5 | Android OpenGL. Drawing textures and triangle-fan circles | I'm drawing two texturized squares (4 vertex each). Then I draw a circle using GL_TRIANGLE_FAN but it isn't being drawn.
When I draw the circles without the squares, it is drawn correctly.
Any ideas where could be the problem?
Please, ask for more information. Thanks | android | opengl-es | null | null | null | null | open | Android OpenGL. Drawing textures and triangle-fan circles
===
I'm drawing two texturized squares (4 vertex each). Then I draw a circle using GL_TRIANGLE_FAN but it isn't being drawn.
When I draw the circles without the squares, it is drawn correctly.
Any ideas where could be the problem?
Please, ask for more information. Thanks | 0 |
9,691,957 | 03/13/2012 20:52:28 | 1,145,985 | 01/12/2012 16:46:22 | 13 | 0 | Powerpoint VSTO Ribbon Buttons Synced | I have VSTO I've written for powerpoint 2010, I have it now functioning so that the task panes function interdependently of each other which is what I want, thanks SliverNinja for that one!
My new problem is if I have 2 Presentations open, Called them "Presentation 1" and "Presentation 2" I can now open up my task panes via a toggle button to show/hide the task pane but my problem now is if I have the task pane shown in "Presentation 2" but not one(task pane) in "Presentation 1" both buttons appear to be toggled. If I un-toggle the one on "Presentation 2" then they both become undone. So It is acting as if they are synced together.
I need some help with how to make these two buttons function as their own click events. So that they may have their own check states. I don't want to make the whole ribbon un-synced just the two buttons I have. | c# | vsto | powerpoint | null | null | null | open | Powerpoint VSTO Ribbon Buttons Synced
===
I have VSTO I've written for powerpoint 2010, I have it now functioning so that the task panes function interdependently of each other which is what I want, thanks SliverNinja for that one!
My new problem is if I have 2 Presentations open, Called them "Presentation 1" and "Presentation 2" I can now open up my task panes via a toggle button to show/hide the task pane but my problem now is if I have the task pane shown in "Presentation 2" but not one(task pane) in "Presentation 1" both buttons appear to be toggled. If I un-toggle the one on "Presentation 2" then they both become undone. So It is acting as if they are synced together.
I need some help with how to make these two buttons function as their own click events. So that they may have their own check states. I don't want to make the whole ribbon un-synced just the two buttons I have. | 0 |
10,994,298 | 06/12/2012 09:57:59 | 560,092 | 01/02/2011 02:00:04 | 543 | 20 | What is the maximum possible fling velocity in Android? | I'm trying to modify a fling velocity in mid-fling, and think that I need a max fling velocity in order to make the calculation, something like:
`v=v^2/max`
which seems to me would curve the velocity exponentially, so that v=max is unchanged. Is this possible, or is there some better way to limit velocity sensitivity besides just linearly?
| android | onfling | null | null | null | 06/12/2012 16:03:26 | not a real question | What is the maximum possible fling velocity in Android?
===
I'm trying to modify a fling velocity in mid-fling, and think that I need a max fling velocity in order to make the calculation, something like:
`v=v^2/max`
which seems to me would curve the velocity exponentially, so that v=max is unchanged. Is this possible, or is there some better way to limit velocity sensitivity besides just linearly?
| 1 |
7,357,643 | 09/09/2011 05:53:10 | 932,501 | 09/07/2011 10:32:33 | 3 | 0 | Google Analytics SDK for Android Code Implementation | Good day
I have manage to create my small and simple application, work with screens and layouts but I cannot make work the Google analytics.
I think my problems are regarding the code placement, please take a look and tell me where I am wrong.
First I have add and build the path for libGoogleAnalytics.jar
at manifest,
</activity>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" ></uses-permission>
</application>
</manifest>
at package,
package com.av0001;
import com.google.android.apps.analytics.GoogleAnalyticsTracker;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
public class Av0001 extends Activity {
/** Called when the activity is first created. */
GoogleAnalyticsTracker tracker;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
tracker = GoogleAnalyticsTracker.getInstance();
tracker.startNewSession("UA-25516864-1", this);
setContentView(R.layout.main);
}
public void myonclick1(View view) {
Intent mIntent = new Intent(this,Check2.class);
startActivity(mIntent);
Toast.makeText(
this,
"Thank you for using, enjoy browsing :)", Toast.LENGTH_LONG).show();
finish();
}
@Override
protected void onDestroy() {
super.onDestroy();
tracker.stopSession();
}
}
So I am stack here, it's running for three days almost,I have no reports at all.
Thanks for support | android | null | null | null | null | null | open | Google Analytics SDK for Android Code Implementation
===
Good day
I have manage to create my small and simple application, work with screens and layouts but I cannot make work the Google analytics.
I think my problems are regarding the code placement, please take a look and tell me where I am wrong.
First I have add and build the path for libGoogleAnalytics.jar
at manifest,
</activity>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" ></uses-permission>
</application>
</manifest>
at package,
package com.av0001;
import com.google.android.apps.analytics.GoogleAnalyticsTracker;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
public class Av0001 extends Activity {
/** Called when the activity is first created. */
GoogleAnalyticsTracker tracker;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
tracker = GoogleAnalyticsTracker.getInstance();
tracker.startNewSession("UA-25516864-1", this);
setContentView(R.layout.main);
}
public void myonclick1(View view) {
Intent mIntent = new Intent(this,Check2.class);
startActivity(mIntent);
Toast.makeText(
this,
"Thank you for using, enjoy browsing :)", Toast.LENGTH_LONG).show();
finish();
}
@Override
protected void onDestroy() {
super.onDestroy();
tracker.stopSession();
}
}
So I am stack here, it's running for three days almost,I have no reports at all.
Thanks for support | 0 |
11,659,767 | 07/25/2012 22:42:41 | 1,080,320 | 12/04/2011 17:47:40 | 64 | 0 | Designing simple attendance dashboard | I am in the process of designing a simple dashboard to get the employees attendance IN Time. I am firing a simple query to get their in time. However, I would like to represent the timing in an interactive way.
My knowledge is that I know how to get the values from the query and fetch the values using java. However, I want to display the data in an interactive way using jquery or javascript and I need your help in that.
Can anyone help and provide some ideas for displaying. I am restricted because the requirement is to display one column and I need something interactive.
How to do that?
Thanks | java | javascript | jquery | null | null | 07/26/2012 00:16:48 | not a real question | Designing simple attendance dashboard
===
I am in the process of designing a simple dashboard to get the employees attendance IN Time. I am firing a simple query to get their in time. However, I would like to represent the timing in an interactive way.
My knowledge is that I know how to get the values from the query and fetch the values using java. However, I want to display the data in an interactive way using jquery or javascript and I need your help in that.
Can anyone help and provide some ideas for displaying. I am restricted because the requirement is to display one column and I need something interactive.
How to do that?
Thanks | 1 |
4,464,752 | 12/16/2010 19:48:05 | 341,536 | 05/14/2010 18:50:33 | 1 | 0 | What is the best linux mail solution for a dedicated phplist installation? | I am setting up phplist for a client on my dedicated server. I am going to install a dedicated mail solution on a dedicated IP address for his mailing list. He has an estimated 5,000 subscribers interested in his newsletter right now. The goal is to send out about that many emails per night.
The current obvious choices are qmail and postfix. Can I get some pros and cons to both? Are there any better solutions? | linux | postfix | qmail | phplist | null | 07/09/2012 18:56:26 | not constructive | What is the best linux mail solution for a dedicated phplist installation?
===
I am setting up phplist for a client on my dedicated server. I am going to install a dedicated mail solution on a dedicated IP address for his mailing list. He has an estimated 5,000 subscribers interested in his newsletter right now. The goal is to send out about that many emails per night.
The current obvious choices are qmail and postfix. Can I get some pros and cons to both? Are there any better solutions? | 4 |
4,931,011 | 02/08/2011 08:38:19 | 236,106 | 12/21/2009 15:10:27 | 673 | 15 | prblem with recursion in javascript graph exloring alogorithm. | >
explored=[]
//class definition
function graph(){
this.graph=new Array();
this .graph[0] = [1,0,1,1,0,1]
this .graph[1] = [0,1,1,1,0,0]
this .graph[2] = [1,1,1,1,0,0]
this .graph[3] = [1,1,1,1,1,0]
this .graph[4] = [0,0,0,1,1,0]
this .graph[5] = [1,0,0,0,0,0]
this.explore = explore
}
function explore(node,depth){
explored[node]=1
document.write('<br>')
for(x=0;x<depth;x++)
document.write('-')
document.write(node+'<br>')
neighbours=this.graph[node]
document.write('exploring '+node +' neighbours' + neighbours +'explored = '+explored)
for ( i=0;i<neighbours.length;i++){
document.write('checking'+i+' node is ='+node )
if(neighbours[i] ==1 && explored[i]!=1)
this.explore(i,++depth)
}
}
g = new graph()
g.explore(0,0)
i am trying to explore a graph here , i am not sure what is wrong with the explore function , the recursion doesn't seem to be working correctly , while exploring the neighbours of the node 0 it explored 0,1,2 and then never returns back to explore 3 4 5 why is that so ? | javascript | algorithm | graph | null | null | null | open | prblem with recursion in javascript graph exloring alogorithm.
===
>
explored=[]
//class definition
function graph(){
this.graph=new Array();
this .graph[0] = [1,0,1,1,0,1]
this .graph[1] = [0,1,1,1,0,0]
this .graph[2] = [1,1,1,1,0,0]
this .graph[3] = [1,1,1,1,1,0]
this .graph[4] = [0,0,0,1,1,0]
this .graph[5] = [1,0,0,0,0,0]
this.explore = explore
}
function explore(node,depth){
explored[node]=1
document.write('<br>')
for(x=0;x<depth;x++)
document.write('-')
document.write(node+'<br>')
neighbours=this.graph[node]
document.write('exploring '+node +' neighbours' + neighbours +'explored = '+explored)
for ( i=0;i<neighbours.length;i++){
document.write('checking'+i+' node is ='+node )
if(neighbours[i] ==1 && explored[i]!=1)
this.explore(i,++depth)
}
}
g = new graph()
g.explore(0,0)
i am trying to explore a graph here , i am not sure what is wrong with the explore function , the recursion doesn't seem to be working correctly , while exploring the neighbours of the node 0 it explored 0,1,2 and then never returns back to explore 3 4 5 why is that so ? | 0 |
2,312,358 | 02/22/2010 16:31:14 | 120,391 | 06/10/2009 08:27:34 | 47 | 5 | Identifying microsoft office temporary files | I'm watching a directory using `FileSystemWatcher`.
When a file is copied into that directory - my watcher grabs it and performs multiple actions with it.
My problem is that when a microsoft-office file is opened, a temporary file is created in the watched directory. I can't find a way to ignore these files.
Though the temporary file name is well known (i.e. abcd.docx --> ~$cd.docx), I need a better way than this to identify that file.
Any ideas? | temporary-files | microsoft-office | filesystemwatcher | null | null | null | open | Identifying microsoft office temporary files
===
I'm watching a directory using `FileSystemWatcher`.
When a file is copied into that directory - my watcher grabs it and performs multiple actions with it.
My problem is that when a microsoft-office file is opened, a temporary file is created in the watched directory. I can't find a way to ignore these files.
Though the temporary file name is well known (i.e. abcd.docx --> ~$cd.docx), I need a better way than this to identify that file.
Any ideas? | 0 |
8,585,118 | 12/21/2011 04:34:49 | 419,012 | 08/12/2010 23:20:59 | 30 | 1 | Should I not use CakePHP or MVC for this app? | Alright so I have been working for a company for the past several months as a kind of general developer/IT guy. I wrote a web app for the company that is hosted locally. I used CakePHP and MySQL (because the application fit the Active Record scheme really well).
The new web app I am working in is going to be used to analyze monthly sales data. Essentially, we get a humongous dump of information every month that I need to analyze...
----
Every month we get a huge table of data that has every one of our clients info (their ID#, how many $$ they processed, how much we made off them, etc.). Call this RESIDUAL
We also get another table that basically has their ID, a "description" (basically the type of expense), and a value. Call this INTERCHANGE
I have a permanent table called REPS that has each Sales Rep ID, their name, etc.
-----
In order to get useful information (like the client name), I monthly delete and reupload another table that has info like their Name, State, Status (if they are active or closed), etc.
I decided to make a residuals table that records the month as a column and I just add to it each month.
-----
My problem is that working with CakePHP is getting pretty difficult. Say I want to get a table that has columns for each month and rows for each Sales Rep. It starts to get really complicated because this is NOT an _Active Record_ application and I am having to do all sorts of long complicated find statements.
Would you recommend changing to a different framework, language, or database? What changes in Database structure should I make? My Controller is INSANELY long, should I shift more work to the Models?
Any ideas?
-----
_Edit_: I need to create a system where my not-as-technical boss can easily run whatever sorts of analyses she wants. | php | mysql | cakephp | web | null | 12/22/2011 14:23:03 | not a real question | Should I not use CakePHP or MVC for this app?
===
Alright so I have been working for a company for the past several months as a kind of general developer/IT guy. I wrote a web app for the company that is hosted locally. I used CakePHP and MySQL (because the application fit the Active Record scheme really well).
The new web app I am working in is going to be used to analyze monthly sales data. Essentially, we get a humongous dump of information every month that I need to analyze...
----
Every month we get a huge table of data that has every one of our clients info (their ID#, how many $$ they processed, how much we made off them, etc.). Call this RESIDUAL
We also get another table that basically has their ID, a "description" (basically the type of expense), and a value. Call this INTERCHANGE
I have a permanent table called REPS that has each Sales Rep ID, their name, etc.
-----
In order to get useful information (like the client name), I monthly delete and reupload another table that has info like their Name, State, Status (if they are active or closed), etc.
I decided to make a residuals table that records the month as a column and I just add to it each month.
-----
My problem is that working with CakePHP is getting pretty difficult. Say I want to get a table that has columns for each month and rows for each Sales Rep. It starts to get really complicated because this is NOT an _Active Record_ application and I am having to do all sorts of long complicated find statements.
Would you recommend changing to a different framework, language, or database? What changes in Database structure should I make? My Controller is INSANELY long, should I shift more work to the Models?
Any ideas?
-----
_Edit_: I need to create a system where my not-as-technical boss can easily run whatever sorts of analyses she wants. | 1 |
7,324,172 | 09/06/2011 18:04:12 | 931,281 | 09/06/2011 18:04:12 | 1 | 0 | Passenger load balancing for rails app | I'm using passenger (3.0.8), and nginx (1.0.5) to serve a rails app (2.3.12) running on ruby (ree-1.8.7-2011.03) on top of Ubuntu 10.04 (64 bit).
The site gets a decent amount of traffic, and I had previously been using apache + mongrel with about 30 instances in the mongrel cluster. After switching to nginx + passenger, it seems to load balance strangely, and has never fired up more than the minimum number of instances (5).
After hitting the site with 4 slow running requests simultaneously, I was not able to load the main page until after the other requests finished. I would have expected to see passenger spawn additional instances (or at least serve a request on the 5th instance). What is going on?
root:~# passenger-status
----------- General information -----------
max = 50
count = 5
active = 0
inactive = 5
Waiting on global queue: 0
----------- Application groups -----------
/home/user/apps/production/current:
App root: /home/user/apps/production/current
* PID: 10414 Sessions: 0 Processed: 1070 Uptime: 49m 3s
* PID: 10404 Sessions: 0 Processed: 1196 Uptime: 49m 6s
* PID: 10410 Sessions: 0 Processed: 513 Uptime: 49m 3s
* PID: 10408 Sessions: 0 Processed: 194 Uptime: 49m 3s
* PID: 10412 Sessions: 0 Processed: 0 Uptime: 49m 3s
Nginx config:
#user www-data;
worker_processes 1;
events {
worker_connections 1024;
}
http {
passenger_root /usr/local/rvm/gems/ree-1.8.7-2011.03/gems/passenger-3.0.8;
passenger_ruby /usr/local/rvm/wrappers/ree-1.8.7-2011.03/ruby;
passenger_max_pool_size 50;
passenger_min_instances 5;
passenger_pool_idle_time 300;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
proxy_redirect off;
server {
listen 443;
server_name site.com;
access_log logs/site.com.log;
ssl on;
ssl_certificate /etc/ssl/certs/site.com.chained.crt;
ssl_certificate_key /etc/ssl/certs/site.com.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
ssl_prefer_server_ciphers on;
rails_env production;
passenger_enabled on;
passenger_use_global_queue on;
root /home/user/apps/production/current/public;
error_page 500 502 503 504 /500.html;
error_page 404 /404.html;
error_page 422 /422.html;
}
} | ruby-on-rails | ruby | nginx | passenger | null | 09/08/2011 02:07:26 | off topic | Passenger load balancing for rails app
===
I'm using passenger (3.0.8), and nginx (1.0.5) to serve a rails app (2.3.12) running on ruby (ree-1.8.7-2011.03) on top of Ubuntu 10.04 (64 bit).
The site gets a decent amount of traffic, and I had previously been using apache + mongrel with about 30 instances in the mongrel cluster. After switching to nginx + passenger, it seems to load balance strangely, and has never fired up more than the minimum number of instances (5).
After hitting the site with 4 slow running requests simultaneously, I was not able to load the main page until after the other requests finished. I would have expected to see passenger spawn additional instances (or at least serve a request on the 5th instance). What is going on?
root:~# passenger-status
----------- General information -----------
max = 50
count = 5
active = 0
inactive = 5
Waiting on global queue: 0
----------- Application groups -----------
/home/user/apps/production/current:
App root: /home/user/apps/production/current
* PID: 10414 Sessions: 0 Processed: 1070 Uptime: 49m 3s
* PID: 10404 Sessions: 0 Processed: 1196 Uptime: 49m 6s
* PID: 10410 Sessions: 0 Processed: 513 Uptime: 49m 3s
* PID: 10408 Sessions: 0 Processed: 194 Uptime: 49m 3s
* PID: 10412 Sessions: 0 Processed: 0 Uptime: 49m 3s
Nginx config:
#user www-data;
worker_processes 1;
events {
worker_connections 1024;
}
http {
passenger_root /usr/local/rvm/gems/ree-1.8.7-2011.03/gems/passenger-3.0.8;
passenger_ruby /usr/local/rvm/wrappers/ree-1.8.7-2011.03/ruby;
passenger_max_pool_size 50;
passenger_min_instances 5;
passenger_pool_idle_time 300;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
proxy_redirect off;
server {
listen 443;
server_name site.com;
access_log logs/site.com.log;
ssl on;
ssl_certificate /etc/ssl/certs/site.com.chained.crt;
ssl_certificate_key /etc/ssl/certs/site.com.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
ssl_prefer_server_ciphers on;
rails_env production;
passenger_enabled on;
passenger_use_global_queue on;
root /home/user/apps/production/current/public;
error_page 500 502 503 504 /500.html;
error_page 404 /404.html;
error_page 422 /422.html;
}
} | 2 |
9,181,126 | 02/07/2012 17:45:05 | 624,976 | 02/20/2011 04:16:27 | 81 | 7 | Adding new permissions to our Facebook canvas app. doesn't always prompt end user to accept them on next app. load | Rails 3.0.7
Omniauth git://github.com/intridea/omniauth.git' (0-3-stable branch)
We have an app. that uses OmniAuth to handle Facebook authorization.
We've recently added some new permissions to this app. (e.g. "friends_photos") (in our omniauth initializer) and occasionally we don't see that the end user is being prompted to add these permissions the next time that they access the app.
Has anyone seen this behavior before?
Thanks,
Wes | facebook-graph-api | omniauth | null | null | null | null | open | Adding new permissions to our Facebook canvas app. doesn't always prompt end user to accept them on next app. load
===
Rails 3.0.7
Omniauth git://github.com/intridea/omniauth.git' (0-3-stable branch)
We have an app. that uses OmniAuth to handle Facebook authorization.
We've recently added some new permissions to this app. (e.g. "friends_photos") (in our omniauth initializer) and occasionally we don't see that the end user is being prompted to add these permissions the next time that they access the app.
Has anyone seen this behavior before?
Thanks,
Wes | 0 |
10,090,612 | 04/10/2012 14:25:32 | 1,237,504 | 02/28/2012 09:18:38 | 1 | 0 | mysql workbench records limit | I perform an SQL query on a database with MySQL and I get back only the first 1000 rows from 24000 expected. If i export the results to an XML form, I get the first 1000 again.
Is there a way to disable that limit and get back all the rows?
Otherwise, I will have to merge 24 XML files :/ | mysql | sql | xml | mysql-workbench | null | 04/11/2012 14:33:15 | off topic | mysql workbench records limit
===
I perform an SQL query on a database with MySQL and I get back only the first 1000 rows from 24000 expected. If i export the results to an XML form, I get the first 1000 again.
Is there a way to disable that limit and get back all the rows?
Otherwise, I will have to merge 24 XML files :/ | 2 |
7,905,074 | 10/26/2011 15:33:01 | 1,014,898 | 10/26/2011 15:24:32 | 1 | 0 | Prevent execution of ruby code in HAML | is there an option for avoiding ruby code to be executed in HAML?
The problem I am having is the following: Users are allowed to
setup their own HAML files in a CMS environment. I want to allow
IF/ELSE and LOOPS within these files, but other ruby code shouldn't
be executed for security reasons.
Do I have to scan the custom HAML files for ruby code and delete
that or is there a better solution?
Thanks for any kind of help!
Greg | ruby-on-rails | ruby | haml | null | null | null | open | Prevent execution of ruby code in HAML
===
is there an option for avoiding ruby code to be executed in HAML?
The problem I am having is the following: Users are allowed to
setup their own HAML files in a CMS environment. I want to allow
IF/ELSE and LOOPS within these files, but other ruby code shouldn't
be executed for security reasons.
Do I have to scan the custom HAML files for ruby code and delete
that or is there a better solution?
Thanks for any kind of help!
Greg | 0 |
3,355,284 | 07/28/2010 16:49:50 | 722 | 08/08/2008 11:37:05 | 4,148 | 156 | NSString: changing a filename but not the extension. | Times like this and my Objective-C noobness shows. :-/
So, the more I work on a routine to do this, the more complex it's becoming, and I'm wondering if there isn't just a simple method to change the name of a filename in a path. Basically, I want to change `@"\some\path\abc.txt` to `@"\some\path\xyz.txt` -- replacing the filename portion but not changing the path or extension.
Thanks! | objective-c | nsstring | null | null | null | null | open | NSString: changing a filename but not the extension.
===
Times like this and my Objective-C noobness shows. :-/
So, the more I work on a routine to do this, the more complex it's becoming, and I'm wondering if there isn't just a simple method to change the name of a filename in a path. Basically, I want to change `@"\some\path\abc.txt` to `@"\some\path\xyz.txt` -- replacing the filename portion but not changing the path or extension.
Thanks! | 0 |
8,349,968 | 12/01/2011 23:42:50 | 118,175 | 06/05/2009 17:52:19 | 2,372 | 35 | How to upload a file temporarily in Rails 3? | I'm creating CSV-upload functionality for a site of mine.
I'm looking to upload a file, parse it, and then dispose of it.
I know I can upload and save a file using Paperclip, but that seems a bit like overkill.
All I need to do is parse the uploaded file and never save it.
How would I go about doing this in Rails 3?
Note: I'd prefer to do the uploading manually without using an external gem so I can learn how to process works, but any suggestions are welcome.
Thanks! | ruby | ruby-on-rails-3 | file-upload | csv | paperclip | null | open | How to upload a file temporarily in Rails 3?
===
I'm creating CSV-upload functionality for a site of mine.
I'm looking to upload a file, parse it, and then dispose of it.
I know I can upload and save a file using Paperclip, but that seems a bit like overkill.
All I need to do is parse the uploaded file and never save it.
How would I go about doing this in Rails 3?
Note: I'd prefer to do the uploading manually without using an external gem so I can learn how to process works, but any suggestions are welcome.
Thanks! | 0 |
8,694,405 | 01/01/2012 17:24:57 | 1,071,829 | 04/22/2009 13:54:19 | 67 | 3 | Set internal shortcut when creating page from code in EPiServer | How can I set an internal shortcut on a new page that is create from code-behind?
Stig | episerver | null | null | null | null | null | open | Set internal shortcut when creating page from code in EPiServer
===
How can I set an internal shortcut on a new page that is create from code-behind?
Stig | 0 |
3,560,502 | 08/24/2010 19:54:56 | 403,912 | 07/27/2010 21:46:33 | 10 | 0 | mmmmh...(php) cookies | How can you generate a new cookie value, with each new request (e.g. the cookie value changes when you click on a hyperlink).
An example would be something that PEAR AUTH does:
"Each client request a special unique cookie is given to the client. He must present this cookie on his next request. This cookie changes on every request. If client does not present the valid cookie he will be logged out."
Basically how could that ^ be done? | php | cookies | null | null | null | null | open | mmmmh...(php) cookies
===
How can you generate a new cookie value, with each new request (e.g. the cookie value changes when you click on a hyperlink).
An example would be something that PEAR AUTH does:
"Each client request a special unique cookie is given to the client. He must present this cookie on his next request. This cookie changes on every request. If client does not present the valid cookie he will be logged out."
Basically how could that ^ be done? | 0 |
3,057,725 | 06/16/2010 22:49:15 | 368,721 | 06/16/2010 22:01:26 | 1 | 0 | Senior Project Ideas About Maths and Algorithms | everybody.I am a senior student in CS.I have not much idea about what to do with my senior project.I think any idea will be very helpful to me.I'm very much interested in algorithms and the math behind them.Thanks for any project idea with this subject. | algorithm | math | project | null | null | 06/17/2010 10:22:26 | not a real question | Senior Project Ideas About Maths and Algorithms
===
everybody.I am a senior student in CS.I have not much idea about what to do with my senior project.I think any idea will be very helpful to me.I'm very much interested in algorithms and the math behind them.Thanks for any project idea with this subject. | 1 |
8,871,704 | 01/15/2012 17:24:23 | 259,752 | 01/27/2010 03:17:21 | 21 | 1 | creating folder,syntax error | im trying to use the code written by Giulio Prisco , but eclipse keep saying syntax error and dont let me to run it.
String extStorageDirectory = Environment.getExternalStorageDirectory().toString();
String basepath = extStorageDirectory + "/name of your app folder on the SD card";
//...
// in onCreate
File clipartdir = new File(basepath + "/clipart/")
Syntax error on token "if", [ expected
Syntax error, insert ";" to complete FieldDeclaration
Syntax error, insert "]" to complete ArrayAccess**
//Eclipse keep saying the following line got syntax error,anything within?
if (!clipartdir.exists()) {
clipartdir.mkdirs();
copyClipart();
}
private void copyClipart() {
AssetManager assetManager = getResources().getAssets();
String[] files = null;
try {
files = assetManager.list("clipart");
} catch (Exception e) {
Log.e("read clipart ERROR", e.toString());
e.printStackTrace();
}
for(int i=0; i<files.length; i++) {
InputStream in = null;
OutputStream out = null;
try {
in = assetManager.open("clipart/" + files[i]);
out = new FileOutputStream(basepath + "/clipart/" + files[i]);
copyFile(in, out);
in.close();
in = null;
out.flush();
out.close();
out = null;
} catch(Exception e) {
Log.e("copy clipart ERROR", e.toString());
e.printStackTrace();
}
}
}
private void copyFile(InputStream in, OutputStream out) throws IOException {
byte[] buffer = new byte[1024];
int read;
while((read = in.read(buffer)) != -1){
out.write(buffer, 0, read);
}
}
this code is written by **Giulio Prisco** , im trying to use it but syntax error | android | null | null | null | null | 07/05/2012 15:45:14 | too localized | creating folder,syntax error
===
im trying to use the code written by Giulio Prisco , but eclipse keep saying syntax error and dont let me to run it.
String extStorageDirectory = Environment.getExternalStorageDirectory().toString();
String basepath = extStorageDirectory + "/name of your app folder on the SD card";
//...
// in onCreate
File clipartdir = new File(basepath + "/clipart/")
Syntax error on token "if", [ expected
Syntax error, insert ";" to complete FieldDeclaration
Syntax error, insert "]" to complete ArrayAccess**
//Eclipse keep saying the following line got syntax error,anything within?
if (!clipartdir.exists()) {
clipartdir.mkdirs();
copyClipart();
}
private void copyClipart() {
AssetManager assetManager = getResources().getAssets();
String[] files = null;
try {
files = assetManager.list("clipart");
} catch (Exception e) {
Log.e("read clipart ERROR", e.toString());
e.printStackTrace();
}
for(int i=0; i<files.length; i++) {
InputStream in = null;
OutputStream out = null;
try {
in = assetManager.open("clipart/" + files[i]);
out = new FileOutputStream(basepath + "/clipart/" + files[i]);
copyFile(in, out);
in.close();
in = null;
out.flush();
out.close();
out = null;
} catch(Exception e) {
Log.e("copy clipart ERROR", e.toString());
e.printStackTrace();
}
}
}
private void copyFile(InputStream in, OutputStream out) throws IOException {
byte[] buffer = new byte[1024];
int read;
while((read = in.read(buffer)) != -1){
out.write(buffer, 0, read);
}
}
this code is written by **Giulio Prisco** , im trying to use it but syntax error | 3 |
11,335,277 | 07/04/2012 20:46:15 | 1,347,390 | 04/20/2012 19:59:22 | 8 | 0 | Query code get working. Dummie | Need fresh air.
jquery code
var disc = $(".discount").html();
$.post('/trans.php', {
disc: disc
}
PHP
$disc = (int)$_POST['disc'];
Please help get it working. Now it returns zero. | php | query | post | null | null | 07/04/2012 20:53:38 | not a real question | Query code get working. Dummie
===
Need fresh air.
jquery code
var disc = $(".discount").html();
$.post('/trans.php', {
disc: disc
}
PHP
$disc = (int)$_POST['disc'];
Please help get it working. Now it returns zero. | 1 |
11,694,474 | 07/27/2012 19:29:13 | 1,552,609 | 07/25/2012 18:57:54 | 6 | 0 | Any Website with free Nokia J2ME Video Tutorials? | Does anyone know any sites with free Nokia J2me tutorials for creating Nokia java apps, probably in NetBeans, good quality tutorials like those of[ Bucky Roberts at the NewBoston][1]
Any Suggestions? Thanks In advance
[1]: http://www.thenewboston.com | java | android | nokia | nokia-s40 | null | 07/27/2012 19:41:50 | off topic | Any Website with free Nokia J2ME Video Tutorials?
===
Does anyone know any sites with free Nokia J2me tutorials for creating Nokia java apps, probably in NetBeans, good quality tutorials like those of[ Bucky Roberts at the NewBoston][1]
Any Suggestions? Thanks In advance
[1]: http://www.thenewboston.com | 2 |
4,302,906 | 11/29/2010 10:37:53 | 443,327 | 09/09/2010 11:13:14 | 13 | 6 | do anybody know jquery plugin of slideshow in which different delay time for each slide can be set? | i want to set different delay time for different slides those will be generated dynamically .
do you know some jquery plugin or any other code for this? | jquery | jquery-plugins | slideshow | null | null | null | open | do anybody know jquery plugin of slideshow in which different delay time for each slide can be set?
===
i want to set different delay time for different slides those will be generated dynamically .
do you know some jquery plugin or any other code for this? | 0 |
3,000,881 | 06/08/2010 20:08:31 | 270,531 | 02/10/2010 18:39:19 | 113 | 0 | Excel worksheet error | I am trying to create dynamic excel sheet, with the help of php using XML Spreadsheet.
But when I try to open the dynamically created excel sheet I keep on getting error that says 'Unable to load worksheet, problem with worksheet settings'. When I try to look at the log file it had created it shows the below text,
XML ERROR in Worksheet Setting
REASON: Bad Value
FILE: C:\Documents and Settings\UserName\Local Settings\Temporary Internet Files\Content.IE5\5XZ039FS\output[3].xls
GROUP: Worksheet
TAG: Table
ATTRIB: ExpandedRowCount
VALUE: 4
Can anybody tell what does the above error mean and how do I remove it?
| php | excel-2007 | null | null | null | null | open | Excel worksheet error
===
I am trying to create dynamic excel sheet, with the help of php using XML Spreadsheet.
But when I try to open the dynamically created excel sheet I keep on getting error that says 'Unable to load worksheet, problem with worksheet settings'. When I try to look at the log file it had created it shows the below text,
XML ERROR in Worksheet Setting
REASON: Bad Value
FILE: C:\Documents and Settings\UserName\Local Settings\Temporary Internet Files\Content.IE5\5XZ039FS\output[3].xls
GROUP: Worksheet
TAG: Table
ATTRIB: ExpandedRowCount
VALUE: 4
Can anybody tell what does the above error mean and how do I remove it?
| 0 |
2,555,922 | 03/31/2010 19:35:05 | 254,946 | 01/20/2010 14:15:00 | 10 | 1 | CSS IF statement + Jquery popup? | How would i go about making a if statement for Mozilla browsers web-kit browsers and IE browsers
for css statement's so i can add my radius but still validate my code. also how would i go about having my site know lets say "IE User Visit's" and my site goes oh there on IE pop up light box or something. needs to support html. but say there on Mozilla or safari base browsers it just goes it because radius is supported by them | css | jquery | cross-browser | php | xhtml | null | open | CSS IF statement + Jquery popup?
===
How would i go about making a if statement for Mozilla browsers web-kit browsers and IE browsers
for css statement's so i can add my radius but still validate my code. also how would i go about having my site know lets say "IE User Visit's" and my site goes oh there on IE pop up light box or something. needs to support html. but say there on Mozilla or safari base browsers it just goes it because radius is supported by them | 0 |
10,428,608 | 05/03/2012 09:28:33 | 257,742 | 01/24/2010 09:26:09 | 61 | 0 | Not able to visualize a loaded data | I just start to test xtk, and no problem with the first sample of the cube. I now try to load an external data, but stored locally into my filesystem (just download skull sample of example 05) and put in the same directory of the html. I'm not able to see anything.
I've also run the tests and the visualization is ok but when I try to open one of test htmls, it isn't able to visualize the sample. Is there some problem of path? I really try to put myself in the most simple situation but I don't see anything.
I use Chrome, and when I check the demos, it is all ok.
Any suggestion?
thank you very much
Daniele | data | load | xtk | null | null | null | open | Not able to visualize a loaded data
===
I just start to test xtk, and no problem with the first sample of the cube. I now try to load an external data, but stored locally into my filesystem (just download skull sample of example 05) and put in the same directory of the html. I'm not able to see anything.
I've also run the tests and the visualization is ok but when I try to open one of test htmls, it isn't able to visualize the sample. Is there some problem of path? I really try to put myself in the most simple situation but I don't see anything.
I use Chrome, and when I check the demos, it is all ok.
Any suggestion?
thank you very much
Daniele | 0 |
11,282,876 | 07/01/2012 14:44:28 | 1,494,358 | 07/01/2012 14:29:35 | 1 | 0 | SQL 2005/2008 system timezone | I work on a ship that has multiple MS SQL servers both 2005/2008. As the ship moves from area to area so does our timezone. Sometimes we can jump ahead one hour and then back again. My question is what is the best practice for this sort of situation, is it safe to change the system time so repeatedly? Should the DB be stopped before doing so? What sort of problems can arise? Any feedback appreciated.
Thanks,
Kris | sql-server | sql-server-2005 | sql-server-2008-r2 | null | null | 07/01/2012 18:08:56 | off topic | SQL 2005/2008 system timezone
===
I work on a ship that has multiple MS SQL servers both 2005/2008. As the ship moves from area to area so does our timezone. Sometimes we can jump ahead one hour and then back again. My question is what is the best practice for this sort of situation, is it safe to change the system time so repeatedly? Should the DB be stopped before doing so? What sort of problems can arise? Any feedback appreciated.
Thanks,
Kris | 2 |
6,111,465 | 05/24/2011 13:50:57 | 516,629 | 11/22/2010 20:29:41 | 843 | 37 | Only running javascript required for current page, best methods? | So I know it's best to have one javascript file for an entire site to limit http requests. So obviously only some javascript is required for some pages. **What is the best way of only running the javascript required for the current page?**
EG.
if(page=='home'){
//run javascript require for the home page
}
Maybe this isn't an issue and if targeting elements are not found on the page javascript will just fail gracefully? I would just like to know the best practice for this javascript structure.
| javascript | structure | null | null | null | null | open | Only running javascript required for current page, best methods?
===
So I know it's best to have one javascript file for an entire site to limit http requests. So obviously only some javascript is required for some pages. **What is the best way of only running the javascript required for the current page?**
EG.
if(page=='home'){
//run javascript require for the home page
}
Maybe this isn't an issue and if targeting elements are not found on the page javascript will just fail gracefully? I would just like to know the best practice for this javascript structure.
| 0 |
11,693,891 | 07/27/2012 18:47:45 | 1,080,891 | 12/05/2011 04:19:46 | 71 | 2 | Get URI for image on ASP.NET server | I need to load a png stored in my asp.net mvc project into my program as a bitmap image. However, the constructor for BitmapImage only takes a Uri object. How can I access the image?
Doing something like
new Uri(VirtualPathUtility.ToAbsolute("~\\Content\\image.png"))
tells me that the format of the URI could not be determined. However it works if I hard code the path (C:\\\\...etc.) | asp.net | asp.net-mvc-3 | uri | null | null | null | open | Get URI for image on ASP.NET server
===
I need to load a png stored in my asp.net mvc project into my program as a bitmap image. However, the constructor for BitmapImage only takes a Uri object. How can I access the image?
Doing something like
new Uri(VirtualPathUtility.ToAbsolute("~\\Content\\image.png"))
tells me that the format of the URI could not be determined. However it works if I hard code the path (C:\\\\...etc.) | 0 |
1,408,342 | 09/10/2009 23:54:12 | 92,129 | 04/17/2009 14:00:39 | 97 | 7 | jQuery clear checkboxes when hiding div? | I have a jQuery script that will display specific divs depending on which select option has been selected.
Here's the code for that:
jQuery.noConflict();
jQuery(document).ready(function() {
jQuery.viewMap = {
'' : jQuery([]),
'1' : jQuery('.company_1'),
'2' : jQuery('.company_2')
};
jQuery('#companyid').change(function() {
jQuery.each(jQuery.viewMap, function() { this.hide(); });
jQuery.viewMap[jQuery(this).val()].show();
});
});
(example div)
<div class="company_1" style="display: none;">
<input type="checkbox" name="classifications[Miner]" id="classifications[Miner]" /> Spec/Rough
<input type="checkbox" name="classifications[Dealer]" id="classifications[Dealer]" /> Dealer
</div>
I'd like it to clear all the checkboxes inside the div (.company_1, .company_2 etc) if someone selects a different option. If that makes sense? :)
Thank you! | jquery | checkbox | null | null | null | null | open | jQuery clear checkboxes when hiding div?
===
I have a jQuery script that will display specific divs depending on which select option has been selected.
Here's the code for that:
jQuery.noConflict();
jQuery(document).ready(function() {
jQuery.viewMap = {
'' : jQuery([]),
'1' : jQuery('.company_1'),
'2' : jQuery('.company_2')
};
jQuery('#companyid').change(function() {
jQuery.each(jQuery.viewMap, function() { this.hide(); });
jQuery.viewMap[jQuery(this).val()].show();
});
});
(example div)
<div class="company_1" style="display: none;">
<input type="checkbox" name="classifications[Miner]" id="classifications[Miner]" /> Spec/Rough
<input type="checkbox" name="classifications[Dealer]" id="classifications[Dealer]" /> Dealer
</div>
I'd like it to clear all the checkboxes inside the div (.company_1, .company_2 etc) if someone selects a different option. If that makes sense? :)
Thank you! | 0 |
10,778,628 | 05/28/2012 02:01:29 | 10,410 | 09/15/2008 22:58:08 | 740 | 27 | Disable OK button when FolderBrowserDialog SelectedPath is MyComputer | In my program, I need to force the user to select the save folder. I have the following code:
private void selectSaveFolder_Click(object sender, EventArgs e)
{
FolderBrowserDialog fbd = new FolderBrowserDialog();
// My Computer is a virtual folder. It has a predefined GUID
fbd.SelectedPath = "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}";
if (fbd.ShowDialog() == DialogResult.OK
{
...
}
}
My problem is the OK button is not initially disabled.
Behaviour:
- "My Computer" is selected (light shade of grey) but the OK button is enabled.
- Clicking on "My Computer" (selection now shaded dark blue) still has the OK button selected.
- If I select say Desktop and then re-select "My Computer", the OK button only then gets disabled.
I've tried playing around with both the SelectedPath and RootFolder, along with Environment.SpecialFolder.MyComputer and Environment.GetPath() to no avail.
How can I disable the OK button when the SelectedPath is not a valid folder? | c# | null | null | null | null | null | open | Disable OK button when FolderBrowserDialog SelectedPath is MyComputer
===
In my program, I need to force the user to select the save folder. I have the following code:
private void selectSaveFolder_Click(object sender, EventArgs e)
{
FolderBrowserDialog fbd = new FolderBrowserDialog();
// My Computer is a virtual folder. It has a predefined GUID
fbd.SelectedPath = "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}";
if (fbd.ShowDialog() == DialogResult.OK
{
...
}
}
My problem is the OK button is not initially disabled.
Behaviour:
- "My Computer" is selected (light shade of grey) but the OK button is enabled.
- Clicking on "My Computer" (selection now shaded dark blue) still has the OK button selected.
- If I select say Desktop and then re-select "My Computer", the OK button only then gets disabled.
I've tried playing around with both the SelectedPath and RootFolder, along with Environment.SpecialFolder.MyComputer and Environment.GetPath() to no avail.
How can I disable the OK button when the SelectedPath is not a valid folder? | 0 |
5,303,897 | 03/14/2011 20:09:28 | 331,785 | 05/03/2010 20:55:29 | 526 | 16 | CSS width doesn't add up | I have two `<div>`s inside a parent `<div>`. Both the inner ones are styled with no `padding`, `border` or `margin` and as `width:50%; display:inline-block;`. The outer `<div>` also has no `padding`, etc. Firebug shows the outer `<div>` to be of 1240px width, and each inner one to be 620px. So why do they appear one below the other and not side-by-side? If i lower their width to 618px, it works. Huh? | css | null | null | null | null | null | open | CSS width doesn't add up
===
I have two `<div>`s inside a parent `<div>`. Both the inner ones are styled with no `padding`, `border` or `margin` and as `width:50%; display:inline-block;`. The outer `<div>` also has no `padding`, etc. Firebug shows the outer `<div>` to be of 1240px width, and each inner one to be 620px. So why do they appear one below the other and not side-by-side? If i lower their width to 618px, it works. Huh? | 0 |
5,896,799 | 05/05/2011 11:14:36 | 173,634 | 09/15/2009 10:21:27 | 802 | 2 | How can I size these spans so that the pictures don't extend past them? | [jsFiddle][1]
In this HTML/CSS, I am trying to create some containers which will hold some text, a profile picture (which can have different sizes) and name.
CSS
#fb_status_10150163932662967{
background:url(http://www.pixel2life.com/twodded/staff/stu/Tutorials/BrickTexture/bricks_zigzag_texture_6190218.JPG) #C0DEED; padding:20px;
}
#fb_status_10150163932662967 p{
background:#fff;
padding:10px 12px 10px 12px;
margin:0;
min-height:48px;
color:#000;
font-size:18px !important;
line-height:22px;
-moz-border-radius:5px;
-webkit-border-radius:5px
}
#fb_status_10150163932662967 p span.metadata{
display:block;
width:100%;
clear:both;
margin-top:8px;
padding-top:12px;
height:40px;
border-top:1px solid #fff;
border-top:1px solid #e6e6e6
}
#fb_status_10150163932662967 p span.metadata span.author{
line-height:19px
}
#fb_status_10150163932662967 p span.metadata span.author img{
float:left;
margin:0 7px 0 0px;
}
#fb_status_10150163932662967 p a {
color: #0084B4;
text-decoration:none;
}
#fb_status_10150163932662967 p a:hover{
text-decoration:underline
}
#fb_status_10150163932662967 p span.embedly_timestamp{
font-size:12px;
display:block
}
HTML
<div id="fb_status_10150163932662967" class="fb_status">
<p>
text1
<span class="metadata">
<span class="author">
<img src="https://fbcdn-profile-a.akamaihd.net/hprofile-ak-snc4/48898_565722966_3090_t.jpg">
<strong>
Ben
</strong>
<br>
</span>
</span>
</p>
<br>
<p>
text2
<span class="metadata">
<span class="author">
<img src="https://fbcdn-profile-a.akamaihd.net/hprofile-ak-snc4/187486_564261187_2838929_t.jpg">
<strong>
Kirsty
</strong>
<br>
</span>
</span>
</p>
<br>
<p>
text3
<span class="metadata">
<span class="author">
<img src="https://fbcdn-profile-a.akamaihd.net/hprofile-ak-snc4/48898_565722966_3090_t.jpg">
<strong>
Ben
</strong>
<br>
</span>
</span>
</p>
</div>
As you can see from the [jsFiddle][1], the profile picture extends past the container. How can I make it so that they are contained fully within the container?
[1]: http://jsfiddle.net/Tu5Y5/1/ | html | css | null | null | null | null | open | How can I size these spans so that the pictures don't extend past them?
===
[jsFiddle][1]
In this HTML/CSS, I am trying to create some containers which will hold some text, a profile picture (which can have different sizes) and name.
CSS
#fb_status_10150163932662967{
background:url(http://www.pixel2life.com/twodded/staff/stu/Tutorials/BrickTexture/bricks_zigzag_texture_6190218.JPG) #C0DEED; padding:20px;
}
#fb_status_10150163932662967 p{
background:#fff;
padding:10px 12px 10px 12px;
margin:0;
min-height:48px;
color:#000;
font-size:18px !important;
line-height:22px;
-moz-border-radius:5px;
-webkit-border-radius:5px
}
#fb_status_10150163932662967 p span.metadata{
display:block;
width:100%;
clear:both;
margin-top:8px;
padding-top:12px;
height:40px;
border-top:1px solid #fff;
border-top:1px solid #e6e6e6
}
#fb_status_10150163932662967 p span.metadata span.author{
line-height:19px
}
#fb_status_10150163932662967 p span.metadata span.author img{
float:left;
margin:0 7px 0 0px;
}
#fb_status_10150163932662967 p a {
color: #0084B4;
text-decoration:none;
}
#fb_status_10150163932662967 p a:hover{
text-decoration:underline
}
#fb_status_10150163932662967 p span.embedly_timestamp{
font-size:12px;
display:block
}
HTML
<div id="fb_status_10150163932662967" class="fb_status">
<p>
text1
<span class="metadata">
<span class="author">
<img src="https://fbcdn-profile-a.akamaihd.net/hprofile-ak-snc4/48898_565722966_3090_t.jpg">
<strong>
Ben
</strong>
<br>
</span>
</span>
</p>
<br>
<p>
text2
<span class="metadata">
<span class="author">
<img src="https://fbcdn-profile-a.akamaihd.net/hprofile-ak-snc4/187486_564261187_2838929_t.jpg">
<strong>
Kirsty
</strong>
<br>
</span>
</span>
</p>
<br>
<p>
text3
<span class="metadata">
<span class="author">
<img src="https://fbcdn-profile-a.akamaihd.net/hprofile-ak-snc4/48898_565722966_3090_t.jpg">
<strong>
Ben
</strong>
<br>
</span>
</span>
</p>
</div>
As you can see from the [jsFiddle][1], the profile picture extends past the container. How can I make it so that they are contained fully within the container?
[1]: http://jsfiddle.net/Tu5Y5/1/ | 0 |
4,482,528 | 12/19/2010 10:29:09 | 430,167 | 08/25/2010 00:46:22 | 150 | 4 | Register User Creation Form using software | I need some idea .I have to design a software that may be console application which should accept URL of Add user page (page dose not have captcha or anything like that).
what my application needs to do is fill that page form i.e username,password and email
and USES POST to register that user
Is it possible?
is it possible for that application to cross platform compatible
what programming language should be used | forms | null | null | null | null | null | open | Register User Creation Form using software
===
I need some idea .I have to design a software that may be console application which should accept URL of Add user page (page dose not have captcha or anything like that).
what my application needs to do is fill that page form i.e username,password and email
and USES POST to register that user
Is it possible?
is it possible for that application to cross platform compatible
what programming language should be used | 0 |
4,878,691 | 02/02/2011 19:05:50 | 496,406 | 11/03/2010 19:50:51 | 33 | 4 | Django Admin and Dajax | I am new to using anything ajax related, so please excuse my ignorance.
I am working with the example [here][1] and trying to get it to work in the Django Admin. I am working on creating a custom change form for the model it will be used in.
The problem I am having is that after making the selection in the first selection box, nothing happens with the second box. I have tried using both prototype and jquery, but it seems that it doesn't get to either of them.
One thing I had to do to even get it to call the function in ajax.py, is I had to add quotes around the Dajax.process variable being passed within onchange.
I am currently just using the django dev server for testing purposes.
What am I missing?
[1]: http://www.dajaxproject.com/forms/ | javascript | jquery | ajax | django | null | null | open | Django Admin and Dajax
===
I am new to using anything ajax related, so please excuse my ignorance.
I am working with the example [here][1] and trying to get it to work in the Django Admin. I am working on creating a custom change form for the model it will be used in.
The problem I am having is that after making the selection in the first selection box, nothing happens with the second box. I have tried using both prototype and jquery, but it seems that it doesn't get to either of them.
One thing I had to do to even get it to call the function in ajax.py, is I had to add quotes around the Dajax.process variable being passed within onchange.
I am currently just using the django dev server for testing purposes.
What am I missing?
[1]: http://www.dajaxproject.com/forms/ | 0 |
10,121,672 | 04/12/2012 10:19:40 | 1,328,814 | 04/12/2012 10:18:27 | 1 | 0 | Amazon Cloudfront Bucket distribution | Is there any ways I can ask Cloudfront API for the name of the bucket it use on amaozn s3? | amazon-s3 | amazon | amazon-cloudfront | null | null | null | open | Amazon Cloudfront Bucket distribution
===
Is there any ways I can ask Cloudfront API for the name of the bucket it use on amaozn s3? | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.