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
5,000,950
02/15/2011 07:35:25
455,042
09/22/2010 12:42:05
227
10
IE input file problem
I have the following input file tag: <input type="file" id="handlerxhr1" /> in mozilla when i run the following jquery code: var input = $('#handlerxhr1')[0]; $('#upload').click(function() { alert(input.files[0]); }); I get response: [object File] (which is good) but in IE i get 'input.files.0 is undefined' what am i doing wrong? thanks
javascript
jquery
mozilla
null
null
null
open
IE input file problem === I have the following input file tag: <input type="file" id="handlerxhr1" /> in mozilla when i run the following jquery code: var input = $('#handlerxhr1')[0]; $('#upload').click(function() { alert(input.files[0]); }); I get response: [object File] (which is good) but in IE i get 'input.files.0 is undefined' what am i doing wrong? thanks
0
6,162,353
05/28/2011 14:53:26
774,414
05/28/2011 14:53:26
1
0
Can't use android GPS in service with thread
I use a activity to call a service and the service run a thread countTask to get the data about GPS and ORIENTATION about the ORIENTATION part, it works fine,but the GPS part totally can't update the newest location so the latitude and altitude always remain null could somebody give an advice? I appreciate your help Here is the whole program <i>http://www.megaupload.com/?d=N52I7M9T Here is the service part http://dpaste.com/hold/547692/ activity part http://dpaste.com/hold/547697/
java
android
multithreading
service
gps
null
open
Can't use android GPS in service with thread === I use a activity to call a service and the service run a thread countTask to get the data about GPS and ORIENTATION about the ORIENTATION part, it works fine,but the GPS part totally can't update the newest location so the latitude and altitude always remain null could somebody give an advice? I appreciate your help Here is the whole program <i>http://www.megaupload.com/?d=N52I7M9T Here is the service part http://dpaste.com/hold/547692/ activity part http://dpaste.com/hold/547697/
0
5,701,550
04/18/2011 10:29:02
655,102
03/11/2011 09:33:17
10
0
showing forum post after clicking something
i am looking script for my forum witch show for example 10 posts and another 10 will be loading in background and when user click show another 10, posts will show, and another will load in background - some thing like facbook has any one could help me ?
jquery
jquery-ajax
null
null
null
04/26/2011 19:31:26
too localized
showing forum post after clicking something === i am looking script for my forum witch show for example 10 posts and another 10 will be loading in background and when user click show another 10, posts will show, and another will load in background - some thing like facbook has any one could help me ?
3
8,971,569
01/23/2012 12:25:43
455,946
09/23/2010 08:31:35
8
1
Create array list with mixed types in Java
Well, it looks like it is not possible. But how can i evaluate a postfix expression without having an operator in the stack of numbers?
java
calculator
null
null
null
01/24/2012 11:41:40
not a real question
Create array list with mixed types in Java === Well, it looks like it is not possible. But how can i evaluate a postfix expression without having an operator in the stack of numbers?
1
11,717,465
07/30/2012 07:58:49
1,562,276
07/30/2012 07:51:48
1
0
One yearmasters program for computer Science
I am BE computer Science from a reputed college in India and have an experience of 5 years. I want to do an MS from some good colleges preferably in USA.<br> Q1. Can you suggest any good **1 year** program?<br> Q2. Do these programs accepts **professional Letter of Recommendation?**[ as it will be difficult for me to get a faculty reco after being 5 year out of the campus] I have found that Cornell and CMU have such programs. Can you suggest some thing other than these two.
computer-science
recommendation
master
null
null
07/30/2012 19:25:06
off topic
One yearmasters program for computer Science === I am BE computer Science from a reputed college in India and have an experience of 5 years. I want to do an MS from some good colleges preferably in USA.<br> Q1. Can you suggest any good **1 year** program?<br> Q2. Do these programs accepts **professional Letter of Recommendation?**[ as it will be difficult for me to get a faculty reco after being 5 year out of the campus] I have found that Cornell and CMU have such programs. Can you suggest some thing other than these two.
2
5,013,778
02/16/2011 07:46:20
617,130
02/15/2011 02:12:17
1
1
HOW to select file according to intl setting
i have the following requirement: i need to install some files just to some special intl version. how can i do this? Thanks.
file
select
wix
wix3.5
null
null
open
HOW to select file according to intl setting === i have the following requirement: i need to install some files just to some special intl version. how can i do this? Thanks.
0
11,719,795
07/30/2012 10:38:44
1,562,679
07/30/2012 10:33:18
1
0
Sprite image with onclick background position
I have been searching the web for some hours now and i cant seem to find a workable solution for my project, so i was hoping some of you out there could help me out. Im not good with java etc. but i can do html and css just fine. I need to have my sprite image strip moving with a next and previous button. if i push next my background position add 50px and if i push previous it removes 50px. I need this to make a slotmachine look alike thingy, so if its possible to add a rolling animation on click it would be awesome. Its prolly fairly simple to make, if one know how to start :) Hope for some assistance and i hope you understand what i want.
jquery
null
null
null
null
07/30/2012 17:17:43
not a real question
Sprite image with onclick background position === I have been searching the web for some hours now and i cant seem to find a workable solution for my project, so i was hoping some of you out there could help me out. Im not good with java etc. but i can do html and css just fine. I need to have my sprite image strip moving with a next and previous button. if i push next my background position add 50px and if i push previous it removes 50px. I need this to make a slotmachine look alike thingy, so if its possible to add a rolling animation on click it would be awesome. Its prolly fairly simple to make, if one know how to start :) Hope for some assistance and i hope you understand what i want.
1
11,645,707
07/25/2012 08:34:01
1,546,338
07/23/2012 16:01:57
1
0
in page loading time jcarousellite comes vertically
On page load the jcarousellite comes vertically and after that it comes correctly see this http://cineaxis.com/
jquery
jcarousellite
null
null
null
07/25/2012 13:54:12
not a real question
in page loading time jcarousellite comes vertically === On page load the jcarousellite comes vertically and after that it comes correctly see this http://cineaxis.com/
1
4,990,374
02/14/2011 09:08:00
410,693
08/04/2010 11:16:53
106
2
parse CSV file .. problem with managing primary key ?
i just created a java file to parse a csv files and save them into an oracle database.. but in need a field ID which acts as a primary key.. and i am a bit confused abt looping..
database
oracle
loops
stringtokenizer
null
null
open
parse CSV file .. problem with managing primary key ? === i just created a java file to parse a csv files and save them into an oracle database.. but in need a field ID which acts as a primary key.. and i am a bit confused abt looping..
0
11,467,361
07/13/2012 09:05:10
528,438
12/02/2010 18:52:11
45
0
Taking a photo in an iOS landscape only app
I have an app that runs only in landscape mode. When i present the camera to take a picture it shows the screen as landscape but the live preview is rotated. When i take a picture the still preview is correct. I tried to rotate the camera image with this: self.navigationController.navigationBarHidden=YES; UIImagePickerController *picker=[[UIImagePickerController alloc] init]; picker.delegate=self; picker.sourceType=UIImagePickerControllerSourceTypeCamera; picker.showsCameraControls=YES; [picker setCameraFlashMode:UIImagePickerControllerCameraFlashModeOff]; CGAffineTransform transform=picker.view.transform; transform= CGAffineTransformMakeRotation(-90*M_PI/180); [picker setCameraViewTransform:transform]; [self presentModalViewController:picker animated:YES]; [picker release]; Now i get the live preview the right way round but a small viewing area (possibly because) it's view is in portrait?). Again the still preview is correct. [live preview][1] [still preview][2] How do i fix this? [1]: https://dl.dropbox.com/u/3729106/Photo%2013-07-2012%2009%2041%2020.png [2]: https://dl.dropbox.com/u/3729106/Photo%2013-07-2012%2009%2041%2030.png
ios
camera
landscape
null
null
null
open
Taking a photo in an iOS landscape only app === I have an app that runs only in landscape mode. When i present the camera to take a picture it shows the screen as landscape but the live preview is rotated. When i take a picture the still preview is correct. I tried to rotate the camera image with this: self.navigationController.navigationBarHidden=YES; UIImagePickerController *picker=[[UIImagePickerController alloc] init]; picker.delegate=self; picker.sourceType=UIImagePickerControllerSourceTypeCamera; picker.showsCameraControls=YES; [picker setCameraFlashMode:UIImagePickerControllerCameraFlashModeOff]; CGAffineTransform transform=picker.view.transform; transform= CGAffineTransformMakeRotation(-90*M_PI/180); [picker setCameraViewTransform:transform]; [self presentModalViewController:picker animated:YES]; [picker release]; Now i get the live preview the right way round but a small viewing area (possibly because) it's view is in portrait?). Again the still preview is correct. [live preview][1] [still preview][2] How do i fix this? [1]: https://dl.dropbox.com/u/3729106/Photo%2013-07-2012%2009%2041%2020.png [2]: https://dl.dropbox.com/u/3729106/Photo%2013-07-2012%2009%2041%2030.png
0
3,844,196
10/02/2010 03:06:50
78,181
03/15/2009 02:18:43
75
4
How can I use external variables in eval in Scheme?
I am trying something out in Scheme for fun. I'm trying to make an Area function that gets the type of the thing it's operating on and then calls a different function depending on the type of object. Here's my code: (define (area object) (if (not (null? (eval (word 'area- (get-type object))))) (eval (list (word 'area- (get-type object)) 'object)) #f ) ) Scheme doesn't like this because it says object is an unbound variable. No, I can't take the quote away because then it's actually placing the value there and then Scheme complains that the list is malformed. What can I do to use the value in object within eval?
lisp
scheme
eval
null
null
null
open
How can I use external variables in eval in Scheme? === I am trying something out in Scheme for fun. I'm trying to make an Area function that gets the type of the thing it's operating on and then calls a different function depending on the type of object. Here's my code: (define (area object) (if (not (null? (eval (word 'area- (get-type object))))) (eval (list (word 'area- (get-type object)) 'object)) #f ) ) Scheme doesn't like this because it says object is an unbound variable. No, I can't take the quote away because then it's actually placing the value there and then Scheme complains that the list is malformed. What can I do to use the value in object within eval?
0
9,380,470
02/21/2012 15:44:15
1,173,371
01/27/2012 11:32:10
13
0
FileUpload method for asp.net website
net and am just wondering if there is a method for the file upload tag in a library anywhere ? Thanks guys heres my code <asp:FileUpload ID="FileUpload1" runat="server" ForeColor="white" />
c#
asp.net
null
null
null
null
open
FileUpload method for asp.net website === net and am just wondering if there is a method for the file upload tag in a library anywhere ? Thanks guys heres my code <asp:FileUpload ID="FileUpload1" runat="server" ForeColor="white" />
0
6,406,851
06/20/2011 04:37:23
799,415
06/15/2011 10:50:14
1
0
Webite Control Panel
I am having a website, say xyz.com and I have the control panel details. The website is already displaying some contents. I have logged into control panel and navigate to browse files where I can view, upload , download files directly into server. I navigate to public_html folder, but could not find any files related to the content displayed in the site. I have uploaded a file test.html into public_html folder, but I am not able to access this file from web browser using the url www.xyz.com/test.html Could anybody please help me on this? Thanks, Priya
webserver
cpanel
null
null
null
06/20/2011 09:29:42
off topic
Webite Control Panel === I am having a website, say xyz.com and I have the control panel details. The website is already displaying some contents. I have logged into control panel and navigate to browse files where I can view, upload , download files directly into server. I navigate to public_html folder, but could not find any files related to the content displayed in the site. I have uploaded a file test.html into public_html folder, but I am not able to access this file from web browser using the url www.xyz.com/test.html Could anybody please help me on this? Thanks, Priya
2
2,948,858
06/01/2010 10:11:11
355,276
06/01/2010 10:11:11
1
0
geting information from Treeview with HierarchicalDataTemplate
Good day! I have such a template: <common:HierarchicalDataTemplate x:Key="my2ndPlusHierarchicalTemplate" ItemsSource="{Binding Children}"> <StackPanel Margin="0,2,5,2" Orientation="Vertical" Grid.Column="2"> <CheckBox IsTabStop="False" IsChecked="False" Click="ItemCheckbox_Click" Grid.Column="1" /> <TextBlock Text="{Binding Name}" FontSize="16" Foreground="#FF100101" HorizontalAlignment="Left" FontFamily="Verdana" FontWeight="Bold" /> <TextBlock Text="{Binding Description}" FontFamily="Verdana" FontSize="10" HorizontalAlignment="Left" Foreground="#FFA09A9A" FontStyle="Italic" /> <TextBox Width="100" Grid.Column="4" Height="24" LostFocus="TextBox_LostFocus" Name="tbNumber"></TextBox> </StackPanel> </common:HierarchicalDataTemplate> for a Treeview <controls:TreeView x:Name="tvServices" ItemTemplate="{StaticResource myHierarchicalTemplate}" ItemContainerStyle="{StaticResource expandedTreeViewItemStyle}" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="3" BorderBrush="#FFC1BCBC" FontFamily="Verdana" FontSize="14"> </controls:TreeView> I want to know the Name property of each TextBox in Treeview to make validation of each textbox such as: private void TextBox_LostFocus(object sender, RoutedEventArgs e) { tbNumber.ClearValidationError(); if ((!tbNumber.Text.IsZakazNumberValid()) && (tbNumber.Text != "")) { tbNumber.SetValidation(MyStrings.NumberError); tbNumber.RaiseValidationError(); isValid = false; } else { isValid = true; } } and I wnat to see what check boxes were checked how can I do it?
silverlight-3.0
silverlight-toolkit
null
null
null
null
open
geting information from Treeview with HierarchicalDataTemplate === Good day! I have such a template: <common:HierarchicalDataTemplate x:Key="my2ndPlusHierarchicalTemplate" ItemsSource="{Binding Children}"> <StackPanel Margin="0,2,5,2" Orientation="Vertical" Grid.Column="2"> <CheckBox IsTabStop="False" IsChecked="False" Click="ItemCheckbox_Click" Grid.Column="1" /> <TextBlock Text="{Binding Name}" FontSize="16" Foreground="#FF100101" HorizontalAlignment="Left" FontFamily="Verdana" FontWeight="Bold" /> <TextBlock Text="{Binding Description}" FontFamily="Verdana" FontSize="10" HorizontalAlignment="Left" Foreground="#FFA09A9A" FontStyle="Italic" /> <TextBox Width="100" Grid.Column="4" Height="24" LostFocus="TextBox_LostFocus" Name="tbNumber"></TextBox> </StackPanel> </common:HierarchicalDataTemplate> for a Treeview <controls:TreeView x:Name="tvServices" ItemTemplate="{StaticResource myHierarchicalTemplate}" ItemContainerStyle="{StaticResource expandedTreeViewItemStyle}" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="3" BorderBrush="#FFC1BCBC" FontFamily="Verdana" FontSize="14"> </controls:TreeView> I want to know the Name property of each TextBox in Treeview to make validation of each textbox such as: private void TextBox_LostFocus(object sender, RoutedEventArgs e) { tbNumber.ClearValidationError(); if ((!tbNumber.Text.IsZakazNumberValid()) && (tbNumber.Text != "")) { tbNumber.SetValidation(MyStrings.NumberError); tbNumber.RaiseValidationError(); isValid = false; } else { isValid = true; } } and I wnat to see what check boxes were checked how can I do it?
0
15,334
08/18/2008 22:41:10
1,670
08/17/2008 21:56:17
1
0
How to create short snippets in VIM?
I have recently started using VIM as my text editor and am currently working on my own customizations. I suppose keyboard mappings can do pretty much anything, but for the time being I'm using them as a sort of snippets facility almost exclusively. So, for example, if I type def{TAB} (<em>:imap def{TAB} def ():<ESC>3ha</em>), it expands to: def |(): # '|' represents the caret This works as expected, but I find it annoying when VIM waits for a full command while I'm typing a word containing "def" and am not interested in expanding it. * Is there a way to avoid this or use this function more effectively to this end? * Is any other VIM feature better suited for this?
vim
vimtips
null
null
null
null
open
How to create short snippets in VIM? === I have recently started using VIM as my text editor and am currently working on my own customizations. I suppose keyboard mappings can do pretty much anything, but for the time being I'm using them as a sort of snippets facility almost exclusively. So, for example, if I type def{TAB} (<em>:imap def{TAB} def ():<ESC>3ha</em>), it expands to: def |(): # '|' represents the caret This works as expected, but I find it annoying when VIM waits for a full command while I'm typing a word containing "def" and am not interested in expanding it. * Is there a way to avoid this or use this function more effectively to this end? * Is any other VIM feature better suited for this?
0
10,916,827
06/06/2012 14:58:21
1,416,177
05/24/2012 22:05:19
1
0
switching between css sheets according to screen width not working in IE7
I'm using the following which is not working in IE7. <!-- styles to use for small screens, such as phones --> <link rel="stylesheet" media="screen and (max-width:480px)" href="phone.css"> <!-- styles to use for medium screens, such as tablets --> <link rel="stylesheet" media="screen and (min-width:481px) and (max-width:800px)" href="tablet.css"> <!-- styles to use for larger screens, such as desktops and laptops --> <link rel="stylesheet" media="screen and (min-width:801px)" href="styles.css"> I would like to know why this doesn't work in IE7 and also, I'm wondering if it is better to link to separate style sheets or to have one style sheet with media queries embedded in it for different situations. Thanks
css
null
null
null
null
06/06/2012 15:34:03
not a real question
switching between css sheets according to screen width not working in IE7 === I'm using the following which is not working in IE7. <!-- styles to use for small screens, such as phones --> <link rel="stylesheet" media="screen and (max-width:480px)" href="phone.css"> <!-- styles to use for medium screens, such as tablets --> <link rel="stylesheet" media="screen and (min-width:481px) and (max-width:800px)" href="tablet.css"> <!-- styles to use for larger screens, such as desktops and laptops --> <link rel="stylesheet" media="screen and (min-width:801px)" href="styles.css"> I would like to know why this doesn't work in IE7 and also, I'm wondering if it is better to link to separate style sheets or to have one style sheet with media queries embedded in it for different situations. Thanks
1
9,131,841
02/03/2012 16:19:40
1,187,956
02/03/2012 16:15:36
1
0
OpenCV with Xcode 4.0.2
I'm not able to compile my code in XCode. It is giving me errors. Anybody knows proper steps to install and then compile ?
xcode
opencv
face-detection
eye-detection
null
02/07/2012 09:45:26
not a real question
OpenCV with Xcode 4.0.2 === I'm not able to compile my code in XCode. It is giving me errors. Anybody knows proper steps to install and then compile ?
1
10,765,243
05/26/2012 09:57:17
72,176
02/28/2009 09:07:13
465
43
How can I rewrite this CURL multipart/form-data request without using -F?
How can I rewrite the following CURL command, so that it doesn't use the `-F` option, but still generates the exact same HTTP request? i.e. so that it passes the multipart/form-data in the body directly. curl -v -i -X POST -F example=test http://localhost:3000/myapp
http
curl
multipartform-data
null
null
null
open
How can I rewrite this CURL multipart/form-data request without using -F? === How can I rewrite the following CURL command, so that it doesn't use the `-F` option, but still generates the exact same HTTP request? i.e. so that it passes the multipart/form-data in the body directly. curl -v -i -X POST -F example=test http://localhost:3000/myapp
0
11,253,065
06/28/2012 21:19:17
531,466
12/05/2010 21:12:31
560
16
How to send SMS with Huawei E226 3G modem using Java
How can I send SMS with Huawei E226 3G modem using Java language?
java
modem
3g
null
null
06/28/2012 21:22:35
not a real question
How to send SMS with Huawei E226 3G modem using Java === How can I send SMS with Huawei E226 3G modem using Java language?
1
11,192,704
06/25/2012 15:49:23
1,302,099
03/29/2012 23:35:46
34
0
CSS Rounded corner in Google Chrome
I wanted to make my top left hand corner of a table rounded in all browsers. I tried this: `-webkit-border-top-left-radius: 9px;` `-moz-border-radius-topleft: 9px;` `border-top-left-radius: 9px;` But it doesn't seem to be working in Google chrome. Can anyone see the error? I'm also sure it used to work...
css
google-chrome
null
null
null
06/25/2012 16:06:27
too localized
CSS Rounded corner in Google Chrome === I wanted to make my top left hand corner of a table rounded in all browsers. I tried this: `-webkit-border-top-left-radius: 9px;` `-moz-border-radius-topleft: 9px;` `border-top-left-radius: 9px;` But it doesn't seem to be working in Google chrome. Can anyone see the error? I'm also sure it used to work...
3
5,680,164
04/15/2011 17:15:25
710,225
04/15/2011 16:48:22
1
0
Why pointers are necessary in programing?
Is it important to use pointers while writing a code in any language for example C-language does it utilize more memory. Thank u
programming-languages
null
null
null
null
04/15/2011 17:39:37
not a real question
Why pointers are necessary in programing? === Is it important to use pointers while writing a code in any language for example C-language does it utilize more memory. Thank u
1
3,129,469
06/28/2010 00:33:13
65,159
02/11/2009 16:16:52
5,393
367
Are there any new ASP.NET MVC 2.0 resources or books that are recommended?
I am already familiar with steven sanders and manning books on asp.net mvc 1.0. I am looking for any asp.net mvc 2.0 books with more recent examples. A good resources are also welcome.
asp.net-mvc
books
null
null
null
09/30/2011 12:25:44
not constructive
Are there any new ASP.NET MVC 2.0 resources or books that are recommended? === I am already familiar with steven sanders and manning books on asp.net mvc 1.0. I am looking for any asp.net mvc 2.0 books with more recent examples. A good resources are also welcome.
4
4,697,676
01/15/2011 02:52:44
576,441
01/15/2011 02:52:44
1
0
how to make a dual boot pen drive using multiboot 10?
i am looking for the steps for making a dual boot pen drive using "multiboot 10" software. I have made a single boot pen drive but cannot make a dual boot pen drive..... please help me. thanks.
windows-services
null
null
null
null
07/16/2011 02:57:17
off topic
how to make a dual boot pen drive using multiboot 10? === i am looking for the steps for making a dual boot pen drive using "multiboot 10" software. I have made a single boot pen drive but cannot make a dual boot pen drive..... please help me. thanks.
2
5,502,335
03/31/2011 15:28:48
593,328
01/28/2011 05:32:41
31
1
uilabel problem
i have a problem is that any way to truncate the text of a label without changing its fontsize ? lets suppose i width of label is 200 and string size is more then 200 then it squeez the string and make it size to small i don't want that i want that if string is comming it shows that much string which is adjust in 200 and truncate rest if any one has any idea then tell me thanks in advance...
iphone-sdk-4.0
iphone-sdk-3.0
sdk
null
null
null
open
uilabel problem === i have a problem is that any way to truncate the text of a label without changing its fontsize ? lets suppose i width of label is 200 and string size is more then 200 then it squeez the string and make it size to small i don't want that i want that if string is comming it shows that much string which is adjust in 200 and truncate rest if any one has any idea then tell me thanks in advance...
0
10,164,188
04/15/2012 17:07:14
82,017
03/24/2009 13:40:11
4,068
144
Possible to handle all MouseMove events in WP7.1?
Is it possible to get notification of any MouseMove event, even those marked as handled? I have the following Xaml: <Grid x:Name="ParentContainer"> <ScrollViewer> ... </ScrollViewer> </Grid> My goal is to get all MouseMove events on the ScrollViewer, or something reasonably close to it like the ParentContainer, *without* resorting to setting ManipulationMode="Control" on the ScrollViewer for the best possible performance. Handling MouseMove on the ParentContainer (or the ScrollViewer) works when ManipulationMode="Control" is set on the ScrollViewer, but not when ManipulationMode="System". It sounds like to improve performance in Mango, the ScrollViewer started swallowing MouseMove events to improve performance. However, I'd expect to be able to get those handled events as follows: ParentContainer.AddHandler(???.MouseMoveEvent, MyMouseMoveHandler, true); In Silverlight or WPF I would expect that code to route all mouse events to MyMouseMoveHandler, even handled events. Unfortunately I can't find a static definition of MouseMoveEvent to pass to AddHandler. Has anyone had success using AddHandler with MouseMoveEvent in WP7? My last resort may be to add an overlay on top of the ScrollViewer with Background="Transparent" that would capture all Mouse events, but not mark them as handled and see if they propagate down to the ScrollViewer.
c#
silverlight
windows-phone-7
event-handling
mouse
null
open
Possible to handle all MouseMove events in WP7.1? === Is it possible to get notification of any MouseMove event, even those marked as handled? I have the following Xaml: <Grid x:Name="ParentContainer"> <ScrollViewer> ... </ScrollViewer> </Grid> My goal is to get all MouseMove events on the ScrollViewer, or something reasonably close to it like the ParentContainer, *without* resorting to setting ManipulationMode="Control" on the ScrollViewer for the best possible performance. Handling MouseMove on the ParentContainer (or the ScrollViewer) works when ManipulationMode="Control" is set on the ScrollViewer, but not when ManipulationMode="System". It sounds like to improve performance in Mango, the ScrollViewer started swallowing MouseMove events to improve performance. However, I'd expect to be able to get those handled events as follows: ParentContainer.AddHandler(???.MouseMoveEvent, MyMouseMoveHandler, true); In Silverlight or WPF I would expect that code to route all mouse events to MyMouseMoveHandler, even handled events. Unfortunately I can't find a static definition of MouseMoveEvent to pass to AddHandler. Has anyone had success using AddHandler with MouseMoveEvent in WP7? My last resort may be to add an overlay on top of the ScrollViewer with Background="Transparent" that would capture all Mouse events, but not mark them as handled and see if they propagate down to the ScrollViewer.
0
4,190,688
11/16/2010 02:31:12
496,949
11/04/2010 08:45:00
448
0
Func and lamda question
I have a declaration of void Test (Func<bool> f) I have a method like `bool getItem(string id)` I can call like `Test ( ()=>getItem("123"))` , why? I suppose that I can check I need 1 string parameter.
c#
.net
null
null
null
11/18/2010 03:11:31
not a real question
Func and lamda question === I have a declaration of void Test (Func<bool> f) I have a method like `bool getItem(string id)` I can call like `Test ( ()=>getItem("123"))` , why? I suppose that I can check I need 1 string parameter.
1
10,275,858
04/23/2012 06:34:56
1,234,667
02/27/2012 02:09:55
3
0
Boolean recursive function
Assuming `f(x) = !f(x-1)` and `f(0) = True` then does there exist a function `g(x)` such that `g(0) = True` and `S = {g(n) : n is on [0, infinity]} = {True, False, False, True, False, False, True, False, False, True, ...}`? More specifically: `g` can only rely on the last iteration of itself, and it may use the x-th iteration of `f`. Also, if you can figure this one out try figuring out the function for `{True, False, False, False, True, False, False, False, True, ...}` Note that `f(x)` above gives `S = {f(n) : n is on [0, infinity]} = {True, False, True, False, True, ...}`.
function
recursion
boolean
null
null
04/23/2012 22:34:07
off topic
Boolean recursive function === Assuming `f(x) = !f(x-1)` and `f(0) = True` then does there exist a function `g(x)` such that `g(0) = True` and `S = {g(n) : n is on [0, infinity]} = {True, False, False, True, False, False, True, False, False, True, ...}`? More specifically: `g` can only rely on the last iteration of itself, and it may use the x-th iteration of `f`. Also, if you can figure this one out try figuring out the function for `{True, False, False, False, True, False, False, False, True, ...}` Note that `f(x)` above gives `S = {f(n) : n is on [0, infinity]} = {True, False, True, False, True, ...}`.
2
9,242,843
02/11/2012 18:29:11
1,204,132
02/11/2012 18:17:20
1
0
RTMFP Protrocol in Flash Player 10.x is not compatible with Flash Player 11.x when using video stream multicast
I have a swc plugin embedded in my product to stream live video to a group of recipients. The plugin uses the NetStream, NetGroup and NetConnection objects, the server I use to handle the RTMFP session is Influxis. One client creates a group as a publisher, and stream a live video. His Camera is enabled and I can see the video on the screen as well. The others connect to his group and play the video. Peer assisted Networking is enabled for both the publisher and the recipients. The plugin worked well in all 10.x versions (10.1/10.2/10.3) However, when upgrading to flash player 11.x, it stopped working. 11.x to 11.x isn't working. 10.x with 11.x isn't working. only 10.x to 10.x is working. The server I use to handle the RTMFP protocol is Influxis.com I sent them the same question as well. The weirdest fact is that I'm using flash builder 4.6 with 4.6 sdk, which is aimed for flash player 11.1, and it is only working with 10.x flash players. I'd appreciate any light you can shed on this. Thank you, Amit
flash
player
rtmfp
null
null
null
open
RTMFP Protrocol in Flash Player 10.x is not compatible with Flash Player 11.x when using video stream multicast === I have a swc plugin embedded in my product to stream live video to a group of recipients. The plugin uses the NetStream, NetGroup and NetConnection objects, the server I use to handle the RTMFP session is Influxis. One client creates a group as a publisher, and stream a live video. His Camera is enabled and I can see the video on the screen as well. The others connect to his group and play the video. Peer assisted Networking is enabled for both the publisher and the recipients. The plugin worked well in all 10.x versions (10.1/10.2/10.3) However, when upgrading to flash player 11.x, it stopped working. 11.x to 11.x isn't working. 10.x with 11.x isn't working. only 10.x to 10.x is working. The server I use to handle the RTMFP protocol is Influxis.com I sent them the same question as well. The weirdest fact is that I'm using flash builder 4.6 with 4.6 sdk, which is aimed for flash player 11.1, and it is only working with 10.x flash players. I'd appreciate any light you can shed on this. Thank you, Amit
0
7,478,809
09/20/2011 00:22:54
701,678
04/11/2011 06:42:09
175
9
Android: Java: Proguard: How to: verify if my jar (different jar project)/apk are successfully processed? (I am thinking to reverse engineer it)
I successfully processed my jar and apk. Then, want to verify if is it truly hard to reverse engineer or truly did the obfuscation. I am thinking to try to reverse engineer it by myself to see what I did. But don't know how to do it.
java
android
reverse-engineering
apk
proguard
null
open
Android: Java: Proguard: How to: verify if my jar (different jar project)/apk are successfully processed? (I am thinking to reverse engineer it) === I successfully processed my jar and apk. Then, want to verify if is it truly hard to reverse engineer or truly did the obfuscation. I am thinking to try to reverse engineer it by myself to see what I did. But don't know how to do it.
0
4,377,355
12/07/2010 13:56:34
165,107
08/28/2009 20:55:46
2,519
34
I need a Powerful Web Scraper library.
I need a powerful web scraper library for mining contents from web. That can be paid or free both will be fine for me. Please suggest me a library or better way for mining the data and store in my preferred database. I have searched but i didn't find any good solution for this. I need a good suggestion from experts. Please help me out. Thanks in advance.
c#
.net
web-crawler
crawler
web-scraping
07/30/2012 19:46:35
not constructive
I need a Powerful Web Scraper library. === I need a powerful web scraper library for mining contents from web. That can be paid or free both will be fine for me. Please suggest me a library or better way for mining the data and store in my preferred database. I have searched but i didn't find any good solution for this. I need a good suggestion from experts. Please help me out. Thanks in advance.
4
4,121
08/06/2008 23:32:27
326
08/04/2008 16:59:58
21
3
[Team] Coding Styles
[Assuming you write code on a team] Does your team actually agree on a coding style standard? Independent of what language you are using, I'm curious to know A) do you agree and B) are the styles something you created as a group or did you decide to use a "third party's" style guide? Our team uses C# primarily, and we've taken to using Microsoft's StyleCop. Not because it's necessarily THE way to do it, but because it's something we [generally] agree with and it's easy to enforce. I'm also interested to know of style-compliance tools in other languages.
codingstyle
language-agnostic
null
null
null
05/08/2012 17:51:23
off topic
[Team] Coding Styles === [Assuming you write code on a team] Does your team actually agree on a coding style standard? Independent of what language you are using, I'm curious to know A) do you agree and B) are the styles something you created as a group or did you decide to use a "third party's" style guide? Our team uses C# primarily, and we've taken to using Microsoft's StyleCop. Not because it's necessarily THE way to do it, but because it's something we [generally] agree with and it's easy to enforce. I'm also interested to know of style-compliance tools in other languages.
2
8,505,953
12/14/2011 14:18:16
301,513
03/25/2010 08:32:11
125
12
Which SMB message tell me the shared folder list?
If I have multiple shared folders, which SMB message will tell who they are ? I use wireshark in hoping to catch that message, but it is weird that I can't find the message sent back from SMB server telling what shared folders it has. Thanks!
networking
wireshark
samba
smb
null
12/15/2011 16:55:56
off topic
Which SMB message tell me the shared folder list? === If I have multiple shared folders, which SMB message will tell who they are ? I use wireshark in hoping to catch that message, but it is weird that I can't find the message sent back from SMB server telling what shared folders it has. Thanks!
2
4,147,311
11/10/2010 17:39:32
251,736
01/15/2010 17:29:16
74
5
Finding image type from NSData or UIImage
I am loading an image from a URL provided by a third-party. There is no file extension (or filename for that matter) on the URL (as it is an obscured URL). I can take the data from this (in the form of NSData) and load it into a UIImage and display it fine. I want to persist this data to a file. However, I don't know what format the data is in (PNG, JPG, BMP)? I assume it is JPG (since it's an image from the web) but is there a programmatic way of finding out for sure? I've looked around StackOverflow and at the documentation and haven't been able to find anything. TIA.
iphone
ios
uiimage
nsdata
persist
null
open
Finding image type from NSData or UIImage === I am loading an image from a URL provided by a third-party. There is no file extension (or filename for that matter) on the URL (as it is an obscured URL). I can take the data from this (in the form of NSData) and load it into a UIImage and display it fine. I want to persist this data to a file. However, I don't know what format the data is in (PNG, JPG, BMP)? I assume it is JPG (since it's an image from the web) but is there a programmatic way of finding out for sure? I've looked around StackOverflow and at the documentation and haven't been able to find anything. TIA.
0
6,006,494
05/15/2011 04:30:17
332,913
05/04/2010 23:30:24
15
1
git submodule modified files status
I've added a submodule in my main git folder tree and haven't changed anything but it's showing up modified. What do I do about this? $ git status # On branch master # Changed but not updated: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: site.com/soundmanager # no changes added to commit (use "git add" and/or "git commit -a") I've tried a git submodule update, but it doesn't do anything.
git
git-submodules
null
null
null
null
open
git submodule modified files status === I've added a submodule in my main git folder tree and haven't changed anything but it's showing up modified. What do I do about this? $ git status # On branch master # Changed but not updated: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: site.com/soundmanager # no changes added to commit (use "git add" and/or "git commit -a") I've tried a git submodule update, but it doesn't do anything.
0
7,966,865
11/01/2011 13:03:25
79,379
03/18/2009 08:42:45
83
9
Tools to measure performance in ASP.net or C#
Can you please guide me to a book, tool or article that would guide me on how to make an asp.net MVC 2 application that uses WCF to perform better? I am interested in lower database query time. How to render pages more quickly. How to write controllers and action and what are the best practices in order to obtain an efficient application. I use Asp.Net MVC 2 , NHibernate / Entity Framework, WCF 4.0 and JQuery. Thanks
sql-server
wcf
asp.net-mvc-2
optimization
null
11/02/2011 13:51:06
not constructive
Tools to measure performance in ASP.net or C# === Can you please guide me to a book, tool or article that would guide me on how to make an asp.net MVC 2 application that uses WCF to perform better? I am interested in lower database query time. How to render pages more quickly. How to write controllers and action and what are the best practices in order to obtain an efficient application. I use Asp.Net MVC 2 , NHibernate / Entity Framework, WCF 4.0 and JQuery. Thanks
4
6,654,414
07/11/2011 18:04:22
595,437
01/30/2011 01:22:51
656
41
Best webpage editor for Ubuntu.
I need to make just plain HTML, JavaScript, and CSS pages. The thing that keeps me away from a simple text editor is because there is no native method for "Master Pages". I was hoping there would be some kind of HTML editor for Ubuntu that would support a simple method to incorporate just a simple system for Master Pages. **EDIT** Actually, maybe one for Windows would also be nice for somebody to point out ;)
javascript
html
css
ubuntu
master-pages
07/12/2011 02:17:18
off topic
Best webpage editor for Ubuntu. === I need to make just plain HTML, JavaScript, and CSS pages. The thing that keeps me away from a simple text editor is because there is no native method for "Master Pages". I was hoping there would be some kind of HTML editor for Ubuntu that would support a simple method to incorporate just a simple system for Master Pages. **EDIT** Actually, maybe one for Windows would also be nice for somebody to point out ;)
2
4,995,599
02/14/2011 18:03:02
252,163
01/16/2010 13:34:44
1,056
40
How to keep programcodes simple
I've a very serious problem in my career as a programmer, and it's that i over complicate things. Are there any guidelines witch i can follow to keep my codes as simple as possible, and drive up my productivity?
self-improvement
theory
null
null
null
02/14/2011 18:06:59
not a real question
How to keep programcodes simple === I've a very serious problem in my career as a programmer, and it's that i over complicate things. Are there any guidelines witch i can follow to keep my codes as simple as possible, and drive up my productivity?
1
10,122,190
04/12/2012 10:57:58
979,082
10/04/2011 18:37:21
1
0
How can I parse a spdx file using JiBX in Java
i am trying to parse a spdx file using JiBX in Java. I want to parse only some elements, not all the elements in the file, not in an ordered manner and some of the elements repeat. Some elements that I want to parse are: < creator >, < packageDownloadLocation > or < checksumValue >. The problem I encountered is that after parsing, the object's properties are null. The object itself is not null. Can you please help me? The binding XML file is: <binding> <mapping name="RDF" class="com.transfer.SpdxTransferObject" ordered="false" flexible="true"> <namespace uri="http://www.w3.org/1999/02/22-rdf-syntax-ns#" prefix="rdf" default="all"/> <namespace uri="http://usefulinc.com/ns/doap#" prefix="j.0" /> <namespace uri ="http://www.w3.org/2000/01/rdf-schema#" prefix="rdfs" /> <namespace uri="http://spdx.org/rdf/terms#" prefix="noPrefix"/> <value name="creator" field="mCreator" get-method="getCreator" set-method="setCreator" default="none"/> </mapping> </binding> The SpdxTransferObject is a simple Java bean with setters and getters: public class SpdxTO implements Serializable { /** Default serial version ID */ private static final long serialVersionUID = 1L; private String mCreator; private String mPackageDownloadLocation; private String mChecksumValue>; /* getters and setters */ ...... } The Java code is: public class ParseSpdxFile { /** Our logger */ private static Log sLog = LoggerFactory.create(); public static SpdxTransferObject parseFromFile(final File pFile) throws ValidationException { sLog.debug("Parsing the Spdx file"); SpdxTO data = null; JiBXFileHandler handler; try { handler = new JiBXFileHandler(BindingDirectory.getFactory(SpdxTransferObject.class)); data = (SpdxTransferObject) handler.loadFromXML(pFile); } catch (JiBXException e) { throw new ValidationException(e); } catch (Exception e) { throw new ValidationException(e); } return data; } } public class JiBXFileHandler { private final IBindingFactory mBfact; public JiBXFileHandler(final IBindingFactory pBfact) { mBfact = pBfact; } public Object loadFromXML(final File pFile) throws Exception { FileInputStream in = null; try { IUnmarshallingContext uctx = mBfact.createUnmarshallingContext(); in = new FileInputStream(pFile); return uctx.unmarshalDocument(in, null); } finally { IOUtils.closeQuietly(in); } } } The spdx file is the following: <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:j.0="http://usefulinc.com/ns/doap#" xmlns="http://spdx.org/rdf/terms#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> <SpdxDocument rdf:about="http://www.spdx.org/tools#SPDXANALYSIS"> <reviewed> <Review> <rdfs:comment>This is just an example.</rdfs:comment> <reviewDate>2010-02-10T00:00:00Z</reviewDate> <reviewer>Person: Joe Reviewer</reviewer> </Review> </reviewed> <hasExtractedLicensingInfo> <ExtractedLicensingInfo rdf:nodeID="A0"> <licenseText>license text</licenseText> <licenseId>LicenseRef-3</licenseId> </ExtractedLicensingInfo> </hasExtractedLicensingInfo> <specVersion>SPDX-0.8</specVersion> <describesPackage> <Package rdf:about="http://www.spdx.org/tools#SPDXANALYSIS?package"> <licenseDeclared> <ConjunctiveLicenseSet> <member> <License rdf:about="http://spdx.org/licenses/MPL-1.1"> <licenseId>MPL-1.1</licenseId> </License> </member> <member rdf:nodeID="A0"/> <member> <ExtractedLicensingInfo rdf:nodeID="A1"> <licenseText>License text 2</licenseText> <licenseId>LicenseRef-2</licenseId> </ExtractedLicensingInfo> </member> <member> <ExtractedLicensingInfo rdf:nodeID="A2"> <licenseText>license text 3</licenseText> <licenseId>LicenseRef-4</licenseId> </ExtractedLicensingInfo> </member> <member> <ExtractedLicensingInfo rdf:nodeID="A3"> <licenseText>licence text 4</licenseText> <licenseId>LicenseRef-1</licenseId> </ExtractedLicensingInfo> </member> <member> <License rdf:about="http://spdx.org/licenses/Apache-2"> <licenseId>Apache-2</licenseId> </License> </member> </ConjunctiveLicenseSet> </licenseDeclared> <packageDownloadLocation>http://www.spdx.org/tools</packageDownloadLocation> <hasFile> <File> <copyrightText>Copyright 2010, 2011</copyrightText> <licenseComments></licenseComments> <licenseInfoInFile rdf:resource="http://spdx.org/licenses/Apache-2"/> <licenseConcluded rdf:resource="http://spdx.org/licenses/Apache-2"/> <fileType>SOURCE</fileType> <checksum> <Checksum> <checksumValue>2fd4e1c67a2d28fced849ee1bb76e7391b93eb12</checksumValue> <algorithm>SHA1</algorithm> </Checksum> </checksum> <fileName>src/org/spdx/parser/Project.java</fileName> </File> </hasFile> <licenseInfoFromFiles rdf:nodeID="A3"/> <checksum> <Checksum> <checksumValue>2fd4e1c67a2d28fced849ee1bb76e7391b93eb12</checksumValue> <algorithm>SHA1</algorithm> </Checksum> </checksum> <sourceInfo>Version 1.0 of the SPDX Translator application</sourceInfo> <packageVerificationCode> <PackageVerificationCode> <packageVerificationCodeValue>4e3211c67a2d28fced849ee1bb76e7391b93feba</packageVerificationCodeValue> <packageVerificationCodeExcludedFile>SpdxTranslatorSpdx.txt</packageVerificationCodeExcludedFile> <packageVerificationCodeExcludedFile>SpdxTranslatorSpdx.rdf</packageVerificationCodeExcludedFile> </PackageVerificationCode> </packageVerificationCode> <packageFileName>spdxtranslator-1.0.zip</packageFileName> <description>This utility..</description> <licenseInfoFromFiles rdf:nodeID="A0"/> <hasFile> <File> <artifactOf> <j.0:Project> <j.0:homepage>http://www.openjena.org/</j.0:homepage> <j.0:name>Jena</j.0:name> </j.0:Project> </artifactOf> <copyrightText>(c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 jena</copyrightText> <licenseComments></licenseComments> <licenseInfoInFile rdf:nodeID="A3"/> <licenseConcluded rdf:nodeID="A3"/> <fileType>ARCHIVE</fileType> <checksum> <Checksum> <checksumValue>76e739c67a2d28fced849ee1bb76e7391b93eb12</checksumValue> <algorithm>SHA1</algorithm> </Checksum> </checksum> <fileName>Jenna-2.6.3/jena-2.6.3-sources.jar</fileName> </File> </hasFile> <name>SPDX Translator</name> <licenseInfoFromFiles rdf:nodeID="A1"/> <licenseInfoFromFiles rdf:nodeID="A2"/> <hasFile> <File> <artifactOf> <j.0:Project rdf:about="http://svn.apache.org/repos/asf/commons/proper/lang/trunk/doap_lang.rdf"> <j.0:homepage>http://commons.apache.org/lang/</j.0:homepage> <j.0:name>Apache Commons Lang</j.0:name> </j.0:Project> </artifactOf> <copyrightText>Copyright 2001-2007</copyrightText> <licenseComments></licenseComments> <licenseInfoInFile rdf:resource="http://spdx.org/licenses/Apache-2"/> <licenseConcluded rdf:resource="http://spdx.org/licenses/Apache-2"/> <fileType>ARCHIVE</fileType> <checksum> <Checksum> <checksumValue>76e739c67a2d28fced849ee1bb76e7391b93eb12</checksumValue> <algorithm>SHA1</algorithm> </Checksum> </checksum> <fileName>lib/commons-lang-2.3.zip</fileName> </File> </hasFile> <copyrightText> Copyright 2010, 2011 Source </copyrightText> <licenseComments>The declared license</licenseComments> <licenseInfoFromFiles> <License rdf:about="http://spdx.org/licenses/Apache-1"> <licenseId>Apache-1</licenseId> </License> </licenseInfoFromFiles> <summary>SPDX Translator utility</summary> <licenseInfoFromFiles rdf:resource="http://spdx.org/licenses/MPL-1.1"/> <licenseInfoFromFiles rdf:resource="http://spdx.org/licenses/Apache-2"/> <licenseConcluded> <ConjunctiveLicenseSet> <member rdf:resource="http://spdx.org/licenses/MPL-1.1"/> <member rdf:nodeID="A1"/> <member rdf:nodeID="A3"/> <member rdf:nodeID="A2"/> <member rdf:resource="http://spdx.org/licenses/Apache-2"/> <member rdf:nodeID="A0"/> <member rdf:resource="http://spdx.org/licenses/Apache-1"/> </ConjunctiveLicenseSet> </licenseConcluded> </Package> </describesPackage> <hasExtractedLicensingInfo rdf:nodeID="A1"/> <hasExtractedLicensingInfo rdf:nodeID="A3"/> <creationInfo> <CreationInfo> <created>2010-02-03T00:00:00Z</created> <rdfs:comment>This is an example of an SPDX spreadsheet format</rdfs:comment> <creator>Person: Steven O'Neall</creator> <creator>Company: Source Code Company</creator> <creator>Tool: SourceCode-V1.2</creator> </CreationInfo> </creationInfo> <hasExtractedLicensingInfo rdf:nodeID="A2"/> <reviewed> <Review> <rdfs:comment>Another example reviewer.</rdfs:comment> <reviewDate>2011-03-13T00:00:00Z</reviewDate> <reviewer>Person: John Reviewer</reviewer> </Review> </reviewed> </SpdxDocument> </rdf:RDF>
java
parsing
jibx
null
null
null
open
How can I parse a spdx file using JiBX in Java === i am trying to parse a spdx file using JiBX in Java. I want to parse only some elements, not all the elements in the file, not in an ordered manner and some of the elements repeat. Some elements that I want to parse are: < creator >, < packageDownloadLocation > or < checksumValue >. The problem I encountered is that after parsing, the object's properties are null. The object itself is not null. Can you please help me? The binding XML file is: <binding> <mapping name="RDF" class="com.transfer.SpdxTransferObject" ordered="false" flexible="true"> <namespace uri="http://www.w3.org/1999/02/22-rdf-syntax-ns#" prefix="rdf" default="all"/> <namespace uri="http://usefulinc.com/ns/doap#" prefix="j.0" /> <namespace uri ="http://www.w3.org/2000/01/rdf-schema#" prefix="rdfs" /> <namespace uri="http://spdx.org/rdf/terms#" prefix="noPrefix"/> <value name="creator" field="mCreator" get-method="getCreator" set-method="setCreator" default="none"/> </mapping> </binding> The SpdxTransferObject is a simple Java bean with setters and getters: public class SpdxTO implements Serializable { /** Default serial version ID */ private static final long serialVersionUID = 1L; private String mCreator; private String mPackageDownloadLocation; private String mChecksumValue>; /* getters and setters */ ...... } The Java code is: public class ParseSpdxFile { /** Our logger */ private static Log sLog = LoggerFactory.create(); public static SpdxTransferObject parseFromFile(final File pFile) throws ValidationException { sLog.debug("Parsing the Spdx file"); SpdxTO data = null; JiBXFileHandler handler; try { handler = new JiBXFileHandler(BindingDirectory.getFactory(SpdxTransferObject.class)); data = (SpdxTransferObject) handler.loadFromXML(pFile); } catch (JiBXException e) { throw new ValidationException(e); } catch (Exception e) { throw new ValidationException(e); } return data; } } public class JiBXFileHandler { private final IBindingFactory mBfact; public JiBXFileHandler(final IBindingFactory pBfact) { mBfact = pBfact; } public Object loadFromXML(final File pFile) throws Exception { FileInputStream in = null; try { IUnmarshallingContext uctx = mBfact.createUnmarshallingContext(); in = new FileInputStream(pFile); return uctx.unmarshalDocument(in, null); } finally { IOUtils.closeQuietly(in); } } } The spdx file is the following: <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:j.0="http://usefulinc.com/ns/doap#" xmlns="http://spdx.org/rdf/terms#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> <SpdxDocument rdf:about="http://www.spdx.org/tools#SPDXANALYSIS"> <reviewed> <Review> <rdfs:comment>This is just an example.</rdfs:comment> <reviewDate>2010-02-10T00:00:00Z</reviewDate> <reviewer>Person: Joe Reviewer</reviewer> </Review> </reviewed> <hasExtractedLicensingInfo> <ExtractedLicensingInfo rdf:nodeID="A0"> <licenseText>license text</licenseText> <licenseId>LicenseRef-3</licenseId> </ExtractedLicensingInfo> </hasExtractedLicensingInfo> <specVersion>SPDX-0.8</specVersion> <describesPackage> <Package rdf:about="http://www.spdx.org/tools#SPDXANALYSIS?package"> <licenseDeclared> <ConjunctiveLicenseSet> <member> <License rdf:about="http://spdx.org/licenses/MPL-1.1"> <licenseId>MPL-1.1</licenseId> </License> </member> <member rdf:nodeID="A0"/> <member> <ExtractedLicensingInfo rdf:nodeID="A1"> <licenseText>License text 2</licenseText> <licenseId>LicenseRef-2</licenseId> </ExtractedLicensingInfo> </member> <member> <ExtractedLicensingInfo rdf:nodeID="A2"> <licenseText>license text 3</licenseText> <licenseId>LicenseRef-4</licenseId> </ExtractedLicensingInfo> </member> <member> <ExtractedLicensingInfo rdf:nodeID="A3"> <licenseText>licence text 4</licenseText> <licenseId>LicenseRef-1</licenseId> </ExtractedLicensingInfo> </member> <member> <License rdf:about="http://spdx.org/licenses/Apache-2"> <licenseId>Apache-2</licenseId> </License> </member> </ConjunctiveLicenseSet> </licenseDeclared> <packageDownloadLocation>http://www.spdx.org/tools</packageDownloadLocation> <hasFile> <File> <copyrightText>Copyright 2010, 2011</copyrightText> <licenseComments></licenseComments> <licenseInfoInFile rdf:resource="http://spdx.org/licenses/Apache-2"/> <licenseConcluded rdf:resource="http://spdx.org/licenses/Apache-2"/> <fileType>SOURCE</fileType> <checksum> <Checksum> <checksumValue>2fd4e1c67a2d28fced849ee1bb76e7391b93eb12</checksumValue> <algorithm>SHA1</algorithm> </Checksum> </checksum> <fileName>src/org/spdx/parser/Project.java</fileName> </File> </hasFile> <licenseInfoFromFiles rdf:nodeID="A3"/> <checksum> <Checksum> <checksumValue>2fd4e1c67a2d28fced849ee1bb76e7391b93eb12</checksumValue> <algorithm>SHA1</algorithm> </Checksum> </checksum> <sourceInfo>Version 1.0 of the SPDX Translator application</sourceInfo> <packageVerificationCode> <PackageVerificationCode> <packageVerificationCodeValue>4e3211c67a2d28fced849ee1bb76e7391b93feba</packageVerificationCodeValue> <packageVerificationCodeExcludedFile>SpdxTranslatorSpdx.txt</packageVerificationCodeExcludedFile> <packageVerificationCodeExcludedFile>SpdxTranslatorSpdx.rdf</packageVerificationCodeExcludedFile> </PackageVerificationCode> </packageVerificationCode> <packageFileName>spdxtranslator-1.0.zip</packageFileName> <description>This utility..</description> <licenseInfoFromFiles rdf:nodeID="A0"/> <hasFile> <File> <artifactOf> <j.0:Project> <j.0:homepage>http://www.openjena.org/</j.0:homepage> <j.0:name>Jena</j.0:name> </j.0:Project> </artifactOf> <copyrightText>(c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 jena</copyrightText> <licenseComments></licenseComments> <licenseInfoInFile rdf:nodeID="A3"/> <licenseConcluded rdf:nodeID="A3"/> <fileType>ARCHIVE</fileType> <checksum> <Checksum> <checksumValue>76e739c67a2d28fced849ee1bb76e7391b93eb12</checksumValue> <algorithm>SHA1</algorithm> </Checksum> </checksum> <fileName>Jenna-2.6.3/jena-2.6.3-sources.jar</fileName> </File> </hasFile> <name>SPDX Translator</name> <licenseInfoFromFiles rdf:nodeID="A1"/> <licenseInfoFromFiles rdf:nodeID="A2"/> <hasFile> <File> <artifactOf> <j.0:Project rdf:about="http://svn.apache.org/repos/asf/commons/proper/lang/trunk/doap_lang.rdf"> <j.0:homepage>http://commons.apache.org/lang/</j.0:homepage> <j.0:name>Apache Commons Lang</j.0:name> </j.0:Project> </artifactOf> <copyrightText>Copyright 2001-2007</copyrightText> <licenseComments></licenseComments> <licenseInfoInFile rdf:resource="http://spdx.org/licenses/Apache-2"/> <licenseConcluded rdf:resource="http://spdx.org/licenses/Apache-2"/> <fileType>ARCHIVE</fileType> <checksum> <Checksum> <checksumValue>76e739c67a2d28fced849ee1bb76e7391b93eb12</checksumValue> <algorithm>SHA1</algorithm> </Checksum> </checksum> <fileName>lib/commons-lang-2.3.zip</fileName> </File> </hasFile> <copyrightText> Copyright 2010, 2011 Source </copyrightText> <licenseComments>The declared license</licenseComments> <licenseInfoFromFiles> <License rdf:about="http://spdx.org/licenses/Apache-1"> <licenseId>Apache-1</licenseId> </License> </licenseInfoFromFiles> <summary>SPDX Translator utility</summary> <licenseInfoFromFiles rdf:resource="http://spdx.org/licenses/MPL-1.1"/> <licenseInfoFromFiles rdf:resource="http://spdx.org/licenses/Apache-2"/> <licenseConcluded> <ConjunctiveLicenseSet> <member rdf:resource="http://spdx.org/licenses/MPL-1.1"/> <member rdf:nodeID="A1"/> <member rdf:nodeID="A3"/> <member rdf:nodeID="A2"/> <member rdf:resource="http://spdx.org/licenses/Apache-2"/> <member rdf:nodeID="A0"/> <member rdf:resource="http://spdx.org/licenses/Apache-1"/> </ConjunctiveLicenseSet> </licenseConcluded> </Package> </describesPackage> <hasExtractedLicensingInfo rdf:nodeID="A1"/> <hasExtractedLicensingInfo rdf:nodeID="A3"/> <creationInfo> <CreationInfo> <created>2010-02-03T00:00:00Z</created> <rdfs:comment>This is an example of an SPDX spreadsheet format</rdfs:comment> <creator>Person: Steven O'Neall</creator> <creator>Company: Source Code Company</creator> <creator>Tool: SourceCode-V1.2</creator> </CreationInfo> </creationInfo> <hasExtractedLicensingInfo rdf:nodeID="A2"/> <reviewed> <Review> <rdfs:comment>Another example reviewer.</rdfs:comment> <reviewDate>2011-03-13T00:00:00Z</reviewDate> <reviewer>Person: John Reviewer</reviewer> </Review> </reviewed> </SpdxDocument> </rdf:RDF>
0
11,299,448
07/02/2012 18:49:22
1,496,871
07/02/2012 18:31:54
1
0
wat's wrong with this code?? http://www.spoj.pl/problems/ARRAYSUB/
#include<stdio.h> #include<stdlib.h> typedef struct node { long int n; struct node *l,*r; }node; typedef node * tree; tree maknod(long int d) { tree t; t=(tree)malloc(sizeof(tree)); t->n=d; t->l=t->r=NULL; return t; } tree ins(tree t,long int d) { if(t==NULL) return maknod(d); else if(t->n > d) t->l=ins(t->l,d); else t->r=ins(t->r,d); return t; } long int findmax(tree t) { if(t->r==NULL) return (t->n); findmax(t->r); } tree del(tree t,long int d) { if(t!=NULL) { if(t->n==d) { if(t->l==NULL && t->r==NULL) return NULL; if(t->l==NULL) return t->r; if(t->r==NULL) return t->l; t->n=findmax(t->l); t->l=del(t->l,t->n); } if(t->n>d) t->l=del(t->l,d); if(t->n<d) t->r=del(t->r,d); } return t; } long int print(tree t) { if(t->r==NULL) return t->n; print(t->r); } int main() { long int num,k,i; tree t=NULL; scanf("%ld ",&num); long int a[num]; for(i=0;i<num;i++) scanf("%ld",&a[i]); scanf("%ld",&k); for(i=0;i<k;i++) { t=ins(t,a[i]); } for(i=0;i<=num-k;i++) { if(i<num-k) { printf("%ld",print(t)); printf(" "); } else printf("%ld",print(t)); t=del(t,a[i]); ins(t,a[i+k]); } return 0; } >>http://ideone.com/ZA3Xb >> in spoj its running for five test cases and in sixth one its comin as segmentation fault.. >> given num is no of elements in array then a[] contains num elements.. k is the size of sub array.. we have to print max element in each sub array of size k in a[].
c
null
null
null
null
07/04/2012 01:08:16
not constructive
wat's wrong with this code?? http://www.spoj.pl/problems/ARRAYSUB/ === #include<stdio.h> #include<stdlib.h> typedef struct node { long int n; struct node *l,*r; }node; typedef node * tree; tree maknod(long int d) { tree t; t=(tree)malloc(sizeof(tree)); t->n=d; t->l=t->r=NULL; return t; } tree ins(tree t,long int d) { if(t==NULL) return maknod(d); else if(t->n > d) t->l=ins(t->l,d); else t->r=ins(t->r,d); return t; } long int findmax(tree t) { if(t->r==NULL) return (t->n); findmax(t->r); } tree del(tree t,long int d) { if(t!=NULL) { if(t->n==d) { if(t->l==NULL && t->r==NULL) return NULL; if(t->l==NULL) return t->r; if(t->r==NULL) return t->l; t->n=findmax(t->l); t->l=del(t->l,t->n); } if(t->n>d) t->l=del(t->l,d); if(t->n<d) t->r=del(t->r,d); } return t; } long int print(tree t) { if(t->r==NULL) return t->n; print(t->r); } int main() { long int num,k,i; tree t=NULL; scanf("%ld ",&num); long int a[num]; for(i=0;i<num;i++) scanf("%ld",&a[i]); scanf("%ld",&k); for(i=0;i<k;i++) { t=ins(t,a[i]); } for(i=0;i<=num-k;i++) { if(i<num-k) { printf("%ld",print(t)); printf(" "); } else printf("%ld",print(t)); t=del(t,a[i]); ins(t,a[i+k]); } return 0; } >>http://ideone.com/ZA3Xb >> in spoj its running for five test cases and in sixth one its comin as segmentation fault.. >> given num is no of elements in array then a[] contains num elements.. k is the size of sub array.. we have to print max element in each sub array of size k in a[].
4
8,783,295
01/09/2012 02:22:54
433,073
08/27/2010 15:21:52
48
1
Does calling dispatch_sync(dispatch_get_global_queue()) on main thread cause app to "hang"?
// Method called when a button is clicked - (void)handleClickEvent { dispatch_sync(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ [self backgroundProcessing]; }); // Some code to update the UI of the view .... [self updateUI]; .... } 1) handleClickEvent is called on the main thread when a button on the view is pressed. 2) I used dispatch_sync() because the following code that updates the UI of the view cannot be done until a variable in the backgroundProcessing method is calculated. 3) I used dispatch_get_global_queue in order to get the backgroundProcessing off the main thread. (following the rule: generally put background processing off main thread and generally put code that affect the UI on the main thread). My question is: Does the backgroundProcessing method "hang" the main thread until it is complete since I am using dispatch_sync?
objective-c
ios
xcode
objective-c-blocks
grand-central-dispatch
null
open
Does calling dispatch_sync(dispatch_get_global_queue()) on main thread cause app to "hang"? === // Method called when a button is clicked - (void)handleClickEvent { dispatch_sync(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ [self backgroundProcessing]; }); // Some code to update the UI of the view .... [self updateUI]; .... } 1) handleClickEvent is called on the main thread when a button on the view is pressed. 2) I used dispatch_sync() because the following code that updates the UI of the view cannot be done until a variable in the backgroundProcessing method is calculated. 3) I used dispatch_get_global_queue in order to get the backgroundProcessing off the main thread. (following the rule: generally put background processing off main thread and generally put code that affect the UI on the main thread). My question is: Does the backgroundProcessing method "hang" the main thread until it is complete since I am using dispatch_sync?
0
5,155,233
03/01/2011 13:38:51
580,950
01/19/2011 05:26:29
30
0
SAP Beginner Questions? Can anyone help ?
I am thinking of making my career into SAP, please help.My questions are listed below<br/> 1) What is the Cost of SAP<br/> 2) Do they have online documentation to learn<br/> 3) Which module should i select i am a network administrator<br/> 4) What is the normal $$ per hour rates for administrator ?<br/> 5) Where should i start from <br/> 6) How much time it takes to completely learn the module ?<br/> 7) Is there any online certification for it ?<br/>
sap
null
null
null
null
03/01/2011 13:51:22
off topic
SAP Beginner Questions? Can anyone help ? === I am thinking of making my career into SAP, please help.My questions are listed below<br/> 1) What is the Cost of SAP<br/> 2) Do they have online documentation to learn<br/> 3) Which module should i select i am a network administrator<br/> 4) What is the normal $$ per hour rates for administrator ?<br/> 5) Where should i start from <br/> 6) How much time it takes to completely learn the module ?<br/> 7) Is there any online certification for it ?<br/>
2
10,208,844
04/18/2012 11:55:43
604,237
02/05/2011 09:18:35
79
3
Why does the code hang when calling cancelInquiry in Java to cancel, a Bluetooth inquiry, on some Nokia phones?
i have a problem on Nokia devices having S40 (but not on S60). the problem is this: when you call the discoveryAgent's cancelInquiry method from within a synchronized block, it hangs. it is actually supposed to call back inquiryCompleted. the code simply freezes- never enters the inquiryCompleted method. if the same thing is done but not from within a synchronized block - everything works. The problem is that i need the block to be synchronized so that everything in it is executed atomically in a multi-threaded app. This is what my DiscoveryListener looks like: public class DeviceDiscoverer implements DiscoveryListener { private Object thisCannotBeInterruptedByOtherBlocksLikeIt=new Object(); private boolean stiiInCycle; private DiscoveryAgent discoveryAgent; public boolean cancel() { //called from some controller in mid discovery //synchronized(thisCannotBeInterruptedByOtherBlocksLikeIt) //problem when this is uncommented { if (stillInCycle) { //<some logic> discoveryAgent.cancelInquiry(this); //<more logic> } } } public void inquiryCompleted(int inquiryStatus) { //this is a callback in response to cancel or normal ending Beeper.beep(); //this makes the phone make a sound } // <some irrelevant methods here. some have synchronized blocks like the one above> } when you run the above code, on both s40 and s60, with the synchronized statement commented out, and call the cancel() method, the inquiryCompleted method is immediately called and you hear the beep. BUT, if you uncomment the synchronized statement, you hear the beep on S60, but on S40 (at least on 5th edition fp1), the inquiryCompleted is never called! (when i placed the beep stmt just before calling the discoveryAgent's cancelInquiry it beeped. when i placed it after that call, it didn't get there. that's because the call does not return until it calls inquiryCompleted and that call doesn't happen) what is the problem? if it's a bug in the impl'n of the cancelInquiry of S40, how do i get around it? i have to synchronize because things are done in parallel (for example my code may start an inquiry and then, may cancel it. at the time that it is cancelled the startInquiry may be running, deviceDiscovered may be running, inquiryCompleted may be running, and of course in parallel with any of these, the incoming cancelInquiry may be running. i tried to separate the inquiryCompleted into another listener instance, in other words, instead of calling discoveryAgent.cancelInquiry(this) i called discoveryAgent.cancelInquiry(anotherInstance) hoping that the inquiryCompleted in the 'anotherInstance' would be called but no, it hangs that way as well. any suggestions? thanks in advance
java-me
bluetooth
nokia-s40
synchronized-block
null
null
open
Why does the code hang when calling cancelInquiry in Java to cancel, a Bluetooth inquiry, on some Nokia phones? === i have a problem on Nokia devices having S40 (but not on S60). the problem is this: when you call the discoveryAgent's cancelInquiry method from within a synchronized block, it hangs. it is actually supposed to call back inquiryCompleted. the code simply freezes- never enters the inquiryCompleted method. if the same thing is done but not from within a synchronized block - everything works. The problem is that i need the block to be synchronized so that everything in it is executed atomically in a multi-threaded app. This is what my DiscoveryListener looks like: public class DeviceDiscoverer implements DiscoveryListener { private Object thisCannotBeInterruptedByOtherBlocksLikeIt=new Object(); private boolean stiiInCycle; private DiscoveryAgent discoveryAgent; public boolean cancel() { //called from some controller in mid discovery //synchronized(thisCannotBeInterruptedByOtherBlocksLikeIt) //problem when this is uncommented { if (stillInCycle) { //<some logic> discoveryAgent.cancelInquiry(this); //<more logic> } } } public void inquiryCompleted(int inquiryStatus) { //this is a callback in response to cancel or normal ending Beeper.beep(); //this makes the phone make a sound } // <some irrelevant methods here. some have synchronized blocks like the one above> } when you run the above code, on both s40 and s60, with the synchronized statement commented out, and call the cancel() method, the inquiryCompleted method is immediately called and you hear the beep. BUT, if you uncomment the synchronized statement, you hear the beep on S60, but on S40 (at least on 5th edition fp1), the inquiryCompleted is never called! (when i placed the beep stmt just before calling the discoveryAgent's cancelInquiry it beeped. when i placed it after that call, it didn't get there. that's because the call does not return until it calls inquiryCompleted and that call doesn't happen) what is the problem? if it's a bug in the impl'n of the cancelInquiry of S40, how do i get around it? i have to synchronize because things are done in parallel (for example my code may start an inquiry and then, may cancel it. at the time that it is cancelled the startInquiry may be running, deviceDiscovered may be running, inquiryCompleted may be running, and of course in parallel with any of these, the incoming cancelInquiry may be running. i tried to separate the inquiryCompleted into another listener instance, in other words, instead of calling discoveryAgent.cancelInquiry(this) i called discoveryAgent.cancelInquiry(anotherInstance) hoping that the inquiryCompleted in the 'anotherInstance' would be called but no, it hangs that way as well. any suggestions? thanks in advance
0
11,061,216
06/16/2012 05:56:13
1,323,626
04/10/2012 09:11:52
23
0
how do I put dictionary key into an array
Im not quite sure what I am doing wrong here, I have folloed the tutorials to the letter. here is my problem, I have a dictionary called dict which is the result of a TWRequest - I know it contains tweets because of my log details. I am now trying to create an Array of the 'text' element of this but my log says that the array s blank??! Here is my code, any help would be greatly appreciated. Thanks NSArray *allTweetText = [dict objectForKey:@"text"]; NSLog(@"WHERE IS THIS: %@", allTweetText); NSString *singleTweet = [allTweetText objectAtIndex:indexPath.row]; NSArray *parsedTweet = [singleTweet componentsSeparatedByString:@":"]; cell.myHeader.text = [parsedTweet objectAtIndex:0]; cell.myDetails.text = [parsedTweet objectAtIndex:1]; cell.myDate.text = [parsedTweet objectAtIndex:2];
arrays
dictionary
twrequest
null
null
06/18/2012 12:44:42
not a real question
how do I put dictionary key into an array === Im not quite sure what I am doing wrong here, I have folloed the tutorials to the letter. here is my problem, I have a dictionary called dict which is the result of a TWRequest - I know it contains tweets because of my log details. I am now trying to create an Array of the 'text' element of this but my log says that the array s blank??! Here is my code, any help would be greatly appreciated. Thanks NSArray *allTweetText = [dict objectForKey:@"text"]; NSLog(@"WHERE IS THIS: %@", allTweetText); NSString *singleTweet = [allTweetText objectAtIndex:indexPath.row]; NSArray *parsedTweet = [singleTweet componentsSeparatedByString:@":"]; cell.myHeader.text = [parsedTweet objectAtIndex:0]; cell.myDetails.text = [parsedTweet objectAtIndex:1]; cell.myDate.text = [parsedTweet objectAtIndex:2];
1
9,360,432
02/20/2012 11:32:52
648,608
03/07/2011 18:00:37
175
4
How do i handle heavy page loads with php
I have a script that generates xml of products on users webstores. Now, this xml needs to be read from the browser into mysql database using php. The issue is that, sometimes the size of the xml is such large in (MegaBytes) that 1. it does not print on the user's site even though it is constructed 2. does not get passed due to its weight and server time outs with the browser. I learned these remedies may help. 1. Increasing the CPU of the machine i use to access and parse the xml 2. Increasing the cache of the the browser I have done all these but still cannot get it effective. Any other solutions out there?
php
xml-parsing
html-parsing
null
null
02/20/2012 22:31:55
not a real question
How do i handle heavy page loads with php === I have a script that generates xml of products on users webstores. Now, this xml needs to be read from the browser into mysql database using php. The issue is that, sometimes the size of the xml is such large in (MegaBytes) that 1. it does not print on the user's site even though it is constructed 2. does not get passed due to its weight and server time outs with the browser. I learned these remedies may help. 1. Increasing the CPU of the machine i use to access and parse the xml 2. Increasing the cache of the the browser I have done all these but still cannot get it effective. Any other solutions out there?
1
9,354,835
02/19/2012 21:54:02
1,084,813
12/07/2011 03:30:41
53
6
How can I automatically toggle hardware graphics acceleration?
My laptop computer has (probably) corrupted graphics card memory and it causes some bizarre errors such as colorful dots appearing all over the screen, cursor jumping up and down and freezing occasionally. I noticed that the problems go away when I turn off HW acceleration in Windows. Whenever I want to play a movie, the picture is blocky unless I reactivate HW acceleration. Doing this manually is annoying and it takes some time so I would like to make a little program to automate the process of disabling or enabling HW acceleration on all displays (equivalent to moving the slider all the way to the left in screen settings). I have no previous experience with programming for Windows so I will appreciate if someone can at least point me in the right direction. I am a cheapskate, buying a new computer is not an option since this one works quite well while I keep HW acceleration disabled.
windows
windows-xp
automation
directx
hardware-acceleration
02/20/2012 06:26:28
not a real question
How can I automatically toggle hardware graphics acceleration? === My laptop computer has (probably) corrupted graphics card memory and it causes some bizarre errors such as colorful dots appearing all over the screen, cursor jumping up and down and freezing occasionally. I noticed that the problems go away when I turn off HW acceleration in Windows. Whenever I want to play a movie, the picture is blocky unless I reactivate HW acceleration. Doing this manually is annoying and it takes some time so I would like to make a little program to automate the process of disabling or enabling HW acceleration on all displays (equivalent to moving the slider all the way to the left in screen settings). I have no previous experience with programming for Windows so I will appreciate if someone can at least point me in the right direction. I am a cheapskate, buying a new computer is not an option since this one works quite well while I keep HW acceleration disabled.
1
10,727,392
05/23/2012 20:32:41
1,084,945
12/07/2011 05:20:07
1,895
63
vim not allowing backspace
File `foo` has text: This| is a line. If I place the cursor at the `|`, hop into `insert` mode, and press <kbd>backspace</kbd>, nothing happens. If I type something, I can delete the things I've typed, but only back to where the insertion began. For example, if I place the cursor at the end of the line, and type `word`, I can delete `word` but can't delete the `.` or anything to the left of it. This is rather annoying. What `vim` setting does this?
vim
null
null
null
null
null
open
vim not allowing backspace === File `foo` has text: This| is a line. If I place the cursor at the `|`, hop into `insert` mode, and press <kbd>backspace</kbd>, nothing happens. If I type something, I can delete the things I've typed, but only back to where the insertion began. For example, if I place the cursor at the end of the line, and type `word`, I can delete `word` but can't delete the `.` or anything to the left of it. This is rather annoying. What `vim` setting does this?
0
7,506,465
09/21/2011 20:50:36
957,836
09/21/2011 20:50:36
1
0
How to install weblogic Portal 10.3
I am migrating my application to new machine, from RH4 to RH5 and on new machine I have WebLogic server 10.3.2 installed. Previously I was using WL Portal 10.2. On new machine the path for application is changed to some other dir. I have created domain by using ./config.sh file, and my adminserver runs fine. I am looking for the information related to what are the steps I should follow to make my application work on new machine. I checked below URLs where I haven't found exact information. >>http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/getting_started/introduction.html#wp1005589 >> download.oracle.com/docs/cd/E13155_01/wlp/docs103/tutorials/setup_dev_env.html >> download.oracle.com/docs/cd/E12840_01/common/docs103/install/index.html
weblogic-10.x
null
null
null
null
09/22/2011 12:08:08
off topic
How to install weblogic Portal 10.3 === I am migrating my application to new machine, from RH4 to RH5 and on new machine I have WebLogic server 10.3.2 installed. Previously I was using WL Portal 10.2. On new machine the path for application is changed to some other dir. I have created domain by using ./config.sh file, and my adminserver runs fine. I am looking for the information related to what are the steps I should follow to make my application work on new machine. I checked below URLs where I haven't found exact information. >>http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/getting_started/introduction.html#wp1005589 >> download.oracle.com/docs/cd/E13155_01/wlp/docs103/tutorials/setup_dev_env.html >> download.oracle.com/docs/cd/E12840_01/common/docs103/install/index.html
2
7,115,386
08/18/2011 23:31:55
901,538
08/18/2011 23:07:37
1
0
Handling UserInterrupt exception in Haskell
I'm implementing a REPL for a Scheme interpreter in Haskell and I'd like to handle some async events like UserInterrupt, StackOverflow, HeapOverflow, etc... Basically, I'd like to stop the current computation when UserInterrupt occurs and print a suitable message when StackOverflow and HeapOverflow occur, etc. I implemented this as follows: repl evaluator = forever $ (do putStr ">>> " >> hFlush stdout out <- getLine >>= evaluator if null out then return () else putStrLn out) `catch` onUserInterrupt onUserInterrupt UserInterrupt = putStrLn "\nUserInterruption" onUserInterrupt e = throw e main = do interpreter <- getMyLispInterpreter handle onAbort (repl $ interpreter "stdin") putStrLn "Exiting..." onAbort e = do let x = show (e :: SomeException) putStrLn $ "\nAborted: " ++ x It works as expected with one exception. If I start the interpreter and press Ctrl-Z + Enter, I get: >>> ^Z Aborted: <stdin>: hGetLine: end of file Exiting... That's correct. But if I start the interpreter and press Ctrl-C followed by Ctrl-Z + Enter I get: >>> UserInterruption >>> ^Z And it hangs and I can't use the interpreter anymore. However, if I press Ctrl-C again, the REPL unblocks. I searched a lot and I can't figure out the reason of it. Can anyone explain me? Many thanks!
exception
haskell
exception-handling
repl
interruption
null
open
Handling UserInterrupt exception in Haskell === I'm implementing a REPL for a Scheme interpreter in Haskell and I'd like to handle some async events like UserInterrupt, StackOverflow, HeapOverflow, etc... Basically, I'd like to stop the current computation when UserInterrupt occurs and print a suitable message when StackOverflow and HeapOverflow occur, etc. I implemented this as follows: repl evaluator = forever $ (do putStr ">>> " >> hFlush stdout out <- getLine >>= evaluator if null out then return () else putStrLn out) `catch` onUserInterrupt onUserInterrupt UserInterrupt = putStrLn "\nUserInterruption" onUserInterrupt e = throw e main = do interpreter <- getMyLispInterpreter handle onAbort (repl $ interpreter "stdin") putStrLn "Exiting..." onAbort e = do let x = show (e :: SomeException) putStrLn $ "\nAborted: " ++ x It works as expected with one exception. If I start the interpreter and press Ctrl-Z + Enter, I get: >>> ^Z Aborted: <stdin>: hGetLine: end of file Exiting... That's correct. But if I start the interpreter and press Ctrl-C followed by Ctrl-Z + Enter I get: >>> UserInterruption >>> ^Z And it hangs and I can't use the interpreter anymore. However, if I press Ctrl-C again, the REPL unblocks. I searched a lot and I can't figure out the reason of it. Can anyone explain me? Many thanks!
0
8,153,373
11/16/2011 14:37:08
983,917
10/07/2011 11:49:17
1
0
Multithreading code
i want to make a program in which different functions run parallelly by multithreading. I havnt done it before because i have just done console application programing not win32 programming. So will you guys tell me an easy way to achieve mutilthreading.
c++
multithreading
null
null
null
11/16/2011 14:53:07
not a real question
Multithreading code === i want to make a program in which different functions run parallelly by multithreading. I havnt done it before because i have just done console application programing not win32 programming. So will you guys tell me an easy way to achieve mutilthreading.
1
11,006,210
06/12/2012 23:20:20
790,581
06/07/2011 09:56:47
604
13
Facing an issue with Endlessadapter in android
I have a problem in implementing the Endlessadapter in my project. I have integrated the same in the project working as, it is downloading data in bunch (10 data) continuously in the background instead as it should download data only when I scrolled the list till the last. Due to the above problem sometimes my app returns OutOfMemoryException, which is not acceptable. **My Code for EndlessAdapter implementation:** **setAdapter in listView:** public void setValuesInCategoryChild(String url,final String filter, final String from, final String to) { if(isOnline()) { final ProgressDialog dialog = ProgressDialog.show( ResearchList.this, "Research List ", "Please wait... ", true); final Handler handler = new Handler() { public void handleMessage(Message msg) { // System.out.println("The id after Save:"+id.get(0).toString()); // catagory.addAll(keyword_vector1); linear_Category_Child.setVisibility(View.GONE); linear_Category_Child_Child.setVisibility(View.VISIBLE); //tv_Child_Header.setText("Volvo"); tv_CategoryChildHeader.setText(from); setHeaderImage(tv_CategoryChildHeader.getText().toString()); System.out.println("The size of Cat Display names:"+coll.getDisplayNames().size()); System.out.println("The size of Cat Images:"+coll.getImages().size()); System.out.println("The size of Cat price:"+coll.getPrice().size()); System.out.println("The size of Cat Year:"+coll.getYears().size()); System.out.println("The size of Cat Rating:"+coll.getRating().size()); System.out.println("The size of Cat Mpg:"+coll.getMpg().size()); LIST_SIZE = coll.getDisplayNames().size(); for (int i=0; i<=BATCH_SIZE; i++){ // countriesSub.add(COUNTRIES[i]); countriesSubCat.add(coll.getDisplayNames().get(i)); imagesSubCat.add(coll.getImages().get(i)); YearSubCat1.add(coll.getYears().get(i)); YearSubCat2.add(coll.getYears().get(i+1)); mpgSubCat1.add(coll.getMpg().get(i)); mpgSubCat2.add(coll.getMpg().get(i+1)); priceSubCat1.add(coll.getPrice().get(i)); priceSubCat2.add(coll.getPrice().get(i+1)); ratingSubCat1.add(coll.getRating().get(i)); ratingSubCat2.add(coll.getRating().get(i+1)); } setLastOffset(BATCH_SIZE); //Adapter for MPG Search demoAdapterCat = new DemoAdapterCat(); lvCategory.setAdapter(demoAdapterCat); Utility util = new Utility(); util.setListViewHeightBasedOnChildren(lvCategory); dialog.dismiss(); } }; final Thread checkUpdate = new Thread() { public void run() { try { String sortEncode = URLEncoder.encode("mpg"); String filterEncode = URLEncoder.encode(filter); String clientEncode = URLEncoder.encode("10030812"); String fromEncode = URLEncoder.encode(from); String toEncode = URLEncoder.encode(to); String catUrl = "/v1/vehicles/get-make-models.json?sort="+sortEncode+"&filter="+filterEncode+"&client-id="+clientEncode+"&from="+fromEncode; genSig = new GetSignature(catUrl, "acura"); try { signature = genSig.getUrlFromString(); } catch (InvalidKeyException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (NoSuchAlgorithmException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } // jsonString = // getJsonSring("http://api.highgearmedia.com/v1/vehicles/get-models.json?make=acura&client-id=10030812&signature=LWQbdAlJVxlXZ1VO2mfqAA=="); //String signatureEncode = URLEncoder.encode(signature); String urlEncode = URLEncoder.encode(catUrl+"&signature="+signature); jsonString = getJsonSring("http://apibeta.highgearmedia.com"+catUrl+"&signature="+signature); System.out.println("The json category:===>"+jsonString); } catch (ClientProtocolException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (URISyntaxException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } JsonParse json = new JsonParse(jsonString); json.parseCat(); handler.sendEmptyMessage(0); } }; checkUpdate.start(); }else { AlertDialog.Builder builder = new Builder(ResearchList.this); builder.setTitle("Attention!"); builder.setMessage("Network Connection unavailable."); builder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub } }); builder.create().show(); } } **DemoAdapterCat Class:** class DemoAdapterCat extends EndlessAdapter { private RotateAnimation rotate=null; ArrayList<String> tempListNamesCat = new ArrayList<String>(); ArrayList<String> tempListImagesCat = new ArrayList<String>(); ArrayList<String> tempListYearCat1 = new ArrayList<String>(); ArrayList<String> tempListYearCat2 = new ArrayList<String>(); ArrayList<String> tempListmpgCat1 = new ArrayList<String>(); ArrayList<String> tempListmpgCat2 = new ArrayList<String>(); ArrayList<String> tempListpriceCat1 = new ArrayList<String>(); ArrayList<String> tempListpriceCat2 = new ArrayList<String>(); ArrayList<String> tempListRatingCat1 = new ArrayList<String>(); ArrayList<String> tempListRatingCat2 = new ArrayList<String>(); DemoAdapterCat() { super(new CategoryListLazyAdapter(ResearchList.this, countriesSubCat, imagesSubCat, YearSubCat1,YearSubCat2, mpgSubCat1,mpgSubCat2, priceSubCat1,priceSubCat2, ratingSubCat1, ratingSubCat2)); Utility util = new Utility(); util.setListViewHeightBasedOnChildren(lvCategory); rotate=new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); rotate.setDuration(600); rotate.setRepeatMode(Animation.RESTART); rotate.setRepeatCount(Animation.INFINITE); } @Override protected View getPendingView(ViewGroup parent) { row=getLayoutInflater().inflate(R.layout.categorylist, null); child=row.findViewById(R.id.tv_CategoryItem_Name); child.setVisibility(View.GONE); child = row.findViewById(R.id.tv_CategoryItem_MPG1); child.setVisibility(View.GONE); child = row.findViewById(R.id.tv_CategoryItem_MPG2); child.setVisibility(View.GONE); child = row.findViewById(R.id.tv_CategoryItem_Price1); child.setVisibility(View.GONE); child = row.findViewById(R.id.tv_CategoryItem_Price2); child.setVisibility(View.GONE); child = row.findViewById(R.id.tv_CategoryItem_Rating1); child.setVisibility(View.GONE); child = row.findViewById(R.id.tv_CategoryItem_Rating2); child.setVisibility(View.GONE); child = row.findViewById(R.id.tv_CategoryItem_Year1); child.setVisibility(View.GONE); child = row.findViewById(R.id.tv_CategoryItem_Year2); child.setVisibility(View.GONE); /*child = row.findViewById(R.id.img_CategoryItem); child.setVisibility(View.GONE); child = row.findViewById(R.id.img_CategoryItem_Arrow); child.setVisibility(View.GONE);*/ /*child = row.findViewById(R.id.linear_main_MPG); child.setVisibility(View.GONE);*/ child=row.findViewById(R.id.throbber); child.setVisibility(View.VISIBLE); child.startAnimation(rotate); return(row); } @Override protected boolean cacheInBackground() { SystemClock.sleep(10000); tempListNamesCat.clear(); tempListImagesCat.clear(); tempListmpgCat1.clear(); tempListmpgCat2.clear(); tempListpriceCat1.clear(); tempListpriceCat2.clear(); tempListYearCat1.clear(); tempListYearCat2.clear(); tempListRatingCat1.clear(); tempListRatingCat2.clear(); int lastOffset = getLastOffset(); if(lastOffset < LIST_SIZE){ int limit = lastOffset + BATCH_SIZE; for(int i=(lastOffset+1); (i<=limit && i<LIST_SIZE); i++){ tempListNamesCat.add(coll.getDisplayNames().get(i)); tempListImagesCat.add(coll.getImages().get(i)); tempListmpgCat1.add(coll.getMpg().get(i)); tempListmpgCat2.add(coll.getMpg().get(i+1)); tempListpriceCat1.add(coll.getPrice().get(i)); tempListpriceCat2.add(coll.getPrice().get(i+1)); tempListRatingCat1.add(coll.getRating().get(i)); tempListRatingCat2.add(coll.getRating().get(i+1)); tempListYearCat1.add(coll.getYears().get(i)); tempListYearCat2.add(coll.getYears().get(i+1)); } setLastOffset(limit); if(limit<LIST_SIZE){ //return true; return(getWrappedAdapter().getCount()<coll.getDisplayNames().size()); } else { return false; } } else { return false; } } @Override protected void appendCachedData() { @SuppressWarnings("unchecked") //Activity activity = this; //ArrayAdapter<String> arrAdapterNew = (ArrayAdapter<String>)getWrappedAdapter(); CategoryListLazyAdapter arrAdapterNewCategory = (CategoryListLazyAdapter)getWrappedAdapter(); //int listLen = tempList.size(); // int listLen = tempListNames.size(); countriesSubCat.addAll(tempListNamesCat); imagesSubCat.addAll(tempListImagesCat); mpgSubCat1.addAll(tempListmpgCat1); mpgSubCat2.addAll(tempListmpgCat2); priceSubCat1.addAll(tempListpriceCat1); priceSubCat2.addAll(tempListpriceCat2); ratingSubCat1.addAll(tempListRatingCat1); ratingSubCat2.addAll(tempListRatingCat2); YearSubCat1.addAll(tempListYearCat1); YearSubCat2.addAll(tempListYearCat2); arrAdapterNewCategory.notifyDataSetChanged(); Utility util = new Utility(); util.setListViewHeightBasedOnChildren(lvCategory); /* for(int i=0; i<listLen; i++){ // arrAdapterNew.add(tempList.get(i)); }*/ } } **LazyAdapter:** public class CategoryListLazyAdapter extends BaseAdapter { private Activity activity; // private List<BaseInventoryItem> localItems; private LayoutInflater inflater = null; private ImageLoader imageLoader; public static Long id; public static int cat_id; public static String type; CatedoryListCollection catList = CatedoryListCollection.getSingletonObject(); LinearLayout linear_CategoryItem_RatingSelection, linear_CategoryItem_MPGSelection, linear_CategoryItem_PriceSelection; TextView tv_RatingHeader, tv_MPGHeader, tv_PriceHeader; ArrayList<String> displayNames = new ArrayList<String>(); ArrayList<String> images = new ArrayList<String>(); ArrayList<String> year1 = new ArrayList<String>(); ArrayList<String> year2 = new ArrayList<String>(); ArrayList<String> mpg1 = new ArrayList<String>(); ArrayList<String> mpg2 = new ArrayList<String>(); ArrayList<String> price1 = new ArrayList<String>(); ArrayList<String> price2 = new ArrayList<String>(); ArrayList<String> rating1 = new ArrayList<String>(); ArrayList<String> rating2 = new ArrayList<String>(); // Pass in the list of items to adapt public CategoryListLazyAdapter(Activity inputActivity, ArrayList<String> displayNames, ArrayList<String> images, ArrayList<String> year1,ArrayList<String> year2, ArrayList<String> mpg1,ArrayList<String> mpg2, ArrayList<String> price1,ArrayList<String> price2, ArrayList<String> rating1, ArrayList<String> rating2) { activity = inputActivity; // localItems = inputItems; inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE); imageLoader = new ImageLoader(activity.getApplicationContext()); this.displayNames = displayNames; this.images = images; this.year1 = year1; this.year2 = year2; this.mpg1 = mpg1; this.mpg2 = mpg2; this.price1 = price1; this.price2 = price2; this.rating1 = rating1; this.rating2 = rating2; } public int getCount() { return displayNames.size(); } public Object getItem(int position) { return position; } public long getItemId(int position) { return position; } public View getView(int position, View convertView, ViewGroup parent) { View vi = convertView; if (convertView == null) { //vi = inflater.inflate(R.layout.new_category_code, null); vi = inflater.inflate(R.layout.categorylist, null); } // Grab all of the layout elements in which we need ot insert content. /* final LinearLayout layout_AZSelected = (LinearLayout)vi.findViewById(R.id.linear_CategoryItem_RatingSelected); final LinearLayout layout_MPGSelected = (LinearLayout)vi.findViewById(R.id.linear_CategoryItem_MPGSelected); final LinearLayout layout_PriceSelected = (LinearLayout)vi.findViewById(R.id.linear_CategoryItem_PriceSelected);*/ linear_CategoryItem_RatingSelection = (LinearLayout)vi.findViewById(R.id.linear_CategoryItem_RatingSelectionBack); linear_CategoryItem_PriceSelection = (LinearLayout)vi.findViewById(R.id.linear_CategoryItem_PriceSelectionBack); linear_CategoryItem_MPGSelection = (LinearLayout)vi.findViewById(R.id.linear_CategoryItem_MPGSelectionBack); TextView tvDisplayName = (TextView) vi.findViewById(R.id.tv_CategoryItem_Name); TextView tvRating1 = (TextView) vi.findViewById(R.id.tv_CategoryItem_Rating1); TextView tvRating2 = (TextView) vi.findViewById(R.id.tv_CategoryItem_Rating2); TextView tvPrice1 = (TextView) vi.findViewById(R.id.tv_CategoryItem_Price1); TextView tvPrice2 = (TextView) vi.findViewById(R.id.tv_CategoryItem_Price2); TextView tvMPG1 = (TextView) vi.findViewById(R.id.tv_CategoryItem_MPG1); TextView tvMPG2 = (TextView) vi.findViewById(R.id.tv_CategoryItem_MPG2); TextView tvYear1 = (TextView) vi.findViewById(R.id.tv_CategoryItem_Year1); TextView tvYear2 = (TextView) vi.findViewById(R.id.tv_CategoryItem_Year2); tv_RatingHeader = (TextView)vi.findViewById(R.id.tv_CategoryItem_RatingHeader); tv_PriceHeader = (TextView)vi.findViewById(R.id.tv_CategoryItem_PriceHeader); tv_MPGHeader = (TextView)vi.findViewById(R.id.tv_CategoryItem_MPGHeader); ImageView productImage = (ImageView) vi.findViewById(R.id.img_CategoryItem); /* ArrayList<String> arr = catList.getMapRating().get("Toyota Paseo"); System.out.println("The array================================>"+arr.get(0)); System.out.println("The array================================2>"+arr.get(1));*/ /*tvRating1.setText(catList.getMapRating().get(position).get(0)); tvRating2.setText(catList.getMapRating().get(position).get(1)); tvPrice1.setText(catList.getMapPrice().get(position).get(0)); tvPrice2.setText(catList.getMapPrice().get(position).get(1)); tvMPG1.setText(catList.getMapMpg().get(position).get(0)); tvMPG2.setText(catList.getMapMpg().get(position).get(1)); tvYear1.setText(catList.getMapYears().get(position).get(0)); tvYear2.setText(catList.getMapYears().get(position).get(1));*/ tvRating1.setText(rating1.get(position)); tvRating2.setText(rating2.get(position)); tvPrice1.setText(price1.get(position)); tvPrice2.setText(price2.get(position)); tvMPG1.setText(mpg1.get(position)); tvMPG1.setBackgroundDrawable(null); tvMPG1.setGravity(Gravity.CENTER); tvMPG2.setText(mpg2.get(position)); tvYear1.setText(year1.get(position)); tvYear2.setText(year2.get(position)); tvDisplayName.setText(catList.getDisplayNames().get(position)); Iterator myVeryOwnIterator = catList.getMapMpg().keySet().iterator(); /*while(myVeryOwnIterator.hasNext()) { String key=(String)myVeryOwnIterator.next(); ArrayList<String> value=catList.getMapMpg().get(key); //Toast.makeText(this, "Key: "+key+" Value: "+value.get(0)+" and "+value.get(1), Toast.LENGTH_LONG).show(); System.out.println("Key:"+key+" Value:"+value.get(0)+" and "+value.get(1)); }*/ //tvBrandName.setText(brandList.getDisplayNames().get(position)); /*layout_RatingSelected.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub layout_RatingSelected.setBackgroundResource(R.drawable.chart_selected_bg); } });*/ /*layout_PriceSelected.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub layout_PriceSelected.setBackgroundResource(R.drawable.chart_selected_bg); } });*/ imageLoader.displayImage(catList.getImages().get(position), activity, productImage); linear_CategoryItem_MPGSelection.setVisibility(View.VISIBLE); tv_MPGHeader.setGravity(Gravity.CENTER); if(ResearchList.MPG_Clicked) { notifyDataSetChanged(); /*layout_MPGSelected.setBackgroundResource(R.drawable.chart_selected_bg); layout_AZSelected.setBackgroundDrawable(null); layout_PriceSelected.setBackgroundDrawable(null);*/ linear_CategoryItem_MPGSelection.setVisibility(View.VISIBLE); linear_CategoryItem_PriceSelection.setVisibility(View.INVISIBLE); linear_CategoryItem_RatingSelection.setVisibility(View.INVISIBLE); tvMPG1.setBackgroundDrawable(null); tvPrice1.setBackgroundColor(Color.parseColor("#D8D8D8")); tvRating1.setBackgroundColor(Color.parseColor("#D8D8D8")); tvMPG1.setGravity(Gravity.CENTER); tvMPG2.setGravity(Gravity.CENTER); tv_MPGHeader.setGravity(Gravity.CENTER); tvPrice1.setGravity(Gravity.CENTER_VERTICAL); tvPrice2.setGravity(Gravity.CENTER_VERTICAL); tv_PriceHeader.setGravity(Gravity.CENTER_VERTICAL); tvRating1.setGravity(Gravity.CENTER_VERTICAL); tvRating2.setGravity(Gravity.CENTER_VERTICAL); tv_RatingHeader.setGravity(Gravity.CENTER_VERTICAL); } if(ResearchList.PRICE_Clicked) { notifyDataSetChanged(); /*layout_PriceSelected.setBackgroundResource(R.drawable.chart_selected_bg); layout_MPGSelected.setBackgroundDrawable(null); layout_AZSelected.setBackgroundDrawable(null);*/ linear_CategoryItem_MPGSelection.setVisibility(View.INVISIBLE); linear_CategoryItem_PriceSelection.setVisibility(View.VISIBLE); linear_CategoryItem_RatingSelection.setVisibility(View.INVISIBLE); tvMPG1.setBackgroundColor(Color.parseColor("#D8D8D8")); tvPrice1.setBackgroundDrawable(null); tvRating1.setBackgroundColor(Color.parseColor("#D8D8D8")); tvMPG1.setGravity(Gravity.CENTER_VERTICAL); tvMPG2.setGravity(Gravity.CENTER_VERTICAL); tv_MPGHeader.setGravity(Gravity.CENTER_VERTICAL); tvPrice1.setGravity(Gravity.CENTER); tvPrice2.setGravity(Gravity.CENTER); tv_PriceHeader.setGravity(Gravity.CENTER); tvRating1.setGravity(Gravity.CENTER_VERTICAL); tvRating2.setGravity(Gravity.CENTER_VERTICAL); tv_RatingHeader.setGravity(Gravity.CENTER_VERTICAL); } if(ResearchList.AZ_clicked) { notifyDataSetChanged(); //layout_RatingSelected.setBackgroundResource(R.drawable.chart_selected_bg); /*layout_AZSelected.setBackgroundDrawable(null); layout_PriceSelected.setBackgroundDrawable(null); layout_MPGSelected.setBackgroundDrawable(null);*/ linear_CategoryItem_MPGSelection.setVisibility(View.INVISIBLE); linear_CategoryItem_PriceSelection.setVisibility(View.INVISIBLE); linear_CategoryItem_RatingSelection.setVisibility(View.INVISIBLE); tvMPG1.setBackgroundColor(Color.parseColor("#D8D8D8")); tvPrice1.setBackgroundColor(Color.parseColor("#D8D8D8")); tvRating1.setBackgroundColor(Color.parseColor("#D8D8D8")); tvMPG1.setGravity(Gravity.CENTER_VERTICAL); tvMPG2.setGravity(Gravity.CENTER_VERTICAL); tv_MPGHeader.setGravity(Gravity.CENTER_VERTICAL); tvPrice1.setGravity(Gravity.CENTER_VERTICAL); tvPrice2.setGravity(Gravity.CENTER_VERTICAL); tv_PriceHeader.setGravity(Gravity.CENTER_VERTICAL); tvRating1.setGravity(Gravity.CENTER_VERTICAL); tvRating2.setGravity(Gravity.CENTER_VERTICAL); tv_RatingHeader.setGravity(Gravity.CENTER_VERTICAL); } if(ResearchList.Highly_Clicked){ notifyDataSetChanged(); /*layout_AZSelected.setBackgroundResource(R.drawable.chart_selected_bg); layout_MPGSelected.setBackgroundDrawable(null); layout_PriceSelected.setBackgroundDrawable(null);*/ linear_CategoryItem_MPGSelection.setVisibility(View.INVISIBLE); linear_CategoryItem_PriceSelection.setVisibility(View.INVISIBLE); linear_CategoryItem_RatingSelection.setVisibility(View.VISIBLE); tvMPG1.setBackgroundColor(Color.parseColor("#D8D8D8")); tvPrice1.setBackgroundColor(Color.parseColor("#D8D8D8")); tvRating1.setBackgroundDrawable(null); tvMPG1.setGravity(Gravity.CENTER_VERTICAL); tvMPG2.setGravity(Gravity.CENTER_VERTICAL); tv_MPGHeader.setGravity(Gravity.CENTER_VERTICAL); tvPrice1.setGravity(Gravity.CENTER_VERTICAL); tvPrice2.setGravity(Gravity.CENTER_VERTICAL); tv_PriceHeader.setGravity(Gravity.CENTER_VERTICAL); tvRating1.setGravity(Gravity.CENTER); tvRating2.setGravity(Gravity.CENTER); tv_RatingHeader.setGravity(Gravity.CENTER); } return vi; } // expose this method so that SearchResultActivity.onDestroy() can safely close the Thread. public void stopImageLoader() { if(imageLoader != null) { imageLoader.stopThread(); } } } Please suggest me any solution regarding the same. Thanks in advance.
android
cwac-endless
null
null
null
06/13/2012 00:52:34
not a real question
Facing an issue with Endlessadapter in android === I have a problem in implementing the Endlessadapter in my project. I have integrated the same in the project working as, it is downloading data in bunch (10 data) continuously in the background instead as it should download data only when I scrolled the list till the last. Due to the above problem sometimes my app returns OutOfMemoryException, which is not acceptable. **My Code for EndlessAdapter implementation:** **setAdapter in listView:** public void setValuesInCategoryChild(String url,final String filter, final String from, final String to) { if(isOnline()) { final ProgressDialog dialog = ProgressDialog.show( ResearchList.this, "Research List ", "Please wait... ", true); final Handler handler = new Handler() { public void handleMessage(Message msg) { // System.out.println("The id after Save:"+id.get(0).toString()); // catagory.addAll(keyword_vector1); linear_Category_Child.setVisibility(View.GONE); linear_Category_Child_Child.setVisibility(View.VISIBLE); //tv_Child_Header.setText("Volvo"); tv_CategoryChildHeader.setText(from); setHeaderImage(tv_CategoryChildHeader.getText().toString()); System.out.println("The size of Cat Display names:"+coll.getDisplayNames().size()); System.out.println("The size of Cat Images:"+coll.getImages().size()); System.out.println("The size of Cat price:"+coll.getPrice().size()); System.out.println("The size of Cat Year:"+coll.getYears().size()); System.out.println("The size of Cat Rating:"+coll.getRating().size()); System.out.println("The size of Cat Mpg:"+coll.getMpg().size()); LIST_SIZE = coll.getDisplayNames().size(); for (int i=0; i<=BATCH_SIZE; i++){ // countriesSub.add(COUNTRIES[i]); countriesSubCat.add(coll.getDisplayNames().get(i)); imagesSubCat.add(coll.getImages().get(i)); YearSubCat1.add(coll.getYears().get(i)); YearSubCat2.add(coll.getYears().get(i+1)); mpgSubCat1.add(coll.getMpg().get(i)); mpgSubCat2.add(coll.getMpg().get(i+1)); priceSubCat1.add(coll.getPrice().get(i)); priceSubCat2.add(coll.getPrice().get(i+1)); ratingSubCat1.add(coll.getRating().get(i)); ratingSubCat2.add(coll.getRating().get(i+1)); } setLastOffset(BATCH_SIZE); //Adapter for MPG Search demoAdapterCat = new DemoAdapterCat(); lvCategory.setAdapter(demoAdapterCat); Utility util = new Utility(); util.setListViewHeightBasedOnChildren(lvCategory); dialog.dismiss(); } }; final Thread checkUpdate = new Thread() { public void run() { try { String sortEncode = URLEncoder.encode("mpg"); String filterEncode = URLEncoder.encode(filter); String clientEncode = URLEncoder.encode("10030812"); String fromEncode = URLEncoder.encode(from); String toEncode = URLEncoder.encode(to); String catUrl = "/v1/vehicles/get-make-models.json?sort="+sortEncode+"&filter="+filterEncode+"&client-id="+clientEncode+"&from="+fromEncode; genSig = new GetSignature(catUrl, "acura"); try { signature = genSig.getUrlFromString(); } catch (InvalidKeyException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (NoSuchAlgorithmException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } // jsonString = // getJsonSring("http://api.highgearmedia.com/v1/vehicles/get-models.json?make=acura&client-id=10030812&signature=LWQbdAlJVxlXZ1VO2mfqAA=="); //String signatureEncode = URLEncoder.encode(signature); String urlEncode = URLEncoder.encode(catUrl+"&signature="+signature); jsonString = getJsonSring("http://apibeta.highgearmedia.com"+catUrl+"&signature="+signature); System.out.println("The json category:===>"+jsonString); } catch (ClientProtocolException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (URISyntaxException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } JsonParse json = new JsonParse(jsonString); json.parseCat(); handler.sendEmptyMessage(0); } }; checkUpdate.start(); }else { AlertDialog.Builder builder = new Builder(ResearchList.this); builder.setTitle("Attention!"); builder.setMessage("Network Connection unavailable."); builder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub } }); builder.create().show(); } } **DemoAdapterCat Class:** class DemoAdapterCat extends EndlessAdapter { private RotateAnimation rotate=null; ArrayList<String> tempListNamesCat = new ArrayList<String>(); ArrayList<String> tempListImagesCat = new ArrayList<String>(); ArrayList<String> tempListYearCat1 = new ArrayList<String>(); ArrayList<String> tempListYearCat2 = new ArrayList<String>(); ArrayList<String> tempListmpgCat1 = new ArrayList<String>(); ArrayList<String> tempListmpgCat2 = new ArrayList<String>(); ArrayList<String> tempListpriceCat1 = new ArrayList<String>(); ArrayList<String> tempListpriceCat2 = new ArrayList<String>(); ArrayList<String> tempListRatingCat1 = new ArrayList<String>(); ArrayList<String> tempListRatingCat2 = new ArrayList<String>(); DemoAdapterCat() { super(new CategoryListLazyAdapter(ResearchList.this, countriesSubCat, imagesSubCat, YearSubCat1,YearSubCat2, mpgSubCat1,mpgSubCat2, priceSubCat1,priceSubCat2, ratingSubCat1, ratingSubCat2)); Utility util = new Utility(); util.setListViewHeightBasedOnChildren(lvCategory); rotate=new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); rotate.setDuration(600); rotate.setRepeatMode(Animation.RESTART); rotate.setRepeatCount(Animation.INFINITE); } @Override protected View getPendingView(ViewGroup parent) { row=getLayoutInflater().inflate(R.layout.categorylist, null); child=row.findViewById(R.id.tv_CategoryItem_Name); child.setVisibility(View.GONE); child = row.findViewById(R.id.tv_CategoryItem_MPG1); child.setVisibility(View.GONE); child = row.findViewById(R.id.tv_CategoryItem_MPG2); child.setVisibility(View.GONE); child = row.findViewById(R.id.tv_CategoryItem_Price1); child.setVisibility(View.GONE); child = row.findViewById(R.id.tv_CategoryItem_Price2); child.setVisibility(View.GONE); child = row.findViewById(R.id.tv_CategoryItem_Rating1); child.setVisibility(View.GONE); child = row.findViewById(R.id.tv_CategoryItem_Rating2); child.setVisibility(View.GONE); child = row.findViewById(R.id.tv_CategoryItem_Year1); child.setVisibility(View.GONE); child = row.findViewById(R.id.tv_CategoryItem_Year2); child.setVisibility(View.GONE); /*child = row.findViewById(R.id.img_CategoryItem); child.setVisibility(View.GONE); child = row.findViewById(R.id.img_CategoryItem_Arrow); child.setVisibility(View.GONE);*/ /*child = row.findViewById(R.id.linear_main_MPG); child.setVisibility(View.GONE);*/ child=row.findViewById(R.id.throbber); child.setVisibility(View.VISIBLE); child.startAnimation(rotate); return(row); } @Override protected boolean cacheInBackground() { SystemClock.sleep(10000); tempListNamesCat.clear(); tempListImagesCat.clear(); tempListmpgCat1.clear(); tempListmpgCat2.clear(); tempListpriceCat1.clear(); tempListpriceCat2.clear(); tempListYearCat1.clear(); tempListYearCat2.clear(); tempListRatingCat1.clear(); tempListRatingCat2.clear(); int lastOffset = getLastOffset(); if(lastOffset < LIST_SIZE){ int limit = lastOffset + BATCH_SIZE; for(int i=(lastOffset+1); (i<=limit && i<LIST_SIZE); i++){ tempListNamesCat.add(coll.getDisplayNames().get(i)); tempListImagesCat.add(coll.getImages().get(i)); tempListmpgCat1.add(coll.getMpg().get(i)); tempListmpgCat2.add(coll.getMpg().get(i+1)); tempListpriceCat1.add(coll.getPrice().get(i)); tempListpriceCat2.add(coll.getPrice().get(i+1)); tempListRatingCat1.add(coll.getRating().get(i)); tempListRatingCat2.add(coll.getRating().get(i+1)); tempListYearCat1.add(coll.getYears().get(i)); tempListYearCat2.add(coll.getYears().get(i+1)); } setLastOffset(limit); if(limit<LIST_SIZE){ //return true; return(getWrappedAdapter().getCount()<coll.getDisplayNames().size()); } else { return false; } } else { return false; } } @Override protected void appendCachedData() { @SuppressWarnings("unchecked") //Activity activity = this; //ArrayAdapter<String> arrAdapterNew = (ArrayAdapter<String>)getWrappedAdapter(); CategoryListLazyAdapter arrAdapterNewCategory = (CategoryListLazyAdapter)getWrappedAdapter(); //int listLen = tempList.size(); // int listLen = tempListNames.size(); countriesSubCat.addAll(tempListNamesCat); imagesSubCat.addAll(tempListImagesCat); mpgSubCat1.addAll(tempListmpgCat1); mpgSubCat2.addAll(tempListmpgCat2); priceSubCat1.addAll(tempListpriceCat1); priceSubCat2.addAll(tempListpriceCat2); ratingSubCat1.addAll(tempListRatingCat1); ratingSubCat2.addAll(tempListRatingCat2); YearSubCat1.addAll(tempListYearCat1); YearSubCat2.addAll(tempListYearCat2); arrAdapterNewCategory.notifyDataSetChanged(); Utility util = new Utility(); util.setListViewHeightBasedOnChildren(lvCategory); /* for(int i=0; i<listLen; i++){ // arrAdapterNew.add(tempList.get(i)); }*/ } } **LazyAdapter:** public class CategoryListLazyAdapter extends BaseAdapter { private Activity activity; // private List<BaseInventoryItem> localItems; private LayoutInflater inflater = null; private ImageLoader imageLoader; public static Long id; public static int cat_id; public static String type; CatedoryListCollection catList = CatedoryListCollection.getSingletonObject(); LinearLayout linear_CategoryItem_RatingSelection, linear_CategoryItem_MPGSelection, linear_CategoryItem_PriceSelection; TextView tv_RatingHeader, tv_MPGHeader, tv_PriceHeader; ArrayList<String> displayNames = new ArrayList<String>(); ArrayList<String> images = new ArrayList<String>(); ArrayList<String> year1 = new ArrayList<String>(); ArrayList<String> year2 = new ArrayList<String>(); ArrayList<String> mpg1 = new ArrayList<String>(); ArrayList<String> mpg2 = new ArrayList<String>(); ArrayList<String> price1 = new ArrayList<String>(); ArrayList<String> price2 = new ArrayList<String>(); ArrayList<String> rating1 = new ArrayList<String>(); ArrayList<String> rating2 = new ArrayList<String>(); // Pass in the list of items to adapt public CategoryListLazyAdapter(Activity inputActivity, ArrayList<String> displayNames, ArrayList<String> images, ArrayList<String> year1,ArrayList<String> year2, ArrayList<String> mpg1,ArrayList<String> mpg2, ArrayList<String> price1,ArrayList<String> price2, ArrayList<String> rating1, ArrayList<String> rating2) { activity = inputActivity; // localItems = inputItems; inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE); imageLoader = new ImageLoader(activity.getApplicationContext()); this.displayNames = displayNames; this.images = images; this.year1 = year1; this.year2 = year2; this.mpg1 = mpg1; this.mpg2 = mpg2; this.price1 = price1; this.price2 = price2; this.rating1 = rating1; this.rating2 = rating2; } public int getCount() { return displayNames.size(); } public Object getItem(int position) { return position; } public long getItemId(int position) { return position; } public View getView(int position, View convertView, ViewGroup parent) { View vi = convertView; if (convertView == null) { //vi = inflater.inflate(R.layout.new_category_code, null); vi = inflater.inflate(R.layout.categorylist, null); } // Grab all of the layout elements in which we need ot insert content. /* final LinearLayout layout_AZSelected = (LinearLayout)vi.findViewById(R.id.linear_CategoryItem_RatingSelected); final LinearLayout layout_MPGSelected = (LinearLayout)vi.findViewById(R.id.linear_CategoryItem_MPGSelected); final LinearLayout layout_PriceSelected = (LinearLayout)vi.findViewById(R.id.linear_CategoryItem_PriceSelected);*/ linear_CategoryItem_RatingSelection = (LinearLayout)vi.findViewById(R.id.linear_CategoryItem_RatingSelectionBack); linear_CategoryItem_PriceSelection = (LinearLayout)vi.findViewById(R.id.linear_CategoryItem_PriceSelectionBack); linear_CategoryItem_MPGSelection = (LinearLayout)vi.findViewById(R.id.linear_CategoryItem_MPGSelectionBack); TextView tvDisplayName = (TextView) vi.findViewById(R.id.tv_CategoryItem_Name); TextView tvRating1 = (TextView) vi.findViewById(R.id.tv_CategoryItem_Rating1); TextView tvRating2 = (TextView) vi.findViewById(R.id.tv_CategoryItem_Rating2); TextView tvPrice1 = (TextView) vi.findViewById(R.id.tv_CategoryItem_Price1); TextView tvPrice2 = (TextView) vi.findViewById(R.id.tv_CategoryItem_Price2); TextView tvMPG1 = (TextView) vi.findViewById(R.id.tv_CategoryItem_MPG1); TextView tvMPG2 = (TextView) vi.findViewById(R.id.tv_CategoryItem_MPG2); TextView tvYear1 = (TextView) vi.findViewById(R.id.tv_CategoryItem_Year1); TextView tvYear2 = (TextView) vi.findViewById(R.id.tv_CategoryItem_Year2); tv_RatingHeader = (TextView)vi.findViewById(R.id.tv_CategoryItem_RatingHeader); tv_PriceHeader = (TextView)vi.findViewById(R.id.tv_CategoryItem_PriceHeader); tv_MPGHeader = (TextView)vi.findViewById(R.id.tv_CategoryItem_MPGHeader); ImageView productImage = (ImageView) vi.findViewById(R.id.img_CategoryItem); /* ArrayList<String> arr = catList.getMapRating().get("Toyota Paseo"); System.out.println("The array================================>"+arr.get(0)); System.out.println("The array================================2>"+arr.get(1));*/ /*tvRating1.setText(catList.getMapRating().get(position).get(0)); tvRating2.setText(catList.getMapRating().get(position).get(1)); tvPrice1.setText(catList.getMapPrice().get(position).get(0)); tvPrice2.setText(catList.getMapPrice().get(position).get(1)); tvMPG1.setText(catList.getMapMpg().get(position).get(0)); tvMPG2.setText(catList.getMapMpg().get(position).get(1)); tvYear1.setText(catList.getMapYears().get(position).get(0)); tvYear2.setText(catList.getMapYears().get(position).get(1));*/ tvRating1.setText(rating1.get(position)); tvRating2.setText(rating2.get(position)); tvPrice1.setText(price1.get(position)); tvPrice2.setText(price2.get(position)); tvMPG1.setText(mpg1.get(position)); tvMPG1.setBackgroundDrawable(null); tvMPG1.setGravity(Gravity.CENTER); tvMPG2.setText(mpg2.get(position)); tvYear1.setText(year1.get(position)); tvYear2.setText(year2.get(position)); tvDisplayName.setText(catList.getDisplayNames().get(position)); Iterator myVeryOwnIterator = catList.getMapMpg().keySet().iterator(); /*while(myVeryOwnIterator.hasNext()) { String key=(String)myVeryOwnIterator.next(); ArrayList<String> value=catList.getMapMpg().get(key); //Toast.makeText(this, "Key: "+key+" Value: "+value.get(0)+" and "+value.get(1), Toast.LENGTH_LONG).show(); System.out.println("Key:"+key+" Value:"+value.get(0)+" and "+value.get(1)); }*/ //tvBrandName.setText(brandList.getDisplayNames().get(position)); /*layout_RatingSelected.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub layout_RatingSelected.setBackgroundResource(R.drawable.chart_selected_bg); } });*/ /*layout_PriceSelected.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub layout_PriceSelected.setBackgroundResource(R.drawable.chart_selected_bg); } });*/ imageLoader.displayImage(catList.getImages().get(position), activity, productImage); linear_CategoryItem_MPGSelection.setVisibility(View.VISIBLE); tv_MPGHeader.setGravity(Gravity.CENTER); if(ResearchList.MPG_Clicked) { notifyDataSetChanged(); /*layout_MPGSelected.setBackgroundResource(R.drawable.chart_selected_bg); layout_AZSelected.setBackgroundDrawable(null); layout_PriceSelected.setBackgroundDrawable(null);*/ linear_CategoryItem_MPGSelection.setVisibility(View.VISIBLE); linear_CategoryItem_PriceSelection.setVisibility(View.INVISIBLE); linear_CategoryItem_RatingSelection.setVisibility(View.INVISIBLE); tvMPG1.setBackgroundDrawable(null); tvPrice1.setBackgroundColor(Color.parseColor("#D8D8D8")); tvRating1.setBackgroundColor(Color.parseColor("#D8D8D8")); tvMPG1.setGravity(Gravity.CENTER); tvMPG2.setGravity(Gravity.CENTER); tv_MPGHeader.setGravity(Gravity.CENTER); tvPrice1.setGravity(Gravity.CENTER_VERTICAL); tvPrice2.setGravity(Gravity.CENTER_VERTICAL); tv_PriceHeader.setGravity(Gravity.CENTER_VERTICAL); tvRating1.setGravity(Gravity.CENTER_VERTICAL); tvRating2.setGravity(Gravity.CENTER_VERTICAL); tv_RatingHeader.setGravity(Gravity.CENTER_VERTICAL); } if(ResearchList.PRICE_Clicked) { notifyDataSetChanged(); /*layout_PriceSelected.setBackgroundResource(R.drawable.chart_selected_bg); layout_MPGSelected.setBackgroundDrawable(null); layout_AZSelected.setBackgroundDrawable(null);*/ linear_CategoryItem_MPGSelection.setVisibility(View.INVISIBLE); linear_CategoryItem_PriceSelection.setVisibility(View.VISIBLE); linear_CategoryItem_RatingSelection.setVisibility(View.INVISIBLE); tvMPG1.setBackgroundColor(Color.parseColor("#D8D8D8")); tvPrice1.setBackgroundDrawable(null); tvRating1.setBackgroundColor(Color.parseColor("#D8D8D8")); tvMPG1.setGravity(Gravity.CENTER_VERTICAL); tvMPG2.setGravity(Gravity.CENTER_VERTICAL); tv_MPGHeader.setGravity(Gravity.CENTER_VERTICAL); tvPrice1.setGravity(Gravity.CENTER); tvPrice2.setGravity(Gravity.CENTER); tv_PriceHeader.setGravity(Gravity.CENTER); tvRating1.setGravity(Gravity.CENTER_VERTICAL); tvRating2.setGravity(Gravity.CENTER_VERTICAL); tv_RatingHeader.setGravity(Gravity.CENTER_VERTICAL); } if(ResearchList.AZ_clicked) { notifyDataSetChanged(); //layout_RatingSelected.setBackgroundResource(R.drawable.chart_selected_bg); /*layout_AZSelected.setBackgroundDrawable(null); layout_PriceSelected.setBackgroundDrawable(null); layout_MPGSelected.setBackgroundDrawable(null);*/ linear_CategoryItem_MPGSelection.setVisibility(View.INVISIBLE); linear_CategoryItem_PriceSelection.setVisibility(View.INVISIBLE); linear_CategoryItem_RatingSelection.setVisibility(View.INVISIBLE); tvMPG1.setBackgroundColor(Color.parseColor("#D8D8D8")); tvPrice1.setBackgroundColor(Color.parseColor("#D8D8D8")); tvRating1.setBackgroundColor(Color.parseColor("#D8D8D8")); tvMPG1.setGravity(Gravity.CENTER_VERTICAL); tvMPG2.setGravity(Gravity.CENTER_VERTICAL); tv_MPGHeader.setGravity(Gravity.CENTER_VERTICAL); tvPrice1.setGravity(Gravity.CENTER_VERTICAL); tvPrice2.setGravity(Gravity.CENTER_VERTICAL); tv_PriceHeader.setGravity(Gravity.CENTER_VERTICAL); tvRating1.setGravity(Gravity.CENTER_VERTICAL); tvRating2.setGravity(Gravity.CENTER_VERTICAL); tv_RatingHeader.setGravity(Gravity.CENTER_VERTICAL); } if(ResearchList.Highly_Clicked){ notifyDataSetChanged(); /*layout_AZSelected.setBackgroundResource(R.drawable.chart_selected_bg); layout_MPGSelected.setBackgroundDrawable(null); layout_PriceSelected.setBackgroundDrawable(null);*/ linear_CategoryItem_MPGSelection.setVisibility(View.INVISIBLE); linear_CategoryItem_PriceSelection.setVisibility(View.INVISIBLE); linear_CategoryItem_RatingSelection.setVisibility(View.VISIBLE); tvMPG1.setBackgroundColor(Color.parseColor("#D8D8D8")); tvPrice1.setBackgroundColor(Color.parseColor("#D8D8D8")); tvRating1.setBackgroundDrawable(null); tvMPG1.setGravity(Gravity.CENTER_VERTICAL); tvMPG2.setGravity(Gravity.CENTER_VERTICAL); tv_MPGHeader.setGravity(Gravity.CENTER_VERTICAL); tvPrice1.setGravity(Gravity.CENTER_VERTICAL); tvPrice2.setGravity(Gravity.CENTER_VERTICAL); tv_PriceHeader.setGravity(Gravity.CENTER_VERTICAL); tvRating1.setGravity(Gravity.CENTER); tvRating2.setGravity(Gravity.CENTER); tv_RatingHeader.setGravity(Gravity.CENTER); } return vi; } // expose this method so that SearchResultActivity.onDestroy() can safely close the Thread. public void stopImageLoader() { if(imageLoader != null) { imageLoader.stopThread(); } } } Please suggest me any solution regarding the same. Thanks in advance.
1
4,578,965
01/02/2011 15:12:39
560,386
01/02/2011 15:03:42
1
0
Tracking Impressions using images
I believe the name for this concept is a **web bug** for website (not email). **Step 1:** I would like 'website A' to select a random image from 'website b' image folder. **Step 2:** the image from 'website b' needs to be randomly renamed and saved. Step 3: Assign the new image from 'website b' to display page 'on website a' Step 3: Finally I would like some way to view this image's tracking stats for impressions of people visiting 'website A' Any Expert Advice Will Help. THANKS AHEAD OF TIME!
php
tracking
null
null
null
01/02/2011 15:44:55
not a real question
Tracking Impressions using images === I believe the name for this concept is a **web bug** for website (not email). **Step 1:** I would like 'website A' to select a random image from 'website b' image folder. **Step 2:** the image from 'website b' needs to be randomly renamed and saved. Step 3: Assign the new image from 'website b' to display page 'on website a' Step 3: Finally I would like some way to view this image's tracking stats for impressions of people visiting 'website A' Any Expert Advice Will Help. THANKS AHEAD OF TIME!
1
4,814,068
01/27/2011 08:20:24
587,133
01/24/2011 06:58:42
9
0
java error unreported exception java.lang.Exception; must be caught or declared to be thrown
import java.io.FileInputStream; import org.apache.commons.codec.binary.Base64; public class Encode { public static String encodeFileStream(String filePath) throws Exception //file path ex : C:\Program Files\Cordys\Web\reports\I0001180.pdf { StringBuffer sb=new StringBuffer(); try { FileInputStream fin = new FileInputStream(filePath); //StringBuffer sb=new StringBuffer(); int lineLength = 72; byte[] buf = new byte[lineLength/4*3]; while (true) { int len = fin.read(buf); if (len <= 0) { break; } //new Base64().encode(byte); //sb.append(Base64.encode(buf)); //sb.append(Base64.encodeBase64(buf)); Base64 b = new Base64(); sb.append(b.encode(buf)); //return sb.toString(); } } catch(Exception e) { return e.getMessage(); } return sb.toString(); } public static void main(String args[]) { String s=""; s=encodeFileStream("E:/CSSDocument/Test.pdf"); } }
java
null
null
null
null
02/21/2012 11:46:03
not a real question
java error unreported exception java.lang.Exception; must be caught or declared to be thrown === import java.io.FileInputStream; import org.apache.commons.codec.binary.Base64; public class Encode { public static String encodeFileStream(String filePath) throws Exception //file path ex : C:\Program Files\Cordys\Web\reports\I0001180.pdf { StringBuffer sb=new StringBuffer(); try { FileInputStream fin = new FileInputStream(filePath); //StringBuffer sb=new StringBuffer(); int lineLength = 72; byte[] buf = new byte[lineLength/4*3]; while (true) { int len = fin.read(buf); if (len <= 0) { break; } //new Base64().encode(byte); //sb.append(Base64.encode(buf)); //sb.append(Base64.encodeBase64(buf)); Base64 b = new Base64(); sb.append(b.encode(buf)); //return sb.toString(); } } catch(Exception e) { return e.getMessage(); } return sb.toString(); } public static void main(String args[]) { String s=""; s=encodeFileStream("E:/CSSDocument/Test.pdf"); } }
1
3,921,013
10/13/2010 05:29:00
377,337
06/27/2010 09:55:35
12
1
json changes the order of elements
I am trying to send a list of objects from an android mobile phone app to a j2ee webserver. I create json objects and then put the objects into an jsonarray(in an order) and then send it. I am able to receive the jsonarray on the server, obtain the objects individually too, but the order of how I inserted the objects into the jsonarray is different compared to the order present in the received array. The order of elements plays a crucial role in my data processing. Could somebody please tell me a workaround for this. Thanks, raqz
android
json
servlets
jsonarray
null
null
open
json changes the order of elements === I am trying to send a list of objects from an android mobile phone app to a j2ee webserver. I create json objects and then put the objects into an jsonarray(in an order) and then send it. I am able to receive the jsonarray on the server, obtain the objects individually too, but the order of how I inserted the objects into the jsonarray is different compared to the order present in the received array. The order of elements plays a crucial role in my data processing. Could somebody please tell me a workaround for this. Thanks, raqz
0
6,209,859
06/02/2011 02:43:48
143,273
07/22/2009 23:02:38
696
16
First Item in Grouped List without using Lambda's?
Assume I have an object with "id" and "name". My list is these items: id = 1, name = "Bob" id = 2, name = "Bob" id = 3, name = "Chris" id = 4, name = "Chris" id = 5, name = "Paul" How can I get a subset of that list that would return me items 1, 3 and 5 (i.e. the first occurrence of a name) but specifically without Lambda's. I think this is the Lambda solution `items.GroupBy(item => item.UniqueIdentifier).Distinct().Select(item => item.First()).ToList();` but I am specifically forbidden to use Lambda's on this solution (no, this isn't at school...this is in an actual work environment)
c#
list
lambda
distinct
null
null
open
First Item in Grouped List without using Lambda's? === Assume I have an object with "id" and "name". My list is these items: id = 1, name = "Bob" id = 2, name = "Bob" id = 3, name = "Chris" id = 4, name = "Chris" id = 5, name = "Paul" How can I get a subset of that list that would return me items 1, 3 and 5 (i.e. the first occurrence of a name) but specifically without Lambda's. I think this is the Lambda solution `items.GroupBy(item => item.UniqueIdentifier).Distinct().Select(item => item.First()).ToList();` but I am specifically forbidden to use Lambda's on this solution (no, this isn't at school...this is in an actual work environment)
0
3,542,342
08/22/2010 16:47:35
427,734
08/22/2010 16:47:35
1
0
How to prepare to the interview question "How would you test this function?"
Big companies like Microsoft often ask you to write some function (for example reverse all words in the statement) and then write test cases for it. What is the best way to prepare for writing such test cases?
interview-questions
null
null
null
null
12/06/2011 01:15:21
not constructive
How to prepare to the interview question "How would you test this function?" === Big companies like Microsoft often ask you to write some function (for example reverse all words in the statement) and then write test cases for it. What is the best way to prepare for writing such test cases?
4
11,139,460
06/21/2012 13:38:23
772,399
05/27/2011 03:30:40
1,025
13
Execution Time of Command Line Command
I am trying to compare two tools execution time, which I have installed in my debian linux server. Now, I have to give two command line command to execute those two tools. For example say, > cat file1 file2 file3 > file4 and > cat file4 file5 file6 > file7 Now, I want to find execution time of 1st and 2nd command. Can anybody help me, how to find those two commands execution time ? Programmatically foundation (say in JAVA) is also acceptable.
java
linux
debian
null
null
null
open
Execution Time of Command Line Command === I am trying to compare two tools execution time, which I have installed in my debian linux server. Now, I have to give two command line command to execute those two tools. For example say, > cat file1 file2 file3 > file4 and > cat file4 file5 file6 > file7 Now, I want to find execution time of 1st and 2nd command. Can anybody help me, how to find those two commands execution time ? Programmatically foundation (say in JAVA) is also acceptable.
0
6,499,829
06/27/2011 22:47:01
818,245
06/27/2011 22:47:01
1
0
Ruby vs. Python: which one is easier to keep track of different language versions?
I've heard that there are issues with the more recent versions of Python (3.x?) that have led to slower adoption. Is that true? And if so, is it an issue when different people are using different versions of the language? Which version of Python is most widespread? Does Ruby have a similar issue, or did most people switch to 1.9? Please note that this is not a general "vs." question at all, but rather a question about this specific issue.
python
ruby
null
null
null
06/30/2011 01:11:46
not constructive
Ruby vs. Python: which one is easier to keep track of different language versions? === I've heard that there are issues with the more recent versions of Python (3.x?) that have led to slower adoption. Is that true? And if so, is it an issue when different people are using different versions of the language? Which version of Python is most widespread? Does Ruby have a similar issue, or did most people switch to 1.9? Please note that this is not a general "vs." question at all, but rather a question about this specific issue.
4
9,101,749
02/01/2012 19:12:22
1,183,461
02/01/2012 18:40:05
1
0
ORA-12154: TNS could not resolve the conflict identifier specified (ORCL)
have Installed ORACLE 10 G Database on my Laptop which is having a WINDOWS 7 Home Basic 64-bit OS with 3 GB of RAM and 320 GB of Hard Disk. My Database name is ORCL. I have made a user named "puneet". I am able to connect to the Database through SQLPLUS by giving the Command conn puneet/puneet@orcl. Also i am able to connect to the Database ORCL from SQLPLUS by giving the command "conn sys as sysdba" along with the Password. I am able to connect to the Database "ORCL" through SQLDEVELOPER. I am getting the above Error while connecting to the Database "ORCL" through "TOAD" version "9.6.1.1". Kindly Help me in resolving this Issue.
toad
null
null
null
null
02/02/2012 00:45:57
not a real question
ORA-12154: TNS could not resolve the conflict identifier specified (ORCL) === have Installed ORACLE 10 G Database on my Laptop which is having a WINDOWS 7 Home Basic 64-bit OS with 3 GB of RAM and 320 GB of Hard Disk. My Database name is ORCL. I have made a user named "puneet". I am able to connect to the Database through SQLPLUS by giving the Command conn puneet/puneet@orcl. Also i am able to connect to the Database ORCL from SQLPLUS by giving the command "conn sys as sysdba" along with the Password. I am able to connect to the Database "ORCL" through SQLDEVELOPER. I am getting the above Error while connecting to the Database "ORCL" through "TOAD" version "9.6.1.1". Kindly Help me in resolving this Issue.
1
10,204,030
04/18/2012 06:31:39
1,127,761
01/03/2012 12:01:14
2,362
134
What technology to learn additional to PHP, MySQL, JS, HTML, CSS
So i'm here and i pretty much got a full chain of languages for prette much any purpose: * PHP * HTML * Javascript * Java * CSS * SQL And now i'm questioning what i should do next as an alternative or addition. My main focus is in web development so mainly there are some technologies that are growing big really fast lately: * node.js (yes basically javascript but i think theres a lot to learn for js to be used on the server side) * ruby * clojure And there are some that have been around for quite some years now: * perl * python But those are only the ones i've seen so far. What are your recommendations from these languages/technologies? Why? What are the benefits or have i missed the ultimate star among them all?
python
ruby
perl
node.js
clojure
04/18/2012 07:11:54
not constructive
What technology to learn additional to PHP, MySQL, JS, HTML, CSS === So i'm here and i pretty much got a full chain of languages for prette much any purpose: * PHP * HTML * Javascript * Java * CSS * SQL And now i'm questioning what i should do next as an alternative or addition. My main focus is in web development so mainly there are some technologies that are growing big really fast lately: * node.js (yes basically javascript but i think theres a lot to learn for js to be used on the server side) * ruby * clojure And there are some that have been around for quite some years now: * perl * python But those are only the ones i've seen so far. What are your recommendations from these languages/technologies? Why? What are the benefits or have i missed the ultimate star among them all?
4
2,249,619
02/12/2010 04:09:59
93,733
04/21/2009 11:43:35
114
5
How to format a datetime in Powershell
So I can format the Get-Date commandlette no problem like this: $date = Get-Date -format "yyyyMMdd" but once I've got a date in a variable, how do I format it. This errors: $dateStr = $date -format "yyyMMdd" saying: > "You must provide a value expression > on the right-hand side of the '-f' > operator"
powershell
c#
asp.net
microsoft
command-line
null
open
How to format a datetime in Powershell === So I can format the Get-Date commandlette no problem like this: $date = Get-Date -format "yyyyMMdd" but once I've got a date in a variable, how do I format it. This errors: $dateStr = $date -format "yyyMMdd" saying: > "You must provide a value expression > on the right-hand side of the '-f' > operator"
0
10,512,192
05/09/2012 08:09:23
1,095,005
12/13/2011 04:23:11
37
0
How to find index of element inside IEnumurable Collection using C#
I am using a **IEnumurable Collection** variable to get my data. I have stored data in that collection **as rows and columns**. For example I am having 3 rows with 3 columns like **EmpNo** , **Designation** and **Salary**. Now I want to get that Designation **column index number**. My Code is: var EmpCollection=PaneViewModel.TrackedItems; // I am having my data as rows and columns in that EmpCollection //Now I need to get designation column index Can anyone please tell me the way to get **Particular column index number** from the Collection?
c#
wpf
mvvm
null
null
05/09/2012 08:31:16
not a real question
How to find index of element inside IEnumurable Collection using C# === I am using a **IEnumurable Collection** variable to get my data. I have stored data in that collection **as rows and columns**. For example I am having 3 rows with 3 columns like **EmpNo** , **Designation** and **Salary**. Now I want to get that Designation **column index number**. My Code is: var EmpCollection=PaneViewModel.TrackedItems; // I am having my data as rows and columns in that EmpCollection //Now I need to get designation column index Can anyone please tell me the way to get **Particular column index number** from the Collection?
1
4,795,655
01/25/2011 15:54:01
281,121
02/25/2010 10:14:10
109
0
Use of a4j:commandButton vs h:commandButton to present new pages in Richfaces
I have completely substituted the h:commandButton with a4j:commandLink in my application for reasons not relevant to this issue. Since then I am seeing flaky peculiar side-effects in IE8 such as select menus that are losing focus and select items that cannot be selected. Does anyone think that it is a bad idea to use a4j:commandButton instead of h:commandButton for some reason? Does anyone have any prior experience on this? Any answer is welcome.
jsf
richfaces
ajax4jsf
null
null
null
open
Use of a4j:commandButton vs h:commandButton to present new pages in Richfaces === I have completely substituted the h:commandButton with a4j:commandLink in my application for reasons not relevant to this issue. Since then I am seeing flaky peculiar side-effects in IE8 such as select menus that are losing focus and select items that cannot be selected. Does anyone think that it is a bad idea to use a4j:commandButton instead of h:commandButton for some reason? Does anyone have any prior experience on this? Any answer is welcome.
0
8,526,305
12/15/2011 20:41:02
455,712
09/23/2010 01:25:17
49
3
Visualization tools for XML data
Hi I'm looking for some XML based tools that can create interactive visualizations. Can anyone suggest me some good tools. thanks
xml
visualization
data-visualization
null
null
12/21/2011 14:29:48
not constructive
Visualization tools for XML data === Hi I'm looking for some XML based tools that can create interactive visualizations. Can anyone suggest me some good tools. thanks
4
598,244
02/28/2009 16:17:28
72,099
02/28/2009 00:48:34
18
0
Java Puzzlers book for a beginner
I am pretty much a beginner java programmer. do you think the book [Java Puzzlers][1] is a good read for learning and inspiration?. Any other books you recommend for java beginners would be great. [1]: http://www.amazon.com/Java-TM-Puzzlers-Pitfalls-Corner/dp/032133678X/ref=sr_1_1?ie=UTF8&s=books&qid=1235837689&sr=1-1
java
books
null
null
null
06/11/2012 08:30:19
not constructive
Java Puzzlers book for a beginner === I am pretty much a beginner java programmer. do you think the book [Java Puzzlers][1] is a good read for learning and inspiration?. Any other books you recommend for java beginners would be great. [1]: http://www.amazon.com/Java-TM-Puzzlers-Pitfalls-Corner/dp/032133678X/ref=sr_1_1?ie=UTF8&s=books&qid=1235837689&sr=1-1
4
8,185,445
11/18/2011 16:16:04
1,054,170
11/18/2011 16:11:41
1
0
Javascript variable input from page?
I'm looking for how to get input from a webpage into a javascript variable?
javascript
html
null
null
null
11/18/2011 16:30:20
not a real question
Javascript variable input from page? === I'm looking for how to get input from a webpage into a javascript variable?
1
6,485,379
06/26/2011 17:04:04
219,594
11/26/2009 17:53:14
382
23
Testing named scopes with RSpec
I am new to testing Rails web applications and RSpec. I work with legasy code and need add tests. So what best way to test finders and named scopes with RSpec? I find in google a few approaches but they are not ideal. For example: http://paulsturgess.co.uk/articles/show/93-using-rspec-to-test-a-named_scope-in-ruby-on-rails it "excludes users that are not active" do @user = Factory(:user, :active => false) User.active.should_not include(@user) end or http://h1labs.com/notebook/2008/8/21/testing-named-scope-with-rspec it "should have a published named scope that returns ..." do Post.published.proxy_options.should == {:conditions => {:published => true}} end I find best approach (IMHO) in "Rail Test Prescriptions": should_match_find_method :active_only { :active == true } where `should_match_find_method` custom helper method
ruby-on-rails
ruby
testing
rspec
null
null
open
Testing named scopes with RSpec === I am new to testing Rails web applications and RSpec. I work with legasy code and need add tests. So what best way to test finders and named scopes with RSpec? I find in google a few approaches but they are not ideal. For example: http://paulsturgess.co.uk/articles/show/93-using-rspec-to-test-a-named_scope-in-ruby-on-rails it "excludes users that are not active" do @user = Factory(:user, :active => false) User.active.should_not include(@user) end or http://h1labs.com/notebook/2008/8/21/testing-named-scope-with-rspec it "should have a published named scope that returns ..." do Post.published.proxy_options.should == {:conditions => {:published => true}} end I find best approach (IMHO) in "Rail Test Prescriptions": should_match_find_method :active_only { :active == true } where `should_match_find_method` custom helper method
0
6,891,166
07/31/2011 17:47:21
829,504
07/05/2011 10:33:13
23
1
Cool preview addons in firefox shows browsing history?
Cool preview addons in firefox shows browsing history or not?
browser
firefox-addon
null
null
null
08/09/2011 13:17:32
not a real question
Cool preview addons in firefox shows browsing history? === Cool preview addons in firefox shows browsing history or not?
1
5,635,811
04/12/2011 13:18:06
648,946
03/07/2011 22:41:19
560
42
Unique constraint on multiple fields in Access 2003
I have not found any answer regarding my question, all unique constraint questions did not involve MS Access. The question is how to make a unique constraint on multpile fields in MS Access 2003 database? If my table consists of columns `id, A, B, C, D, E, F`. I have an index on column **id**, but I would like to have a unique constraint set on both columns `A` and `B`. Hence, I may have a duplicate value in column `A`, provided the value in column `B` are different. I want to stress that I am **not interested** in a workaround like **creating new column** with concatenated values from columns `A` and `B`, and creating a constraint on this column.
unique
ms-access-2003
constraints
null
null
null
open
Unique constraint on multiple fields in Access 2003 === I have not found any answer regarding my question, all unique constraint questions did not involve MS Access. The question is how to make a unique constraint on multpile fields in MS Access 2003 database? If my table consists of columns `id, A, B, C, D, E, F`. I have an index on column **id**, but I would like to have a unique constraint set on both columns `A` and `B`. Hence, I may have a duplicate value in column `A`, provided the value in column `B` are different. I want to stress that I am **not interested** in a workaround like **creating new column** with concatenated values from columns `A` and `B`, and creating a constraint on this column.
0
9,278,559
02/14/2012 14:25:03
1,170,561
01/26/2012 03:38:03
1
0
php malfunction
Running php on ubuntu. Just installed the newest update today. I am having trouble doing a simple str_replace; I am trying to remove all comma's from a string, which does work. But when i try to alter the string again, the commas reappear somehow. I mean WTF right. I refactored my code to ensure I didn't cause this. Anyways here is my code. Can anybody spot a bug? $delim=remDelim(fgets($fo)); # echo 'before : '.htmlspecialchars($delim); $delime =str_replace(",","&#44;",$delim); echo 'after : '.htmlspecialchars($delime); $delimed = str_replace("<","",$delime); echo $delimed.'<br />'; example output: Jose, jr to Jose&#44; jr to Jose, jr its like my string is being unconverted somehow. I would say that it was most likely I got the names mixed up and used the first string to craft the last.. But alas I can see that is not the case. Crazy right? WTF?
php
str-replace
null
null
null
null
open
php malfunction === Running php on ubuntu. Just installed the newest update today. I am having trouble doing a simple str_replace; I am trying to remove all comma's from a string, which does work. But when i try to alter the string again, the commas reappear somehow. I mean WTF right. I refactored my code to ensure I didn't cause this. Anyways here is my code. Can anybody spot a bug? $delim=remDelim(fgets($fo)); # echo 'before : '.htmlspecialchars($delim); $delime =str_replace(",","&#44;",$delim); echo 'after : '.htmlspecialchars($delime); $delimed = str_replace("<","",$delime); echo $delimed.'<br />'; example output: Jose, jr to Jose&#44; jr to Jose, jr its like my string is being unconverted somehow. I would say that it was most likely I got the names mixed up and used the first string to craft the last.. But alas I can see that is not the case. Crazy right? WTF?
0
2,011,740
01/06/2010 08:44:26
244,563
01/06/2010 08:44:26
1
0
How do I save an html page to a database?
I just want to know if it's possible. How do I save an html page and all of its contents to a database? like for example, I have a database wherein it consists all HTML pages. Just want to know if its possible. And how to retrieve it too. We're using PHP as our language. Thank you.
php
html
database
save
null
null
open
How do I save an html page to a database? === I just want to know if it's possible. How do I save an html page and all of its contents to a database? like for example, I have a database wherein it consists all HTML pages. Just want to know if its possible. And how to retrieve it too. We're using PHP as our language. Thank you.
0
7,181,524
08/24/2011 20:01:00
908,301
01/06/2011 23:48:37
11
1
agile dev for customers who don't speak tech - best practices?
I've read some articles and [this][1] [1]: http://stackoverflow.com/questions/129073/what-is-the-best-pattern-solution-to-implement-workflow-a-process-for-product but haven't really found a good process for product development, utilizing customer feedback. The issue is how does one get to rapid, agile development when customers don't speak tech. Right now we have customer support teams vet all support messages via zendesk, and use uservoice for feature requests, to best support our customers. BUT, things aren't ubber fast and I don't feel like we're giving people the best customer experience (maybe I expect too much after working with Nordstrom). The Question is: > What process can one use to respond to customers leaving them with a great experience, and get their bugs, recommendations, and product-our solution related issues worked out to the best of our abilities? Ideally, this means we're understanding the issues to an actionable level within a few minute phone call/email with the customer, getting ?time-tables? from developers on features and fixes, and organizing all of this madness. I'm wondering if anyone has really effective work-flows they use or have used. Thanks!!
project-management
workflow
agile
productivity
null
08/24/2011 21:49:13
not constructive
agile dev for customers who don't speak tech - best practices? === I've read some articles and [this][1] [1]: http://stackoverflow.com/questions/129073/what-is-the-best-pattern-solution-to-implement-workflow-a-process-for-product but haven't really found a good process for product development, utilizing customer feedback. The issue is how does one get to rapid, agile development when customers don't speak tech. Right now we have customer support teams vet all support messages via zendesk, and use uservoice for feature requests, to best support our customers. BUT, things aren't ubber fast and I don't feel like we're giving people the best customer experience (maybe I expect too much after working with Nordstrom). The Question is: > What process can one use to respond to customers leaving them with a great experience, and get their bugs, recommendations, and product-our solution related issues worked out to the best of our abilities? Ideally, this means we're understanding the issues to an actionable level within a few minute phone call/email with the customer, getting ?time-tables? from developers on features and fixes, and organizing all of this madness. I'm wondering if anyone has really effective work-flows they use or have used. Thanks!!
4
11,198,253
06/25/2012 22:25:14
402,941
07/27/2010 04:07:03
681
46
how to write install script for my website that configures virtual hosts, sets up a database etc on apache2, mysql, debian
How to write install script for my website that configures virtual hosts, sets up a database etc on apache2, mysql, & debian? I see a lot of tutorials about how to set these environments up but nothing about automating the process. I basically want to write an install script that: - Goes checks all the products the solution needs are there, if not downloads and installs them with a basic configuration. - Gets the appropriate version of the software from a git repo builds it then installs it on the website - Makes final adjustments to the site like permissions links to make sites-enabled etc. Is there a tool that will help me do this? or a tutorial somewhere that will help me tick all the boxes? Is there a best practice or book of knowledge I can read on the subject of *nix website deployment?
mysql
bash
apache2
install
debian
06/26/2012 17:54:20
off topic
how to write install script for my website that configures virtual hosts, sets up a database etc on apache2, mysql, debian === How to write install script for my website that configures virtual hosts, sets up a database etc on apache2, mysql, & debian? I see a lot of tutorials about how to set these environments up but nothing about automating the process. I basically want to write an install script that: - Goes checks all the products the solution needs are there, if not downloads and installs them with a basic configuration. - Gets the appropriate version of the software from a git repo builds it then installs it on the website - Makes final adjustments to the site like permissions links to make sites-enabled etc. Is there a tool that will help me do this? or a tutorial somewhere that will help me tick all the boxes? Is there a best practice or book of knowledge I can read on the subject of *nix website deployment?
2
8,137,190
11/15/2011 13:39:17
1,047,641
11/15/2011 13:29:44
1
0
How to calculate third point of a triangle from two points, angle and edge length?
I'm looking for a way (in Java) to calculate a third point in triangle if there are known two points, angle between edges and length of an edge. Can you help? Thanks!
java
3d
geometry
2d
null
11/16/2011 01:29:46
not a real question
How to calculate third point of a triangle from two points, angle and edge length? === I'm looking for a way (in Java) to calculate a third point in triangle if there are known two points, angle between edges and length of an edge. Can you help? Thanks!
1
2,071,871
01/15/2010 13:40:11
100,209
05/03/2009 11:28:00
71
5
Setting Actionscript Object Keys
If I have an array, I can set the keys by doing the following: var example:Array = new Array(); example[20] = "500,45"; example[324] = "432,23"; If I want to do something with Objects, how would I achieve this? I tried the following: var example:Object = [{x:500, y:45}, {x:432, y:23}]; // Works but keys are 0 and 1 var example:Object = [20: {x:500, y:45}, 324: {x:432, y:23}]; // Compile errors var example:Object = [20]: {x:500, y:45}, [324]: {x:432, y:23}; // Compile errors var example:Object = [20] {x:500, y:45}, [324] {x:432, y:23}; // Compile errors Is there a good way to achieve this? I understand I could do this: var example:Object = {id20 : {x:500, y:45}, id324: {x:432, y:23} }; But it doesn't suit me.
as2
actionscript-2
null
null
null
null
open
Setting Actionscript Object Keys === If I have an array, I can set the keys by doing the following: var example:Array = new Array(); example[20] = "500,45"; example[324] = "432,23"; If I want to do something with Objects, how would I achieve this? I tried the following: var example:Object = [{x:500, y:45}, {x:432, y:23}]; // Works but keys are 0 and 1 var example:Object = [20: {x:500, y:45}, 324: {x:432, y:23}]; // Compile errors var example:Object = [20]: {x:500, y:45}, [324]: {x:432, y:23}; // Compile errors var example:Object = [20] {x:500, y:45}, [324] {x:432, y:23}; // Compile errors Is there a good way to achieve this? I understand I could do this: var example:Object = {id20 : {x:500, y:45}, id324: {x:432, y:23} }; But it doesn't suit me.
0
3,959,649
10/18/2010 13:31:13
350,080
05/25/2010 16:02:15
96
3
What is a good video+soundplayer with flash and html5-support?
I need a audio and videoplayer that is usable both in non flash-browsers (such as iphone-safari) and in non html5-video-enabled browser (such as all old browsers) Apart from this clean asthetics(think vimeo), support for many codec-types and easyness to implement are all bonuses. Free or paid doesn't matter!
flash
video
audio
mediaplayer
html5-video
null
open
What is a good video+soundplayer with flash and html5-support? === I need a audio and videoplayer that is usable both in non flash-browsers (such as iphone-safari) and in non html5-video-enabled browser (such as all old browsers) Apart from this clean asthetics(think vimeo), support for many codec-types and easyness to implement are all bonuses. Free or paid doesn't matter!
0
7,200,631
08/26/2011 06:08:40
913,458
08/26/2011 06:08:40
1
0
remote connection using SSH without passwords
How can we run a script on a remote machine without passwords? When i issue the following command, it is prompting for passoword. Could any one advise on this please ? ssh username@hostname df -h Also advise if the password can be passed dynamically
ssh
null
null
null
null
08/26/2011 17:18:19
off topic
remote connection using SSH without passwords === How can we run a script on a remote machine without passwords? When i issue the following command, it is prompting for passoword. Could any one advise on this please ? ssh username@hostname df -h Also advise if the password can be passed dynamically
2
6,931,245
08/03/2011 18:20:01
250,807
01/14/2010 15:10:27
44
6
Eclipse Indigo "Save Actions" are not being applied
I'm new to Eclipse and downloaded the following version: Eclipse Java EE IDE for Web Developers. Version: Indigo Release Build id: 20110615-0604 I have edited Java > Editor > Save Actions to do the following: Remove trailing white spaces on all lines, Correct indentation When I save the .java file, those actions are not applied... is this a bug? Found this that might be related:https://bugs.eclipse.org/bugs/show_bug.cgi?id=350475
eclipse
eclipse-indigo
null
null
null
null
open
Eclipse Indigo "Save Actions" are not being applied === I'm new to Eclipse and downloaded the following version: Eclipse Java EE IDE for Web Developers. Version: Indigo Release Build id: 20110615-0604 I have edited Java > Editor > Save Actions to do the following: Remove trailing white spaces on all lines, Correct indentation When I save the .java file, those actions are not applied... is this a bug? Found this that might be related:https://bugs.eclipse.org/bugs/show_bug.cgi?id=350475
0
1,047,112
06/26/2009 02:48:03
2,635
08/23/2008 19:46:51
13,162
192
Does anyone else get worn out using Scrum, finishing sprint after sprint?
I'm with a pretty small startup and we started using a form of a Scrum/Agile development cycle. In many ways I enjoy Scrum. We have relatively short sprints (2 weeks). I like the Burndown Chart to track the teams progress, I like the Feature Board so I always know what I should be doing next. It feels good taking down a feature's card from the board, completing it and then putting it in the burn down pile. However, we are now entering in our 18th Sprint release cycle and I'm starting to feel a little burnt out. It isn't that I don't like job or my co-workers, it is just that these sprints are... well, sprints. From start to finish I literally feel like I'm racing against the clock to maintain our development velocity. When we are done with the sprint we spend one day planning the next sprints feature set and estimates and then off we go again. For people who work in a mature Agile/Scrum development process, is this normal? Or are we missing something? Sometimes I just feel like I need some unassigned, untracked time to get done some minor things, to clear my head and to fix some trivial things that aren't normally included in a sprint.
scrum
agile
null
null
null
12/12/2011 17:36:09
not constructive
Does anyone else get worn out using Scrum, finishing sprint after sprint? === I'm with a pretty small startup and we started using a form of a Scrum/Agile development cycle. In many ways I enjoy Scrum. We have relatively short sprints (2 weeks). I like the Burndown Chart to track the teams progress, I like the Feature Board so I always know what I should be doing next. It feels good taking down a feature's card from the board, completing it and then putting it in the burn down pile. However, we are now entering in our 18th Sprint release cycle and I'm starting to feel a little burnt out. It isn't that I don't like job or my co-workers, it is just that these sprints are... well, sprints. From start to finish I literally feel like I'm racing against the clock to maintain our development velocity. When we are done with the sprint we spend one day planning the next sprints feature set and estimates and then off we go again. For people who work in a mature Agile/Scrum development process, is this normal? Or are we missing something? Sometimes I just feel like I need some unassigned, untracked time to get done some minor things, to clear my head and to fix some trivial things that aren't normally included in a sprint.
4
6,210,259
06/02/2011 04:10:53
887,872
04/20/2011 06:05:51
33
1
Access data from my table of sqlserver in asp.net
i am designing a project in .net 4.0 using mvc3. my table name "logindata" is stored in sql server 2008. i want to access rows of that table in my project model class. So please suggest me what connction string i should use and where i should specify table name to access data from that table.?
asp.net
null
null
null
null
06/02/2011 10:32:48
too localized
Access data from my table of sqlserver in asp.net === i am designing a project in .net 4.0 using mvc3. my table name "logindata" is stored in sql server 2008. i want to access rows of that table in my project model class. So please suggest me what connction string i should use and where i should specify table name to access data from that table.?
3
10,295,958
04/24/2012 10:16:47
478,338
10/12/2010 14:44:16
71
0
Google Chrome - Incognito
When ever I open my Incognito in Chrome I need few sites to automatically loaded. Is there any options to do ?
google-chrome
incognito-mode
null
null
null
04/25/2012 14:15:13
off topic
Google Chrome - Incognito === When ever I open my Incognito in Chrome I need few sites to automatically loaded. Is there any options to do ?
2
9,553,516
03/04/2012 08:41:28
311,237
04/07/2010 17:48:00
8
0
send end recive UDP from Web page
im newbie in send end recive UDP things.. i need to send (maybe receive) some data from PHP web page to local software. this software can recive and send data via UDP 1987 port. is there a way to do? javascript activeX or flash library or something Software= VOIP SoftPhone PHP Web Page = CRM all I wanted was actually make a button to call and if possible recive length of the call Sory for my awful english..
php
flash
udp
activex
null
null
open
send end recive UDP from Web page === im newbie in send end recive UDP things.. i need to send (maybe receive) some data from PHP web page to local software. this software can recive and send data via UDP 1987 port. is there a way to do? javascript activeX or flash library or something Software= VOIP SoftPhone PHP Web Page = CRM all I wanted was actually make a button to call and if possible recive length of the call Sory for my awful english..
0
6,819,243
07/25/2011 16:21:09
678,061
03/26/2011 13:47:37
181
16
JScrollPane "jumping" when scrollbars start being used
Sorry, this is a long piece of sample code below, but here's the issue: I have a background that I'm actively drawing (I could probably be smart and draw it once and just scale it, but this shows the problem just as well). You can use the mouse wheel to zoom in and out on the image. The idea is to do a "google map" zoom where it zooms under the mouse pointer. What I've noticed is that it doesn't seem to actuall behave until the image is big enough to use both scroll bars. Until then, you get the image simply getting bigger, but locked to the origin. The "correct" behavior should be that the viewposition is moved, even though the scrollbars aren't yet being utilized by an oversized image. I'm not sure how to get around this (or if this is correct and expected) without drawing a much larger background behind the image so it more than fills the viewport. It "jumps" after one or the other scroll bars engages due to (I think) the same issue. Thoughts? package com.hostigr.raw.io.client.gui; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Point; import java.awt.RenderingHints; import java.awt.event.MouseWheelEvent; import java.awt.event.MouseWheelListener; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JViewport; public class TestFrame extends JFrame { public static void main(String[] arg) { new TestFrame(); } public TestFrame() { initComponents(); setVisible(true); } private void initComponents() { setLayout(new BorderLayout()); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setSize(600, 600); setPreferredSize(new Dimension(600, 600)); add(new TopPanel()); } private class TopPanel extends JPanel { JScrollPane scrollPane; public TopPanel() { setPreferredSize(new Dimension(500,500)); scrollPane = new JScrollPane(new InteriorPanel()); scrollPane.setPreferredSize(new Dimension(500,500)); scrollPane.getVerticalScrollBar().setPreferredSize(new Dimension(10,490)); scrollPane.getHorizontalScrollBar().setPreferredSize(new Dimension(490,10)); scrollPane.setWheelScrollingEnabled(false); scrollPane.setHorizontalScrollBarPolicy( JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); scrollPane.setVerticalScrollBarPolicy( JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); add(scrollPane); } } private class InteriorPanel extends JPanel { private double scale = 10.0; private final double scaleModifier = 0.1; private final int width = 10; private Point loc = new Point(0,0); private final int SIZE = 10; public InteriorPanel() { super(true); setPreferredSize(new Dimension((int)(scale * width * SIZE), (int)(scale * width * SIZE))); this.addMouseWheelListener(new MapMouseWheelListener()); } @Override public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2D = (Graphics2D) g; g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2D.scale(scale,scale); for (int row = 0; row <= SIZE; row++) { for (int col = 0; col < SIZE; col++) { if ((col + row) % 2 == 0) { g2D.setColor(Color.white); } else { g2D.setColor(Color.black); } g2D.fillRect(col * width, row * width, width, width); } } } private void incrementScale(int notches) { double modifier = 0; double prevScale = scale; if (notches != 0) { modifier = 1.0 + -notches / Math.abs(notches) * scaleModifier; } scale = scale * Math.pow(modifier, Math.abs(notches)); /*if (scale * width < 1) { scale = 1.0/width; } else if (scale * width * 3 > parentHeight || scale * width * 3 > parentWidth) { if (parentHeight > parentWidth) { scale = parentWidth / 3.0 / width; } else { scale = parentHeight / 3.0 / width; } } else if (scale * width * SIZE < parentWidth) { scale = parentWidth / (double)SIZE / width; } else if (scale * width * SIZE < parentHeight) { scale = parentHeight / (double)SIZE / width; }*/ this.repaint(); setPreferredSize(new Dimension((int)(scale * width * SIZE), (int)(scale * width * SIZE))); JViewport viewport = ((JViewport)(getParent().getParent().getComponent(0))); Point orig = viewport.getViewPosition(); viewport.setViewPosition(new Point( orig.x - (int)Math.round(loc.x*(1 - scale/prevScale)), orig.y - (int)Math.round(loc.y*(1 - scale/prevScale)))); System.out.println(orig + "\n " + loc + "\n " + (1 - scale / prevScale)); revalidate(); } private class MapMouseWheelListener implements MouseWheelListener { @Override public void mouseWheelMoved(MouseWheelEvent e) { loc = e.getPoint(); incrementScale(e.getWheelRotation()); } } } }
java
swing
null
null
null
null
open
JScrollPane "jumping" when scrollbars start being used === Sorry, this is a long piece of sample code below, but here's the issue: I have a background that I'm actively drawing (I could probably be smart and draw it once and just scale it, but this shows the problem just as well). You can use the mouse wheel to zoom in and out on the image. The idea is to do a "google map" zoom where it zooms under the mouse pointer. What I've noticed is that it doesn't seem to actuall behave until the image is big enough to use both scroll bars. Until then, you get the image simply getting bigger, but locked to the origin. The "correct" behavior should be that the viewposition is moved, even though the scrollbars aren't yet being utilized by an oversized image. I'm not sure how to get around this (or if this is correct and expected) without drawing a much larger background behind the image so it more than fills the viewport. It "jumps" after one or the other scroll bars engages due to (I think) the same issue. Thoughts? package com.hostigr.raw.io.client.gui; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Point; import java.awt.RenderingHints; import java.awt.event.MouseWheelEvent; import java.awt.event.MouseWheelListener; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JViewport; public class TestFrame extends JFrame { public static void main(String[] arg) { new TestFrame(); } public TestFrame() { initComponents(); setVisible(true); } private void initComponents() { setLayout(new BorderLayout()); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setSize(600, 600); setPreferredSize(new Dimension(600, 600)); add(new TopPanel()); } private class TopPanel extends JPanel { JScrollPane scrollPane; public TopPanel() { setPreferredSize(new Dimension(500,500)); scrollPane = new JScrollPane(new InteriorPanel()); scrollPane.setPreferredSize(new Dimension(500,500)); scrollPane.getVerticalScrollBar().setPreferredSize(new Dimension(10,490)); scrollPane.getHorizontalScrollBar().setPreferredSize(new Dimension(490,10)); scrollPane.setWheelScrollingEnabled(false); scrollPane.setHorizontalScrollBarPolicy( JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); scrollPane.setVerticalScrollBarPolicy( JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); add(scrollPane); } } private class InteriorPanel extends JPanel { private double scale = 10.0; private final double scaleModifier = 0.1; private final int width = 10; private Point loc = new Point(0,0); private final int SIZE = 10; public InteriorPanel() { super(true); setPreferredSize(new Dimension((int)(scale * width * SIZE), (int)(scale * width * SIZE))); this.addMouseWheelListener(new MapMouseWheelListener()); } @Override public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2D = (Graphics2D) g; g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2D.scale(scale,scale); for (int row = 0; row <= SIZE; row++) { for (int col = 0; col < SIZE; col++) { if ((col + row) % 2 == 0) { g2D.setColor(Color.white); } else { g2D.setColor(Color.black); } g2D.fillRect(col * width, row * width, width, width); } } } private void incrementScale(int notches) { double modifier = 0; double prevScale = scale; if (notches != 0) { modifier = 1.0 + -notches / Math.abs(notches) * scaleModifier; } scale = scale * Math.pow(modifier, Math.abs(notches)); /*if (scale * width < 1) { scale = 1.0/width; } else if (scale * width * 3 > parentHeight || scale * width * 3 > parentWidth) { if (parentHeight > parentWidth) { scale = parentWidth / 3.0 / width; } else { scale = parentHeight / 3.0 / width; } } else if (scale * width * SIZE < parentWidth) { scale = parentWidth / (double)SIZE / width; } else if (scale * width * SIZE < parentHeight) { scale = parentHeight / (double)SIZE / width; }*/ this.repaint(); setPreferredSize(new Dimension((int)(scale * width * SIZE), (int)(scale * width * SIZE))); JViewport viewport = ((JViewport)(getParent().getParent().getComponent(0))); Point orig = viewport.getViewPosition(); viewport.setViewPosition(new Point( orig.x - (int)Math.round(loc.x*(1 - scale/prevScale)), orig.y - (int)Math.round(loc.y*(1 - scale/prevScale)))); System.out.println(orig + "\n " + loc + "\n " + (1 - scale / prevScale)); revalidate(); } private class MapMouseWheelListener implements MouseWheelListener { @Override public void mouseWheelMoved(MouseWheelEvent e) { loc = e.getPoint(); incrementScale(e.getWheelRotation()); } } } }
0
11,119,600
06/20/2012 12:30:41
436,649
09/01/2010 06:16:48
51
0
WCF ria Domain service does not show available context
I am new to WCF RIA development. I have created a silverlight 4 application with WCF ria support. Then I have created ADO.Net entity data model based on a local database file. Now when I am going to create a Domain service class the dropdown below the "available context classes" is empty and it does not show the names of tables from the datasource. Am I missing any step here or is something not installed properly. I am using VS 2010 & Sql server Express 2008. Thanks in advance
wcf
data
entity
ria
null
null
open
WCF ria Domain service does not show available context === I am new to WCF RIA development. I have created a silverlight 4 application with WCF ria support. Then I have created ADO.Net entity data model based on a local database file. Now when I am going to create a Domain service class the dropdown below the "available context classes" is empty and it does not show the names of tables from the datasource. Am I missing any step here or is something not installed properly. I am using VS 2010 & Sql server Express 2008. Thanks in advance
0
9,992,938
04/03/2012 12:08:09
1,136,878
01/08/2012 09:03:35
1
0
Is there any paper compare mysql fulltext search with mssql fulltext search?
I have studied mysql fulltext search's syntax, performance, function, limitations, algorithm, architecture.. and I should compare mysql fulltext search with mssql fulltext search? If not, I would go to msdn! can someone give me some advice or url? thank you!
mysql
sql-server
database
fulltext
null
04/04/2012 13:01:00
off topic
Is there any paper compare mysql fulltext search with mssql fulltext search? === I have studied mysql fulltext search's syntax, performance, function, limitations, algorithm, architecture.. and I should compare mysql fulltext search with mssql fulltext search? If not, I would go to msdn! can someone give me some advice or url? thank you!
2
9,569,025
03/05/2012 15:15:05
1,250,123
03/05/2012 15:00:20
1
0
visual studio --"object reference not set to an instant of object" error
"object reference not set to an instant of object" error while creating a new project.how to set the problem.I need to start a new project on windows phone please respond quickly if u know how to fix this.
vb.net
null
null
null
null
03/06/2012 03:36:19
not a real question
visual studio --"object reference not set to an instant of object" error === "object reference not set to an instant of object" error while creating a new project.how to set the problem.I need to start a new project on windows phone please respond quickly if u know how to fix this.
1
11,510,727
07/16/2012 18:55:55
1,529,669
07/16/2012 17:56:47
1
0
Multiple Comboboxes in a web page with different behaviors
I have 2 jquery combboxes in a webpage.One that has options to sort the messages by date and category.The other combobox has options to delete the message,mark as read and unread. <select id="List1" class="combobox"> <option value=""></option> <option value="Delete">Delete </option> <option value="Mark Read">Mark Read </option> <option value="Mark Unread">Mark Unread </option> </select> <select id="List2" class="combobox"> <option value="Application">Application </option> <option value="Category">Category </option> <option value="Date" selected="selected">Date </option> </select> My question here is, I want the menu to default to an empty space after the change event is performed on the combobox with id="list1" i.e the input label should be empty.But the other combobox(List1) should retain the value of whats selected (Date when it is initially loaded);
jquery
html
null
null
null
07/18/2012 17:51:52
too localized
Multiple Comboboxes in a web page with different behaviors === I have 2 jquery combboxes in a webpage.One that has options to sort the messages by date and category.The other combobox has options to delete the message,mark as read and unread. <select id="List1" class="combobox"> <option value=""></option> <option value="Delete">Delete </option> <option value="Mark Read">Mark Read </option> <option value="Mark Unread">Mark Unread </option> </select> <select id="List2" class="combobox"> <option value="Application">Application </option> <option value="Category">Category </option> <option value="Date" selected="selected">Date </option> </select> My question here is, I want the menu to default to an empty space after the change event is performed on the combobox with id="list1" i.e the input label should be empty.But the other combobox(List1) should retain the value of whats selected (Date when it is initially loaded);
3
9,281,685
02/14/2012 17:46:47
655,066
03/11/2011 09:06:48
266
0
good sites for UML learning/refrence
After searching for hours in internet i am not able find sites which gives good material for UML reference. can any body suggest which site/book is good for UML reference?
uml
null
null
null
null
02/16/2012 00:54:01
not constructive
good sites for UML learning/refrence === After searching for hours in internet i am not able find sites which gives good material for UML reference. can any body suggest which site/book is good for UML reference?
4
9,011,560
01/25/2012 22:47:24
1,048,576
11/15/2011 22:25:03
3
0
Integrating PHP MVC application into a website
I have searched and searched for an answer to this sort of over-arching question, but haven't come across and answer. I was hoping I could get some help here. I have an application I'm building that is sort of a hybrid. It's probably a weird way to do it, but I want to have MVC organization, with the look and feel of the website it's going into. Here's a little background: - I'm not using any frameworks - The application is structured as such: /MyLibrary -/MyApplication --/controllers ---/<controller files here> --/models ---/<model files here> --/views ---/<view files here> -/Filesystem (a library I have for myself for using the file system) -/OtherDependenciesForMyApplication - My website is structured as such: /MyWebsiteFolder -/include -/scripts -/webroot --/index.php --/<other folders and files> --/myapplication ---/<this is where I would like to go for my application to be accessed> I am sort of developing my views to be part of the page that the website displays. For example, myview.php will contain the content that will be displayed. It will be wrapped by /MyWebsiteFolder/webroot/myapplication/index.php. So, the application itself isn't made to be standalone. It's made to work off of the website's authentication system and use the website's CSS. What suggestions do you have for me for deploying my application in this manner, while keeping my Git repositories for the website and the application separate. If you really, really have nothing to say to help me with this specific problem, please suggest another way to do it that would use the website's authentication, get me the look and feel of being in the website, without recreating the entire website's styles in the application. Thanks in advance for any help.
php
mvc
web-applications
integration
null
01/27/2012 14:41:42
not constructive
Integrating PHP MVC application into a website === I have searched and searched for an answer to this sort of over-arching question, but haven't come across and answer. I was hoping I could get some help here. I have an application I'm building that is sort of a hybrid. It's probably a weird way to do it, but I want to have MVC organization, with the look and feel of the website it's going into. Here's a little background: - I'm not using any frameworks - The application is structured as such: /MyLibrary -/MyApplication --/controllers ---/<controller files here> --/models ---/<model files here> --/views ---/<view files here> -/Filesystem (a library I have for myself for using the file system) -/OtherDependenciesForMyApplication - My website is structured as such: /MyWebsiteFolder -/include -/scripts -/webroot --/index.php --/<other folders and files> --/myapplication ---/<this is where I would like to go for my application to be accessed> I am sort of developing my views to be part of the page that the website displays. For example, myview.php will contain the content that will be displayed. It will be wrapped by /MyWebsiteFolder/webroot/myapplication/index.php. So, the application itself isn't made to be standalone. It's made to work off of the website's authentication system and use the website's CSS. What suggestions do you have for me for deploying my application in this manner, while keeping my Git repositories for the website and the application separate. If you really, really have nothing to say to help me with this specific problem, please suggest another way to do it that would use the website's authentication, get me the look and feel of being in the website, without recreating the entire website's styles in the application. Thanks in advance for any help.
4
3,335,482
07/26/2010 13:58:28
402,338
07/26/2010 13:58:27
1
0
which graduate course better for getting entry level jobs- MS CS or MS MIS
I have no work experience and probably will have none when i graduate(unless i get an internship). i want to get into business later in my courier like a MBA. so now i'm confused on which course to take. i like programming fine enough. but i really want to make a lot of money which i figure comes in the business side... but first i need to get a job after i graduate in MS. hence my dilemma which course will guarantee a job after graduation with no work experience and a decent salary..
ms
cs
null
null
null
07/28/2010 01:45:39
off topic
which graduate course better for getting entry level jobs- MS CS or MS MIS === I have no work experience and probably will have none when i graduate(unless i get an internship). i want to get into business later in my courier like a MBA. so now i'm confused on which course to take. i like programming fine enough. but i really want to make a lot of money which i figure comes in the business side... but first i need to get a job after i graduate in MS. hence my dilemma which course will guarantee a job after graduation with no work experience and a decent salary..
2
4,804,401
01/26/2011 12:10:01
587,387
01/24/2011 11:05:59
33
2
Reporting true game scores in Flash & PHP
HI, Im making a flash game and just wondering, how can I protect the ingame scores from being hacked ? For the moment im using a random number, which is set on the server and sent to the client, then using a hashing function which will hash 'score+randNumber' (a bit more complex, but the same idea), then i send the resulting score and the hash to the server (obviously logging attempted cheats). This so far works, but it is still easy to hack the score by decompiling the flash and finding out what the hashing formula is. Is there any other way that the scores can be transmitted to the server with little or no possibility of hacking?
php
flash
security
variables
null
null
open
Reporting true game scores in Flash & PHP === HI, Im making a flash game and just wondering, how can I protect the ingame scores from being hacked ? For the moment im using a random number, which is set on the server and sent to the client, then using a hashing function which will hash 'score+randNumber' (a bit more complex, but the same idea), then i send the resulting score and the hash to the server (obviously logging attempted cheats). This so far works, but it is still easy to hack the score by decompiling the flash and finding out what the hashing formula is. Is there any other way that the scores can be transmitted to the server with little or no possibility of hacking?
0
8,291,023
11/28/2011 02:57:27
1,059,023
11/22/2011 03:35:26
1
0
Access denied to C:\program file\myapplicationfolder\
I am tring to save xml file to C:\Program file\MyApplicationFolder\my.xml but access denied error was occurred how can i do that please help me !
c#
.net
winforms
null
null
11/28/2011 07:11:25
not a real question
Access denied to C:\program file\myapplicationfolder\ === I am tring to save xml file to C:\Program file\MyApplicationFolder\my.xml but access denied error was occurred how can i do that please help me !
1
6,163,159
05/28/2011 17:16:04
774,519
05/28/2011 17:16:04
1
0
Dis able a jquery element on a web page
Hi i am building a jquery functionality a close friend suggested that there should a button on the jquery element itself to switch it off and rather the whole thing should shrink to a single button on the web page but i am unable to do so please help any help appreciated
jquery-ui
null
null
null
null
05/30/2011 19:25:01
not a real question
Dis able a jquery element on a web page === Hi i am building a jquery functionality a close friend suggested that there should a button on the jquery element itself to switch it off and rather the whole thing should shrink to a single button on the web page but i am unable to do so please help any help appreciated
1
8,238,557
11/23/2011 07:26:03
1,049,378
11/16/2011 09:53:59
21
0
How to call a class that is responsible for sending and reading messages?
I'm having a class that doesn't send and reads messages itself but calls others classes to do that. The class is more responsible for the right proccess flow. E.g. it has a method like public void sendConnect() { comm.connect(); Message message = MessageBuilder.getMessage(Data data); comm.send(message); waitForResponse(); } It aswell has a method that reads the Answer. So it does Sending and Reading. public Message readAnswer() { Message answer = buffer.getLastMessage(); return answer; } How would you call such a class? Communicator? ProtocolImpl?
java
class
name
null
null
11/23/2011 08:41:07
not constructive
How to call a class that is responsible for sending and reading messages? === I'm having a class that doesn't send and reads messages itself but calls others classes to do that. The class is more responsible for the right proccess flow. E.g. it has a method like public void sendConnect() { comm.connect(); Message message = MessageBuilder.getMessage(Data data); comm.send(message); waitForResponse(); } It aswell has a method that reads the Answer. So it does Sending and Reading. public Message readAnswer() { Message answer = buffer.getLastMessage(); return answer; } How would you call such a class? Communicator? ProtocolImpl?
4
7,362,542
09/09/2011 13:42:19
602,257
02/03/2011 21:21:02
467
8
Dismatching dimensions when trying to adjust the width and height
I haven't got the right dimensions for my picture when i try to adjust the width and height, nder the `image menu->image size`, i try to give dimensions to my picture of 640 as width and 960 as height, however, i couldn't do that, here is what i got : ![enter image description here][1] [1]: http://i.stack.imgur.com/nvrGX.png I try to export my picture as PNG, but the dimensions are automatically given when just adjust either the height or the width, so i didn't got the right one that i need.
photoshop
null
null
null
null
12/12/2011 19:50:09
off topic
Dismatching dimensions when trying to adjust the width and height === I haven't got the right dimensions for my picture when i try to adjust the width and height, nder the `image menu->image size`, i try to give dimensions to my picture of 640 as width and 960 as height, however, i couldn't do that, here is what i got : ![enter image description here][1] [1]: http://i.stack.imgur.com/nvrGX.png I try to export my picture as PNG, but the dimensions are automatically given when just adjust either the height or the width, so i didn't got the right one that i need.
2
4,709,319
01/17/2011 01:35:18
273,122
12/04/2009 03:32:25
79
4
cakephp plugin to make URL SEO friendly
How do I make cakephp website URL SEO friendly? Is there a plugin available for cakephp 1.2.6
cakephp
seo
null
null
null
null
open
cakephp plugin to make URL SEO friendly === How do I make cakephp website URL SEO friendly? Is there a plugin available for cakephp 1.2.6
0
6,362,696
06/15/2011 18:44:55
711,129
04/16/2011 12:26:09
92
6
Javascript, for loop will not work
var a=0; setTimeout (function () { animatedDraw(context, 20+32*level[0],20*0, textArray[0]); }, timeArray[0]); setTimeout (function () { animatedDraw(context, 20+32*level[1],20*1, textArray[1]); }, timeArray[1]); setTimeout (function () { animatedDraw(context, 20+32*level[2],20*2, textArray[2]); }, timeArray[2]); setTimeout (function () { animatedDraw(context, 20+32*level[3],20*3, textArray[3]); }, timeArray[3]); setTimeout (function () { animatedDraw(context, 20+32*level[4],20*4, textArray[4]); }, timeArray[4]); setTimeout (function () { animatedDraw(context, 20+32*level[5],20*5, textArray[5]); }, timeArray[5]); for (a=0; a<6; a++) setTimeout (function () { animatedDraw(context, 20+32*level[a],20*0, textArray[a]); }, timeArray[a]); The first part of my code is the part that works. The second part does not show up. I am drawing in a canvas (HTML 5), but when I popped six alert boxes, the alert boxed showed. Am I doing something very stupid wrong? Thanks in advance
javascript
arrays
for-loop
null
null
null
open
Javascript, for loop will not work === var a=0; setTimeout (function () { animatedDraw(context, 20+32*level[0],20*0, textArray[0]); }, timeArray[0]); setTimeout (function () { animatedDraw(context, 20+32*level[1],20*1, textArray[1]); }, timeArray[1]); setTimeout (function () { animatedDraw(context, 20+32*level[2],20*2, textArray[2]); }, timeArray[2]); setTimeout (function () { animatedDraw(context, 20+32*level[3],20*3, textArray[3]); }, timeArray[3]); setTimeout (function () { animatedDraw(context, 20+32*level[4],20*4, textArray[4]); }, timeArray[4]); setTimeout (function () { animatedDraw(context, 20+32*level[5],20*5, textArray[5]); }, timeArray[5]); for (a=0; a<6; a++) setTimeout (function () { animatedDraw(context, 20+32*level[a],20*0, textArray[a]); }, timeArray[a]); The first part of my code is the part that works. The second part does not show up. I am drawing in a canvas (HTML 5), but when I popped six alert boxes, the alert boxed showed. Am I doing something very stupid wrong? Thanks in advance
0
4,680,770
01/13/2011 13:53:40
412,106
08/05/2010 15:16:56
168
11
MySQL is turning ™ into ª?
I'm exporting an excel file into a CSV and then uploading to a MySQL database, but every entry that has a ™ (trademark) turns into a small a (ª). The database is set to utf8_unicode_ci, as is each row. Any ideas why this is happening still?
php
mysql
character-encoding
null
null
null
open
MySQL is turning ™ into ª? === I'm exporting an excel file into a CSV and then uploading to a MySQL database, but every entry that has a ™ (trademark) turns into a small a (ª). The database is set to utf8_unicode_ci, as is each row. Any ideas why this is happening still?
0
8,821,883
01/11/2012 15:28:25
838,423
07/11/2011 07:30:26
1
0
Should I use Python or C# for LIMS (Laboratory Information Management System)?
I am building a LIMS system but I am confused weather I should use python or C#. I am familiar with C# but I've just started learning python. It will be a standalone desktop application with entry forms and backend connectivity with the database. And also suggest which framework and IDE should I use for GUI when programming in python. Thanks :)
c#
python
null
null
null
01/11/2012 15:33:39
not constructive
Should I use Python or C# for LIMS (Laboratory Information Management System)? === I am building a LIMS system but I am confused weather I should use python or C#. I am familiar with C# but I've just started learning python. It will be a standalone desktop application with entry forms and backend connectivity with the database. And also suggest which framework and IDE should I use for GUI when programming in python. Thanks :)
4
3,784,467
09/24/2010 05:35:56
430,102
08/24/2010 22:46:05
51
0
Division by Zero Errors
Mann i have a problem with this question from my professor. Here is the question: Write the definition of a function typing_speed , that receives two parameters. The first is the number of words that a person has typed (an int greater than or equal to zero) in a particular time interval. The second is the length of the time interval in seconds (an int greater than zero). The function returns the typing speed of that person in words per minute (a float ). Here is my code: def typing_speed(num_words,time_interval): if(num_words >= 0 and time_interval > 0): factor = float(60 / time_interval) print factor return float(num_words/(factor)) I know that the "factor" is getting assigned 0 because its not being rounded properly or something. I dont know how to handle these decimals properly. Float isnt doing anything apparently. Any help is appreciated, thankyou.
python
function
float
decimal
division
null
open
Division by Zero Errors === Mann i have a problem with this question from my professor. Here is the question: Write the definition of a function typing_speed , that receives two parameters. The first is the number of words that a person has typed (an int greater than or equal to zero) in a particular time interval. The second is the length of the time interval in seconds (an int greater than zero). The function returns the typing speed of that person in words per minute (a float ). Here is my code: def typing_speed(num_words,time_interval): if(num_words >= 0 and time_interval > 0): factor = float(60 / time_interval) print factor return float(num_words/(factor)) I know that the "factor" is getting assigned 0 because its not being rounded properly or something. I dont know how to handle these decimals properly. Float isnt doing anything apparently. Any help is appreciated, thankyou.
0
5,209,707
03/06/2011 09:30:52
646,152
03/05/2011 16:13:51
16
1
I need some form of BMI Calculator
I need to develop some form of BMI calculator for part of a medical site I am working on. In Javascript preferably. Anyone?
php
javascript
null
null
null
03/06/2011 09:34:03
too localized
I need some form of BMI Calculator === I need to develop some form of BMI calculator for part of a medical site I am working on. In Javascript preferably. Anyone?
3