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,651,838
07/25/2012 14:17:05
1,449,157
06/11/2012 14:28:08
15
0
I need just one token for my web app to access one of my facebook pages
So here's the deal, I'm learning how to work with facebook api, and i'm having some difficulties trying to understand it, the documentation isn't at all organized imho. So I'm getting this error "Impersonated access tokens can only be used with the Graph API" And I think it's because I use the token from the graph API explorer. My big problem is that I'm trying to do a fql with the API, if I run the query without the API and at the end pass the add &access_token=(token) I get the results I want. My main purpose with this project is to have a normal website, that fetch some data of my facebook page(albums, photos and events), and I want to display it in my page, it's like facebook is the backoffice. So is there way to solve this?
facebook
facebook-fql
facebook-authentication
null
null
null
open
I need just one token for my web app to access one of my facebook pages === So here's the deal, I'm learning how to work with facebook api, and i'm having some difficulties trying to understand it, the documentation isn't at all organized imho. So I'm getting this error "Impersonated access tokens can only be used with the Graph API" And I think it's because I use the token from the graph API explorer. My big problem is that I'm trying to do a fql with the API, if I run the query without the API and at the end pass the add &access_token=(token) I get the results I want. My main purpose with this project is to have a normal website, that fetch some data of my facebook page(albums, photos and events), and I want to display it in my page, it's like facebook is the backoffice. So is there way to solve this?
0
8,303,234
11/28/2011 22:23:06
938,350
09/10/2011 16:03:36
162
8
How to use some jquery script toghether
i'm using two jquery script in my html page: with the first i upload image without refresh page with this script seen here: [upload image with ajax and jquery][1] and after image is seen in my page i hope to use this script: [drag image into div with mouse][2] to move image into div to "center" the content of image into that little div: this is some code: <script type="text/javascript" > $(document).ready(function() { $('#photoimg').live('change', function(){ $("#imageform").ajaxForm({target:'#logo'}).submit(); $('#imm').draggable(); $("#imm").css({top: 0, left: 0}); $( "#imm" ).draggable({ containment: 'parent' }); $("#imm").css({cursor: 'pointer'}); }); }); </script> when i use only draggable script it works good, so image was uploaded statically on loading of page. when i upload image with ajax it will not work... can you help me pls?? [1]: http://www.9lessons.info/2011/08/ajax-image-upload-without-refreshing.html [2]: http://jqueryui.com/demos/draggable/
jquery
ajax
file-upload
draggable
null
11/29/2011 00:48:23
not a real question
How to use some jquery script toghether === i'm using two jquery script in my html page: with the first i upload image without refresh page with this script seen here: [upload image with ajax and jquery][1] and after image is seen in my page i hope to use this script: [drag image into div with mouse][2] to move image into div to "center" the content of image into that little div: this is some code: <script type="text/javascript" > $(document).ready(function() { $('#photoimg').live('change', function(){ $("#imageform").ajaxForm({target:'#logo'}).submit(); $('#imm').draggable(); $("#imm").css({top: 0, left: 0}); $( "#imm" ).draggable({ containment: 'parent' }); $("#imm").css({cursor: 'pointer'}); }); }); </script> when i use only draggable script it works good, so image was uploaded statically on loading of page. when i upload image with ajax it will not work... can you help me pls?? [1]: http://www.9lessons.info/2011/08/ajax-image-upload-without-refreshing.html [2]: http://jqueryui.com/demos/draggable/
1
107,541
09/20/2008 07:44:10
18,651
09/19/2008 08:35:26
1
0
What is your single favorite book for getting started with unit testing?
I am looking for a book that gives a good overview of the subject, and is also practical for **implementing** unit testing. The book should be useful for users of different programming languages.
unit-testing
subjective
books
null
null
11/22/2011 16:40:23
not constructive
What is your single favorite book for getting started with unit testing? === I am looking for a book that gives a good overview of the subject, and is also practical for **implementing** unit testing. The book should be useful for users of different programming languages.
4
8,883,765
01/16/2012 17:22:17
1,152,267
01/16/2012 16:29:13
21
1
User preference matching recommendation system ( pearson correlation )
I will point this out first, my knowledge of algorithms is very modest and am working on improving this with the recommendation system I am working on ( this is for my own educational gain ). ## Background ## So far, I have a list of user preferences to work into a correlation with other user preferences. Each users will have the following data: * Major: ( Business, Computer Science, Nursing, ect ... ) * Gender: ( Male, Female ) * Age: ( numeric value ) * Ethnicity: ( American Indian/Alaskan Native, Black/African American, Hispanic/Latino, Asian/Pacific Islander, White, Not of Hispanic Origin ) My goal is to rank the persons that are participating with each other. So, User1 would have a list of ranked users like so: 1. User4 - 89% 2. User20 - 34% 3. User234 - 31% Right now, I can do the ranking if I give each of the users preference a rating ( 1 - 5 ). Then use the Pearson Coefficient to rank them. The user class has a mapping like this: User1: ( name, rank ) * Major -> computer science, 3 * Gender -> male, 5 * Age -> 18, 5 * Ethnicity -> white, 3 I found this link and appears to be close to what I want to do: http://stackoverflow.com/questions/3574929/user-matching-with-current-data ## Questions * Am I using the right algorithm for this process? * How can I take something like 'Computer Science' and give it a value to use with the Pearson Coefficient? * Can I generate the 'rank' on the fly? ( How can I do this? ) The programming language I am using is C#. Also, if possible, I would like to do this without the aid of a library as the goal is to learn more advanced CS topics. Thanks
c#
.net
algorithm
null
null
null
open
User preference matching recommendation system ( pearson correlation ) === I will point this out first, my knowledge of algorithms is very modest and am working on improving this with the recommendation system I am working on ( this is for my own educational gain ). ## Background ## So far, I have a list of user preferences to work into a correlation with other user preferences. Each users will have the following data: * Major: ( Business, Computer Science, Nursing, ect ... ) * Gender: ( Male, Female ) * Age: ( numeric value ) * Ethnicity: ( American Indian/Alaskan Native, Black/African American, Hispanic/Latino, Asian/Pacific Islander, White, Not of Hispanic Origin ) My goal is to rank the persons that are participating with each other. So, User1 would have a list of ranked users like so: 1. User4 - 89% 2. User20 - 34% 3. User234 - 31% Right now, I can do the ranking if I give each of the users preference a rating ( 1 - 5 ). Then use the Pearson Coefficient to rank them. The user class has a mapping like this: User1: ( name, rank ) * Major -> computer science, 3 * Gender -> male, 5 * Age -> 18, 5 * Ethnicity -> white, 3 I found this link and appears to be close to what I want to do: http://stackoverflow.com/questions/3574929/user-matching-with-current-data ## Questions * Am I using the right algorithm for this process? * How can I take something like 'Computer Science' and give it a value to use with the Pearson Coefficient? * Can I generate the 'rank' on the fly? ( How can I do this? ) The programming language I am using is C#. Also, if possible, I would like to do this without the aid of a library as the goal is to learn more advanced CS topics. Thanks
0
5,673,832
04/15/2011 07:50:03
709,391
04/15/2011 07:50:03
1
0
Updation in sql server throgh viasual studio coding.
I am a beginner and I create my project(Offline) in visual studio,connect it with sql server through server explorer,i want to know the coding in visual studio that can i update data through it.
visual-studio-2010
null
null
null
null
04/15/2011 08:51:21
not a real question
Updation in sql server throgh viasual studio coding. === I am a beginner and I create my project(Offline) in visual studio,connect it with sql server through server explorer,i want to know the coding in visual studio that can i update data through it.
1
11,389,755
07/09/2012 06:02:37
1,201,479
02/10/2012 07:10:14
26
1
How to upload an image in sdcard to facebook wall?
this is the code I had written. In this code, Text-Message is updating on facebook wall. but I have to post Image in a device to facebook wall. Please help me friends... public class ImageUploadActivity extends Activity { /** Called when the activity is first created. */ private static final String APP_ID = "252399301538097"; private static final String[] PERMISSIONS = new String[] {"publish_stream"}; private static final String TOKEN = "access_token"; private static final String EXPIRES = "expires_in"; private static final String KEY = "facebook-credentials"; private Facebook facebook; private String messageToPost; public boolean saveCredentials(Facebook facebook) { Editor editor = getApplicationContext().getSharedPreferences(KEY, Context.MODE_PRIVATE).edit(); editor.putString(TOKEN, facebook.getAccessToken()); editor.putLong(EXPIRES, facebook.getAccessExpires()); return editor.commit(); } public boolean restoreCredentials(Facebook facebook) { SharedPreferences sharedPreferences = getApplicationContext().getSharedPreferences(KEY, Context.MODE_PRIVATE); facebook.setAccessToken(sharedPreferences.getString(TOKEN, null)); facebook.setAccessExpires(sharedPreferences.getLong(EXPIRES, 0)); return facebook.isSessionValid(); } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); facebook = new Facebook(APP_ID); restoreCredentials(facebook); //requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.main); String facebookMessage = getIntent().getStringExtra("facebookMessage"); if (facebookMessage == null){ facebookMessage = "Test wall post"; } messageToPost = facebookMessage; } public void doNotShare(View button){ finish(); } public void share(View button){ if (! facebook.isSessionValid()) { loginAndPostToWall(); } else { postToWall(messageToPost); } } public void loginAndPostToWall(){ facebook.authorize(this, PERMISSIONS, Facebook.FORCE_DIALOG_AUTH, new LoginDialogListener()); } public void postToWall(String message){ Bundle parameters = new Bundle(); parameters.putString("message", message); parameters.putString("description", "topic share"); try { facebook.request("me"); String response = facebook.request("me/feed", parameters, "POST"); Log.d("Tests", "got response: " + response); if (response == null || response.equals("") || response.equals("false")) { showToast("Blank response."); } else { showToast("Message posted to your facebook wall!"); } finish(); } catch (Exception e) { showToast("Failed to post to wall!"); e.printStackTrace(); finish(); } } class LoginDialogListener implements DialogListener { public void onComplete(Bundle values) { saveCredentials(facebook); if (messageToPost != null){ postToWall(messageToPost); } } public void onFacebookError(FacebookError error) { showToast("Authentication with Facebook failed!"); finish(); } public void onError(DialogError error) { showToast("Authentication with Facebook failed!"); finish(); } public void onCancel() { showToast("Authentication with Facebook cancelled!"); finish(); } } private void showToast(String message){ Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show(); } }
android
null
null
null
null
07/10/2012 11:49:05
not a real question
How to upload an image in sdcard to facebook wall? === this is the code I had written. In this code, Text-Message is updating on facebook wall. but I have to post Image in a device to facebook wall. Please help me friends... public class ImageUploadActivity extends Activity { /** Called when the activity is first created. */ private static final String APP_ID = "252399301538097"; private static final String[] PERMISSIONS = new String[] {"publish_stream"}; private static final String TOKEN = "access_token"; private static final String EXPIRES = "expires_in"; private static final String KEY = "facebook-credentials"; private Facebook facebook; private String messageToPost; public boolean saveCredentials(Facebook facebook) { Editor editor = getApplicationContext().getSharedPreferences(KEY, Context.MODE_PRIVATE).edit(); editor.putString(TOKEN, facebook.getAccessToken()); editor.putLong(EXPIRES, facebook.getAccessExpires()); return editor.commit(); } public boolean restoreCredentials(Facebook facebook) { SharedPreferences sharedPreferences = getApplicationContext().getSharedPreferences(KEY, Context.MODE_PRIVATE); facebook.setAccessToken(sharedPreferences.getString(TOKEN, null)); facebook.setAccessExpires(sharedPreferences.getLong(EXPIRES, 0)); return facebook.isSessionValid(); } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); facebook = new Facebook(APP_ID); restoreCredentials(facebook); //requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.main); String facebookMessage = getIntent().getStringExtra("facebookMessage"); if (facebookMessage == null){ facebookMessage = "Test wall post"; } messageToPost = facebookMessage; } public void doNotShare(View button){ finish(); } public void share(View button){ if (! facebook.isSessionValid()) { loginAndPostToWall(); } else { postToWall(messageToPost); } } public void loginAndPostToWall(){ facebook.authorize(this, PERMISSIONS, Facebook.FORCE_DIALOG_AUTH, new LoginDialogListener()); } public void postToWall(String message){ Bundle parameters = new Bundle(); parameters.putString("message", message); parameters.putString("description", "topic share"); try { facebook.request("me"); String response = facebook.request("me/feed", parameters, "POST"); Log.d("Tests", "got response: " + response); if (response == null || response.equals("") || response.equals("false")) { showToast("Blank response."); } else { showToast("Message posted to your facebook wall!"); } finish(); } catch (Exception e) { showToast("Failed to post to wall!"); e.printStackTrace(); finish(); } } class LoginDialogListener implements DialogListener { public void onComplete(Bundle values) { saveCredentials(facebook); if (messageToPost != null){ postToWall(messageToPost); } } public void onFacebookError(FacebookError error) { showToast("Authentication with Facebook failed!"); finish(); } public void onError(DialogError error) { showToast("Authentication with Facebook failed!"); finish(); } public void onCancel() { showToast("Authentication with Facebook cancelled!"); finish(); } } private void showToast(String message){ Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show(); } }
1
9,211,730
02/09/2012 13:28:16
867,418
07/28/2011 12:09:46
34
0
Changing hosts file in Ubuntu
I came here to ask you how to set up my hosts file in Ubuntu so when I go to **95.42.251.194:3333** my browser to open **127.0.0.1** . I tried this: **127.0.0.1 95.42.251.194:3333** Thanks in advance!
ubuntu
localhost
hosts
null
null
02/10/2012 12:54:45
off topic
Changing hosts file in Ubuntu === I came here to ask you how to set up my hosts file in Ubuntu so when I go to **95.42.251.194:3333** my browser to open **127.0.0.1** . I tried this: **127.0.0.1 95.42.251.194:3333** Thanks in advance!
2
6,863,654
07/28/2011 18:12:12
868,076
07/28/2011 18:12:12
1
0
Untaring files into a new folder
I've got a bunch of tar and tar.gz files that I would like to unzip. Inside these files, most of them have the same folder structure zipped up inside (although with different files). If I were to do this manually by right-clicking and selecting "Extract Here," it'd would create a new folder for me with the original file name and dump the files there. However, when I do this via the command line, the behavior isn't always the same. Sometimes it'd create the desired new folder and other times it wouldn't, causing it to overwrite the extraction of others. Using the -C option seems to require the folder already existing. How can I mimic the behavior of the manual "Extract Here" in the command line? Thanks.
linux
tar
null
null
null
07/29/2011 13:00:28
off topic
Untaring files into a new folder === I've got a bunch of tar and tar.gz files that I would like to unzip. Inside these files, most of them have the same folder structure zipped up inside (although with different files). If I were to do this manually by right-clicking and selecting "Extract Here," it'd would create a new folder for me with the original file name and dump the files there. However, when I do this via the command line, the behavior isn't always the same. Sometimes it'd create the desired new folder and other times it wouldn't, causing it to overwrite the extraction of others. Using the -C option seems to require the folder already existing. How can I mimic the behavior of the manual "Extract Here" in the command line? Thanks.
2
3,942,454
10/15/2010 13:02:11
454,770
09/22/2010 07:29:57
82
0
How to get the duration of days from today to a specified date in javascript?
Suppose the specified date is `2010-11-9`, how to get the duration programatically?
javascript
date
null
null
null
null
open
How to get the duration of days from today to a specified date in javascript? === Suppose the specified date is `2010-11-9`, how to get the duration programatically?
0
10,780,685
05/28/2012 07:10:36
1,419,106
05/26/2012 14:23:43
1
0
FB development - Upload a photo into user's profile
Can you tell me what I do wrong. I use PHP. Try to upload the photo into users profile.. I get permissions and it works. But uploading doesn't work, I tryed many ways. So what do I do wrong? <?php include_once 'facebook.php'; $facebook = new Facebook(array( 'appId' => 'ID', 'secret' => 'SECRET', 'cookie' => true, 'domain' => 'DOMAIN' )); $session = $facebook->getSession(); if (!$session) { $loginUrl = $facebook->getLoginUrl(array( 'canvas' => 1, 'fbconnect' => 1, 'display' => 'page', 'req_perms' => 'user_likes, publish_stream', 'next' => 'NEXTURL' )); echo "<script type='text/javascript'>top.location.href = '$loginUrl';</script>"; } else{ try { $uid = $facebook->getUser(); $me = $facebook->api('/me'); $token = $session['access_token'];//here I get the token from the $session array $album_id = 'ALBUM ID'; /// what should I write here? //upload your photo $file= 'logo.png'; $args = array( 'message' => 'Photo from app', ); $args[basename($file)] = '@' . realpath($file); $ch = curl_init(); $url = 'https://graph.facebook.com/'.$album_id.'/photos?access_token='.$token; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $args); $data = curl_exec($ch); //returns the id of the photo you just uploaded print_r(json_decode($data,true)); } catch(FacebookApiException $e){ echo "Error:" . print_r($e, true); } } ?> Thanks in advance
facebook
upload
photo
null
null
null
open
FB development - Upload a photo into user's profile === Can you tell me what I do wrong. I use PHP. Try to upload the photo into users profile.. I get permissions and it works. But uploading doesn't work, I tryed many ways. So what do I do wrong? <?php include_once 'facebook.php'; $facebook = new Facebook(array( 'appId' => 'ID', 'secret' => 'SECRET', 'cookie' => true, 'domain' => 'DOMAIN' )); $session = $facebook->getSession(); if (!$session) { $loginUrl = $facebook->getLoginUrl(array( 'canvas' => 1, 'fbconnect' => 1, 'display' => 'page', 'req_perms' => 'user_likes, publish_stream', 'next' => 'NEXTURL' )); echo "<script type='text/javascript'>top.location.href = '$loginUrl';</script>"; } else{ try { $uid = $facebook->getUser(); $me = $facebook->api('/me'); $token = $session['access_token'];//here I get the token from the $session array $album_id = 'ALBUM ID'; /// what should I write here? //upload your photo $file= 'logo.png'; $args = array( 'message' => 'Photo from app', ); $args[basename($file)] = '@' . realpath($file); $ch = curl_init(); $url = 'https://graph.facebook.com/'.$album_id.'/photos?access_token='.$token; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $args); $data = curl_exec($ch); //returns the id of the photo you just uploaded print_r(json_decode($data,true)); } catch(FacebookApiException $e){ echo "Error:" . print_r($e, true); } } ?> Thanks in advance
0
1,986,821
12/31/2009 19:33:46
238,919
12/26/2009 19:08:04
4
2
Balance factor of nodes in AVL Tree???
![alt text][1] [1]: http://img517.imageshack.us/img517/9136/clipimage002w.jpg <br> to calculate balance factor of a node in avl tree we need to find the height of its left subtree and the height of its right subtree then we subtract the height of right subtree from the height of its left subtree<br><br> balancefactor=leftsubtreeheigh - rightsubtreeheight;<br><br> my question is how to calculate the the height of left subtree or right subtree for example in the given figer the height of left subtree of root node 40 is 4 and the height of right subtree of 40 is 2 so the difference of heights is 2, but how i will do this in c++ code. please help...
c#
visual-c++
c
null
null
null
open
Balance factor of nodes in AVL Tree??? === ![alt text][1] [1]: http://img517.imageshack.us/img517/9136/clipimage002w.jpg <br> to calculate balance factor of a node in avl tree we need to find the height of its left subtree and the height of its right subtree then we subtract the height of right subtree from the height of its left subtree<br><br> balancefactor=leftsubtreeheigh - rightsubtreeheight;<br><br> my question is how to calculate the the height of left subtree or right subtree for example in the given figer the height of left subtree of root node 40 is 4 and the height of right subtree of 40 is 2 so the difference of heights is 2, but how i will do this in c++ code. please help...
0
10,023,949
04/05/2012 06:58:05
1,239,481
02/29/2012 05:47:08
2
1
How to use cocoa framework in apple ios applicaiton
AM developing an i phone application.In iphone application,am using a view based application.Now i want to use cocoa framework for using NSOpenPanel controller in ios application.How to use cocoa framework and where to use it in ios.Can some body explain in detail.How to use the cocoa framework in apple ios applications? For using NSOpenPanel controller in ios application,what i did is i took a new cocoa project and i used the NSOpenPanel controller.Then again i took a new view based application project for ios application.When we take a new project in ios,it will defaultly give the foundation,UIKit and coreGraphics framework.But when i took a new cocoa application,the default frameworks available are Foundation,cocoa and Appkit framework.What i did is for using cocoa framework in ios application,i dragged the cocoa framework from the cocoa application to my ios application.That step is successfully done.But when i started build and run.Then it again asked for AppKit framework.I dragged that one too in the same manner as cocoa framework did.Then it asked for foundation framework.In both the applications for ios and cocoa applications,foundation framework is different.How to do this.Please help me some how?
ios
cocoa
frameworks
import
null
04/11/2012 01:53:01
not a real question
How to use cocoa framework in apple ios applicaiton === AM developing an i phone application.In iphone application,am using a view based application.Now i want to use cocoa framework for using NSOpenPanel controller in ios application.How to use cocoa framework and where to use it in ios.Can some body explain in detail.How to use the cocoa framework in apple ios applications? For using NSOpenPanel controller in ios application,what i did is i took a new cocoa project and i used the NSOpenPanel controller.Then again i took a new view based application project for ios application.When we take a new project in ios,it will defaultly give the foundation,UIKit and coreGraphics framework.But when i took a new cocoa application,the default frameworks available are Foundation,cocoa and Appkit framework.What i did is for using cocoa framework in ios application,i dragged the cocoa framework from the cocoa application to my ios application.That step is successfully done.But when i started build and run.Then it again asked for AppKit framework.I dragged that one too in the same manner as cocoa framework did.Then it asked for foundation framework.In both the applications for ios and cocoa applications,foundation framework is different.How to do this.Please help me some how?
1
3,532,367
08/20/2010 15:28:43
138,767
07/15/2009 14:45:46
15
0
Sharepoint 2010 - How to apply custom master page and theme to all subsites?
I have created a sharepoint web site let's call it portal so we get the url: > http://mydevserver/sites/portal/ I have put a lot of effort into creating a custom master page on the above website and also uploaded resources (CSS, images) to the site assets directory that the new master page references and also tweaked the theme. I have also created a subsite lets call it subsite: > http://mydevserver/sites/portal/subsite Now the issue is that subsite has not inherited any of the portal styling. It has the out-of the box sharepoint styling and since it is a different site, I don't know how to make it see the portal master page and resources. Which brings me to me question: Is there an easy and maintainable way to apply my portal theme and masterpage settings to all subsites? How would you go about it? Thanks!
sharepoint2010
null
null
null
null
01/25/2012 15:49:55
off topic
Sharepoint 2010 - How to apply custom master page and theme to all subsites? === I have created a sharepoint web site let's call it portal so we get the url: > http://mydevserver/sites/portal/ I have put a lot of effort into creating a custom master page on the above website and also uploaded resources (CSS, images) to the site assets directory that the new master page references and also tweaked the theme. I have also created a subsite lets call it subsite: > http://mydevserver/sites/portal/subsite Now the issue is that subsite has not inherited any of the portal styling. It has the out-of the box sharepoint styling and since it is a different site, I don't know how to make it see the portal master page and resources. Which brings me to me question: Is there an easy and maintainable way to apply my portal theme and masterpage settings to all subsites? How would you go about it? Thanks!
2
6,273,720
06/08/2011 02:55:40
788,516
06/08/2011 02:55:40
1
0
How can i fix this CSS problem?
I have my own blog at : clicksbeast dot com and from the left side of the blog there is a big white space, how can i fix this css problem? Thanks a lot!
css
null
null
null
null
06/08/2011 12:23:57
too localized
How can i fix this CSS problem? === I have my own blog at : clicksbeast dot com and from the left side of the blog there is a big white space, how can i fix this css problem? Thanks a lot!
3
6,984,900
08/08/2011 15:58:00
636,625
02/27/2011 16:42:43
22
0
git branch messed up
I have a serious issue happened to my git repository. I had 2 branches previously, and I wrote codes last night and forgot to push to the github. This morning I used the other machine and tried fork a new branch and push them up(the codes are stored in dropbox so it doesn't matter which machine I'm using), then git gave me error say: "permission denied". Then I realized that I'm not using my labtop, so I opened up my labtop and tried to get into the branch I just created. But then it seems like I cannot do that, and what was worse, all the codes that I committed on the other machine are gone! I use `git branch` to see the branch listing and now it's like: centeredForm (shang's conflicted copy 2011-08-08) * centeredform master refinement where the first "centeredForm" is the branch I created on the other machine, and "centeredform" is the branch I created on my labtop afterwards. Are my codes gone? Or is there a way to restore to previous status?
git
branch
null
null
null
null
open
git branch messed up === I have a serious issue happened to my git repository. I had 2 branches previously, and I wrote codes last night and forgot to push to the github. This morning I used the other machine and tried fork a new branch and push them up(the codes are stored in dropbox so it doesn't matter which machine I'm using), then git gave me error say: "permission denied". Then I realized that I'm not using my labtop, so I opened up my labtop and tried to get into the branch I just created. But then it seems like I cannot do that, and what was worse, all the codes that I committed on the other machine are gone! I use `git branch` to see the branch listing and now it's like: centeredForm (shang's conflicted copy 2011-08-08) * centeredform master refinement where the first "centeredForm" is the branch I created on the other machine, and "centeredform" is the branch I created on my labtop afterwards. Are my codes gone? Or is there a way to restore to previous status?
0
7,679,015
10/06/2011 18:50:20
970,114
09/28/2011 23:18:02
1
0
Mvc 3 form post parameter: How can I reach ddl with name="Attribute.AttributeID" by a parameter in a controller
I have a dropdownlist that looks like this: @Html.DropDownListFor( x => x.Attribute.AttributeID, new SelectList(Model.Attributes, "AttributeID", "Name") ) In my controller I've tried parameters like attributeId and attribute_attributeId, this is my code: [HttpPost] public ActionResult Index(int productId, int attributeId) (Btw, I'm also receiving the ProductID which is in the query string) The output of my ddl is ... id="Attribute_AttributeID" name="Attribute.AttributeID" ... I've tried this also: @Html.DropDownListFor( x => x.Attribute.AttributeID, new SelectList(Model.Attributes, "AttributeID", "Name"), null, new { id = "attributeId", name = "attributeId" } ) But then the id just changes and not the both... So my question is how can I be able to reach the dll without having to write something like **x => x.SelectedAttributeID** in the ddl.
asp.net-mvc-3
parameters
null
null
null
null
open
Mvc 3 form post parameter: How can I reach ddl with name="Attribute.AttributeID" by a parameter in a controller === I have a dropdownlist that looks like this: @Html.DropDownListFor( x => x.Attribute.AttributeID, new SelectList(Model.Attributes, "AttributeID", "Name") ) In my controller I've tried parameters like attributeId and attribute_attributeId, this is my code: [HttpPost] public ActionResult Index(int productId, int attributeId) (Btw, I'm also receiving the ProductID which is in the query string) The output of my ddl is ... id="Attribute_AttributeID" name="Attribute.AttributeID" ... I've tried this also: @Html.DropDownListFor( x => x.Attribute.AttributeID, new SelectList(Model.Attributes, "AttributeID", "Name"), null, new { id = "attributeId", name = "attributeId" } ) But then the id just changes and not the both... So my question is how can I be able to reach the dll without having to write something like **x => x.SelectedAttributeID** in the ddl.
0
9,670,650
03/12/2012 16:11:03
1,264,329
03/12/2012 14:25:08
1
0
SQL: Find all previous records for a subset of IDs
I'm new to SQL and I am having trouble even starting this query. <br> If a student has a record in '2012', list that record and all of their previous records. <br> A simplified data set: <pre>ASSIGNMENTS STUDENT_ID BOOK_TITLE TERM <HR>001 MOBY DICK 2009 002 ULYSSES 2009 003 HAMLET 2009 004 1984 2009 005 HAMLET 2009 004 WAR & PEACE 2010 003 THE TRIAL 2010 004 MOBY DICK 2011 001 -NULL---- 2012 004 -NULL---- 2012 </pre> Results should be the record of those registered in a given term followed by that student's previous records. The goal is for the user to look at currently registered students (NULL value in book title) and make sure they don't assign a book the student has already read. <pre> STUDENT_ID BOOK_TITLE TERM 001 -NULL---- 2012 001 MOBY DICK 2009 004 -NULL---- 2012 004 MOBY DICK 2011 004 WAR & PEACE 2010 004 1984 2009 </PRE> Any pointers/starting directions would be greatly appreciated! I have tried messing around with 'with', multiple inner joins, but I am not getting anywhere. I keep thinking about if..then syntax that doesn't really work in SQL?
sql
null
null
null
null
null
open
SQL: Find all previous records for a subset of IDs === I'm new to SQL and I am having trouble even starting this query. <br> If a student has a record in '2012', list that record and all of their previous records. <br> A simplified data set: <pre>ASSIGNMENTS STUDENT_ID BOOK_TITLE TERM <HR>001 MOBY DICK 2009 002 ULYSSES 2009 003 HAMLET 2009 004 1984 2009 005 HAMLET 2009 004 WAR & PEACE 2010 003 THE TRIAL 2010 004 MOBY DICK 2011 001 -NULL---- 2012 004 -NULL---- 2012 </pre> Results should be the record of those registered in a given term followed by that student's previous records. The goal is for the user to look at currently registered students (NULL value in book title) and make sure they don't assign a book the student has already read. <pre> STUDENT_ID BOOK_TITLE TERM 001 -NULL---- 2012 001 MOBY DICK 2009 004 -NULL---- 2012 004 MOBY DICK 2011 004 WAR & PEACE 2010 004 1984 2009 </PRE> Any pointers/starting directions would be greatly appreciated! I have tried messing around with 'with', multiple inner joins, but I am not getting anywhere. I keep thinking about if..then syntax that doesn't really work in SQL?
0
11,033,311
06/14/2012 12:44:49
520,476
11/25/2010 17:30:47
27
2
PHP Tag system without database (plain text files)
I want to implement a tag system on my website. The website is made in PHP, but uses NO database (sql) system. It reads the files from plain text files and includes them. The pages are in a file, if a page is requested that file is read, and if the page is in there the site returns it. If the page is not in there it gives an error (so no path traversal issues, I can let page "blablabla" go to "other-page.inc.php"). The page list is a big case statement, like this: case "faq": $s_inc_page= $s_contentdir . "static/faq.php"; $s_pagetitle="FAQ"; $s_pagetype="none"; break; ($s_pageype is for the css theme). What I want is something like this: case "article-about-cars": $s_inc_page= $s_contentdir . "article/vehicles/about-cars.php"; $s_pagetitle="Article about Cars"; $s_pagetype="article"; $s_tags=array("car","mercedes","volvo","gmc"); break; And a tag page which takes a tag as get variable, checks which cases have that tag in the $s_tag array and then returns those cases. Is this possible, or am I thinking in the wrong direction?
php
tags
plaintext
null
null
null
open
PHP Tag system without database (plain text files) === I want to implement a tag system on my website. The website is made in PHP, but uses NO database (sql) system. It reads the files from plain text files and includes them. The pages are in a file, if a page is requested that file is read, and if the page is in there the site returns it. If the page is not in there it gives an error (so no path traversal issues, I can let page "blablabla" go to "other-page.inc.php"). The page list is a big case statement, like this: case "faq": $s_inc_page= $s_contentdir . "static/faq.php"; $s_pagetitle="FAQ"; $s_pagetype="none"; break; ($s_pageype is for the css theme). What I want is something like this: case "article-about-cars": $s_inc_page= $s_contentdir . "article/vehicles/about-cars.php"; $s_pagetitle="Article about Cars"; $s_pagetype="article"; $s_tags=array("car","mercedes","volvo","gmc"); break; And a tag page which takes a tag as get variable, checks which cases have that tag in the $s_tag array and then returns those cases. Is this possible, or am I thinking in the wrong direction?
0
11,012,068
06/13/2012 09:35:23
907,768
08/23/2011 13:16:13
1
0
Thick or thin line according to the touch speed
i am using core graphics for drawing application. i would like to draw a thick or thin line based on the touch speed ... is it possible to achieve the core graphics ? is it any algorithm is there to achieve this kind of thick and thin lines... i am appreciate Does anybody help ?
ios
core-graphics
draw
null
null
06/19/2012 11:47:29
not a real question
Thick or thin line according to the touch speed === i am using core graphics for drawing application. i would like to draw a thick or thin line based on the touch speed ... is it possible to achieve the core graphics ? is it any algorithm is there to achieve this kind of thick and thin lines... i am appreciate Does anybody help ?
1
8,494,474
12/13/2011 18:45:57
960,065
09/22/2011 22:01:15
20
2
I want to have tabs displayed vertically on the left hand side with Jquery Tools Tabs. Can anyone help me out?
I'm using the minimal setup except I've edited the CSS somewhat in a previous project and I have copied and pasted into this one. It's not much I've just changed the thickness of the border and colors. So does anyone know how to manage getting the tabs to be displayed vertically on the left hand side of the pane?
css
jquery-tools
null
null
null
null
open
I want to have tabs displayed vertically on the left hand side with Jquery Tools Tabs. Can anyone help me out? === I'm using the minimal setup except I've edited the CSS somewhat in a previous project and I have copied and pasted into this one. It's not much I've just changed the thickness of the border and colors. So does anyone know how to manage getting the tabs to be displayed vertically on the left hand side of the pane?
0
3,745,731
09/19/2010 12:50:12
49,189
12/26/2008 10:51:13
197
4
What are the current trends in Software architecture apart from SOA
I know that SOA is a architecture pattern or style which is widely adopted. I also see Domain driven design is recommended by many people. Are there any other proven styles of architecture in current practice ? Thanks, Chakra.
architecture
null
null
null
null
09/21/2010 08:17:40
not a real question
What are the current trends in Software architecture apart from SOA === I know that SOA is a architecture pattern or style which is widely adopted. I also see Domain driven design is recommended by many people. Are there any other proven styles of architecture in current practice ? Thanks, Chakra.
1
10,291,413
04/24/2012 03:36:57
911,854
08/25/2011 10:44:46
921
44
Responsive design: Is it better to hide or to change position of elements?
I have the following dilemma with two elements (menu items) that I need to move in a responsive design (it's only two variations for now, let's say one for over 750px width and another for under 750px wide): Should I have two separate html blocks, one for each variation, and hide/show them depending on the devise size? Or should I have only one html block and css styles that play with positions? This last option is kind of complicated with the design I'm planning, so the real question might be: is it too bad to have two different html blocks? The page will have javascript and ajax interaction, although I'm not sure to what extent. Thank you in advance.
html
css
position
responsive-design
null
04/25/2012 11:52:04
not constructive
Responsive design: Is it better to hide or to change position of elements? === I have the following dilemma with two elements (menu items) that I need to move in a responsive design (it's only two variations for now, let's say one for over 750px width and another for under 750px wide): Should I have two separate html blocks, one for each variation, and hide/show them depending on the devise size? Or should I have only one html block and css styles that play with positions? This last option is kind of complicated with the design I'm planning, so the real question might be: is it too bad to have two different html blocks? The page will have javascript and ajax interaction, although I'm not sure to what extent. Thank you in advance.
4
10,366,588
04/28/2012 19:00:30
1,329,707
04/12/2012 16:49:48
13
1
distibuted sophomore system to serialize tasks that must not run at the same time
I am seeking a way to serialize tasks that affect data in a data store without using MySQL ex: A worker doing accounting on group1 should be the only worker doing accounting on group one and should wait in queue if another worker is doing accounting on group one. I could accomplish this with MySQL by setting up sophomore table, start a transaction, do a update on the the the row for group1, do my task, and commit. i was thinking that maybe 0mq redis or some sort of messaging system could be used accomplish the same goal and allow me to use what ever data store i want. i was also thinking that ScalienDB may be able to solve the problem in the same manor as mysql seeing that it supports transactions. The documentation for ScalienDB seems to be somewhat incomplete so i can't quite Ascertain if it can do transactions in that fashion. <BR> So my questions are:<BR> 1. can ScalienDB do a transaction that would force a client to wait for another client to commit if it wanted to edit a row in a table that another client has also done a edit on.<br> 2. using a messaging system how would you suggest implementing something that boils down to something like this: var sophomore = sophomore_group() sophomore.acquire('task1',function(){ // do work after a sophomore is locked in sophomore.release() // }) ideally i would not want this system to dependent on a centralized broker <Br> 3. is there a alternate solution that would fit this problem
node.js
mongodb
redis
rabbitmq
zeromq
null
open
distibuted sophomore system to serialize tasks that must not run at the same time === I am seeking a way to serialize tasks that affect data in a data store without using MySQL ex: A worker doing accounting on group1 should be the only worker doing accounting on group one and should wait in queue if another worker is doing accounting on group one. I could accomplish this with MySQL by setting up sophomore table, start a transaction, do a update on the the the row for group1, do my task, and commit. i was thinking that maybe 0mq redis or some sort of messaging system could be used accomplish the same goal and allow me to use what ever data store i want. i was also thinking that ScalienDB may be able to solve the problem in the same manor as mysql seeing that it supports transactions. The documentation for ScalienDB seems to be somewhat incomplete so i can't quite Ascertain if it can do transactions in that fashion. <BR> So my questions are:<BR> 1. can ScalienDB do a transaction that would force a client to wait for another client to commit if it wanted to edit a row in a table that another client has also done a edit on.<br> 2. using a messaging system how would you suggest implementing something that boils down to something like this: var sophomore = sophomore_group() sophomore.acquire('task1',function(){ // do work after a sophomore is locked in sophomore.release() // }) ideally i would not want this system to dependent on a centralized broker <Br> 3. is there a alternate solution that would fit this problem
0
2,087,017
01/18/2010 15:24:12
207,847
11/10/2009 14:35:11
60
3
Convert date from yyyy-mm-dd to dd-mm-yy using xsl
HI all, I got a JavaScript function to convert the date, but I was wondering if there is any way to convert the date with xsl without using JavaScript. Thanks.
xslt
date
null
null
null
null
open
Convert date from yyyy-mm-dd to dd-mm-yy using xsl === HI all, I got a JavaScript function to convert the date, but I was wondering if there is any way to convert the date with xsl without using JavaScript. Thanks.
0
2,334,048
02/25/2010 12:52:09
193,098
10/20/2009 13:00:32
1
1
ASP.NET Web application Initialize (First hit) takes over 15 Mins . .
I have a Web application (http://www.holidaystreets.com), it has around 120,000+ pages. Whenever we restart the server it takes more then 15 minutes for the site to warm up. I built it as 'Release', do not have any heavy stuff initilizing (i.e. Control Adapters or in APPInit). Any tips?
asp.net
web-applications
null
null
null
null
open
ASP.NET Web application Initialize (First hit) takes over 15 Mins . . === I have a Web application (http://www.holidaystreets.com), it has around 120,000+ pages. Whenever we restart the server it takes more then 15 minutes for the site to warm up. I built it as 'Release', do not have any heavy stuff initilizing (i.e. Control Adapters or in APPInit). Any tips?
0
4,889,651
02/03/2011 17:46:39
601,976
02/03/2011 17:32:10
1
0
Rails 2.3.8: How to functionally test the root route by requesting '/' ?
Rails 2.3.8 (testing with Mocha) In my routes.rb file: map.root(:controller => 'application', :action => 'render_404_not_found') In my functional tests I want to verify that a request for '/' will be handled properly: @controller.stubs(:render_404_not_found).returns(666) %w( HEAD GET POST PUT DELETE ).each do |method| @request = ActionController::TestRequest.new @request.env['REQUEST_URI'] = uri @request.path = uri process(uri, nil, nil, nil, method) assert_response(666, "Request for '#{method} #{uri}'" + 'should have 404ed (or 666ed)') end I realise the stub 'returns' clause is incorrect, but I haven't gotten there yet: test_bogus_uri_path(EdgeConditionsTest): ActionController::RoutingError: /usr/lib/ruby/gems/1.8/gems/ \ actionpack-2.3.8/lib /action_controller/routing/route_set.rb:420: \ in `generate': No route matches {:controller=>"application", :action=>"/"} So how do I test that this route is working and invoking #render_404_not_found ? Thanks!
ruby-on-rails
testing
routing
routes
null
null
open
Rails 2.3.8: How to functionally test the root route by requesting '/' ? === Rails 2.3.8 (testing with Mocha) In my routes.rb file: map.root(:controller => 'application', :action => 'render_404_not_found') In my functional tests I want to verify that a request for '/' will be handled properly: @controller.stubs(:render_404_not_found).returns(666) %w( HEAD GET POST PUT DELETE ).each do |method| @request = ActionController::TestRequest.new @request.env['REQUEST_URI'] = uri @request.path = uri process(uri, nil, nil, nil, method) assert_response(666, "Request for '#{method} #{uri}'" + 'should have 404ed (or 666ed)') end I realise the stub 'returns' clause is incorrect, but I haven't gotten there yet: test_bogus_uri_path(EdgeConditionsTest): ActionController::RoutingError: /usr/lib/ruby/gems/1.8/gems/ \ actionpack-2.3.8/lib /action_controller/routing/route_set.rb:420: \ in `generate': No route matches {:controller=>"application", :action=>"/"} So how do I test that this route is working and invoking #render_404_not_found ? Thanks!
0
3,027,573
06/12/2010 05:13:05
160,966
08/21/2009 17:49:04
333
6
Good blogging service for writing posts about coding
I'm looking for a blogging service (like blogspot.com) where I can quickly start to get thing going, and was wondering which was suited to write technical posts, i.e. one that has a good common way to embed source snippets, perhaps even with syntax highlighting for some languages ?
syntax-highlighting
blogs
null
null
null
11/25/2011 13:58:59
not constructive
Good blogging service for writing posts about coding === I'm looking for a blogging service (like blogspot.com) where I can quickly start to get thing going, and was wondering which was suited to write technical posts, i.e. one that has a good common way to embed source snippets, perhaps even with syntax highlighting for some languages ?
4
1,429,476
09/15/2009 20:36:36
143,813
07/23/2009 15:15:37
482
13
longest common substring problem
Does anyone know of an R package that solves [the longest common substring problem][1]? I am looking for something fast that could work on vectors. [1]: http://en.wikipedia.org/wiki/Longest_common_substring_problem
r
string
null
null
null
null
open
longest common substring problem === Does anyone know of an R package that solves [the longest common substring problem][1]? I am looking for something fast that could work on vectors. [1]: http://en.wikipedia.org/wiki/Longest_common_substring_problem
0
10,401,657
05/01/2012 17:30:32
1,260,500
03/10/2012 02:21:24
-5
0
I need to make analog clock that works on Internet Explorer
I have asked the question below, but was unfairly closed without giving me any useful information nor asking me for clarification, I am going to ask it again hoping someone would be kind enough to answer instead of wrongly using their authority: I need to put analog clocks in a customer's web page. What I need hete is not a complete code, even though if it ever exists I wouldn't mind, but a guidance on how to implement The clocks hands and how to make them move. The calculations of time and clock time zone is something I can do. One last thing, I need that to work on IE browser 7 and above.
javascript
html
null
null
null
05/02/2012 15:26:48
not constructive
I need to make analog clock that works on Internet Explorer === I have asked the question below, but was unfairly closed without giving me any useful information nor asking me for clarification, I am going to ask it again hoping someone would be kind enough to answer instead of wrongly using their authority: I need to put analog clocks in a customer's web page. What I need hete is not a complete code, even though if it ever exists I wouldn't mind, but a guidance on how to implement The clocks hands and how to make them move. The calculations of time and clock time zone is something I can do. One last thing, I need that to work on IE browser 7 and above.
4
9,293,042
02/15/2012 12:05:18
127,511
06/23/2009 11:20:09
487
12
MYSQLDUMP without the password prompt
I would like to know the command to perform a mysqldump of a database without the prompt for the password. REASON: I would like to run a cron job, which takes a mysqldump of the database once everyday. Therefore, I can be able to insert the password when prompted. How could I solve this ?
mysql
ubuntu
mysqldump
null
null
null
open
MYSQLDUMP without the password prompt === I would like to know the command to perform a mysqldump of a database without the prompt for the password. REASON: I would like to run a cron job, which takes a mysqldump of the database once everyday. Therefore, I can be able to insert the password when prompted. How could I solve this ?
0
4,593,169
01/04/2011 11:39:40
562,481
01/04/2011 11:39:40
1
0
XSOM Parser for Win CE
I would like to use the xsom.jar for parsing xsd files, it's working like charm in PC/Laptop. But my requirement is to run my application on an embedded device having Win CE 6.0 operating system. when run my application in my target device, I get, "java.lang.reflect.InvocationTargetException" I did some debugging and found that the error raises from the line where in instantiate the XSOMParser I think that it's due to some dependency lib missing, but not sure what it could be. Please help/guide me in resolving this. Regards Bharatha Selvan.
java
null
null
null
null
null
open
XSOM Parser for Win CE === I would like to use the xsom.jar for parsing xsd files, it's working like charm in PC/Laptop. But my requirement is to run my application on an embedded device having Win CE 6.0 operating system. when run my application in my target device, I get, "java.lang.reflect.InvocationTargetException" I did some debugging and found that the error raises from the line where in instantiate the XSOMParser I think that it's due to some dependency lib missing, but not sure what it could be. Please help/guide me in resolving this. Regards Bharatha Selvan.
0
10,929,506
06/07/2012 09:53:25
1,088,286
12/08/2011 17:59:08
79
1
Wild NSUserDefaults changes values
I save a bool value in NSUserDefaults like this: [[NSUserDefaults standardUserDefaults]setBool:NO forKey:@"password"]; And then I synchronize defaults like this: [[NSUserDefaults standardUserDefaults]synchronize]; But when my app enters background and then enters foreground my bool changes value to `YES` Why does that happen ? I set my bool to `YES` only in one place in program, which is not managing when my app leaves/enters foreground. Thanks!
iphone
objective-c
ios
xcode
nsuserdefaults
null
open
Wild NSUserDefaults changes values === I save a bool value in NSUserDefaults like this: [[NSUserDefaults standardUserDefaults]setBool:NO forKey:@"password"]; And then I synchronize defaults like this: [[NSUserDefaults standardUserDefaults]synchronize]; But when my app enters background and then enters foreground my bool changes value to `YES` Why does that happen ? I set my bool to `YES` only in one place in program, which is not managing when my app leaves/enters foreground. Thanks!
0
4,388,719
12/08/2010 14:42:19
535,107
12/08/2010 14:29:37
1
1
Magento category display problem on homepage on the left and right column
Hi i have magento store in which i have 4 category which i want to display on my homepage on 2 on left column and 2 on right column so how could that possible?
magento
null
null
null
null
null
open
Magento category display problem on homepage on the left and right column === Hi i have magento store in which i have 4 category which i want to display on my homepage on 2 on left column and 2 on right column so how could that possible?
0
10,443,428
05/04/2012 05:59:30
1,148,258
01/13/2012 18:05:50
3
0
Proxy Username/Password in Apache HttpClient
I'm looking to perform a GET on the yahoo currency rate service via Apache HttpClient 4.1.2, but I'm getting an UknownHostException when I'm accessing via company firewall. The code works fine when I try it from home(without any proxy config, of course), though. Also, the URL opens on my browser, but can't be pinged from command prompt. A sample URL is <a href="http://quote.yahoo.com/d/quotes.csv?f=l1&s=USDINR=X">http://quote.yahoo.com/d/quotes.csv?f=l1&s=USDINR=X</a> Here's the code I used to connect to the Yahoo finance service: DefaultHttpClient httpClient = new DefaultHttpClient(); HttpConnectionParams.setConnectionTimeout(httpClient.getParams(), 10000); /** Proxy Config */ AuthScope auth = new AuthScope("PROXY_HOST", PROXY_PORT); Credentials creds = new UsernamePasswordCredentials("MY_USERNAME", "MY_PASSWORD"); httpClient.getCredentialsProvider().setCredentials(auth, creds) /*Proxy config ends */ HttpHost targetHost = new HttpHost(SERVER_URL); String urlParams = "?f=l1"; if(!params.isEmpty()) { for(String param : params) { String paramString = "s=" + URLEncoder.encode(param, DEFAULT_ENCODING) + "=X"; urlParams += (urlParams.length() > 1) ? ("&" + paramString) : paramString; } } HttpGet httpget = new HttpGet(urlParams); HttpResponse response = httpClient.execute(targetHost, httpget); HttpEntity entity = response.getEntity(); InputStream instream = entity.getContent(); I also tried the following proxy config, but couldn't find out how to add the username/password. HttpHost proxy = new HttpHost("PROXY_HOST", PROXY_PORT); httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy); Thanks,<br/> Debojit
proxy
httpclient
apache-httpcomponents
null
null
null
open
Proxy Username/Password in Apache HttpClient === I'm looking to perform a GET on the yahoo currency rate service via Apache HttpClient 4.1.2, but I'm getting an UknownHostException when I'm accessing via company firewall. The code works fine when I try it from home(without any proxy config, of course), though. Also, the URL opens on my browser, but can't be pinged from command prompt. A sample URL is <a href="http://quote.yahoo.com/d/quotes.csv?f=l1&s=USDINR=X">http://quote.yahoo.com/d/quotes.csv?f=l1&s=USDINR=X</a> Here's the code I used to connect to the Yahoo finance service: DefaultHttpClient httpClient = new DefaultHttpClient(); HttpConnectionParams.setConnectionTimeout(httpClient.getParams(), 10000); /** Proxy Config */ AuthScope auth = new AuthScope("PROXY_HOST", PROXY_PORT); Credentials creds = new UsernamePasswordCredentials("MY_USERNAME", "MY_PASSWORD"); httpClient.getCredentialsProvider().setCredentials(auth, creds) /*Proxy config ends */ HttpHost targetHost = new HttpHost(SERVER_URL); String urlParams = "?f=l1"; if(!params.isEmpty()) { for(String param : params) { String paramString = "s=" + URLEncoder.encode(param, DEFAULT_ENCODING) + "=X"; urlParams += (urlParams.length() > 1) ? ("&" + paramString) : paramString; } } HttpGet httpget = new HttpGet(urlParams); HttpResponse response = httpClient.execute(targetHost, httpget); HttpEntity entity = response.getEntity(); InputStream instream = entity.getContent(); I also tried the following proxy config, but couldn't find out how to add the username/password. HttpHost proxy = new HttpHost("PROXY_HOST", PROXY_PORT); httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy); Thanks,<br/> Debojit
0
8,426,084
12/08/2011 04:15:43
1,005,073
10/20/2011 11:16:08
1
0
How to Store the game score in android cocos2d
I calculates the score in game project using android cocos2d, in that game after finishing the first level it goes to the next level, so i want to store that first level score and also add next level scores. how can i store that scores in android-cocos2d.
cocos2d-android
null
null
null
null
null
open
How to Store the game score in android cocos2d === I calculates the score in game project using android cocos2d, in that game after finishing the first level it goes to the next level, so i want to store that first level score and also add next level scores. how can i store that scores in android-cocos2d.
0
5,294,564
03/14/2011 03:57:59
658,204
03/14/2011 03:57:59
1
0
Wi-fi calling application
What should I use to convert voice to text and security protocols to transfer the text.
android
null
null
null
null
03/14/2011 04:14:57
not a real question
Wi-fi calling application === What should I use to convert voice to text and security protocols to transfer the text.
1
8,225,048
11/22/2011 10:06:56
329,226
04/29/2010 19:26:30
222
21
Openoffice headless memory optimizations
I run openoffice in headless mode on Webfaction hosting (they actually have OpenOffice.org 3.2 installed) and use it to convert odt to pdf with appy.pod python module. The problem is that after migrating to the new server (Centos6-64bit, OpenOffice.org 3.1), it consumes too much ram (80mb) after first conversion (20mb more). I have read this about memory settings: http://www.addictivetips.com/ubuntu-linux-tips/speed-up-openoffice-with-simple-memory-tweak/ and I need to know if I can tweak these settings using configuration files in user home directory. Any tips on headless openoffice memory optimizations are welcome.
openoffice.org
pyuno
null
null
null
11/25/2011 07:49:35
off topic
Openoffice headless memory optimizations === I run openoffice in headless mode on Webfaction hosting (they actually have OpenOffice.org 3.2 installed) and use it to convert odt to pdf with appy.pod python module. The problem is that after migrating to the new server (Centos6-64bit, OpenOffice.org 3.1), it consumes too much ram (80mb) after first conversion (20mb more). I have read this about memory settings: http://www.addictivetips.com/ubuntu-linux-tips/speed-up-openoffice-with-simple-memory-tweak/ and I need to know if I can tweak these settings using configuration files in user home directory. Any tips on headless openoffice memory optimizations are welcome.
2
7,715,987
10/10/2011 16:43:21
226,507
12/07/2009 16:43:51
1,635
110
how much effort to port javascript apps to Dart
I'm curious how hard it will be, if you have a fairly large javascript app or library, to convert that app to Dart. I'm looking at the Dart documentation that came out a few hours ago, and trying to figure out what javascript features it *doesn't* support, and otherwise just how similar it is. Superficially it seems quite similar to javascript, of course, but obviously it is not a strict superset. So the big question for me is whether there are so many things that are different that porting something would be more trouble than it is worth. Any first impressions from people who might have dug deeper in the docs than I have?
javascript
google-dart
null
null
null
10/10/2011 19:13:45
not a real question
how much effort to port javascript apps to Dart === I'm curious how hard it will be, if you have a fairly large javascript app or library, to convert that app to Dart. I'm looking at the Dart documentation that came out a few hours ago, and trying to figure out what javascript features it *doesn't* support, and otherwise just how similar it is. Superficially it seems quite similar to javascript, of course, but obviously it is not a strict superset. So the big question for me is whether there are so many things that are different that porting something would be more trouble than it is worth. Any first impressions from people who might have dug deeper in the docs than I have?
1
8,492,208
12/13/2011 16:00:39
760,807
05/19/2011 09:53:31
2,305
26
Reading shared data inside a signal handler
I am in a situation where I need to read a binary search tree (BST) inside a signal handler ( SIGSEGV signal handler, which according to my knowledge is per thread base). The BST can be modified by the other threads in the application. Now since a signal handler can't use semaphores, mutexes etc. and therefore can't access shared data, How do I solve this problem? Note that my application is multithreaded and running on a multicore system.
c
linux
mutex
signals
signal-handling
null
open
Reading shared data inside a signal handler === I am in a situation where I need to read a binary search tree (BST) inside a signal handler ( SIGSEGV signal handler, which according to my knowledge is per thread base). The BST can be modified by the other threads in the application. Now since a signal handler can't use semaphores, mutexes etc. and therefore can't access shared data, How do I solve this problem? Note that my application is multithreaded and running on a multicore system.
0
6,270,432
06/07/2011 19:17:02
430,167
08/25/2010 00:46:22
1,127
54
Reminder Calender with extra notes c#
Hi i want to build functionality of reminder,but have no clue how to implement it. Say i have textbox that has some description of task and date time control for selecting date at what i have to do that task.Now how can i implement such thing that once task has been scheduled and i am using the application's other functions (say app contains some other functions also except reminder) when date is near a messagebox shoes and i am informed that i scheduled some task some days ago may be my description is unclear but i need something Reminder that displays the scheduled task some time earlier. oh yes all the data is stored in SQLLite database
c#
winforms
calendar
reminders
todo
null
open
Reminder Calender with extra notes c# === Hi i want to build functionality of reminder,but have no clue how to implement it. Say i have textbox that has some description of task and date time control for selecting date at what i have to do that task.Now how can i implement such thing that once task has been scheduled and i am using the application's other functions (say app contains some other functions also except reminder) when date is near a messagebox shoes and i am informed that i scheduled some task some days ago may be my description is unclear but i need something Reminder that displays the scheduled task some time earlier. oh yes all the data is stored in SQLLite database
0
3,229,665
07/12/2010 15:19:13
1,712
08/18/2008 07:45:44
603
30
UPnP library for Java
Is there a library for implementing service discovery and publishing via UPnP? (I am trying to find some alternatives to JmDNS that while protocol-wise worked fine for our purposes, was highly unstable as a library, having an unacceptably bad tendency for deadlocking itself.)
java
upnp
service-discovery
null
null
01/25/2012 15:51:35
not constructive
UPnP library for Java === Is there a library for implementing service discovery and publishing via UPnP? (I am trying to find some alternatives to JmDNS that while protocol-wise worked fine for our purposes, was highly unstable as a library, having an unacceptably bad tendency for deadlocking itself.)
4
2,764,077
05/04/2010 09:14:12
173,668
09/15/2009 11:24:01
66
4
boost::asio::local::stream_protocol::iostream does not work?
Referencing an [old (from 2008) discussion][1]: There is a compile error when trying to use boost::asio::local::stream_protocol::iostream There was no solution on the discussion forum and I've run into the same problem, it seems. Has there been a fix or solution for the compile error? How can I use boost::asio::local::stream_protocol::iostream? [1]: http://old.nabble.com/Problems-with-boost::asio::local::stream_protocol::iostream-under-Boost-1.36.0-td19462107.html
boost-asio
c++
null
null
null
null
open
boost::asio::local::stream_protocol::iostream does not work? === Referencing an [old (from 2008) discussion][1]: There is a compile error when trying to use boost::asio::local::stream_protocol::iostream There was no solution on the discussion forum and I've run into the same problem, it seems. Has there been a fix or solution for the compile error? How can I use boost::asio::local::stream_protocol::iostream? [1]: http://old.nabble.com/Problems-with-boost::asio::local::stream_protocol::iostream-under-Boost-1.36.0-td19462107.html
0
8,899,720
01/17/2012 18:26:58
496,401
11/03/2010 19:45:01
106
7
Doctrine foreach query - what is wrong?
I do have an array called $zip_in_distance Array ([0] => Array([zip] => 12345, [distance] => 12345)). If I am going to print the $value[zip], it is correct. But I get an empty array back. When I don't use a foreach-loop and I do manual the query, it is working. What do I do wrong? $shop = array(); foreach ($zip_in_distance as $key => $value) { $q = Doctrine_Query::create() ->from('market m') ->where('m.zip = ? ', $value['zip']) ->execute(); $shop[] = $q; } return $shop; My template: foreach ($shops as $key => $list) { echo $key . $list['id'] . '<br>'; } Thanks in advance! Craphunter
php
symfony
doctrine
symfony-1.4
doctrine-1.2
null
open
Doctrine foreach query - what is wrong? === I do have an array called $zip_in_distance Array ([0] => Array([zip] => 12345, [distance] => 12345)). If I am going to print the $value[zip], it is correct. But I get an empty array back. When I don't use a foreach-loop and I do manual the query, it is working. What do I do wrong? $shop = array(); foreach ($zip_in_distance as $key => $value) { $q = Doctrine_Query::create() ->from('market m') ->where('m.zip = ? ', $value['zip']) ->execute(); $shop[] = $q; } return $shop; My template: foreach ($shops as $key => $list) { echo $key . $list['id'] . '<br>'; } Thanks in advance! Craphunter
0
5,909,797
05/06/2011 10:02:35
741,523
05/06/2011 10:02:35
1
0
For an MVC architecture, should I prefer Ruby on Rails or PHP
Both languages are new for me.
php
ruby-on-rails
null
null
null
05/06/2011 10:31:34
not a real question
For an MVC architecture, should I prefer Ruby on Rails or PHP === Both languages are new for me.
1
7,210,811
08/26/2011 21:37:51
908,840
08/24/2011 03:50:10
3
0
iOS measuring web page loading time
I searched a lot but couldn't find the way to measure web page loading time with iOS. In the app, I want to show certain page loading time.. Is it possible with iOS sdk or third party sdk? Thanks
ios
null
null
null
null
null
open
iOS measuring web page loading time === I searched a lot but couldn't find the way to measure web page loading time with iOS. In the app, I want to show certain page loading time.. Is it possible with iOS sdk or third party sdk? Thanks
0
10,808,825
05/30/2012 01:18:13
1,211,024
02/15/2012 10:11:23
15
0
C++ function to return array
**I need my function to return an array , but it doesn't take an array as argument as most of search examples show the code is like this:** double myfunction () { double arr[10]; //assign values to the array return arr; } main() { double arr2[10]; arr2[10] = myfunction; //print arr2 } **when I used pointers to display the array , i got values like "CCCCCC"...**
c++
null
null
null
null
null
open
C++ function to return array === **I need my function to return an array , but it doesn't take an array as argument as most of search examples show the code is like this:** double myfunction () { double arr[10]; //assign values to the array return arr; } main() { double arr2[10]; arr2[10] = myfunction; //print arr2 } **when I used pointers to display the array , i got values like "CCCCCC"...**
0
10,152,549
04/14/2012 09:35:30
1,321,507
04/09/2012 08:58:18
20
0
Xcode days between two dates
I need to calculate the days between two dates, I created a code but it gives an error. In fact, as if startDate and endDate are on the same day the result is 0, and I would like to be 1. On the [Apple][1] site I found a possible solution, but I do not know how to use it. Someone could tell me how? @implementation NSCalendar (MySpecialCalculations) -(NSInteger)daysWithinEraFromDate:(NSDate *) startDate toDate:(NSDate *) endDate { NSInteger startDay=[self ordinalityOfUnit:NSDayCalendarUnit inUnit: NSEraCalendarUnit forDate:startDate]; NSInteger endDay=[self ordinalityOfUnit:NSDayCalendarUnit inUnit: NSEraCalendarUnit forDate:endDate]; return endDay-startDay; } @end [1]: https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/DatesAndTimes/Articles/dtCalendricalCalculations.html
xcode
nsdate
nscalendar
null
null
04/14/2012 19:58:29
not a real question
Xcode days between two dates === I need to calculate the days between two dates, I created a code but it gives an error. In fact, as if startDate and endDate are on the same day the result is 0, and I would like to be 1. On the [Apple][1] site I found a possible solution, but I do not know how to use it. Someone could tell me how? @implementation NSCalendar (MySpecialCalculations) -(NSInteger)daysWithinEraFromDate:(NSDate *) startDate toDate:(NSDate *) endDate { NSInteger startDay=[self ordinalityOfUnit:NSDayCalendarUnit inUnit: NSEraCalendarUnit forDate:startDate]; NSInteger endDay=[self ordinalityOfUnit:NSDayCalendarUnit inUnit: NSEraCalendarUnit forDate:endDate]; return endDay-startDay; } @end [1]: https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/DatesAndTimes/Articles/dtCalendricalCalculations.html
1
7,665,111
10/05/2011 17:18:29
749,397
05/11/2011 19:58:02
22
0
how to create an exe file from my created file(.cs file)?
Here my file: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication2 { public static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } } public class Form1 : Form { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } public Form1() { InitializeComponent(); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Text = "Form1"; } #endregion } } as you can see this C# code is whole of codes for running a Winform application that im merged together! ... So,anyway , I want to create an exe file from that C# code ... what should i do? help me please!
c#
winforms
null
null
null
10/05/2011 22:26:36
not a real question
how to create an exe file from my created file(.cs file)? === Here my file: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication2 { public static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } } public class Form1 : Form { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } public Form1() { InitializeComponent(); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Text = "Form1"; } #endregion } } as you can see this C# code is whole of codes for running a Winform application that im merged together! ... So,anyway , I want to create an exe file from that C# code ... what should i do? help me please!
1
2,716,898
04/26/2010 21:07:23
46,782
12/16/2008 19:05:07
819
43
How can I optimize the import of this dataset in mysql?
I've got the following table schema: >>CREATE TABLE `alexa` ( `id` int(10) unsigned NOT NULL, `rank` int(10) unsigned NOT NULL, `domain` varchar(63) NOT NULL, `domainStatus` varchar(6) DEFAULT NULL, PRIMARY KEY (`rank`), KEY `domain` (`domain`), KEY `id` (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 It takes several minutes to import the data. To me that seems rather slow as we're only talking about a million rows of data. What can I do to optimize the insert of this data? (already using disable keys) G-Man
mysql
optimization
table
import
null
null
open
How can I optimize the import of this dataset in mysql? === I've got the following table schema: >>CREATE TABLE `alexa` ( `id` int(10) unsigned NOT NULL, `rank` int(10) unsigned NOT NULL, `domain` varchar(63) NOT NULL, `domainStatus` varchar(6) DEFAULT NULL, PRIMARY KEY (`rank`), KEY `domain` (`domain`), KEY `id` (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 It takes several minutes to import the data. To me that seems rather slow as we're only talking about a million rows of data. What can I do to optimize the insert of this data? (already using disable keys) G-Man
0
9,522,321
03/01/2012 19:05:06
1,221,934
02/20/2012 20:13:09
1
0
No access to Android Market after loading Ice Cream Sandwich
I followed the instructions on the source.android.com website to download, build, and install Android OS v4.0.3 on a Nexus S. Everything seemed fine, I could take pictures, access WiFi to surf the web, etc. The problem is that there is no Market app and I have been unable to install anything via the Market over the web. The apps I had on the phone prior to loading ICS all show as "installed" on the website but they will not sync with the device. Any time I try to install a new app, everything seems to go ok and then it says the download will begin shortly but it never does. I have tried many different things described on posts such as resetting to factory defaults, clearing cache, etc but nothing works. Does anyone know how I can load the Market app or somehow download apps from the Market to manually install?
android
null
null
null
null
03/01/2012 19:25:16
off topic
No access to Android Market after loading Ice Cream Sandwich === I followed the instructions on the source.android.com website to download, build, and install Android OS v4.0.3 on a Nexus S. Everything seemed fine, I could take pictures, access WiFi to surf the web, etc. The problem is that there is no Market app and I have been unable to install anything via the Market over the web. The apps I had on the phone prior to loading ICS all show as "installed" on the website but they will not sync with the device. Any time I try to install a new app, everything seems to go ok and then it says the download will begin shortly but it never does. I have tried many different things described on posts such as resetting to factory defaults, clearing cache, etc but nothing works. Does anyone know how I can load the Market app or somehow download apps from the Market to manually install?
2
8,103,626
11/12/2011 09:28:33
1,038,465
11/09/2011 20:02:36
1
0
Linux TortoiseSVN
Please can you advise me the best analogue of TortoiseSVN on linux? Now I use ArchLinux with openbox. Very important for me to see changes for merged files when commit/update to do small corrections if needed. Thank you.
linux
svn
tortoisesvn
archlinux
null
06/19/2012 07:28:19
not constructive
Linux TortoiseSVN === Please can you advise me the best analogue of TortoiseSVN on linux? Now I use ArchLinux with openbox. Very important for me to see changes for merged files when commit/update to do small corrections if needed. Thank you.
4
933,565
06/01/2009 04:30:23
115,182
05/31/2009 19:08:40
3
0
Get Auto Increment value with MySQL query
I currently have a database with over 6 million rows and growing. I currently do SELECT COUNT(id) FROM table; in order to display the number to my users, but the database is getting large and I have no need to store all of those rows except to be able to show the number. Is there a way to select the auto_increment value to display so that I can clear out most of the rows in the database? Using LAST_INSERT_ID() doesn't seem to work.
mysql
auto-increment
count
null
null
null
open
Get Auto Increment value with MySQL query === I currently have a database with over 6 million rows and growing. I currently do SELECT COUNT(id) FROM table; in order to display the number to my users, but the database is getting large and I have no need to store all of those rows except to be able to show the number. Is there a way to select the auto_increment value to display so that I can clear out most of the rows in the database? Using LAST_INSERT_ID() doesn't seem to work.
0
4,401,490
12/09/2010 17:59:06
326,518
04/27/2010 03:18:10
1,741
109
Constructor Injection Alternatives (Castle Windsor)
I like Constructor injection for dependency injection. It forces a clear declaration of concerns from a type and helps with testability. I like Constructor injection, in _most_ places... Logging as an example where I do not like it. If I have a base class from which many other classes inherit, and I want all of those classes to use an instance of my ILogger (or whatever), and I don't want a static factory (Logger.Instance)...I don't want to have to declare a constructor on every sub-class that takes an ILogger. So, I could have my base class declare the logger as a Property and have it injected that way public class MyBaseClass { public ILogger Logger { get; set; } } ...but 1. That doesn't assure me that Logger _actually_ gets injected and is not null. 2. I don't like having ILogger with a public set So...what other options do I have? (I'm using Castle Windsor). I've contemplated making an interface public interface IInitializable<T> { void Initialize(T instance); } public class MyBaseClass : IInitializable<ILogger>, ...could have other IInitializables too... { protected ILogger Logger { get; private set; } public void Initialize(ILogger instance) { Logger = instance; } } Then having a facility on my container that automatically calls all implementations of `IInitializable<T>` upon type construction... But I'm wondering what other peoples' thoughts are before I go that route...
.net
dependency-injection
inversion-of-control
castle-windsor
null
null
open
Constructor Injection Alternatives (Castle Windsor) === I like Constructor injection for dependency injection. It forces a clear declaration of concerns from a type and helps with testability. I like Constructor injection, in _most_ places... Logging as an example where I do not like it. If I have a base class from which many other classes inherit, and I want all of those classes to use an instance of my ILogger (or whatever), and I don't want a static factory (Logger.Instance)...I don't want to have to declare a constructor on every sub-class that takes an ILogger. So, I could have my base class declare the logger as a Property and have it injected that way public class MyBaseClass { public ILogger Logger { get; set; } } ...but 1. That doesn't assure me that Logger _actually_ gets injected and is not null. 2. I don't like having ILogger with a public set So...what other options do I have? (I'm using Castle Windsor). I've contemplated making an interface public interface IInitializable<T> { void Initialize(T instance); } public class MyBaseClass : IInitializable<ILogger>, ...could have other IInitializables too... { protected ILogger Logger { get; private set; } public void Initialize(ILogger instance) { Logger = instance; } } Then having a facility on my container that automatically calls all implementations of `IInitializable<T>` upon type construction... But I'm wondering what other peoples' thoughts are before I go that route...
0
9,028,221
01/27/2012 02:19:48
857,071
07/22/2011 00:47:33
423
13
How to have a logo in the middle of two menu lists?
I am trying to put a logo between two menu lists, but it isnt working. I made a PSD before hand and this is what it is supposed to look like: ![enter image description here][1] However, I just cant accomplish this in html and css for some reason. Here is what it looks like right now: ![enter image description here][2] http://99.198.122.237/qasim/ is the live link. How am I supposed to do this? It just wont work for some reason. My HTML: <body> <div class="nav"> <div class="container"> <div class="menu-left"> <ul> <li><a id="hello" href="#">Home</a></li> <li><a id="about" href="#">About</a></li> </ul> </div> <div class="logo"></div> <div class="menu-right"> <ul> <li><a id="portfolio" href="#">Portfolio</a></li> <li><a id="contact" href="#">Contact</a></li> </ul> </div> </div> </div> </body> My CSS: div { display: block; } .nav { height: 64px; background: url(navigation_bg.png); width: 100%; margin:0 auto; } .container { width: 960px; position: relative; margin:0 auto; } .menu-left, .menu-right { width: 300px; height: 64px; position: absolute; top: 0; } .menu-left { left: 200px; } .menu-right { right: 200px; } .nav ul { list-style:none; margin: 0; padding: 0; height: 64px; line-height: 64px; } .nav ul li { float: left; font-family: 'FuturaStdBoldCondensed'; font-size: 20px; text-shadow: 1px 1px 1px black; text-transform: uppercase; margin:0 20px; } .menu-right ul li { float: right; } .logo { margin: 0 auto; width: 140px; height: 128px; background: url(logo.png) center center rgba(0,0,0, 0.4); border-radius: 0 0 20px 20px; } How do I get this perfectly centered? [1]: http://i.stack.imgur.com/nG5zF.png [2]: http://i.stack.imgur.com/4YgdO.png
html
css
navigation
html-lists
centering
null
open
How to have a logo in the middle of two menu lists? === I am trying to put a logo between two menu lists, but it isnt working. I made a PSD before hand and this is what it is supposed to look like: ![enter image description here][1] However, I just cant accomplish this in html and css for some reason. Here is what it looks like right now: ![enter image description here][2] http://99.198.122.237/qasim/ is the live link. How am I supposed to do this? It just wont work for some reason. My HTML: <body> <div class="nav"> <div class="container"> <div class="menu-left"> <ul> <li><a id="hello" href="#">Home</a></li> <li><a id="about" href="#">About</a></li> </ul> </div> <div class="logo"></div> <div class="menu-right"> <ul> <li><a id="portfolio" href="#">Portfolio</a></li> <li><a id="contact" href="#">Contact</a></li> </ul> </div> </div> </div> </body> My CSS: div { display: block; } .nav { height: 64px; background: url(navigation_bg.png); width: 100%; margin:0 auto; } .container { width: 960px; position: relative; margin:0 auto; } .menu-left, .menu-right { width: 300px; height: 64px; position: absolute; top: 0; } .menu-left { left: 200px; } .menu-right { right: 200px; } .nav ul { list-style:none; margin: 0; padding: 0; height: 64px; line-height: 64px; } .nav ul li { float: left; font-family: 'FuturaStdBoldCondensed'; font-size: 20px; text-shadow: 1px 1px 1px black; text-transform: uppercase; margin:0 20px; } .menu-right ul li { float: right; } .logo { margin: 0 auto; width: 140px; height: 128px; background: url(logo.png) center center rgba(0,0,0, 0.4); border-radius: 0 0 20px 20px; } How do I get this perfectly centered? [1]: http://i.stack.imgur.com/nG5zF.png [2]: http://i.stack.imgur.com/4YgdO.png
0
96,977
09/18/2008 21:06:32
2,577
08/23/2008 03:18:09
605
37
How can I find out what's thrashing my hard drive in XP?
This is a programming question in the sense that I'm experiencing a hardware issue which is keeping me from being able to develop effectively... Anyway, my PC is running insanely slow, but it doesn't appear to be a memory consumption issue or a CPU issue - no programs are running away with too much of either. But something is thrashing my hard drive - the hard drive light just stays on nearly solidly, barely flickering at all, and it never stops. In Vista there would be a likely culprit (superfetch) as well as intrinsic tools to see what the issue is (resource manager, I believe) - but I'm running Windows XP. Is there a way, through a utility or programmatically - to see what it is that's murdering my hard drive performance in Windows XP?
performance
windows-xp
harddrive
null
null
03/15/2011 17:05:08
off topic
How can I find out what's thrashing my hard drive in XP? === This is a programming question in the sense that I'm experiencing a hardware issue which is keeping me from being able to develop effectively... Anyway, my PC is running insanely slow, but it doesn't appear to be a memory consumption issue or a CPU issue - no programs are running away with too much of either. But something is thrashing my hard drive - the hard drive light just stays on nearly solidly, barely flickering at all, and it never stops. In Vista there would be a likely culprit (superfetch) as well as intrinsic tools to see what the issue is (resource manager, I believe) - but I'm running Windows XP. Is there a way, through a utility or programmatically - to see what it is that's murdering my hard drive performance in Windows XP?
2
3,274,044
07/18/2010 02:04:58
93,540
04/21/2009 02:32:02
190
14
Best book on AJAX
We have the very best book by Douglas Crockford, "JavaScript: The Good Parts". I can recommend it to anyone who wants to dig into real good parts of JavaScript. The question is, what is the best book on AJAX? What would you recommend reading?
ajax
books
null
null
null
10/09/2011 14:36:49
not constructive
Best book on AJAX === We have the very best book by Douglas Crockford, "JavaScript: The Good Parts". I can recommend it to anyone who wants to dig into real good parts of JavaScript. The question is, what is the best book on AJAX? What would you recommend reading?
4
9,059,060
01/30/2012 03:38:30
1,177,266
01/30/2012 03:22:25
1
0
BizTalk NSoftware SFTP - Read first file only when second file received
> I have a scenario where client drop an XML and a .FINISHED file. It looks very typical problem but I think SFTP and SSO have made it non-typical. Client writes the .Finished file once it’s done with .XML file. Both file have same name. As you can see I can’t start reading .XML before .FINISHED created. I am developing on BizTalk 2009 using /n software SFTP Adaptor for BizTalk with SSO for authentication. **Notes:** · I have to use SFTP as I can’t use FTP protocol. · There are some solutions I have Googled and tried but all are FTP based and/or using Correlation. · I have to use SSO for managing credentials. /n software SFTP Adaptor provides the feature to use SSO and it is working fine under normal scenario where I have to read/write without waiting for .FINISHED file. ** - I have used following approaches: ** **· Correlation – Parallel/Sequential.** · After spending some time I realised that I can’t use Correlation as I have to wait for .FINISHED file before start reading .XML. Client starts writing XML first and then FINISHED · When I drop the .XML receive location picks the file without waiting for .FINISHED and Orchestration through exception depending upon Correlation type. · For this solution I have got help from following blog http://www.paulvanbrenk.com/blog/CategoryView,category,BizTalk.aspx · Please correct me if I have wrong understanding. · **Using a .Net Component to Get the XML File from SFTP location once .FINISHED received:** · I see this as solution but I am having issue getting file from SFTP site. I have to use SSO for authentication and can’t find any .NET based SFTP solution using SSO. · For this solution I have got help from following site: http://social.msdn.microsoft.com/Forums/en-AU/biztalkgeneral/thread/29938f2f-ba45-4f5d-bb4c-3dfab4c9bd3e Another possible solution is to change /n Software or any other SFTP Adaptor’s receive location or URI within Orchestration at runtime i.e. initially set it to .FINISHED once received change it to .XML and get it. Don’t know how to achieve it but is it possible within orchestration?? Please advice how to resolve this issue as I have already spent fair amount of time on it. Immediate response will be highly appreciated. Kind Regards
biztalk
sftp
correlation
sequential
adaptor
null
open
BizTalk NSoftware SFTP - Read first file only when second file received === > I have a scenario where client drop an XML and a .FINISHED file. It looks very typical problem but I think SFTP and SSO have made it non-typical. Client writes the .Finished file once it’s done with .XML file. Both file have same name. As you can see I can’t start reading .XML before .FINISHED created. I am developing on BizTalk 2009 using /n software SFTP Adaptor for BizTalk with SSO for authentication. **Notes:** · I have to use SFTP as I can’t use FTP protocol. · There are some solutions I have Googled and tried but all are FTP based and/or using Correlation. · I have to use SSO for managing credentials. /n software SFTP Adaptor provides the feature to use SSO and it is working fine under normal scenario where I have to read/write without waiting for .FINISHED file. ** - I have used following approaches: ** **· Correlation – Parallel/Sequential.** · After spending some time I realised that I can’t use Correlation as I have to wait for .FINISHED file before start reading .XML. Client starts writing XML first and then FINISHED · When I drop the .XML receive location picks the file without waiting for .FINISHED and Orchestration through exception depending upon Correlation type. · For this solution I have got help from following blog http://www.paulvanbrenk.com/blog/CategoryView,category,BizTalk.aspx · Please correct me if I have wrong understanding. · **Using a .Net Component to Get the XML File from SFTP location once .FINISHED received:** · I see this as solution but I am having issue getting file from SFTP site. I have to use SSO for authentication and can’t find any .NET based SFTP solution using SSO. · For this solution I have got help from following site: http://social.msdn.microsoft.com/Forums/en-AU/biztalkgeneral/thread/29938f2f-ba45-4f5d-bb4c-3dfab4c9bd3e Another possible solution is to change /n Software or any other SFTP Adaptor’s receive location or URI within Orchestration at runtime i.e. initially set it to .FINISHED once received change it to .XML and get it. Don’t know how to achieve it but is it possible within orchestration?? Please advice how to resolve this issue as I have already spent fair amount of time on it. Immediate response will be highly appreciated. Kind Regards
0
3,988,076
10/21/2010 13:44:05
155,406
08/12/2009 20:54:53
396
9
Export igraph Issues in R
I have generated a few network graphs in igraph. I like to use tkplot, however, after resizing the window manually and changing the layout, my machine freezes up when I try to export or even take a screenshot of the graph. Any ideas? My machine is Windows XP Pro and has 2GB memory. Many thanks in advance.
r
null
null
null
null
null
open
Export igraph Issues in R === I have generated a few network graphs in igraph. I like to use tkplot, however, after resizing the window manually and changing the layout, my machine freezes up when I try to export or even take a screenshot of the graph. Any ideas? My machine is Windows XP Pro and has 2GB memory. Many thanks in advance.
0
3,889,850
10/08/2010 11:02:05
419,050
08/13/2010 00:30:28
10
0
XPS document to PDF,DOC
Which one is the best third party libary to convert XPS to PDF and XPS to DOC.
wpf
pdf
xps
null
null
11/11/2011 13:14:55
not constructive
XPS document to PDF,DOC === Which one is the best third party libary to convert XPS to PDF and XPS to DOC.
4
10,289,049
04/23/2012 22:13:15
1,276,707
03/18/2012 09:00:12
15
1
Exclude rows if the id match
How can i exclude row with same id. Like i have a table of members activity. where member id is repeated many times in the table. I want to get all member id but in this case if i select member id i will get all ids and i want one id only one time not repeating. ID | OwnerID | Date | GroupID 1 1 2012-04-23 19:25:04 1 2 1 2012-04-23 19:26:55 1 3 2 2012-04-23 19:26:56 1 4 1 2012-04-23 19:26:58 1 5 2 2012-04-23 19:27:14 1 Here if i select the OwnerID i will get 1 three times i want to make it 1. Its like i just want to have a list of user who is in this table and don't want how many times he/she comes up in this table. I hope it makes sense.. Thanks in advance.
mysql
query
null
null
null
05/07/2012 15:27:12
not a real question
Exclude rows if the id match === How can i exclude row with same id. Like i have a table of members activity. where member id is repeated many times in the table. I want to get all member id but in this case if i select member id i will get all ids and i want one id only one time not repeating. ID | OwnerID | Date | GroupID 1 1 2012-04-23 19:25:04 1 2 1 2012-04-23 19:26:55 1 3 2 2012-04-23 19:26:56 1 4 1 2012-04-23 19:26:58 1 5 2 2012-04-23 19:27:14 1 Here if i select the OwnerID i will get 1 three times i want to make it 1. Its like i just want to have a list of user who is in this table and don't want how many times he/she comes up in this table. I hope it makes sense.. Thanks in advance.
1
3,173,355
07/04/2010 00:51:51
145,117
07/25/2009 22:33:29
454
12
Python: Passing functions with arguments to a built-in function?
like this <a href="http://stackoverflow.com/questions/3136915/python-passing-all-arguments-of-a-function-to-another-function">question</a> I want to pass a function with arguments. But I want to pass it to built-in functions. Example: files = [ 'hey.txt', 'hello.txt', 'goodbye.jpg', 'howdy.gif' ] def filterex(path, ex): pat = r'.+\.(' + ex + ')$' math = re.search(pat, path) if match and match.group(1) == ex: return true I could use that code with a for loop and an if statement but it's shorter and maybe more readable to use filter(func, seq). But if I understand correctly the function you use with filter only takes one argument which is the item from the sequence. So I was wondering if it's possible to pass more arguments?
python
null
null
null
null
null
open
Python: Passing functions with arguments to a built-in function? === like this <a href="http://stackoverflow.com/questions/3136915/python-passing-all-arguments-of-a-function-to-another-function">question</a> I want to pass a function with arguments. But I want to pass it to built-in functions. Example: files = [ 'hey.txt', 'hello.txt', 'goodbye.jpg', 'howdy.gif' ] def filterex(path, ex): pat = r'.+\.(' + ex + ')$' math = re.search(pat, path) if match and match.group(1) == ex: return true I could use that code with a for loop and an if statement but it's shorter and maybe more readable to use filter(func, seq). But if I understand correctly the function you use with filter only takes one argument which is the item from the sequence. So I was wondering if it's possible to pass more arguments?
0
4,879,173
02/02/2011 19:54:46
589,279
01/25/2011 16:11:30
1
1
How to show volume control of embed video
I would think there would be a simple param for embeded videos to show a volume control but I cannot seem to find anything except stuff on controlling the systems volume using jquery. Is there a way to just enable the built in volume control of an embeded video? If I use this code to embed the video is there a way to enable the volume control of the player? <object CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject" width="220"> <param name="fileName" value="URL of my Video"> <param name="autoStart" value="false"> <param name="showControls" value="true"> <embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="URL of my video" width=220 autoStart=0 showcontrols=1> </object>
video
controls
embedded
volume
null
null
open
How to show volume control of embed video === I would think there would be a simple param for embeded videos to show a volume control but I cannot seem to find anything except stuff on controlling the systems volume using jquery. Is there a way to just enable the built in volume control of an embeded video? If I use this code to embed the video is there a way to enable the volume control of the player? <object CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject" width="220"> <param name="fileName" value="URL of my Video"> <param name="autoStart" value="false"> <param name="showControls" value="true"> <embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="URL of my video" width=220 autoStart=0 showcontrols=1> </object>
0
726,921
04/07/2009 18:04:12
86,411
04/02/2009 20:30:18
30
3
Recommend sprite size for games (XNA)?
**What is the best size for an individual tile in a 2D sprite sheet?** I am creating a sprite sheet and am trying to figure out what the best resolution is to use for each sprite. Is there a standard size I shouldn't go above or below? ex. 64px X 64px, 512px X 512px, etc. I am trying to get HD quality sprites. Think Alien Hominid, Castle Crashers, or World of Goo. Some examples would be nice too, so if you have sprite sheet example please upload them.
c#
xna
null
null
null
03/14/2012 15:07:27
not constructive
Recommend sprite size for games (XNA)? === **What is the best size for an individual tile in a 2D sprite sheet?** I am creating a sprite sheet and am trying to figure out what the best resolution is to use for each sprite. Is there a standard size I shouldn't go above or below? ex. 64px X 64px, 512px X 512px, etc. I am trying to get HD quality sprites. Think Alien Hominid, Castle Crashers, or World of Goo. Some examples would be nice too, so if you have sprite sheet example please upload them.
4
7,234,671
08/29/2011 19:10:22
349,575
05/25/2010 05:00:08
55
12
File upload security
I found this online http://www.scanit.be/uploads/php-file-upload.pdf It's a good guide, I'm just wondering if it's missing anything, or if there are other things I should do to make sure my app is secure.
php
html
security
file-upload
null
08/29/2011 19:19:39
not a real question
File upload security === I found this online http://www.scanit.be/uploads/php-file-upload.pdf It's a good guide, I'm just wondering if it's missing anything, or if there are other things I should do to make sure my app is secure.
1
1,876,815
12/09/2009 20:54:39
115,833
06/02/2009 07:49:04
109
10
What does "-0x1(%edx,%ecx,1)" mean in objdump output?
Using objdump to understand a binary and I realize I'm not fluent enough in ASM syntax. What does the following notion mean? xor %al,-0x1(%edx,%ecx,1) And while you're at it - what should I search for in order to find docs about such notions?
objdump
asm
assembly
null
null
null
open
What does "-0x1(%edx,%ecx,1)" mean in objdump output? === Using objdump to understand a binary and I realize I'm not fluent enough in ASM syntax. What does the following notion mean? xor %al,-0x1(%edx,%ecx,1) And while you're at it - what should I search for in order to find docs about such notions?
0
10,579,480
05/14/2012 08:01:31
134,861
07/08/2009 11:17:38
446
12
Windows Application in Gujarati language
I want to develop Widows Application in Gujarati language. But i don't have any idea how to do this? So Can any one give me suggestion what to do to develop Desktop windows application in Gujarati font?
fonts
desktop-application
windows-applications
null
null
null
open
Windows Application in Gujarati language === I want to develop Widows Application in Gujarati language. But i don't have any idea how to do this? So Can any one give me suggestion what to do to develop Desktop windows application in Gujarati font?
0
10,751,159
05/25/2012 08:37:24
906,933
08/23/2011 02:49:39
16
0
How to change the password input from letters to ****
I am using a very simple php form to password protect one page. I would like the character '*' to appear in the box when they are typing in <form name="form1" method="post" action="checkpw.php"> <table><tr><td colspan="2"> <p class="form"> Password: <span id="formfield"><input name="pw" type="text" id="pw"></span></p></td> <tr><td valign="top"></td><td align="right"><span class="submitbt"><input type="image" class="rollover" src="images/buttons/BTN_Submit.png" id="contact_submit" alt="Submit" width="72px" height="68px" border="0" hover="images/buttons/BTN_Submit_over.png" name="submitbt" value="Login"></span></td> </tr></table> </form>
php
html
forms
passwords
null
05/25/2012 10:43:21
too localized
How to change the password input from letters to **** === I am using a very simple php form to password protect one page. I would like the character '*' to appear in the box when they are typing in <form name="form1" method="post" action="checkpw.php"> <table><tr><td colspan="2"> <p class="form"> Password: <span id="formfield"><input name="pw" type="text" id="pw"></span></p></td> <tr><td valign="top"></td><td align="right"><span class="submitbt"><input type="image" class="rollover" src="images/buttons/BTN_Submit.png" id="contact_submit" alt="Submit" width="72px" height="68px" border="0" hover="images/buttons/BTN_Submit_over.png" name="submitbt" value="Login"></span></td> </tr></table> </form>
3
8,278,346
11/26/2011 12:18:47
1,064,725
11/24/2011 22:27:13
3
0
operator changing the argument of class for no reason (*int)
In my class File, I've: class File { std::vector<char> name, timeOfCreation, timeOfLastEdit, content; std::vector<char>::const_iterator* pPos, *pPosOfEnd; int *pSize; bool *pForcedSize; void setTimeOfLastEdit(); int* indexOfLastChar, *indexOfCurrentChar; friend class Interface; friend class Directory; public: File(std::string, int argSize = 0, std::string arg_content = 0); // constructor File(); // constructor File(const File&); // copy constructor ~File(); // destructor char* returnName(); File& operator = (const File&); File operator += (const int); File operator -= (const int); File& operator ++ (); // prefix File& operator -- (); // prefix File operator ++ (int); // postfix File operator -- (int); // postfix bool operator ! (); int operator () (char*, int); friend bool operator == (const File&, const File&); friend bool operator != (const File&, const File&); friend bool operator >= (const File&, const File&); friend bool operator <= (const File&, const File&); friend bool operator < (const File&, const File&); friend bool operator > (const File&, const File&); friend std::istream & operator >> (std::istream&, File&); friend std::ostream & operator << (std::ostream&, File); }; and my operator () is like this: int File::operator () (char* contentNextNBytes, int n) { int i; int j = 0; std::vector<char>::const_iterator it = content.begin(); for(j = 0; j < *indexOfCurrentChar; j++) ++it; for(i = 0; i < n; i++) { contentNextNBytes[i] = *it; if(i == *indexOfLastChar-1) { contentNextNBytes[i+1] = '\0'; *indexOfCurrentChar = i+1; return i+1; } ++it; } contentNextNBytes[i] = '\0'; *indexOfCurrentChar = n; return n; } In my other class, Interface, I call the operator () with `int i = dir[index](buffer, n)`, where n is num of bytes, and index is the index of the File in directory. Now, as is implemented in the operator, the value *indexOfCurrentChar points to should (and does) become the position of the last character extracted from the File. However when I call the same operator again, for the same index, with `int j = dir[index](buffer, n1)`, right when the program enters the operator {} it changes the value of *indexOfCurrentChar to 0 again, while my code should continue from the last char and read the next n1 bytes in File Why does this happen? :( Here's part of the code I'm using to call the operator in the class Interface: buffer = new char[n+1]; k = d[index](buffer, n); std::cout<<"Extracting of "<<k<<" bytes succeeded, and here is the content extracted:\n"; std::cout<<"\""<<buffer<<"\"";
c++
class
pointers
operator-overloading
arguments
null
open
operator changing the argument of class for no reason (*int) === In my class File, I've: class File { std::vector<char> name, timeOfCreation, timeOfLastEdit, content; std::vector<char>::const_iterator* pPos, *pPosOfEnd; int *pSize; bool *pForcedSize; void setTimeOfLastEdit(); int* indexOfLastChar, *indexOfCurrentChar; friend class Interface; friend class Directory; public: File(std::string, int argSize = 0, std::string arg_content = 0); // constructor File(); // constructor File(const File&); // copy constructor ~File(); // destructor char* returnName(); File& operator = (const File&); File operator += (const int); File operator -= (const int); File& operator ++ (); // prefix File& operator -- (); // prefix File operator ++ (int); // postfix File operator -- (int); // postfix bool operator ! (); int operator () (char*, int); friend bool operator == (const File&, const File&); friend bool operator != (const File&, const File&); friend bool operator >= (const File&, const File&); friend bool operator <= (const File&, const File&); friend bool operator < (const File&, const File&); friend bool operator > (const File&, const File&); friend std::istream & operator >> (std::istream&, File&); friend std::ostream & operator << (std::ostream&, File); }; and my operator () is like this: int File::operator () (char* contentNextNBytes, int n) { int i; int j = 0; std::vector<char>::const_iterator it = content.begin(); for(j = 0; j < *indexOfCurrentChar; j++) ++it; for(i = 0; i < n; i++) { contentNextNBytes[i] = *it; if(i == *indexOfLastChar-1) { contentNextNBytes[i+1] = '\0'; *indexOfCurrentChar = i+1; return i+1; } ++it; } contentNextNBytes[i] = '\0'; *indexOfCurrentChar = n; return n; } In my other class, Interface, I call the operator () with `int i = dir[index](buffer, n)`, where n is num of bytes, and index is the index of the File in directory. Now, as is implemented in the operator, the value *indexOfCurrentChar points to should (and does) become the position of the last character extracted from the File. However when I call the same operator again, for the same index, with `int j = dir[index](buffer, n1)`, right when the program enters the operator {} it changes the value of *indexOfCurrentChar to 0 again, while my code should continue from the last char and read the next n1 bytes in File Why does this happen? :( Here's part of the code I'm using to call the operator in the class Interface: buffer = new char[n+1]; k = d[index](buffer, n); std::cout<<"Extracting of "<<k<<" bytes succeeded, and here is the content extracted:\n"; std::cout<<"\""<<buffer<<"\"";
0
3,600,489
08/30/2010 12:51:45
388,325
07/10/2010 06:52:55
3
2
Custom Rails Validation - multiple fields simultaneously
I'm looking to create a custom validation in Rails. I need to validate that a POSTed start_date_time and end_date_time (together) do not overlap that combination in the database. Example: In the database: ----------------- <pre> start_date 05/15/2000 end_date 05/30/2000 </pre> POSTed: --------------- <pre> start_date 05/10/2000 end_date 05/20/2000 FAILS! </pre> Here's the rub: 1) I want to send *both* start and end fields into the function 2) I want to get the values of *both* POSTed fields to use in building a query. 3) Bonus: I want to use a scope (like say, for a given [:user_id, :event] -- but, again, I want that to be passed in. How do I get the values of the fields? Let's say my function looks like this: --------------------------------------- def self.validates_datetime_not_overlapping(start, finish, scope_attr=[], conf={}) config = { :message => 'some default message' } config.update(conf) # Now what? end I'm sort of stuck at this point. I've scoured the net, and can't figure it out.... I can get the *value* of *either* start *or* finish, but not both **at the same time** by using validate_each ... *Any* help would be _great_! Thanks :)
ruby-on-rails
validation
null
null
null
null
open
Custom Rails Validation - multiple fields simultaneously === I'm looking to create a custom validation in Rails. I need to validate that a POSTed start_date_time and end_date_time (together) do not overlap that combination in the database. Example: In the database: ----------------- <pre> start_date 05/15/2000 end_date 05/30/2000 </pre> POSTed: --------------- <pre> start_date 05/10/2000 end_date 05/20/2000 FAILS! </pre> Here's the rub: 1) I want to send *both* start and end fields into the function 2) I want to get the values of *both* POSTed fields to use in building a query. 3) Bonus: I want to use a scope (like say, for a given [:user_id, :event] -- but, again, I want that to be passed in. How do I get the values of the fields? Let's say my function looks like this: --------------------------------------- def self.validates_datetime_not_overlapping(start, finish, scope_attr=[], conf={}) config = { :message => 'some default message' } config.update(conf) # Now what? end I'm sort of stuck at this point. I've scoured the net, and can't figure it out.... I can get the *value* of *either* start *or* finish, but not both **at the same time** by using validate_each ... *Any* help would be _great_! Thanks :)
0
399,387
12/30/2008 02:31:08
6,054
09/12/2008 05:58:40
15
1
What's your favorite web view for Subversion (SVN) repositories?
I have just built up my first SVN server, along with the mod_dav_svn module for Apache so that I have a rudimentary web view into the repository. There appear to be lots of alternate/additional packages to make the web view more full-featured, along the lines of what you would see at Launchpad or Sourceforge. What's your favorite web view for SVN?
version-control
svn
null
null
null
10/02/2011 11:51:17
not constructive
What's your favorite web view for Subversion (SVN) repositories? === I have just built up my first SVN server, along with the mod_dav_svn module for Apache so that I have a rudimentary web view into the repository. There appear to be lots of alternate/additional packages to make the web view more full-featured, along the lines of what you would see at Launchpad or Sourceforge. What's your favorite web view for SVN?
4
7,168,578
08/23/2011 23:06:44
331,775
05/03/2010 20:36:41
21
2
Free online storage to store application settings
I would like to store my application settings (like user names, passwords, etc) using some online storage or cloud computing It can be SQL or flat file based The most important that it will have some free account type Thanks!
storage
online
null
null
null
11/25/2011 12:30:17
off topic
Free online storage to store application settings === I would like to store my application settings (like user names, passwords, etc) using some online storage or cloud computing It can be SQL or flat file based The most important that it will have some free account type Thanks!
2
4,086,506
11/03/2010 11:19:35
231,465
12/14/2009 17:13:48
434
2
Entity Framework stored procedure with multiple resultsets?
I am new to EF4 . I am using a stored procedure that returns 2 resultsets? I understand that this is not possible and not supported.Pity! What is the workaround? any code examples? Thanks a lot
entity-framework
null
null
null
null
null
open
Entity Framework stored procedure with multiple resultsets? === I am new to EF4 . I am using a stored procedure that returns 2 resultsets? I understand that this is not possible and not supported.Pity! What is the workaround? any code examples? Thanks a lot
0
10,014,968
04/04/2012 16:03:23
548,526
12/20/2010 11:11:38
417
50
Wordpress based website on Ubuntu
Is it advisable to run a wordpress/drupal or joombla production website as root on a ubuntu server ? Any drawbacks for running it as non root ? I somehow get the feeling that I should not allow my ubuntu's root access to the wordpress site.
wordpress
drupal
ubuntu
null
null
04/05/2012 09:10:39
off topic
Wordpress based website on Ubuntu === Is it advisable to run a wordpress/drupal or joombla production website as root on a ubuntu server ? Any drawbacks for running it as non root ? I somehow get the feeling that I should not allow my ubuntu's root access to the wordpress site.
2
11,728,854
07/30/2012 20:10:36
1,230,541
02/24/2012 10:29:52
8
0
importing CSV into mysql with PHP
I have inserting my csv file into MYSQL.Sometimes it does but there are some special characters in the database like 0, 'Ã8.I'm using zend framework. 1. public function indexAction() { $db = Zend_Db_Table::getDefaultAdapter(); $path = 'c:/RAA/test.csv'; $row = 1; $result = array(); if (($handle = fopen("c:/RAA/test.csv", "r")) !== FALSE) { while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { $num = count($data); $row++; for ($i=0; $i < $num; $i++) { $result = array('id' => $data[$i], 'name' => $data[$i], 'description' => $data[$i]); } $db->insert('test', $result); } } exit; }
php
zend-framework
null
null
null
08/01/2012 00:21:47
not a real question
importing CSV into mysql with PHP === I have inserting my csv file into MYSQL.Sometimes it does but there are some special characters in the database like 0, 'Ã8.I'm using zend framework. 1. public function indexAction() { $db = Zend_Db_Table::getDefaultAdapter(); $path = 'c:/RAA/test.csv'; $row = 1; $result = array(); if (($handle = fopen("c:/RAA/test.csv", "r")) !== FALSE) { while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { $num = count($data); $row++; for ($i=0; $i < $num; $i++) { $result = array('id' => $data[$i], 'name' => $data[$i], 'description' => $data[$i]); } $db->insert('test', $result); } } exit; }
1
5,376,465
03/21/2011 10:36:54
385,338
07/07/2010 09:04:30
38
0
sql server 2 views in one
I have 2 Different Views 1. select count(*) as Grandtotal from table x where id=1 2. select count(*) as total from table x where id=1 and [bla bla] Group by id 3. select top1(a) from table y i need to create view that will contain the flowing column GrandTotal, total , a
sql
ssrs-2008
null
null
null
null
open
sql server 2 views in one === I have 2 Different Views 1. select count(*) as Grandtotal from table x where id=1 2. select count(*) as total from table x where id=1 and [bla bla] Group by id 3. select top1(a) from table y i need to create view that will contain the flowing column GrandTotal, total , a
0
10,127,452
04/12/2012 16:07:56
1,187,936
02/03/2012 16:06:54
72
0
Displaying an icon from the database
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.database); ListView lv=(ListView)findViewById(R.id.mylist); dbh = new DatabaseHelper(this); c = dbh.getReadableDatabase().rawQuery("SELECT _id, " + DatabaseHelper.NAME + ", " + DatabaseHelper.LASTNAME + ", " + DatabaseHelper.ans2 + " FROM " + DatabaseHelper.TABLE_NAME, null); // initializing String[] dataFrom ={DatabaseHelper.NAME, DatabaseHelper.LASTNAME, DatabaseHelper.ans2}; int[] dataTo = {R.id.name, R.id.value1, R.id.value2}; SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.row, c, dataFrom, dataTo); lv.setAdapter(adapter); registerForContextMenu(lv); } My row.xml file to display all data. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="left" android:layout_weight="30" android:id="@+id/name" /> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="40" android:gravity="center_horizontal" android:id="@+id/value1" /> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="30" android:gravity="right" android:id="@+id/value2" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="right" android:src="@drawable/ic_launcher" android:id="@+id/icon" /> </LinearLayout> I have successfully created a table with SQlite. I would like to display an icon in each database row which will be displayed ( using List view ) and the icon should depend on a certain element in a row. For example , if the sex ( DatabaseHelper.SEX )is male , then we would display a male icon , and if the sex is female , we would display a female icon. If you look at my XML file , I have an icon already displayed ( which is the default android icon , but this is not what I want ). Any ideas?
android
xml
sqlite
icons
android-listview
null
open
Displaying an icon from the database === public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.database); ListView lv=(ListView)findViewById(R.id.mylist); dbh = new DatabaseHelper(this); c = dbh.getReadableDatabase().rawQuery("SELECT _id, " + DatabaseHelper.NAME + ", " + DatabaseHelper.LASTNAME + ", " + DatabaseHelper.ans2 + " FROM " + DatabaseHelper.TABLE_NAME, null); // initializing String[] dataFrom ={DatabaseHelper.NAME, DatabaseHelper.LASTNAME, DatabaseHelper.ans2}; int[] dataTo = {R.id.name, R.id.value1, R.id.value2}; SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.row, c, dataFrom, dataTo); lv.setAdapter(adapter); registerForContextMenu(lv); } My row.xml file to display all data. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="left" android:layout_weight="30" android:id="@+id/name" /> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="40" android:gravity="center_horizontal" android:id="@+id/value1" /> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="30" android:gravity="right" android:id="@+id/value2" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="right" android:src="@drawable/ic_launcher" android:id="@+id/icon" /> </LinearLayout> I have successfully created a table with SQlite. I would like to display an icon in each database row which will be displayed ( using List view ) and the icon should depend on a certain element in a row. For example , if the sex ( DatabaseHelper.SEX )is male , then we would display a male icon , and if the sex is female , we would display a female icon. If you look at my XML file , I have an icon already displayed ( which is the default android icon , but this is not what I want ). Any ideas?
0
7,827,121
10/19/2011 19:40:12
256,007
01/21/2010 17:10:22
1,088
70
What stable c++11 feature can be used safely
What are the `C++11` features that have got enough mature that I can start using safely in my projects. I am talking about `GCC` mainly I rarely need Visual Studio. and I obviously don't want to include a feature in my code that requires a rewrite after few months. and should I even start using these features in this very beginning ? cause whatever we mostly do is not `c++11 dependent` we can do all things and every things in old school methods too. so should we even start using C++11 features at this early stage ?
c++
c++11
null
null
null
10/20/2011 13:38:49
too localized
What stable c++11 feature can be used safely === What are the `C++11` features that have got enough mature that I can start using safely in my projects. I am talking about `GCC` mainly I rarely need Visual Studio. and I obviously don't want to include a feature in my code that requires a rewrite after few months. and should I even start using these features in this very beginning ? cause whatever we mostly do is not `c++11 dependent` we can do all things and every things in old school methods too. so should we even start using C++11 features at this early stage ?
3
11,079,026
06/18/2012 08:07:37
1,072,672
11/30/2011 04:45:40
77
1
Emacs: Adding custom code block delimiter?
I using emacs to write some [ejs][1] files. I have set (show-paren-mode t) in my .emacs for highlighting parentheses. The ejs code looks like: <ul> <% for(var i=0; i<supplies.length; i++) {%> <li><%= supplies[i] %></li> <% } %> </ul> It seems that this mode doesn't work fine when editing ejs using html-mode. For example, a left '<' in '<%' matches the '}' on the right instead of matching a '%>'. So my question is can I add '<%' as a code block delimiter to make show-paren-mode work fine in ejs files? Any help is appreciated. [1]: http://embeddedjs.com
emacs
syntax-highlighting
delimiter
parentheses
null
null
open
Emacs: Adding custom code block delimiter? === I using emacs to write some [ejs][1] files. I have set (show-paren-mode t) in my .emacs for highlighting parentheses. The ejs code looks like: <ul> <% for(var i=0; i<supplies.length; i++) {%> <li><%= supplies[i] %></li> <% } %> </ul> It seems that this mode doesn't work fine when editing ejs using html-mode. For example, a left '<' in '<%' matches the '}' on the right instead of matching a '%>'. So my question is can I add '<%' as a code block delimiter to make show-paren-mode work fine in ejs files? Any help is appreciated. [1]: http://embeddedjs.com
0
7,139,428
08/21/2011 16:12:27
904,419
08/21/2011 08:10:36
1
0
Running a program (writen in C) in Linux
I'm using Ubuntu. I wrote a program in C which interacts with a Mysql Database The compilation process goes smoothly (excepts several warnings) and I get the executable. How do I run it in Ubuntu? I mean, I use this command : gcc -o magazzino main_magazzino.c -L/usr/include/mysql -lmysqlclient How do I run magazzino? Thanks Margherita
c
null
null
null
null
08/25/2011 01:46:31
off topic
Running a program (writen in C) in Linux === I'm using Ubuntu. I wrote a program in C which interacts with a Mysql Database The compilation process goes smoothly (excepts several warnings) and I get the executable. How do I run it in Ubuntu? I mean, I use this command : gcc -o magazzino main_magazzino.c -L/usr/include/mysql -lmysqlclient How do I run magazzino? Thanks Margherita
2
8,419,620
12/07/2011 17:20:57
1,086,133
12/07/2011 16:59:11
1
0
can we use more than else in c program
Is this possible ? If it's possible describe how it works , otherwise describe what the errors in the program. if(value1>value2) printf("value1 is greater"); else printf("value2 is greater"); else printf("Invalid output"); endif
c++
c
null
null
null
12/07/2011 17:30:48
not a real question
can we use more than else in c program === Is this possible ? If it's possible describe how it works , otherwise describe what the errors in the program. if(value1>value2) printf("value1 is greater"); else printf("value2 is greater"); else printf("Invalid output"); endif
1
7,013,687
08/10/2011 15:43:51
773,527
05/27/2011 17:44:05
16
1
how to fetch selected user details using join query in zend framework
Hi i am new to zend and mysql so please ignore if this is a silly ques. i have two tabels: users and user_cars. Now the user_cars table contains same user with multiple cars. i.e. if a user has three different cars, then the user_cars table contains three entries for that user. Now i want to select a particular user from user_cars table. The userid is given to me. can anyone please tell me how to do that. users: userid, username, password, fname, lname // columns user_cars: id, userid, car_name, purchase_date // columns so i have a userid and want to select all the rows from user_cars with the given userid. can anyone please tell me how to do this.
mysql
zend-db-table
null
null
null
null
open
how to fetch selected user details using join query in zend framework === Hi i am new to zend and mysql so please ignore if this is a silly ques. i have two tabels: users and user_cars. Now the user_cars table contains same user with multiple cars. i.e. if a user has three different cars, then the user_cars table contains three entries for that user. Now i want to select a particular user from user_cars table. The userid is given to me. can anyone please tell me how to do that. users: userid, username, password, fname, lname // columns user_cars: id, userid, car_name, purchase_date // columns so i have a userid and want to select all the rows from user_cars with the given userid. can anyone please tell me how to do this.
0
10,408,479
05/02/2012 06:01:12
1,340,980
04/18/2012 09:49:51
1
0
Using " N " number of Web service request in same thread group in "Jmeter"
I'm using Jmeter2.4. In that I'm trying to use "N" number of webservice(SOAP) Request sampler in a Single Thread Group. But in all that "N" Number WebService(SOAP) Request , the WSDL URL is "http://webservices.daehosting.com/services/TemperatureConversions.wso?WSDL " is Same.,. In that, Web service, it has 4 methods. So i need to check all 4 methods, by using 4 different WebService(SOAP) Request in order to check each method in each request. Problem is: If i choose one method in 1st WebService(SOAP) Request, then in the remaining other 3 WebService(SOAP) Request, the method get changed automatically to same as the one that i have chosen in 1st WebService(SOAP) Request. Expected as: I want to choose other 3 methods in other 3 WebService(SOAP) Request respectively. So that, i can test webservice request for all the 4 methods in 4 different WebService(SOAP) Request. Hope, if any clarification regarding my question, I'm ready to explain in more Thanks, Selva, QA Engineer
web-services
jmeter
null
null
null
null
open
Using " N " number of Web service request in same thread group in "Jmeter" === I'm using Jmeter2.4. In that I'm trying to use "N" number of webservice(SOAP) Request sampler in a Single Thread Group. But in all that "N" Number WebService(SOAP) Request , the WSDL URL is "http://webservices.daehosting.com/services/TemperatureConversions.wso?WSDL " is Same.,. In that, Web service, it has 4 methods. So i need to check all 4 methods, by using 4 different WebService(SOAP) Request in order to check each method in each request. Problem is: If i choose one method in 1st WebService(SOAP) Request, then in the remaining other 3 WebService(SOAP) Request, the method get changed automatically to same as the one that i have chosen in 1st WebService(SOAP) Request. Expected as: I want to choose other 3 methods in other 3 WebService(SOAP) Request respectively. So that, i can test webservice request for all the 4 methods in 4 different WebService(SOAP) Request. Hope, if any clarification regarding my question, I'm ready to explain in more Thanks, Selva, QA Engineer
0
10,335,765
04/26/2012 14:42:24
510,783
11/17/2010 12:42:25
22
0
better way of writing code
Is this a better approach, in terms of code reuse, code modification? I may need to change paymentDao.savePayment() method in many controller files when I need to add a new parameter to the savePayment method in future. I have also thought of creating another class just to pass the parameter only, like paymentDao.savePayment(parameterClass) is this a better solution? or is there even better solution than this? paymentDao.savePayment(fromUserId, toUserId, amount, paymentMethod, note, paymentGateway); class PaymentDaoImpl implements PaymentDao{ public void savePayment(long fromUserId, long toUserId, double amount String paymentMethod, String note, String paymentGateway ){ PaymentStdReln paymentStdReln = new PaymentStdReln(); paymentStdReln.setFromUser(fromUserId); paymentStdReln.setToUserId(toUserId); paymentStdRelnDao.save(paymentStdReln); PaymentGateway pg = new PaymentGateway(); pg.setGateway(paymentGateway); paymentGateWayDao.save(pg); ..... //In this way save into many table } }
oop
design
ooad
null
null
04/27/2012 14:11:22
not constructive
better way of writing code === Is this a better approach, in terms of code reuse, code modification? I may need to change paymentDao.savePayment() method in many controller files when I need to add a new parameter to the savePayment method in future. I have also thought of creating another class just to pass the parameter only, like paymentDao.savePayment(parameterClass) is this a better solution? or is there even better solution than this? paymentDao.savePayment(fromUserId, toUserId, amount, paymentMethod, note, paymentGateway); class PaymentDaoImpl implements PaymentDao{ public void savePayment(long fromUserId, long toUserId, double amount String paymentMethod, String note, String paymentGateway ){ PaymentStdReln paymentStdReln = new PaymentStdReln(); paymentStdReln.setFromUser(fromUserId); paymentStdReln.setToUserId(toUserId); paymentStdRelnDao.save(paymentStdReln); PaymentGateway pg = new PaymentGateway(); pg.setGateway(paymentGateway); paymentGateWayDao.save(pg); ..... //In this way save into many table } }
4
11,160,485
06/22/2012 16:37:06
173,286
09/14/2009 17:34:45
428
14
EnterCriticalSection crashes with more than 64 threads
Is there a thread limit EnterCriticalSection() can cope with? The following code works fine with 64 threads, but it crashes when using 65 or more: CRITICAL_SECTION TestCritSection; unsigned int threadId; int getThreadId() { int tid = -1; EnterCriticalSection(&TestCritSection); tid= threadId; threadId++; LeaveCriticalSection(&TestCritSection); return tid; } void parallelTest() { int tid = getThreadId(); cout << "Thread " << tid << " executed" << endl; } void multiThreadTest() { unsigned int numThreads = 64; // fine, but program crashes when numThreads is set to 65 or more HANDLE *threads = new HANDLE[numThreads]; DWORD ThreadID; threadId = 1; if (!InitializeCriticalSectionAndSpinCount(&TestCritSection, 0x00000400)) return; for (int i=0; i<numThreads; ++i) { threads[i] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) parallelTest, (LPVOID) NULL, 0, &ThreadID); } WaitForMultipleObjects(numThreads, threads, TRUE, INFINITE); DeleteCriticalSection(&TestCritSection); for (int i=0; i<numThreads; ++i) { CloseHandle(threads[i]); } delete [] threads; } I guess CRITICAL_SECTION is internally using a semaphore with a max count of 64. Can I somehow change that?
c++
windows
multithreading
null
null
null
open
EnterCriticalSection crashes with more than 64 threads === Is there a thread limit EnterCriticalSection() can cope with? The following code works fine with 64 threads, but it crashes when using 65 or more: CRITICAL_SECTION TestCritSection; unsigned int threadId; int getThreadId() { int tid = -1; EnterCriticalSection(&TestCritSection); tid= threadId; threadId++; LeaveCriticalSection(&TestCritSection); return tid; } void parallelTest() { int tid = getThreadId(); cout << "Thread " << tid << " executed" << endl; } void multiThreadTest() { unsigned int numThreads = 64; // fine, but program crashes when numThreads is set to 65 or more HANDLE *threads = new HANDLE[numThreads]; DWORD ThreadID; threadId = 1; if (!InitializeCriticalSectionAndSpinCount(&TestCritSection, 0x00000400)) return; for (int i=0; i<numThreads; ++i) { threads[i] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) parallelTest, (LPVOID) NULL, 0, &ThreadID); } WaitForMultipleObjects(numThreads, threads, TRUE, INFINITE); DeleteCriticalSection(&TestCritSection); for (int i=0; i<numThreads; ++i) { CloseHandle(threads[i]); } delete [] threads; } I guess CRITICAL_SECTION is internally using a semaphore with a max count of 64. Can I somehow change that?
0
7,688,878
10/07/2011 14:45:16
534,994
12/08/2010 12:52:30
284
4
How to pretty print XML in bulk
Is there an application that pretty prints XML in bulk? That is you specify a directory full of XML files, rather that do files one by one.
xml
null
null
null
null
10/07/2011 17:37:34
off topic
How to pretty print XML in bulk === Is there an application that pretty prints XML in bulk? That is you specify a directory full of XML files, rather that do files one by one.
2
6,970,043
08/07/2011 01:06:06
831,783
07/06/2011 14:26:55
18
0
URL query clearing php code problem
This is the code that im using for clear any queries in my url.. <?php function curPageURL() { $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} $pageURL .= "://"; if ($_SERVER["SERVER_PORT"] != "80") { $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; } else { $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; $pageURL = substr( $pageURL, 0, strrpos( $pageURL, "?")); } return $pageURL; } ?> this clears > www.mydomian.com/myurl.html?*********** result is > www.mydomian.com/myurl.html Its done....but the thing it when its come with normal URL > www.mydomian.com/myurl.html The result is EMPLTY,NO RESULT ! BUT i want as it is.. no change.. > www.mydomian.com/myurl.html i want the result normall url as it is... Thank You!
php
null
null
null
null
null
open
URL query clearing php code problem === This is the code that im using for clear any queries in my url.. <?php function curPageURL() { $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} $pageURL .= "://"; if ($_SERVER["SERVER_PORT"] != "80") { $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; } else { $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; $pageURL = substr( $pageURL, 0, strrpos( $pageURL, "?")); } return $pageURL; } ?> this clears > www.mydomian.com/myurl.html?*********** result is > www.mydomian.com/myurl.html Its done....but the thing it when its come with normal URL > www.mydomian.com/myurl.html The result is EMPLTY,NO RESULT ! BUT i want as it is.. no change.. > www.mydomian.com/myurl.html i want the result normall url as it is... Thank You!
0
4,062,647
10/31/2010 09:56:10
490,269
10/28/2010 15:21:58
8
0
C what the function of this function?
int getInput (void) { char input[9]; fgets(input, 9, stdin); return atoi(input + 6); } why 9 is a must in char input[9] void printHeader(void) { printf("Content-type: text/html\n\n"); printf("<html>\n"); printf("<head>\n"); printf("<title>%s</title>\n", PROGRAM_NAME); printf("</head>\n"); printf("<body style='padding:25px;'>\n"); } void printFooter(void) { printf("</body>\n"); printf("</html>\n"); } int main() { int n=0; int last1 = 0; int last2 = 1; int current; int max_n = getInput(); printHeader(); printf("<h2>%s</h2>\n", PROGRAM_NAME); printf("The first %d Fibonacci numbers are: \n", max_n); printf("<br />"); while (n < max_n) { if (n == 0) { current = 0; } else if (n == 1) { current = 1; } else { current = last2 + last1; } printf("%d, ", current); last1 = last2; last2 = current; n++; } printf("...\n"); printFooter(); return 0; }
c
null
null
null
null
11/02/2010 00:26:20
not a real question
C what the function of this function? === int getInput (void) { char input[9]; fgets(input, 9, stdin); return atoi(input + 6); } why 9 is a must in char input[9] void printHeader(void) { printf("Content-type: text/html\n\n"); printf("<html>\n"); printf("<head>\n"); printf("<title>%s</title>\n", PROGRAM_NAME); printf("</head>\n"); printf("<body style='padding:25px;'>\n"); } void printFooter(void) { printf("</body>\n"); printf("</html>\n"); } int main() { int n=0; int last1 = 0; int last2 = 1; int current; int max_n = getInput(); printHeader(); printf("<h2>%s</h2>\n", PROGRAM_NAME); printf("The first %d Fibonacci numbers are: \n", max_n); printf("<br />"); while (n < max_n) { if (n == 0) { current = 0; } else if (n == 1) { current = 1; } else { current = last2 + last1; } printf("%d, ", current); last1 = last2; last2 = current; n++; } printf("...\n"); printFooter(); return 0; }
1
8,736,916
01/05/2012 02:32:52
805,820
06/19/2011 23:25:15
44
1
Would adding more threads increase the performance of my program
In my program I have a while loop which iterates through an array list of a bunch of pictures and does a bunch of processing on them to change how they look and their image type and then writes them to the disk. My question is would adding multiple threads to process images or save the images speed things up, if so what would be the best way to go about it. (I suck at using threads)
java
multithreading
performance
null
null
01/05/2012 04:34:39
not a real question
Would adding more threads increase the performance of my program === In my program I have a while loop which iterates through an array list of a bunch of pictures and does a bunch of processing on them to change how they look and their image type and then writes them to the disk. My question is would adding multiple threads to process images or save the images speed things up, if so what would be the best way to go about it. (I suck at using threads)
1
6,215,308
06/02/2011 13:39:38
652,236
03/09/2011 19:19:23
1
0
Strategies for making web app easy to assimilate into another dot com business?
It seems to me that a dot com startup should probably be designed to be bought by a larger dot com. I am interested in development strategies that could help here -- any development patterns, architectural ideas etc. Or it could be just using they right platform. I am probably already on the wrong foot by using asp.net. I am working on an n-tiered architecture connected by web services. Of course it is all on the one machine at the moment. I am trying to build flexibility to swap out the database type (for example to mysql from SQL), in the data access layer. I hope you don't mind dumping some ideas here for me.
asp.net
application
null
null
null
06/02/2011 18:10:07
not constructive
Strategies for making web app easy to assimilate into another dot com business? === It seems to me that a dot com startup should probably be designed to be bought by a larger dot com. I am interested in development strategies that could help here -- any development patterns, architectural ideas etc. Or it could be just using they right platform. I am probably already on the wrong foot by using asp.net. I am working on an n-tiered architecture connected by web services. Of course it is all on the one machine at the moment. I am trying to build flexibility to swap out the database type (for example to mysql from SQL), in the data access layer. I hope you don't mind dumping some ideas here for me.
4
6,923,009
08/03/2011 07:25:14
876,067
08/03/2011 07:20:13
1
0
AppStore App price
I would like to know if there are any regulations from Apple how expansive an app is allowed to be - or are there any properties an app should have if it is very expansive - above 500$. thx, OmidH
ios
app-store
pricing
null
null
08/03/2011 09:09:01
off topic
AppStore App price === I would like to know if there are any regulations from Apple how expansive an app is allowed to be - or are there any properties an app should have if it is very expansive - above 500$. thx, OmidH
2
11,562,536
07/19/2012 14:01:07
33,584
11/03/2008 07:45:07
1,173
25
Update records in table after CTE
I have the following CTE that will give me the DocTotal for the entire invoice. ;WITH CTE_DocTotal AS ( SELECT SUM(Sale + VAT) AS DocTotal FROM PEDI_InvoiceDetail GROUP BY InvoiceNumber ) UPDATE PEDI_InvoiceDetail SET DocTotal = CTE_DocTotal.DocTotal Now with this result I want to enter into the column the DocTotal value inside PEDI_InvoiceDetail. I know is not going to work and I know I am missing something, what is it?
sql
sql-server
tsql
common-table-expression
null
null
open
Update records in table after CTE === I have the following CTE that will give me the DocTotal for the entire invoice. ;WITH CTE_DocTotal AS ( SELECT SUM(Sale + VAT) AS DocTotal FROM PEDI_InvoiceDetail GROUP BY InvoiceNumber ) UPDATE PEDI_InvoiceDetail SET DocTotal = CTE_DocTotal.DocTotal Now with this result I want to enter into the column the DocTotal value inside PEDI_InvoiceDetail. I know is not going to work and I know I am missing something, what is it?
0
9,499,878
02/29/2012 13:18:53
1,098,223
12/14/2011 16:15:15
33
1
is there anything wrong with the thread program?
I sends 1 million message to rabbitmq ,this program is message consumer . when consumer more than half a million ,my program is shutdown or slowness. "processLogs" method spring-amqp .when has the message method be called. the SimpleMessageListenerContainer concurrentConsumers has 10. I don't know what's wrong .thank your help. private LogMapper logMapper; private int maxnum = 10000; private LinkedBlockingQueue<Log> events = new LinkedBlockingQueue<Log>(); private ExecutorService senderPool = null; private int senderPoolSize = 10; private final long maxtime = maxnum*senderPoolSize; protected class EventSender implements Runnable { @Override public void run() { insertLogs(); } } //the method is rabbitmq consumer public void processLogs(AmqpLogMessage msg) { if (null == senderPool) { startSenders(); } Log log = new Log(); log.setApp(msg.getApplicationId()); log.setLevel(msg.getLevel()); log.setLogger(msg.getLogger()); log.setContents(msg.getMessage()); log.setRecordInsertDate(new Date()); log.setProduceDate(new Date(msg.getTimestamp())); log.setConsumeDate(new Date(msg.getTimestamp())); this.events.offer(log); //this.logMapper.insert(log); } @Transactional void insertLogs() { List<Log> list = new ArrayList<Log>(); long dida = 0; while(true){ long bg = System.currentTimeMillis(); try { final Log log = this.events.take(); list.add(log); if(dida>=maxtime||list.size() > maxnum){ if(list.size()>0){ this.logMapper.insertBatch(list); } list = new ArrayList<Log>(); dida=0; } } catch (InterruptedException e) { logger.error(e); } dida+=(System.currentTimeMillis()-bg); } }
java
spring
thread-safety
spring-amqp
null
02/29/2012 13:29:30
too localized
is there anything wrong with the thread program? === I sends 1 million message to rabbitmq ,this program is message consumer . when consumer more than half a million ,my program is shutdown or slowness. "processLogs" method spring-amqp .when has the message method be called. the SimpleMessageListenerContainer concurrentConsumers has 10. I don't know what's wrong .thank your help. private LogMapper logMapper; private int maxnum = 10000; private LinkedBlockingQueue<Log> events = new LinkedBlockingQueue<Log>(); private ExecutorService senderPool = null; private int senderPoolSize = 10; private final long maxtime = maxnum*senderPoolSize; protected class EventSender implements Runnable { @Override public void run() { insertLogs(); } } //the method is rabbitmq consumer public void processLogs(AmqpLogMessage msg) { if (null == senderPool) { startSenders(); } Log log = new Log(); log.setApp(msg.getApplicationId()); log.setLevel(msg.getLevel()); log.setLogger(msg.getLogger()); log.setContents(msg.getMessage()); log.setRecordInsertDate(new Date()); log.setProduceDate(new Date(msg.getTimestamp())); log.setConsumeDate(new Date(msg.getTimestamp())); this.events.offer(log); //this.logMapper.insert(log); } @Transactional void insertLogs() { List<Log> list = new ArrayList<Log>(); long dida = 0; while(true){ long bg = System.currentTimeMillis(); try { final Log log = this.events.take(); list.add(log); if(dida>=maxtime||list.size() > maxnum){ if(list.size()>0){ this.logMapper.insertBatch(list); } list = new ArrayList<Log>(); dida=0; } } catch (InterruptedException e) { logger.error(e); } dida+=(System.currentTimeMillis()-bg); } }
3
10,791,649
05/29/2012 00:04:18
991,229
10/12/2011 10:16:10
152
2
java spring - why ñ changes to ñ?
I don't understand whenever I save any string that contains ñ it changes to ñ. Even in the database the ñ is changed to ñ. Examples: * ñ becomes ñ. * Niño becomes Niño. I don't have any clue what causes this problem or where the problem is coming from. Please help. Thanks in advance.
java
spring-mvc
null
null
null
null
open
java spring - why ñ changes to ñ? === I don't understand whenever I save any string that contains ñ it changes to ñ. Even in the database the ñ is changed to ñ. Examples: * ñ becomes ñ. * Niño becomes Niño. I don't have any clue what causes this problem or where the problem is coming from. Please help. Thanks in advance.
0
9,676,580
03/13/2012 00:03:46
1,188,766
02/04/2012 01:53:53
6
0
IO File code is being inconsistent
The output from my function is being inconsistent. The function is suppose to open a file then extract integers from the file and then set the integers into an array. I am having problems extracting from the file to the array if there are 20 integers. When I try to do this, I am seeing that the "array is outside of bounds." The function is also suppose to cout prompts if the file name is incorrect or if the file does not have an integer in its context. Both of these seem to be working properly. Any help would be greatly appreciated. bool loadArrayFromFile(int a[], int &n) { ifstream infile; string fileName; cout<<"Enter the name of file: "; cin>>fileName; infile.open(fileName.c_str()); if(!infile) { cout<<"File didn't open"<<endl; //if file name is incorrect or could not be opened return false; } int count=0; //count values in file int elem=0; //keeps track of elements infile>>a[elem]; while(infile.good()) { elem++; count++; infile>>a[elem]; } if(!infile.eof()) { cout<<"Wrong datatype in file"<<endl; infile.clear(); infile.close(); return false; } n=count; infile.close(); return true; }
c++
file-io
ifstream
eof
null
null
open
IO File code is being inconsistent === The output from my function is being inconsistent. The function is suppose to open a file then extract integers from the file and then set the integers into an array. I am having problems extracting from the file to the array if there are 20 integers. When I try to do this, I am seeing that the "array is outside of bounds." The function is also suppose to cout prompts if the file name is incorrect or if the file does not have an integer in its context. Both of these seem to be working properly. Any help would be greatly appreciated. bool loadArrayFromFile(int a[], int &n) { ifstream infile; string fileName; cout<<"Enter the name of file: "; cin>>fileName; infile.open(fileName.c_str()); if(!infile) { cout<<"File didn't open"<<endl; //if file name is incorrect or could not be opened return false; } int count=0; //count values in file int elem=0; //keeps track of elements infile>>a[elem]; while(infile.good()) { elem++; count++; infile>>a[elem]; } if(!infile.eof()) { cout<<"Wrong datatype in file"<<endl; infile.clear(); infile.close(); return false; } n=count; infile.close(); return true; }
0
6,238,312
06/04/2011 17:30:47
755,481
05/16/2011 10:31:24
81
1
Remove all if None English from a string
I have a string that contain None-English : អត���រាប���រូរប���រាក���ថ���ង���ទី 03-06-2011 ម������ង 07:30 នាទី រូបិយប���ឞ���ឞ​ អត���រា​ ទិញចូល លក���ច���ញ រូបិយប���ឞ���ឞ​ប���រទ�����​អា�����ីប���រាក���រ���ល (1usd)4,1004,107បាត ថ���ឡង��� (1usd)30.1530.23រុង Anybody could tell me how can I remove the non-english string the result to be like this: #03-06-2011 # 07:30 #(1usd)4,1004,107#(1usd)30.1530.23#
php5
null
null
null
null
null
open
Remove all if None English from a string === I have a string that contain None-English : អត���រាប���រូរប���រាក���ថ���ង���ទី 03-06-2011 ម������ង 07:30 នាទី រូបិយប���ឞ���ឞ​ អត���រា​ ទិញចូល លក���ច���ញ រូបិយប���ឞ���ឞ​ប���រទ�����​អា�����ីប���រាក���រ���ល (1usd)4,1004,107បាត ថ���ឡង��� (1usd)30.1530.23រុង Anybody could tell me how can I remove the non-english string the result to be like this: #03-06-2011 # 07:30 #(1usd)4,1004,107#(1usd)30.1530.23#
0
5,523,660
04/02/2011 14:14:00
307,006
04/01/2010 15:07:50
71
1
Marketable skills - Should I learn JQuery and PHP?
I know there are seemingly similar questions on stackoverflow, but this is more specific. I am a Java programmer (academic for six years) but am looking for more marketable skills so I can get a job after my master's is complete. We all know that the vast majority of startups today are web based, so its PHP, JavaScript, SQL, maybe Python and Ruby, and maybe Java they want on your resume. I am great with Java for academic purposes, and have a good handle on Oo practices. I have thoroughly read Effective Java and always attempt to code with good Oo practices no matter the project I am working on. So, to make myself more marketable, I'm trying to learn all this new web programming stuff like JavaScript and PHP. The problem is, this whole Ajax world is so full of languages and technologies and lingo that is really really hard to learn from scratch. Moreover, a lot of stuff seems to written for the non-programmer, which is not what I want. So, should I learn JQuery and PHP? What about Dojo? What is the best way to learn all this stuff together? Right now, its an extremely daunting task to not only understand the languages (thats probably the easiest part) to understanding the API's like JQuery and understanding the frameworks and general ways of doing things like Ajax. I really need to get hired for a programming position when I finish my masters. I really, really love programming and just need that first job so I can get some industry experience and it will be that much easier to apply for jobs in the future. Thanks for any advice!
php
jquery
null
null
null
04/02/2011 14:24:46
off topic
Marketable skills - Should I learn JQuery and PHP? === I know there are seemingly similar questions on stackoverflow, but this is more specific. I am a Java programmer (academic for six years) but am looking for more marketable skills so I can get a job after my master's is complete. We all know that the vast majority of startups today are web based, so its PHP, JavaScript, SQL, maybe Python and Ruby, and maybe Java they want on your resume. I am great with Java for academic purposes, and have a good handle on Oo practices. I have thoroughly read Effective Java and always attempt to code with good Oo practices no matter the project I am working on. So, to make myself more marketable, I'm trying to learn all this new web programming stuff like JavaScript and PHP. The problem is, this whole Ajax world is so full of languages and technologies and lingo that is really really hard to learn from scratch. Moreover, a lot of stuff seems to written for the non-programmer, which is not what I want. So, should I learn JQuery and PHP? What about Dojo? What is the best way to learn all this stuff together? Right now, its an extremely daunting task to not only understand the languages (thats probably the easiest part) to understanding the API's like JQuery and understanding the frameworks and general ways of doing things like Ajax. I really need to get hired for a programming position when I finish my masters. I really, really love programming and just need that first job so I can get some industry experience and it will be that much easier to apply for jobs in the future. Thanks for any advice!
2
10,412,041
05/02/2012 10:37:49
1,222,651
02/21/2012 05:54:21
20
1
Create an object with a String and and method overloading
I have a String which can either be of Double or Integer type or some other type. I first need to create a Double or Integer object and then send it over to a overloaded method. Here's my code so far; public void doStuff1(object obj, String dataType){ if ("Double".equalsIgnoreCase(dataType)) { doStuff2(Double.valueOf(obj.toString())); } else if ("Integer".equalsIgnoreCase(dataType)) { doStuff2(Integer.valueOf(obj.toString())); } } public void doStuff2(double d1){ //do some double related stuff here } public void doStuff2(int d1){ //do some int related stuff here } I'd like to do this without if/else, with something like this; Class<?> theClass = Class.forName(dataType); The problem is 'theClass' still can't be cast to either double or int. I would be gratefull for any ideas. Thanks.
java
reflection
overloading
method-overloading
null
null
open
Create an object with a String and and method overloading === I have a String which can either be of Double or Integer type or some other type. I first need to create a Double or Integer object and then send it over to a overloaded method. Here's my code so far; public void doStuff1(object obj, String dataType){ if ("Double".equalsIgnoreCase(dataType)) { doStuff2(Double.valueOf(obj.toString())); } else if ("Integer".equalsIgnoreCase(dataType)) { doStuff2(Integer.valueOf(obj.toString())); } } public void doStuff2(double d1){ //do some double related stuff here } public void doStuff2(int d1){ //do some int related stuff here } I'd like to do this without if/else, with something like this; Class<?> theClass = Class.forName(dataType); The problem is 'theClass' still can't be cast to either double or int. I would be gratefull for any ideas. Thanks.
0
11,539,254
07/18/2012 10:26:03
1,534,415
07/18/2012 10:13:18
1
0
formatting in excel
In excel2010 Version can we format time column into text along with AM/PM information for corresponding time. eg.COLUMN A has "daily" as text and column B has "6.00 PM " as value . can we append these A & B Columns and display as "daily 6.00 PM" in single cell?
excel
formating
null
null
null
07/19/2012 13:49:42
off topic
formatting in excel === In excel2010 Version can we format time column into text along with AM/PM information for corresponding time. eg.COLUMN A has "daily" as text and column B has "6.00 PM " as value . can we append these A & B Columns and display as "daily 6.00 PM" in single cell?
2
9,103,845
02/01/2012 21:48:42
379,676
06/30/2010 04:32:49
283
7
SSH intermittently losing connection or not even getting a connection on a local Ubuntu 10.04 server
Thanks in advance for any help. I'm using Ubuntu 10.04 server, OpenSSH is installed standard via package. I have this running on a dozen other machines in this exact format, and they are virtuals so they are even on the same hardware! I'm using putty on the windows side for a client. I'm using pub/private key. So what happens is one of two things: 1. Right off the bat putty says "network error connection refused". I've had this happen up to around 8 times in a row, but RARELY. All other services on machine are still responding without issue, so I know the machine has network connectivity. 2. More commonly, it lets you in, and after a while it will just drop connection. Same as above, everything is still function, it just seems to be SSH. 3. Last night, I left a connection up when I left work, and it stayed up ALL NIGHT. That's the only time I've seen a connection to this server stay as long as it did. I've updated the OS. My next step is to turn on verbose logging in SSH and see if that brings anything to light. Does anyone have any suggestions on how to debug this, or have you seen this before? Thanks Stackers!!!!
linux
ubuntu
ssh
network-protocols
null
02/02/2012 07:38:43
off topic
SSH intermittently losing connection or not even getting a connection on a local Ubuntu 10.04 server === Thanks in advance for any help. I'm using Ubuntu 10.04 server, OpenSSH is installed standard via package. I have this running on a dozen other machines in this exact format, and they are virtuals so they are even on the same hardware! I'm using putty on the windows side for a client. I'm using pub/private key. So what happens is one of two things: 1. Right off the bat putty says "network error connection refused". I've had this happen up to around 8 times in a row, but RARELY. All other services on machine are still responding without issue, so I know the machine has network connectivity. 2. More commonly, it lets you in, and after a while it will just drop connection. Same as above, everything is still function, it just seems to be SSH. 3. Last night, I left a connection up when I left work, and it stayed up ALL NIGHT. That's the only time I've seen a connection to this server stay as long as it did. I've updated the OS. My next step is to turn on verbose logging in SSH and see if that brings anything to light. Does anyone have any suggestions on how to debug this, or have you seen this before? Thanks Stackers!!!!
2
6,113,163
05/24/2011 15:49:23
531,376
12/05/2010 18:26:35
32
1
JQuery and PHP Infinite Scrolling Help
I'm having a problem with my infinite scrolling. As I scroll down, it loads the next items fine but it keeps sending those items. I've been using this jquery to give it a unique id because I have ordered the items with mysql with an algorithm: $("#image-list li").each(function(index) { $(this).attr('id', index); }); and inorder to label the newly given items from an external php file, I have to use this code in the file as well. To send the information about the items given, I've been using this jquery: function last_db_item_function() { var ID=$(".db-item:last").attr("id"); $('div#last-db-item-loader').html('<img src="loading.gif" height="30px" />'); $.post("index.php?action=get&last_db_item="+ID, function(data){ if (data != "") { $(".db-item:last").after(data); } $('div#last-db-item-loader').empty(); }); }; $(window).scroll(function(){ if ($(window).scrollTop() == $(document).height() - $(window).height()){ last_db_item_function(); } }); but the problem is that it does not seem to work. Which I mean it doesn't not gather that last item id from the newly parsed php file. To parse the php I've been doing this: $last_db_item = $_GET['last_db_item']; $action = $_GET['action']; if($action != "get") { .... Code Here.... }else{ include ('secondimages.php'); } So my question is, why does this seem to go on forever?
php
jquery
infinite-scroll
null
null
null
open
JQuery and PHP Infinite Scrolling Help === I'm having a problem with my infinite scrolling. As I scroll down, it loads the next items fine but it keeps sending those items. I've been using this jquery to give it a unique id because I have ordered the items with mysql with an algorithm: $("#image-list li").each(function(index) { $(this).attr('id', index); }); and inorder to label the newly given items from an external php file, I have to use this code in the file as well. To send the information about the items given, I've been using this jquery: function last_db_item_function() { var ID=$(".db-item:last").attr("id"); $('div#last-db-item-loader').html('<img src="loading.gif" height="30px" />'); $.post("index.php?action=get&last_db_item="+ID, function(data){ if (data != "") { $(".db-item:last").after(data); } $('div#last-db-item-loader').empty(); }); }; $(window).scroll(function(){ if ($(window).scrollTop() == $(document).height() - $(window).height()){ last_db_item_function(); } }); but the problem is that it does not seem to work. Which I mean it doesn't not gather that last item id from the newly parsed php file. To parse the php I've been doing this: $last_db_item = $_GET['last_db_item']; $action = $_GET['action']; if($action != "get") { .... Code Here.... }else{ include ('secondimages.php'); } So my question is, why does this seem to go on forever?
0