Id
int64
1.68k
75.6M
PostTypeId
int64
1
2
AcceptedAnswerId
int64
1.7k
75.6M
ParentId
int64
1.68k
75.6M
Score
int64
-60
3.16k
ViewCount
int64
8
2.68M
Body
stringlengths
1
41.1k
Title
stringlengths
14
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
1
CreationDate
stringlengths
23
23
LastActivityDate
stringlengths
23
23
LastEditDate
stringlengths
23
23
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
1
21.3M
Tags
list
5,830,477
1
5,832,011
null
1
2,284
I am trying to make a form with a border like the border on the Windows Vista volume control. The form would need to be resizeable as well. ![enter image description here](https://i.stack.imgur.com/FM8Ug.jpg) Thanks, giodamelio To be a little more clear about what I am looking for. Here is a form with the property set to false. ![enter image description here](https://i.stack.imgur.com/JeBvr.png) Here is a rough Photoshop of what I am looking for. ![enter image description here](https://i.stack.imgur.com/nQpc6.png)
Winforms border style
CC BY-SA 3.0
0
2011-04-29T09:42:06.857
2011-04-29T18:55:41.393
2011-04-29T10:53:00.337
375,847
375,847
[ "vb.net", "winforms", "formborderstyle" ]
5,830,503
1
5,857,153
null
155
81,074
I need to include a header graphic in all of my activities/views. The file with the header is called header.xml: ``` <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#0000FF" android:padding="0dip"> <ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/header" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margin="0dip" android:layout_marginTop="0dip" android:layout_marginBottom="0dip" android:padding="0dip" android:paddingTop="0dip" android:paddingBottom="0dip" android:layout_gravity="fill" android:background="#00FF00" /> </FrameLayout> ``` Note the `android:background="#00FF00"` (green), it's just visualisation purposes. I include them into my views like this: ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" style="@style/white_background"> <include layout="@layout/header" /> (...) ``` So, when I actually try it out, the result looks like the left image, instead of what it should look like (right): ![note the green border](https://i.stack.imgur.com/uC6hg.png) (1) This - the orange - part is the image/ImageView in question (2) The unloved green border. note: normally, the green area would be transparent - It's only green because I set the `background`. Note the green border around the image at the top; It's part of the ImageView and I just can't figure out why it is there or how I can get rid of it. It set all paddings and margins to 0 (but the result is the same when I omit them). The image is a 480x64px jpeg* and I put it in res/drawable (not in one of the `drawable-Xdpi` though). (* jpeg, because it seems I stumbled upon the old png gamma problem - at first I worked around the problem by making the green border the same orange as the picture, and the colors didn't match.) I tried it on my htc desire/2.2/Build 2.33.163.1 and on the emulator. Also I described the problem to someone in #android-dev; She could reproduce the problem but had no explanation either. build target is 1.6. update @tehgoose: this code yields the exact same top+bottom padded result. ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" style="@style/white_background"> <!-- <include layout="@layout/header" /> --> <ImageView android:src="@drawable/header" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#00FF00" android:layout_weight="0" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="8dip" android:layout_weight="1"> (... rest of the elements) </LinearLayout> </LinearLayout> ```
Unwanted padding around an ImageView
CC BY-SA 4.0
0
2011-04-29T09:45:34.253
2021-01-21T05:47:49.527
2018-07-04T11:39:27.297
8,770,663
88,070
[ "android", "user-interface", "imageview" ]
5,830,571
1
5,890,240
null
39
3,124
In this [video](https://www.youtube.com/watch?v=cPNkH-7PRTk), Rich Hickey introduced Clojure for Lisp programmers. At time 01:10:42, he talked about nil/false/end-of-sequence/'() among Clojure/Common Lisp/Scheme/Java. He said: "Scheme has true and false, but they are broken." ![slide](https://lh6.googleusercontent.com/_KGDZ8XNzwv8/TbqJeerCaHI/AAAAAAAAFVo/P_aWzrNq7zM/s400/Richhickey-ClojureForLispProgrammersPart1372.flv_snapshot_01.10.43_%5B2011.04.29_17.38.56%5D.jpg) I don't understand why he said that and why does he consider it's "broken"?
Why did father of Clojure say that Scheme's true/false are broken?
CC BY-SA 3.0
0
2011-04-29T09:53:09.937
2015-05-16T19:34:40.617
2015-05-16T19:34:40.617
336,184
46,090
[ "clojure", "null", "scheme", "common-lisp" ]
5,830,747
1
5,830,774
null
4
42,113
The image below shows a part of my Login form . The program works fine and I am able to login when I press the Enter Button. But I want to Login when I press My Enter Button (Return Button) on my Keyboard. How can I do this ? ![enter image description here](https://i.stack.imgur.com/IzLxl.png)
How to capture Enter Button Pressed Event
CC BY-SA 3.0
0
2011-04-29T10:14:22.080
2014-04-27T02:54:10.140
null
null
722,000
[ "vb.net", "winforms", "authentication" ]
5,830,964
1
5,831,026
null
1
98
Hello friends I am having following table structure of quote Table ![enter image description here](https://i.stack.imgur.com/UAWuM.png) I want to access all similar quotes (which have same author_id and category_id) for a particular _id(quoteId) Similar quotes means all columns of all those rows of this table of same category_id and same author_id. Two quotes can be considered as similar if their authors are same and category are same.
Getting similar rows from Database Table
CC BY-SA 3.0
0
2011-04-29T10:36:20.100
2011-09-21T07:59:45.860
2011-09-21T07:59:45.860
288,773
395,661
[ "mysql", "sql", "sql-server" ]
5,831,161
1
5,849,930
null
5
513
In context of the realization of a project I need to find the k-longest sequences in PHP. There are many ways to implement this - but which algorithm is the fastest for PHP? Which algorithm would you implement? (overview) Which one is most-efficient and dynamic (numbers, strings, etc)? (fast?, time for n-elems?) How would you implement it? (example) Thank you! --- I'm about to implement the ONISI k-nearest neightbour algorithm. The longest sequences are visualised in this schematic. ![The interaction history since t and the immediate history.](https://i.stack.imgur.com/LFqSh.png) This shematic gives a brief overview on the ONISI algorithm.![enter image description here](https://i.stack.imgur.com/YKFwW.png) The total/immediate-history-elements are strings representing a $state --> $action pattern. This means, considering the first 3 elements of schematic (1), data would be displayed, for instance, like: `$immediate_history = array( array( "s2" => "a2" ), array( "s3" => "a3" ), array( "s1" => "a1" ) [..] );` Still any questions about the problematic? Cheers!
Finding the k-longest sequences in an one-dimensional array?
CC BY-SA 3.0
0
2011-04-29T11:01:04.557
2011-05-01T17:06:23.510
2020-06-20T09:12:55.060
-1
263,033
[ "php", "algorithm", "math", "sequence", "n-dimensional" ]
5,831,182
1
null
null
0
182
Hi guys I Am developing the application in cocoas2d using the box 2d frame work but unfortunately i'm not able to restrict the gray ball in the half screen area of the image shown here i want that ball not to go opposite part of the screen I Have Used The b2Mousejoint For to move the ball around the screen b2PrismaticJointDef restrict on any particular axis But i want to restrict on the particular rect area of the screen ![image of my trouble](https://i.stack.imgur.com/heVXR.png)
mouse joint is not working to restrict the ball in the half part of the screen
CC BY-SA 3.0
null
2011-04-29T11:02:38.150
2011-11-11T07:36:30.563
null
null
730,776
[ "iphone", "cocos2d-iphone", "box2d-iphone", "physics-engine" ]
5,831,202
1
5,831,244
null
3
12,530
Hy!!! I want to make a small DB Demo. My Error is: `Schema 'TEST' does not exist` Picture: ![enter image description here](https://i.stack.imgur.com/SKb9v.png)
Java DB Schema 'TEST' does not exist
CC BY-SA 3.0
null
2011-04-29T11:05:00.650
2016-01-07T22:02:20.393
null
null
547,995
[ "java", "javadb" ]
5,831,253
1
5,831,272
null
1
180
So there is "�", the replacement character 0xFFFD, the symbol for a byte-sequence that is not represented as a character in Unicode (right?). Well, I wonder what 'is' this 'thing' actually, as I can't 'see'/'find' it in Windows' character table, neither searching for the symbol itself, nor searching for FFFD. But after all it is a character, right? So it should be in there. I am confused ... ![enter image description here](https://i.stack.imgur.com/OEg0f.gif)
Why is � not listed in the Windows character table?
CC BY-SA 3.0
null
2011-04-29T11:11:05.710
2011-04-29T11:13:03.483
null
null
562,440
[ "unicode" ]
5,831,382
1
5,831,426
null
15
35,197
I am looking at Apple's MapCallouts example for map annotations and callouts (==bubbles that appear when you click on a pin). Every annotation there has coordinates, title and subtitle. I would like to display subtitle in 2 lines, i tried with: ``` - (NSString *)subtitle { return @"Founded: June 29, 1776\nSecond line text"; } ``` but the text "Second line text" stays in one line and makes bubble wider.I get this: ![enter image description here](https://i.stack.imgur.com/VT4kG.png) I would also like to change image of the button to one of my own's, the code that sets the button is currently like this: ``` UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; ``` Any ideas? EDIT: I tried 7KV7's advice. Button change is successful, but i still cant get subtitles in 2 lines. My code: ``` MKPinAnnotationView* customPinView = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:BridgeAnnotationIdentifier] autorelease]; customPinView.pinColor = MKPinAnnotationColorPurple; customPinView.animatesDrop = YES; // Button UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; button.frame = CGRectMake(0, 0, 23, 23); button.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter; //UIEdgeInsets titleInsets = UIEdgeInsetsMake(7.0, -20.0, 7.0, 7.0); //button.titleEdgeInsets = titleInsets; [button setImage:[UIImage imageNamed:@"ic_phone_default.png"] forState:UIControlStateNormal]; //[button setImage:[UIImage imageNamed:@"ic_phone_selected.png"] forState:UIControlStateSelected]; [button setImage:[UIImage imageNamed:@"ic_phone_selected.png"] forState:UIControlStateHighlighted]; [button addTarget:self action:@selector(showDetails:) forControlEvents:UIControlEventTouchUpInside]; customPinView.rightCalloutAccessoryView = button; //two labels UIView *leftCAV = [[UIView alloc] initWithFrame:CGRectMake(0,0,50,50)]; //[leftCAV addSubview : button]; UILabel *l1=[[UILabel alloc] init]; l1.frame=CGRectMake(0, 15, 50, 50); l1.text=@"First line of subtitle"; l1.font=[UIFont fontWithName:@"Arial Rounded MT Bold" size:(10.0)]; UILabel *l2=[[UILabel alloc] init]; l2.frame=CGRectMake(0, 30, 50, 50); l2.text=@"Second line of subtitle"; l2.font=[UIFont fontWithName:@"Arial Rounded MT Bold" size:(10.0)]; [leftCAV addSubview : l1]; [leftCAV addSubview : l2]; customPinView.leftCalloutAccessoryView = leftCAV; //customPinView. customPinView.canShowCallout = YES; return customPinView; ``` I get this: ![enter image description here](https://i.stack.imgur.com/dZ9jV.png)
How to display 2 lines of text for subtitle of MKAnnotation and change the image for the button on the right?
CC BY-SA 3.0
0
2011-04-29T11:25:49.383
2019-01-02T03:34:43.990
2011-04-29T14:50:48.773
324,417
324,417
[ "iphone", "mkmapview", "mkannotation" ]
5,831,428
1
null
null
3
5,974
I have a zoom column chart with more then 200 categories in xAxis. Consequently, when it is in the initial state (scale 1:1), all these guys are shown under the X axis, and it's impossible to read anything even if I place them vertically. I need to zoom the chart to make the labels visible. Here's screenshot of the problem: ![enter image description here](https://i.stack.imgur.com/KgTsF.png) Here's my code: [http://jsfiddle.net/sherlock85/hJcQm/](http://jsfiddle.net/sherlock85/hJcQm/) Is it possible to adjust the concentration of the labels (perhaps change the step automatically) depending on a zoom level? I would really appreciate your help. Thanks, Andrzej
Highcharts problem - showing labels in zoomable chart
CC BY-SA 3.0
0
2011-04-29T11:31:03.943
2014-02-24T15:55:53.130
null
null
428,727
[ "charts", "highcharts", "label" ]
5,831,455
1
5,937,477
null
46
44,375
In my case: I have a TextBlock Binding to a property of type DateTime. I want it to be displayed as the Regional settings of the User says. ``` <TextBlock Text="{Binding Date, StringFormat={}{0:d}}" /> ``` I am setting Language property as [WPF XAML Bindings and CurrentCulture Display](https://stackoverflow.com/questions/991526/wpf-xaml-bindings-and-currentculture-display) says: ``` this.Language = XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag); ``` But with this line of code it just displays the text as the default format of CultureInfo with IetfLanguageTag of CurrentCulture says, not as the effective value selected in systems region settings says: (e.g. for "de-DE" is used instead of selected ) ![Region settings: not the default but yyy-MM-dd is used](https://i.stack.imgur.com/bosWa.png) Is there a way Binding uses the correct format without defining ConverterCulture on every single Binding? In code ``` string.Format("{0:d}",Date); ``` uses the right Culture settings. another way which doesn't work as desired (like this.Language = ... does): ``` xmlns:glob="clr-namespace:System.Globalization;assembly=mscorlib" ``` and ``` <Binding Source="{x:Static glob:CultureInfo.CurrentCulture}" Path="IetfLanguageTag" ConverterCulture="{x:Static glob:CultureInfo.InvariantCulture}" /> ```
Use "real" CultureInfo.CurrentCulture in WPF Binding, not CultureInfo from IetfLanguageTag
CC BY-SA 3.0
0
2011-04-29T11:33:01.113
2019-01-10T05:55:34.487
2017-05-23T12:10:03.420
-1
670,721
[ "c#", "wpf", "binding", "currentculture" ]
5,831,589
1
5,831,740
null
6
388
Which is oldest browser and shortest Screen Size of mobile which has Facility to surf Internet and still in use? I'm making a Mobile site for Older devices (Not for Smartphones), which are still in use. I'm testing on [Nokia 5130 Xpress Music mobile](http://www.fonearena.com/nokia-5130-xpressmusic_726.html) which has size of 240 x 320 pixels and Browser is Opera Mini (Version I don't know). Is it enough to test on this, these days or I should test on lower size than this and less capable browser than this? Any suggestion? ![enter image description here](https://i.stack.imgur.com/Nf8gc.jpg) Like in desktop we don't consider screen size lower than 1024 X 768 px and We have started to not to consider IE6, Firefox 2 and 3.0 etc.
Which is preferred oldest browser and shortest Screen Size of mobile to test website and which has Facility to surf Internet and still in use?
CC BY-SA 3.0
null
2011-04-29T11:47:40.703
2011-04-29T12:34:28.007
2011-04-29T11:57:07.360
84,201
84,201
[ "html", "css", "xhtml", "mobile-website" ]
5,831,738
1
null
null
0
323
How I can implement the following menu (also supports scrolling and animation for bar item). ![enter image description here](https://i.stack.imgur.com/QLg0x.png)
How can i implement animated and scrollable menu bar in iPhone
CC BY-SA 3.0
null
2011-04-29T12:01:10.947
2011-04-29T12:07:29.120
null
null
676,369
[ "iphone", "user-interface", "menu", "scrollable" ]
5,831,838
1
5,832,432
null
5
3,113
I have written the following code: ``` library(ggplot2) data <- structure(list(x = c(1L, 6L, 3L, 4L, 2L, 3L, 6L, 1L, 5L, 2L, 1L, 5L), y = c(1L, 7L, 5L, 6L, 3L, 4L, 6L, 2L, 5L, 6L, 5L, 2L ), year = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("2010", "2011"), class = "factor"), matching = structure(c(1L, 2L, 3L, 4L, 5L, 6L, 1L, 2L, 3L, 4L, 5L, 6L), .Label = c("person1", "person2", "person3", "person4", "person5", "person6"), class = "factor")), .Names = c("x", "y", "year", "matching"), row.names = c(NA, -12L), class = "data.frame") data$year <- factor(data$year) colors <- c("#4cb5ee", "#a0d099", "red") p <- ggplot(data, aes(x=x, y=y)) + geom_point(aes(colour=year), shape=16, size=6) + geom_line(aes(group=matching), arrow=arrow(length=unit(0.15,"cm")), colour="black", size=1) + xlab("x") + ylab("y") + scale_colour_manual("year", values=colors) + scale_x_continuous(limits=c(1,7), breaks=seq(1,7, by=1)) + scale_y_continuous(limits=c(1,7), breaks=seq(1,7, by=1)) print(p) ``` It gives the following output: ![plot](https://i.stack.imgur.com/WlJgM.jpg) I can't figure out why the arrow of the line is point sometimes at a point which refers to year=2010 and sometimes points at a point where year=2011. What I found out is that arrow takes several arguments: ``` arrow(angle = 30, length = unit(0.25, "inches"), ends = "last", type = "open") ``` So that I could say `ends="first"`. But I can't generalize that `ends` is always `first` or always `last`. I tried to add a column to my data.frame which has the information if the arrow should end first or last, but it didn't gives me the output I wanted. Every help is highly appreciated :-) Thanks in advance!
ggplot2 geom_line() should point at specified value
CC BY-SA 3.0
0
2011-04-29T12:11:27.963
2011-04-29T13:06:48.827
null
null
1,848,552
[ "r", "ggplot2" ]
5,832,046
1
5,832,099
null
2
334
I have lot of thumbnail and I want to show check box on images at left-top side as shown in image. I am displaying thumbnail images in Repeater. ![enter image description here](https://i.stack.imgur.com/LJIBo.png) How can I do this?
Show checkbox with image thumbnails
CC BY-SA 4.0
null
2011-04-29T12:31:47.567
2019-05-03T13:34:38.423
2019-05-03T13:34:38.423
1,033,581
450,339
[ "html", "css", "css-position" ]
5,832,202
1
5,832,720
null
0
118
I'm a complete novice in gui-programming and I'm looking for an easy way to visualize a data structure I have. I own another program that does a similar job and the component it uses seems like it would fulfill my purposes as well. So instead of testing out different components myself (Which would undoubtedly force me to learn a lot), I'm wondering if there's a fast way out of it. Is there anyway to find out what specific wpf/winform component a program is using without asking author/having source code access? Edit: Looks like this, the area it's in is scrollable horizontally/vertically. The objects on it are selectable, moveable and have actions associated with their right-click menu. I want to visualize an undirected graph and have the possibility to interact with the nodes graphically. Here's the control I'm talking about: ![weird object graph control thingie](https://i.stack.imgur.com/1E6nf.gif)
Is there a way to find out what winform/wpf components a program uses?
CC BY-SA 3.0
null
2011-04-29T12:45:09.733
2011-04-29T13:34:53.803
2011-04-29T13:27:35.187
null
148,550
[ "wpf", "winforms", "visual-studio" ]
5,832,248
1
5,832,341
null
1
122
Here is the layout I would like to make: ![Layout example](https://i.stack.imgur.com/cpsqX.jpg) 'input' is 70% width of the screen. and the 'second input' is 70% width of 'input'. 'button' is 30% width of 'input'. 'input' is in the middle of the screen. How can I do so? Thank you.
How to layout follow content using CSS?
CC BY-SA 3.0
null
2011-04-29T12:48:33.857
2011-04-29T13:20:24.313
2011-04-29T12:49:50.737
20,261
148,956
[ "html", "css", "layout" ]
5,832,353
1
5,832,608
null
2
6,032
When constructing filter in [Filter Editor](http://documentation.devexpress.com/#WindowsForms/CustomDocument2470), can i provide list of possible values ? ![enter image description here](https://i.stack.imgur.com/WPDol.jpg) Can I have here ComboBox with possible values instead of TextEdit ?
DevExpress Filter Editor : DropdownList
CC BY-SA 3.0
null
2011-04-29T12:58:40.447
2013-10-01T14:58:35.673
null
null
606,586
[ "c#", "winforms", "filter", "devexpress" ]
5,832,340
1
5,832,413
null
0
1,619
![enter image description here](https://i.stack.imgur.com/7tsET.png)friends, i have written following layout code and buttons to be displayed on screen equally but it not seems to work any one guide me what mistake am i doing? ``` ![<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <LinearLayout android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:background="@color/color_panel_background" > <ImageButton android:layout_height="wrap_content" android:id="@+id/currentLocation" android:layout_weight="1" android:layout_width="fill_parent" android:src="@drawable/current_location_icon" /> <ImageButton android:layout_height="wrap_content" android:id="@+id/searchCity" android:layout_weight="1" android:layout_width="fill_parent" android:src="@drawable/search_icon" /> <ImageButton android:layout_height="wrap_content" android:id="@+id/home" android:layout_weight="1" android:layout_width="fill_parent" android:src="@drawable/home_icon" /> </LinearLayout> </RelativeLayout>][2] ```
Android layout weight problem
CC BY-SA 3.0
null
2011-04-29T12:57:25.820
2013-08-16T04:03:02.183
null
null
249,991
[ "android", "layout" ]
5,832,596
1
null
null
2
73
Hello friends I am having following table structure of quote Table ![enter image description here](https://i.stack.imgur.com/3ROU1.png) I want to access all similar quotes (which have same author_id and category_id) for a particular _id(quoteId) Earlier Similar quotes means all columns of all those rows of this table of same category_id same author_id. Two quotes can be considered as similar if their authors are same and category are same. so I was using following query for this ``` SELECT `related_quote`.* FROM `quote` AS `main_quote` LEFT JOIN `quote` AS `related_quote` USING(`author_id`, `category_id`) WHERE `main_quote`.`_id` = QUOTE_ID ``` But now for some other requirement the definition of similar quotes changed slightly Similar quotes means all columns of all those rows of this table of same category_id same author_id. Two quotes can be considered as similar if their authors are same and category are same. Please help me to create the query for condition thanks in adv
Getting similar rows from Database Table
CC BY-SA 3.0
0
2011-04-29T13:20:30.147
2011-04-29T14:22:37.853
2011-04-29T14:22:37.853
105,264
395,661
[ "php", "mysql", "sql" ]
5,833,378
1
5,833,440
null
3
20,135
I have a textbox where a user is supposed to enter a date. How can I check whether the entered date is in the correct date format? > Like this: `02/02/2008` - `022/22/-1`- `2009/02/02`- `02/Jun/2015`- `02/abc/2010` (I don't want to use DateTimePicker or MonthCalender). EDIT 1 I tried it like this ``` Private Sub txtHireDate_Validated(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtHireDate.Validated Dim dateString As String = txtHireDate.Text Dim formats As String = "MM/dd/yyyy" Dim dateValue As DateTime If DateTime.TryParseExact(dateString, formats, New CultureInfo("en-US"), DateTimeStyles.None, dateValue) Then End If ``` But its showing some errors ![enter image description here](https://i.stack.imgur.com/Wh61A.png)
How to check whether the entered date is in the correct format?
CC BY-SA 3.0
0
2011-04-29T14:28:30.040
2011-04-29T15:27:51.987
2011-04-29T15:17:06.653
722,000
722,000
[ "vb.net", "winforms" ]
5,833,495
1
5,921,387
null
0
663
I recently migrated an old project that uses Three20 from Xcode 3.2 to Xcode 4, and after the transition, some really weird behavior occurs whenever I launch the application: whatever is the controller I open with the navigator, a blank view is presented to the screen. The funny things is, I am able to touch the UI elements that are supposed to be there (for example, in this screenshot view I can tap a text field and the keyboard gets presented). Has anyone got any idea of what's happening here? Please note that I haven't changed a single line of code from the working old version: I just migrated the project with ttmodule.py. ![Blank screen](https://i.stack.imgur.com/zQcG7.png)
Any controller that I open with TTNavigator results in a blank view
CC BY-SA 3.0
null
2011-04-29T14:39:22.117
2011-05-07T13:33:00.520
2020-06-20T09:12:55.060
-1
389,356
[ "iphone", "ios4", "xcode4", "three20", "ttnavigator" ]
5,833,658
1
5,833,857
null
1
697
Playing with Disqus for commenting, but the problem is that we have a Silverlight control for playing video right above the Disqus comments. Example page: [http://play.nimbushd.com/view/lfm7](http://play.nimbushd.com/view/lfm7) When an anonymous/not logged in user presses the "Post as..." button to post a comment, the Disqus guest/login div dialog pops up, but is behind the Silverlight control, preventing the user from proceeding any further. How can I either , or ? Edit: Screenshot of issue: ![Screenshot of Issue](https://i.stack.imgur.com/tjkjf.jpg)
Disqus popup div vs. Silverlight control Z-Order
CC BY-SA 3.0
null
2011-04-29T14:53:35.613
2011-04-29T15:12:21.580
2011-04-29T14:59:27.967
63,775
63,775
[ "html", "css", "silverlight", "disqus" ]
5,833,684
1
5,833,739
null
0
651
I have created a service which would show "Hello World" message when it starts.. The OnStart method of the service consists the following code: ``` protected override void OnStart(string[] args) { System.Windows.Forms.MessageBox.Show("Hello World"); } ``` The service is installed perfectly, but when I start the service I get the following error. > The RucService on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the performance Logs and Alert service. ![Error Message](https://i.stack.imgur.com/g3fM2.jpg) So it does not show the message Hello World. Why is this happening?
Why is my custom Windows service not doing its work?
CC BY-SA 3.0
null
2011-04-29T14:55:46.223
2011-09-09T11:12:12.733
2011-09-09T11:12:12.733
63,550
598,420
[ "c#", ".net", "service", "windows-services" ]
5,833,835
1
null
null
3
1,786
I am creating a custom button that needs to be able to glow to a varying degree ![diamonds](https://i.stack.imgur.com/flZDd.png) How would I use these pictures to make a button that 'glows' the diamond when it is pressed, and have this glow gradually fade back to inert state? I want to churn out several different colours of diamond as well... I am hoping to generate all different coloured diamonds from the same stock images presented here. I would like to get my head around the basic methods available, in enough detail that I can see each one through and make a decision which path to take... --- My tangled efforts so far... ( I will delete all of this, or move it into possibly several answers as a solution unfolds... ) I can see 3 potential solution paths: - it looks as though GL has everything it takes to get complete fine-grained control over the process, although functions exposed by core graphics come tantalisingly close, and that would save several hundred lines of code spread over a bunch of source files, which seems a bit ridiculous for such a basic task.- , and to accomplish the blending![chroma-key masking](https://i.stack.imgur.com/flE1y.png) documentation goes on to say > Anything underneath the unpainted samples, such as the current fill color or other drawing, shows through.so I can chroma-key mask the left image, setting {0,0,0} ie Black as the key. this at least secures a transparent background, now I have to work on making it yellow instead of grey. so maybe I could have started instead with setting a yellow back colour for my image context, then use some CGContextSetBlendMode(...) to imprint the diamond on the yellow, THEN use chroma-key masking to get a transparent background ok, this covers at least getting the basic unlit image on-screen now I could overlay the sparkly image, using some blend mode, maybe I could keep it in its current greyscale state, and that would just boost the colours of the original only problem with this is that it is a lot of heavy real-time blending so maybe I could pre-calculate every image in the animation... this is looking increasingly mucky...- if this allows me to set the blend mode to additive blending then I could just composite the glowing image over the original image with an appropriate Alpha setting.
iOS: Smooth button Glow effect by blending between images
CC BY-SA 3.0
0
2011-04-29T15:10:12.703
2011-06-15T04:34:44.547
2011-06-15T04:28:34.047
435,129
435,129
[ "ios", "image", "transition", "alphablending", "glow" ]
5,834,081
1
5,834,174
null
3
7,653
I'm using ListView component to display some saved profiles in my program, each profile has an icon and a title. So I used, the ListView with property set to (also groupping was applied) How I wan't to add some description text about the entries (not a tooltip). Can I do it like Windows Explorer does? ![Windows Explorer Tile view, item details](https://i.stack.imgur.com/SUHGY.png)
Show subitems in C# ListView when using Tile view
CC BY-SA 3.0
0
2011-04-29T15:33:21.727
2018-04-30T10:19:19.357
null
null
682,156
[ "c#", "listview" ]
5,834,164
1
5,834,247
null
1
713
I'm trying to query a few tables in our db that contains product data. It is a MSSQL 2005 database. The problem is its returning multiple rows for one product when I need it to only produce one row per product. Blow is the query and results I'm using. ``` SELECT ProductItem.sku, ProductItem.title, ProductItem.short_desc, ProductItem.long_desc, ProductItem.active, ProductItem.product_item_id, ProductCategory.category_desc, ProductCategoryMap.product_id, ProductCategory.active AS activecat, Product.adwords_label, ProductItem.item_price, ProductItem.sale_price FROM Product INNER JOIN ProductCategoryMap INNER JOIN ProductCategory ON ProductCategoryMap.product_category_id = ProductCategory.product_category_id ON Product.product_id = ProductCategoryMap.product_id FULL OUTER JOIN ProductItem ON Product.product_key = ProductItem.sku WHERE (ProductItem.active = 1) AND (ProductCategory.active = 1) ``` This returns the following results:![enter image description here](https://i.stack.imgur.com/uC0KU.png) I know the problem occurs because the product resides in multiple categories, but really I don't need every category its in, just one of them. So ideally just one product for every row returned I can't figure out how to make my query achieve that though. Can anyone help me out please?
select on one result from the query
CC BY-SA 3.0
null
2011-04-29T15:41:08.383
2011-04-29T16:02:15.013
null
null
322,572
[ "sql", "sql-server-2005", "tsql" ]
5,834,588
1
null
null
5
6,395
I have a user control ``` public partial class ButtonControl : UserControl ``` which has two controls of label and picturebox ``` this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.text = new System.Windows.Forms.Label(); ``` I have used this control in a windows form ``` this.appointmentButton = new DentalSoft.UI.Controls.ButtonControl(); ``` created an event ``` this.appointmentButton.Click += new System.EventHandler(this.appointmentButton_Click); ``` ![enter image description here](https://i.stack.imgur.com/cexzs.png) but the problem is, if i click on the image or the label inside of the control, the click event doesn't fire. I want to fire this click event no matter where the user clicks inside of the control. Is it possible?
Fire parent click event when child is clicked in windows form user control
CC BY-SA 3.0
null
2011-04-29T16:19:39.203
2018-12-06T17:43:25.400
null
null
326,597
[ "user-controls", "delegates", "event-handling", "click", "windows-forms-designer" ]
5,835,284
1
null
null
1
1,370
Ok I have a view that we will call homeView. When a certain button is pushed on homeView, a UIPopOverController is presented in the following way: ``` self.studyPicker = [[[StudyPickerController alloc] initWithStudyArray:self.studyArray ViewNum:butto.tag] autorelease]; UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:self.studyPicker]; _studyPicker.delegate = self; self.studyPickerPopover = [[[UIPopoverController alloc] initWithContentViewController:navController] autorelease]; [self.studyPickerPopover presentPopoverFromRect:CGRectMake(955,60, 22,10) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; ``` Which works great. I get a nice big popover controller that displays my tableView data just the way I need it. Just as an FYI, in my StudyPickerController viewDidLoad method, I am also setting this: ``` self.contentSizeForViewInPopover = CGSizeMake(1000.0, 610.0); ``` Which allows me to make the size of my tableView nice and big. is after I select a row in this first tableView. The navigationController pushes the new view just fine, but then the width of my popover controller gets cut in half! It doesn't make any sense! I have tried everything and can't figure out what is going on. In the new view, called ScreenView, it also has the same code in viewDidLoad: ``` self.contentSizeForViewInPopover = CGSizeMake(1000.0, 610.0); ``` that I've made but don't know what to do with is that if I take out the contentForSize code from the view in the tableView, or the one that I am trying to push to within the controller, when it pushes, it gets cut in half again, to the width of a standard popover controller you see in like Safari. But adding that code in makes it 2 times as wide, like there are two glued together or something, but it is still more narrow than the original width. I don't know what's going on here, hopefully someone can help me out! Thanks Here is an image of the width it should stay: ![enter image description here](https://i.stack.imgur.com/dU6hA.png) And then here it is after it pushes the new view: ![enter image description here](https://i.stack.imgur.com/WmoLa.png)
Problem with UIPopOverController shrinking in width when navigationController pushes a new view(screenshots included)
CC BY-SA 3.0
0
2011-04-29T17:29:02.897
2011-10-11T09:15:18.903
2011-04-29T17:55:12.173
647,565
647,565
[ "iphone", "cocoa-touch", "ipad", "width", "uipopovercontroller" ]
5,835,792
1
5,894,704
null
2
5,127
I'm training a machine learning algorithm, and wanted to make an avi to visualize the appearance of weights over time. I threw together something similar to: ``` aviobj = avifile( 'weights.avi' ); for jj = 1:whatever % do some training imagesc( ... ); % where '...' is stuff to reshape the weight matrix aviobj = addframe( aviobj, getframe ); end; aviobj = close( aviobj ); implay( 'weights.avi' ); ``` The problem is, the frames end up looking like this: ![enter image description here](https://i.stack.imgur.com/YgJbo.jpg) The numbers shouldn't have that orientation. This occurs with any avi I generate in matlab. Any suggestions? -Brian
Matlab: using avifile, addframe, getframe; the generated avi is contorted
CC BY-SA 3.0
0
2011-04-29T18:21:21.787
2012-06-29T05:37:29.630
2012-06-29T05:37:29.630
97,160
549,246
[ "matlab", "video", "screen-capture", "avi" ]
5,836,203
1
5,836,835
null
13
7,020
I am working on creating an online image editing tool.Looking for some refernce how can I add an image with white space on right side.For example see this image ![enter image description here](https://i.stack.imgur.com/4KDB0.jpg)
Java padding image
CC BY-SA 3.0
0
2011-04-29T18:58:17.540
2020-02-01T21:47:34.073
null
null
608,576
[ "java", "image-processing", "image-editing" ]
5,836,232
1
5,836,298
null
2
80
I have a bunch of data stored in a MySQL database with a column called 'ip', and each record in the IP table is an IPv4 address that has been INET_ATON'd. Example: ![enter image description here](https://i.stack.imgur.com/BgMTk.gif) I'd now like to read out data with a where clause that matches any record such that the IP resolves to something in this range: 10.0.0.0 - 10.0.255.255 Any ideas on how to tackle this?
MySQL Query to Read Out Data in IP Blocks?
CC BY-SA 3.0
null
2011-04-29T19:01:36.070
2011-04-29T21:30:48.977
null
null
102,635
[ "mysql", "sql", "networking" ]
5,836,303
1
5,836,501
null
2
1,230
We're converting to markdown, before we used an 'in-house' system, where both the image links and all data with it (e.g. alt) in another bracket. For example `{IMAGE LINK}[OPTIONAL ALT WITH OTHER DATA]` Now we are moving to markdown, (our data is stored as markdown in the database), I need to convert everything into markdown: So How can I turn all instances of `{LINK}[OPTIONAL DATA]` (square brackets not required, so some are just {}) into markdown equivalent: Basically, `{http://www.youtube.com/image.gif}[this is optional alt]` INTO `![alt](http://www.youtube.com/Image.gif)` I have the following so far, but do I deal with the optional [ALT DATA] tag? ``` if (preg_match_all('/\[(.*?)\]/i', $string, $matches, PREG_SET_ORDER)) { } ```
Preg_replace_all links to markdown format
CC BY-SA 3.0
null
2011-04-29T19:08:41.250
2011-04-29T20:30:08.293
2011-04-29T20:30:08.293
496,669
496,669
[ "php", "markdown" ]
5,836,481
1
5,836,584
null
1
2,281
I have a `UIToolbar` with a `UIBarButtonItem` that I created in Interface Builder. The `UIBarButtonItem` is a bordered button that contains a custom image. The button takes up the entire length of the toolbar. I have tried using different images, changing the width of the button... I don't know what else to do. It stretches across the entire toolbar. If I use one the provided "Identifiers" (camera, trash, compose...) the button appears a normal size. ![How it looks in Interface Builder](https://i.stack.imgur.com/PHMXS.png) How it looks in Interface Builder ![How it looks when I run it on the iPhone](https://i.stack.imgur.com/dhbL5.png) How it looks when I run it on the iPhone ### SOLUTION After some more tinkering, here is what I found: if I create a new UIToolbar and add custom image to the UIBarButtonItem, it works fine - but as soon as I connect the UIBarButtonItem to an IBOutlet, it goes large. I had to then specify the UIBarButtonItem's width in the code, via the IBOutlet.
UIBarButtonItem Taking Entire Width of UIToolbar
CC BY-SA 3.0
0
2011-04-29T19:25:24.610
2011-04-30T05:31:43.113
2011-04-30T01:33:17.007
300,129
300,129
[ "iphone", "width", "uibarbuttonitem", "uitoolbar" ]
5,837,067
1
5,837,176
null
0
14,146
I'm trying to make a JButton on a JDialog, but, the button will cover the entire JDialog, any help on this? This is what it looks like: ![enter image description here](https://i.stack.imgur.com/ntjDn.png) This is how I create the JDialog and the JButton: ``` class MenuStoreHandler implements ActionListener{ public void actionPerformed(ActionEvent e){ Dimension dim = Toolkit.getDefaultToolkit().getScreenSize(); int screenWidth = (int) dim.getWidth(); int screenHeight = (int) dim.getHeight(); JDialog g = new JDialog(); g.setTitle("The Store"); g.setSize(200, 200); g.setLocation(screenWidth / 2 - 150, screenHeight / 2 - 150); JButton b = new JButton("Buy"); b.addActionListener( new StoreItem1Handler() ); b.setVisible(true); g.add(b); g.setVisible(true); } } ``` I'm just going to post my full MrStan.class, here it is: ``` package Progress; public class MrStan extends JPanel{ private Timer timer = new Timer(); public static int points; static File h = new File("text.txt"); public ImageIcon bg = new ImageIcon("D:/MrStan/bg.png"); static JMenuBar menubar; Formatter x; JMenu menu; JMenuItem menuitem; double version = 0.3; class todoTask extends TimerTask{ public void run(){ points += 1; repaint(); } } public int getPoints(){ return points; } public void setPoints( int points ){ this.points = points; } public MrStan(){ setIgnoreRepaint(true); menubar = new JMenuBar(); menu = new JMenu("Menu"); menu.setMnemonic(KeyEvent.VK_F); menu.getAccessibleContext().setAccessibleDescription("Menu"); menubar.add(menu); menuitem = new JMenuItem("Store (S)", new ImageIcon("coins.png")); menuitem.setMnemonic(KeyEvent.VK_S); menuitem.addActionListener( new MenuStoreHandler() ); menu.add(menuitem); menuitem = new JMenuItem("Reset Points (R)", new ImageIcon("delete.png")); menuitem.setMnemonic(KeyEvent.VK_R); menuitem.addActionListener( new MenuResetPointHandler() ); menu.add(menuitem); // add a separator menu.addSeparator(); menuitem = new JMenuItem("Exit (E)", new ImageIcon("cross.png")); menuitem.setMnemonic(KeyEvent.VK_E); menuitem.addActionListener( new MenuExitHandler() ); menu.add(menuitem); timer.schedule(new todoTask(), 0, 2000); } class MenuStoreHandler implements ActionListener{ public void actionPerformed(ActionEvent e){ Dimension dim = Toolkit.getDefaultToolkit().getScreenSize(); int screenWidth = (int) dim.getWidth(); int screenHeight = (int) dim.getHeight(); JDialog g = new JDialog(); g.setTitle("The Store"); g.setSize(200, 200); g.setLocation(screenWidth / 2 - 150, screenHeight / 2 - 150); JButton b = new JButton("Buy"); b.addActionListener( new StoreItem1Handler() ); b.setVisible(true); g.add(b); g.setVisible(true); } } class StoreItem1Handler implements ActionListener{ public void actionPerformed(ActionEvent e){ System.out.println("Store-Button 1 pressed."); } } class MenuExitHandler implements ActionListener{ public void actionPerformed(ActionEvent e){ System.exit(1); } } class MenuResetPointHandler implements ActionListener{ public void actionPerformed(ActionEvent e){ points = 0; repaint(); JOptionPane.showMessageDialog(null, "Points have been reset."); } } public void paint(Graphics g){ g.setColor(Color.WHITE); bg.paintIcon(this,g,0,0); g.setColor(Color.BLACK); g.drawString("Points: " + points, 75, 95); g.drawString("Version: " + version, 2, 10); } public static void main(String[] args){ final MrStanCreateFile g = new MrStanCreateFile(); Runtime.getRuntime().addShutdownHook(new Thread(new Runnable(){ public void run(){ if(h.exists()){ g.openFile(); g.addRecords(); g.closeFile(); }else{ System.out.println(h.getName() + "does not exist, not saving."); } } }, "Shutdown-thread")); readIt(); //Create new JFrame JFrame frame = new JFrame(); frame.setTitle("MrStan"); frame.setSize(200, 200); frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); frame.setJMenuBar(menubar); //Set location of JFrame Dimension dim = Toolkit.getDefaultToolkit().getScreenSize(); int screenWidth = (int) dim.getWidth(); int screenHeight = (int) dim.getHeight(); frame.setLocation(screenWidth / 2 - 200, screenHeight / 2 - 200); //Set ContentPane to JPanel MrStan panel = new MrStan(); frame.setContentPane(panel); //Make the user not be able to resize frame.setResizable(false); //Make the JFrame visible frame.setVisible(true); } public static void readIt(){ MrStanReadFile r = new MrStanReadFile(); r.openFile(); r.readFile(); r.closeFile(); } } ``` Why is this covering my ENTIRE JDialog? I'm using the basic Layout Manager, it should just be fine.
Adding buttons to a JDialog?
CC BY-SA 3.0
null
2011-04-29T20:28:30.713
2017-03-13T13:26:27.623
2017-03-13T13:26:27.623
3,885,376
702,669
[ "java", "swing", "jbutton", "jdialog" ]
5,837,290
1
5,837,378
null
0
2,223
I've done quite a bit of research on CSS fullscreen layouts I just couldn't seem to find something like what I'm trying to do. I'm looking for a fullscreen layout with a header, footer, multiple columns, and a sidebar. Here's an ascii model and then a photoshop mockup. Anyone have any ideas? I'm yet to find a fullscreen layout technique to work. ``` +-----------------------+-------+ | | | +-------------+---------+ + | | | | | | | | | | | | | | | | | | | | | | | | +-------------+---------+-------+ | | +-------------------------------+ ``` ![Layout Prototype](https://i.stack.imgur.com/5N6vx.png) So tell me, how do you think this could be accomplished? I'm open to CSS 3 or HTML 5 options as cross-browser compatibility is a bonus, but not a necessity (WebKit is the target platform).
Fullscreen CSS Layout Challenge (Multi-column w/ Header and Footer)
CC BY-SA 3.0
null
2011-04-29T20:52:34.303
2011-04-29T21:13:35.393
null
null
483,418
[ "css", "layout", "fullscreen" ]
5,837,467
1
null
null
0
1,766
How would I make two buttons appear the same when one is hovered over? Picture of the buttons I want to be shown are here: [http://i.stack.imgur.com/b4P6B.png](https://i.stack.imgur.com/b4P6B.png) ![enter image description here](https://i.stack.imgur.com/b4P6B.png) How would I make the button with the green image in the center appear as the same style (colors, borders, etc...) when the `Sign On` one has been hovered over / clicked? I'm using Windows Forms.
Set C# Button Style to another Button when hovered / clicked / unhovered
CC BY-SA 3.0
null
2011-04-29T21:14:48.937
2011-04-29T21:27:33.430
2011-04-29T21:24:26.357
322,355
677,110
[ "c#", "winforms", "button" ]
5,837,510
1
null
null
4
620
Are there any WPF libraries similar to [jQuery UI](http://jqueryui.com/)? I especially like the [Sortable](http://jqueryui.com/demos/sortable/#portlets) interaction: ![enter image description here](https://i.stack.imgur.com/X18iB.png) and [Resizable](http://jqueryui.com/demos/resizable/) interaction: ![enter image description here](https://i.stack.imgur.com/mN88B.png) Would be great if these 2 interactions could be combined. Thanks.
WPF library similar to jQuery UI?
CC BY-SA 3.0
0
2011-04-29T21:21:08.907
2011-04-30T06:18:04.053
null
null
null
[ "wpf", "jquery-ui", "wpf-controls", "jquery-ui-sortable", "jquery-ui-resizable" ]
5,837,563
1
5,837,806
null
1
1,017
What I'm trying to do is independently slidetoggle text divs under a row of images when those images - in a dl/dt gallery - are clicked, like so: ![dl and dt gallery](https://i.stack.imgur.com/hbspT.png) But of course I'm doing at least a few things wrong. Could be complicated that the markup is in a jQuery Tab, but that may not be the case. [http://jsfiddle.net/Yfs2V/8/](http://jsfiddle.net/Yfs2V/8/) I think the function is problematic: ``` $(".bkcontent").hide(); $("#bookimggallery dt").click(function() { $(".bkcontent").hide(); $(this).parent().children(".bkcontent").slideToggle(500); }); ``` ``` <div id="bookimggallery"> <dl class="gallery"><dt><img alt="img" src=""></dt> <dt>Image Title One</dt></dl> <dl class="gallery"><dt><img alt="img" src=""></dt> <dt>Image Title Two</dt></dl> <dl class="gallery"><dt><img alt="img" src=""></dt> <dt>Image Title Three</dt></dl> <dl class="gallery"><dt><img alt="img" src=""></dt> <dt>Image Title Four</dt></dl> <dl class="gallery"><dt><img alt="img" src=""></dt> <dt>Image Title Five</dt></dl> </div> <div id="booktextdiv"> <div class="bkcontent">Lorum Ipsum....</div> <div class="bkcontent">Lorum Ipsum....</div> <div class="bkcontent">Lorum Ipsum....</div> <div class="bkcontent">Lorum Ipsum....</div> <div class="bkcontent">Lorum Ipsum....</div> </div> ``` ``` #bookimggallery { width: 600px; height:200px; margin:2px; text-align: center;} dl.gallery {width: 93px; text-align: center; float: left;} .gallery dt { width: 80px; margin-top:2px; font-size: .7em; text-align:center;} #booktextdiv span {display:none} *(omitted tabs CSS for clairity)* ```
How to fix this jQuery SlideToggle?
CC BY-SA 3.0
0
2011-04-29T21:26:31.833
2011-04-29T21:56:09.687
2011-04-29T21:48:37.867
85,385
85,385
[ "jquery", "slidetoggle" ]
5,837,643
1
5,837,778
null
4
4,369
How would you implement the following instance method for `NSSet`: ``` - (BOOL)containsMemberOfClass:(Class)aClass ``` Here's why I want to know: Core Data model: ![enter image description here](https://i.stack.imgur.com/qZ9A7.png) How do I add a Facebook authorization to a user's authorizations `NSSet`, but only if one doesn't already exist. In other words, a user can have many authorizations (in case I choose to add a Twitter (e.g.) authorization in the future) but should only have one of each kind of authorization. So, `if (![myUser.authorizations containsMemberOfClass:[Facebook class]])`, then add a Facebook authorization instance to `myUser`.
How do I check if an NSSet contains an object of a kind of class?
CC BY-SA 3.0
0
2011-04-29T21:36:12.660
2013-11-12T11:26:53.473
null
null
242,933
[ "core-data", "nsmanagedobject", "nsset" ]
5,838,242
1
5,838,317
null
1
353
I should start by saying I have researched this question. I can't find any identical questions or ones which do what I'm after. I'd like to be able to put some content at the bottom left of the page, and then have a div above that which automatically stretches itself to use all the space between the top of the page and the content at the bottom left, even when the user resizes the window. Please see the image below. I position the bottom-left content with `position: absolute; bottom: 10px;`, which works. So then I would ideally have the div above it automatically stretch to fill the big gap (i.e.): `[stretchy_div_height] = [100%] - [height_of_bottom_div] - [bottom_div_margin]`. Ideally I would like to do this without JavaScript if possible. But either way is fine. I can't use faux columns for the height-stretching div (I need real content all the way down). Thank you! Here is an image of what I'm aiming to achieve: ![](https://i.stack.imgur.com/863ue.png)
CSS column devilry: a sticky div with an auto-stretching div in between it?
CC BY-SA 3.0
0
2011-04-29T23:05:47.790
2011-04-30T00:10:48.823
null
null
679,374
[ "javascript", "html", "css", "xhtml" ]
5,838,279
1
5,838,500
null
2
1,146
I'm working on a class to get the Latitude and Longitude of an address by 3 different providers (just for comparison sake). `<hr>` My Google Maps DataContract works like a champ. But my Bing and MapQuest DataContracts aren't playing so nice. I think the issue has to deal with the of the JSON for Bing and MapQuest, and I just don't know how to deal with them. Here is the Function that processes the Data. ``` ''# Because the JSON Response from Google, MapQuest, and Bing are drastically ''# different, we need to consume the response a little differently ''# for each API. ''# ################################## ''# BING IS BROKEN ''# ################################## ''# Here we're handling the Bing Provider If Provider = apiProvider.Bing Then Dim res = DirectCast(serializer.ReadObject(request.GetResponse().GetResponseStream()), BingResponse) Dim resources As BingResponse.ResourceSet.Resource = res.resourceSets(0).resources(0) Dim point = resources.point With coordinates .latitude = point.coordinates(0) .longitude = point.coordinates(1) End With ''# ################################## ''# GOOGLE WORKS LIKE A CHAMP ''# ################################## ''# Here we're handling the Google Provider ElseIf Provider = apiProvider.Google Then Dim res = DirectCast(serializer.ReadObject(request.GetResponse().GetResponseStream()), GoogleResponse) Dim resources As GoogleResponse.Result = res.results(0) Dim point = resources.geometry.location With coordinates .latitude = point.lat .longitude = point.lng End With ''# ################################## ''# MAPQUEST IS BROKEN ''# ################################## ''# Here we're handling the MapQuest Provider ElseIf Provider = apiProvider.MapQuest Then Dim res = DirectCast(serializer.ReadObject(request.GetResponse().GetResponseStream()), MapQuestResponse) Dim resources As MapQuestResponse.Result = res.results(0) Dim point = resources.locations.latLng With coordinates .latitude = point.lat .longitude = point.lng End With End If ``` And here are the three DataContracts ``` ''# A comment to fix SO Code Coloring <DataContract()> Public Class BingResponse <DataMember()> Public Property resourceSets() As ResourceSet() <DataContract()> Public Class ResourceSet <DataMember()> Public Property resources() As Resource() <DataContract([Namespace]:="http://schemas.microsoft.com/search/local/ws/rest/v1", name:="Location")> Public Class Resource <DataMember()> Public Property point() As m_Point <DataContract()> Public Class m_Point <DataMember()> Public Property coordinates() As String() End Class End Class End Class End Class <DataContract()> Public Class GoogleResponse <DataMember()> Public Property results() As Result() <DataContract()> Public Class Result <DataMember()> Public Property geometry As m_Geometry <DataContract()> Public Class m_Geometry <DataMember()> Public Property location As m_location <DataContract()> Public Class m_location <DataMember()> Public Property lat As String <DataMember()> Public Property lng As String End Class End Class End Class End Class <DataContract()> Public Class MapQuestResponse <DataMember()> Public Property results() As Result() <DataContract()> Public Class Result <DataMember()> Public Property locations As m_Locations <DataContract()> Public Class m_Locations <DataMember()> Public Property latLng As m_latLng <DataContract()> Public Class m_latLng <DataMember()> Public Property lat As String <DataMember()> Public Property lng As String End Class End Class End Class End Class ``` When testing I get this error > System.NullReferenceException: Object reference not set to an instance of an object. on line ``` .latitude = point.lat ``` When testing I get this error > System.IndexOutOfRangeException: Index was outside the bounds of the array. on line ``` Dim resources As BingResponse.ResourceSet.Resource = res.resourceSets(0).resources(0) ``` --- FYI, I'll also post what the JSON Response for each looks like. ## Google Maps ``` { "status": "OK", "results": [ { "types": [ "bus_station", "transit_station" ], "formatted_address": "Microsoft Way & Microsoft ACS, Redmond, WA 98052, USA", "address_components": [ { "long_name": "Microsoft Way & Microsoft ACS", "short_name": "Microsoft Way & Microsoft ACS", "types": [ "bus_station", "transit_station" ] }, { "long_name": "Redmond", "short_name": "Redmond", "types": [ "locality", "political" ] }, { "long_name": "East Seattle", "short_name": "East Seattle", "types": [ "administrative_area_level_3", "political" ] }, { "long_name": "King", "short_name": "King", "types": [ "administrative_area_level_2", "political" ] }, { "long_name": "Washington", "short_name": "WA", "types": [ "administrative_area_level_1", "political" ] }, { "long_name": "United States", "short_name": "US", "types": [ "country", "political" ] }, { "long_name": "98052", "short_name": "98052", "types": [ "postal_code" ] } ], "geometry": { "location": { "lat": 47.6397018, "lng": -122.1305080 }, "location_type": "APPROXIMATE", "viewport": { "southwest": { "lat": 47.6365542, "lng": -122.1336556 }, "northeast": { "lat": 47.6428494, "lng": -122.1273604 } } }, "partial_match": true }, { "types": [ "bus_station", "transit_station" ], "formatted_address": "Microsoft Way & NE 36th St, Redmond, WA 98052, USA", "address_components": [ { "long_name": "Microsoft Way & NE 36th St", "short_name": "Microsoft Way & NE 36th St", "types": [ "bus_station", "transit_station" ] }, { "long_name": "Redmond", "short_name": "Redmond", "types": [ "locality", "political" ] }, { "long_name": "East Seattle", "short_name": "East Seattle", "types": [ "administrative_area_level_3", "political" ] }, { "long_name": "King", "short_name": "King", "types": [ "administrative_area_level_2", "political" ] }, { "long_name": "Washington", "short_name": "WA", "types": [ "administrative_area_level_1", "political" ] }, { "long_name": "United States", "short_name": "US", "types": [ "country", "political" ] }, { "long_name": "98052", "short_name": "98052", "types": [ "postal_code" ] } ], "geometry": { "location": { "lat": 47.6420593, "lng": -122.1306990 }, "location_type": "APPROXIMATE", "viewport": { "southwest": { "lat": 47.6389117, "lng": -122.1338466 }, "northeast": { "lat": 47.6452069, "lng": -122.1275514 } } }, "partial_match": true }, { "types": [ "bus_station", "transit_station" ], "formatted_address": "Microsoft Way & NE 31ST St, Redmond, WA 98052, USA", "address_components": [ { "long_name": "Microsoft Way & NE 31ST St", "short_name": "Microsoft Way & NE 31ST St", "types": [ "bus_station", "transit_station" ] }, { "long_name": "Redmond", "short_name": "Redmond", "types": [ "locality", "political" ] }, { "long_name": "East Seattle", "short_name": "East Seattle", "types": [ "administrative_area_level_3", "political" ] }, { "long_name": "King", "short_name": "King", "types": [ "administrative_area_level_2", "political" ] }, { "long_name": "Washington", "short_name": "WA", "types": [ "administrative_area_level_1", "political" ] }, { "long_name": "United States", "short_name": "US", "types": [ "country", "political" ] }, { "long_name": "98052", "short_name": "98052", "types": [ "postal_code" ] } ], "geometry": { "location": { "lat": 47.6380959, "lng": -122.1318050 }, "location_type": "APPROXIMATE", "viewport": { "southwest": { "lat": 47.6349483, "lng": -122.1349526 }, "northeast": { "lat": 47.6412435, "lng": -122.1286574 } } }, "partial_match": true }, { "types": [ "route" ], "formatted_address": "Microsoft w Campus Acrd, Redmond, WA, USA", "address_components": [ { "long_name": "Microsoft w Campus Acrd", "short_name": "Microsoft w Campus Acrd", "types": [ "route" ] }, { "long_name": "Redmond", "short_name": "Redmond", "types": [ "locality", "political" ] }, { "long_name": "East Seattle", "short_name": "East Seattle", "types": [ "administrative_area_level_3", "political" ] }, { "long_name": "King", "short_name": "King", "types": [ "administrative_area_level_2", "political" ] }, { "long_name": "Washington", "short_name": "WA", "types": [ "administrative_area_level_1", "political" ] }, { "long_name": "United States", "short_name": "US", "types": [ "country", "political" ] } ], "geometry": { "location": { "lat": 47.6582970, "lng": -122.1414390 }, "location_type": "GEOMETRIC_CENTER", "viewport": { "southwest": { "lat": 47.6559394, "lng": -122.1435435 }, "northeast": { "lat": 47.6622346, "lng": -122.1372482 } }, "bounds": { "southwest": { "lat": 47.6577719, "lng": -122.1433446 }, "northeast": { "lat": 47.6604021, "lng": -122.1374471 } } }, "partial_match": true } ] } ``` ## Bing Maps ``` { "authenticationResultCode" : "ValidCredentials", "brandLogoUri" : "http://dev.virtualearth.net/Branding/logo_powered_by.png", "copyright" : "Copyright © 2011 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.", "resourceSets" : [ { "estimatedTotal" : 1, "resources" : [ { "__type" : "Location:http://schemas.microsoft.com/search/local/ws/rest/v1", "address" : { "addressLine" : "1 Microsoft Way", "adminDistrict" : "WA", "countryRegion" : "United States", "formattedAddress" : "1 Microsoft Way, Redmond, WA 98052", "locality" : "Redmond", "postalCode" : "98052" }, "bbox" : [ 47.636682837606166, -122.13698544771381, 47.644408272747519, -122.12169881991093 ], "confidence" : "High", "entityType" : "Address", "name" : "1 Microsoft Way, Redmond, WA 98052", "point" : { "coordinates" : [ 47.640545555176843, -122.12934213381237 ], "type" : "Point" } } ] } ], "statusCode" : 200, "statusDescription" : "OK", "traceId" : "3d0dd6c4ea1f4c4ba6f9c7211a5abf75|BAYM001222|02.00.82.2800|BY2MSNVM001058" } ``` ## MapQuest ``` { "info" : { "copyright" : { "imageAltText" : "© 2011 MapQuest, Inc.", "imageUrl" : "http://tile21.mqcdn.com/res/mqlogo.gif", "text" : "© 2011 MapQuest, Inc." }, "messages" : [ ], "statuscode" : 0 }, "options" : { "ignoreLatLngInput" : false, "maxResults" : -1, "thumbMaps" : true }, "results" : [ { "locations" : [ { "adminArea1" : "US", "adminArea1Type" : "Country", "adminArea3" : "WA", "adminArea3Type" : "State", "adminArea4" : "King County", "adminArea4Type" : "County", "adminArea5" : "Redmond", "adminArea5Type" : "City", "displayLatLng" : { "lat" : 47.674197999999997, "lng" : -122.1203 }, "dragPoint" : false, "geocodeQuality" : "CITY", "geocodeQualityCode" : "A5XCX", "latLng" : { "lat" : 47.674197999999997, "lng" : -122.1203 }, "linkId" : 0, "mapUrl" : "http://www.mapquestapi.com/staticmap/v3/getmap?type=map&size=225,160&pois=purple-1,47.674198,-122.1203,0,0|&center=47.674198,-122.1203&zoom=9&key=Fmjtd|luu22q01ng,2n=o5-h6rnq&rand=-47567557", "postalCode" : "", "sideOfStreet" : "N", "street" : "", "type" : "s" } ], "providedLocation" : { "location" : "1 Microsoft Way, Redmon WA" } } ] } ``` ## Addition ![screenshot](https://i.stack.imgur.com/rMTNv.png)
.NET DataContractJsonSerializer, Nested collections throwing me for a loop
CC BY-SA 3.0
null
2011-04-29T23:11:27.230
2017-08-09T22:39:08.500
2017-08-09T22:39:08.500
3,744,182
124,069
[ "asp.net", "json", "datacontract", "datacontractjsonserializer" ]
5,838,409
1
5,889,261
null
17
6,891
I've found various proposed solutions to this problem on this internet, but none of them work for me. Does anyone know why this might be happening? [http://answers.unity3d.com/questions/15294/xcode-build-and-archive-error-no-such-file-or-directory](http://answers.unity3d.com/questions/15294/xcode-build-and-archive-error-no-such-file-or-directory) [http://blog.joshschumacher.com/2011/04/06/xcode4-the-operation-couldn%E2%80%99t-be-completed-no-such-file-or-directory/](http://blog.joshschumacher.com/2011/04/06/xcode4-the-operation-couldn%E2%80%99t-be-completed-no-such-file-or-directory/) I've tried archiving with every combination of coding signing vs not using code signing, and I've tried using every combination of provisioning profiles, but I still get the same error every time. I'm very confused as to why I'd even be getting an error like this when trying to save a file. I'm using XCode 4, my application builds for archive fine. In fact, I can even upload my application to itunesconnect (and it was accepted!). I just can't create an IPA for sharing and beta testing before submission. Any ideas? [The error message](https://i.stack.imgur.com/SZnGY.png) ![The Error](https://i.stack.imgur.com/SZnGY.png) [Right before I get the error](https://i.stack.imgur.com/vRc0O.png) ![Right before I get the error](https://i.stack.imgur.com/vRc0O.png)
XCode 4 Archive/IPA Error: "The operation couldn’t be completed. No such file or directory"
CC BY-SA 3.0
0
2011-04-29T23:38:59.357
2011-11-01T11:50:45.727
null
null
478,460
[ "objective-c", "xcode", "xcode4" ]
5,838,506
1
5,840,733
null
5
3,208
I want to draw a "bounding box" around a skewed rectangle. I thought I could use the cvMinAreaRect2() function but it only handles the rotation, see this image: ![enter image description here](https://i.stack.imgur.com/FFIob.png) Is there any function to solve this? If not, any ideas how to implement it?
OpenCV - Find skewed rectangle
CC BY-SA 3.0
0
2011-04-29T23:59:55.117
2012-08-15T10:42:16.417
2012-08-15T10:42:16.417
77,595
650,711
[ "image-processing", "opencv" ]
5,838,737
1
5,919,701
null
1
334
Ok so what I'm trying to do is create an array of pointers that point to vectors that change in size. Also the array of pointers is nestled inside a class that's inside a vector. For some reason I seem to be having problems with memory becoming corrupt. Also if I use vectors I run into the problems with the stack overflowing caused by stuff resizing and calling constructors. Here is an essential layout of what I'm gunning for. ![Diagram](https://i.stack.imgur.com/m9Abs.png) Maybe a little sloppy. But I end up with the problem of memory being currupted in the babyclasses pointers, basically I want to access "linked" babyclasses via the babyclasses vector of babyclasses it's connected to. Any clever ideas here? And before anyone tells me this is a silly way to do things, isn't this type of functionality the basis of OO Programming? ``` class Baby { public: deque<shared_ptr<Baby>> vInputs; int X; int Y; int Z; Baby() { numInputs = 0; isNull = false; wasTickled = false; X,Y,Z = 0; } void addInput(shared_ptr<Baby> baby) { if(numInputs == 0) vInputs = deque<shared_ptr<Baby>>(0); vInputs.push_back(baby); numInputs++; } void setXYZ(int x, int y, int z) { X = x; Y = y; Z = z; } void Tickle() { if(!wasTickled) wasTickled = true; else return; for(int i=0;i<numInputs;i++) { vInputs[i]->Tickle(); } } void setNull(bool isnull) { isNull = isnull; } private: int numInputs; bool isNull; bool wasTickled; }; class BabyLayer { public: int Width; int Height; BabyLayer() { Width = 0; Height = 0; } BabyLayer(int width, int height) { Width = width; Height = height; vecBabies = std::deque<deque<Baby>>(0); for(int i=0;i<height;i++) { deque<Baby> row = deque<Baby>(0); for(int i=0;i<width;i++) { row.push_back(Baby()); }; vecBabies.push_back(row); } MakeConnections(); } Baby * getBaby(int x, int y) { Baby n = Baby(); n.setNull(true); if(x >= Width || x <0) return &n; if(y >= Height || y < 0) return &n; n.setNull(false); return &vecBabies[y][x]; } ~BabyLayer(void) { } private: std::deque<deque<Baby>> vecBabies; void MakeConnections() { for(int y=0;y<Height;y++) { for(int x=0;x<Width;x++) { //Top Right if(y > 0 && x < Width-1) vecBabies[y][x].addInput(shared_ptr<Baby>(&vecBabies[y-1][x+1])); //Middle Right if(x < Width -1) vecBabies[y][x].addInput(shared_ptr<Baby>(&vecBabies[y][x+1])); //Bottom Right if(x < Width -1 && y < Height-1) vecBabies[y][x].addInput(shared_ptr<Baby>(&vecBabies[y+1][x+1])); //Bottom Middle if(y < Height-1) vecBabies[y][x].addInput(shared_ptr<Baby>(&vecBabies[y+1][x])); } } } }; class BabyCube { public: int X; int Y; int Z; BabyCube(int x, int y, int z) { X = x; Y = y; Z = z; Layers = deque<BabyLayer>(); for(int i=0;i<z;i++) { BabyLayer lay = BabyLayer(x,y); Layers.push_back(lay); } NullBaby = Baby(); NullBaby.setNull(true); MakeConnections(); } void MakeConnections() { int l = Layers.size(); if(l == 0 || l == 1) return; for(int layer=0;layer<l;layer++) { BabyLayer * lay = &Layers[layer]; if(layer< l-1) { for(int y=0;y<lay->Height;y++) { for(int x=0;x<lay->Width;x++) { //Top Left if(x > 0 && y > 0) Layers[layer].getBaby(x,y)->addInput(shared_ptr<Baby>(Layers[layer+1].getBaby(x-1,y-1))); //Top Middle if(y > 0) Layers[layer].getBaby(x,y)->addInput(shared_ptr<Baby>(Layers[layer+1].getBaby(x,y-1))); //Top Right if(y > 0 && x+1 < lay->Width-1) Layers[layer].getBaby(x,y)->addInput(shared_ptr<Baby>(Layers[layer+1].getBaby(x+1,y-1))); //Middle Right if(x+1 < lay->Width -1) Layers[layer].getBaby(x,y)->addInput(shared_ptr<Baby>(Layers[layer+1].getBaby(x+1,y))); //Bottom Right if(x+1 < lay->Width -1 && y+1 < lay->Height-1) Layers[layer].getBaby(x,y)->addInput(shared_ptr<Baby>(Layers[layer+1].getBaby(x+1,y+1))); //Bottom Middle if(y+1 < lay->Height-1) Layers[layer].getBaby(x,y)->addInput(shared_ptr<Baby>(Layers[layer+1].getBaby(x,y+1))); //Bottom Left if(x > 0 && y+1 < lay->Height-1) Layers[layer].getBaby(x,y)->addInput(shared_ptr<Baby>(Layers[layer+1].getBaby(x-1,y+1))); //Middle Left if(x > 0) Layers[layer].getBaby(x,y)->addInput(shared_ptr<Baby>(Layers[layer+1].getBaby(x-1,y))); //Middle Middle Layers[layer].getBaby(x,y)->addInput(shared_ptr<Baby>(Layers[layer+1].getBaby(x,y))); } } } } } Baby * getBaby(int x, int y, int z) { if(z >= Layers.size() || z < 0) return &NullBaby; if(y >= Layers[z].Height || y < 0) return &NullBaby; if(x >= Layers[z].Width || x < 0) return &NullBaby; return Layers[z].getBaby(x,y); } void Update() { } ~BabyCube(void) { } private: deque<BabyLayer> Layers; Baby NullBaby; }; ```
c++ dynamic arrays and pointers
CC BY-SA 3.0
null
2011-04-30T00:54:48.447
2011-05-07T07:26:44.320
2011-04-30T02:52:50.587
222,054
222,054
[ "c++", "pointers", "corrupt" ]
5,838,797
1
5,838,844
null
2
289
From VS2010 in Windows 7 using Directory.Delete(path) from the VS debugger. I have full admin rights to my machine. I basically ran ``` Directory.Delete(path) ``` Not only did it not delete the folders, but now when I try to go and delete them manually I get ![enter image description here](https://i.stack.imgur.com/rmaLW.png) No matter what I do, it will not let me delete the path any more. If my program tries to delete it, I get a UnathorizedAccessException. What's going on here? : I've tried deleting from Windows explorer and from a command box running as administrator. I don't actually see what else there is to do.
From VS2010 in Windows 7 using Directory.Delete(path) from the VS debugger
CC BY-SA 3.0
null
2011-04-30T01:12:05.537
2011-05-04T17:40:43.390
2011-04-30T01:20:08.503
127,257
127,257
[ "c#", ".net", "windows-7", "permissions" ]
5,838,994
1
5,839,005
null
3
3,415
I'm trying to recreate a function from a discrete fourier transform. In Matlab it would be done like this: ``` function [y] = Fourier(dft,x) n = length(dft); y = cos(pi*(x+1)'*(0:n-1))*real(dft)+sin(pi*(x+1)'*(0:n-1))*imag(dft) end ``` My attempt in Python is falling flat because I don't know how to add up all the coefficients correctly ``` def reconstruct(dft, x): n = len(dft) y = ([(coeff.real)*np.cos(np.pi*x*nn) + (coeff.imag)*np.cos(np.pi*x*nn) for coeff in dft for nn in range(0,n)]) ``` But this isn't correct because I need to sum over n and add those sums together. Where am I off? The equation I am trying to recreate is below: ![Fourier Series](https://i.stack.imgur.com/CopGv.png)
Fourier Series from Discrete Fourier Transform
CC BY-SA 3.0
null
2011-04-30T02:08:24.793
2011-04-30T20:21:28.237
2011-04-30T02:41:36.640
308,962
308,962
[ "python", "numpy" ]
5,839,115
1
5,841,911
null
0
429
I feel really stupid coming to ask this question here today after bugging everyone yesteday on understanding the algorithm. But I am not looking at this thing straight anymore. Anyways, it is a knapsack probled, solved with memoization and dynamic progrmming. The problem is that the printout of my answers is not matching the requierements. All I want is a second look at it and if someone can point me where I am wrong at. Appreciated for all the help. This is the ProfitHeader.h file ``` #ifndef PROFITHEADER_H_ #define PROFITHEADER_H_ #include <string> #include <map> #include <vector> using namespace std; namespace kproblem{ typedef int Money; typedef int Labor; struct Resources{ Money liquidity; Labor officeWork; Labor programmingWork; Resources(Money li, Labor of, Labor pro) : liquidity(li), officeWork(of), programmingWork(pro){} //operator -= Resources & operator -=( const Resources &rhs ){ liquidity -=rhs.liquidity; officeWork -=rhs.officeWork; programmingWork -=rhs.programmingWork; return *this; } //operator< Used to make sure that key elements Match. will not modify (this) bool operator<(const Resources & rhs) const{ if(this->liquidity < rhs.liquidity) return true; else if(this->liquidity > rhs.liquidity) return false; else if(this->officeWork < rhs.officeWork) return true; else if(this->officeWork > rhs.officeWork) return false; //this is the iff conditional else if(this->programmingWork < rhs.programmingWork) return true; else return false; } }; //Global Operator-. This will not modify (this). Resources operator-( const Resources & lhs, const Resources & rhs ){ return Resources(lhs.liquidity - rhs.liquidity, lhs.officeWork - rhs.officeWork, lhs.programmingWork - rhs.programmingWork); } //This is the Project Struct. It should contain the resources and data from the file. struct Project{ string name; Resources resources; Money profit; Project(string n, Resources re, Money p) : name(n), resources(re), profit(p) {} }; //Definition of the ValueMap typedef map<pair<Resources, vector<Project>::size_type>, pair<Money, bool>> ValueMap; } #endif ``` This is my main.cpp ``` #include <iostream> #include <fstream> #include <sstream> #include <exception> #include "ProfitHeader.h" using namespace std; using namespace kproblem; //The following was provided to us on the program class IO_Exception : public runtime_error { public: IO_Exception(const string & message) : runtime_error(message) { } }; void readProjects(vector<Project> & projects, const string & fileName) { ifstream infile(fileName.c_str()); if (!infile) throw IO_Exception("Could not open " + fileName); string oneLine; unsigned int lineNum = 0; while (getline(infile, oneLine)) { istringstream st(oneLine); lineNum++; string name; Money liquidity; Labor officeWork; Labor programmingWork; Money profit; st >> name; st >> liquidity; st >> officeWork; st >> programmingWork; st >> profit; if (st.fail()) { cerr << "Skipping line number " << lineNum << ": " << oneLine << endl; continue; } string junk; if (st >> junk) { cerr << "Skipping line number " << lineNum << ": " << oneLine << endl; continue; } projects.push_back(Project(name, Resources(liquidity, officeWork, programmingWork), profit)); } if (!infile.eof()) throw IO_Exception("Error reading from " + fileName); } //Class Best Profit. //This class will calculate the best possible profit we can get. Money bestProfit(const vector<Project> & projects, Resources res, ValueMap & valMap,int n){ //initialize the best 2 possible solutions. Money best1; Money best2; Money map; // the map where ou answers are stored // First check if we are not at the end of the projects if(n == 0){ return 0; } //now we are going to check the best project possible. //Check the subinstance if it was solved. if(valMap.find(make_pair(res, n-1)) != valMap.end()){ map = valMap.find(make_pair(res, n-1))->second.first; return map; }//check if the subinstance is solved. if it is return the value. best1 = bestProfit(projects, res, valMap, n-1);//first best possible solution //check the resources for the last project only. Fopr the second best possible solution. if(res.liquidity >= projects.at(n-1).resources.liquidity && res.officeWork >= projects.at(n-1).resources.officeWork && res.programmingWork >= projects.at(n-1).resources.programmingWork){// feasability Check. //all the above are requiered as it is necessary to check for all of them when doing the calculations. best2 = bestProfit(projects, res - projects[n-1].resources, valMap, n-1) + projects[n-1].profit; } else{ best2 = 0; } //after the whole check compare the results and store the best possible result in the map. if(best1 >= best2){ valMap.insert(make_pair(make_pair(res, n), make_pair(best1,false))); return best1; } else{ valMap.insert(make_pair(make_pair(res, n), make_pair(best2,true))); return best2; } } //reportBestProfit. This will call Best profit and help us print the final results. void reportBestProfit(vector<Project> projects, Resources resources){ ValueMap valueMap; //Variables for the total resources used. Money liq = 0; Money ow = 0; Money pw = 0; int n = 1000; //number of projects, put here for fast testing Money bestP = bestProfit(projects, resources, valueMap, n); //Iterate the valuemap and print the best projects available to us. cout << "Selected Projects -" << endl; for(int i= 1; i <= 1000; i++){ //if(valueMap.find(make_pair(resources, i-1)) == valueMap.end()){ if(valueMap.find(make_pair(resources, i))->second.second == true){ //if(valueMap.find(make_pair(resources, i))->second.first != valueMap.find(make_pair(resources, i-1))->second.first){ //cout << valueMap.find(make_pair(resources, i))->second.first; //money //cout <<" "<< valueMap.find(make_pair(resources, i))->second.second; //boolean cout << " " << projects.at(i-1).name << " " << projects.at(i-1).resources.liquidity <<" ";//projects cout << projects.at(i-1).resources.officeWork << " " << projects.at(i-1).resources.programmingWork; cout << " " << projects.at(i-1).profit << endl;//profit //} } } cout << "Total Resources Used -" << endl; //Print the resources consumed. for(int i= 1; i <= 1000; i++){ if(valueMap.find(make_pair(resources, i))->second.second == true){ liq += projects.at(i-1).resources.liquidity; ow += projects.at(i-1).resources.officeWork; pw += projects.at(i-1).resources.programmingWork; } } cout << " " << "Liquidity: " << liq <<endl; cout << " " << "Office Work: " << ow <<endl; cout << " " << "Programming Work: " << pw <<endl; //Print the total Profit. cout << "Profit: " << bestP << endl; system("PAUSE"); } int main() { vector<Project> projects; try { readProjects(projects, "Proj5Data.txt"); } catch (const IO_Exception & ex) { cerr << "IO error from: " << ex.what() << endl; return 1; } //these values can be changed for different analysis on projects. Money liquidity = 200; Labor officeWork = 450; Labor programmingWork = 1000; cout << "Available resources - " << endl << " Liquidity: " << liquidity << endl << " Office Work: " << officeWork << endl << " Programming Work: " << programmingWork << endl; reportBestProfit(projects, Resources(liquidity, officeWork, programmingWork)); return 0; } ``` The project file that contains the projects can be downloaded temporarily here: ``` https://rapidshare.com/files/459861869/Proj5Data.txt ``` my guess is the problem is on the valmap find, but I have tried all kinds of combinations and it does not work at all. Finally this is the final printout I should be getting from this: ![result](https://i.stack.imgur.com/EhABN.gif) But instead I am getting all these other results, including some of the ones I need:![result2](https://i.stack.imgur.com/ZQkyD.gif) Again thank you for the one that can slap me in the head and say, you FOO, you shouldn't be doing this anymore :).
final project, Dynamic Programming. Need second set of eyes
CC BY-SA 3.0
null
2011-04-30T02:46:41.600
2012-10-24T13:27:53.557
2011-04-30T11:55:52.570
692,199
692,199
[ "c++", "solution" ]
5,839,286
1
null
null
43
18,745
Does anyone know how to break on unhandled exceptions in pycharm? per [this link](http://youtrack.jetbrains.net/issue/PY-1498) it should be possible, although its not breaking for me (build 105.58). Is there some switch I have to turn on to enable this? EDIT: I did what you suggested, but the debugger is not breaking on unhandled exceptions. Please see the screenshot below, and let me know if I need to do something else. ![enter image description here](https://i.stack.imgur.com/U1IMt.jpg) It seems this is the same issue as [breaking on unhandled exceptions in pydev/gae](https://stackoverflow.com/questions/5761928/breaking-on-unhandled-exceptions-in-pydev-gae). Pycharm uses pydevd for the debugger. ``` C:\Python25\python.exe "C:\Program Files\JetBrains\PyCharm 1.2.1\helpers\pydev\pydevd.py" --client 127.0.0.1 --port 49371 --file C:/Users/morpheus/PycharmProjects/untitled1/main.py pydev debugger: warning: psyco not available for speedups (the debugger will still work correctly, but a bit slower) pydev debugger: starting Connected to pydev debugger (build 105.58) ``` I can get it to break on a non-gae project, but it won't break on a gae project. How can this be fixed?
Break on unhandled exception in pycharm
CC BY-SA 3.0
0
2011-04-30T03:30:02.503
2015-11-19T14:48:44.883
2017-05-23T12:26:31.280
-1
147,530
[ "python", "google-app-engine", "pycharm" ]
5,839,492
1
5,839,530
null
2
348
So I am picking up a project that was quit halfway through by the last guy so that I could get some more practice with PHP and databases. I have run into a problem, and I am sure it is common enough that there is a standard solution, but I am unable to find one. The db I am working with has 4,600, so reorganizing is out of the question. It is a db of liquers for a wholesaler. Here is what the results page looks like currently: ![enter image description here](https://i.stack.imgur.com/ZdcO8.png) What I am trying to set it up so the results are returned in list form, with only one title and dropdown menus for the different sizes/prices of products that looks like this: ![enter image description here](https://i.stack.imgur.com/xd4cL.jpg) The problem is that there are multiple entries in the db for each product. In this example there are 3, while some have 1, and some have 2. I am really not sure how to go about this, and any help would be greatly appreciated. Thank you.
Combining multiple rows or results with the same title to form drop down menus with PHP and MySQL
CC BY-SA 3.0
null
2011-04-30T04:25:11.107
2011-04-30T04:48:31.287
null
null
615,285
[ "php", "mysql" ]
5,839,585
1
5,839,610
null
0
167
Just helping my friend here. He got this website in development: [http://themagicbeads.com/en/15-dresses](http://themagicbeads.com/en/15-dresses) When open with firefox, there is no error. However when open with chrome or safari, got striketrough bug in the product description as in the picture below: ![enter image description here](https://i.stack.imgur.com/3XOE5.png) How to fix this? Thank you.
Need help fix css bug in chrome / safari
CC BY-SA 3.0
null
2011-04-30T04:45:29.420
2011-04-30T04:50:43.830
null
null
417,899
[ "css", "webkit" ]
5,839,598
1
5,839,622
null
0
147
In my www folder I have a folder called openslopeone. Inside openslopeone I have a file called OpenSlopeOne.php. In my www folder I have a file called test.php in which I did: require_once ('openslopeone/OpenSlopeOne.php'); however, now I am getting the following error: ![enter image description here](https://i.stack.imgur.com/I89uz.png) Here's the include/require code from OpenSlopeOne.php ``` set_include_path('./inc'); require_once 'Zend/Db.php'; require_once 'Zend/Loader.php'; ``` Inside the folder inc I have the folder Zend, which contains Db.php and Loader.php What am I missing here
problem with include in PHP
CC BY-SA 3.0
null
2011-04-30T04:49:11.070
2011-04-30T05:02:24.647
2011-04-30T05:02:24.647
721,937
721,937
[ "php" ]
5,839,637
1
5,839,681
null
2
3,662
![enter image description here](https://i.stack.imgur.com/1hXiR.png) Here in above figure sleeping like a baby is a `link button`. I don't want to place a `UITextView` as this simply opens up a `pickerView` How can I create a `link button` of similar kind in iPhone?
how to create a link button in iPhone?
CC BY-SA 3.0
null
2011-04-30T04:56:07.787
2013-05-22T11:14:51.183
2013-05-22T11:14:51.183
1,355,704
463,857
[ "iphone", "objective-c", "cocoa-touch", "ios4", "uibutton" ]
5,839,814
1
5,839,826
null
15
11,322
How to animate/move the view in the curve path, is it possible to do using UIAnimation.![enter image description here](https://i.stack.imgur.com/pce1I.jpg) Like moving a view in the path as in the image.
How to move a view along a curved path in iOS
CC BY-SA 3.0
0
2011-04-30T05:36:15.573
2017-01-06T07:41:29.733
2011-04-30T10:40:27.900
21,234
300,517
[ "iphone", "objective-c", "ios", "core-animation", "uianimation" ]
5,839,917
1
5,839,951
null
0
200
I have a UITableView cell and I need to set it's label to "Sometext (number)". I can do that, but I need the "(number)" to be grayish, how can I do that? Here's an image which might make what I am trying to ask clearer: ![enter image description here](https://i.stack.imgur.com/pdU2d.png) I need the 12, 24, 48, 96 to be gray just like in this picture. Thanks.
Formatting UITableViewCell
CC BY-SA 3.0
null
2011-04-30T06:02:07.383
2011-04-30T06:09:07.963
null
null
635,064
[ "iphone", "objective-c", "cocoa-touch", "uitableview" ]
5,840,020
1
5,840,156
null
2
336
In the book I'm reading _Pro C# 2008 and the .NET Platform" there is a chapter on CIL with some code that I am confused about. ![enter image description here](https://i.stack.imgur.com/vImBq.png) Why is the step highlighted necessary? As I see it, this is what the code is doing. 1. A local integer variable "i" is created and is initialized to 0 (by virtue of integers are always initialized to 0 if not explicitly assigned a value) 2. (IL_0000) The value of the local variable [0] (which is "i") is loaded onto the stack 3. (IL_0001) Then the value is popped off the stack and assigned to "i" again . . . WHY? "i" is already 0!
What is this CIL code doing? Why is the 3rd step necessary?
CC BY-SA 3.0
null
2011-04-30T06:25:53.860
2011-04-30T07:11:52.760
2011-04-30T06:34:44.053
568,289
568,289
[ ".net", "for-loop", "cil" ]
5,840,219
1
5,844,125
null
8
1,002
I was going through an article by Robert C. Martin and at one place he gave a example like this: The first image shows that there's a cyclic dependency between the two packages. To remove this dependency a new interface is added in the second image. B implements the interface and Y uses it. And Martin makes the following point: > Interfaces are very often included in the package that uses them, rather than in the package that implements them. My question is, why should we arrange interfaces this way? What is the reasoning behind packaging interfaces this way? According to Common Closure Principle classes that change together should stay together. Is an interface closer to its implementer or its user, in terms of change??? ![enter image description here](https://i.stack.imgur.com/kzABr.jpg)
Why should we place interfaces with classes that use them rather than those that implement them?
CC BY-SA 3.0
0
2011-04-30T07:11:07.907
2011-04-30T19:40:54.930
null
null
281,504
[ "oop", "design-patterns", "package" ]
5,840,228
1
5,844,305
null
0
1,026
I have a csv file with 2 records. but when i try to upload this file through the magento upload module it's uploading more than 196 records. I crossed check with everything in my file only 2 records are there. What's the problem? It's related to cache or index something?? For your reference i attached the screenshot of the page also. ![enter image description here](https://i.stack.imgur.com/NBJVq.jpg)
Magento : Problem in Importing the csv file
CC BY-SA 3.0
null
2011-04-30T07:12:25.943
2011-05-01T00:55:09.773
null
null
489,046
[ "php", "mysql", "magento" ]
5,840,625
1
null
null
0
187
Here is the pic from Elastic... First time load the page: ![enter image description here](https://i.stack.imgur.com/Z4fvd.jpg) Focus, and blur:![enter image description here](https://i.stack.imgur.com/gLS9H.jpg) after typing ...![enter image description here](https://i.stack.imgur.com/FoEx7.jpg) I don't want the space occur, how can I remove them?? Thank you. Example from Elastic: [http://www.unwrongest.com/projects/elastic/](http://www.unwrongest.com/projects/elastic/)
How to remove abnormal space in Elastic (jquery plugin)
CC BY-SA 3.0
null
2011-04-30T08:38:04.110
2011-09-28T20:59:44.203
null
null
148,956
[ "css", "jquery-plugins", "textarea" ]
5,840,788
1
5,840,808
null
1
122
![enter image description here](https://i.stack.imgur.com/BfsHS.png) How can I create a modal to pop up just above the button clicked? As shown here above in the image, the pop up is just above the button "sleeping like a baby". I want the modal to pop up in a similar way. How can I do that?
How to present a modalView just above the control which makes it pop up?
CC BY-SA 3.0
0
2011-04-30T09:14:59.827
2011-04-30T09:21:17.583
null
null
463,857
[ "iphone", "objective-c", "cocoa-touch", "ipad" ]
5,840,802
1
6,332,819
null
26
6,512
I use the google map tool from [primefaces](https://www.primefaces.org/showcase/ui/data/gmap/basic.xhtml). I want my user to be able to place just one marker on a map. The values of the coordinates should be stored in a managed bean variables. How can I do that? See what I did so far: I created the map: ``` <f:view contentType="text/html"> <p:gmap id="gmap" center="36.890257,30.707417" zoom="13" type="HYBRID" style="width:600px;height:400px" model="#{mapBean.emptyModel}" onPointClick="handlePointClick(event);" widgetVar="map" /> </f:view> <p:dialog widgetVar="dlg" effect="FADE" effectDuration="0.5" close="false" fixedCenter="true"> <h:form prependId="false"> <h:panelGrid columns="2"> <h:outputLabel for="title" value="Title:" /> <p:inputText id="title" value="#{mapBean.title}" /> <f:facet name="footer"> <p:commandButton value="Add" actionListener="#{mapBean.addMarker}" update="messages" oncomplete="markerAddComplete()"/> <p:commandButton value="Cancel" onclick="return cancel()"/> </f:facet> </h:panelGrid> <h:inputHidden id="lat" value="#{newOfferSupportController.mapLocationX}" /> <h:inputHidden id="lng" value="#{newOfferSupportController.mapLocationY}" /> </h:form> </p:dialog> <script type="text/javascript"> var currentMarker = null; function handlePointClick(event) { if(currentMarker == null) { document.getElementById('lat').value = event.latLng.lat(); document.getElementById('lng').value = event.latLng.lng(); currentMarker = new google.maps.Marker({ position:new google.maps.LatLng(event.latLng.lat(), event.latLng.lng()) }); map.addOverlay(currentMarker); dlg.show(); } } function markerAddComplete() { var title = document.getElementById('title'); currentMarker.setTitle(title.value); title.value = ""; currentMarker = null; dlg.hide(); } function cancel() { dlg.hide(); currentMarker.setMap(null); currentMarker = null; return false; } </script> ``` I also greated the variables that will hold the coordinates: ``` @ManagedBean @RequestScoped public class NewOfferSupportController { private float mapLocationX; private float mapLocationY; //Get & set methods ``` It all works as in the primefaces [page](https://www.primefaces.org/showcase/ui/data/gmap/addMarkers.xhtml) but I have 2 problems: Problem 1: Once the marker is placed, it cannot be placed again. Problem 2: In the same form where the map is there are some other elements such as text fields. I noticed that validation does not occur when I click on the submit button located in the form where the map is, Actually the form does not get submitted at all(This didn't occur before i added the map), why is the map disrupting the validation? ![enter image description here](https://i.stack.imgur.com/qRwdt.png)
How to place markers on google map
CC BY-SA 3.0
0
2011-04-30T09:19:55.643
2018-03-12T02:15:57.037
2018-03-12T02:15:57.037
1,033,581
614,141
[ "java", "google-maps", "jsf-2", "primefaces" ]
5,840,999
1
5,841,331
null
0
191
Maybe someone knows where can i find this control or similar one. It looks and works really great ![Radeon Catalyst screen shot](https://i.stack.imgur.com/nEQV0.png)
Looking for wpf, .net control like the one used in Catalyst Control Center
CC BY-SA 3.0
null
2011-04-30T10:04:30.680
2011-04-30T11:03:58.280
null
null
596,935
[ ".net", "wpf", "windows-forms-designer" ]
5,841,274
1
5,842,616
null
0
271
I just noticed some rare error messages on my browser console, but i don't know what is the reason. I use some primefaces gadgets in my app, it all works fine, but when i navigate from one page to another i keep see this in the console: ![enter image description here](https://i.stack.imgur.com/LhlRo.png) I don't know what is wrong. I just want to mention that all my pages use one same template, that has the navigation gadget you see in the image above. In that template at the head tag i added this scripts: ``` <script type="text/javascript" src="/primefaces_resource/2.1/yui/utilities/utilities.js"></script> <script type="text/javascript" src="/primefaces_resource/2.1/yui/datasource/datasource-min.js"></script> <script type="text/javascript" src="/primefaces_resource/2.1/primefaces/paginator/paginator.js"></script> <script type="text/javascript" src="/primefaces_resource/2.1/yui/datatable/datatable-min.js"></script> <script type="text/javascript" src="/primefaces_resource/2.1/primefaces/datatable/datatable.js"></script> <script type="text/javascript" src="/primefaces_resource/2.1/yui/swf/swf-min.js"></script> <script type="text/javascript" src="/primefaces_resource/2.1/yui/charts/charts-min.js"></script> <script type="text/javascript" src="/primefaces_resource/2.1/primefaces/charts/charts.js"></script> <script type="text/javascript" src="/primefaces_resource/2.1/jquery/jquery.js"></script> <script type="text/javascript" src="/primefaces_resource/2.1/primefaces/core/core.js"></script> <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript" ></script> ``` This is the jars i added to my classpath to be able to use primefaces: ![enter image description here](https://i.stack.imgur.com/zMgAZ.png) I dont understand why do i see those messages all the time in the console?
Why this errors appear in my console?
CC BY-SA 3.0
0
2011-04-30T10:51:31.507
2011-04-30T15:07:25.433
2011-04-30T11:03:38.720
614,141
614,141
[ "java", "jsf", "jakarta-ee", "jsf-2", "primefaces" ]
5,841,283
1
5,841,398
null
1
4,818
please help me about that how i can convert my class into interface so other classes can use main menu . or let me know if there is easy way to call the same menu in the main class except extends bcz there are classes which already are extending other classes. here is the sample code ``` package com.droidnova.android.howto.optionmenu; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.widget.Toast; public class ControlMenu extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.settings: Intent intent = new Intent(this, ShowSettings.class); startActivity(intent); break; case R.id.services: Intent intent2 = new Intent(this, Test.class); startActivity(intent2); break; case R.id.Quit: finish(); break; default: break; } return true; } } ``` i want to call these menus into other classes (one of them are listed below) so that option menu is available on every activity without using extends. ``` public class Test extends ListActivity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.listplaceholder); ArrayList<HashMap<String, String>> mylist = new ArrayList<HashMap<String, String>>(); JSONObject json = JSONfunctions.getJSONfromURL("http://midsweden.gofreeserve.com/fetch.php"); try{ JSONArray earthquakes = json.getJSONArray("earthquakes"); for(int i=0;i<earthquakes.length();i++){ HashMap<String, String> map = new HashMap<String, String>(); JSONObject e = earthquakes.getJSONObject(i); map.put("id", String.valueOf(i)); map.put("name", "Earthquake name:" + e.getString("name")); map.put("password", "Magnitude: " + e.getString("password")); mylist.add(map); } }catch(JSONException e) { Log.e("log_tag", "Error parsing data "+e.toString()); } ListAdapter adapter = new SimpleAdapter(this, mylist , R.layout.test, new String[] { "name", "magnitude" }, new int[] { R.id.item_title, R.id.item_subtitle }); setListAdapter(adapter); final ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { @SuppressWarnings("unchecked") HashMap<String, String> o = (HashMap<String, String>) lv.getItemAtPosition(position); Toast.makeText(Test.this, "ID '" + o.get("id") + "' was clicked.", Toast.LENGTH_SHORT).show(); } }); } } ``` now i am following this way ``` package com.droidnova.android.howto.optionmenu; import android.app.Activity; import android.content.Intent; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.content.Intent; public class MenuHandler extends Activity{ private Activity activity; public MenuHandler(Activity activity) { this.activity = activity; } public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = activity.getMenuInflater(); inflater.inflate(R.menu.menu, menu); return true; } public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.settings: Intent intent = new Intent(this, ShowSettings.class); startActivity(intent); break; case R.id.services: Intent intent2 = new Intent(this, Test.class); startActivity(intent2); break; case R.id.Quit: finish(); break; default: break; } return true; } ``` } and Test class is ``` package com.droidnova.android.howto.optionmenu; import java.util.ArrayList; import java.util.HashMap; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; import android.app.ListActivity; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.SimpleAdapter; import android.widget.Toast; public class Test extends ListActivity { private MenuHandler menuHandler; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.listplaceholder); menuHandler = new MenuHandler(this); ArrayList<HashMap<String, String>> mylist = new ArrayList<HashMap<String, String>>(); JSONObject json = JSONfunctions.getJSONfromURL("http://midsweden.gofreeserve.com/fetch.php"); try{ JSONArray earthquakes = json.getJSONArray("earthquakes"); for(int i=0;i<earthquakes.length();i++){ HashMap<String, String> map = new HashMap<String, String>(); JSONObject e = earthquakes.getJSONObject(i); map.put("id", String.valueOf(i)); map.put("name", "Earthquake name:" + e.getString("name")); map.put("password", "Magnitude: " + e.getString("password")); mylist.add(map); } }catch(JSONException e) { Log.e("log_tag", "Error parsing data "+e.toString()); } ListAdapter adapter = new SimpleAdapter(this, mylist , R.layout.test, new String[] { "name", "magnitude" }, new int[] { R.id.item_title, R.id.item_subtitle }); setListAdapter(adapter); final ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { @SuppressWarnings("unchecked") HashMap<String, String> o = (HashMap<String, String>) lv.getItemAtPosition(position); Toast.makeText(Test.this, "ID '" + o.get("id") + "' was clicked.", Toast.LENGTH_SHORT).show(); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { return menuHandler.onCreateOptionsMenu(menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { return menuHandler.onOptionsItemSelected(item); } } ``` menu are perfectly appearing on the screen but when i am clicking on any menu it "Force to stop" pops up Now i am able to get logat errors Here they are ![enter image description here](https://i.stack.imgur.com/1Vyd1.png)
converting class into interface
CC BY-SA 3.0
null
2011-04-30T10:53:50.593
2011-04-30T18:48:19.800
2011-04-30T18:48:19.800
667,340
667,340
[ "java", "android" ]
5,841,370
1
6,242,793
null
18
12,376
I installed a fresh AMI for EC2 ([http://aws.amazon.com/amis/Microsoft/5147732567196848](http://aws.amazon.com/amis/Microsoft/5147732567196848)) and have installed Web deploy 2.1 on it. The web deploy 2.1 service is running for real as ``` netstat -an ``` Shows 8172 is being listened on by the Web Deployment Agent Service. But, when I try to deploy to this site using Project->right-click->Publish (via web deploy) I receive the following error message ``` ------ Build started: Project: Cir.Web, Configuration: Debug Any CPU ------ Cir.Web -> C:\Projects\CrazyInsaneRobot\Source\Cir.Web\bin\Cir.Web.dll ------ Publish started: Project: Cir.Web, Configuration: Debug Any CPU ------ Transformed Web.config using Web.Debug.config into obj\Debug\TransformWebConfig\transformed\Web.config. Auto ConnectionString Transformed Views\Web.config into obj\Debug\CSAutoParameterize\transformed\Views\Web.config. Auto ConnectionString Transformed obj\Debug\TransformWebConfig\transformed\Web.config into obj\Debug\CSAutoParameterize\transformed\Web.config. Copying all files to temporary location below for package/publish: obj\Debug\Package\PackageTmp. Start Web Deploy Publish the Application/package to https://ec2-175-41-170-198.ap-southeast-1.compute.amazonaws.com:8172/msdeploy.axd?site=Default%20Web%20Site ... C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3847,5): Warning : Retrying the sync because a socket error (10054) occurred. Retrying operation 'Serialization' on object sitemanifest (sourcePath). Attempt 1 of 10. C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3847,5): Warning : Retrying the sync because a socket error (10054) occurred. Retrying operation 'Serialization' on object sitemanifest (sourcePath). Attempt 2 of ... C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3847,5): Warning : Retrying the sync because a socket error (10054) occurred. Retrying operation 'Serialization' on object sitemanifest (sourcePath). Attempt 10 of 10. C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3847,5): Error : Web deployment task failed.(Could not complete the request to remote agent URL 'https://ec2-175-41-170-198.ap-southeast-1.compute.amazonaws.com:8172/msdeploy.axd?site=Default Web Site'.) This error indicates that you cannot connect to the server. Make sure the service URL is correct, firewall and network settings on this computer and on the server computer are configured properly, and the appropriate services have been started on the server. Error details: Could not complete the request to remote agent URL 'https://ec2-175-41-170-198.ap-southeast-1.compute.amazonaws.com:8172/msdeploy.axd?site=Default Web Site'. The underlying connection was closed: An unexpected error occurred on a send. Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. An existing connection was forcibly closed by the remote host Publish failed to deploy. ========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ========== ========== Publish: 0 succeeded, 1 failed, 0 skipped ========== ``` My firewall on the EC2 instance has been turned off. And my AWS firewall settings are ![http://dl.dropbox.com/u/7881451/ec2-firewall-settings.PNG](https://i.stack.imgur.com/RJdi7.png) which are the recommended settings. Other notes/thoughts: - - If anyone has any suggestions about how to debug this, I would be so ever grateful!
Can't get my EC2 Windows Server 2008 (Web stack) instance to receive publishings of my website
CC BY-SA 3.0
0
2011-04-30T11:11:06.340
2017-11-20T23:59:03.603
2014-09-21T10:05:52.690
1,505,120
209
[ "asp.net", "iis", "amazon-ec2", "webdeploy" ]
5,841,557
1
5,841,582
null
1
1,271
I'm Using JChart2d ([http://jchart2d.sourceforge.net/index.shtml](http://jchart2d.sourceforge.net/index.shtml)) for trace a values of a double array dynamically. when I code the configuration in the main method and run it it run perfectly. ![enter image description here](https://i.stack.imgur.com/WX1Y5.png) Here is the code. ``` public class WaveTracer { ITrace2D trace ; Chart2D chart ; double dataArray []; JFrame frame; public WaveTracer(int limit , double [] data){ trace = new Trace2DLtd(limit); dataArray = data; } public void configure(String framename, int fwidth , int fheight, int xpos , int ypos ){ try{ chart = new Chart2D(); trace.setColor(Color.RED); frame = new JFrame(framename); frame.addWindowListener(new WindowAdapter() { /** * @see java.awt.event.WindowAdapter#windowClosing(java.awt.event.WindowEvent) */ @Override public void windowClosing(final WindowEvent e) { System.exit(0); } }); frame.getContentPane().add(chart); frame.setSize(fwidth, fheight); frame.setLocation(xpos, ypos); }catch (Throwable f) { System.exit(0); } } public void trace(int speed) throws InterruptedException{ frame.setVisible(true); chart.addTrace(trace); for (int j = 0; j < dataArray.length; j++) { trace.addPoint(j,dataArray[j]); Thread.sleep(speed); } System.exit(0); } public static void main(String args []){ Random random = new Random(); double d[] = new double[2000]; int count=1; for(int i=200;i>=0;i--){ d[200-i] = random.nextDouble()*10.0; } WaveTracer wavetracer = new WaveTracer(5000, d); wavetracer.configure("plying wave form with time", 1000, 500, 200, 200); try { wavetracer.trace(150); } catch (InterruptedException ex) { Logger.getLogger(FrequencyDitectorForm.class.getName()).log(Level.SEVERE, null, ex); } } } ``` But I need draw the graph when I click on a "Draw" button which in in another form. I created a form which contains a button "Draw" and added the following code to the action click. ``` JFrame dialog = new JFrame(); Random random = new Random(); double d[] = new double[2000]; int count=1; for(int i=200;i>=0;i--){ d[200-i] = random.nextDouble()*10.0; } WaveTracer wavetracer = new WaveTracer(5000, d); wavetracer.configure("plying wave form with time", 1000, 500, 200, 200); try { wavetracer.trace(150); } catch (InterruptedException ex) { Logger.getLogger(FrequencyDitectorForm.class.getName()).log(Level.SEVERE, null, ex); } ``` ![enter image description here](https://i.stack.imgur.com/94KwE.png) But when I click on that button only the new frame loads and shows nothing in the frame. Then I have tested the loop by adding a messagebox to the loop. In that case it show the graph for each iteration of the loop. ![enter image description here](https://i.stack.imgur.com/HCAXG.png) Can some one please help me on this issue. How can I get draw this graph from a separate form without triggering a messagebox in every cycle of a loop.
How to call JChart2D dynamic graph using another JFrame
CC BY-SA 3.0
null
2011-04-30T11:52:36.367
2011-04-30T13:25:20.720
2011-04-30T11:59:04.040
522,444
288,135
[ "java", "charts", "real-time", "jframe" ]
5,841,818
1
5,991,114
null
68
33,295
In the documentation: Buttons Save or Fork are always present in the UI. First one appears if no fiddle was loaded, the latter is used to create a new fiddle from the existing one. I ONLY see SAVE when the fiddle is brand new, then RUN/update/fork. In Fx4 and Safari 5 on MAC (and Fx 4 on pc) ![enter image description here](https://i.stack.imgur.com/aLQAi.png) UPDATE: New BASE functionality does exactly what I wanted. ![New version](https://i.stack.imgur.com/AUAiy.png) From the [SO FAQ](https://stackoverflow.com/faq) > Stack Overflow is for professional and enthusiast programmers, people who write code because they love it. We feel the best Stack Overflow questions have a bit of source code in them, but if your question generally covers …- - - - … then you’re in the right place to ask your question!
How do I just SAVE a jsFiddle and not get a new version
CC BY-SA 3.0
0
2011-04-30T12:45:25.513
2019-09-28T19:07:30.063
2017-05-23T11:33:26.967
-1
295,783
[ "jsfiddle" ]
5,842,104
1
null
null
0
347
![](https://i.stack.imgur.com/wRbb9.png) The black line is added between my listview and the logo header. Any ideas on what to look for in the mark up? I don't understand where its coming from.
Android listview annoying black line
CC BY-SA 3.0
null
2011-04-30T13:39:59.657
2012-08-27T12:49:27.097
2011-04-30T13:41:21.137
390,278
732,426
[ "android", "listview", "android-layout" ]
5,842,174
1
5,843,058
null
0
940
Please help me out regarding the menu handler . I want to make menu handler which i can call in different activities . All things are working fine . list is fetching from the server and menu are also appearing but when i click on the any menu button "Force to close" Pops up . Here is the meun handler class ``` package com.droidnova.android.howto.optionmenu; import android.app.Activity; import android.content.Intent; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.content.Intent; public class MenuHandler extends Activity{ private Activity activity; public MenuHandler(Activity activity) { this.activity = activity; } public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = activity.getMenuInflater(); inflater.inflate(R.menu.menu, menu); return true; } public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.settings: Intent intent = new Intent(this, ShowSettings.class); startActivity(intent); break; case R.id.services: Intent intent2 = new Intent(this, Test.class); startActivity(intent2); break; case R.id.Quit: finish(); break; default: break; } return true; } } ``` over here i want the same menu to work . package com.droidnova.android.howto.optionmenu; ``` import java.util.ArrayList; import java.util.HashMap; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; import android.app.ListActivity; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.SimpleAdapter; import android.widget.Toast; public class Test extends ListActivity { private MenuHandler menuHandler; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.listplaceholder); menuHandler = new MenuHandler(this); ArrayList<HashMap<String, String>> mylist = new ArrayList<HashMap<String, String>>(); JSONObject json = JSONfunctions.getJSONfromURL("http://midsweden.gofreeserve.com/fetch.php"); try{ JSONArray earthquakes = json.getJSONArray("earthquakes"); for(int i=0;i<earthquakes.length();i++){ HashMap<String, String> map = new HashMap<String, String>(); JSONObject e = earthquakes.getJSONObject(i); map.put("id", String.valueOf(i)); map.put("name", "Earthquake name:" + e.getString("name")); map.put("password", "Magnitude: " + e.getString("password")); mylist.add(map); } }catch(JSONException e) { Log.e("log_tag", "Error parsing data "+e.toString()); } ListAdapter adapter = new SimpleAdapter(this, mylist , R.layout.test, new String[] { "name", "magnitude" }, new int[] { R.id.item_title, R.id.item_subtitle }); setListAdapter(adapter); final ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { @SuppressWarnings("unchecked") HashMap<String, String> o = (HashMap<String, String>) lv.getItemAtPosition(position); Toast.makeText(Test.this, "ID '" + o.get("id") + "' was clicked.", Toast.LENGTH_SHORT).show(); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { return menuHandler.onCreateOptionsMenu(menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { return menuHandler.onOptionsItemSelected(item); } } ``` Here is what i am getting in the logcat ![enter image description here](https://i.stack.imgur.com/OonEn.png)
Menu Handler for the activities
CC BY-SA 3.0
null
2011-04-30T13:51:56.950
2011-04-30T19:46:11.050
2020-06-20T09:12:55.060
-1
592,344
[ "java", "android" ]
5,842,268
1
5,875,112
null
0
746
I have been struggling for some time with the strange behavior of navigation bar items. I have segmented control on the navigation bar (take a look at the image below) ![enter image description here](https://i.stack.imgur.com/wAGV5.png) where button pushes table view controller with UISearchDisplayController. To show table view controller I use the code as it follows: ``` if (uiSegmentedControl.selectedSegmentIndex == 1 ) { DetailsTableVewController* detailsViewController = [[DetailsTableVewController alloc] initWithList:list]; [self.navigationController pushViewController:detailsViewController animated:YES]; [detailsViewController release]; } ``` Then to return back I use the following code: ``` [self.navigationController popViewControllerAnimated:YES]; ``` Although I use the code above to go back to the previous controller when UISearchDisplayController is either active or inactive I have different behavior of the navigation bar items. When UISearchDisplayController is active items disappear from the navigation bar ![enter image description here](https://i.stack.imgur.com/DSYka.png) Does anybody know why it happens? Thanks in advance.
Navigation bar items disappear from navigation bar
CC BY-SA 3.0
null
2011-04-30T14:07:47.893
2011-05-03T20:11:39.443
null
null
195,108
[ "ios4", "uinavigationcontroller", "uisearchdisplaycontroller" ]
5,842,396
1
5,842,408
null
0
353
Step 1:- Click on more ![enter image description here](https://i.stack.imgur.com/jzxQy.jpg) Step 2:- Click on add to cart to add an item to cart ![enter image description here](https://i.stack.imgur.com/0E1vY.jpg) This is my gridview ``` <asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" GridLines="None" Width="810px" CssClass="gridview" DataSourceID="SqlDataSource3" > <RowStyle BackColor="#F7F6F3" ForeColor="#333333" /> <Columns> <asp:TemplateField ShowHeader="False"> <ItemTemplate> <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Edit">More...</asp:LinkButton> </ItemTemplate> <EditItemTemplate> <asp:LinkButton ID="GVAddToCart" runat="server" onclick="GVAddToCart_Click">Add to cart</asp:LinkButton> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="itemName" SortExpression="itemName"> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Bind("itemName") %>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:Label ID="itemName" runat="server" Text='<%# Eval("itemName") %>'></asp:Label> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="price" SortExpression="price"> <ItemTemplate> <asp:Label ID="Label2" runat="server" Text='<%# Bind("price") %>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:Label ID="price" runat="server" Text='<%# Eval("price") %>'></asp:Label> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="offer" SortExpression="offer"> <ItemTemplate> <asp:Label ID="Label3" runat="server" Text='<%# Bind("offer") %>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:Label ID="offer" runat="server" Text='<%# Eval("offer") %>'></asp:Label> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="availability" SortExpression="availability"> <ItemTemplate> <asp:Label ID="Label4" runat="server" Text='<%# Bind("availability") %>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:Label ID="availability" runat="server" Text='<%# Eval("availability") %>'></asp:Label> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="shopName" SortExpression="shopName"> <ItemTemplate> <asp:Label ID="Label5" runat="server" Text='<%# Bind("shopName") %>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:Label ID="shopName" runat="server" Text='<%# Eval("shopName") %>'></asp:Label> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="address" SortExpression="address"> <ItemTemplate> <asp:Label ID="Label6" runat="server" Text='<%# Bind("address") %>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:Label ID="address" runat="server" Text='<%# Eval("address") %>'></asp:Label> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="email" SortExpression="email"> <ItemTemplate> <asp:Label ID="Label7" runat="server" Text='<%# Bind("email") %>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:Label ID="email" runat="server" Text='<%# Eval("email") %>'></asp:Label> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="phone" SortExpression="phone"> <ItemTemplate> <asp:Label ID="Label8" runat="server" Text='<%# Bind("phone") %>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:Label ID="phone" runat="server" Text='<%# Eval("phone") %>'></asp:Label> </EditItemTemplate> </asp:TemplateField> </Columns> <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" /> <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> <EditRowStyle BackColor="#999999" /> <AlternatingRowStyle BackColor="White" ForeColor="#284775" /> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:databaseConnectionString %>" SelectCommand="SELECT shopList.itemName, shopList.offer, shopList.price, shopList.availability, shopDescription.shopName, shopDescription.address, shopDescription.email, shopDescription.phone FROM shopList INNER JOIN shopDescription ON shopList.shopID = shopDescription.shopID"> </asp:SqlDataSource> ``` This is the code behind for the add to cart link button ``` Protected Sub GVAddToCart_Click(ByVal sender As Object, ByVal e As System.EventArgs) If User.Identity.Name = "" Then MsgBox("You need to login first before adding anything to the cart!", , "") Response.Redirect("~/login.aspx", True) Exit Sub End If Dim sCart = New cart Dim itemName, GVPrice, offer As Label Dim userID, buyNo, itemID As String itemID = Request.QueryString("itemID") itemName = CType(ListView1.Items(0).FindControl("itemName"), Label) userID = User.Identity.Name Dim index As Integer = GridView1.EditIndex GVPrice = CType(GridView1.Rows(index).FindControl("price"), Label) GVPrice.Text = CType(GVPrice.Text, Integer) offer = CType(GridView1.Rows(index).FindControl("offer"), Label) If sCart.CheckIfItemPresent(userID, itemID, GVPrice.Text, offer.Text) = True Then Exit Sub End If buyNo = sCart.findLatestBuyNo(userID) Session("buyNo") = buyNo Session("buyNo") = sCart.AddToCart(itemID, itemName.Text, GVPrice.Text, offer.Text, buyNo, userID) End Sub ``` So what I want to do is to remove the Step 1..how can i do this? If i remove the more link..it stops working...please help me. I have to click on the more link to to get the Add to cart link...I want to add an item to the cart in one click..with what i have now ...I need two clicks. When I click on more it goes to edit mode..then when I click on add to cart(which is in edit template)..it takes the price and offer values from the edit template..if i move the "Add To Cart" button into the `ItemTemplate`...it cant access the offer and price values. If i move the "Add To Cart" button into the `ItemTemplate` how will I know which row is being clicked?
How can I make the link in my GridView a single click?
CC BY-SA 3.0
null
2011-04-30T14:30:20.043
2015-05-08T19:41:07.880
2015-05-08T19:41:07.880
1,558,269
711,400
[ "asp.net" ]
5,842,504
1
5,850,099
null
1
1,864
Every time I test out my app on the emulator. "An error occurred with AppName. Please try again later." I have enabled internet access in the manifest .XML. This is what I have so far: ``` package com.xxxxxx; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.widget.TextView; import com.facebook.android.DialogError; import com.facebook.android.Facebook; import com.facebook.android.Facebook.DialogListener; import com.facebook.android.FacebookError; import com.facebook.android.Util; public class LunchtimeActivity extends Activity { Facebook facebook = new Facebook("xxxxxxxxxxxxxx"); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //setContentView(R.layout.main); facebook.authorize(this, new String [] {"user_location", "friend_location", "user_events", "friends_events"}, new DialogListener() { @Override public void onComplete(Bundle values) {} @Override public void onFacebookError(FacebookError error) {} @Override public void onError(DialogError e) {} @Override public void onCancel() {} }); Bundle parameters = new Bundle(); parameters.putString( "fields", "id,name" ); try { String response = facebook.request( "me/friends", parameters ); JSONObject json = Util.parseJson( response ); JSONArray data = json.getJSONArray( "data" ); for ( int i = 0; i < data.length(); i++ ) { JSONObject friend = data.getJSONObject( i ); String id = friend.getString( "id" ); String name = friend.getString( "name" ); Log.v("JSON", id); Log.v("JSON", name); } } catch (Exception e) {} catch (FacebookError f) {} TextView tv = new TextView(this); tv.setText("Hello, Android"); setContentView(tv); } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); facebook.authorizeCallback(requestCode, resultCode, data); } } ``` ![enter image description here](https://i.stack.imgur.com/zaTdi.png) Logcat output: ``` ... 05-01 02:21:01.601: DEBUG/Facebook-WebView(234): Webview loading URL: fbconnect://success/?error=invalid_scope&error_description=Unsupported+scope%3A+%27friend_location... ``` Eclipse console output: ``` [2011-05-01 02:18:57 - Lunchtime_1.0] ------------------------------ [2011-05-01 02:18:57 - Lunchtime_1.0] Android Launch! [2011-05-01 02:18:57 - Lunchtime_1.0] adb is running normally. [2011-05-01 02:18:57 - Lunchtime_1.0] Performing com.lunch.LunchtimeActivity activity launch [2011-05-01 02:18:57 - Lunchtime_1.0] Automatic Target Mode: Preferred AVD 'Now' is not available. Launching new emulator. [2011-05-01 02:18:57 - Lunchtime_1.0] Launching a new emulator with Virtual Device 'Now' [2011-05-01 02:19:03 - Emulator] 2011-05-01 02:19:03.471 emulator[3575:903] Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz. [2011-05-01 02:19:03 - Lunchtime_1.0] New emulator found: emulator-5554 [2011-05-01 02:19:03 - Lunchtime_1.0] Waiting for HOME ('android.process.acore') to be launched... [2011-05-01 02:20:20 - Lunchtime_1.0] WARNING: Application does not specify an API level requirement! [2011-05-01 02:20:20 - Lunchtime_1.0] Device API version is 7 (Android 2.1-update1) [2011-05-01 02:20:20 - Lunchtime_1.0] HOME is up on device 'emulator-5554' [2011-05-01 02:20:20 - Lunchtime_1.0] Uploading Lunchtime_1.0.apk onto device 'emulator-5554' [2011-05-01 02:20:20 - Lunchtime_1.0] Installing Lunchtime_1.0.apk... [2011-05-01 02:20:39 - Lunchtime_1.0] Success! [2011-05-01 02:20:39 - Lunchtime_1.0] Starting activity com.lunch.LunchtimeActivity on device emulator-5554 [2011-05-01 02:20:43 - Lunchtime_1.0] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.lunch/.LunchtimeActivity } ``` I'm literally just using the Facebook SDK provided by Facebook itself for Android and I can't make it work. Any ideas?
Facebook OAuth on Android
CC BY-SA 3.0
null
2011-04-30T14:50:55.740
2017-03-17T09:20:29.143
2017-03-17T09:20:29.143
1,915,448
712,997
[ "java", "android", "json", "facebook", "oauth" ]
5,842,871
1
5,844,767
null
5
2,097
really simpel markup: ``` <div id="page-wrap"> <div class="post horizontal"> <h2>Headline 01</h2> <div class="entry"> <p>Lorem ipsum dolor...</p> <p class="image"><img class="alignnone" src="some.jpg" alt="" width="1024" height="768"></p> <p class="image"><img class="alignnone" src="some.jpg" alt="" width="1024" height="768"></p> <p class="image"><img class="alignnone" src="some.jpg" alt="" width="1024" height="768"></p> </div> </div> <div class="post horizontal"> <h2>Headline 02</h2> <div class="entry"> <p>Lorem ipsum dolor...</p> <p class="image"><img class="alignnone" src="some.jpg" alt="" width="1024" height="768"></p> <p class="image"><img class="alignnone" src="some.jpg" alt="" width="1024" height="768"></p> <p class="image"><img class="alignnone" src="some.jpg" alt="" width="1024" height="768"></p> </div> </div> </div> ``` my css looks like this: ``` .horizontal { overflow-x:scroll; clear:both; } .horizontal p { float:left; width:500px; padding:0 20px 20px 0; } .horizontal p.image { width:1024px; } ``` I have no idea how I can create horzizontal "frames" like the mockup beneath without using actual frames. Right now, the images do not float because the with of .horizontal is 100% inside of #page-wrap. So they are aligned underneath each other. I want all images to be side by side within .horizontal. Each lane should have a seperate scrollbar that lets me scroll through the images. I want to create this: ![http://i.stack.imgur.com/p2Vfk.png](https://i.stack.imgur.com/BIyMR.png) Any idea how to solve this? Moreover I have a few more things I don't know how to solve... e.g. the scrollbars or each .horizontal should just appear if there is actual content that has to be scrolled (if there are no images the scollbar shouldn't be there) thank you for your help btw. I'm using jquery in my project, is this only possible with js?
html + css: horizontal scroll lanes?
CC BY-SA 3.0
0
2011-04-30T15:48:27.133
2011-04-30T21:43:04.117
2011-04-30T16:38:35.097
719,312
1,444,475
[ "html", "css", "layout", "scroll" ]
5,842,938
1
5,842,994
null
2
3,546
How would I make buttons appear in the Windows 7 Taskbar like the image below has it setup? [http://i.stack.imgur.com/ZcH1z.png](https://i.stack.imgur.com/ZcH1z.png) ![Buttons in tasbar](https://i.stack.imgur.com/ZcH1z.png) How would I create buttons in the taskbar with tooltiptext on the button like the picture above? C# Windows Form. Thanks.
How to create buttons in taskbar menu Windows 7 C#?
CC BY-SA 3.0
0
2011-04-30T15:58:15.883
2011-04-30T16:05:32.900
null
null
677,110
[ "c#", "taskbar" ]
5,843,085
1
5,845,752
null
2
4,609
I'm trying to replicate an answer given in a previous thread: [How to calculate a Fourier series in Numpy?](https://stackoverflow.com/questions/4258106/how-to-calculate-a-fourier-series-in-numpy) ``` import numpy as np import matplotlib.pyplot as plt import itertools def func(x): if x >= 1.0 or x <= -1.0: return 0 else: return (abs(x) - 1.0) a = 1.0 b = -1.0 N = 128. time = np.linspace( a, b, N ) y = (np.fromiter(itertools.imap(func, time), dtype=time.dtype, count=time.shape[0])) fig = plt.figure() ax = fig.add_subplot(1,1,1) ax.plot(time,y) period = 2. def cn(n): c = y*np.exp(-1j*2*n*np.pi*time/period) return c.sum()/c.size def f(x, Nh): f = np.array([2*cn(i)*np.exp(1j*2*i*np.pi*x/period) for i in range(1,Nh+1)]) return f.sum() y2 = np.array([f(t,10).real for t in time]) ax.plot(time, y2) plt.show() ``` I'm getting a solution that's close to the right answer, but shifted. I wasn't sure what I am doing wrong. ![shifted fourier series](https://i.stack.imgur.com/QXkPv.png)
Fourier Series in Numpy. Question about Previous Answer
CC BY-SA 3.0
0
2011-04-30T16:23:28.633
2012-07-31T18:53:30.977
2017-05-23T12:26:42.013
-1
308,962
[ "python", "numpy" ]
5,843,106
1
null
null
1
480
I writing my own textbox control in C# for Winforms. One thing i can't figure out: how to draw the text position sign in various sizes? ![Text position sign](https://i.stack.imgur.com/6wjRU.gif)
How to draw position sign?
CC BY-SA 3.0
null
2011-04-30T16:25:45.933
2016-06-27T02:06:44.723
2016-06-27T02:06:44.723
3,204,551
191,727
[ "c#", ".net", "winforms", "textbox", "ownerdrawn" ]
5,843,334
1
5,843,387
null
2
3,441
There's something that I don't understand with SharedPreference. In [this document](http://developer.android.com/reference/android/content/SharedPreferences.html) it says that the getStringSet() method is supported from API 1. But I found no method like that. I use API 8 for my apps. What's happening here? Is it not supported anymore? ps : There's no difference with the SharedPreference.Editor. There's no putStringSet() in the editor class. screenshot : look.. no getStringSet() ![enter image description here](https://i.stack.imgur.com/JOO9J.jpg)
SharedPreferences.getStringSet() not found?
CC BY-SA 3.0
null
2011-04-30T17:06:53.400
2013-01-17T01:34:08.213
2011-04-30T17:18:58.467
616,280
616,280
[ "android", "sharedpreferences" ]
5,843,343
1
5,843,880
null
0
1,339
In Django, I made a UserProfile class and linked it to the User with user = models.OneToOneField(User) That works fine, looks like this: ![enter image description here](https://i.stack.imgur.com/dMVXS.png) Where the UserProfile is visible (with only one field). However, I am also using the option that I discovered today. I can get the User fields editable in list view, like this: ![enter image description here](https://i.stack.imgur.com/LqxrN.png) Very nice feature, but one I can find little information about. What I want to do is add UserProfile fields to this list in an editable way (the email_verified field in the above example, to begin with). Is that possible to do (without changing Django code)? If so, how would I do that? Many thanks, UPDATE: Seriously, how can I make the question more useful if I can't use links, images, nothing? Information about list_editable is in the Django help, hopefully Google helps.
Django admin list_editable profile
CC BY-SA 3.0
null
2011-04-30T17:08:16.070
2011-04-30T18:45:39.067
2011-04-30T17:13:19.180
273,200
723,090
[ "django", "admin", "authentication" ]
5,843,562
1
18,878,059
null
21
23,847
I'd like to modify the spacing between characters in a WPF TextBox. Something like the `letter-spacing: 5px` thing that is available in CSS. I think it is possible in XAML; what's the simplest way? I found the "[Introduction to the GlyphRun Object and Glyphs Element](http://msdn.microsoft.com/en-us/library/ms748985.aspx)" document, and found it to be exceedingly unhelpful. This is a code example from that page: ``` <!-- "Hello World!" with explicit character widths for proportional font --> <Glyphs FontUri = "C:\WINDOWS\Fonts\ARIAL.TTF" FontRenderingEmSize = "36" UnicodeString = "Hello World!" Indices = ",80;,80;,80;,80;,80;,80;,80;,80;,80;,80;,80" Fill = "Maroon" OriginX = "50" OriginY = "225" /> ``` The same documentation page gives this "explanation" for what the `Indices` property does: ![enter image description here](https://i.stack.imgur.com/f96zn.png) I have no idea what any of that means. I'm also not sure that Indices is the right thing - the comment in the code speaks of "character widths" which I don't care about. I want to adjust the width characters. Also, there is no example for how to apply a `Glyphs` element to a TextBox. When I tried it, my WPF test app just crashed. --- What I want to do is slightly increase the empty space that appears between drawn characters within a WPF TextBox. The text will vary in length and content. Do I have to modify the `Indicies` property every time there is a new character? Is there a way to say "make it 20% more space than usual, for every character". Can anybody help me?
How can I specify letter spacing or kerning, in a WPF TextBox?
CC BY-SA 3.0
0
2011-04-30T17:47:51.573
2021-07-04T13:14:54.053
2011-04-30T18:07:24.487
48,082
48,082
[ "wpf", "xaml", "textbox", "kerning" ]
5,844,414
1
5,844,599
null
0
293
Please help me out regarding repeating the menu. First class: ``` public class A extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.settings: Intent intent = new Intent(this, ShowSettings.class); startActivity(intent); break; case R.id.services: Intent intent2 = new Intent(this, Test.class); startActivity(intent2); break; case R.id.Quit: finish(); break; default: break; } return true; } } ``` second class ``` public class Test extends ListActivity { @Override public void onCreate(Bundle savedInstanceState) { over here i will be fetching the list from the server } @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.settings: Intent intent = new Intent(this, ShowSettings.class); startActivity(intent); break; case R.id.services: Intent intent2 = new Intent(this, Test.class); startActivity(intent2); break; case R.id.Quit: finish(); break; default: break; } return true; } } ``` I have tried [in this way](https://stackoverflow.com/questions/5841283/converting-class-into-interface) but it was not working. previous logcat ``` 04-30 23:32:09.906: ERROR/vold(26): Error opening switch name path '/sys/class/switch/test2' (No such file or directory) 04-30 23:32:09.906: ERROR/vold(26): Error bootstrapping switch '/sys/class/switch/test2' (No such file or directory) 04-30 23:32:09.906: ERROR/vold(26): Error opening switch name path '/sys/class/switch/test' (No such file or directory) 04-30 23:32:09.906: ERROR/vold(26): Error bootstrapping switch '/sys/class/switch/test' (No such file or directory) 04-30 23:32:26.345: ERROR/MemoryHeapBase(65): error opening /dev/pmem: No such file or directory 04-30 23:32:26.345: ERROR/SurfaceFlinger(65): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake 04-30 23:32:26.475: ERROR/libEGL(65): couldn't load <libhgl.so> library (Cannot load library: load_library[984]: Library 'libhgl.so' not found) 04-30 23:32:27.234: ERROR/libEGL(76): couldn't load <libhgl.so> library (Cannot load library: load_library[984]: Library 'libhgl.so' not found) 04-30 23:32:31.694: ERROR/BatteryService(65): Could not open '/sys/class/power_supply/usb/online' 04-30 23:32:31.694: ERROR/BatteryService(65): Could not open '/sys/class/power_supply/battery/batt_vol' 04-30 23:32:31.694: ERROR/BatteryService(65): Could not open '/sys/class/power_supply/battery/batt_temp' 04-30 23:32:32.445: ERROR/EventHub(65): could not get driver version for /dev/input/mouse0, Not a typewriter 04-30 23:32:32.445: ERROR/EventHub(65): could not get driver version for /dev/input/mice, Not a typewriter 04-30 23:32:33.116: ERROR/System(65): Failure starting core service 04-30 23:32:33.116: ERROR/System(65): java.lang.SecurityException 04-30 23:32:33.116: ERROR/System(65): at android.os.BinderProxy.transact(Native Method) 04-30 23:32:33.116: ERROR/System(65): at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146) 04-30 23:32:33.116: ERROR/System(65): at android.os.ServiceManager.addService(ServiceManager.java:72) 04-30 23:32:33.116: ERROR/System(65): at com.android.server.ServerThread.run(SystemServer.java:162) 04-30 23:32:33.125: ERROR/AndroidRuntime(65): Crash logging skipped, no checkin service 04-30 23:32:35.514: ERROR/LockPatternKeyguardView(65): Failed to bind to GLS while checking for account 04-30 23:32:43.175: ERROR/ActivityThread(109): Failed to find provider info for com.google.settings 04-30 23:32:43.205: ERROR/ActivityThread(109): Failed to find provider info for com.google.settings 04-30 23:32:49.344: ERROR/ApplicationContext(65): Couldn't create directory for SharedPreferences file shared_prefs/wallpaper-hints.xml 04-30 23:32:50.144: ERROR/vold(26): Cannot start volume '/sdcard' (volume is not bound) 04-30 23:32:52.407: ERROR/ActivityThread(106): Failed to find provider info for android.server.checkin 04-30 23:32:55.918: ERROR/MediaPlayerService(30): Couldn't open fd for content://settings/system/notification_sound 04-30 23:32:55.949: ERROR/MediaPlayer(65): Unable to to create media player 04-30 23:32:56.969: ERROR/ActivityThread(106): Failed to find provider info for android.server.checkin 04-30 23:32:57.237: ERROR/ActivityThread(106): Failed to find provider info for android.server.checkin 04-30 23:33:18.468: ERROR/AndroidRuntime(212): Uncaught handler: thread main exiting due to uncaught exception 04-30 23:33:18.848: ERROR/AndroidRuntime(212): java.lang.NullPointerException 04-30 23:33:18.848: ERROR/AndroidRuntime(212): at android.widget.SimpleAdapter.getCount(SimpleAdapter.java:95) 04-30 23:33:18.848: ERROR/AndroidRuntime(212): at android.widget.AdapterView.checkFocus(AdapterView.java:689) 04-30 23:33:18.848: ERROR/AndroidRuntime(212): at android.widget.AdapterView$AdapterDataSetObserver.onInvalidated(AdapterView.java:813) 04-30 23:33:18.848: ERROR/AndroidRuntime(212): at android.database.DataSetObservable.notifyInvalidated(DataSetObservable.java:43) 04-30 23:33:18.848: ERROR/AndroidRuntime(212): at android.widget.BaseAdapter.notifyDataSetInvalidated(BaseAdapter.java:54) 04-30 23:33:18.848: ERROR/AndroidRuntime(212): at android.widget.SimpleAdapter$SimpleFilter.publishResults(SimpleAdapter.java:391) 04-30 23:33:18.848: ERROR/AndroidRuntime(212): at android.widget.Filter$ResultsHandler.handleMessage(Filter.java:282) 04-30 23:33:18.848: ERROR/AndroidRuntime(212): at android.os.Handler.dispatchMessage(Handler.java:99) 04-30 23:33:18.848: ERROR/AndroidRuntime(212): at android.os.Looper.loop(Looper.java:123) 04-30 23:33:18.848: ERROR/AndroidRuntime(212): at android.app.ActivityThread.main(ActivityThread.java:4203) 04-30 23:33:18.848: ERROR/AndroidRuntime(212): at java.lang.reflect.Method.invokeNative(Native Method) 04-30 23:33:18.848: ERROR/AndroidRuntime(212): at java.lang.reflect.Method.invoke(Method.java:521) 04-30 23:33:18.848: ERROR/AndroidRuntime(212): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 04-30 23:33:18.848: ERROR/AndroidRuntime(212): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 04-30 23:33:18.848: ERROR/AndroidRuntime(212): at dalvik.system.NativeStart.main(Native Method) 04-30 23:33:29.837: ERROR/ActivityThread(109): Failed to find provider info for android.server.checkin 04-30 23:33:29.849: ERROR/GoogleHttpClient(109): Error recording stats 04-30 23:33:29.849: ERROR/GoogleHttpClient(109): java.lang.IllegalArgumentException: Unknown URL content://android.server.checkin/stats 04-30 23:33:29.849: ERROR/GoogleHttpClient(109): at android.content.ContentResolver.insert(ContentResolver.java:476) 04-30 23:33:29.849: ERROR/GoogleHttpClient(109): at com.google.android.net.GoogleHttpClient.executeWithoutRewriting(GoogleHttpClient.java:241) 04-30 23:33:29.849: ERROR/GoogleHttpClient(109): at com.google.android.net.GoogleHttpClient.execute(GoogleHttpClient.java:278) 04-30 23:33:29.849: ERROR/GoogleHttpClient(109): at com.google.android.net.GoogleHttpClient.execute(GoogleHttpClient.java:348) 04-30 23:33:29.849: ERROR/GoogleHttpClient(109): at com.google.android.providers.enhancedgooglesearch.SuggestionProvider.sendGenieSearchRequest(SuggestionProvider.java:587) 04-30 23:33:29.849: ERROR/GoogleHttpClient(109): at com.google.android.providers.enhancedgooglesearch.SuggestionProvider.querySearchSuggestions(SuggestionProvider.java:316) 04-30 23:33:29.849: ERROR/GoogleHttpClient(109): at com.google.android.providers.enhancedgooglesearch.SuggestionProvider.query(SuggestionProvider.java:262) 04-30 23:33:29.849: ERROR/GoogleHttpClient(109): at android.content.ContentProvider$Transport.query(ContentProvider.java:129) 04-30 23:33:29.849: ERROR/GoogleHttpClient(109): at android.content.ContentResolver.query(ContentResolver.java:152) 04-30 23:33:29.849: ERROR/GoogleHttpClient(109): at com.android.globalsearch.SearchableSuggestionSource.getSuggestions(SearchableSuggestionSource.java:268) 04-30 23:33:29.849: ERROR/GoogleHttpClient(109): at com.android.globalsearch.SearchableSuggestionSource.getCursor(SearchableSuggestionSource.java:216) 04-30 23:33:29.849: ERROR/GoogleHttpClient(109): at com.android.globalsearch.SearchableSuggestionSource.getSuggestions(SearchableSuggestionSource.java:166) 04-30 23:33:29.849: ERROR/GoogleHttpClient(109): at com.android.globalsearch.AbstractSuggestionSource$1.call(AbstractSuggestionSource.java:75) 04-30 23:33:29.849: ERROR/GoogleHttpClient(109): at com.android.globalsearch.AbstractSuggestionSource$1.call(AbstractSuggestionSource.java:68) 04-30 23:33:29.849: ERROR/GoogleHttpClient(109): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:256) 04-30 23:33:29.849: ERROR/GoogleHttpClient(109): at java.util.concurrent.FutureTask.run(FutureTask.java:122) 04-30 23:33:29.849: ERROR/GoogleHttpClient(109): at com.android.globalsearch.QueryMultiplexer$SuggestionRequest.run(QueryMultiplexer.java:172) 04-30 23:33:29.849: ERROR/GoogleHttpClient(109): at com.android.globalsearch.PerTagExecutor$Limiter$1.run(PerTagExecutor.java:106) 04-30 23:33:29.849: ERROR/GoogleHttpClient(109): at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648) 04-30 23:33:29.849: ERROR/GoogleHttpClient(109): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673) 04-30 23:33:29.849: ERROR/GoogleHttpClient(109): at java.lang.Thread.run(Thread.java:1060) 04-30 23:33:29.849: ERROR/GoogleHttpClient(109): at com.android.globalsearch.SuggestionProvider$SuggestionThread.run(SuggestionProvider.java:102) 04-30 23:33:29.998: ERROR/ActivityThread(109): Failed to find provider info for android.server.checkin 04-30 23:33:30.047: ERROR/GoogleHttpClient(109): Error recording stats 04-30 23:33:30.047: ERROR/GoogleHttpClient(109): java.lang.IllegalArgumentException: Unknown URL content://android.server.checkin/stats 04-30 23:33:30.047: ERROR/GoogleHttpClient(109): at android.content.ContentResolver.insert(ContentResolver.java:476) 04-30 23:33:30.047: ERROR/GoogleHttpClient(109): at com.google.android.net.GoogleHttpClient.executeWithoutRewriting(GoogleHttpClient.java:241) 04-30 23:33:30.047: ERROR/GoogleHttpClient(109): at com.google.android.net.GoogleHttpClient.execute(GoogleHttpClient.java:278) 04-30 23:33:30.047: ERROR/GoogleHttpClient(109): at com.google.android.net.GoogleHttpClient.execute(GoogleHttpClient.java:348) 04-30 23:33:30.047: ERROR/GoogleHttpClient(109): at com.google.android.providers.enhancedgooglesearch.SuggestionProvider.sendGenieSearchRequest(SuggestionProvider.java:587) 04-30 23:33:30.047: ERROR/GoogleHttpClient(109): at com.google.android.providers.enhancedgooglesearch.SuggestionProvider.querySearchSuggestions(SuggestionProvider.java:316) 04-30 23:33:30.047: ERROR/GoogleHttpClient(109): at com.google.android.providers.enhancedgooglesearch.SuggestionProvider.query(SuggestionProvider.java:262) 04-30 23:33:30.047: ERROR/GoogleHttpClient(109): at android.content.ContentProvider$Transport.query(ContentProvider.java:129) 04-30 23:33:30.047: ERROR/GoogleHttpClient(109): at android.content.ContentResolver.query(ContentResolver.java:152) 04-30 23:33:30.047: ERROR/GoogleHttpClient(109): at com.android.globalsearch.SearchableSuggestionSource.getSuggestions(SearchableSuggestionSource.java:268) 04-30 23:33:30.047: ERROR/GoogleHttpClient(109): at com.android.globalsearch.SearchableSuggestionSource.getCursor(SearchableSuggestionSource.java:216) 04-30 23:33:30.047: ERROR/GoogleHttpClient(109): at com.android.globalsearch.SearchableSuggestionSource.getSuggestions(SearchableSuggestionSource.java:166) 04-30 23:33:30.047: ERROR/GoogleHttpClient(109): at com.android.globalsearch.AbstractSuggestionSource$1.call(AbstractSuggestionSource.java:75) 04-30 23:33:30.047: ERROR/GoogleHttpClient(109): at com.android.globalsearch.AbstractSuggestionSource$1.call(AbstractSuggestionSource.java:68) 04-30 23:33:30.047: ERROR/GoogleHttpClient(109): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:256) 04-30 23:33:30.047: ERROR/GoogleHttpClient(109): at java.util.concurrent.FutureTask.run(FutureTask.java:122) 04-30 23:33:30.047: ERROR/GoogleHttpClient(109): at com.android.globalsearch.QueryMultiplexer$SuggestionRequest.run(QueryMultiplexer.java:172) 04-30 23:33:30.047: ERROR/GoogleHttpClient(109): at com.android.globalsearch.PerTagExecutor$Limiter$1.run(PerTagExecutor.java:106) 04-30 23:33:30.047: ERROR/GoogleHttpClient(109): at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648) 04-30 23:33:30.047: ERROR/GoogleHttpClient(109): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673) 04-30 23:33:30.047: ERROR/GoogleHttpClient(109): at java.lang.Thread.run(Thread.java:1060) 04-30 23:33:30.047: ERROR/GoogleHttpClient(109): at com.android.globalsearch.SuggestionProvider$SuggestionThread.run(SuggestionProvider.java:102) ``` instead of emulator when i tried to run on the android i got the following logcat ![enter image description here](https://i.stack.imgur.com/Ni3e1.png)
repetition in the menu
CC BY-SA 3.0
null
2011-04-30T20:25:19.940
2011-04-30T21:56:53.670
2017-05-23T12:02:54.450
-1
667,340
[ "java", "android" ]
5,844,709
1
5,844,723
null
1
108
What's this? ![enter image description here](https://i.stack.imgur.com/2RSsI.png) And how do I get rid of it? [Actual webpage here](http://www.glamourunderground.com/how-to-start-running/).
Getting rid of undesired layout element on webpage
CC BY-SA 3.0
null
2011-04-30T21:27:47.337
2011-05-01T07:20:56.770
2011-05-01T06:32:13.457
218,717
725,430
[ "html", "css", "layout", "cross-browser", "stylesheet" ]
5,844,845
1
5,844,878
null
4
13,441
I came across two special characters which seem not to be covered by the `ISO-8859-1` character set i.e. they don't make it through to my program. The German `ß` and the Norwegian `ø` i'm reading the files as follows: ``` FileInputStream inputFile = new FileInputStream(corpus[i]); InputStreamReader ir = new InputStreamReader(inputFile, "ISO-8859-1") ; ``` Is there a way for me to read these characters without having to apply manual replacement as a workaround? [EDIT] this is how it looks on screen. Note that i have no problems with other accents e.g. è and the lot... ![enter image description here](https://i.stack.imgur.com/Rx9Fq.jpg)
reading file with accented characters in Java
CC BY-SA 3.0
0
2011-04-30T21:51:57.913
2013-03-20T10:23:53.170
2011-04-30T22:12:21.943
null
null
[ "java", "encoding" ]
5,845,379
1
5,847,356
null
0
333
I am wanting to set up a blend (without using shaders preferably) to produce the following. I have a black/white textured quad, and a quad of a solid color(for example red). I'd like the blend to show the color (red) where all the white pixels are and black otherwise. Is this possible and what does the code look like? ![enter image description here](https://i.stack.imgur.com/l1Sd4.png)
OpenGL Blending Color over Monochrome
CC BY-SA 3.0
null
2011-04-30T23:46:48.400
2011-05-01T08:24:58.237
null
null
233,211
[ "opengl", "blend" ]
5,845,398
1
5,845,462
null
2
292
Part of my database schema involves the entities: ``` Jobs Agencies Agents and relation JobAgent ``` - - - The database will be SQL Server 2008 Here is my schema: ![enter image description here](https://i.stack.imgur.com/SJqI6.jpg) My problem is that Jobs.agencyid must always be equal to Agents.agencyid when related through JobAgent. If Jobs.agencyid were to be updated to a new agency, The Agents would then belong to a different Agency than the Job. What would be the best way to redesign my schema to avoid relying on triggers or application code to ensure this consistency?
Database schema consistency issue
CC BY-SA 3.0
null
2011-04-30T23:53:20.547
2011-05-01T07:38:25.200
2011-05-01T00:01:51.933
135,152
732,790
[ "sql-server", "sql-server-2008", "database-design", "data-modeling" ]
5,845,792
1
null
null
3
2,245
A comic book page is composed of several rectangle area, and some of them may overlap with each other like below. Also those rectangles may not be horizontal aligned. What is the best strategy to detect the coordinates and dimension of the individual rectangle area ? My platform is iOS and Android. I think there may be no API to solve the problem directly. I just wanna know what is the algorithm to deal with it ? Thanks. ![enter image description here](https://i.stack.imgur.com/PADZw.jpg)
How to detect the rectangle area on a comic book page?
CC BY-SA 3.0
null
2011-05-01T01:34:56.933
2019-10-25T06:57:09.867
2019-06-20T08:06:33.443
400,275
403,015
[ "android", "iphone", "opencv", "ipad", "graphics" ]
5,845,831
1
5,846,032
null
0
1,286
I am trying to create an iphone application where I need an expandable UITextView. I am looking for something similar to a feature in contacts app for adding notes. ![](https://i.stack.imgur.com/a4b2Y.png)
How can I create a UITextView that expands vertically as required?
CC BY-SA 3.0
0
2011-05-01T01:46:35.287
2011-05-01T02:35:27.520
null
null
163,587
[ "ios", "uitextview" ]
5,845,891
1
5,872,739
null
0
200
When I create drawing shapes I cant see any color or fill. I know there is a setting that need to be changed so I can see them. Here is a pick of what is happening on my screen: ![enter image description here](https://i.stack.imgur.com/2T88d.png) I draw the shape and all I see is the green outline, any suggestions?
How do I change the drawing setting to show the objects filled?
CC BY-SA 3.0
null
2011-05-01T02:00:34.250
2011-05-03T16:36:50.317
null
null
128,860
[ "flash-cs5" ]
5,846,172
1
null
null
8
3,674
Problem I am facing is joining of individual polygons. Each is a 4-point polygon. The final result is then a merge / union of two polygons. Following image shows one version of possible result (results may vary, because that black filled part can be different for each result). ![](https://i.stack.imgur.com/J7rru.png) I start with something like: ``` Polygon one = [A,B,C,D]; // (A/B/C/D) might look like : new Point {x = 10, y = 15} Polygon two = [E,F,G,H]; ``` And I need an algorithm for calculating union of these two sets, so I will get result like: ``` Polygon total = [I,J,K,L,M,N]; // = new points ``` I don't have to visualize it (even when I do..), I just need the set of points defining new polygon (union of those two), because my final result will be a centroid of that merged polygon. I already have algorithm to calculate centroid based on set of input points. But I need to get the right points first. So far, I have found mentions about convex-hull algorithm, but I am afraid that it would generate following polygon (which is wrong): ![](https://i.stack.imgur.com/bZuX5.png) I have a program, that is able to work with objects, that are represented by 4 points. Each point has two attributes (x coordinate, y coordinate). Then the program is able to draw lines between these points. These lines will then look like a square, rectangle or polygon.. this result depends on given coordinates, but I know, that I will be always using points, that will generate polygons. Once the points are connected, the program is able to fill this connected area. Once this is drawn, you can see following image: [](https://i.stack.imgur.com/oZzmU.png) BUT: The program doesn't know, that he just made a polygon. He only knows, that he got 4 points from me, he connected them and filled them. Then I have second object (=polygon), which is defined by another set of points (different coordinates). Program again doesn't know that he's creating a filled polygon.. he just did some operations with 4 given points. Result in this case is another polygon: [](https://i.stack.imgur.com/Xbqga.png) Now, we just draw two polygons at display.. and we gave them such coordinates, that they overlap each other. The result looks like this (considering only the filled area): ![](https://i.stack.imgur.com/J7rru.png) My program just draw two polygons. Fine. You can see at your screen only one polygon (because there are two overlaping = they look like one piece) and . I already have an algorithm, that will accept a set of points (representing a points forming polygon) and counting a centroid from these points. But I can't use the algorithm now, because I can't give him the needed points, because I do not know them. Here are the points, that I want as a result: [](https://i.stack.imgur.com/7U7NK.png) So my algorithm should start with points A,B,C,D,E,F,G,H and he should give me points I,J,K,L,M,N as a result. And I thought, that `union of two polygons` would be enough to explain :)
How to merge two polygons (arrays of objects) programatically?
CC BY-SA 4.0
0
2011-05-01T03:11:25.157
2019-08-10T10:11:00.167
2020-06-20T09:12:55.060
-1
732,962
[ "c#", "algorithm" ]
5,846,220
1
null
null
0
325
Create new project from opengl template via xcode4, you will see one color square moving. I want to put two more small views to show the same thing. What I did is to add two ``` EAGLView *glView1; EAGLView *glView2; ``` Then set up with property/systhesize etc, and same coding with self.view like these ``` [(EAGLView *)self.view setContext:context]; [(EAGLView *)self.view setFramebuffer]; if (!glView2) { glView2 = [[EAGLView alloc] init]; } [self.glView2 setContext:context2]; [self.glView2 setFramebuffer]; if (!glView1) { glView1 = [[EAGLView alloc] init]; } [self.glView1 setContext:context]; [self.glView1 setFramebuffer]; ``` Do same thing for other place which self.view did. Also do the right thing to link within interface builder. (xcode4) But the result show ![enter image description here](https://i.stack.imgur.com/qpxDw.png) I found that the last draw order in drawFrame will decide which window will show ``` [self.glView1 setFramebuffer]; [self.glView2 setFramebuffer]; // these will not show , but if put last, it will show [(EAGLView *)self.view setFramebuffer]; // this will work ``` Does that make sense to explain my purpose and issues ? Thanks very much for point out the root cause and help me go through this.
Questions for hacking OpenGL ES2 template project from Xcode 4
CC BY-SA 3.0
null
2011-05-01T03:28:17.257
2012-02-02T01:07:52.673
null
null
338,204
[ "ios", "ios4", "opengl-es-2.0" ]
5,846,268
1
null
null
2
3,877
I'm trying to use the web service at this link: [https://www.fedex.com/wpor/web/jsp/drclinks.jsp?links=wss/getstarted.html](https://www.fedex.com/wpor/web/jsp/drclinks.jsp?links=wss/getstarted.html) I'm trying to use the Rate service, I downloaded the C# sample code. I'm bad at explaining what's going on, so I'll use images. Here's what the sample project files look like: ![enter image description here](https://i.stack.imgur.com/U0FmU.png) Everything works fine in this sample project. I want to use it in an existing project that I have. I tried just copying over the Web References folder into my project, but my solution files look like: ![enter image description here](https://i.stack.imgur.com/x4zcB.png) My experience with web services is very limited, so I'm not sure what I need to do here to get the web reference working on my solution, and getting it working in Visual Studio is confusing. I'm using .NET 4.0
Copying a web reference to a new project
CC BY-SA 3.0
null
2011-05-01T03:42:12.460
2021-10-17T10:02:37.520
null
null
295,302
[ "c#", "asp.net", "asp.net-mvc", "web-services" ]
5,846,293
1
5,846,678
null
0
643
I am new to Javascript and need some help. See the image first: ![here's a link](https://i.stack.imgur.com/6aPSS.jpg). Points predictor application. Basically when the user selects the winning team through the radio button it should add 10 points to the winning team in the points column and and sort the table (row sorting)automatically based on the points the team has higher points higher position. Does anyone have any ideas how to achieve this? Here's the HTML: ``` <div> <table id="pointsTable" border="1" cellspacing="0" cellpadding="5"> <tr> <th scope="col">name</th> <th scope="col">played</th> <th scope="col">won</th> <th scope="col">lost</th> <th scope="col">points</th> </tr> <tr id="teamA"> <td>team A</td> <td>3</td> <td>2</td> <td>1</td> <td id="teamApoints">20</td> </tr> <tr id="teamB"> <td>team B</td> <td>4</td> <td>2</td> <td>2</td> <td id="teamBpoints">20</td> </tr> <tr id="teamC"> <td>team C</td> <td>3</td> <td>1</td> <td>2</td> <td id="teamCpoints">10</td> </tr> <tr id="teamD"> <td>team D</td> <td>4</td> <td>0;</td> <td>4</td> <td id="teamDpoints">0</td> </tr> </table> </div> <div> <form> team A vs team C <br/> team A <input type="radio" name="winner" value="teamA" /> team C <input type="radio" name="winner" value="teamC" /> <br/> <br/> team B vs team D <br/> team B <input type="radio" name="winner" value="teamB" /> team D <input type="radio" name="winner" value="teamD" /> <br/> <br/> team A vs team D <br/> team A <input type="radio" name="winner" value="teamA" /> team D <input type="radio" name="winner" value="teamD" /> <br/> <br/> team B vs team C <br/> team B <input type="radio" name="winner" value="teamB" /> team C <input type="radio" name="winner" value="teamC" /> </form> </div> ```
Javascript help, tables and radio buttons
CC BY-SA 3.0
null
2011-05-01T03:48:48.113
2017-10-31T08:42:04.207
2017-10-31T08:42:04.207
4,370,109
732,981
[ "javascript", "html-table", "radio-button" ]
5,846,429
1
13,090,396
null
19
15,822
![All one line](https://i.stack.imgur.com/q8hIL.png) I seem to run into this randomly. It usually displays the file normally, but sometimes it's all scrunched onto one line. I can't figure out what's causing it.
My javascript file is displayed as a single line of text in the chrome debugger. Why?
CC BY-SA 3.0
0
2011-05-01T04:27:07.263
2012-10-26T16:01:41.623
null
null
88,696
[ "javascript", "google-chrome", "debugging" ]
5,846,504
1
5,853,926
null
1
800
I'm developing an App which works like Dropbox. I want to dynamically change the emblem of a file during synchronization. Like this: ![effect I want](https://i.stack.imgur.com/kUieY.png) Is there any solution to this with Qt/C++?
How to change the emblem of a file-icon with C/C++ in GNOME?
CC BY-SA 3.0
0
2011-05-01T04:45:04.920
2011-05-02T06:04:34.577
null
null
614,951
[ "linux", "ubuntu", "gnome" ]
5,846,685
1
5,846,823
null
1
4,198
I developed a small ASP.NET 3.5 app. with only few pages and no DB connectivity. I am trying to publish it, but my website gives error: ``` **Parser Error Message:** It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. **Source Error:** Line 45: Line 46: --> Line 47: <authentication mode="None"/> Line 48: <!-- Line 49: The <customErrors> section enables configuration ``` I am using Windows 7 with IIS 7. When I add a new website in IIS there are a few concerns here. Below are the images that show that something is wrong underhood: 1. While creating new application pool for an application built on .NET 3.5, I could not see the .NET Framework 3.5 in the list: ![enter image description here](https://i.stack.imgur.com/D6Z2F.png) 1. When I open the Add Website dialog, and click Test Settings, it gives this error: ![enter image description here](https://i.stack.imgur.com/qmHOA.png) Please let me know how to fix this issue. I also want to know whether I have to add a website or add a virtual directory?
Not able to configure IIS 7 for ASP.NET 3.5 app
CC BY-SA 3.0
null
2011-05-01T05:33:53.883
2011-05-01T06:18:59.013
null
null
194,328
[ "asp.net", "iis-7", "asp.net-3.5" ]
5,846,709
1
5,846,763
null
3
6,117
I have this code. I've done this for years now but I'm stumped with the result of this example. The purpose is to make the text box visible and put the contents of the clicked SPAN tag in it. ``` document.onclick = CaptureClickedElement; function CaptureClickedElement(e) { var EventElement; if(e==null) EventElement = event.srcElement;// IE else EventElement = e.target;// Firefox if( EventElement.tagName == "SPAN") { document.getElementById("divTXT").style.display=""; document.getElementById("txt").value = document.getElementById("Span1").innerHTML; alert(document.getElementById("Span1").innerHTML) } } ``` Strangely though, it DOES show the contents but also shows open/close SPAN tags at the end of it. If I alert ther results, the same thing is shown. Please find the attached screen shot of it here. ![enter image description here](https://i.stack.imgur.com/pXLMt.png) Does anyone have an idea of why this is happening? Thanks! Here is the HTML (copied from comments by mplungjan) ``` <style type="text/css"> #divOuter { width: 100px; height: 70px; border: 1px solid blue; float: left; } </style> <body> <div> <form name="frm" method="post" action=""> <div id="divTXT" style="display:none"> <input type="text" id="txt" name="txt" value="" size="30" /> </div> </form> </div> <div id="divOuter"> <span id="Span1">hi, this is a test.<span> </div> </body> ```
Showing the contents of a SPAN using JavaScript
CC BY-SA 3.0
null
2011-05-01T05:42:40.340
2011-05-01T05:57:19.843
2011-05-01T05:57:19.843
295,783
560,161
[ "javascript", "innerhtml", "html" ]
5,847,281
1
5,847,310
null
5
6,048
I have two tables `User` and `UserRole` which are they connected using a link table `UserInRole` When I generate the entity model, for some reason, the entity `UserInRole` not getting generated. And as you can see from the picture, Entity Framework understood that there is many-to-many relationship between `User` and `UserRole`: ![enter image description here](https://i.stack.imgur.com/bzE2c.jpg) I need to implement the query like this ``` select ur.Name from [User] as u inner join UserInRole uir on uir.UserId = u.Id inner join UserRole ur on ur.Id = uir.UserRoleId where u.Username = 'magename' ``` I am using generic repository, if navigation property would exists the query would be looking like this: ``` from u in repository.AsQueryable<User>() join uir in repository.AsQueryable<UserInRole>() on u.Id equals uir.UserId join ur in repository.AsQueryable<UserRole>() on uir.UserId equals ur.Id where u.Username == userName select ur.Name ``` But Entity Framework does not generate `UserInRoles` navigation property and related `UserInRole` entity, so the question what should I do in that situation? Should I remove link between `UserInRole` and `UserRole` to get entity `UserInRole` generated in model or there any way to have the query I described above without any changes in database? UPDATED so looks i need to do something like that ``` stirng[] roles = (from u in repository.AsQueryable<User>() where u.Username == userName select ur.UserRoles.Select(x => x.Name)).ToArray<string>(); ``` getting an error `Cannot implicitly convert type 'System.Collections.Generic.List<System.Collections.Generic.IEnumerable<string>>' to 'string[]'` any ideas?
Entity Framework many-to-many query: navigation property not generated
CC BY-SA 3.0
0
2011-05-01T08:10:03.157
2011-05-01T08:34:31.603
2011-05-01T08:34:31.603
415,078
415,078
[ "entity-framework-4" ]
5,847,422
1
5,847,457
null
2
7,827
I have a table layout as shown.I have a lot of rows. I have used android:strechcolumns="1" to strech the second column of each row.This is the case everywhere. But in the fifth row I have 2 fields.I want them to occupy equal space.The row size should be same as that of the previous row.I want the overall size of the rows to remain the same as that on the screeshot.Also I have indicated in the screenshot the boundary within which all rows should lie . How can this be done? ``` <TableRow> <TextView android:gravity="right" android:paddingTop="10dip" /> <Spinner android:id="@+id/depot_name_spinner"/> </TableRow> <TableRow> <TextView android:text="@string/product_name" android:paddingTop="10dip" android:gravity="right"/> <Spinner android:id="@+id/product_name_spinner" /> </TableRow> <TableRow> <TextView android:text="@string/date" android:gravity="right" /> <Button android:id="@+id/date_button" /> </TableRow> <TableRow> <TextView android:text="@string/measure_ltr" android:gravity="right" /> <EditText android:id="@+id/ltr_text" android:layout_width="50dip"/> <TextView android:text="@string/measure_qts" android:gravity="right" /> <EditText android:id="@+id/qts_text" /> </TableRow> ``` ![enter image description here](https://i.stack.imgur.com/hI9yX.png) Thanks
Table layout in android -Row sizing
CC BY-SA 3.0
0
2011-05-01T08:44:30.733
2011-05-03T18:00:52.197
null
null
598,714
[ "android" ]
5,847,518
1
5,847,545
null
1
10,224
I am having difficulties doing a simple validation of a text field that has as a value - an int variable. I need the following; - - - This is the validator I created, but it does not work as I desire. Can you have a look at it and tell me where I am making the mistake? ``` public void validateProductValue(FacesContext context, UIComponent validate, Object value) { FacesMessage msg = new FacesMessage(""); String inputFromField = (String) value; String simpleTextPatternText = "^([0-9]+$)?"; Pattern textPattern = null; Matcher productValueMatcher = null; textPattern = Pattern.compile(simpleTextPatternText); productValueMatcher = textPattern.matcher(inputFromField); if (!productValueMatcher.matches()) { msg = new FacesMessage("Only digits allowed"); throw new ValidatorException(msg); } if (inputFromField.length() <= 0) { msg = new FacesMessage("You must enter a value greater than 0"); throw new ValidatorException(msg); } if (Integer.parseInt(inputFromField.toString().trim()) <= 0) { msg = new FacesMessage("0 or bellow is not permited"); throw new ValidatorException(msg); } } ``` This is how I call the field: ``` <h:inputText id="productValue" value="#{newOfferSupportController.productValue}" validator="#{newOfferSupportController.validateProductValue}"/> ``` This the validation shown in the browser: ![enter image description here](https://i.stack.imgur.com/DjnmZ.png) ### Text ``` /newoffer.xhtml @44,184 validator="#{newOfferSupportController.validateProductValue}": java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String ```
Validating int value
CC BY-SA 3.0
null
2011-05-01T09:06:47.850
2011-05-01T09:31:00.033
2011-05-01T09:31:00.033
418,556
614,141
[ "java", "validation", "jsf", "jsf-2" ]
5,847,593
1
5,847,914
null
1
1,056
I have 2 tables which looks like this: ![](https://i.stack.imgur.com/8tm7t.jpg) and the output should look like this: ![enter image description here](https://i.stack.imgur.com/Uhrhs.jpg) How can I accomplish this using both sql query (i'm using sql server 2005) and using linq to sql query ? BTW i'm using sql server 2005, asp.net with c# in Visual studio 2008. Please help me Thanks in anticipation
Count the number of elements in sql server table
CC BY-SA 3.0
null
2011-05-01T09:31:44.697
2011-05-03T18:39:25.563
2011-05-01T09:41:58.763
13,302
653,622
[ "asp.net", "sql-server", "sql-server-2005", "linq-to-sql" ]