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
7,259,164
08/31/2011 15:11:38
766,263
05/23/2011 15:20:03
18
1
Adjusting dinamic size of layout in Android
In an Activity with a lot of components, I have a RelativeLayout that have a WebView (it shows a simple text, that I don't know his size). This is the xml code: <RelativeLayout android:id="@+id/descripcionRelative" android:layout_below="@+id/descripcion_bold" android:layout_width="match_parent" android:layout_height="125dip" android:background="@drawable/my_border"> <WebView android:id="@+id/webViewDescripcion" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </RelativeLayout> The attribute android:layout_height of RelativeLayout is 125dip, because if text is too large, I want to delimitate to 125dip. If text is large, I will see text with scroll. Great! But... if text is short, I see a lot of innecessary space. One solution is change android:layout_height of RelativeLayout to wrap_content. If text is short, the component will have the exact pixels, but if text is too large, I can't delimitate it. The BIG PROBLEM is that I can't calculate the WebView's height. If i do: descripcion_web.getHeight() it return 0. If I call this method here, it doesn't return the well number: descripcion_web.setWebViewClient(new WebViewClient() { @Override public void onPageFinished(WebView webView, String url) { super.onPageFinished(webView, url); RelativeLayout marco = (RelativeLayout)findViewById(R.id.descripcionRelative); System.out.println("Height webView: "+webView.getHeight()); System.out.println("Height relative: "+marco.getHeight()); } }); I try to call method in onResume() but it doesn't work. Another attempt to solve the problem, is set android:layout_height to match_parent and use a View method setMaximumHeight(), but It doesn't exist. However, exists setMinimumHeight()... How can I resolve this? Thank you very much!
android
webview
size
relativelayout
null
null
open
Adjusting dinamic size of layout in Android === In an Activity with a lot of components, I have a RelativeLayout that have a WebView (it shows a simple text, that I don't know his size). This is the xml code: <RelativeLayout android:id="@+id/descripcionRelative" android:layout_below="@+id/descripcion_bold" android:layout_width="match_parent" android:layout_height="125dip" android:background="@drawable/my_border"> <WebView android:id="@+id/webViewDescripcion" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </RelativeLayout> The attribute android:layout_height of RelativeLayout is 125dip, because if text is too large, I want to delimitate to 125dip. If text is large, I will see text with scroll. Great! But... if text is short, I see a lot of innecessary space. One solution is change android:layout_height of RelativeLayout to wrap_content. If text is short, the component will have the exact pixels, but if text is too large, I can't delimitate it. The BIG PROBLEM is that I can't calculate the WebView's height. If i do: descripcion_web.getHeight() it return 0. If I call this method here, it doesn't return the well number: descripcion_web.setWebViewClient(new WebViewClient() { @Override public void onPageFinished(WebView webView, String url) { super.onPageFinished(webView, url); RelativeLayout marco = (RelativeLayout)findViewById(R.id.descripcionRelative); System.out.println("Height webView: "+webView.getHeight()); System.out.println("Height relative: "+marco.getHeight()); } }); I try to call method in onResume() but it doesn't work. Another attempt to solve the problem, is set android:layout_height to match_parent and use a View method setMaximumHeight(), but It doesn't exist. However, exists setMinimumHeight()... How can I resolve this? Thank you very much!
0
1,719,886
11/12/2009 04:31:26
8,078
09/15/2008 15:07:44
3,904
121
Why doesn't CTRL-D send EOF in mono?
Take the following C# file, the simplest possible repro of my problem: using System; using System.IO; public static class Test { public static void Main(string[] args) { string line; while ((line = Console.In.ReadLine()) != null) { Console.Out.WriteLine(line); } } } When I build this under mono and run it on the console, everything works fine except that I can't send EOF. Typing CTRL-D just puts a weird character on the command line. I think that I'm checking for EOF the wrong way, but `Console.In` is a `TextReader`, which doesn't have the `EndOfFile` property. How can I fix this?
mono
c#
eof
null
null
null
open
Why doesn't CTRL-D send EOF in mono? === Take the following C# file, the simplest possible repro of my problem: using System; using System.IO; public static class Test { public static void Main(string[] args) { string line; while ((line = Console.In.ReadLine()) != null) { Console.Out.WriteLine(line); } } } When I build this under mono and run it on the console, everything works fine except that I can't send EOF. Typing CTRL-D just puts a weird character on the command line. I think that I'm checking for EOF the wrong way, but `Console.In` is a `TextReader`, which doesn't have the `EndOfFile` property. How can I fix this?
0
8,867,109
01/15/2012 02:25:01
501,893
11/09/2010 12:50:29
334
13
Symfony2 substract 2 datetimes
IΒ΄m working on symfony2 and I need to substract 2 datetimes on my controller, I tried a lo of things but nothing seems to work: $startime = $historial->getStarttime(); //Datetime $endtime = $historial->getEndtime(); //Datetime $mytime= $endtime-$startime; I also tried with strtotime, date... Any help or clue? Thanks in advance
symfony
symfony-2.0
null
null
null
null
open
Symfony2 substract 2 datetimes === IΒ΄m working on symfony2 and I need to substract 2 datetimes on my controller, I tried a lo of things but nothing seems to work: $startime = $historial->getStarttime(); //Datetime $endtime = $historial->getEndtime(); //Datetime $mytime= $endtime-$startime; I also tried with strtotime, date... Any help or clue? Thanks in advance
0
9,450,907
02/26/2012 05:49:12
958,712
09/22/2011 09:08:14
176
0
How can I differentiate between windows 7 and windows xp or other windows in a C program?
and also a 32bit OS from a 64bit OS? Are there some #ifdef I can use to detect the actual OS version and whether it is 32 or 64 bit?
c
windows
winapi
null
null
null
open
How can I differentiate between windows 7 and windows xp or other windows in a C program? === and also a 32bit OS from a 64bit OS? Are there some #ifdef I can use to detect the actual OS version and whether it is 32 or 64 bit?
0
3,777,725
09/23/2010 11:15:55
227,943
12/09/2009 12:15:28
342
20
Incorrect decrement of the reference count of an object that is not owned at this point by the caller in iphone
I'm getting a memory warning: "Incorrect decrement of the reference count of an object that is not owned at this point by the caller" for challengeCell at the marked line. myIdentifier = @"ChallengTblVwCell"; ChallengeTableViewCell *challengeCell = (ChallengeTableViewCell *)[tableView dequeueReusableCellWithIdentifier:myIdentifier]; if( challengeCell == nil ) { [[ NSBundle mainBundle ] loadNibNamed:@"ChallengeTableViewCell" owner:self options:nil ]; challengeCell = challengeTblCell; } else { AsyncImageView* oldImage = (AsyncImageView*)[challengeCell.contentView viewWithTag:999]; [oldImage removeFromSuperview]; } challengeInstance = [genericArray objectAtIndex:indexPath.row]; NSString *challengeTitle = challengeInstance.elecompany; NSString *challengeImage = challengeInstance.eleimg; NSString *challengeContent = challengeInstance.eletxt; NSString *challengeTime = challengeInstance.elecdate; NSInteger challengeVotes = challengeInstance.eleshdr; NSString *challengeSubtitle = challengeInstance.eletitle; NSInteger challengeCommentsNo = challengeInstance.cnt; NSString *urlAddress_ = [NSString stringWithFormat:@"%@",challengeImage]; NSURL *url_ = [NSURL URLWithString:urlAddress_]; //Create a URL object. CGRect _frame3_; _frame3_.size.width=50; _frame3_.size.height=50; _frame3_.origin.x=12; _frame3_.origin.y=54; AsyncImageView* asyncImage3 = [[[AsyncImageView alloc] initWithFrame:_frame3_] autorelease]; asyncImage3.tag = 999; [asyncImage3 loadImageFromURL:url_]; [challengeCell.contentView addSubview:asyncImage3]; [challengeCell initWithTitle:challengeTitle subTitle:challengeSubtitle _votes:challengeVotes content:challengeContent _time:challengeTime _image:challengeImage noComments:challengeCommentsNo]; //Warning cming at this line return (UITableViewCell *)challengeCell; Can anybody please help me resolve this? Thanx in advance.
iphone
memory-management
null
null
null
null
open
Incorrect decrement of the reference count of an object that is not owned at this point by the caller in iphone === I'm getting a memory warning: "Incorrect decrement of the reference count of an object that is not owned at this point by the caller" for challengeCell at the marked line. myIdentifier = @"ChallengTblVwCell"; ChallengeTableViewCell *challengeCell = (ChallengeTableViewCell *)[tableView dequeueReusableCellWithIdentifier:myIdentifier]; if( challengeCell == nil ) { [[ NSBundle mainBundle ] loadNibNamed:@"ChallengeTableViewCell" owner:self options:nil ]; challengeCell = challengeTblCell; } else { AsyncImageView* oldImage = (AsyncImageView*)[challengeCell.contentView viewWithTag:999]; [oldImage removeFromSuperview]; } challengeInstance = [genericArray objectAtIndex:indexPath.row]; NSString *challengeTitle = challengeInstance.elecompany; NSString *challengeImage = challengeInstance.eleimg; NSString *challengeContent = challengeInstance.eletxt; NSString *challengeTime = challengeInstance.elecdate; NSInteger challengeVotes = challengeInstance.eleshdr; NSString *challengeSubtitle = challengeInstance.eletitle; NSInteger challengeCommentsNo = challengeInstance.cnt; NSString *urlAddress_ = [NSString stringWithFormat:@"%@",challengeImage]; NSURL *url_ = [NSURL URLWithString:urlAddress_]; //Create a URL object. CGRect _frame3_; _frame3_.size.width=50; _frame3_.size.height=50; _frame3_.origin.x=12; _frame3_.origin.y=54; AsyncImageView* asyncImage3 = [[[AsyncImageView alloc] initWithFrame:_frame3_] autorelease]; asyncImage3.tag = 999; [asyncImage3 loadImageFromURL:url_]; [challengeCell.contentView addSubview:asyncImage3]; [challengeCell initWithTitle:challengeTitle subTitle:challengeSubtitle _votes:challengeVotes content:challengeContent _time:challengeTime _image:challengeImage noComments:challengeCommentsNo]; //Warning cming at this line return (UITableViewCell *)challengeCell; Can anybody please help me resolve this? Thanx in advance.
0
9,477,508
02/28/2012 06:38:18
1,018,733
10/28/2011 16:25:39
97
0
Usb port no longer recognizes android
Usb port no longer works to program android. My computer recognizes it as a wireless tether (I think because my wireless goes out whenever I plug the phone in) I'm at a loss to what to do. The problem is with my eclipse or computer because I can still target my android on a friend's computer running eclipse. Thank you!
android
null
null
null
null
02/28/2012 13:06:49
not a real question
Usb port no longer recognizes android === Usb port no longer works to program android. My computer recognizes it as a wireless tether (I think because my wireless goes out whenever I plug the phone in) I'm at a loss to what to do. The problem is with my eclipse or computer because I can still target my android on a friend's computer running eclipse. Thank you!
1
4,414,284
12/10/2010 23:48:25
510,209
11/17/2010 00:04:03
10
0
The art of programming: Python vs C#
Over the last few years I have grown rather fond of python. I enjoy coding in it a lot more than in other languages. Recently, a coworker told me that he preferred C#. I am having a hard time understanding his choice. When ever I code with C# I feel like its Java but for Microsoft products only. He also added that he is very pleased with the work Microsoft has put into C#. This seems to contradict what I have been lead to believe. Anyways, which language would you say is more expressive? Which would you use to develop an application and why? What are some of the advantages and disadvantages of using one over the other? Thanks!
c#
python
null
null
null
12/10/2010 23:50:15
not constructive
The art of programming: Python vs C# === Over the last few years I have grown rather fond of python. I enjoy coding in it a lot more than in other languages. Recently, a coworker told me that he preferred C#. I am having a hard time understanding his choice. When ever I code with C# I feel like its Java but for Microsoft products only. He also added that he is very pleased with the work Microsoft has put into C#. This seems to contradict what I have been lead to believe. Anyways, which language would you say is more expressive? Which would you use to develop an application and why? What are some of the advantages and disadvantages of using one over the other? Thanks!
4
4,387,847
12/08/2010 13:16:39
535,019
12/08/2010 13:16:39
1
0
python, dynamically implement a class onthefly
Assuming i have a class that implements several methods. We want a user to chose to which methods to run among the exisiting methods or he can decide to add any method on_the_fly. from example class RemoveNoise(): pass then methods are added as wanted RemoveNoise.raw = Raw() RemoveNoise.bais = Bias() etc he can even write a new one def new(): pass and also add the `new()` method RemoveNoise.new=(New) run(RemoveNoise) `run()` is a function that evaluates such a class. Any hints on how to solve this in python?
python
function
interface
methods
add
null
open
python, dynamically implement a class onthefly === Assuming i have a class that implements several methods. We want a user to chose to which methods to run among the exisiting methods or he can decide to add any method on_the_fly. from example class RemoveNoise(): pass then methods are added as wanted RemoveNoise.raw = Raw() RemoveNoise.bais = Bias() etc he can even write a new one def new(): pass and also add the `new()` method RemoveNoise.new=(New) run(RemoveNoise) `run()` is a function that evaluates such a class. Any hints on how to solve this in python?
0
232,035
10/24/2008 00:00:40
11,236
09/16/2008 06:29:28
493
22
How do you promot joint code ownership?
A strong Agile concept is Joint Code Ownership - no single member of the team owns a piece of code, but rather the entire team. This means the code is up for editing, improvement, refactoring... How do you promote this concept? How do you deal with a team member that has trust issues regarding his code, and remains suspicious of other people messing with it?
agile
code-ownership
teamwork
null
null
08/18/2011 21:04:16
off topic
How do you promot joint code ownership? === A strong Agile concept is Joint Code Ownership - no single member of the team owns a piece of code, but rather the entire team. This means the code is up for editing, improvement, refactoring... How do you promote this concept? How do you deal with a team member that has trust issues regarding his code, and remains suspicious of other people messing with it?
2
7,403,422
09/13/2011 14:20:50
810,260
06/22/2011 11:46:59
33
0
Help removing class / object that extends application
I have created a new class that extends application. I am doing this to save state values (arrayslist etc) thoughout the application I am setting values on one screen and when I return to that screen it pulls those values back When I return to the main menu I click back (ie exit app) and instead of exiting it jumps back to the screen where I use the class object (set and read) Can anyone help with me on why this is happening Thanks for your time
android
null
null
null
null
09/14/2011 09:08:21
not a real question
Help removing class / object that extends application === I have created a new class that extends application. I am doing this to save state values (arrayslist etc) thoughout the application I am setting values on one screen and when I return to that screen it pulls those values back When I return to the main menu I click back (ie exit app) and instead of exiting it jumps back to the screen where I use the class object (set and read) Can anyone help with me on why this is happening Thanks for your time
1
9,901,423
03/28/2012 05:01:38
1,061,851
11/23/2011 12:03:18
23
1
Core-data vs SQLite
I planned to make an iPhone app which store to-do lists like thing. What is the best approach to store data in an iPhone in such situation, SQLite or core-data.
iphone
sqlite
core-data
null
null
03/30/2012 01:05:37
not a real question
Core-data vs SQLite === I planned to make an iPhone app which store to-do lists like thing. What is the best approach to store data in an iPhone in such situation, SQLite or core-data.
1
11,515,345
07/17/2012 02:44:46
1,241,357
02/29/2012 22:15:44
79
1
how to progress in programming?
I am learning C++ at University ( we're up to inheritance right now) and I would like know when will I finally be able to write nice programs? How was your programming progress? What did you do from my point to become a good programmer? I'm thinking about doing some www.projecteuler.com stuff. But I want to do more amazing programs for instance a program that automatically gets weather data from a website and sends it on my Ipod. My best program yet was this lame code: #include <iostream> using namespace std; γ€€ γ€€ γ€€ int main() γ€€ γ€€ { γ€€ int mat[10][10]; for (int i=0; i<10; i++) { mat [0][i]=(i+1); } for (int j=0; j<10; j++) { mat [j][0]=(j+1); γ€€ } // FOR THE ASSIGNMENT USE THIS!!!!! BELOW!!! // i-1 // j-1 // i-j +1 γ€€ γ€€ γ€€ γ€€ /* for (int i=0;i<10;i++) { cout<<mat[i][0]<<" "; } γ€€ γ€€ for (int i=0;i<10;i++) { cout<<mat[0][i]<<endl; } */ system( "PAUSE"); γ€€ return 0; }
c++
null
null
null
null
07/17/2012 02:58:01
not constructive
how to progress in programming? === I am learning C++ at University ( we're up to inheritance right now) and I would like know when will I finally be able to write nice programs? How was your programming progress? What did you do from my point to become a good programmer? I'm thinking about doing some www.projecteuler.com stuff. But I want to do more amazing programs for instance a program that automatically gets weather data from a website and sends it on my Ipod. My best program yet was this lame code: #include <iostream> using namespace std; γ€€ γ€€ γ€€ int main() γ€€ γ€€ { γ€€ int mat[10][10]; for (int i=0; i<10; i++) { mat [0][i]=(i+1); } for (int j=0; j<10; j++) { mat [j][0]=(j+1); γ€€ } // FOR THE ASSIGNMENT USE THIS!!!!! BELOW!!! // i-1 // j-1 // i-j +1 γ€€ γ€€ γ€€ γ€€ /* for (int i=0;i<10;i++) { cout<<mat[i][0]<<" "; } γ€€ γ€€ for (int i=0;i<10;i++) { cout<<mat[0][i]<<endl; } */ system( "PAUSE"); γ€€ return 0; }
4
8,974,425
01/23/2012 15:52:24
1,165,205
01/23/2012 15:05:36
1
0
Jquery Ui Drag and drop with some ease or gravity
Basically I am designer and not a programmer. I am trying to build some application. You can see my basic code here at jsfiddle http://jsfiddle.net/mailverma/WWfTN/1/. The idea is, user can sort 6 most descriptive and 6 least descriptive words and will drag and drop them in respective container. I need help regarding enhancements in this code. 1) Issue in this current code is, when I reset, after that, sometimes yellow rectangles are not accepted in some dotted slots. If you place same yellow rectangle in other slot it will be accepted. I don’t know the reason. Please help. 2) When user drags and throws yellow rectangle towards green or blue container, it should go by some gravity force. When more than half of yellow rectangle comes inside blue or green container, it should automatically snap to available empty dotted slot. Overlapping is not expected here. 3) I want to change class of yellow rectangle holder in top (In my code it is li) when yellow rectangle is dropped in blue or green container. So that user can drag back to original position. Please help me in this code. Thanks in advance.
jquery
gravity
null
null
null
null
open
Jquery Ui Drag and drop with some ease or gravity === Basically I am designer and not a programmer. I am trying to build some application. You can see my basic code here at jsfiddle http://jsfiddle.net/mailverma/WWfTN/1/. The idea is, user can sort 6 most descriptive and 6 least descriptive words and will drag and drop them in respective container. I need help regarding enhancements in this code. 1) Issue in this current code is, when I reset, after that, sometimes yellow rectangles are not accepted in some dotted slots. If you place same yellow rectangle in other slot it will be accepted. I don’t know the reason. Please help. 2) When user drags and throws yellow rectangle towards green or blue container, it should go by some gravity force. When more than half of yellow rectangle comes inside blue or green container, it should automatically snap to available empty dotted slot. Overlapping is not expected here. 3) I want to change class of yellow rectangle holder in top (In my code it is li) when yellow rectangle is dropped in blue or green container. So that user can drag back to original position. Please help me in this code. Thanks in advance.
0
11,658,936
07/25/2012 21:29:42
44,330
12/08/2008 16:01:37
37,278
978
java 3d graphics: a simple example showing a cube that the user can interactively rotate
I'm looking for a simple way to show a cube that a user can interactively rotate w/ the mouse. Is there one? I can't seem to find one and when I look at the Java3d tutorial, the interactive parts leave me with my eyes glazed. Is JavaFX any easier to use in this respect?
java
graphics
3d
null
null
07/26/2012 14:13:09
not constructive
java 3d graphics: a simple example showing a cube that the user can interactively rotate === I'm looking for a simple way to show a cube that a user can interactively rotate w/ the mouse. Is there one? I can't seem to find one and when I look at the Java3d tutorial, the interactive parts leave me with my eyes glazed. Is JavaFX any easier to use in this respect?
4
8,974,367
01/23/2012 15:48:48
728,244
04/27/2011 22:51:48
166
17
Working FFMPEG settings for converting to WebM format?
Can anyone give me working settings for converting video to WebM with ffmpeg? I am on Windows 7 with the `FFmpeg git-67f5650 64-bit Static (Latest) ` build from [http://ffmpeg.zeranoe.com/builds/][1] I've tried several settings found on google, a couple of different input formats and even "all default" settings like `ffmpeg -i a.wmv -f webm a.webm` and still ffmpeg just gives me a "stopped working" error. Thanks in advance! [1]: http://ffmpeg.zeranoe.com/builds/
video
ffmpeg
webm
null
null
null
open
Working FFMPEG settings for converting to WebM format? === Can anyone give me working settings for converting video to WebM with ffmpeg? I am on Windows 7 with the `FFmpeg git-67f5650 64-bit Static (Latest) ` build from [http://ffmpeg.zeranoe.com/builds/][1] I've tried several settings found on google, a couple of different input formats and even "all default" settings like `ffmpeg -i a.wmv -f webm a.webm` and still ffmpeg just gives me a "stopped working" error. Thanks in advance! [1]: http://ffmpeg.zeranoe.com/builds/
0
752,394
04/15/2009 15:59:48
13,954
09/16/2008 21:26:44
868
67
dollar sign c#
Can someone explain the usage of the dollar sign here.. var updateProgressDiv = $get('updateProgressDiv'); scroll down to the functions.. http://mattberseth.com/blog/2007/05/ajaxnet_example_using_an_updat.html
c#
asp.net
syntax
null
null
null
open
dollar sign c# === Can someone explain the usage of the dollar sign here.. var updateProgressDiv = $get('updateProgressDiv'); scroll down to the functions.. http://mattberseth.com/blog/2007/05/ajaxnet_example_using_an_updat.html
0
6,534,454
06/30/2011 12:05:39
822,999
06/30/2011 12:05:39
1
0
Scrolling Issues :)
Could someone please please help me? My site is www.sweet.ie I'm trying to get rid of the scrollbars as I want the scrolling to be done as per the JQuery (people keep trying to use the regular scrollbars and telling me theres something wrong with the site). If I put overflow:hidden; in the Body style the site doesnt' work in IE 9 and below + Firefox. So i've taken it out and the scrollbars are there What do I do? I'm not a crazy programmer, i'm more on the design end of things. Banging head against the wall isn't helping. If anyone could help me I would really really appreciate it. Thanks so much, Aileen
jquery
html
css
null
null
07/02/2011 19:17:43
not a real question
Scrolling Issues :) === Could someone please please help me? My site is www.sweet.ie I'm trying to get rid of the scrollbars as I want the scrolling to be done as per the JQuery (people keep trying to use the regular scrollbars and telling me theres something wrong with the site). If I put overflow:hidden; in the Body style the site doesnt' work in IE 9 and below + Firefox. So i've taken it out and the scrollbars are there What do I do? I'm not a crazy programmer, i'm more on the design end of things. Banging head against the wall isn't helping. If anyone could help me I would really really appreciate it. Thanks so much, Aileen
1
6,042,507
05/18/2011 09:26:29
596,821
01/31/2011 12:08:22
14
0
UITableView - Sectioned Tableview drilling down into Children subviews then into a Detail view
For the life of me, i can NOT get this working, ive spent nearly 2 months tryin to figure it out :S Is anyone able to post a pList and UITableView code on how to do this? i know im askin for quite a bit but im at whitt's end :( Any help would be greatly appreciated.
iphone
objective-c
ios
uitableview
plist
null
open
UITableView - Sectioned Tableview drilling down into Children subviews then into a Detail view === For the life of me, i can NOT get this working, ive spent nearly 2 months tryin to figure it out :S Is anyone able to post a pList and UITableView code on how to do this? i know im askin for quite a bit but im at whitt's end :( Any help would be greatly appreciated.
0
332,453
12/01/2008 22:23:49
42,276
12/01/2008 22:23:49
1
0
Can't connect to VirtualBox guest through NAT -- connection was closed
Host system is Vista, guest named BoxInABox is Debian lenny. The guest is configured in VirtualBox settings to use NAT. To set up port forwarding for ssh into the guest, I followed the directions at this link: http://mydebian.blogdns.org/?p=148. On the host I did: vboxmanage setextradata BoxInABox "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" 2222 vboxmanage setextradata BoxInABox "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" 22 vboxmanage setextradata BoxInABox "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" TCP and restarted the guest. Now if I do nmap -p 2222 on the host I can see that the port is "open", but when I try this on the guest: ssh -p 2222 localhost I get this: ssh_exchange_identification: Connection closed by remote host I don't really know how to diagnose this any further. ssh to localhost on the guest works just fine.
virtualbox
ssh
nat
null
null
04/01/2012 05:33:46
off topic
Can't connect to VirtualBox guest through NAT -- connection was closed === Host system is Vista, guest named BoxInABox is Debian lenny. The guest is configured in VirtualBox settings to use NAT. To set up port forwarding for ssh into the guest, I followed the directions at this link: http://mydebian.blogdns.org/?p=148. On the host I did: vboxmanage setextradata BoxInABox "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" 2222 vboxmanage setextradata BoxInABox "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" 22 vboxmanage setextradata BoxInABox "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" TCP and restarted the guest. Now if I do nmap -p 2222 on the host I can see that the port is "open", but when I try this on the guest: ssh -p 2222 localhost I get this: ssh_exchange_identification: Connection closed by remote host I don't really know how to diagnose this any further. ssh to localhost on the guest works just fine.
2
6,047,070
05/18/2011 15:16:56
628,831
02/22/2011 18:01:48
78
6
Fulltext exact phrase matching
I started with: - SELECT id FROM people WHERE name = 'john roger'; Which was too slow. So put a fulltext index on and now have: - SELECT id FROM people WHERE MATCH (name) AGAINST('"john roger"' IN BOOLEAN MODE) LIMIT 1; But that matches. 'john roger stevens' Is it possible to get a fulltext exact phrase match?
mysql
null
null
null
null
null
open
Fulltext exact phrase matching === I started with: - SELECT id FROM people WHERE name = 'john roger'; Which was too slow. So put a fulltext index on and now have: - SELECT id FROM people WHERE MATCH (name) AGAINST('"john roger"' IN BOOLEAN MODE) LIMIT 1; But that matches. 'john roger stevens' Is it possible to get a fulltext exact phrase match?
0
7,877,810
10/24/2011 15:11:26
734,591
05/02/2011 14:19:30
8
0
is there a documentation about USB/WIFI stuck?
i have compiled a linux driver of a usb/wifi dongle, and i want to understand the process of interaction between WIFI stuck and USB stuck, or if it exists, the Ethernet interfacing, is there documentation about that? Thanks.
documentation
usb
driver
wifi
null
10/26/2011 15:24:19
not a real question
is there a documentation about USB/WIFI stuck? === i have compiled a linux driver of a usb/wifi dongle, and i want to understand the process of interaction between WIFI stuck and USB stuck, or if it exists, the Ethernet interfacing, is there documentation about that? Thanks.
1
1,112,436
07/10/2009 23:33:03
107,498
05/15/2009 05:36:46
6
0
Checking if a regex pattern is valid in perl
Firstly, I was wondering if there was some kind of built in function that would check to see if a regex pattern was valid or not. I don't want to check to see if the expression works - I simply want to check it to make sure that the syntax of the pattern is valid - if that's possible. If there is no built in function to do so, how do I do it on my own? Do I even need to? Is there a directory of built in functions/modules that I can search so I can avoid more questions like this? Thank you.
perl
regex
null
null
null
null
open
Checking if a regex pattern is valid in perl === Firstly, I was wondering if there was some kind of built in function that would check to see if a regex pattern was valid or not. I don't want to check to see if the expression works - I simply want to check it to make sure that the syntax of the pattern is valid - if that's possible. If there is no built in function to do so, how do I do it on my own? Do I even need to? Is there a directory of built in functions/modules that I can search so I can avoid more questions like this? Thank you.
0
9,502,159
02/29/2012 15:44:34
122,210
06/12/2009 18:38:42
133
7
How to execute a shell command securely as a web service
SO I have a security dilemma. Basically what I am doing is providing a web based translation service for a "Thousands of Problems for Theorem Provers" application. I take a document written in [PSOA RuleML][1] language and translate it into [TPTP-FOF][2]. To demonstrate this translation I want to provide two RESTful web services. One to translate the PSOA RuleML and another to provide reasoning ([initial report][3]). The first service uses Java/ANTLR3/RestEasy and the second service uses Java/ApacheCommonsExec to test the generated TPTP Strings returned from the first service against the theorem prover. Does Apache Commons Exec provide sufficient security to do this? I realize there are other obvious solutions e.g. compose the services, to ensure that only TPTP FOF sentences are tested. But I would like to expose this theorem prover itself as a web service if possible any ideas SO. Thanks in advance! [1]: http://ruleml.org/#PSOA [2]: http://www.cs.miami.edu/~tptp/TPTP/SyntaxBNF.html "TPTP FOF" [3]: http://code.google.com/p/psoa2tptp/downloads/list
java
security
shell
rest
null
03/01/2012 22:02:50
not constructive
How to execute a shell command securely as a web service === SO I have a security dilemma. Basically what I am doing is providing a web based translation service for a "Thousands of Problems for Theorem Provers" application. I take a document written in [PSOA RuleML][1] language and translate it into [TPTP-FOF][2]. To demonstrate this translation I want to provide two RESTful web services. One to translate the PSOA RuleML and another to provide reasoning ([initial report][3]). The first service uses Java/ANTLR3/RestEasy and the second service uses Java/ApacheCommonsExec to test the generated TPTP Strings returned from the first service against the theorem prover. Does Apache Commons Exec provide sufficient security to do this? I realize there are other obvious solutions e.g. compose the services, to ensure that only TPTP FOF sentences are tested. But I would like to expose this theorem prover itself as a web service if possible any ideas SO. Thanks in advance! [1]: http://ruleml.org/#PSOA [2]: http://www.cs.miami.edu/~tptp/TPTP/SyntaxBNF.html "TPTP FOF" [3]: http://code.google.com/p/psoa2tptp/downloads/list
4
3,871,088
10/06/2010 09:22:56
81,892
03/24/2009 09:02:21
1,312
93
What CMS: Sitecore, KEntico, EPIServer or multiple?
At this point we are developing Sitecore websites and we are gaining experience every day. This means that we know how to adjust our approach to different types of customers and that we are able to build our applications quicker every project we do. Offcourse Sitecore is not the only W-CMS around and we have looked into other W-CMS's. What are the pro's and the con's for a company to offer solutions in different types of CMS's and what would this mean for the programmers that are working with this CMS? Would a choice to offer solutions in more CMS's automatically mean that the global experience per CMS will shrink relative? Hope there are some people around with experience in multiple big W-CMS's (Sitecore, KEntico, EPIServer, etc.. etc..).
c#
.net
content-management-system
null
null
06/01/2012 06:39:37
not constructive
What CMS: Sitecore, KEntico, EPIServer or multiple? === At this point we are developing Sitecore websites and we are gaining experience every day. This means that we know how to adjust our approach to different types of customers and that we are able to build our applications quicker every project we do. Offcourse Sitecore is not the only W-CMS around and we have looked into other W-CMS's. What are the pro's and the con's for a company to offer solutions in different types of CMS's and what would this mean for the programmers that are working with this CMS? Would a choice to offer solutions in more CMS's automatically mean that the global experience per CMS will shrink relative? Hope there are some people around with experience in multiple big W-CMS's (Sitecore, KEntico, EPIServer, etc.. etc..).
4
6,275,994
06/08/2011 08:18:37
788,800
06/08/2011 08:10:55
1
0
Which open source projects use iterator and interpreter design patterns?
I need some information about projects that use these patterns. And these projects must be on C++. Thank you! =)
c++
design-patterns
null
null
null
06/08/2011 08:35:04
not a real question
Which open source projects use iterator and interpreter design patterns? === I need some information about projects that use these patterns. And these projects must be on C++. Thank you! =)
1
8,630,365
12/25/2011 16:06:43
1,115,237
12/25/2011 10:19:41
3
0
Is it possible to declare an alpha mask directly at the layer-list XML definition?
A newbie question I have this layers.xml, and a mask.png resource <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <bitmap android:src="@drawable/img" android:gravity="center"/> </item> <item> <bitmap android:src="@drawable/mask" android:gravity="center"/> </item> </layer-list> Is it possible to direct the mask bitmap to act as a clipping mask at the xml, or do I have to do it by code. Thanks for your advice
android
android-layout
png
mask
alphablending
null
open
Is it possible to declare an alpha mask directly at the layer-list XML definition? === A newbie question I have this layers.xml, and a mask.png resource <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <bitmap android:src="@drawable/img" android:gravity="center"/> </item> <item> <bitmap android:src="@drawable/mask" android:gravity="center"/> </item> </layer-list> Is it possible to direct the mask bitmap to act as a clipping mask at the xml, or do I have to do it by code. Thanks for your advice
0
11,337,384
07/05/2012 03:01:45
226,958
12/08/2009 07:56:49
4,062
116
Java thread dump: Difference between "waiting to lock" and "parking to wait for"?
In a Java thread dump, you can see locks mentioned within stack traces. There seems to be three kinds of information: 1: - locked <0x00002aab329f7fa0> (a java.io.BufferedInputStream) 2: - waiting to lock <0x00002aaaf4ff6fa0> (a org.alfresco.repo.lock.LockServiceImpl) 3: - parking to wait for <0x00002aaafbf70bb8> (a java.util.concurrent.SynchronousQueue$TransferStack) 1: The thread has obtained a lock on object 0x00002aab329f7fa0. 2&3: Seem to say that the thread is waiting for the lock on said object to become available... but what is the difference 2 and 3?
java
multithreading
locking
jvm
thread-dump
null
open
Java thread dump: Difference between "waiting to lock" and "parking to wait for"? === In a Java thread dump, you can see locks mentioned within stack traces. There seems to be three kinds of information: 1: - locked <0x00002aab329f7fa0> (a java.io.BufferedInputStream) 2: - waiting to lock <0x00002aaaf4ff6fa0> (a org.alfresco.repo.lock.LockServiceImpl) 3: - parking to wait for <0x00002aaafbf70bb8> (a java.util.concurrent.SynchronousQueue$TransferStack) 1: The thread has obtained a lock on object 0x00002aab329f7fa0. 2&3: Seem to say that the thread is waiting for the lock on said object to become available... but what is the difference 2 and 3?
0
4,292,956
11/27/2010 17:33:25
493,890
11/01/2010 17:57:55
10
1
Windows Phone 7 evangelists
I heard that microsoft is putting a lot of effort into promoting the windows phone 7 platform and have many evangelists who can offer help. Does anyone know where I can get a hold of them?
windows-mobile
microsoft
windows-phone-7
null
null
11/28/2010 03:27:27
off topic
Windows Phone 7 evangelists === I heard that microsoft is putting a lot of effort into promoting the windows phone 7 platform and have many evangelists who can offer help. Does anyone know where I can get a hold of them?
2
11,665,675
07/26/2012 08:51:46
1,357,950
04/26/2012 06:55:08
24
0
how to disable Installer showing process id in command prompt during installation?
I use NSIS script for my installer. The process Id is gets opened in command prompt on 2k3 64 bit machine. I need to disable the command prompt diaplaying the process id. Need the script to be added to the installer for the same. thanks in advance.
installer
nsis
null
null
null
07/27/2012 00:45:54
not a real question
how to disable Installer showing process id in command prompt during installation? === I use NSIS script for my installer. The process Id is gets opened in command prompt on 2k3 64 bit machine. I need to disable the command prompt diaplaying the process id. Need the script to be added to the installer for the same. thanks in advance.
1
11,646,097
07/25/2012 08:57:54
1,345,376
04/20/2012 00:55:53
496
6
Is it possible to have a terminal window in redcar editor?
Is it possible to have a command prompt in redcar ? I would basically like my terminal window in redcar. Just like I can open multiple shells in emacs itself. Is it possible?
ruby
redcar
null
null
null
07/29/2012 01:01:58
off topic
Is it possible to have a terminal window in redcar editor? === Is it possible to have a command prompt in redcar ? I would basically like my terminal window in redcar. Just like I can open multiple shells in emacs itself. Is it possible?
2
8,148,268
11/16/2011 07:47:58
1,049,156
11/16/2011 07:39:38
1
0
How to launch new activity or task from onActivityResult
IΒ΄m trying to use the VoiceRecognition sample for sending voice recognized text to an internet bot. All I need is to send info to an URL and get the html code. I found a problem trying to start httpclient inside onActivityResult, and I donΒ΄t know how to solve it. This is the code: public class BkVRMobileActivity extends Activity { private static final int REQUEST_CODE = 1234; private ListView wordsList; private TextView texto1; private TextView texto2; /** * Called with the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.voice_recog); ImageButton speakButton = (ImageButton) findViewById(R.id.speakButton); wordsList = (ListView) findViewById(R.id.list); texto1 = (TextView) findViewById(R.id.textView1); texto2 = (TextView) findViewById(R.id.textView2); // Disable button if no recognition service is present PackageManager pm = getPackageManager(); List<ResolveInfo> activities = pm.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); if (activities.size() == 0) { speakButton.setEnabled(false); } } /** * Handle the action of the button being clicked */ public void speakButtonClicked(View v) { startVoiceRecognitionActivity(); System.out.println("--al lio --"); } /** * Fire an intent to start the voice recognition activity. */ private void startVoiceRecognitionActivity() { Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Reconocimiento de Voz activado..."); intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 1); startActivityForResult(intent, REQUEST_CODE); } /** * Handle the results from the voice recognition activity. */ @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == REQUEST_CODE && resultCode == RESULT_OK) { ArrayList<String> matches = data.getStringArrayListExtra( RecognizerIntent.EXTRA_RESULTS); //wordsList.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,matches)); texto1.setText(matches.get(0)); String laurl = "http://www.pandorabots.com/pandora/talk-xml?input=" + matches.get(0) + "&botid=9cd68de58e342fb8"; //open the url using httpclient for reading html source getXML(laurl); //System.out.println(laurl); } //super.onActivityResult(requestCode, resultCode, data); } public String getXML(String url){ String log = null; try { HttpClient httpclient = new DefaultHttpClient(); // Create HTTP Client HttpGet httpget = new HttpGet(url); // Set the action you want to do HttpResponse response = httpclient.execute(httpget); // Executeit HttpEntity entity = response.getEntity(); InputStream is = entity.getContent(); // Create an InputStream with the response BufferedReader reader = new BufferedReader(new InputStreamReader(is, "iso-8859-1"), 8); StringBuilder sb = new StringBuilder(); String line = null; while ((line = reader.readLine()) != null) // Read line by line sb.append(line + "\n"); String resString = sb.toString(); // Result is here is.close(); // Close the stream texto2.setText(resString); } catch (UnsupportedEncodingException e) { log = "<results status=\"error\"><msg>Can't connect to server</msg></results>"; } catch (MalformedURLException e) { log = "<results status=\"error\"><msg>Can't connect to server</msg></results>"; } catch (IOException e) { log = "<results status=\"error\"><msg>Can't connect to server</msg></results>"; } return log; } }
activity
voice-recognition
result
null
null
null
open
How to launch new activity or task from onActivityResult === IΒ΄m trying to use the VoiceRecognition sample for sending voice recognized text to an internet bot. All I need is to send info to an URL and get the html code. I found a problem trying to start httpclient inside onActivityResult, and I donΒ΄t know how to solve it. This is the code: public class BkVRMobileActivity extends Activity { private static final int REQUEST_CODE = 1234; private ListView wordsList; private TextView texto1; private TextView texto2; /** * Called with the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.voice_recog); ImageButton speakButton = (ImageButton) findViewById(R.id.speakButton); wordsList = (ListView) findViewById(R.id.list); texto1 = (TextView) findViewById(R.id.textView1); texto2 = (TextView) findViewById(R.id.textView2); // Disable button if no recognition service is present PackageManager pm = getPackageManager(); List<ResolveInfo> activities = pm.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); if (activities.size() == 0) { speakButton.setEnabled(false); } } /** * Handle the action of the button being clicked */ public void speakButtonClicked(View v) { startVoiceRecognitionActivity(); System.out.println("--al lio --"); } /** * Fire an intent to start the voice recognition activity. */ private void startVoiceRecognitionActivity() { Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Reconocimiento de Voz activado..."); intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 1); startActivityForResult(intent, REQUEST_CODE); } /** * Handle the results from the voice recognition activity. */ @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == REQUEST_CODE && resultCode == RESULT_OK) { ArrayList<String> matches = data.getStringArrayListExtra( RecognizerIntent.EXTRA_RESULTS); //wordsList.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,matches)); texto1.setText(matches.get(0)); String laurl = "http://www.pandorabots.com/pandora/talk-xml?input=" + matches.get(0) + "&botid=9cd68de58e342fb8"; //open the url using httpclient for reading html source getXML(laurl); //System.out.println(laurl); } //super.onActivityResult(requestCode, resultCode, data); } public String getXML(String url){ String log = null; try { HttpClient httpclient = new DefaultHttpClient(); // Create HTTP Client HttpGet httpget = new HttpGet(url); // Set the action you want to do HttpResponse response = httpclient.execute(httpget); // Executeit HttpEntity entity = response.getEntity(); InputStream is = entity.getContent(); // Create an InputStream with the response BufferedReader reader = new BufferedReader(new InputStreamReader(is, "iso-8859-1"), 8); StringBuilder sb = new StringBuilder(); String line = null; while ((line = reader.readLine()) != null) // Read line by line sb.append(line + "\n"); String resString = sb.toString(); // Result is here is.close(); // Close the stream texto2.setText(resString); } catch (UnsupportedEncodingException e) { log = "<results status=\"error\"><msg>Can't connect to server</msg></results>"; } catch (MalformedURLException e) { log = "<results status=\"error\"><msg>Can't connect to server</msg></results>"; } catch (IOException e) { log = "<results status=\"error\"><msg>Can't connect to server</msg></results>"; } return log; } }
0
6,918,176
08/02/2011 20:29:46
328,479
04/29/2010 03:53:46
63
0
Use an object's string.contains method within a switch statement?
Basically something along the lines of: switch (string.contains(x)) { case(x = "asdf"): break; case(x = "jkl"): break; case(x = "qwerty"): break; }
c#
.net
null
null
null
null
open
Use an object's string.contains method within a switch statement? === Basically something along the lines of: switch (string.contains(x)) { case(x = "asdf"): break; case(x = "jkl"): break; case(x = "qwerty"): break; }
0
1,478,397
09/25/2009 16:49:46
141,689
07/20/2009 22:04:07
148
10
If you created a programming language, what would you call it?
I'm guessing many of you have thought about writing your own programming language...I know I have. But once you've hurdled the complexities of implementing it, then you have the much weightier task of actually naming your creation. This question was inspired by Fog Creek's decision to call their compiler Wasabi instead of "Bone Crusher 3000", which is hilarious, but arguably impractical. So, what would you call your programming language?
programming-languages
naming
null
null
null
09/25/2009 17:07:16
not a real question
If you created a programming language, what would you call it? === I'm guessing many of you have thought about writing your own programming language...I know I have. But once you've hurdled the complexities of implementing it, then you have the much weightier task of actually naming your creation. This question was inspired by Fog Creek's decision to call their compiler Wasabi instead of "Bone Crusher 3000", which is hilarious, but arguably impractical. So, what would you call your programming language?
1
8,021,375
11/05/2011 16:05:51
989,977
10/11/2011 16:52:13
6
0
Data Scraping - One application or multiple?
I have 30+ sources of data I scrape daily in various formats (xml, html, csv). Over the last three years Ive built 20 or so c# console applications that go out, download the data and re-format it into a database. But Im curious what other people are doing for this type of task. Are people building one tool that has a lot of variables and inputs or are people designing 20+ programs to scrape and parse this data.
c#
.net
web-scraping
null
null
11/05/2011 18:21:07
not constructive
Data Scraping - One application or multiple? === I have 30+ sources of data I scrape daily in various formats (xml, html, csv). Over the last three years Ive built 20 or so c# console applications that go out, download the data and re-format it into a database. But Im curious what other people are doing for this type of task. Are people building one tool that has a lot of variables and inputs or are people designing 20+ programs to scrape and parse this data.
4
10,867,467
06/03/2012 02:32:59
292,291
03/12/2010 10:53:07
1,826
46
Backbone Local Storage "undefined is not a function"
I am using [`Backbone.LocalStorage`][1]: **http://jsfiddle.net/jiewmeng/grhz9/3/** $(function() { console.log(Backbone.LocalStorage); // undefined!! var Todo = Backbone.Model.extend({}); var Todos = Backbone.Collection.extend({ model: Todo, localStorage: new Backbone.LocalStorage("todos") }); });​ The 1st `console.log()` gives `undefined`. Then there an error at the `localStorage: ...` line > Uncaught TypeError: undefined is not a function Expected since `Baclbone.LocalStorage` is `undefined` but why? [1]: https://github.com/jeromegn/Backbone.localStorage
backbone.js
null
null
null
null
null
open
Backbone Local Storage "undefined is not a function" === I am using [`Backbone.LocalStorage`][1]: **http://jsfiddle.net/jiewmeng/grhz9/3/** $(function() { console.log(Backbone.LocalStorage); // undefined!! var Todo = Backbone.Model.extend({}); var Todos = Backbone.Collection.extend({ model: Todo, localStorage: new Backbone.LocalStorage("todos") }); });​ The 1st `console.log()` gives `undefined`. Then there an error at the `localStorage: ...` line > Uncaught TypeError: undefined is not a function Expected since `Baclbone.LocalStorage` is `undefined` but why? [1]: https://github.com/jeromegn/Backbone.localStorage
0
8,552,576
12/18/2011 15:04:40
901,588
08/19/2011 00:12:27
65
2
How to design good looking iPhone applications
I think I have just about mastered the basics of iPhone programming and now I want to make my apps look better. Every time I show my family/friends what I have done they think it looks a little "basic". I am inclined to agree I know how to customise the table view but apart from that everything I make just looks a bit "appy". All the books I have just cover the basics. There's nothing in there that looks amazing. I know this is a very vague question but I really need to make things look better. Do I have to be good at art? I have heard of people using custom designs in Quartz composer, is this how they do it? Thanks
iphone
ios
gui
null
null
12/18/2011 17:26:50
not constructive
How to design good looking iPhone applications === I think I have just about mastered the basics of iPhone programming and now I want to make my apps look better. Every time I show my family/friends what I have done they think it looks a little "basic". I am inclined to agree I know how to customise the table view but apart from that everything I make just looks a bit "appy". All the books I have just cover the basics. There's nothing in there that looks amazing. I know this is a very vague question but I really need to make things look better. Do I have to be good at art? I have heard of people using custom designs in Quartz composer, is this how they do it? Thanks
4
4,852,764
01/31/2011 15:43:28
340,353
05/13/2010 14:15:28
9
2
Gridview does not comes up using custom class
My gridview does not renders if I am using my derived GridClass, It does render when I add GridView object to myLayout but not when I add My Grid Object/ :( .Here's is the code public class parentClass extends MyotherClass { Grid _gridV = null; public void createGridMenu(GridViewAdapter adp ) { _gridV = (Grid) inflater.inflate(R.layout.Mygridmenu, null); _gridV.setAdapter(adp); MyLinearLayout.add(_gridV); } class Grid extends GridView{ Grid() { super(myContext); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); } } //My other methods }
android
null
null
null
null
null
open
Gridview does not comes up using custom class === My gridview does not renders if I am using my derived GridClass, It does render when I add GridView object to myLayout but not when I add My Grid Object/ :( .Here's is the code public class parentClass extends MyotherClass { Grid _gridV = null; public void createGridMenu(GridViewAdapter adp ) { _gridV = (Grid) inflater.inflate(R.layout.Mygridmenu, null); _gridV.setAdapter(adp); MyLinearLayout.add(_gridV); } class Grid extends GridView{ Grid() { super(myContext); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); } } //My other methods }
0
5,657,275
04/14/2011 00:30:05
461,362
09/29/2010 05:27:45
1
1
HTML5 Cache Manifest works over http but not https
My google-fu does not seem up to snuff today so here it goes... I have a django application sitting on top of apache using wsgi. I am attempting to make this work offline. I serve the Cache Manifest file from a django url with the correct mimetype and a no-cache header. I have a manifest reference in the template that looks like <html lang="en" manifest="/myPath/manifest/"> In order to debug this problem I am using the simplest of manifest files first CACHE MANIFEST NETWORK: * However, this gives me the following errors in chrome when I attempt to serve it via the https interface. > Creating Application Cache with > manifest > https://127.0.0.1/myPath/manifest/ > Application Cache Checking event > Application Cache Error event: > Manifest fetch failed (-1) > https://127.0.0.1/myPath/manifest/ When served over http it appears to work correctly. I am using a self signed security certificate on my development machine. This is the only thing that I can think might make the difference between http and https serving the same manifest file(using relative links so the origin is correct). What is causing the difference between http and https, and how to I correct it?
django
html5
https
manifest
null
null
open
HTML5 Cache Manifest works over http but not https === My google-fu does not seem up to snuff today so here it goes... I have a django application sitting on top of apache using wsgi. I am attempting to make this work offline. I serve the Cache Manifest file from a django url with the correct mimetype and a no-cache header. I have a manifest reference in the template that looks like <html lang="en" manifest="/myPath/manifest/"> In order to debug this problem I am using the simplest of manifest files first CACHE MANIFEST NETWORK: * However, this gives me the following errors in chrome when I attempt to serve it via the https interface. > Creating Application Cache with > manifest > https://127.0.0.1/myPath/manifest/ > Application Cache Checking event > Application Cache Error event: > Manifest fetch failed (-1) > https://127.0.0.1/myPath/manifest/ When served over http it appears to work correctly. I am using a self signed security certificate on my development machine. This is the only thing that I can think might make the difference between http and https serving the same manifest file(using relative links so the origin is correct). What is causing the difference between http and https, and how to I correct it?
0
11,161,277
06/22/2012 17:30:11
1,142,524
01/11/2012 06:31:13
13
2
Please tell me the source to study Subsonic in ASP.NET
I'm try to know about Subsonic in ASP.NET. But there is (subsonicproject.com) Docs(Getting Started) not available. If any one know the source to study Subsonic then tell me....
asp.net
subsonic
subsonic3
null
null
null
open
Please tell me the source to study Subsonic in ASP.NET === I'm try to know about Subsonic in ASP.NET. But there is (subsonicproject.com) Docs(Getting Started) not available. If any one know the source to study Subsonic then tell me....
0
2,769,407
05/04/2010 22:35:54
332,877
05/04/2010 22:19:21
1
0
iPhone, trying to post a plist (NSDictionary) to a web service
Is there a simple way to package a plist object (NSDictionary, NSArray, etc.) and Post it to a web service?
iphone
plist
web-services
nsdictionary
objective-c
null
open
iPhone, trying to post a plist (NSDictionary) to a web service === Is there a simple way to package a plist object (NSDictionary, NSArray, etc.) and Post it to a web service?
0
5,841,285
04/30/2011 10:54:25
573,936
01/13/2011 08:36:06
66
0
How to send Json object?
I am really new bee in android,so can anyone please help me to my problem...here is : I am using two AutoCompletedTextView as "username" and "password", So here I need to send the username and password as JSon Object for HTTP request.Now how do I bind username and password in Json object. Any help will really be appreciated THANKS
android
json
http
null
null
null
open
How to send Json object? === I am really new bee in android,so can anyone please help me to my problem...here is : I am using two AutoCompletedTextView as "username" and "password", So here I need to send the username and password as JSon Object for HTTP request.Now how do I bind username and password in Json object. Any help will really be appreciated THANKS
0
8,715,626
01/03/2012 16:50:08
1,120,826
12/29/2011 09:19:41
7
0
How to draw oval upside down?
I need to draw my ovals upside down, so they would be equally lined on the bottom. fillOval(int x, int y, int width, int height) if i make negative height, then there wont be anything painted, so how can I make it paint the ring upside down?
java
graphics
applet
null
null
01/03/2012 19:21:01
not a real question
How to draw oval upside down? === I need to draw my ovals upside down, so they would be equally lined on the bottom. fillOval(int x, int y, int width, int height) if i make negative height, then there wont be anything painted, so how can I make it paint the ring upside down?
1
11,453,545
07/12/2012 14:02:23
1,224,024
02/21/2012 17:59:51
15
0
manipulating list into array
In this program noise is a one-dimensional list 1 x N, where N is the length of the list. N could be as high as 100,000 of time series data. I want to create a number of phseSpaces: 1, 2, ....10, of varying columns from 1, 2,..10, respectively, by manipulating the entries in the noise list and getting entries at specific indexes to populate the new array. As the size of each array varies, I have set the length of the indexes to be equal the length of the noise list less the position of the highest index (which is computed). However, when the program below runs, it throws the following error: "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index". I have read round to find the meaning. I understand it probably the case that the index I refer to in the noise list may not exist. However, I think it is reasonable from my calculation that the highest index (computed) should exist in the noise list, so I am not sure why this is happening. I am new to program and will be grateful for your assistance. int length = noise.Count; int tdelay1 = 200; int [] embDim = new int [10] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; foreach (int m in embDim) { if (m == embDim[0]) { float[,] phaseSpace1 = new float[length, m]; for (int i = 0; i < length-1; i++) { phaseSpace1 [i,0] = noise[i]; } } else if (m == embDim[1]) { float[,] phaseSpace2 = new float[(length-tdelay1), m]; for (int i = 0; i < (length-tdelay1-1); i++) { int j = i + tdelay1; phaseSpace2 [i,0] = noise[i]; phaseSpace2 [i,1] = noise[j]; } } else if (m == embDim[2]) { float[,] phaseSpace3 = new float[(length-2*tdelay1), m]; for (int i = 0; i < (length-2*tdelay1-1); i++) { int j = i + tdelay1; int k = i + 2 * tdelay1; phaseSpace3 [i, 0] = noise[i]; phaseSpace3 [i, 1] = noise[j]; phaseSpace3 [i, 2] = noise[k]; } } else if (m == embDim[3]) { float[,] phaseSpace4 = new float[(length-3*tdelay1), m]; for (int i = 0; i < (length-3*tdelay1-1); i++) { int j = i + tdelay1; int k = i + 2 * tdelay1; int l = i + 3 * tdelay1; phaseSpace4[i, 0] = noise[i]; phaseSpace4[i, 1] = noise[j]; phaseSpace4[i, 2] = noise[k]; phaseSpace4[i, 3] = noise[l]; } } else if (m == embDim[4]) { float[,] phaseSpace5 = new float[(length-4*tdelay1), m]; for (int i = 0; i < (length-4*tdelay1-1); i++) { int j = i + tdelay1; int k = i + 2 * tdelay1; int l = i + 3 * tdelay1; int n = i + 4 * tdelay1; phaseSpace5[i, 0] = noise[i]; phaseSpace5[i, 1] = noise[j]; phaseSpace5[i, 2] = noise[k]; phaseSpace5[i, 3] = noise[l]; phaseSpace5[i, 4] = noise[n]; } } else if (m == embDim[5]) { float[,] phaseSpace6 = new float[(length-5*tdelay1), m]; for (int i = 0; i < (length-5*tdelay1-1); i++) { int j = i + tdelay1; int k = i + 2 * tdelay1; int l = i + 3 * tdelay1; int n = i + 4 * tdelay1; int o = i + 5 * tdelay1; phaseSpace6[i, 0] = noise[i]; phaseSpace6[i, 1] = noise[j]; phaseSpace6[i, 2] = noise[k]; phaseSpace6[i, 3] = noise[l]; phaseSpace6[i, 4] = noise[n]; phaseSpace6[i, 5] = noise[o]; } } else if (m == embDim[6]) { float[,] phaseSpace7 = new float[(length-6*tdelay1), m]; for (int i = 0; i < (length-6*tdelay1-1); i++) { int j = i + tdelay1; int k = i + 2 * tdelay1; int l = i + 3 * tdelay1; int n = i + 4 * tdelay1; int o = i + 5 * tdelay1; int p = i + 6 * tdelay1; phaseSpace7[i, 0] = noise[i]; phaseSpace7[i, 1] = noise[j]; phaseSpace7[i, 2] = noise[k]; phaseSpace7[i, 3] = noise[l]; phaseSpace7[i, 4] = noise[n]; phaseSpace7[i, 5] = noise[o]; phaseSpace7[i, 6] = noise[p]; } } else if (m == embDim[7]) { float[,] phaseSpace8 = new float[(length-7*tdelay1), m]; for (int i = 0; i < (length-7*tdelay1-1); i++) { int j = i + tdelay1; int k = i + 2 * tdelay1; int l = i + 3 * tdelay1; int n = i + 4 * tdelay1; int o = i + 5 * tdelay1; int p = i + 6 * tdelay1; int q = i + 7 * tdelay1; phaseSpace8[i, 0] = noise[i]; phaseSpace8[i, 1] = noise[j]; phaseSpace8[i, 2] = noise[k]; phaseSpace8[i, 3] = noise[l]; phaseSpace8[i, 4] = noise[n]; phaseSpace8[i, 5] = noise[o]; phaseSpace8[i, 6] = noise[p]; phaseSpace8[i, 7] = noise[q]; } } else if (m == embDim[8]) { float[,] phaseSpace9 = new float[(length-8*tdelay1), m]; for (int i = 0; i < (length-8*tdelay1-1); i++) { int j = i + tdelay1; int k = i + 2 * tdelay1; int l = i + 3 * tdelay1; int n = i + 4 * tdelay1; int o = i + 5 * tdelay1; int p = i + 6 * tdelay1; int q = i + 7 * tdelay1; int r = i + 8 * tdelay1; phaseSpace9[i, 0] = noise[i]; phaseSpace9[i, 1] = noise[j]; phaseSpace9[i, 2] = noise[k]; phaseSpace9[i, 3] = noise[l]; phaseSpace9[i, 4] = noise[n]; phaseSpace9[i, 5] = noise[o]; phaseSpace9[i, 6] = noise[p]; phaseSpace9[i, 7] = noise[q]; phaseSpace9[i, 8] = noise[r]; } } else if (m == embDim[9]) { float[,] phaseSpace10 = new float[(length-9*tdelay1), m]; for (int i = 0; i < (length-9*tdelay1-1); i++) { int j = i + tdelay1; int k = i + 2 * tdelay1; int l = i + 3 * tdelay1; int n = i + 4 * tdelay1; int o = i + 5 * tdelay1; int p = i + 6 * tdelay1; int q = i + 7 * tdelay1; int r = i + 8 * tdelay1; int s = i + 9 * tdelay1; phaseSpace10[i, 0] = noise[i]; phaseSpace10[i, 1] = noise[j]; phaseSpace10[i, 2] = noise[k]; phaseSpace10[i, 3] = noise[l]; phaseSpace10[i, 4] = noise[n]; phaseSpace10[i, 5] = noise[o]; phaseSpace10[i, 6] = noise[p]; phaseSpace10[i, 7] = noise[q]; phaseSpace10[i, 8] = noise[r]; phaseSpace10[i, 9] = noise[s]; } }
c#
null
null
null
null
07/12/2012 17:22:53
not a real question
manipulating list into array === In this program noise is a one-dimensional list 1 x N, where N is the length of the list. N could be as high as 100,000 of time series data. I want to create a number of phseSpaces: 1, 2, ....10, of varying columns from 1, 2,..10, respectively, by manipulating the entries in the noise list and getting entries at specific indexes to populate the new array. As the size of each array varies, I have set the length of the indexes to be equal the length of the noise list less the position of the highest index (which is computed). However, when the program below runs, it throws the following error: "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index". I have read round to find the meaning. I understand it probably the case that the index I refer to in the noise list may not exist. However, I think it is reasonable from my calculation that the highest index (computed) should exist in the noise list, so I am not sure why this is happening. I am new to program and will be grateful for your assistance. int length = noise.Count; int tdelay1 = 200; int [] embDim = new int [10] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; foreach (int m in embDim) { if (m == embDim[0]) { float[,] phaseSpace1 = new float[length, m]; for (int i = 0; i < length-1; i++) { phaseSpace1 [i,0] = noise[i]; } } else if (m == embDim[1]) { float[,] phaseSpace2 = new float[(length-tdelay1), m]; for (int i = 0; i < (length-tdelay1-1); i++) { int j = i + tdelay1; phaseSpace2 [i,0] = noise[i]; phaseSpace2 [i,1] = noise[j]; } } else if (m == embDim[2]) { float[,] phaseSpace3 = new float[(length-2*tdelay1), m]; for (int i = 0; i < (length-2*tdelay1-1); i++) { int j = i + tdelay1; int k = i + 2 * tdelay1; phaseSpace3 [i, 0] = noise[i]; phaseSpace3 [i, 1] = noise[j]; phaseSpace3 [i, 2] = noise[k]; } } else if (m == embDim[3]) { float[,] phaseSpace4 = new float[(length-3*tdelay1), m]; for (int i = 0; i < (length-3*tdelay1-1); i++) { int j = i + tdelay1; int k = i + 2 * tdelay1; int l = i + 3 * tdelay1; phaseSpace4[i, 0] = noise[i]; phaseSpace4[i, 1] = noise[j]; phaseSpace4[i, 2] = noise[k]; phaseSpace4[i, 3] = noise[l]; } } else if (m == embDim[4]) { float[,] phaseSpace5 = new float[(length-4*tdelay1), m]; for (int i = 0; i < (length-4*tdelay1-1); i++) { int j = i + tdelay1; int k = i + 2 * tdelay1; int l = i + 3 * tdelay1; int n = i + 4 * tdelay1; phaseSpace5[i, 0] = noise[i]; phaseSpace5[i, 1] = noise[j]; phaseSpace5[i, 2] = noise[k]; phaseSpace5[i, 3] = noise[l]; phaseSpace5[i, 4] = noise[n]; } } else if (m == embDim[5]) { float[,] phaseSpace6 = new float[(length-5*tdelay1), m]; for (int i = 0; i < (length-5*tdelay1-1); i++) { int j = i + tdelay1; int k = i + 2 * tdelay1; int l = i + 3 * tdelay1; int n = i + 4 * tdelay1; int o = i + 5 * tdelay1; phaseSpace6[i, 0] = noise[i]; phaseSpace6[i, 1] = noise[j]; phaseSpace6[i, 2] = noise[k]; phaseSpace6[i, 3] = noise[l]; phaseSpace6[i, 4] = noise[n]; phaseSpace6[i, 5] = noise[o]; } } else if (m == embDim[6]) { float[,] phaseSpace7 = new float[(length-6*tdelay1), m]; for (int i = 0; i < (length-6*tdelay1-1); i++) { int j = i + tdelay1; int k = i + 2 * tdelay1; int l = i + 3 * tdelay1; int n = i + 4 * tdelay1; int o = i + 5 * tdelay1; int p = i + 6 * tdelay1; phaseSpace7[i, 0] = noise[i]; phaseSpace7[i, 1] = noise[j]; phaseSpace7[i, 2] = noise[k]; phaseSpace7[i, 3] = noise[l]; phaseSpace7[i, 4] = noise[n]; phaseSpace7[i, 5] = noise[o]; phaseSpace7[i, 6] = noise[p]; } } else if (m == embDim[7]) { float[,] phaseSpace8 = new float[(length-7*tdelay1), m]; for (int i = 0; i < (length-7*tdelay1-1); i++) { int j = i + tdelay1; int k = i + 2 * tdelay1; int l = i + 3 * tdelay1; int n = i + 4 * tdelay1; int o = i + 5 * tdelay1; int p = i + 6 * tdelay1; int q = i + 7 * tdelay1; phaseSpace8[i, 0] = noise[i]; phaseSpace8[i, 1] = noise[j]; phaseSpace8[i, 2] = noise[k]; phaseSpace8[i, 3] = noise[l]; phaseSpace8[i, 4] = noise[n]; phaseSpace8[i, 5] = noise[o]; phaseSpace8[i, 6] = noise[p]; phaseSpace8[i, 7] = noise[q]; } } else if (m == embDim[8]) { float[,] phaseSpace9 = new float[(length-8*tdelay1), m]; for (int i = 0; i < (length-8*tdelay1-1); i++) { int j = i + tdelay1; int k = i + 2 * tdelay1; int l = i + 3 * tdelay1; int n = i + 4 * tdelay1; int o = i + 5 * tdelay1; int p = i + 6 * tdelay1; int q = i + 7 * tdelay1; int r = i + 8 * tdelay1; phaseSpace9[i, 0] = noise[i]; phaseSpace9[i, 1] = noise[j]; phaseSpace9[i, 2] = noise[k]; phaseSpace9[i, 3] = noise[l]; phaseSpace9[i, 4] = noise[n]; phaseSpace9[i, 5] = noise[o]; phaseSpace9[i, 6] = noise[p]; phaseSpace9[i, 7] = noise[q]; phaseSpace9[i, 8] = noise[r]; } } else if (m == embDim[9]) { float[,] phaseSpace10 = new float[(length-9*tdelay1), m]; for (int i = 0; i < (length-9*tdelay1-1); i++) { int j = i + tdelay1; int k = i + 2 * tdelay1; int l = i + 3 * tdelay1; int n = i + 4 * tdelay1; int o = i + 5 * tdelay1; int p = i + 6 * tdelay1; int q = i + 7 * tdelay1; int r = i + 8 * tdelay1; int s = i + 9 * tdelay1; phaseSpace10[i, 0] = noise[i]; phaseSpace10[i, 1] = noise[j]; phaseSpace10[i, 2] = noise[k]; phaseSpace10[i, 3] = noise[l]; phaseSpace10[i, 4] = noise[n]; phaseSpace10[i, 5] = noise[o]; phaseSpace10[i, 6] = noise[p]; phaseSpace10[i, 7] = noise[q]; phaseSpace10[i, 8] = noise[r]; phaseSpace10[i, 9] = noise[s]; } }
1
10,713,128
05/23/2012 03:38:51
460,147
09/28/2010 03:29:06
505
27
Pre-populating select field in Django with several values
I have tried quite a few things but I still don't know how can I populate a `select field` in Django. The following example, adds a dictionary with a select field with a `name='tags'` attribute. data = {} for tag in tags: data['tags'] = tag.name form = Form(initial=data) As it is expected, the loop is overwriting the key 'tags', so it only prevails the last value (and indeed, the form shows the last value). I expected that maybe passing a list would work: data = {} l = [] for tag in tags: l.append(tag.name) data['tags'] = l form = Form(initial=data) But in this case, it just doesn't work. As you can imagina, I'm using a form similar to this: class NewTopicForm(forms.Form): ... some fields tags = ChoiceField( widget=forms.Select(), choices=SOME_CHOICES ) What is the correct way to populate a form with a select field when I need to add several values?. Thanks!
django
forms
select
populate
null
null
open
Pre-populating select field in Django with several values === I have tried quite a few things but I still don't know how can I populate a `select field` in Django. The following example, adds a dictionary with a select field with a `name='tags'` attribute. data = {} for tag in tags: data['tags'] = tag.name form = Form(initial=data) As it is expected, the loop is overwriting the key 'tags', so it only prevails the last value (and indeed, the form shows the last value). I expected that maybe passing a list would work: data = {} l = [] for tag in tags: l.append(tag.name) data['tags'] = l form = Form(initial=data) But in this case, it just doesn't work. As you can imagina, I'm using a form similar to this: class NewTopicForm(forms.Form): ... some fields tags = ChoiceField( widget=forms.Select(), choices=SOME_CHOICES ) What is the correct way to populate a form with a select field when I need to add several values?. Thanks!
0
11,080,960
06/18/2012 10:26:13
1,435,484
06/04/2012 15:29:00
1
0
does symmetric encryption vulnerable to plain-text-attacks?
for example bob send a text to boss1 for symmetric encryption to send to boss2 (only boss1 and boss2 know the key). boss1 send encrypted text back to bob to send to boss2. can bob compare the plain text he sent to boss1 with the encrypted version to guess what is for example AES key?
security
encryption
encryption-symmetric
symmetric
symmetric-key
06/19/2012 03:18:48
off topic
does symmetric encryption vulnerable to plain-text-attacks? === for example bob send a text to boss1 for symmetric encryption to send to boss2 (only boss1 and boss2 know the key). boss1 send encrypted text back to bob to send to boss2. can bob compare the plain text he sent to boss1 with the encrypted version to guess what is for example AES key?
2
7,547,562
09/25/2011 18:19:33
879,217
08/04/2011 18:13:35
15
0
Brand Creation and Development Questionnaires‏
Hoping you can help. Based on academic research on Branding as a business function of Marketing, I have designed two questionnaires which I would appreciate you providing your input, based on your opinions and experience. The questionnaires are anonymous and are designed to provide primary data on Brand Creation and Development conducted by start-up companies/teams/individuals in particular in the software industry. 1. Brand Development - targetted at formal small businesses, or those acting informally either individually or as part of a team to produce a product. <http://www.kwiksurveys.com?s=OKLJKK_3ea39107> 2. Consumers - everyone can fill this questionnaire out. <http://www.kwiksurveys.com?s=OKLJFI_65038e66> Both questionnaires close on Thursday 29th September 2011. Please take a few moments to complete the survey; your time and support are greatly appreciated. Kind regards, Paul.
business
startup
survey
branding
null
09/25/2011 19:31:08
off topic
Brand Creation and Development Questionnaires‏ === Hoping you can help. Based on academic research on Branding as a business function of Marketing, I have designed two questionnaires which I would appreciate you providing your input, based on your opinions and experience. The questionnaires are anonymous and are designed to provide primary data on Brand Creation and Development conducted by start-up companies/teams/individuals in particular in the software industry. 1. Brand Development - targetted at formal small businesses, or those acting informally either individually or as part of a team to produce a product. <http://www.kwiksurveys.com?s=OKLJKK_3ea39107> 2. Consumers - everyone can fill this questionnaire out. <http://www.kwiksurveys.com?s=OKLJFI_65038e66> Both questionnaires close on Thursday 29th September 2011. Please take a few moments to complete the survey; your time and support are greatly appreciated. Kind regards, Paul.
2
4,340,396
12/02/2010 21:57:01
103,167
05/07/2009 21:29:29
17,364
761
Does the C++ standard mandate poor performance for iostreams, or am I just dealing with a poor implementation?
Every time I mention slow performance of C++ standard library iostreams, I get met with a wave of disbelief. Yet I have profiler results showing large amounts of time spent in iostream library code (full compiler optimizations), and switching from iostreams to OS-specific I/O APIs and custom buffer management does give an order of magnitude improvement. What extra work is the C++ standard library doing, is it required by the standard, and is it useful in practice? Or do some compilers provide implementations of iostreams that are competitive with manual buffer management? To get matters moving, I've written a couple of short programs to exercise the iostreams internal buffering: * putting binary data into an `ostringstream` http://ideone.com/2PPYw * putting binary data into a `char[]` buffer http://ideone.com/Ni5ct * putting binary data into a `vector<char>` http://ideone.com/Mj2Fi Note that the `ostringstream` version runs fewer iterations because it is so much slower. On ideone, the `ostringstream` is about 3 times slower than `std:copy` + `back_inserter` + `std::vector`, and about 15 times slower than `memcpy` into a raw buffer. This feels consistent with before-and-after profiling when I switched my real application to custom buffering. These are all in-memory buffers, so the slowness of iostreams can't be blamed on slow disk I/O, too much flushing, synchronization with stdio, or any of the other things people use to excuse observed slowness of the C++ standard library iostream. It would be nice to see benchmarks on other systems and commentary on things common implementations do (such as gcc's libc++, Visual C++, Intel C++) and how much of the overhead is mandated by the standard.
c++
performance
iostream
null
null
07/02/2011 02:28:23
not constructive
Does the C++ standard mandate poor performance for iostreams, or am I just dealing with a poor implementation? === Every time I mention slow performance of C++ standard library iostreams, I get met with a wave of disbelief. Yet I have profiler results showing large amounts of time spent in iostream library code (full compiler optimizations), and switching from iostreams to OS-specific I/O APIs and custom buffer management does give an order of magnitude improvement. What extra work is the C++ standard library doing, is it required by the standard, and is it useful in practice? Or do some compilers provide implementations of iostreams that are competitive with manual buffer management? To get matters moving, I've written a couple of short programs to exercise the iostreams internal buffering: * putting binary data into an `ostringstream` http://ideone.com/2PPYw * putting binary data into a `char[]` buffer http://ideone.com/Ni5ct * putting binary data into a `vector<char>` http://ideone.com/Mj2Fi Note that the `ostringstream` version runs fewer iterations because it is so much slower. On ideone, the `ostringstream` is about 3 times slower than `std:copy` + `back_inserter` + `std::vector`, and about 15 times slower than `memcpy` into a raw buffer. This feels consistent with before-and-after profiling when I switched my real application to custom buffering. These are all in-memory buffers, so the slowness of iostreams can't be blamed on slow disk I/O, too much flushing, synchronization with stdio, or any of the other things people use to excuse observed slowness of the C++ standard library iostream. It would be nice to see benchmarks on other systems and commentary on things common implementations do (such as gcc's libc++, Visual C++, Intel C++) and how much of the overhead is mandated by the standard.
4
966,699
06/08/2009 20:02:59
119,419
06/08/2009 19:51:01
1
0
In Rails, How do I validates_uniqueness_of :field with a scope of last 6 months
**First Item**<br /> I Want to validate a field to make sure it is unique (in the last 6 months) before saving it to the database. I am thinking I should use validates_uniqueness_of :field, case_sensitive => false, Scope => ... For my application it only has to be unique if, it was used <6 months ago. Thinking to compare it to created_at, but don't really know how to go about it. **Second Item**<br /> I think I should somehow use .strip to remove any spaces before or after the text that the use may have put in accidentally (I know that these extra spaces are used by default in rails and if they are there can make a filed unique.) If anyone has any hints on how this should be done correctly I really would appreciate it.
ruby-on-rails
form-validation
validation
null
null
null
open
In Rails, How do I validates_uniqueness_of :field with a scope of last 6 months === **First Item**<br /> I Want to validate a field to make sure it is unique (in the last 6 months) before saving it to the database. I am thinking I should use validates_uniqueness_of :field, case_sensitive => false, Scope => ... For my application it only has to be unique if, it was used <6 months ago. Thinking to compare it to created_at, but don't really know how to go about it. **Second Item**<br /> I think I should somehow use .strip to remove any spaces before or after the text that the use may have put in accidentally (I know that these extra spaces are used by default in rails and if they are there can make a filed unique.) If anyone has any hints on how this should be done correctly I really would appreciate it.
0
10,158,844
04/15/2012 01:23:10
1,333,984
04/15/2012 01:21:33
1
0
Max ram you can give to java?
I run a mine craft server on a 32 bit Ubuntu system if I upgrade to64 bit what is the max memory I can give to java? I want it to have about 12 gig of ram but I can't do that on 32bit
java
minecraft
null
null
null
04/15/2012 05:34:29
off topic
Max ram you can give to java? === I run a mine craft server on a 32 bit Ubuntu system if I upgrade to64 bit what is the max memory I can give to java? I want it to have about 12 gig of ram but I can't do that on 32bit
2
10,338,857
04/26/2012 17:59:19
1,010,868
10/24/2011 12:39:23
186
16
Android: are android fragments reusable?
Are android fragments reusable - i mean if i could use code like below: class MyTabActivity extends FragmentActivity implements OnClickListener { Fragment[] tabs = new Fragment[3]; @Override protected void onCreate(Bundle bundle) { super.onCreate(bundle); setContentView(R.layout.settings_activity); findViewById(R.id.button1).setOnClickListener(this); findViewById(R.id.button2).setOnClickListener(this); findViewById(R.id.button3).setOnClickListener(this); //first xml-defined fragment, it is inside //FrameLayout with id R.id.loadTarget -> see openTab() tabs[0] = getSupportFragmentManager().findFragmentById( R.id.firstFragment); } private void openTab(int i) { final FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); ft.replace(R.id.loadTarget, getTabFragment(i)); ft.addToBackStack(null); ft.commit(); } private Fragment getTabFragment(int i) { if(tabs[i] == null) { switch(i) { //0-tab fragment has been allready //retrieved in onCreate case 1: tabs[1] = new MySecondTabFragment(); break; case 2: tabs[2] = new MyThirdTabFragment(); break; } } return tabs[i]; } @Override public void onClick(View v) { switch(v.getId()) { case R.id.button1: openTab(0); break; case R.id.button2: openTab(1); break; case R.id.button3: openTab(2); break; } } }
java
android
android-fragments
null
null
null
open
Android: are android fragments reusable? === Are android fragments reusable - i mean if i could use code like below: class MyTabActivity extends FragmentActivity implements OnClickListener { Fragment[] tabs = new Fragment[3]; @Override protected void onCreate(Bundle bundle) { super.onCreate(bundle); setContentView(R.layout.settings_activity); findViewById(R.id.button1).setOnClickListener(this); findViewById(R.id.button2).setOnClickListener(this); findViewById(R.id.button3).setOnClickListener(this); //first xml-defined fragment, it is inside //FrameLayout with id R.id.loadTarget -> see openTab() tabs[0] = getSupportFragmentManager().findFragmentById( R.id.firstFragment); } private void openTab(int i) { final FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); ft.replace(R.id.loadTarget, getTabFragment(i)); ft.addToBackStack(null); ft.commit(); } private Fragment getTabFragment(int i) { if(tabs[i] == null) { switch(i) { //0-tab fragment has been allready //retrieved in onCreate case 1: tabs[1] = new MySecondTabFragment(); break; case 2: tabs[2] = new MyThirdTabFragment(); break; } } return tabs[i]; } @Override public void onClick(View v) { switch(v.getId()) { case R.id.button1: openTab(0); break; case R.id.button2: openTab(1); break; case R.id.button3: openTab(2); break; } } }
0
10,750,177
05/25/2012 07:22:24
553,805
12/25/2010 12:02:53
1
1
patent for a feature of a sotfware?
I have a Question about patent issues on softwares. Since big software firms take the patent ownership of features, could be a feature of your software causes patent violation? Let me explain this issue with an example: You write a software and you will add a feature to Copy function. For example, you will add filtering feature additionally to CTRL+C. With the example above I need to clarify issues below: 1. If our new feature for "filtering for the copy command" is protected with a patent, is there exists a possible patent violation if we use the same feature in our software? 2. If yes, how can we figure out that our new "filtering for the copy command" can cause a patent violation? 3. Another Case related to above: Case: No one ows patent right for the feature and you add this feature first to your software. Is there a possible risk such as: Another guy applies for patent of this feature, and if he get the patent for it could your software start to violate the patent then? 4. Can such small features like above "filtering for the copy command" can be patented? If yes a software developer should worry with the patent violation issue in addition to design and development. You have definitely heard patent violation cases between big software companies but they have departments for patent searching, lawyer teams etc. But if you are only a small software development team there are not only no one to carry out that kind of patent issues, but also your sources are insufficent. Thank you for your time.
features
software-design
patents
null
null
05/27/2012 15:03:41
off topic
patent for a feature of a sotfware? === I have a Question about patent issues on softwares. Since big software firms take the patent ownership of features, could be a feature of your software causes patent violation? Let me explain this issue with an example: You write a software and you will add a feature to Copy function. For example, you will add filtering feature additionally to CTRL+C. With the example above I need to clarify issues below: 1. If our new feature for "filtering for the copy command" is protected with a patent, is there exists a possible patent violation if we use the same feature in our software? 2. If yes, how can we figure out that our new "filtering for the copy command" can cause a patent violation? 3. Another Case related to above: Case: No one ows patent right for the feature and you add this feature first to your software. Is there a possible risk such as: Another guy applies for patent of this feature, and if he get the patent for it could your software start to violate the patent then? 4. Can such small features like above "filtering for the copy command" can be patented? If yes a software developer should worry with the patent violation issue in addition to design and development. You have definitely heard patent violation cases between big software companies but they have departments for patent searching, lawyer teams etc. But if you are only a small software development team there are not only no one to carry out that kind of patent issues, but also your sources are insufficent. Thank you for your time.
2
10,624,903
05/16/2012 18:58:23
1,399,426
05/16/2012 18:56:16
1
0
I need a javascript/html plug-in that allows me to post news without editing .html file
It would be inconvenient if every time I want to post a news story on my site, I would have to do into my .html file and add the story. Is there a plug-in that allows you to do this from a third party?
javascript
jquery
html
null
null
05/17/2012 22:38:58
not constructive
I need a javascript/html plug-in that allows me to post news without editing .html file === It would be inconvenient if every time I want to post a news story on my site, I would have to do into my .html file and add the story. Is there a plug-in that allows you to do this from a third party?
4
5,557,861
04/05/2011 20:09:33
154,070
08/11/2009 00:37:37
376
20
Sharepoint Development in Visual Studio 2010
Is it possible to develop for Sharepoint using Visual Studio 2010 pointing to the Sharepoint installed on a seperate server? When I try to add a sharepoint connection in VS2010 it gives my error that there is no sharepoint server installed on my machine. Do I really have to install it on my machine? Can't I just connect to a sharepoint server for developing application? Cheers.
visual-studio-2010
sharepoint
null
null
null
null
open
Sharepoint Development in Visual Studio 2010 === Is it possible to develop for Sharepoint using Visual Studio 2010 pointing to the Sharepoint installed on a seperate server? When I try to add a sharepoint connection in VS2010 it gives my error that there is no sharepoint server installed on my machine. Do I really have to install it on my machine? Can't I just connect to a sharepoint server for developing application? Cheers.
0
9,961,404
04/01/2012 02:19:45
1,305,711
04/01/2012 01:04:48
1
0
Iisolating quick-sort issue C++
I am currently learning about quick sort and have been stumped. For this assignment we are reading in 10k randomly generated numbers(by a separately created program and copying that file into this one) and then outputting every thousandth to a file for each type of search to compare results. My program is currently outputting a file where the first 15 numbers outputted are the first 15 numbers being read. The remaining numbers are placed relatively in the right spot in regards to each other, but not in actual smallest to largest order. Here is my code: #include <iostream> #include <iomanip> #include <fstream> #include <string> const int maxs=10000; using namespace std; void readem(double a[],int i) { ifstream inf; inf.open("random.dat"); for(i=0;i<maxs;i++) { inf >> a[i]; } } void printem(double a[], ofstream &outf) { int i; for(i=0;i<maxs;i++) //for(i=0;i<4999;i+=1000) { outf<<" " << a[i] << endl; } outf << endl; //for(i=4999;i<maxs;i+=1000) outf <<" " << a[i]; } void swapem(double &i, double &j) { double temp; temp=i; i=j; j=temp; } void quicksort(double a[], int left, int right) { int j = left, k = right; double temp; while (j < k) { while (a[j] > a[left]) j++; while (a[k] < a[left]) k--; if (j < k) { //swapem(a[j], a[k]); temp = a[j]; a[j] = a[k]; a[k] = temp; j++; k--; } } if (left < j-1) quicksort(a, left, k-1); if (j+1 < right) quicksort(a, k+1, right); } void main() { int i, j; ifstream inf; ofstream outf; inf.open("random.dat"); outf.open("sorted.out"); outf.setf(ios::fixed); outf.precision(3); //outf << "Hello" << endl; double a[maxs+1]; for (i=1; i<=1;i++) { readem(a, i); switch(i) { //case 1: outf << "Bublesort Start:" << endl; // bubblesort(a, outf); // cout << "Bubblesort done" << endl; // break; //case 2: outf << endl << "Selectsort Start:" << endl; // selectsort(a, outf); // cout << "Selectsort done" << endl; // break; //case 3: outf << endl <<"Insertsort Start:" << endl; // insertsort(a, outf); // cout << "Insertsort done" << endl; // break; case 1: outf << endl << "Quicksort Start:" << endl; quicksort(a, a[0], maxs-1); cout << "Quicksort done" << endl; break; } printem(a, outf); } } Here is a sample of the output data: 2.200 2.419 1.427 0.000 3.447 -9.751 -3.939 -10.743 -4.145 Thank you and any help would be appreciated.
c++
null
null
null
null
04/26/2012 12:34:37
too localized
Iisolating quick-sort issue C++ === I am currently learning about quick sort and have been stumped. For this assignment we are reading in 10k randomly generated numbers(by a separately created program and copying that file into this one) and then outputting every thousandth to a file for each type of search to compare results. My program is currently outputting a file where the first 15 numbers outputted are the first 15 numbers being read. The remaining numbers are placed relatively in the right spot in regards to each other, but not in actual smallest to largest order. Here is my code: #include <iostream> #include <iomanip> #include <fstream> #include <string> const int maxs=10000; using namespace std; void readem(double a[],int i) { ifstream inf; inf.open("random.dat"); for(i=0;i<maxs;i++) { inf >> a[i]; } } void printem(double a[], ofstream &outf) { int i; for(i=0;i<maxs;i++) //for(i=0;i<4999;i+=1000) { outf<<" " << a[i] << endl; } outf << endl; //for(i=4999;i<maxs;i+=1000) outf <<" " << a[i]; } void swapem(double &i, double &j) { double temp; temp=i; i=j; j=temp; } void quicksort(double a[], int left, int right) { int j = left, k = right; double temp; while (j < k) { while (a[j] > a[left]) j++; while (a[k] < a[left]) k--; if (j < k) { //swapem(a[j], a[k]); temp = a[j]; a[j] = a[k]; a[k] = temp; j++; k--; } } if (left < j-1) quicksort(a, left, k-1); if (j+1 < right) quicksort(a, k+1, right); } void main() { int i, j; ifstream inf; ofstream outf; inf.open("random.dat"); outf.open("sorted.out"); outf.setf(ios::fixed); outf.precision(3); //outf << "Hello" << endl; double a[maxs+1]; for (i=1; i<=1;i++) { readem(a, i); switch(i) { //case 1: outf << "Bublesort Start:" << endl; // bubblesort(a, outf); // cout << "Bubblesort done" << endl; // break; //case 2: outf << endl << "Selectsort Start:" << endl; // selectsort(a, outf); // cout << "Selectsort done" << endl; // break; //case 3: outf << endl <<"Insertsort Start:" << endl; // insertsort(a, outf); // cout << "Insertsort done" << endl; // break; case 1: outf << endl << "Quicksort Start:" << endl; quicksort(a, a[0], maxs-1); cout << "Quicksort done" << endl; break; } printem(a, outf); } } Here is a sample of the output data: 2.200 2.419 1.427 0.000 3.447 -9.751 -3.939 -10.743 -4.145 Thank you and any help would be appreciated.
3
2,267,045
02/15/2010 15:47:44
100,516
05/03/2009 22:15:07
1,821
114
How to learn use your IDE effectively?
I've developed in IntelliJ IDEA for several years. And I've never seriously used NetBeans or Eclipse. But now I have to work in Eclipse and I want to be able to use at least part of it's power as soon as possible. So, the question can be divided into 2 parts. 1) More general question: how to learn new IDE in a short time? 2) Are there any extremely good Eclipse tutorials? Like '30 things Eclipse developer must know' or something similar.
ide
eclipse
tutorials
null
null
09/01/2011 13:52:10
not constructive
How to learn use your IDE effectively? === I've developed in IntelliJ IDEA for several years. And I've never seriously used NetBeans or Eclipse. But now I have to work in Eclipse and I want to be able to use at least part of it's power as soon as possible. So, the question can be divided into 2 parts. 1) More general question: how to learn new IDE in a short time? 2) Are there any extremely good Eclipse tutorials? Like '30 things Eclipse developer must know' or something similar.
4
7,890,859
10/25/2011 14:27:49
1,012,803
10/25/2011 13:30:41
1
0
HTTP 403 Service Error when trying to post XML to HTTPS URL
I am trying to write a small class using the Apache HttpClient library that would do an HTTPS post to a specified URL sending some XML. When I run my code, the HTTP status line I receive back is "403 Service Error". Here's the complete error HTML returned: $errorDump java.net.SocketTimeoutException:Read timed out $errorInfo $errorDump java.net.SocketTimeoutException:Read timed out $error Read timed out $localizedError Read timed out $errorType java.net.SocketTimeoutException $user $time 2011-10-25 09:39:29 EDT $error Read timed out $errorType java.net.SocketTimeoutException This is the code I am using: import java.io.ByteArrayInputStream; import java.io.InputStreamReader; import java.io.BufferedReader; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.InputStreamEntity; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.util.EntityUtils; public class HttpXmlPost { public static void main(String[] args) { String url = "https://someurlhere.com"; String xmlStr = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?><xmlTag></xmlTag>"; String content = request(xmlStr, url); System.out.println(content); } private static String request(String xmlStr, String url) { boolean success = false; String content = ""; HttpClient httpclient = new DefaultHttpClient(); try { HttpPost httpPost = new HttpPost(url.trim()); InputStreamEntity reqEntity = new InputStreamEntity(new ByteArrayInputStream(xmlStr.getBytes() ), -1); reqEntity.setContentType("application/xml"); reqEntity.setChunked(true); httpPost.setEntity(reqEntity); System.out.println("Executing request " + httpPost.getRequestLine()); HttpResponse response = httpclient.execute(httpPost); HttpEntity resEntity = response.getEntity(); System.out.println("----------------------------------------"); System.out.println(response.getStatusLine()); if(response.getStatusLine().getStatusCode() == 200){ success = true; } if (resEntity != null) { System.out.println("Response content length: " + resEntity.getContentLength()); System.out.println("Chunked?: " + resEntity.isChunked()); } BufferedReader reader = new BufferedReader(new InputStreamReader(resEntity.getContent())); StringBuilder buf = new StringBuilder(); char[] cbuf = new char[ 2048 ]; int num; while ( -1 != (num=reader.read( cbuf ))) { buf.append( cbuf, 0, num ); } content = buf.toString(); EntityUtils.consume(resEntity); } catch (Exception e) { System.out.println(e); } finally { httpclient.getConnectionManager().shutdown(); } return content; } } Whatever XML I pass in doesn't seem to matter, it gives the same error no matter what. Note that this actually works with some URLs. For example, if I put https://www.facebook.com, it goes through. However, it doesn't work for my specified URL. I thought it might be a certificate issue, tried to add some code to trust any certificate, didn't seem to work either, though I may have done it wrong. Any help is appreciated.
java
https
httpclient
null
null
null
open
HTTP 403 Service Error when trying to post XML to HTTPS URL === I am trying to write a small class using the Apache HttpClient library that would do an HTTPS post to a specified URL sending some XML. When I run my code, the HTTP status line I receive back is "403 Service Error". Here's the complete error HTML returned: $errorDump java.net.SocketTimeoutException:Read timed out $errorInfo $errorDump java.net.SocketTimeoutException:Read timed out $error Read timed out $localizedError Read timed out $errorType java.net.SocketTimeoutException $user $time 2011-10-25 09:39:29 EDT $error Read timed out $errorType java.net.SocketTimeoutException This is the code I am using: import java.io.ByteArrayInputStream; import java.io.InputStreamReader; import java.io.BufferedReader; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.InputStreamEntity; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.util.EntityUtils; public class HttpXmlPost { public static void main(String[] args) { String url = "https://someurlhere.com"; String xmlStr = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?><xmlTag></xmlTag>"; String content = request(xmlStr, url); System.out.println(content); } private static String request(String xmlStr, String url) { boolean success = false; String content = ""; HttpClient httpclient = new DefaultHttpClient(); try { HttpPost httpPost = new HttpPost(url.trim()); InputStreamEntity reqEntity = new InputStreamEntity(new ByteArrayInputStream(xmlStr.getBytes() ), -1); reqEntity.setContentType("application/xml"); reqEntity.setChunked(true); httpPost.setEntity(reqEntity); System.out.println("Executing request " + httpPost.getRequestLine()); HttpResponse response = httpclient.execute(httpPost); HttpEntity resEntity = response.getEntity(); System.out.println("----------------------------------------"); System.out.println(response.getStatusLine()); if(response.getStatusLine().getStatusCode() == 200){ success = true; } if (resEntity != null) { System.out.println("Response content length: " + resEntity.getContentLength()); System.out.println("Chunked?: " + resEntity.isChunked()); } BufferedReader reader = new BufferedReader(new InputStreamReader(resEntity.getContent())); StringBuilder buf = new StringBuilder(); char[] cbuf = new char[ 2048 ]; int num; while ( -1 != (num=reader.read( cbuf ))) { buf.append( cbuf, 0, num ); } content = buf.toString(); EntityUtils.consume(resEntity); } catch (Exception e) { System.out.println(e); } finally { httpclient.getConnectionManager().shutdown(); } return content; } } Whatever XML I pass in doesn't seem to matter, it gives the same error no matter what. Note that this actually works with some URLs. For example, if I put https://www.facebook.com, it goes through. However, it doesn't work for my specified URL. I thought it might be a certificate issue, tried to add some code to trust any certificate, didn't seem to work either, though I may have done it wrong. Any help is appreciated.
0
2,890,699
05/23/2010 04:55:10
348,133
05/23/2010 04:55:10
1
0
About Network Address Translation (NAT)?
Just curious about a particular scenario of NAT. Let's suppose we have 4 computers sharing a global IP address under the NAT. I understand that the NAT box keeps an internal record to know which computer to forward requests to. But let's say on computer #2 I'm trying to download a file. And let's say on computer #1, #3, and #4, I'm just browsing the web normally. When the browser initiates a TCP connection to get that file, how does it know which computer to give it to? I mean like, each of the four computers is using port 80 to browse the web right? How does the NAT's record distinguish which "port 80" belongs to which computer?
computer
nat
null
null
null
null
open
About Network Address Translation (NAT)? === Just curious about a particular scenario of NAT. Let's suppose we have 4 computers sharing a global IP address under the NAT. I understand that the NAT box keeps an internal record to know which computer to forward requests to. But let's say on computer #2 I'm trying to download a file. And let's say on computer #1, #3, and #4, I'm just browsing the web normally. When the browser initiates a TCP connection to get that file, how does it know which computer to give it to? I mean like, each of the four computers is using port 80 to browse the web right? How does the NAT's record distinguish which "port 80" belongs to which computer?
0
4,243,375
11/22/2010 07:52:04
515,765
11/22/2010 07:52:04
1
0
[facebook app]Is there any way I can get the user_id from tab?
I'm trying to get user_id from the tab. I found out the params["signed_request"] will give me some info about the user_id. And I tried. But, in fact , params["signed_request"] gave me the wrong value. It returned the profile_id instead of user_id. Is there anyway I can get the user_id from tab? I really need the user_id to do something! Please help!!! Thank you!
facebook-iframe
null
null
null
null
null
open
[facebook app]Is there any way I can get the user_id from tab? === I'm trying to get user_id from the tab. I found out the params["signed_request"] will give me some info about the user_id. And I tried. But, in fact , params["signed_request"] gave me the wrong value. It returned the profile_id instead of user_id. Is there anyway I can get the user_id from tab? I really need the user_id to do something! Please help!!! Thank you!
0
8,881,890
01/16/2012 15:08:25
1,004,781
10/20/2011 08:42:51
54
1
How to troubleshoot redirect issue, possibly involving drupal
I have written a drupal module to handle redirects. User journey for mobiles: my_main_site => my_mobile_site my_main_site?mobile => sets cookie and allows user to browse my_main_site without redirection. I know that the query string ?mobile IS setting the cookie, and the whole process works fine when I make the request using a curl script. I'm completely stumped as to why this is not working and have no idea how totroubleshoot things further. I appreciate this is somewhat bespoke request but I'm really looking for troubleshooting advice rather than anything else. Any ideas? Thanks..
redirect
drupal-7
null
null
null
01/17/2012 17:47:20
not a real question
How to troubleshoot redirect issue, possibly involving drupal === I have written a drupal module to handle redirects. User journey for mobiles: my_main_site => my_mobile_site my_main_site?mobile => sets cookie and allows user to browse my_main_site without redirection. I know that the query string ?mobile IS setting the cookie, and the whole process works fine when I make the request using a curl script. I'm completely stumped as to why this is not working and have no idea how totroubleshoot things further. I appreciate this is somewhat bespoke request but I'm really looking for troubleshooting advice rather than anything else. Any ideas? Thanks..
1
4,638,979
01/09/2011 11:54:51
543,749
12/15/2010 18:22:11
43
1
getting a specific string fields from a Generic List to an array..
in c#, let's suppose that i have a class like as follows.. public class anItem { public string name { get; set; } public string surname { get; set; } } and i use a generic list with that object, like. List<anItem> listof = new List<anItem>(); listof.Add(new anItem { name = "name 1", surname = "surname 1" }); listof.Add(new anItem { name = "name 2", surname = "surname 2" }); listof.Add(new anItem { name = "name 3", surname = "surname 3" }); listof.Add(new anItem { name = "name 4", surname = "surname 4" }); is it possible take all surname 's from **listof** generic list to a string array ? string[] takenSurnames = // take just surnames from listof yes i can get that with **foreach** or **for** loops. but i wonder if there's any lambda expression or something like that shorter ? Thanks in advance..
c#
c#-4.0
null
null
null
null
open
getting a specific string fields from a Generic List to an array.. === in c#, let's suppose that i have a class like as follows.. public class anItem { public string name { get; set; } public string surname { get; set; } } and i use a generic list with that object, like. List<anItem> listof = new List<anItem>(); listof.Add(new anItem { name = "name 1", surname = "surname 1" }); listof.Add(new anItem { name = "name 2", surname = "surname 2" }); listof.Add(new anItem { name = "name 3", surname = "surname 3" }); listof.Add(new anItem { name = "name 4", surname = "surname 4" }); is it possible take all surname 's from **listof** generic list to a string array ? string[] takenSurnames = // take just surnames from listof yes i can get that with **foreach** or **for** loops. but i wonder if there's any lambda expression or something like that shorter ? Thanks in advance..
0
5,624,669
04/11/2011 16:47:34
638,434
02/28/2011 22:00:38
247
15
Strange "BadZipfile: Bad CRC-32" problem
This code is simplification of code in a Django app that receives an uploaded zip file via HTTP multi-part POST and does read-only processing of the data inside: #!/usr/bin/env python import csv, sys, StringIO, traceback, zipfile try: import io except ImportError: sys.stderr.write('Could not import the `io` module.\n') def get_zip_file(filename, method): if method == 'direct': return zipfile.ZipFile(filename) elif method == 'StringIO': data = file(filename).read() return zipfile.ZipFile(StringIO.StringIO(data)) elif method == 'BytesIO': data = file(filename).read() return zipfile.ZipFile(io.BytesIO(data)) def process_zip_file(filename, method, open_defaults_file): zip_file = get_zip_file(filename, method) items_file = zip_file.open('items.csv') csv_file = csv.DictReader(items_file) try: for idx, row in enumerate(csv_file): image_filename = row['image1'] if open_defaults_file: z = zip_file.open('defaults.csv') z.close() sys.stdout.write('Processed %d items.\n' % idx) except zipfile.BadZipfile: sys.stderr.write('Processing failed on item %d\n\n%s' % (idx, traceback.format_exc())) process_zip_file(sys.argv[1], sys.argv[2], int(sys.argv[3])) Pretty simple. We open the zip file and one or two CSV files inside the zip file. What's weird is that if I run this with a large zip file (~13 MB) and have it instantiate the `ZipFile` from a `StringIO.StringIO` or a `io.BytesIO` (Perhaps anything other than a plain filename? I had similar problems in the Django app when trying to create a `ZipFile` from a `TemporaryUploadedFile` or even a file object created by calling `os.tmpfile()` and `shutil.copyfileobj()`) and have it open TWO csv files rather than just one, then it fails towards the end of processing. Here's the output that I see on a Linux system: $ ./test_zip_file.py ~/data.zip direct 1 Processed 250 items. $ ./test_zip_file.py ~/data.zip StringIO 1 Processing failed on item 242 Traceback (most recent call last): File "./test_zip_file.py", line 26, in process_zip_file for idx, row in enumerate(csv_file): File ".../python2.7/csv.py", line 104, in next row = self.reader.next() File ".../python2.7/zipfile.py", line 523, in readline return io.BufferedIOBase.readline(self, limit) File ".../python2.7/zipfile.py", line 561, in peek chunk = self.read(n) File ".../python2.7/zipfile.py", line 581, in read data = self.read1(n - len(buf)) File ".../python2.7/zipfile.py", line 641, in read1 self._update_crc(data, eof=eof) File ".../python2.7/zipfile.py", line 596, in _update_crc raise BadZipfile("Bad CRC-32 for file %r" % self.name) BadZipfile: Bad CRC-32 for file 'items.csv' $ ./test_zip_file.py ~/data.zip BytesIO 1 Processing failed on item 242 Traceback (most recent call last): File "./test_zip_file.py", line 26, in process_zip_file for idx, row in enumerate(csv_file): File ".../python2.7/csv.py", line 104, in next row = self.reader.next() File ".../python2.7/zipfile.py", line 523, in readline return io.BufferedIOBase.readline(self, limit) File ".../python2.7/zipfile.py", line 561, in peek chunk = self.read(n) File ".../python2.7/zipfile.py", line 581, in read data = self.read1(n - len(buf)) File ".../python2.7/zipfile.py", line 641, in read1 self._update_crc(data, eof=eof) File ".../python2.7/zipfile.py", line 596, in _update_crc raise BadZipfile("Bad CRC-32 for file %r" % self.name) BadZipfile: Bad CRC-32 for file 'items.csv' $ ./test_zip_file.py ~/data.zip StringIO 0 Processed 250 items. $ ./test_zip_file.py ~/data.zip BytesIO 0 Processed 250 items. Incidentally, the code fails under the same conditions but in a different way on my OS X system. Instead of the `BadZipfile` exception, it seems to read corrupted data and gets very confused. This all suggests to me that I am doing something in this code that you are not supposed to do -- e.g.: call `zipfile.open` on a file while already having another file within the same zip file object open? This doesn't seem to be a problem when using `ZipFile(filename)`, but perhaps it's problematic when passing `ZipFile` a file-like object, because of some implementation details in the `zipfile` module? Perhaps I missed something in the `zipfile` docs? Or maybe it's not documented yet? Or (least likely), a bug in the `zipfile` module?
zipfile
stringio
bytesio
null
null
null
open
Strange "BadZipfile: Bad CRC-32" problem === This code is simplification of code in a Django app that receives an uploaded zip file via HTTP multi-part POST and does read-only processing of the data inside: #!/usr/bin/env python import csv, sys, StringIO, traceback, zipfile try: import io except ImportError: sys.stderr.write('Could not import the `io` module.\n') def get_zip_file(filename, method): if method == 'direct': return zipfile.ZipFile(filename) elif method == 'StringIO': data = file(filename).read() return zipfile.ZipFile(StringIO.StringIO(data)) elif method == 'BytesIO': data = file(filename).read() return zipfile.ZipFile(io.BytesIO(data)) def process_zip_file(filename, method, open_defaults_file): zip_file = get_zip_file(filename, method) items_file = zip_file.open('items.csv') csv_file = csv.DictReader(items_file) try: for idx, row in enumerate(csv_file): image_filename = row['image1'] if open_defaults_file: z = zip_file.open('defaults.csv') z.close() sys.stdout.write('Processed %d items.\n' % idx) except zipfile.BadZipfile: sys.stderr.write('Processing failed on item %d\n\n%s' % (idx, traceback.format_exc())) process_zip_file(sys.argv[1], sys.argv[2], int(sys.argv[3])) Pretty simple. We open the zip file and one or two CSV files inside the zip file. What's weird is that if I run this with a large zip file (~13 MB) and have it instantiate the `ZipFile` from a `StringIO.StringIO` or a `io.BytesIO` (Perhaps anything other than a plain filename? I had similar problems in the Django app when trying to create a `ZipFile` from a `TemporaryUploadedFile` or even a file object created by calling `os.tmpfile()` and `shutil.copyfileobj()`) and have it open TWO csv files rather than just one, then it fails towards the end of processing. Here's the output that I see on a Linux system: $ ./test_zip_file.py ~/data.zip direct 1 Processed 250 items. $ ./test_zip_file.py ~/data.zip StringIO 1 Processing failed on item 242 Traceback (most recent call last): File "./test_zip_file.py", line 26, in process_zip_file for idx, row in enumerate(csv_file): File ".../python2.7/csv.py", line 104, in next row = self.reader.next() File ".../python2.7/zipfile.py", line 523, in readline return io.BufferedIOBase.readline(self, limit) File ".../python2.7/zipfile.py", line 561, in peek chunk = self.read(n) File ".../python2.7/zipfile.py", line 581, in read data = self.read1(n - len(buf)) File ".../python2.7/zipfile.py", line 641, in read1 self._update_crc(data, eof=eof) File ".../python2.7/zipfile.py", line 596, in _update_crc raise BadZipfile("Bad CRC-32 for file %r" % self.name) BadZipfile: Bad CRC-32 for file 'items.csv' $ ./test_zip_file.py ~/data.zip BytesIO 1 Processing failed on item 242 Traceback (most recent call last): File "./test_zip_file.py", line 26, in process_zip_file for idx, row in enumerate(csv_file): File ".../python2.7/csv.py", line 104, in next row = self.reader.next() File ".../python2.7/zipfile.py", line 523, in readline return io.BufferedIOBase.readline(self, limit) File ".../python2.7/zipfile.py", line 561, in peek chunk = self.read(n) File ".../python2.7/zipfile.py", line 581, in read data = self.read1(n - len(buf)) File ".../python2.7/zipfile.py", line 641, in read1 self._update_crc(data, eof=eof) File ".../python2.7/zipfile.py", line 596, in _update_crc raise BadZipfile("Bad CRC-32 for file %r" % self.name) BadZipfile: Bad CRC-32 for file 'items.csv' $ ./test_zip_file.py ~/data.zip StringIO 0 Processed 250 items. $ ./test_zip_file.py ~/data.zip BytesIO 0 Processed 250 items. Incidentally, the code fails under the same conditions but in a different way on my OS X system. Instead of the `BadZipfile` exception, it seems to read corrupted data and gets very confused. This all suggests to me that I am doing something in this code that you are not supposed to do -- e.g.: call `zipfile.open` on a file while already having another file within the same zip file object open? This doesn't seem to be a problem when using `ZipFile(filename)`, but perhaps it's problematic when passing `ZipFile` a file-like object, because of some implementation details in the `zipfile` module? Perhaps I missed something in the `zipfile` docs? Or maybe it's not documented yet? Or (least likely), a bug in the `zipfile` module?
0
7,443,997
09/16/2011 11:27:41
57,428
01/21/2009 08:23:46
63,143
1,644
Why wouldn't gcc compile this trivial code that calls free() function?
I tried the following code on both codepad.org and ideone.com: char* ptr = new char; free( ptr ); Yes, I know it's undefined behavior, but I want to compile it and run it to see what happens. Visual C++ 10 compiles it, but gcc which is used on the abovementioned sites says >error: expected constructor, destructor, or type conversion before β€˜(’ token Why wouldn't this code compile with gcc and how could I make it compile?
c++
gcc
memory-allocation
null
null
07/31/2012 18:33:07
too localized
Why wouldn't gcc compile this trivial code that calls free() function? === I tried the following code on both codepad.org and ideone.com: char* ptr = new char; free( ptr ); Yes, I know it's undefined behavior, but I want to compile it and run it to see what happens. Visual C++ 10 compiles it, but gcc which is used on the abovementioned sites says >error: expected constructor, destructor, or type conversion before β€˜(’ token Why wouldn't this code compile with gcc and how could I make it compile?
3
8,061,962
11/09/2011 08:08:01
946,603
09/15/2011 10:52:27
6
1
How to synchronize product inventory stock in 2 databases. Mysql and MSSQL
I have 2 databases: *Magento online web shop @ Mysql *VISMA NOVA ERP system @MSSQL I need to synchronize product stock between these two. In magento product stock is decreased only when order is made(with no payment, check money order). Also it should be changed during stock update from Nova. In Nova stock changes during different actions of Nova operator. Also it should be changed when magento's order is placed.
mysql
sql-server-2005
sql-server-2008
magento
null
null
open
How to synchronize product inventory stock in 2 databases. Mysql and MSSQL === I have 2 databases: *Magento online web shop @ Mysql *VISMA NOVA ERP system @MSSQL I need to synchronize product stock between these two. In magento product stock is decreased only when order is made(with no payment, check money order). Also it should be changed during stock update from Nova. In Nova stock changes during different actions of Nova operator. Also it should be changed when magento's order is placed.
0
6,495,953
06/27/2011 16:29:03
422,252
08/16/2010 22:36:54
692
27
PHP SQL Table Creation and Maintance
What are some good reccomendations for managing SQL tables? I want to move away from writing and editting sqp tables manually, and therefore was wondering what was peoples standpoint. I been playing with the idea of creating an up and down function in my conroller class using Kohana's ORM. For example. Class books_Controller{ static function up(){ //create sql database tables; } static function down(){ // delete cuurent db table } } Then I call to up to create the tables and down to remove. books_Controller::up(); Thats great except when setting up a new server it can become a hastle creating and updating an 'init.php' file. Also sites new specific things on a per site basis. ## Proposal I've thought about creating a simple online php terminal. For example, I could visit domain.com/terminal, enter username and password and be able to eval input. From there I could bring up and down only specific along with other maintence. Pros? Cons? I don't hate sql, but I find it troublesome to manage/update up to date sql files. Also abstractions are near impossible in sql.
php
null
null
null
null
06/28/2011 21:39:34
not constructive
PHP SQL Table Creation and Maintance === What are some good reccomendations for managing SQL tables? I want to move away from writing and editting sqp tables manually, and therefore was wondering what was peoples standpoint. I been playing with the idea of creating an up and down function in my conroller class using Kohana's ORM. For example. Class books_Controller{ static function up(){ //create sql database tables; } static function down(){ // delete cuurent db table } } Then I call to up to create the tables and down to remove. books_Controller::up(); Thats great except when setting up a new server it can become a hastle creating and updating an 'init.php' file. Also sites new specific things on a per site basis. ## Proposal I've thought about creating a simple online php terminal. For example, I could visit domain.com/terminal, enter username and password and be able to eval input. From there I could bring up and down only specific along with other maintence. Pros? Cons? I don't hate sql, but I find it troublesome to manage/update up to date sql files. Also abstractions are near impossible in sql.
4
10,676,309
05/20/2012 19:03:43
1,362,108
04/27/2012 22:37:16
158
27
Can't read <h3> class with my script
I have a small issue. I can't seem to get the script to recognise the h3 tag. i can't just keep it as h3, I must add a class to it. **h3 tag:** <h3 class="jjheader"> <?php echo $listitem->title ?> </h3> **css:** #accordion h3.jjheader { padding: 8px 8px 8px 8px; font-weight: bold; font-size: 12px; color: #666666; margin-top: 5px; cursor: pointer; border: 1px solid #444444; border-radius: 8px; background: #151515; } **script:** It works fine if I don't add a class to h3 and replace `.jjheader` with `h3` in the script below, however with the class, it doesn't. <script type="text/javascript"> var parentAccordion=new TINY.accordion.slider('parentAccordion'); parentAccordion.init('accordion','.jjheader',0,1,'accordion-selected'); </script> Can someone please point in the right direction. Thanks in advance.
javascript
html
css
null
null
null
open
Can't read <h3> class with my script === I have a small issue. I can't seem to get the script to recognise the h3 tag. i can't just keep it as h3, I must add a class to it. **h3 tag:** <h3 class="jjheader"> <?php echo $listitem->title ?> </h3> **css:** #accordion h3.jjheader { padding: 8px 8px 8px 8px; font-weight: bold; font-size: 12px; color: #666666; margin-top: 5px; cursor: pointer; border: 1px solid #444444; border-radius: 8px; background: #151515; } **script:** It works fine if I don't add a class to h3 and replace `.jjheader` with `h3` in the script below, however with the class, it doesn't. <script type="text/javascript"> var parentAccordion=new TINY.accordion.slider('parentAccordion'); parentAccordion.init('accordion','.jjheader',0,1,'accordion-selected'); </script> Can someone please point in the right direction. Thanks in advance.
0
5,036,235
02/18/2011 00:02:43
156,011
08/13/2009 18:35:51
640
52
Rails 3: Caching to Global Variable
I'm sure "global variable" will get the hair on the back of everyone's neck standing up. What I'm trying to do is store a hierarchical menu in an acts_as_tree data table (done). In application_helper.rb, I create an html menu by querying the database and walking the tree (done). I don't want to do this for every page load. Here's what I tried: application.rb config.menu = nil application_helper.rb def my_menu_builder return MyApp::Application.config.menu if MyApp::Application.config.menu # All the menu building code that should only run once MyApp::Application.config.menu = menu_html end menu_controller.rb def create # whatever create code expire_menu_cache end protected def expire_menu_cache MyApp::Application.config.menu = nil end Where I stand right now is that on first page load, the database is, indeed, queried and the menu built. The results are stored in the config variable and the database is never again hit for this. It's the cache expiration part that's not working. When I reset the config.menu variable to nil, presumably the next time through my_menu_builder, it will detect that change and rebuild the menu, caching the new results. Doesn't seem to happen. Questions: Is Application.config a good place to store stuff like this? Does anyone see an obvious flaw in this caching strategy? Don't say premature optimization -- that's the phase I'm in. The premature-optimization iteration :) Thanks!
ruby-on-rails
caching
global-variables
null
null
null
open
Rails 3: Caching to Global Variable === I'm sure "global variable" will get the hair on the back of everyone's neck standing up. What I'm trying to do is store a hierarchical menu in an acts_as_tree data table (done). In application_helper.rb, I create an html menu by querying the database and walking the tree (done). I don't want to do this for every page load. Here's what I tried: application.rb config.menu = nil application_helper.rb def my_menu_builder return MyApp::Application.config.menu if MyApp::Application.config.menu # All the menu building code that should only run once MyApp::Application.config.menu = menu_html end menu_controller.rb def create # whatever create code expire_menu_cache end protected def expire_menu_cache MyApp::Application.config.menu = nil end Where I stand right now is that on first page load, the database is, indeed, queried and the menu built. The results are stored in the config variable and the database is never again hit for this. It's the cache expiration part that's not working. When I reset the config.menu variable to nil, presumably the next time through my_menu_builder, it will detect that change and rebuild the menu, caching the new results. Doesn't seem to happen. Questions: Is Application.config a good place to store stuff like this? Does anyone see an obvious flaw in this caching strategy? Don't say premature optimization -- that's the phase I'm in. The premature-optimization iteration :) Thanks!
0
756,917
04/16/2009 16:22:12
88,249
04/07/2009 18:45:22
141
7
Static method hides instance method ! Anybody, please throw light!
Similar question has been asked, but this is little different. Should following code give warning? class Foo { public void Do() { /*...*/ } /*...*/ } class Bar : Foo { public static void Do() { /*...*/ } /*...*/ } It gives: "warning CS0108: 'Bar.Do()' hides inherited member 'Foo.Do()'. Use the new keyword if hiding was intended." Let me make a change in code. class Foo { public static void Do() { /*...*/ } /*...*/ } class Bar : Foo { public void Do() { /*...*/ } /*...*/ } Same warning. If you do following, warning goes away. class Foo { public void Do() { /*...*/ } /*...*/ } class Bar : Foo { new public static void Do() { /*...*/ } /*...*/ } Let me make further change. class Foo { public void Do() { /*...*/ } /*...*/ } class Bar : Foo { new public static void Do() { new Bar().Do();/*...*/ } /*...*/ } This does not compile. error CS0176: Member 'Bar.Do()' cannot be accessed with an instance reference; qualify it with a type name instead. So, I lose access to inherited method via instance reference from static method! What would be logic behind it? Or I made a typo somewhere? Btw, I come across this when I was trying to define static method 'Show' for my form derived from 'Form'.
c#
.net
oop
software-engineering
language
null
open
Static method hides instance method ! Anybody, please throw light! === Similar question has been asked, but this is little different. Should following code give warning? class Foo { public void Do() { /*...*/ } /*...*/ } class Bar : Foo { public static void Do() { /*...*/ } /*...*/ } It gives: "warning CS0108: 'Bar.Do()' hides inherited member 'Foo.Do()'. Use the new keyword if hiding was intended." Let me make a change in code. class Foo { public static void Do() { /*...*/ } /*...*/ } class Bar : Foo { public void Do() { /*...*/ } /*...*/ } Same warning. If you do following, warning goes away. class Foo { public void Do() { /*...*/ } /*...*/ } class Bar : Foo { new public static void Do() { /*...*/ } /*...*/ } Let me make further change. class Foo { public void Do() { /*...*/ } /*...*/ } class Bar : Foo { new public static void Do() { new Bar().Do();/*...*/ } /*...*/ } This does not compile. error CS0176: Member 'Bar.Do()' cannot be accessed with an instance reference; qualify it with a type name instead. So, I lose access to inherited method via instance reference from static method! What would be logic behind it? Or I made a typo somewhere? Btw, I come across this when I was trying to define static method 'Show' for my form derived from 'Form'.
0
8,484,368
12/13/2011 04:33:46
741,542
05/06/2011 10:10:40
26
0
Value stored to cell during its initilization is never read in cellForRowAtIndex method?
In my application in tableview cell for row at index method i use the fallowing lines of code When my application is for analyze i got the fallowing leak code: **- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; //if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; //} // Configure the cell... }** i got error like this **Value stored to cell during its initilization is never read** Please help any one Thanks in advance
objective-c
uitableview
memory-management
memory-leaks
uitableviewcell
null
open
Value stored to cell during its initilization is never read in cellForRowAtIndex method? === In my application in tableview cell for row at index method i use the fallowing lines of code When my application is for analyze i got the fallowing leak code: **- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; //if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; //} // Configure the cell... }** i got error like this **Value stored to cell during its initilization is never read** Please help any one Thanks in advance
0
6,237,878
06/04/2011 16:15:03
784,086
06/04/2011 16:15:03
1
0
Apache mod_proxy, tomcat 5.5 - sometimes no response
Running tomcat 5.5 with (64 bit centos, 8 gb ram), mysql, apache "-server -Xss1M -Xms2G -Xmx3550m -XX:+UseConcMarkSweepGC -XX:NewSize=1G -XX:MaxPermSize=512m XX:CMSInitiatingOccupancyFraction=70" running multiple application on tomcat via apache as front end (almost 10 domains for various context paths on tomcat) apache config: httpd.conf: KeepAlive On ProxyRequests Off ProxyPreserveHost On Timeout 1800 ProxyPass /demo http : //127.0.0.1:8080/demo ProxyPassReverse /demo http :// 127.0.0.1.22:8080/demo ProxyPass /demo2 http :// 127.0.0.1:8080/demo2 ProxyPassReverse /demo2 http :// 127.0.0.1.22:8080/demo2 SetEnv force-proxy-request-1.0 1 SetEnv proxy-nokeepalive 1 .htaccess RewriteEngine on RewriteCond %{HTTP_HOST} ^test\.web\.com$ [NC] RewriteRule (.*) http : //test.web.com/demo/$1 [L,R=301] RewriteCond %{HTTP_HOST} ^test2\.web\.com$ [NC] RewriteRule (.*) http : //test2.web.com/demo2/$1 [L,R=301] Everything works great, including response time and all 10 instances (various domains), but 3-4 times a day: http://test.web.com does not give any response, it throws blank page (completely blank) while at the time when its blank, direct url: http://127.0.0.1:8080/demo works fine. It means tomcat still works fine, it seems apache is not able to forward the request to tomcat - right now load on per instance is 20 per minute. Sometime everything works for 3-4 days, then it happens, sometimes it keeps on happening. Blank page comes for some time - and after 3-4 minutes - page starts coming.
.htaccess
tomcat
page
blank
mod-proxy
null
open
Apache mod_proxy, tomcat 5.5 - sometimes no response === Running tomcat 5.5 with (64 bit centos, 8 gb ram), mysql, apache "-server -Xss1M -Xms2G -Xmx3550m -XX:+UseConcMarkSweepGC -XX:NewSize=1G -XX:MaxPermSize=512m XX:CMSInitiatingOccupancyFraction=70" running multiple application on tomcat via apache as front end (almost 10 domains for various context paths on tomcat) apache config: httpd.conf: KeepAlive On ProxyRequests Off ProxyPreserveHost On Timeout 1800 ProxyPass /demo http : //127.0.0.1:8080/demo ProxyPassReverse /demo http :// 127.0.0.1.22:8080/demo ProxyPass /demo2 http :// 127.0.0.1:8080/demo2 ProxyPassReverse /demo2 http :// 127.0.0.1.22:8080/demo2 SetEnv force-proxy-request-1.0 1 SetEnv proxy-nokeepalive 1 .htaccess RewriteEngine on RewriteCond %{HTTP_HOST} ^test\.web\.com$ [NC] RewriteRule (.*) http : //test.web.com/demo/$1 [L,R=301] RewriteCond %{HTTP_HOST} ^test2\.web\.com$ [NC] RewriteRule (.*) http : //test2.web.com/demo2/$1 [L,R=301] Everything works great, including response time and all 10 instances (various domains), but 3-4 times a day: http://test.web.com does not give any response, it throws blank page (completely blank) while at the time when its blank, direct url: http://127.0.0.1:8080/demo works fine. It means tomcat still works fine, it seems apache is not able to forward the request to tomcat - right now load on per instance is 20 per minute. Sometime everything works for 3-4 days, then it happens, sometimes it keeps on happening. Blank page comes for some time - and after 3-4 minutes - page starts coming.
0
8,546,541
12/17/2011 17:24:39
1,102,994
12/17/2011 02:11:01
3
0
Sorting a linked list C
I have linked list which has to be sorted with any algorithm for sorting. typedef struct word { wchar_t *word; struct word *prev, *next; }TWord; typedef struct list { TWord *head; TWord *tail; int size; }TList; I already have a function to compare two string type massives. The function return to 0 if the strings are equal, to 1 if the first string is bigger than the second one and -1 if the first string is smaller than the second one. Could somebody please helm me write the function?
c
sorting
linked-list
null
null
12/17/2011 17:36:13
not a real question
Sorting a linked list C === I have linked list which has to be sorted with any algorithm for sorting. typedef struct word { wchar_t *word; struct word *prev, *next; }TWord; typedef struct list { TWord *head; TWord *tail; int size; }TList; I already have a function to compare two string type massives. The function return to 0 if the strings are equal, to 1 if the first string is bigger than the second one and -1 if the first string is smaller than the second one. Could somebody please helm me write the function?
1
5,367,254
03/20/2011 07:22:23
325,418
05/09/2009 15:50:29
10,837
356
In Ruby, how to write code inside a class so that getter foo and setter self.foo = ... look more similar?
In Ruby, inside a class's instance method, we use a getter by foo and we use a setter by self.foo = something One doesn't need to have a `self.` and the other does, is there a way to make them look more similar, and not using something like `self.foo` as the getter, as it also looks verbose.
ruby
null
null
null
null
null
open
In Ruby, how to write code inside a class so that getter foo and setter self.foo = ... look more similar? === In Ruby, inside a class's instance method, we use a getter by foo and we use a setter by self.foo = something One doesn't need to have a `self.` and the other does, is there a way to make them look more similar, and not using something like `self.foo` as the getter, as it also looks verbose.
0
3,851,195
10/03/2010 19:08:56
313,366
03/07/2010 06:13:25
162
20
Is there a rational reason that Oracle's error feedback is lousy for this example?
See example: http://stackoverflow.com/questions/189557/ora-00942-table-or-view-does-not-exist-how-do-i-find-which-table-or-view-it-is Basically in a case like this Oracle responds with something like: SQL Error: ORA-00942: table or view does not exist Obscure error messages from Oracle when using an ORM lib like Hibernate aren't exactly a once in a lifetime experience. Why doesn't Oracle simply mention the NAME of the table or view which doesn't exist? Why all the auditing and other complex "solutions" posted in the example question? In short: Is there some rational, technical explanation for Oracle's seemingly piss poor error feedback, or is this more likely the result of a lack of motivation (on Oracle's part) to improve due to their almost 'monopolistic' popularity status? (Or other? Lack of coordination with ORM devs and DB vendors?) Actually, this also begs the question of whether other competing (particularly OSS) DBs provide any better feedback, which I have no idea of really, so this may apply to more than just Oracle.
database
oracle
hibernate
null
null
10/03/2010 21:01:47
not constructive
Is there a rational reason that Oracle's error feedback is lousy for this example? === See example: http://stackoverflow.com/questions/189557/ora-00942-table-or-view-does-not-exist-how-do-i-find-which-table-or-view-it-is Basically in a case like this Oracle responds with something like: SQL Error: ORA-00942: table or view does not exist Obscure error messages from Oracle when using an ORM lib like Hibernate aren't exactly a once in a lifetime experience. Why doesn't Oracle simply mention the NAME of the table or view which doesn't exist? Why all the auditing and other complex "solutions" posted in the example question? In short: Is there some rational, technical explanation for Oracle's seemingly piss poor error feedback, or is this more likely the result of a lack of motivation (on Oracle's part) to improve due to their almost 'monopolistic' popularity status? (Or other? Lack of coordination with ORM devs and DB vendors?) Actually, this also begs the question of whether other competing (particularly OSS) DBs provide any better feedback, which I have no idea of really, so this may apply to more than just Oracle.
4
4,961,751
02/10/2011 19:36:06
456,311
09/23/2010 14:54:02
157
23
Nested UIScrollView won't scroll when outter view is zoomed.
I'm having quite a problem here when nesting UIScrollViews. I have an outter paged scroll view, that does paged scrolling with it's UIScrollView subviews. These subviews contain a subview that have a CALayer with a big image. Whenever is needed this CALayer subviews can be have small scrollview added to them that act as small picture galleries. These galleries have their own viewcontroller called SlideViewController. view<br> |<br> v<br> mainScrollView<br> |<br> v<br> UIScrollView (page)<br> |<br> v view with CALayer<br> |<br> v<br> ScrollView like gallery.<br> Everything works like a charm until the ipad is rotated to landscape and the page scroll view is zoomed a 33%. All of the subviews are in their place. their bounds are correct, so as their frame. The thing is that when I swipe over the little galleries they don't scroll any more. The big page does. I've tried setting canCancelContentTouches to NO to all of the involved scrollviews. I also subclassed the gallery scroll view to get a grip on the touchesEnded/began/cancelled and try to disable the super view scrolling from there with no success. I tried to set the galleries as a first responder when I called init on them. With no further results. Now I can scroll the galleries only if I put my finger for a while on them, so no gesture recognizer steals the swipe from them, and then scroll gently to the next picture of the gallery. If I swipe normally, sometimes the big outter scrollview would steal the swipe and change the page, and sometimes the little gallery would catch it first. **this only happens when the scrollview containing the CA layer (the page) is zoomed** otherwise works amazingly great with no issues what so ever. Am I screwing the UIResponder chain? How could I fix this? I could paste you some code snippets, but this involves a handful of classes, that I don't know which ones could be of use or not. Thanks in advance
ipad
iphone-sdk-4.0
uiscrollview
nested
null
null
open
Nested UIScrollView won't scroll when outter view is zoomed. === I'm having quite a problem here when nesting UIScrollViews. I have an outter paged scroll view, that does paged scrolling with it's UIScrollView subviews. These subviews contain a subview that have a CALayer with a big image. Whenever is needed this CALayer subviews can be have small scrollview added to them that act as small picture galleries. These galleries have their own viewcontroller called SlideViewController. view<br> |<br> v<br> mainScrollView<br> |<br> v<br> UIScrollView (page)<br> |<br> v view with CALayer<br> |<br> v<br> ScrollView like gallery.<br> Everything works like a charm until the ipad is rotated to landscape and the page scroll view is zoomed a 33%. All of the subviews are in their place. their bounds are correct, so as their frame. The thing is that when I swipe over the little galleries they don't scroll any more. The big page does. I've tried setting canCancelContentTouches to NO to all of the involved scrollviews. I also subclassed the gallery scroll view to get a grip on the touchesEnded/began/cancelled and try to disable the super view scrolling from there with no success. I tried to set the galleries as a first responder when I called init on them. With no further results. Now I can scroll the galleries only if I put my finger for a while on them, so no gesture recognizer steals the swipe from them, and then scroll gently to the next picture of the gallery. If I swipe normally, sometimes the big outter scrollview would steal the swipe and change the page, and sometimes the little gallery would catch it first. **this only happens when the scrollview containing the CA layer (the page) is zoomed** otherwise works amazingly great with no issues what so ever. Am I screwing the UIResponder chain? How could I fix this? I could paste you some code snippets, but this involves a handful of classes, that I don't know which ones could be of use or not. Thanks in advance
0
9,259,036
02/13/2012 10:37:49
759,866
05/18/2011 19:51:00
2,034
89
Doctrine 2 DQL query with class name?
Is it possible in DQL, to specify the class name as a WHERE or GROUP BY clause? That would be very useful when having a hierarchy of users, for example: <!-- language: lang-sql --> SELECT a FROM Article a JOIN a.owner o WHERE o.class = ? <!-- language: lang-sql --> SELECT u.class, COUNT(*) FROM User u GROUP BY u.class
orm
doctrine2
dql
null
null
null
open
Doctrine 2 DQL query with class name? === Is it possible in DQL, to specify the class name as a WHERE or GROUP BY clause? That would be very useful when having a hierarchy of users, for example: <!-- language: lang-sql --> SELECT a FROM Article a JOIN a.owner o WHERE o.class = ? <!-- language: lang-sql --> SELECT u.class, COUNT(*) FROM User u GROUP BY u.class
0
9,444,934
02/25/2012 14:40:31
650,195
03/08/2011 17:03:10
18
0
Xstream Json - Order
I'm noticing a strange behavior in Xstream and the json output. I am using Xstream 1.4.2 in java. public class Person { @XStreamAlias("fname") private String firstname; @XStreamAlias("lname") private String lastname; } and when using the following code to convert to json XStream xstream = new XStream(new JettisonMappedXmlDriver()); xstream.setMode(XStream.NO_REFERENCES); xstream.autodetectAnnotations(true); // return String json = xstream.toXML(objPerson); The order of the output json doesnt match the same order I have in class Person, in other words, the last name (lname) comes before the first name (fname). Anyone know why that happnes? Can it be controlled? Supposing we have a list of elements, and I sort it, can I rely that Xstream will convert the list to json and keep the sorting order as it is in the java code? Thank you
java
json
xstream
null
null
null
open
Xstream Json - Order === I'm noticing a strange behavior in Xstream and the json output. I am using Xstream 1.4.2 in java. public class Person { @XStreamAlias("fname") private String firstname; @XStreamAlias("lname") private String lastname; } and when using the following code to convert to json XStream xstream = new XStream(new JettisonMappedXmlDriver()); xstream.setMode(XStream.NO_REFERENCES); xstream.autodetectAnnotations(true); // return String json = xstream.toXML(objPerson); The order of the output json doesnt match the same order I have in class Person, in other words, the last name (lname) comes before the first name (fname). Anyone know why that happnes? Can it be controlled? Supposing we have a list of elements, and I sort it, can I rely that Xstream will convert the list to json and keep the sorting order as it is in the java code? Thank you
0
674,733
03/23/2009 18:50:59
61,342
02/02/2009 02:48:57
727
16
Is it currently possible to get more meaningful error messages from C++ template code?
As in the title.
c++
templates
error-message
null
null
03/23/2009 19:17:13
not a real question
Is it currently possible to get more meaningful error messages from C++ template code? === As in the title.
1
11,736,836
07/31/2012 09:17:29
278,853
02/22/2010 16:46:06
154
28
Linux Ubuntu 11.10 unable to upload images using swfuploader
Hi I'm a web developer and we have a user who is having problems uploading some images using the SWFUploader. Some of the images are fine and he can upload but there are a quite a few which he can't. When he clicks to browse the folder it comes up but the images aren't there. It doesn't seem to be a mime issue or anything to do with the extension being capitals. The files seem to be a range of sizes as well so that doesn't help. I've asked the user to update his system and browser same problem. He has tried several different browsers and has also updated his flash. Doesn't seem to be a virus or anything nasty. Does anyone know of any other steps I could take. I would like to try this out myself but we only have windows and a mac and a command based lunix server and he is on Ubuntu 11.10 - Oneiric Ocelot Any ideas? Thanks Richard
linux
ubuntu
upload
ubuntu-11.10
swfloader
07/31/2012 20:59:19
off topic
Linux Ubuntu 11.10 unable to upload images using swfuploader === Hi I'm a web developer and we have a user who is having problems uploading some images using the SWFUploader. Some of the images are fine and he can upload but there are a quite a few which he can't. When he clicks to browse the folder it comes up but the images aren't there. It doesn't seem to be a mime issue or anything to do with the extension being capitals. The files seem to be a range of sizes as well so that doesn't help. I've asked the user to update his system and browser same problem. He has tried several different browsers and has also updated his flash. Doesn't seem to be a virus or anything nasty. Does anyone know of any other steps I could take. I would like to try this out myself but we only have windows and a mac and a command based lunix server and he is on Ubuntu 11.10 - Oneiric Ocelot Any ideas? Thanks Richard
2
319,037
11/25/2008 21:57:32
4,249
09/02/2008 14:13:06
3,716
180
Problem with relative path in Python on Windows
I know this is a simple, beginner-ish Python question, but I'm having trouble opening a file using a relative path. This behavior seems odd to me (coming from a non-Python background): import os, sys titles_path = os.path.normpath("../downloads/movie_titles.txt") print "Current working directory is {0}".format(os.getcwd()) print "Titles path is {0}, exists? {1}".format(movie_titles_path, os.path.exists(movie_titles_path)) titlesFile = open(movie_titles_path, 'r') print titlesFile This results in: C:\Users\Matt\Downloads\blah>testscript.py Current working directory is C:\Users\Matt\Downloads\blah Titles path is ..\downloads\movie_titles.txt, exists? False Traceback (most recent call last): File "C:\Users\Matt\Downloads\blah\testscript.py", line 27, in <module> titlesFile = open(titles_path, 'r') IOError: [Errno 2] No such file or directory: '..\\downloads\\movie_titles.txt' However, a dir command shows this file at the relative path exists: C:\Users\Matt\Downloads\blah>dir /b ..\downloads\movie_titles.txt movie_titles.txt What's going on with how Python interprets relative paths on Windows? What is the correct way to open a file with a relative path?
python
null
null
null
null
11/25/2008 22:10:04
off topic
Problem with relative path in Python on Windows === I know this is a simple, beginner-ish Python question, but I'm having trouble opening a file using a relative path. This behavior seems odd to me (coming from a non-Python background): import os, sys titles_path = os.path.normpath("../downloads/movie_titles.txt") print "Current working directory is {0}".format(os.getcwd()) print "Titles path is {0}, exists? {1}".format(movie_titles_path, os.path.exists(movie_titles_path)) titlesFile = open(movie_titles_path, 'r') print titlesFile This results in: C:\Users\Matt\Downloads\blah>testscript.py Current working directory is C:\Users\Matt\Downloads\blah Titles path is ..\downloads\movie_titles.txt, exists? False Traceback (most recent call last): File "C:\Users\Matt\Downloads\blah\testscript.py", line 27, in <module> titlesFile = open(titles_path, 'r') IOError: [Errno 2] No such file or directory: '..\\downloads\\movie_titles.txt' However, a dir command shows this file at the relative path exists: C:\Users\Matt\Downloads\blah>dir /b ..\downloads\movie_titles.txt movie_titles.txt What's going on with how Python interprets relative paths on Windows? What is the correct way to open a file with a relative path?
2
5,393,345
03/22/2011 15:10:18
618,286
02/15/2011 17:35:46
19
0
Getting command line output in VBScript (without writing to files)
I'm using VBScript, and my goal is to be able to substitute a drive letter for a path of my choosing. I need the D drive, and if it's not available I need to check if it's already mapped to the right spot; then notify the user if it's not. I found this: http://technet.microsoft.com/en-us/library/ee156605.aspx and I'm trying to adapt their second example: Set objShell = WScript.CreateObject("WScript.Shell") Set objExecObject = objShell.Exec("cmd /c ping -n 3 -w 1000 157.59.0.1") Do While Not objExecObject.StdOut.AtEndOfStream strText = objExecObject.StdOut.ReadLine() If Instr(strText, "Reply") > 0 Then Wscript.Echo "Reply received." Exit Do End If Loop (my adaptations): Set objShell = WScript.CreateObject("WScript.Shell") Set objExecObject = objShell.Exec("cmd /c substr") strText = "" Do While Not objExecObject.StdOut.AtEndOfStream strText = strText & objExecObject.StdOut.ReadLine() Loop Wscript.Echo strText Then I'll probably search for the string that tells where the D drive is mapped. I've also tried `objShell.Exec("substr")`, but I still don't get any output. Does anyone have any ideas on what I might be doing wrong? Or is there a better way to tell about drive mappings? Thanks, 213897
windows
vbscript
subst
drive-mapping
null
null
open
Getting command line output in VBScript (without writing to files) === I'm using VBScript, and my goal is to be able to substitute a drive letter for a path of my choosing. I need the D drive, and if it's not available I need to check if it's already mapped to the right spot; then notify the user if it's not. I found this: http://technet.microsoft.com/en-us/library/ee156605.aspx and I'm trying to adapt their second example: Set objShell = WScript.CreateObject("WScript.Shell") Set objExecObject = objShell.Exec("cmd /c ping -n 3 -w 1000 157.59.0.1") Do While Not objExecObject.StdOut.AtEndOfStream strText = objExecObject.StdOut.ReadLine() If Instr(strText, "Reply") > 0 Then Wscript.Echo "Reply received." Exit Do End If Loop (my adaptations): Set objShell = WScript.CreateObject("WScript.Shell") Set objExecObject = objShell.Exec("cmd /c substr") strText = "" Do While Not objExecObject.StdOut.AtEndOfStream strText = strText & objExecObject.StdOut.ReadLine() Loop Wscript.Echo strText Then I'll probably search for the string that tells where the D drive is mapped. I've also tried `objShell.Exec("substr")`, but I still don't get any output. Does anyone have any ideas on what I might be doing wrong? Or is there a better way to tell about drive mappings? Thanks, 213897
0
3,727,055
09/16/2010 13:19:10
81,410
03/23/2009 13:00:12
1,183
75
How can you prevent Silverlight Client Http request from caching respones?
I am using a `HttpWebRequest` created from `WebRequestCreator.ClientHttp.Create()` to fetch data from a webservice. And everything seemed to be working fine until I found out the calls where being cached. I was pretty sure that the ClientHttp did not include caching, but after a bit of searching I found this little note: > **Client HTTP Processing** > - Caching support [http://msdn.microsoft.com/en-us/library/dd772166(VS.95).aspx#networking][1] Which is the what's New in Silverlight 4 page on MSDN. But that is almost the only information I can find. I found another post claiming that the ClientHttp will request respect no-cache headers from the server, but I really would prefer that my Silverlight application was not dependent on a server-side setting. The usual fix to this problem is to simply add a random parameter to each call, but I really would like a more elegant solution. **Is there a way to simple disable the cache on `ClientHttpWebRequest`?** - Preferable on single call and not a global setting. [1]: http://msdn.microsoft.com/en-us/library/dd772166(VS.95).aspx#networking
.net
silverlight
caching
silverlight-4.0
clienthttpstack
null
open
How can you prevent Silverlight Client Http request from caching respones? === I am using a `HttpWebRequest` created from `WebRequestCreator.ClientHttp.Create()` to fetch data from a webservice. And everything seemed to be working fine until I found out the calls where being cached. I was pretty sure that the ClientHttp did not include caching, but after a bit of searching I found this little note: > **Client HTTP Processing** > - Caching support [http://msdn.microsoft.com/en-us/library/dd772166(VS.95).aspx#networking][1] Which is the what's New in Silverlight 4 page on MSDN. But that is almost the only information I can find. I found another post claiming that the ClientHttp will request respect no-cache headers from the server, but I really would prefer that my Silverlight application was not dependent on a server-side setting. The usual fix to this problem is to simply add a random parameter to each call, but I really would like a more elegant solution. **Is there a way to simple disable the cache on `ClientHttpWebRequest`?** - Preferable on single call and not a global setting. [1]: http://msdn.microsoft.com/en-us/library/dd772166(VS.95).aspx#networking
0
1,150,281
07/19/2009 16:41:28
69,654
02/22/2009 19:42:51
1
3
Papervision3D books to buy
Can anyone suggest me a good papervision3D book to read? I know as3 pretty well but I'm just starting out with pv3d.
pv3d
papervision3d
null
null
null
09/25/2011 10:56:02
not constructive
Papervision3D books to buy === Can anyone suggest me a good papervision3D book to read? I know as3 pretty well but I'm just starting out with pv3d.
4
1,152,333
07/20/2009 08:32:27
87,234
04/05/2009 06:44:56
3,937
100
Force compiler to not optimize side-effect-less statements
I was reading some old game programming books and as some of you might know, back in that day it was usually faster to do bit hacks than do things the standard way. (Converting `float` to `int`, mask sign bit, convert back for absolute value, instead of just calling `fabs()`, for example) Nowadays is almost always better to just use the standard library math functions, since these tiny things are hardly the cause of most bottlenecks anyway. But I still want to do a comparison, just for curiosity's sake. So I want to make sure when I profile, I'm not getting skewed results. As such, I'd like to make sure the compiler does not optimize out statements that have no side effect, such as: void float_to_int(float f) { int i = static_cast<int>(f); // has no side-effects } Is there a way to do this? As far as I can tell, doing something like `i += 10` will still have no side-effect and as such won't solve the problem. The only thing I can think of is having a global variable, `int dummy;`, and after the cast doing something like `dummy += i`, so the value of `i` is used. But I feel like this dummy operation will get in the way of the results I want. I'm using Visual Studio 2008 / G++ (3.4.4).
c++
optimization
null
null
null
null
open
Force compiler to not optimize side-effect-less statements === I was reading some old game programming books and as some of you might know, back in that day it was usually faster to do bit hacks than do things the standard way. (Converting `float` to `int`, mask sign bit, convert back for absolute value, instead of just calling `fabs()`, for example) Nowadays is almost always better to just use the standard library math functions, since these tiny things are hardly the cause of most bottlenecks anyway. But I still want to do a comparison, just for curiosity's sake. So I want to make sure when I profile, I'm not getting skewed results. As such, I'd like to make sure the compiler does not optimize out statements that have no side effect, such as: void float_to_int(float f) { int i = static_cast<int>(f); // has no side-effects } Is there a way to do this? As far as I can tell, doing something like `i += 10` will still have no side-effect and as such won't solve the problem. The only thing I can think of is having a global variable, `int dummy;`, and after the cast doing something like `dummy += i`, so the value of `i` is used. But I feel like this dummy operation will get in the way of the results I want. I'm using Visual Studio 2008 / G++ (3.4.4).
0
6,335,069
06/13/2011 19:12:35
736,688
05/03/2011 18:05:41
18
3
Start another activity (by Intent) on half screen
Is it possible to start an activity (ie. Calculator) from within my main activity but in such a way that it only takes a part of the screen and not the whole screen?
android
android-layout
null
null
null
null
open
Start another activity (by Intent) on half screen === Is it possible to start an activity (ie. Calculator) from within my main activity but in such a way that it only takes a part of the screen and not the whole screen?
0
9,481,006
02/28/2012 11:25:06
1,194,935
02/07/2012 14:59:52
18
1
Have Excel QueryTable row numbers start at 1
Is there any way to adjust the starting number of a QueryTables row number? I have set QueryTable.RowNumbers = True but this starts counting at 0. I would like to start at 1.
excel-vba
null
null
null
null
null
open
Have Excel QueryTable row numbers start at 1 === Is there any way to adjust the starting number of a QueryTables row number? I have set QueryTable.RowNumbers = True but this starts counting at 0. I would like to start at 1.
0
4,474,219
12/17/2010 19:48:20
539,165
12/11/2010 21:18:51
11
1
Self hosted Yahoo Pipes alterantive?
I've searched high and low for a Yahoo Pipes alternative and the only online app I found that is anything like it - seems to be an abandoned project. Are there any self hosted solutions that allow truncate, filter and regex per feed item?
regex
rss
null
null
null
12/19/2010 13:25:12
off topic
Self hosted Yahoo Pipes alterantive? === I've searched high and low for a Yahoo Pipes alternative and the only online app I found that is anything like it - seems to be an abandoned project. Are there any self hosted solutions that allow truncate, filter and regex per feed item?
2
10,927,910
06/07/2012 08:01:26
1,075,826
12/01/2011 16:07:32
40
0
Row striping with multiple tables
I have multiple tables in the same document and want add a row color to the first tbody row in each table. I have the followiong code $('table tbody tr').filter(':even').not('.spacer, .hidden, thead tr, tfoot tr').addClass('even'); However, it's not working exactly as I would like. Can anyone help with the code above so I can ensure the row highlighting starts with the first tbody row of each table, no matter how many tables appear on the page? Thanks in advance.
jquery
table
null
null
null
null
open
Row striping with multiple tables === I have multiple tables in the same document and want add a row color to the first tbody row in each table. I have the followiong code $('table tbody tr').filter(':even').not('.spacer, .hidden, thead tr, tfoot tr').addClass('even'); However, it's not working exactly as I would like. Can anyone help with the code above so I can ensure the row highlighting starts with the first tbody row of each table, no matter how many tables appear on the page? Thanks in advance.
0
5,024,551
02/17/2011 02:46:14
620,675
02/17/2011 02:46:14
1
0
How to make a 5 layer- pyramid * using C#
My question is how to make a pyramid using * and 'space' in C#? The output will be like this. * * * * * * * * * * * * * * * We only need to use "for loop" for this program (4 for loops). I hope that you can help me. I searched in different websites but there's no answer. I actually need it tomorrow. Thanks for helping me! ^^
c#
c#-4.0
null
null
null
02/17/2011 02:55:00
too localized
How to make a 5 layer- pyramid * using C# === My question is how to make a pyramid using * and 'space' in C#? The output will be like this. * * * * * * * * * * * * * * * We only need to use "for loop" for this program (4 for loops). I hope that you can help me. I searched in different websites but there's no answer. I actually need it tomorrow. Thanks for helping me! ^^
3
4,927,257
02/07/2011 22:12:38
352,765
05/28/2010 09:57:51
8,280
592
text-overflow:ellipsis in Firefox 4?
The `text-overflow:ellipsis;` CSS property must be one of the few things that Microsoft has done right for the web. All the other browsers now support it... except Firefox. The Firefox developers have been [arguing over it since 2005](https://bugzilla.mozilla.org/show_bug.cgi?id=312156) but despite the obvious demand for it, they can't seem to actually bring themselves to implement it (even an experimental `-moz-` implementation would be sufficient). A few years ago, someone worked out a way to [hack Firefox 3 to make it support an ellipsis](http://ernstdehaan.blogspot.com/2008/10/ellipsis-in-all-modern-browsers.html). The hack uses the `-moz-binding` feature to implement it using XUL. Quite a number of sites are now using this hack. The bad news? Firefox 4 is removing the `-moz-binding` feature, which means this hack won't work any more. So as soon as Firefox 4 is released (later this month, I hear), we're going to be back to the problem of having it not being able to support this feature. So my question is: Is there any other way around this? (I'm trying to avoid falling back to a Javascript solution if at all possible)
css3
ellipsis
text-overflow
firefox-4
null
null
open
text-overflow:ellipsis in Firefox 4? === The `text-overflow:ellipsis;` CSS property must be one of the few things that Microsoft has done right for the web. All the other browsers now support it... except Firefox. The Firefox developers have been [arguing over it since 2005](https://bugzilla.mozilla.org/show_bug.cgi?id=312156) but despite the obvious demand for it, they can't seem to actually bring themselves to implement it (even an experimental `-moz-` implementation would be sufficient). A few years ago, someone worked out a way to [hack Firefox 3 to make it support an ellipsis](http://ernstdehaan.blogspot.com/2008/10/ellipsis-in-all-modern-browsers.html). The hack uses the `-moz-binding` feature to implement it using XUL. Quite a number of sites are now using this hack. The bad news? Firefox 4 is removing the `-moz-binding` feature, which means this hack won't work any more. So as soon as Firefox 4 is released (later this month, I hear), we're going to be back to the problem of having it not being able to support this feature. So my question is: Is there any other way around this? (I'm trying to avoid falling back to a Javascript solution if at all possible)
0
9,782,319
03/20/2012 06:36:17
1,129,344
01/04/2012 06:43:09
29
1
How can we see IP adress from where my own Update has been Done
I doubt my facebook account and password was compromised , I have changed its passwrod, now I want to see who did my previous update , please let me know how to do it, I am a JAVA developer so I am quite comfortable with Coding
php
facebook
null
null
null
03/21/2012 09:56:37
off topic
How can we see IP adress from where my own Update has been Done === I doubt my facebook account and password was compromised , I have changed its passwrod, now I want to see who did my previous update , please let me know how to do it, I am a JAVA developer so I am quite comfortable with Coding
2
7,471,764
09/19/2011 13:32:32
811,718
06/23/2011 07:05:59
1
0
Replacement for SVG
My project is using SVG and there is a plan to move out of SVG and replace the existing functionality with suitable replacement.<br /><br /> My current SVG apps does following things,<br /><br /> 1. Exposes the object(SVG shapes) relations or dependency in screen.<br /> When there are two dependent shapes (say rect1 and rect2), we draw a line from rect1 to react2 to say that they are dependent.<br /><br /> 2. Triggers javascript functions when we fire certain events (click or mouse over) on shapes. <br /><br /> Is there any alternatives to replace the SVG and simply the drawing process?<br /> I am thinking to store the shapes information in database and auto generate the shapes in UI.<br /><br /> Thanks in advance.
javascript
graphics
svg
2d
null
null
open
Replacement for SVG === My project is using SVG and there is a plan to move out of SVG and replace the existing functionality with suitable replacement.<br /><br /> My current SVG apps does following things,<br /><br /> 1. Exposes the object(SVG shapes) relations or dependency in screen.<br /> When there are two dependent shapes (say rect1 and rect2), we draw a line from rect1 to react2 to say that they are dependent.<br /><br /> 2. Triggers javascript functions when we fire certain events (click or mouse over) on shapes. <br /><br /> Is there any alternatives to replace the SVG and simply the drawing process?<br /> I am thinking to store the shapes information in database and auto generate the shapes in UI.<br /><br /> Thanks in advance.
0
11,369,705
07/06/2012 21:12:21
1,292,230
03/26/2012 05:21:52
138
26
No Awarded Bounty
I had submitted a question and put a bounty on it a little more than a week ago. I couldn't get a correct answer to my question and none of the answers had an upvote, so when the bounty closed, nobody was awarded the points. What happened to those points?
stackoverflow
null
null
null
null
07/06/2012 21:18:13
off topic
No Awarded Bounty === I had submitted a question and put a bounty on it a little more than a week ago. I couldn't get a correct answer to my question and none of the answers had an upvote, so when the bounty closed, nobody was awarded the points. What happened to those points?
2
2,050,102
01/12/2010 15:36:01
185,593
10/07/2009 12:17:02
1,345
83
StringFormat flags : display the whole line
the StringFormat flags permits to differently represent a string in a rectangle. [in this example][1] was used `string_format.FormatFlags = StringFormatFlags.NoClip` one: ![alt text][2] Question === having txt = "The quick brown fox jumps over the lazy dog." can I represent this text entirely as a single line (and centered). I mean, I use a default rectangle without knowing what will be the length of the text, but i know where should be the text **center**. [1]: http://www.java2s.com/Tutorial/VB/0300__2D-Graphics/StringFormatFlagsNoClip.htm [2]: http://www.java2s.com/Tutorial/VBImages/NoClipStringFormatFlag.PNG
.net
stringformat
.net-2.0
null
null
null
open
StringFormat flags : display the whole line === the StringFormat flags permits to differently represent a string in a rectangle. [in this example][1] was used `string_format.FormatFlags = StringFormatFlags.NoClip` one: ![alt text][2] Question === having txt = "The quick brown fox jumps over the lazy dog." can I represent this text entirely as a single line (and centered). I mean, I use a default rectangle without knowing what will be the length of the text, but i know where should be the text **center**. [1]: http://www.java2s.com/Tutorial/VB/0300__2D-Graphics/StringFormatFlagsNoClip.htm [2]: http://www.java2s.com/Tutorial/VBImages/NoClipStringFormatFlag.PNG
0
11,045,916
06/15/2012 06:51:59
174,184
09/16/2009 07:41:01
335
15
HttpServletRequest getParameter unable to retrieve parameters with &amp;
I have a url, something like this `localhost:8080/foo.action?param1=7&param2=8&param3=6` When this is the Url (as it is), `request.getParmeter("param2")` gives me `8` [Correct] i) When the encoding converts this url to `localhost:8080/foo.action?param1=7%26param2=8%26param3=6` In this case, `request.getParameter("param1")` gives me `7&param2=8&param3=6` ii) When the encoding converts this url to `localhost:8080/foo.action?param1=7&amp;param2=8&amp;param3=6` In this case, `request.getParameter("param1")` gives me `7` and `request.getParameter("param2")` gives me null What is the correct way of retrieving the parameters? [Assuming that using one of the two Url encoding schemes is unavoidable] (I am using struts actions)
java
jsp
servlets
struts
httprequest
null
open
HttpServletRequest getParameter unable to retrieve parameters with &amp; === I have a url, something like this `localhost:8080/foo.action?param1=7&param2=8&param3=6` When this is the Url (as it is), `request.getParmeter("param2")` gives me `8` [Correct] i) When the encoding converts this url to `localhost:8080/foo.action?param1=7%26param2=8%26param3=6` In this case, `request.getParameter("param1")` gives me `7&param2=8&param3=6` ii) When the encoding converts this url to `localhost:8080/foo.action?param1=7&amp;param2=8&amp;param3=6` In this case, `request.getParameter("param1")` gives me `7` and `request.getParameter("param2")` gives me null What is the correct way of retrieving the parameters? [Assuming that using one of the two Url encoding schemes is unavoidable] (I am using struts actions)
0
9,194,738
02/08/2012 13:58:56
1,182,796
02/01/2012 13:29:59
1
0
How to install Internet explorer in Ubuntu?
I have struggled in installing Internet explorer in in UBUNTU...can anyone help me to do?
ubuntu
null
null
null
null
02/08/2012 14:01:25
off topic
How to install Internet explorer in Ubuntu? === I have struggled in installing Internet explorer in in UBUNTU...can anyone help me to do?
2
4,082,428
11/02/2010 21:52:03
313,421
04/10/2010 10:36:10
518
62
After zipping a file, new size > old size * 100, how is it possible ?!
Our CEO asked it in a meeting and emphasized it's possible under normal conditions on every pc !
zip
company-questions
award
null
null
11/02/2010 21:57:00
not a real question
After zipping a file, new size > old size * 100, how is it possible ?! === Our CEO asked it in a meeting and emphasized it's possible under normal conditions on every pc !
1
4,140,884
11/10/2010 03:07:55
455,663
09/22/2010 23:44:01
11
1
pyparsing, forward, and recursion
This is my first question, so please bear with me... I'm using pyparsing to parse vcd (value change dump) files. Essentially, I want to read in the files, parse it into an internal dictionary, and manipulate the values. Without going into details on the structure, my problem occurs with identifying nested categories. In vcd files, you have 'scopes' which include wires and possibly some deeper (nested) scopes. Think of them like levels. So in my file, I have: $scope module toplevel $end $scope module midlevel $end $var wire a $end $var wire b $end $upscope $end $var wire c $end $var wire d $end $var wire e $end $scope module extralevel $end $var wire f $end $var wire g $end $upscope $end $var wire h $end $var wire i $end $upscope $end So 'toplevel' encompasses everything (a - i), 'midlevel' has (a - b), 'extralevel' has (f - g), etc. Here is my code (snippet) for parsing this section: scope_header = Group(Literal('$scope') + Word(alphas) + Word(alphas) + \ Literal('$end')) wire_map = Group(Literal('$var') + Literal('wire') + Word(alphas) + \ Literal('$end')) scope_footer = Group(Literal('$upscope') + Literal('$end')) scope = Forward() scope << (scope_header + ZeroOrMore(wire_map) + ZeroOrMore(scope) + \ ZeroOrMore(wire_map) + scope_footer) Now, what I _thought_ happens is that as it hits each scope, it would keep track of each 'level' and I would end up with a structure containing nested scopes. However, it errors out on $scope module extralevel $end saying it expects '$upscope'. So I know I'm not using the recursion correctly. Can someone help me out? Let me know if I need to provide more info. Thanks!!!!
python
recursion
forward
pyparsing
null
null
open
pyparsing, forward, and recursion === This is my first question, so please bear with me... I'm using pyparsing to parse vcd (value change dump) files. Essentially, I want to read in the files, parse it into an internal dictionary, and manipulate the values. Without going into details on the structure, my problem occurs with identifying nested categories. In vcd files, you have 'scopes' which include wires and possibly some deeper (nested) scopes. Think of them like levels. So in my file, I have: $scope module toplevel $end $scope module midlevel $end $var wire a $end $var wire b $end $upscope $end $var wire c $end $var wire d $end $var wire e $end $scope module extralevel $end $var wire f $end $var wire g $end $upscope $end $var wire h $end $var wire i $end $upscope $end So 'toplevel' encompasses everything (a - i), 'midlevel' has (a - b), 'extralevel' has (f - g), etc. Here is my code (snippet) for parsing this section: scope_header = Group(Literal('$scope') + Word(alphas) + Word(alphas) + \ Literal('$end')) wire_map = Group(Literal('$var') + Literal('wire') + Word(alphas) + \ Literal('$end')) scope_footer = Group(Literal('$upscope') + Literal('$end')) scope = Forward() scope << (scope_header + ZeroOrMore(wire_map) + ZeroOrMore(scope) + \ ZeroOrMore(wire_map) + scope_footer) Now, what I _thought_ happens is that as it hits each scope, it would keep track of each 'level' and I would end up with a structure containing nested scopes. However, it errors out on $scope module extralevel $end saying it expects '$upscope'. So I know I'm not using the recursion correctly. Can someone help me out? Let me know if I need to provide more info. Thanks!!!!
0
5,156,328
03/01/2011 15:10:36
639,554
03/01/2011 15:06:24
1
0
C++ 4 players in a array after element 3 reset to 0 with modulus
4 players in a array after element 3 reset to 0 with modulus. So if its players 3 turn it will reset to player 1 witch is element 0.
c++
null
null
null
null
03/01/2011 17:13:04
not a real question
C++ 4 players in a array after element 3 reset to 0 with modulus === 4 players in a array after element 3 reset to 0 with modulus. So if its players 3 turn it will reset to player 1 witch is element 0.
1
10,256,398
04/21/2012 05:09:04
823,859
06/30/2011 21:13:41
26
0
Chrome: Cannot Use Tab Key or Auto-fill
I don't know if this is the proper forum, but you guys have been extremely helpful and knowledgeable in the past. For the past few days, I've had the following issues with Chrome: 1) I cannot tab between fields on a form 2) Auto-fill does not show up in forms 3) I need to press the return key twice to get a new line (for example, in this text box). I've uninstalled all of my extensions, in case that was the issue, but it didn't help. I've written to the support team, but haven't heard back. If this keeps up, I may need to switch back to Firefox. Adam
google-chrome
null
null
null
null
04/28/2012 02:46:50
off topic
Chrome: Cannot Use Tab Key or Auto-fill === I don't know if this is the proper forum, but you guys have been extremely helpful and knowledgeable in the past. For the past few days, I've had the following issues with Chrome: 1) I cannot tab between fields on a form 2) Auto-fill does not show up in forms 3) I need to press the return key twice to get a new line (for example, in this text box). I've uninstalled all of my extensions, in case that was the issue, but it didn't help. I've written to the support team, but haven't heard back. If this keeps up, I may need to switch back to Firefox. Adam
2
2,012,074
01/06/2010 09:55:43
120,992
06/11/2009 00:45:23
23
0
How can I guess action name from url in Rails?
For example I have an *url* generated by `something_path` or `something_url` methods. I need to know action name from that *url*
ruby-on-rails
routing
null
null
null
null
open
How can I guess action name from url in Rails? === For example I have an *url* generated by `something_path` or `something_url` methods. I need to know action name from that *url*
0
2,201,598
02/04/2010 17:04:30
257,092
01/22/2010 20:45:26
36
1
Django: how to define two fields "unique" as couple
Is there a way to define a couple of fields as unique in Django? I have a table of volumes (of journals) and I don't want more then one volume number for the same journal. class Volume(models.Model): id = models.AutoField(primary_key=True) journal_id = models.ForeignKey(Journals, db_column='jid', null=True, verbose_name = "Journal") volume_number = models.CharField('Volume Number', max_length=100) comments = models.TextField('Comments', max_length=4000, blank=True) I tried to put `unique = True` as attribute in the fields `journal_id` and `volume_number` but it doesn't work. Ideas?? Thanks, Giovanni
django
django-models
null
null
null
null
open
Django: how to define two fields "unique" as couple === Is there a way to define a couple of fields as unique in Django? I have a table of volumes (of journals) and I don't want more then one volume number for the same journal. class Volume(models.Model): id = models.AutoField(primary_key=True) journal_id = models.ForeignKey(Journals, db_column='jid', null=True, verbose_name = "Journal") volume_number = models.CharField('Volume Number', max_length=100) comments = models.TextField('Comments', max_length=4000, blank=True) I tried to put `unique = True` as attribute in the fields `journal_id` and `volume_number` but it doesn't work. Ideas?? Thanks, Giovanni
0