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
sequence
3,726,867
1
3,727,031
null
14
1,179
I have an IF statement in QBASIC... yes... QBASIC... I have been teaching someone to program (I decided this would be nice and easy to see how the syntax works). ...Anyway, I have this code: ``` CLS start: INPUT ">>", a$ PRINT a$ IF (INSTR(a$, "do you")) THEN IF (INSTR(a$, "like")) THEN IF (INSTR(a$, "cheese")) THEN PRINT "Yep, I like cheese": IF (INSTR(a$, "music")) THEN PRINT "Depends, which genre?": GOTO musicGenre ELSE IF (INSTR(a$, "hate")) THEN IF (INSTR(a$, "cheese")) THEN PRINT "No, I like cheese" END IF END IF END IF musicGenre: INPUT ">>", m$ SELECT CASE (m$) CASE "pop" PRINT "..pop! lol, baa baa" CASE "rock" PRINT "Rock is ok" END SELECT GOTO start ``` But when I type "`do you like cheese?`" it seems to only reply "`Yep, I like cheese`" every other time... Could anyone shed some light on this? "`do you like music?`" works time... Screenshot of the output: ![alt text](https://i.stack.imgur.com/YqBYh.jpg)
Here's an old school IF statement for you, but there is a problem
CC BY-SA 2.5
null
2010-09-16T12:56:49.327
2016-08-27T02:40:43.110
2010-09-16T13:21:45.350
285,178
285,178
[ "qbasic" ]
3,727,062
1
null
null
4
229
I'm looking for software that frames a TV feed (via coax cable) with still images, tickers, etc. Below is an example of a potential layout I'm interested in (care of Bloomberg). ![alt text](https://i.stack.imgur.com/yxxv0.jpg)
Looking for software: frame a TV feed with other information
CC BY-SA 2.5
0
2010-09-16T13:20:44.540
2010-09-24T11:55:16.873
null
null
444,382
[ "video" ]
3,727,179
1
3,727,242
null
4
3,380
I have two tables, `tabSparePart` and `tabSparePartCategory`. Every spare part belongs to a spare part category. I need all spare parts that belong to a specific category. But the problem is that a spare part category could be a "subcategory" of another, they reference each other (the "main categories" have 'null' in this FK column). Let's say I need all spare parts with `fiSparePartCategory=1` and all spare parts that belong to a category that is a "subcategory" of `category=1`. How to write the SQL query that returns all spare parts regardless of how many levels of subcategories there are. I hope you understand my requirement. The following is an illustration of what I have. How to make it dynamic so that it works regardless of the number of subcategories? Thanks, Tim ![alt text](https://i.stack.imgur.com/jkTnd.jpg) Link to image: [http://www.bilder-hochladen.net/files/4709-lg-jpg.html](http://www.bilder-hochladen.net/files/4709-lg-jpg.html) : Following is an other static approach which works when there is only one level of subcategory: ``` SELECT SparePartName FROM tabSparePart WHERE (fiSparePartCategory IN (SELECT idSparePartCategory FROM tabSparePartCategory WHERE (idSparePartCategory = 1) OR (fiSparePartCategory = 1))) ```
SQL query: self-referencing foreign key relationship
CC BY-SA 2.5
null
2010-09-16T13:34:52.580
2010-09-16T14:58:55.330
2010-09-16T14:58:55.330
13,302
284,240
[ "sql", "sql-server", "foreign-key-relationship" ]
3,727,130
1
3,727,778
null
2
743
I've been using databinding in several simple situations with pretty good success. Usually I just use INotifyPropertyChanged to enable my codebehind to modify the GUI values on screen, rather than implement dependency properties for everything. I am playing with an LED control to learn more about databinding in user controls, and was forced to use dependency properties because VS2008 told me I had to. My application is straightforward -- I have a window that displays several LED controls, each with a number above it and optionally, one to its side. The LEDs should be definable with a default color, as well as change state. I started by writing an LED control, which seemed to go perfectly fine. First, I started with code like this: ``` <UserControl x:Class="LEDControl.LED" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="Auto" Width="Auto"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/> </Grid.ColumnDefinitions> <!-- LED portion --> <Ellipse Grid.Column="0" Margin="3" Height="{Binding LEDSize}" Width="{Binding LEDSize}" Fill="{Binding LEDColor}" StrokeThickness="2" Stroke="DarkGray" /> <Ellipse Grid.Column="0" Margin="3" Height="{Binding LEDSize}" Width="{Binding LEDSize}"> <Ellipse.Fill> <RadialGradientBrush GradientOrigin="0.5,1.0"> <RadialGradientBrush.RelativeTransform> <TransformGroup> <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.5" ScaleY="1.5"/> <TranslateTransform X="0.02" Y="0.3"/> </TransformGroup> </RadialGradientBrush.RelativeTransform> <GradientStop Offset="1" Color="#00000000"/> <GradientStop Offset="0.4" Color="#FFFFFFFF"/> </RadialGradientBrush> </Ellipse.Fill> </Ellipse> <!-- label --> <TextBlock Grid.Column="1" Margin="3" VerticalAlignment="Center" Text="{Binding LEDLabel}" /> </Grid> </UserControl> ``` This draws an LED just fine. I then bound LEDSize, LEDLabel, and LEDColor to the Ellipse properties by setting `this.DataContext = this` like I always do: ``` /// <summary> /// Interaction logic for LED.xaml /// </summary> public partial class LED : UserControl, INotifyPropertyChanged { private Brush state_color_; public Brush LEDColor { get { return state_color_; } set { state_color_ = value; OnPropertyChanged( "LEDColor"); } } private int led_size_; public int LEDSize { get { return led_size_; } set { led_size_ = value; OnPropertyChanged( "LEDSize"); } } private string led_label_; public string LEDLabel { get { return led_label_; } set { led_label_ = value; OnPropertyChanged( "LEDLabel"); } } public LED() { InitializeComponent(); this.DataContext = this; } #region INotifyPropertyChanged Members public event PropertyChangedEventHandler PropertyChanged; protected void OnPropertyChanged( string property_name) { if( PropertyChanged != null) PropertyChanged( this, new PropertyChangedEventArgs( property_name)); } #endregion } ``` At this point, I can change the property values and see that the LED changes size, color and its label. Great! I want the LED control to be reusable in other widgets that I write over time, and the next step for me was to create another UserControl (in a separate assembly), called `IOView`. `IOView` is pretty basic at this point: ``` <UserControl x:Class="IOWidget.IOView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:led="clr-namespace:LEDControl;assembly=LEDControl" Height="Auto" Width="Auto"> <Grid> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition /> </Grid.RowDefinitions> <TextBlock Grid.Row="0" HorizontalAlignment="Center" Text="{Binding Path=Index}" /> <led:LED Grid.Row="1" HorizontalContentAlignment="Center" HorizontalAlignment="Center" LEDSize="30" LEDColor="Green" LEDLabel="Test" /> </Grid> </UserControl> ``` Notice that I can modify the LED properties in XAML at design time and everything works as expected: ![alt text](https://i.stack.imgur.com/y2hOl.png) I then blindly tried to databind LEDColor to my IOView, and VS2008 kindly told me Oops! I hadn't even realized that since I haven't made my own GUI controls before. Since the `LEDColor` is already databound to the Ellipse, I added a DependencyProperty called Color. ``` public static DependencyProperty ColorProperty = DependencyProperty.Register( "Color", typeof(Brush), typeof(LED)); public Brush Color { get { return (Brush)GetValue(ColorProperty); } set { SetValue( ColorProperty, value); LEDColor = value; } } ``` Note that I set the property `LEDColor` in the setter, since that's how the Ellipse knows what color it should be. The next baby step involved setting the color of the LED in my IOView by binding to IOView.InputColor: ``` /// <summary> /// Interaction logic for IOView.xaml /// </summary> public partial class IOView : UserControl, INotifyPropertyChanged { private Int32 index_; public Int32 Index { get { return index_; } set { index_ = value; OnPropertyChanged( "Index"); } } private Brush color_; public Brush InputColor { get { return color_; } set { color_ = value; OnPropertyChanged( "InputColor"); } } private Boolean state_; public Boolean State { get { return state_; } set { state_ = value; OnPropertyChanged( "State"); } } public IOView() { InitializeComponent(); this.DataContext = this; } #region INotifyPropertyChanged Members public event PropertyChangedEventHandler PropertyChanged; protected void OnPropertyChanged( string property_name) { if( PropertyChanged != null) PropertyChanged( this, new PropertyChangedEventArgs( property_name)); } #endregion } ``` and in IOView.xaml, I changed the LED to this: ``` <led:LED Grid.Row="1" HorizontalContentAlignment="Center" HorizontalAlignment="Center" LEDSize="30" Color="{Binding InputColor}" /> ``` But it's not working, because of the following error in the Output window: Hmm... so for some reason, my DataBinding is messed up. I can get the LED to work on its own with databinding, but once I wrap it in another control and set its datacontext, it doesn't work. I'm not sure what to try at this point. I'd love to get as detailed an answer as possible. I know that I could have just retemplated a CheckBox to get the same results, but this is an experiment for me and I'm trying to understand how to databind to controls' descendants.
Misunderstanding databinding fundamentals and DataContexts -- long story
CC BY-SA 2.5
0
2010-09-16T13:28:35.903
2011-09-27T15:18:40.527
2010-09-16T13:40:07.420
214,071
214,071
[ "c#", "wpf", "data-binding", ".net-3.5", "datacontext" ]
3,727,686
1
3,727,728
null
0
1,192
I use [http://github.com/abraham/twitteroauth](http://github.com/abraham/twitteroauth) PHP library for reaching the Twitter REST API. My config file has credentials: ``` <?php $consumer_key = 'xxxxxxxxxxxxx'; $consumer_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; $login = 'xxx'; $passwd = 'xxx'; ?> ``` Is it possible to get `oauth_token` and `oauth_token_secret` without showing the Twitter login page? ![alt text](https://i.stack.imgur.com/JvyHT.png)
OAuth authorization without Twitter login page
CC BY-SA 3.0
0
2010-09-16T14:31:37.397
2017-08-12T14:08:08.070
2017-08-12T14:08:08.070
211,848
211,848
[ "php", "twitter", "oauth" ]
3,728,358
1
3,728,569
null
0
106
![alt text](https://i.stack.imgur.com/eFBkB.jpg) When I continuously do "step into",it switches between different threads. But how's that scheduled in visual studio,how does it know which thread to activate for next instruction?
Debugging a multi-thread programe with "Disassembly view" in visual studio
CC BY-SA 2.5
null
2010-09-16T15:48:27.487
2010-09-16T16:14:54.393
2020-06-20T09:12:55.060
-1
417,798
[ "c", "visual-studio-2008", "assembly" ]
3,728,474
1
3,728,544
null
1
684
I have a web page with large div(for example white) and another div that is follows the previous one. The problem is that if white block is big enough and it height is almost or even bigger than the browser window(and scroll bars appear), the red block is in the bottom of the page there is still gap between red div and end of the window in Firefox/Safari/Opera: ![alt text](https://i.stack.imgur.com/VhHxS.png) But in Explorer/Chrome everything is ok: ![alt text](https://i.stack.imgur.com/QkF9P.png) My code: ``` <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title></title> <style type="text/css"> root { display: block; } html, body{ padding: 0; margin: 0; width: 100%; height: 100%; font-family: Tahoma; background-color: blue ; } #container{ position: absolute; left: 50%; width: 961px; height: 100%; margin-left: -480px; } .infContainer{ position: relative; padding-left: 19px; background-color: white; color: #434343; } div#footerCopyright{ position: relative; bottom: 15px; font-size: 0.75em; background-color: red; } div#bottomFooterDivider{ height: 50px; } div#pageBottomDivider{ height: 35px; } </style> </head> <body> <div id="container"> <div id="mainBlock" class="infContainer"> <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/> <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/> <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/> <br/><br/><br/><br/><br/><br/> </div> <div id="footerCopyright"> <div id="bottomFooterDivider"></div> </div> </div> </body> </html> ``` How to solve this problem and have the same page without blue gap in Firefox/Opera/Safari. Actual page: [http://109.74.203.141/stack/1/tmp.html](http://109.74.203.141/stack/1/tmp.html)
Elliminate gap between last div and page end in firefox/opera/Safari
CC BY-SA 2.5
null
2010-09-16T16:01:22.633
2010-09-16T16:11:30.627
null
null
149,245
[ "css", "firefox", "xhtml", "layout", "html" ]
3,728,731
1
null
null
1
705
i have a "rare" behavior here, i this model: # models.py ``` class Area(models.Model): area = models.CharField(max_length=150,unique=True) slug = models.SlugField(max_length=200) fecha = models.DateTimeField(default=datetime.date.today,editable=False) activa = models.BooleanField(default=True) class Empresa(models.Model): usuario = models.ForeignKey(User) nombre = models.CharField(max_length=150) telefono = models.CharField(max_length=20) fax = models.CharField(max_length=20,null=True,blank=True) actividad = models.ManyToManyField(Area) ``` I dont know why the m2m_field actividad, into the django admin and any forms html is showing the slug field from the model Area as label ![alt text](https://i.stack.imgur.com/A3KSb.jpg)
django ManyToManyField show slug as label
CC BY-SA 2.5
null
2010-09-16T16:34:06.113
2010-09-16T18:23:31.563
2020-06-20T09:12:55.060
-1
147,424
[ "django", "django-models", "django-admin", "django-forms" ]
3,728,983
1
null
null
1
84
![alt text](https://i.stack.imgur.com/wppay.jpg) Especially,how the thread be named by method name like `GrabberCB::BufferCB`?
How are thread names populated in thread window of visual studio?
CC BY-SA 2.5
null
2010-09-16T17:05:11.713
2010-09-16T17:06:57.810
2020-06-20T09:12:55.060
-1
417,798
[ "c", "visual-studio-2008" ]
3,729,502
1
null
null
1
1,881
I am trying to access picasa from android , i have tried to run following sample code ``` http://code.google.com/p/google-api-java-client/source/browse/picasa-atom-android-sample/?repo=samples#picasa-atom-android-sample%3Fstate%3Dclosed ``` but i am getting only one thing over here , ![alt text](https://i.stack.imgur.com/oluiX.png) and there is no options to select google account. in my code i am getting ``` final AccountManager manager = AccountManager.get(this); final Account[] accounts = manager.getAccountsByType("com.google"); final int size = accounts.length; ``` size = 0 and no items were there in select google account so can you please tell me how to set up google account , to access picasa album or if someone has another idea then also i don't mind.
accsessing picasa using android
CC BY-SA 2.5
0
2010-09-16T18:15:59.767
2012-10-24T15:33:52.770
2010-09-21T17:35:18.613
83,406
405,383
[ "android", "google-api", "picasa", "google-api-java-client" ]
3,729,554
1
3,729,745
null
1
7,973
![alt text](https://i.stack.imgur.com/4xhrU.jpg) This is the desired result Ineeded. I had populated State(RowGroup), Male(ColGroup), Year(ColGroup) and the data inside the matrix. To calculate the data count total(100), I used the feature AddTotal by right-clicking it. But in this report I have used expression to calculated individual Percentage. Expr1: to calculate the percentage I used this expression: ``` =Fields!count.Value/Sum(Fields!count.Value, "Gender_Group") ``` I have no problem in populating this percentage(25%,25%). The problem I am right now is calculating the total percentage. (50%). I couldn't see the AddTotal option in rdlc at the Total field row. ![alt text](https://i.stack.imgur.com/vByuY.png) Hence I tried to add another expression at the red colored cell to find the sum ``` expr2:=Sum(ReportItems!Textbox1.Value) ``` where textbox1 is the value in the Expr1. But I get an error: ``` Aggregate functions can be used only on report items contained in page headers and footers. ``` My desired output is finding the total percentage. Any help would be appreciated.
SSRS/RDLC Calculating SubTotal of an Expression
CC BY-SA 2.5
0
2010-09-16T18:22:18.477
2011-01-24T11:58:52.840
2011-01-24T11:58:52.840
573,261
178,769
[ "reporting-services", "ssrs-2008", "rdlc" ]
3,729,648
1
3,729,961
null
2
1,279
I have a function that loads a sprite sheet, finds a block of sprites, and then puts each individual sprite into a list. Before it appends a sprite into the list, it will blit it onto the screen. Once it's done loading sprites, it will then iterate through the list, blitting each sprite as it goes. The two sets of blits be identical, but instead the first sprite is dropped from the list, and the last sprite is duplicated. The two sets of blits look like this: ![alt text](https://i.stack.imgur.com/8WdA3.jpg) Each sprite is blitted in the order it was appended to the list, going from left to right, top to bottom, so the first sprite is the top left one, and the last is the bottom right. Here's the function that loads the sprites: ``` def assembleSprites(name, screen): """Given a character name, this function will return a list of all that character's sprites. This is used to populate the global variable spriteSets""" spriteSize = (35, 35) spritesheet = pygame.image.load("./images/patchconsprites.png") sprites = [] start = charCoords[name] char = list(start) image = pygame.Surface((35,35)) # load each sprite and blit them as they're added to the list for y in range(5): char[0] = start[0] for x in range(9): rect = (char[0], char[1], char[0]+spriteSize[0], char[1]+spriteSize[1]) image.blit(spritesheet, (0,0), rect) image = image.convert() colorkey = image.get_at((0,0)) image.set_colorkey(colorkey, RLEACCEL) screen.blit(image, (x*40, y*40)) pygame.display.update() sprites.append(image) char[0] += spriteSize[0]+2 char[1] += spriteSize[1]+2 # check that the list was constructed correctly count = 0 for y in range(6,11): for x in range(9): screen.blit(sprites[count], (x*40,y*40)) count += 1 pygame.display.update() return sprites ``` Anyone see how I'm screwing the list up?
a list of pygame sprites loses its first element, and gains a duplicate of the last
CC BY-SA 2.5
null
2010-09-16T18:32:23.993
2010-09-16T19:16:44.037
null
null
377,617
[ "python", "list", "pygame" ]
3,729,690
1
3,729,753
null
25
24,478
For an iPhone application I want to draw a circle, that is only for an x percentage filled. Something like this: ![alt text](https://i.stack.imgur.com/tiyuY.png) I have no problems calculating the radius, the degrees or the radians, that is no problem. Also drawing the circle is already done. But how do I get the iPhone SDK to draw the part that is filled. I can draw a rectangle that size, but not part of a circle. I just want to draw that on a a normal context. Hope someone can give me any pointers here.
Draw part of a circle
CC BY-SA 2.5
0
2010-09-16T18:39:32.797
2015-10-26T07:37:23.860
2010-09-16T18:50:55.877
69,313
69,313
[ "iphone", "objective-c", "cocoa-touch" ]
3,729,841
1
3,730,269
null
1
3,804
Im coding html newsletter and faced up with strange thing in gmail. Code: ``` <table cellpadding="0" cellspacing="0" width="700" height="122"> <tr> <td valign="top" colspan="3" width="689" height="8"><img src="http://www.url.com/img/product_top_border.gif"></td> </tr> <tr> <td valign="top" width="12" height="106"><img src="http://www.url.com/img/product_left_border.gif"></td> <td valign="top" height="106" width="689"> some content </td> <td valign="top" width="12" height="106"><img src="http://www.url.com/img/product_right_border.gif"></td> </tr> <tr> <td valign="top" colspan="3" width="689" height="8"><img src="http://www.url.com/img/product_bot_border.gif"></td> </tr> </table> ``` Gmail screenshot: ![gmail](https://i.stack.imgur.com/gtrGh.gif) Screenshot from other email clients: ![In other email clients](https://i.stack.imgur.com/JAswV.gif) Any hints? Your help would be appreciated.
Html newsletter in gmail
CC BY-SA 2.5
null
2010-09-16T19:00:14.620
2012-02-09T18:47:44.110
null
null
262,460
[ "html", "gmail", "newsletter" ]
3,730,259
1
3,732,513
null
7
15,883
I'm developing an Android application with a tabbed layout. I've got it to where it doesn't spawn a new activity like [Google's tutorial suggested](http://developer.android.com/resources/tutorials/views/hello-tabwidget.html), however I only did this in an effort to get my content to show when clicking on each tab. Currently it just shows black regardless of what tab is active. The following is my code in its latest iteration: ``` public class Main extends TabActivity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Resources res = getResources(); TabHost tabHost = getTabHost(); TabHost.TabSpec spec; // add orders tab spec = tabHost.newTabSpec("orders").setIndicator("Orders", res.getDrawable(R.drawable.flash_36)) .setContent(R.id.ordersLayout); tabHost.addTab(spec); // add positions tab spec = tabHost.newTabSpec("positions").setIndicator("Positions", res.getDrawable(R.drawable.small_tiles_36)) .setContent(R.id.positionsLayout); tabHost.addTab(spec); // add strategies tab spec = tabHost.newTabSpec("strategies").setIndicator("Strategies", res.getDrawable(R.drawable.cards_36)) .setContent(R.id.strategiesLayout); tabHost.addTab(spec); // add account tab spec = tabHost.newTabSpec("account").setIndicator("Account", res.getDrawable(R.drawable.seal_36)) .setContent(R.id.accountLayout); tabHost.addTab(spec); tabHost.setCurrentTab(1); } } ``` ``` <?xml version="1.0" encoding="utf-8"?> <TabHost android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <LinearLayout android:id="@+id/mainLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="5dp"> <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content"> </TabWidget> <FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#fff" android:padding="5dp"> <include layout="@layout/orders"/> <include layout="@layout/positions"/> <include layout="@layout/strategies"/> <include layout="@layout/account"/> </FrameLayout> </LinearLayout> </TabHost> ``` ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:id="@+id/accountLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#fff" xmlns:android="http://schemas.android.com/apk/res/android"> <TextView android:text="Account Information" android:id="@+id/accountLabel" android:layout_width="fill_parent" android:layout_height="wrap_content"> </TextView> </LinearLayout> ``` ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:id="@+id/ordersLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#fff" xmlns:android="http://schemas.android.com/apk/res/android"> <TextView android:text="Working Orders" android:id="@+id/ordersLabel" android:layout_width="fill_parent" android:layout_height="wrap_content"> </TextView> </LinearLayout> ``` And here's a screenshot of what I get when switching between tabs: ![alt text](https://i.stack.imgur.com/NVq2e.png) ![alt text](https://i.stack.imgur.com/b7OQj.png) This is true for both the emulator and a Samsung Galaxy I just got, and I highly reccommend by the way, any ideas?
Android Tabbed Layout setContent
CC BY-SA 2.5
0
2010-09-16T19:52:55.750
2010-09-17T03:34:42.660
null
null
50,391
[ "android" ]
3,730,767
1
3,732,383
null
4
11,714
I am using Google Map Version 3 API to add markers on Google Map. The is that, markers show up on browsers. but when users print the map through browser's print command, nothing shows up. The question is, - - : - - markers are clearly visible ![alt text](https://i.stack.imgur.com/9GKKt.png)- (IE7, IE8) - markers are not printed (on paper or PDF) ![alt text](https://i.stack.imgur.com/N2Oy2.png)- (FireFox 3.5.4) - only markers are printed ![alt text](https://i.stack.imgur.com/DQqUZ.png)
How to print Google Map markers
CC BY-SA 2.5
null
2010-09-16T20:58:39.197
2015-01-07T08:26:58.913
2010-09-16T21:50:16.843
4,035
4,035
[ "google-maps", "printing", "google-maps-api-3" ]
3,731,081
1
null
null
1
92
Does anyone know of free tools, IDEs or plugins (preferably for Netbeans or Eclipse) that can generate dependency trees like [NDepend](http://www.ndepend.com/) for Visual Studio? I am looking for one that does it for PHP, but ideally it would support multiple languages. ![alt text](https://i.stack.imgur.com/VK9U5.jpg)
Tool or IDEs that can generate dependency trees?
CC BY-SA 2.5
null
2010-09-16T21:46:41.883
2018-12-22T15:29:30.130
null
null
396,458
[ "ide", "dependency-management" ]
3,731,454
1
3,732,545
null
5
7,265
In how can you convert a image to a without losing colors. With [imagetruecolortopallete](http://php.net/manual/en/function.imagetruecolortopalette.php) it . I have a function that runs through all the colors and filters them (eg. grayscale). and It , such as this picture of a Lamborghini- ![alt text](https://i.stack.imgur.com/6bTPe.png) This is ``` $im = imagecreatefrompng("lamborghini.png"); $degrees = 0; $img = imagecreatetruecolor(imagesx($im), imagesy($im)); imagecopy($img, $im, 0, 0, 0, 0, imagesx($im), imagesy($im)); imagetruecolortopalette($img, true, 256); $t = imagecolorstotal($img); for ($i = 0; $i < $t; $i++) { $rgb = imagecolorsforindex($img, $i); $hsv =rgbtohsv($rgb['red'], $rgb['green'], $rgb['blue']); $h = $degrees; $s = $hsv['s']; $v = $hsv['v']; while ($h > 360) {$h -= 360;}; $nrgb = hsvtorgb($h, $s, $v); imagecolorset($img, $i, $nrgb['r'], $nrgb['g'], $nrgb['b']); } imagecopy($im, $img, 0, 0, 0, 0, imagesx($img), imagesy($img)); header('Content-type: image/png'); imagepng($im); imagedestroy($im); ``` And it ![alt text](https://i.stack.imgur.com/qvdeX.png) You can see . Is there ? Also I don't think it has to do with my code but how [imagetruecolortopalette](http://php.net/manual/en/function.imagetruecolortopalette.php) outputs it
PHP GD palette colors
CC BY-SA 2.5
0
2010-09-16T22:52:24.083
2013-10-28T16:46:20.087
2010-09-16T23:05:15.767
1,246,275
1,246,275
[ "php", "image", "colors", "gd", "palette" ]
3,732,285
1
null
null
21
119,793
I cant figure it out. How do i align the textbox? I thought using float: left on the labels on the left (then doing it on the input when i notice the input was now on the left without that) but that was completely wrong. How do i get the textbox align along with the labels on the left of them next to the textbox instead of the far left? The picture is an example of what i'd like it to look like. ![alt text](https://i.stack.imgur.com/OY0DH.png)
align textbox and text/labels in html?
CC BY-SA 2.5
0
2010-09-17T02:22:46.660
2017-11-26T17:47:51.527
null
null
null
[ "html", "css" ]
3,732,703
1
3,732,872
null
2
16,646
Does anyone know how can I create a prompt input dialog with dropdown box in javascript? Example: ![alt text](https://i.stack.imgur.com/5yfFF.png)
Create prompt input dialog with dropdown box in javascript?
CC BY-SA 2.5
null
2010-09-17T04:41:10.363
2010-09-17T06:32:06.727
2010-09-17T06:22:32.710
50,846
52,745
[ "javascript", "dialog" ]
3,732,806
1
3,732,865
null
0
249
hi i am new to iphone.what i need is i have to place a images like stars in the sky and animate the stars glow for example i am showing a sample image how can i done this pls post some code or link regarding this.sorry for my poor English.Thank u in advance. ![alt text](https://i.stack.imgur.com/T4Fbn.jpg)
how to animate images in view background
CC BY-SA 2.5
0
2010-09-17T05:16:30.967
2010-09-17T05:34:28.317
null
null
699,226
[ "iphone" ]
3,733,039
1
3,735,519
null
3
2,650
I'm using DNN 5.4 with the default google api jquery reference: ![alt text](https://i.stack.imgur.com/Aas5K.png) I have confirmed that jquery.min.js is loading. I don't know if there's other jQuery (other than the plugin) that needs to be loaded. I'm utilizing the Google Code jQuery Textbox Watermark Plugin ([Link](http://code.google.com/p/jquery-watermark/)) Web Dev Toolbar & Firebug suggest that both jQuery and the Watermark Plugin are loading. This code is sitting near the top of my skin .ascs: ``` <script type="text/javascript" src="/js/watermark/jquery.watermark.min.js"></script> ``` The following code works (when the inputs are wrapped in form tags) in basic html document. However, when placed inside either a DNN skin or DNN module, it fails to work and generates a javascript here. ``` <script language="javascript" type="text/javascript"> (function ($) { $(document).ready(function () { jQuery("#xsearch").watermark("Leave blank for USA"); }) })(jQuery); </script> SearchString: <input type="text" id="xsearch" name="xsearch" /> <input type="button" value="search" id="xsubmit" name="xsubmit" /> ``` The Error (FireBug): ``` jQuery("#xsearch").watermark is not a function [Break on this error] jQuery("#xsearch").watermark("Leave blank for USA"); ``` This alternate code produces the same error: ``` <script language="javascript" type="text/javascript"> jQuery.noConflict(); jQuery(function () { jQuery("#xsearch").watermark("Leave blank for USA"); jQuery("#xsubmit").click( function () { jQuery("#xsearch")[0].focus(); } ); }); </script> ``` And finally, the same error is produced when I replace jQuery with $ It feels like a conflict of some sort, but I'm lost on what to do next. Thanks in advance for your time
DotNetNuke - jQuery - Why is this jQuery Watermark plugin not working?
CC BY-SA 2.5
0
2010-09-17T06:18:47.487
2011-11-18T20:54:51.657
null
null
127,880
[ "asp.net", "jquery", "jquery-ui", "jquery-plugins", "dotnetnuke" ]
3,733,282
1
null
null
1
431
In css, i set the overlow property of the div to scroll and it works well. But the scrolls are visible but not active with a greyed color even they are not needed. So how can i make the scrolls invisible when they are not needed ? ![alt text](https://i.stack.imgur.com/rgVbX.jpg)
Scroll visibility
CC BY-SA 2.5
null
2010-09-17T07:03:13.467
2010-09-17T07:15:01.710
null
null
134,263
[ "javascript", "html", "css" ]
3,733,471
1
3,733,567
null
16
10,446
In Draw 9-patch, everything looks fine. , my SDK says the 9-patch png is malformed. Because I have something like an 11-patch png. Because I don't want the little grabbing area to be scaled. How to get it working? The screenshot describes everything: ![alt text](https://i.stack.imgur.com/0kIFO.png) Error Meassage in Console: ``` ERROR: 9-patch image /res/drawable-hdpi/top_complete.9.png malformed. Can't have more than one marked region along edge. Found at pixel #10 along bottom edge. ERROR: Failure processing PNG image /res/drawable-hdpi/top_complete.9.png ```
Android / 9-patch PNG: What, if I need smth like a 11-patch PNG?
CC BY-SA 2.5
0
2010-09-17T07:37:11.417
2015-10-14T00:03:36.043
2010-09-17T11:51:32.320
433,718
433,718
[ "android", "android-layout", "nine-patch" ]
3,733,483
1
3,740,998
null
1
3,182
im looking for some tips and hints how i can build up my Application in a good way. So here are some informations: I have at the moment the Mainwindow designed with a grid which holds 4 frames. its looking like this. ![menu](https://i.stack.imgur.com/rPmti.jpg) At the top is a menu which let you select the different Pages. I have for the main area about 8 pages for e.g. a settings page and 4 content pages. The Sidebar displays some additional informations which can be choosen by the user and the bottom shows only a page when 1 of the content pages are opened. So my content pages have ViewModels behind to fill them and im trying to use commands in the near future when im understand all features of them ;). So im trying to use the MVVM way, but im very new at this. I don't really need a navigation menu like it is given from navigation windows. So is it the best way for an application like that to use Frames or are there any better solutions?
WPF How to design a multi-window Application?
CC BY-SA 2.5
0
2010-09-17T07:39:46.560
2010-09-18T08:53:32.513
null
null
424,226
[ "c#", "wpf", "mvvm" ]
3,733,526
1
3,733,545
null
0
77
This code has different result in Firefox and Chrome ``` <div style="border:1px solid red; width:50%; height:50px; position:relative;"> <input type="text" style="position:absolute; left:0; right:20px;" /> </div> ``` ![alt text](https://i.stack.imgur.com/R0ZWf.png) How to make the text box anchored 0px to the left and 20px to the right side of the div? NOTE: div's width must fluid 50%. Thank you :)
Anchoring trick isn't working in Firefox
CC BY-SA 2.5
null
2010-09-17T07:49:25.070
2011-04-05T14:12:48.693
2010-09-17T08:32:15.363
351,564
351,564
[ "css", "cross-browser" ]
3,733,725
1
null
null
0
1,456
Im using mfc to draw a custom menu except it has a nasty looking border around it. How do i get rid of the border or draw over it? For example: ![](https://i.stack.imgur.com/q8qtL.png) (the white border around the edge) Edit: i know its only three hours left but none of the things below work. I have tried them using the following code: ``` HWND hwnd = m_pParent->getBrowserHWND(); uint32 style = GetWindowLong(hwnd, GWL_STYLE); SetWindowLong(hwnd, GWL_STYLE, style&~WS_BORDER); SetWindowPos(hwnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED); HookHwnd hook(hwnd); int res = TrackPopupMenu((HMENU)menu.GetHMenu(), TPM_LEFTALIGN|TPM_RIGHTBUTTON|TPM_RETURNCMD|TPM_RECURSE, xPos, yPos, 0, hwnd, NULL); SetWindowLong(hwnd, GWL_STYLE, style); ```
Custom back ground for owner drawn menu
CC BY-SA 4.0
0
2010-09-17T08:24:46.430
2018-07-29T10:45:06.850
2018-07-29T10:45:06.850
143,091
23,339
[ "c++", "winapi" ]
3,733,733
1
3,733,931
null
0
561
I have a TCP server that creates a (blocking) socket, waits until it is available for reading using select(), then calls accept() and starts reading the data. Here is an [example](http://beej.us/guide/bgnet/examples/selectserver.c) (not mine) illustrating the concept. The question is, at what points of TCP handshake does select() and accept() calls return? ![TCP 3-way handshake](https://i.stack.imgur.com/MjsR9.gif) Ubuntu Hardy, if it matters. 2.6.31-14-server #48ya1 SMP Fri Apr 2 15:43:25 MSD 2010 x86_64 GNU/Linux
TCP handshake phases corresponding to select() and accept() return points
CC BY-SA 2.5
null
2010-09-17T08:26:20.783
2010-09-17T08:57:44.827
2010-09-17T08:57:41.317
23,714
23,714
[ "linux", "sockets", "tcp" ]
3,734,100
1
null
null
0
1,378
How do I make sure the deployment target of my binary is set at 3.0? My base SDK is 4.0 because I'm using xcode 3.2.4 and this is the only SDK I can use. I thought it was possible to get the binary to target 3.0 using the settings in the Build properties but when I upload the binary to iTunes Connect it still says the minimum os is 4.0.![alt text](https://i.stack.imgur.com/S5k5M.png)
xcode : How do I make sure the deployment target of my binary is set at 3.0?
CC BY-SA 2.5
null
2010-09-17T09:27:16.370
2010-09-17T15:04:44.310
null
null
107,567
[ "iphone", "xcode", "deployment", "ios" ]
3,734,296
1
3,734,370
null
1
802
My code for the Layout is given below. I am not able see the full content, nor am I able to scroll. How can I show the entire contents by scrolling? ``` <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingTop="10px" android:background="@color/bg_color" > <TextView android:paddingLeft="20px" android:text="hhhhhhhhhhhhhhhhh" android:id="@+id/eventname" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:textColor="@color/black" android:textStyle="bold" android:textSize="15px"></TextView> </LinearLayout> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:paddingLeft="50px" android:layout_height="wrap_content" android:orientation="horizontal" android:background="@color/bg_color" android:layout_gravity="center_horizontal"> <ImageView android:id="@+id/ImageView01" android:scaleType="fitCenter" android:layout_width="100dip" android:layout_height="120dip" ></ImageView> <ImageView android:id="@+id/ImageView02" android:scaleType="fitCenter" android:layout_width="100dip" android:layout_height="120dip" ></ImageView> </LinearLayout> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:background="@color/bg_color"> <TextView android:paddingLeft="20px" android:text="" android:id="@+id/maindet" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/black" android:textSize="12px"></TextView> <TextView android:textStyle="bold" android:paddingLeft="20px" android:text="Muzieikstijlen" android:id="@+id/stylet" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/black" android:textSize="12px"></TextView> <TextView android:paddingLeft="20px" android:text="" android:id="@+id/styletype" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/black" android:textSize="12px"></TextView> <TextView android:textStyle="bold" android:paddingLeft="20px" android:text="Prinjzen" android:id="@+id/prijzen" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/black" android:textSize="12px"></TextView> <TextView android:paddingLeft="20px" android:text="" android:id="@+id/voor" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/black" android:textSize="12px"></TextView> <TextView android:textStyle="bold" android:paddingLeft="20px" android:text="Line-up" android:id="@+id/lineup" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/black" android:textSize="12px"></TextView> <TextView android:paddingLeft="20px" android:text="" android:id="@+id/djlist" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/black" android:textSize="12px"></TextView> <TextView android:textStyle="bold" android:paddingLeft="20px" android:text="Minimumleeftijd" android:id="@+id/min" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/black" android:textSize="12px"></TextView> <TextView android:paddingLeft="20px" android:text="" android:id="@+id/minage" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/black" android:textSize="12px"></TextView> </LinearLayout> <Button android:id="@+id/back" android:layout_height="40px" android:layout_width="150px" android:layout_gravity="center" android:background="@color/btnback" android:text="Back" android:textSize="20px" android:textColor="@color/bg_color"></Button> </LinearLayout> ``` Screen shot of the phone: Thank you. ![alt text](https://i.stack.imgur.com/jHHUD.png)
How do I add scrolling to an Android layout?
CC BY-SA 3.0
0
2010-09-17T09:54:10.893
2014-02-28T13:38:45.950
2014-02-28T13:38:45.950
1,542,891
436,765
[ "android", "scroll", "scrollview" ]
3,734,497
1
3,739,957
null
0
1,006
I have an iPhone app that I've converted to a . The app works fine in all orientation on the iPhone. However on iPad when I rotate a table view, the UITableViewCell accessory is not repositioned correctly (see images below). I'm using a standard UITableViewCell of type UITableViewCellStyleSubtitle. The rest of view is drawn correctly and uses all the iPad real estate. The XIB files are the same for the iPad and iPhone, except for the MainWindow.xib. After scrolling down and backup, the accessory are redrawn at the correct position. Does anyone know what could be causing that issue? If I remove the index list on the right, the problem disappears! ![alt text](https://i.stack.imgur.com/ItRGz.png) ![alt text](https://i.stack.imgur.com/dNMnU.png) ![alt text](https://i.stack.imgur.com/RgkCy.png)
UITableViewCell accessory not positioned correctly after rotating UITableView on iPad
CC BY-SA 2.5
0
2010-09-17T10:24:09.760
2010-11-10T15:34:42.710
2010-09-17T11:21:06.923
211,481
211,481
[ "iphone", "ipad", "uitableview" ]
3,734,877
1
3,734,904
null
0
261
I am just looking at setting a up a custom UIViewController programatically (see code below) and I am just curious about the white line I am getting at the bottom of the display, I don't see this when I create the view using a NIB in InterfaceBuilder. Is it just a case of offsetting the frame down by the height of the status bar or am I missing something else? # EDIT: Found it: viewController.view.frame = CGRectMake(0.0,20.0,320.0,460.0); ``` - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { MyController *tempController = [[MyController alloc] init]; [self setMyController:tempController]; [window addSubview:[myController view]]; [window makeKeyAndVisible]; return YES; } ``` ![alt text](https://i.stack.imgur.com/xN1Io.png) Much appreciated ... Gary
Programmatic View Offset by Status Bar?
CC BY-SA 2.5
null
2010-09-17T11:26:53.213
2010-09-17T11:35:42.393
null
null
164,216
[ "iphone", "objective-c", "cocoa-touch" ]
3,735,147
1
3,736,755
null
0
474
I'm parsing the image from the url, i want to display the corner of parsed image as roundrect(similar to figure2) but i'm not able to do that, can anyone guide me regarding on this, My code for parsing the image from url is ``` img_value = new URL(VAL4[arg0]); Log.v("Image_Url1",img_value.toString()); try{ mIcon11 = BitmapFactory.decodeStream(img_value.openConnection().getInputStream()); img.setImageBitmap(mIcon11); }catch(Exception e) { Log.v(TAG,"error "+e); } ``` Figure 2 ![alt text](https://i.stack.imgur.com/1y05p.png) Figure1 ![alt text](https://i.stack.imgur.com/hVV40.png)
How to apply round rectuangular shape to the parsed image from android?
CC BY-SA 2.5
null
2010-09-17T12:06:44.300
2010-09-17T15:35:12.063
2010-09-17T12:11:12.170
137,350
424,413
[ "android" ]
3,735,559
1
null
null
6
368
I'm using [tablesorter](http://tablesorter.com/docs/) in an `asp:GridView` and works fine but this been bother me for some time (firing up a call to the server, refreshing the page), as you can see by the 2 images below: before refresh: [alt text http://www.balexandre.com/temp/2010-09-17_1504.png](http://www.balexandre.com/temp/2010-09-17_1504.png) after refresh: ![alt text](https://i.stack.imgur.com/1lodj.png) Does anyone have an idea of if this might be a bug, or something on my end just for the behavior of it? Maybe someone already crossed this problem before
TableSorter loses header text
CC BY-SA 2.5
0
2010-09-17T13:09:30.983
2010-09-21T09:09:55.413
2010-09-17T13:23:22.820
44,269
28,004
[ "asp.net", "jquery", "tablesorter" ]
3,735,600
1
null
null
0
235
So I have such structure: 3 points (X, Y) BAC and knowledge that in real 3d world BAC angle is 90 degrees.So an image would look like that: ![alt text](https://i.stack.imgur.com/WxdwK.png) And what we want to get at first is : ![alt text](https://i.stack.imgur.com/VbwJO.png) than we wanna add some stuff like 2 parallel lines ![alt text](https://i.stack.imgur.com/nlOlR.png) and what I need next is some formula for somehow shrinking image back to its original view but now with added elements. So what formulas do I need?
Is there algorthm for 2 way 2D plane transformation based on 3 points and angle?
CC BY-SA 2.5
null
2010-09-17T13:14:27.550
2010-09-17T23:15:12.477
2010-09-17T23:15:12.477
242,848
434,051
[ "algorithm", "geometry", "transformation" ]
3,735,748
1
3,737,915
null
19
5,434
Here's the problem: I have a number of binary images composed by traces of different thickness. Below there are two images to illustrate the problem: ## First Image - size: 711 x 643 px ![711 x 643 example image](https://imgur.com/bA263.png) ## Second Image - size: 930 x 951 px ![alt text](https://imgur.com/3Zs7m.png) What I need is to measure the average thickness (in pixels) of the traces in the images. In fact, the average thickness of traces in an image is a somewhat subjective measure. So, what I need is a measure that have some correlation with the radius of the trace, as indicated in the figure below: ![alt text](https://imgur.com/rw0Sy.png) ## Notes - Since the measure doesn't need to be very precise, I am willing to trade precision for speed. In other words, speed is an important factor to the solution of this problem.- There might be intersections in the traces.- The trace thickness might not be constant, but an average measure is OK (even the maximum trace thickness is acceptable). - The trace will always be much longer than it is wide.
Measuring the average thickness of traces in an image
CC BY-SA 2.5
0
2010-09-17T13:33:43.377
2014-04-02T14:13:41.310
2010-09-17T20:26:39.293
353,410
64,138
[ "algorithm", "image", "language-agnostic", "image-processing", "computer-vision" ]
3,736,075
1
3,736,383
null
0
534
In my application I have a map, this map has a lot of annotations... but sometimes no location is found for an annotation (server couldn't find lat/lon). When this happens, I would like to draw a little box on my map with the text "Some locations could not be found" (or similar). I want this box to have round corners and to be transperant. Also, if possible I would prefer if this does not effect the functionality of the map. What I mean with that is that if the user draws its finger on the map from where that box is located, the map should still move. How can I make such a box? This is what I mean: ![alt text](https://i.stack.imgur.com/7VzoW.png) Best regards, Paul Peelen
Draw round-corner box
CC BY-SA 2.5
0
2010-09-17T14:12:44.857
2010-09-17T15:04:12.377
null
null
406,677
[ "iphone", "google-maps", "ios4", "drawing", "mapkit" ]
3,736,208
1
3,736,282
null
65
50,344
Okay. I'm sick of this problem. This have an easy fix, I'm sure of it!! I hope SO can help me to get rid of this once and for all! > How do we get Eclipse to stop trying to process/compile all files under a particular project directory? The goal is for no errors/warnings to exist in the problems view if they relate to something in this folder or it's subfolders. We run Eclipse 3.6 and the m2eclipse plugin v0.10.2.20100623 manages our autobuild. For reasons beyond my control, we have the entire BlazeDS distribution in our SVN project directory under `src/main/resources/blazeds`. Essentially, this directory contains a vanilla distribution of tomcat running blazeds to which all our configuration and project files are added when we deploy to our server via SCP. So, when we run deploy, this version of tomcat is copied to the server and our project is placed inside. Tomcat and our RIA application work and everything is fine. The problem is, Eclipse tries to compile everything under `src/main/resources/blazeds` when running AutoBuild and this generates about 300 errors/warnings in our problem view. So when a real error surfaces, it gets lost among the noise. The errors stem from code in `/blazeds/tomcat/webapps/samples/testdrive-datapush` and also the `testdrive-httpservice`, `traderdesktop` example webapps. They have dependent source code that's not on the classpath and jars that aren't included in the libraries. I'm trying to push the proper solution: to remove the samples completely and also to get blazeds out of our version control. That's not happening anytime soon. I've followed the [SO answer here](https://stackoverflow.com/questions/2514296/how-do-i-remove-error-warnings-made-by-tpl-files-in-my-eclipse-project) but it's only a very temporary solution. I've tried adding exclusions everywhere I can think of and other members of my team have done the same. I've removed `src/main/resources` as a source directory (in preferences > Java Build Path > Source Tab) I've added exclusions for `blazeds` under the resource directory. I've tried every permutation of `blazeds` and `**` as in `*blazeds*`, `**/blazeds/**`, etc. I've even tried including the libraries and source files the compiler is complaining about but I couldn't get it right without excessively mangling our project configuration. > This has to be simple. What is the conventional way to exclude a folder that is producing warnings/errors in an eclipse project? --- --- The picture below shows the red X's I'm trying to clear and that `Build Path > Exclude` isn't an option... ![Red X's won't go away](https://i.stack.imgur.com/auYdR.gif)
How to exclude a folder that is producing warnings/errors in an Eclipse project?
CC BY-SA 2.5
0
2010-09-17T14:28:48.260
2020-10-21T13:12:48.027
2017-05-23T12:26:07.887
-1
178,433
[ "eclipse", "ide", "build-process", "m2eclipse" ]
3,736,261
1
null
null
3
233
I made this graph in wolfram alpha by accident: ![Graph](https://i.stack.imgur.com/5elU2.gif) Readable code in any language is good, but something that can be run in a browser would be best (i.e. JavaScript / Canvas). If you write code in other languages, please include a screenshot. Notes: - [link](http://www.wolframalpha.com/input/?i=arg%28sin%28x%2Biy%29%29+%3D+sin%5E%28-1%29%28%28sqrt%282%29+cos%28x%29+sinh%28y%29%29%2Fsqrt%28cosh%282+y%29-cos%282+x%29%29%29)- - - - - - - Finally, here's another example which might help in your mission: ([link](http://www.wolframalpha.com/input/?i=arg%28sin%28x%2Biy%29%29+%3D+tan%5E%28-1%29%28cot%28x%29+tanh%28y%29%29)) ![Graph 2](https://i.stack.imgur.com/BGp14.gif)
How can I reproduce a scribbly pattern like this in code?
CC BY-SA 2.5
0
2010-09-17T14:34:45.677
2010-09-19T06:25:15.003
2010-09-17T14:41:44.303
443,019
443,019
[ "language-agnostic", "math", "graphics", "trigonometry" ]
3,736,459
1
3,740,361
null
4
2,951
I see examples of selectors using android states like 'selected' to define style. Here a simplified example: ``` <selector> <item android:state_selected="true" android:drawable="@color/transparent" /> <item android:drawable="@drawable/listitem_normal" /> </selector> ``` So, my question is: Can I define and use my own state instead of ``` android:state_selected="true" ``` My goal is to color shapes based on an integer value, like simple version of this heatmap: ![alt text](https://i.stack.imgur.com/3YrLq.gif)
Custom item states for android selectors
CC BY-SA 2.5
0
2010-09-17T14:56:11.463
2013-05-08T07:37:36.217
2010-09-18T04:36:12.403
14,651
289,740
[ "android", "coding-style", "selector", "heatmap" ]
3,736,552
1
3,736,705
null
5
7,915
Does anyone know where the various screen dimensions are for the iPhone4? I have checked the MobileHIG but alls I could find where references back to the old iPhone3G. Should I just assume that all previous values are doubled (i.e. StatusBar = 40 pixels), or is there a more accurate illustration (like the one below hidden somewhere else? ![alt text](https://i.stack.imgur.com/AOn7g.jpg) Cheers Gary
iPhone4 UI Element Size in Pixels?
CC BY-SA 2.5
0
2010-09-17T15:08:36.073
2010-09-17T16:12:13.973
null
null
164,216
[ "iphone", "cocoa-touch", "user-interface" ]
3,737,077
1
3,737,120
null
107
84,709
I have a `TextBox` control within a `StackPanel` whose `Orientation` is set to `Horizontal`, but can't get the TextBox to fill the remaining StackPanel space. XAML: ``` <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="180" Width="324"> <StackPanel Background="Orange" Orientation="Horizontal" > <TextBlock Text="a label" Margin="5" VerticalAlignment="Center"/> <TextBox Height="25" HorizontalAlignment="Stretch" Width="Auto"/> </StackPanel> </Window> ``` And this is what it looks like: ![alt text](https://i.stack.imgur.com/kSeqt.png) Why is that TextBox not filling the StackPanel? I know I can have more control by using a `Grid` control, I'm just confused about the layout.
WPF TextBox won't fill in StackPanel
CC BY-SA 2.5
0
2010-09-17T16:16:07.060
2022-07-11T10:28:30.637
null
null
172,387
[ ".net", "wpf" ]
3,737,164
1
3,737,511
null
6
1,299
So I sometimes use app_offline.htm to take an app offline while I upload a new version. However, while I am in the process of uploading larger dll's, I get the yellow error-screen saying the dll could not be loaded. This seems to be out of sync with my expectations of what app_offline.htm does (stops the app entirely), and also provides the users with errors in stead of the nice app_offline.htm I put up. Am I doing something wrong or is this behavior by design? ![alt text](https://i.stack.imgur.com/BOxPK.png)
Using app_offline.htm to take an app offline while updating dll's fails while updating dll's
CC BY-SA 2.5
0
2010-09-17T16:27:41.187
2010-09-17T17:27:59.250
2010-09-17T16:41:17.993
77,884
77,884
[ "asp.net", "iis-7", "app-offline.htm" ]
3,737,165
1
3,737,183
null
7
1,220
Yesterday I [worked up an example of](http://www.cerebralmastication.com/2010/09/principal-component-analysis-pca-vs-ordinary-least-squares-ols-a-visual-explination/) the difference between Ordinary Least Squares (OLS) vs. Principal Components Analysis (PCA). For that illustration I wanted to show the errors minimized by OLS and PCA so I plotted the actuals, the predicted line and then I manually (with GIMP) drew in a drop line to illustrate a couple of the error terms. How can I code the creation of the error lines in R? Here's the code I used for my example: ``` set.seed(2) x <- 1:100 y <- 20 + 3 * x e <- rnorm(100, 0, 60) y <- 20 + 3 * x + e plot(x,y) yx.lm <- lm(y ~ x) lines(x, predict(yx.lm), col="red") ``` Then I manually added the yellow lines to produce the following: ![alt text](https://i.stack.imgur.com/p0uWZ.png)
Drop lines from actual to modeled points in R
CC BY-SA 2.5
0
2010-09-17T16:27:49.613
2019-01-03T15:58:24.063
null
null
37,751
[ "r", "graphics", "lm" ]
3,737,252
1
6,024,390
null
0
1,164
I created a custom UITableViewCell in my app and the default indent when the Delete button is present is not happening, below is a screenshot of my settings. Anyone have any idea as to what I'm doing wrong? ![alt text](https://i.stack.imgur.com/l70Y0.png) Also, here's a shot of the IB properties: ![alt text](https://i.stack.imgur.com/Rsdzx.png)
Custom TableView Cell Indentation Issue
CC BY-SA 2.5
0
2010-09-17T16:39:49.443
2011-05-16T23:04:38.510
null
null
277,757
[ "iphone", "objective-c", "uitableview" ]
3,737,787
1
3,741,737
null
0
220
I have quite a big code here... But fortunately it is not needed to be mentioned at all. It comes down to something which... fails? So, in the end this is supposed to draw two triangles (using AS3 Graphics). It works fine with one, but when I put a second there, it looks weird. I trace debugged it, and I think the bug is in the Graphics - this is my output for the actual points drawn: ``` DRAW - POINT ( 50 , -50 ) - POINT ( -50 , 50 ) - POINT ( 50 , 50 ) DRAW - POINT ( -50 , -50 ) - POINT ( 50 , -50 ) - POINT ( -50 , 50 ) ``` (x, y), two triangles. This would result in a square of one color (these triangles are one colored), or possibly a square split in half if I were to change the colors. Would... It does not. Instead, I get THIS: ![alt text](https://i.stack.imgur.com/KO1C3.png) OR (which is weird), when I switch the order in which the triangles are drawn: ![alt text](https://i.stack.imgur.com/T1LGk.png) ... Any idea what is going on? I have read on another forum that functions beginFill and endFill are supposed to be called before and after drawing every shape - obviously that's what I did even before looking - the color won't be different elsehow. So - any idea? EDIT: The graphics calls look like this: ``` for (var vi:int = 0; vi < triangles.length; vi++){ gfx.beginFill(0xFF0000, 0.5 + (0.5 * vi)); trace("DRAW"); trace("- POINT ( " + triangles[vi].points[0].x + " , " + triangles[vi].points[0].y + " )"); trace("- POINT ( " + triangles[vi].points[1].x + " , " + triangles[vi].points[1].y + " )"); trace("- POINT ( " + triangles[vi].points[2].x + " , " + triangles[vi].points[2].y + " )"); gfx.lineTo(triangles[vi].points[0].x, triangles[vi].points[0].y); gfx.lineTo(triangles[vi].points[1].x, triangles[vi].points[1].y); gfx.lineTo(triangles[vi].points[2].x, triangles[vi].points[2].y); gfx.lineTo(triangles[vi].points[0].x, triangles[vi].points[0].y); gfx.endFill(); } ```
Graphics - overlapping bug or what?
CC BY-SA 2.5
null
2010-09-17T18:03:45.030
2010-09-18T12:45:42.720
2010-09-18T09:04:21.603
392,025
392,025
[ "actionscript-3", "graphics", "vector-graphics" ]
3,737,848
1
null
null
7
3,367
I've been researching this for weeks. I'm currently designing a architecture design using n-tier (3-layered) method and factory design approach. My goal is to put each client's business logic (ClientA.DLL, ClientB.DLL) in separate namespaces so that the project scales out, meaning I can modify/remove/add a specific client's business logic without affecting the others, because they're not dependent on each other. Then I invoke the client's namespaces/class using the client's unique identifier (a string value that is maintained in the database) via the Factory namespace. The also the per-client logic, while the serves as the Layout or the Template that the per-client's classes will be using. Here is the project solution: ![alt text](https://i.stack.imgur.com/lBf9o.jpg) And here is the actual code: ``` namespace BusinessAbstract { // the entity / data transfer object public class MemberDTO { public string MemberID { get; set; } public string MemberName { get; set; } } // the interface public interface IMaintainable { void Add(); void Edit(); void Delete(); } // the base abstract class, implements the Entity and the Interface public abstract class Member : MemberDTO, IMaintainable { // Implement IMaintanable but change it to abstract public abstract void Add(); public abstract void Edit(); public abstract void Delete(); // a method with Database access, get from DAL public virtual MemberDTO GetMemberDetails(params object[] args) { return DAL.MemberDAL.FetchMemberDetails(args); } public virtual string GetClientBLL() { return "base's method"; } } } ``` ClientA implementation of the AbstractBusinessRule ``` namespace ClientA { public class _Member : BusinessAbstract.Member { public override void Add() { throw new NotImplementedException(); } public override void Edit() { throw new NotImplementedException(); } public override void Delete() { throw new NotImplementedException(); } public override string GetClientBLL() { return "ClientA Method"; } } } ``` The Factory ``` public static class Invoker { public static T GetMemberInstance<T>(string clientCode) where T : Member, IMaintainable { Type objType = Type.GetType(clientCode + "._Member," + clientCode); return (T)Activator.CreateInstance(objType); } } ``` Sample implementation on Presentation Tier ``` protected void Page_Load(object sender, EventArgs e) { // invoke Member class using String hardcode Member obj = Invoker.GetMemberInstance<Member>("ClientA"); Response.Write(obj.GetClientBLL()); //prints clientA method obj = Invoker.GetMemberInstance<Member>("ClientB"); Response.Write(obj.GetClientBLL()); //prints clientB method } ``` And you'll also notice that I have a DAL folder in each of the client DLLs as well as the AbstractBusinessRule DLL, because I also want to scale the DAL layer and use the layer structure "UI-BLL-DAL." Any comments/suggestion about this design are welcome. I'm hoping for input on how I can improve this structure. Thanks in advance.
Creating A Loosely-Coupled / Scalable software architecture
CC BY-SA 3.0
0
2010-09-17T18:12:48.130
2017-05-28T22:07:15.180
2017-05-28T22:07:15.180
3,241,128
444,024
[ "c#", ".net", "design-patterns", "architecture" ]
3,738,269
1
3,738,402
null
19
11,410
[In my previous question](https://stackoverflow.com/questions/3684484) a lot of users wanted me to give some more data to toy with. So I got working on exporting all my data and processing it with Python, but then I realized: where do I leave all this data? Well I decided the best thing would be to stick them in a database, so at least I don't have [to parse the raw files](http://cid-0e685da213fd5935.skydrive.live.com/redir.aspx?page=browse&resid=E685DA213FD5935!148&type=6&authkey=WOUgehAzQ!o%24&Bsrc=EMSHGM&Bpub=SN.Notifications) every time. But since I know nothing about databases this is turning out to be quite confusing. I tried some tutorials to create a sqlite database, add a table and field and try to insert my numpy.arrays, but it can't get it to work. Typically my results per dog look like this: ![alt text](https://i.stack.imgur.com/2403W.png) So I have 35 different dogs and each dog has 24 measurement. Each measurement itself has an unknown amount of contacts. Each measurement consists out of a 3D array (248 frames of the whole plate [255x63]) and a 2D array (the maximal values for each sensor of the plate [255x63]). Storing one value in a database wasn't a problem, but getting my 2D arrays in there didn't seem to work. So my question is how should I order this in a database and insert my arrays into it?
How to insert arrays into a database?
CC BY-SA 2.5
0
2010-09-17T19:16:31.653
2010-09-19T04:42:15.230
2017-05-23T12:16:55.167
-1
77,595
[ "python", "database-design", "numpy" ]
3,738,334
1
null
null
1
196
I have a several series of data points that need to be graphed. For each graph, some points may need to be thrown out due to error. An example is the following: ![alt text](https://i.stack.imgur.com/49iNO.jpg) The circled areas are errors in the data. What I need is an algorithm to filter this data so that it eliminates the error by replacing the bad points with flat lines, like so: ![alt text](https://i.stack.imgur.com/wZ0sP.jpg) Are there any algorithms out there that are especially good at detecting error points? Do you have any tips that could point me in the right direction? EDIT: Error points are any points that don't look consistent with the data on both sides. There can be large jumps, as long as the data after the jump still looks consistent. If it's on the edge of the graph, large jumps should probably be considered error.
How should I filter this data?
CC BY-SA 2.5
null
2010-09-17T19:25:15.317
2010-09-17T21:28:01.853
2010-09-17T20:35:27.497
138,757
138,757
[ "algorithm", "filter", "data-processing", "post-processing" ]
3,738,504
1
null
null
2
1,346
I understand how to include a standard alert within my iPhone application, and can dismiss it with an OK or CLOSE button (see Epicurious example in image). How can I make a cool alert/notice overlay like the one seen in the foursquare app (see foursquare example in image)? In particular, how to include the alert/notice layout with graphic. Is this a separate view? If you can point me to a tutorial or sample code that will get me moving in the right direction, it's appreciated! :) ![alt text](https://i.stack.imgur.com/e9pWU.jpg)
How to Implement a Cool Alert/Information Overlay on iPhone?
CC BY-SA 2.5
0
2010-09-17T19:47:48.343
2012-12-13T23:11:08.057
null
null
237,134
[ "iphone", "ios4", "ios" ]
3,738,601
1
3,738,667
null
4
133
There are usually some that I don't use in whatever project I'm working on (System.XML, System.XML.Linq for example). Are there any drawbacks from leaving default assemblies that I won't be using in my project? ![alt text](https://i.stack.imgur.com/irK1D.png)
Bad to leave unused default assemblies in the reference folder?
CC BY-SA 2.5
0
2010-09-17T20:03:22.727
2011-07-18T01:27:56.507
null
null
226,897
[ ".net", "assemblies", "visual-studio-project" ]
3,739,000
1
4,912,130
null
2
278
Other than copying Facebook's SELECT and OPTION elements, is there a Rails-native way of generating a Facebook-esque, localized-language select list? ![alt text](https://i.stack.imgur.com/e1adi.png)
Rails3 Facebook-esque localized language picklist
CC BY-SA 2.5
0
2010-09-17T21:01:00.573
2011-02-06T07:12:48.873
null
null
134,367
[ "localization", "ruby-on-rails-3" ]
3,739,144
1
3,746,078
null
4
4,252
I'd like to get a list of all the Azure Table errors and figure out a clean way to handle them in a `try...catch` block. For example, I'd like to not have to directly code and compare the InnerException message to `String.Contains("The specified entity already exists")`. What is the right way to trap these errors? ![alt text](https://i.stack.imgur.com/uPZME.png)
Clean way to catch errors from Azure Table (other than string match?)
CC BY-SA 2.5
0
2010-09-17T21:24:34.900
2011-07-08T08:06:58.613
2010-09-18T20:40:01.790
328,397
328,397
[ "c#", "azure", "try-catch", "azure-table-storage" ]
3,739,454
1
3,742,053
null
7
5,192
I'm building a small 3D engine for a game I'm working on. I've got my basics sorted: textured triangles with backface culling. However depth sorting is proving to be a difficult problem. I'm calculating the face Z by averaging out the 3 points that make up the triangular face. The longer faces sometimes overlap the smaller faces since they have a larger Z value and therefore rise up in the depth sorted display list. How do I fix this? I'm sure there are known depth sorting techniques if I can only get some practical help in programming them. I've build the render pipeline myself so I have access to all the required data - triangles, points, textures, UV coordinates, etc. ![alt text](https://i.stack.imgur.com/dgRPF.jpg) ![alt text](https://i.stack.imgur.com/2kGcH.jpg)
How do I Z-sort triangles for a 3D engine?
CC BY-SA 2.5
0
2010-09-17T22:18:36.890
2015-09-08T17:30:52.243
2012-05-10T12:59:14.113
29,995
41,021
[ "3d", "rendering", "depth-buffer" ]
3,739,970
1
3,740,000
null
1
1,236
In the following code, I am able to check with the debugger the values of self and childView. ``` [self.navigationController pushViewController:childView animated:YES]; ``` ![](https://imgur.com/eqfsD.png) However, I am not able to see the value of self.navigationController. How can I check if it is nil?
How to check if self.navigationController is nil
CC BY-SA 2.5
null
2010-09-18T01:09:39.083
2010-09-18T04:15:24.620
2010-09-18T01:22:26.727
404,020
404,020
[ "cocoa", "cocoa-touch", "xcode", "gdb", "debugging" ]
3,740,122
1
3,740,875
null
0
3,797
EDIT: Solved, (at least for the explorer) the problem was it keeps the old thumbs.db. I have a png icon and I've created a 128px, 96px, 64px, 32px, 16px icon using several tools. But the result is always the same.. when I compile the exe using that icon and resize to max icon size, it stays to something like 32-48px. Anyone got the same issue? Also when I put the executable on RocketDock, it also gets small icon. The executable has all icons, I checked it with Resource Hacker. It's a strange issue, I just wanted to make my app with big icon so it can be used in dock applications and on users that use bigger icon sizes. Here's an example of what I'm talking about. The Visual Studio icon is there just for test. ![alt text](https://i.stack.imgur.com/7yXXp.png) And also a RocketDock screenshot containing a shortcut to the icon and to the executable: ![alt text](https://i.stack.imgur.com/mkoYk.png)
Incorrect icon size when imported to exe
CC BY-SA 2.5
null
2010-09-18T02:20:48.320
2010-09-18T12:28:24.813
2010-09-18T12:28:24.813
309,145
309,145
[ "c#", "windows", "visual-studio", "icons" ]
3,740,165
1
3,740,628
null
1
212
I'm used to using Idle for Python development, but decided to give Visual Studio 2010 + IronPython a try last week. It seems to work fine, but I noticed that triple-quoted (multi-line) strings don't highlight correctly in the editor. See photo: ![The whole string block should be red](https://i.stack.imgur.com/FbX5q.png) Does anyone else have this problem or know of a good fix? Apart from that bug, Visual Studio seems to be great for Python.
Python Triple Quoted Strings in Visual Studio 2010
CC BY-SA 2.5
null
2010-09-18T02:37:38.577
2010-09-18T06:28:22.507
null
null
162,220
[ "visual-studio", "ide", "ironpython" ]
3,740,186
1
3,740,194
null
15
15,165
I just generated a few million GUID's turned them into a String and got the length... it was always the same. Can I rely on this fixed length of the GUID when converting to String? Also, is the middle number of the GUID always "4" as shown in this screenshot? ![alt text](https://i.stack.imgur.com/isj7i.png)
Questions about GUID's: Are they always fixed in length, and is the middle number always 4?
CC BY-SA 2.5
0
2010-09-18T02:46:21.583
2010-09-28T20:06:05.087
2010-09-18T04:27:19.117
76,337
328,397
[ "c#", ".net", "guid" ]
3,740,590
1
3,740,693
null
1
1,091
I'm building a graphical program that will need to show files on both the user's computer and on a remote server. I'm using Tkinter, and I'm definitely a novice with this toolkit. I want to have the files displayed in a box similar to what you would get from a "Details" view in Windows, so that each file has several categories of info(think name, type, size, permissions, etc.) about it and so that the list can be sorted by category, ascending or descending. What objects in Tkinter (if any) could I use to accomplish this? Is there a tutorial or an existing project that implements something similar with Tkinter? I'm not sure if my description makes sense, so here's a screenshot of what I want: ![alt text](https://i.stack.imgur.com/0a36u.png)
List sorted by categories in Tkinter?
CC BY-SA 2.5
0
2010-09-18T06:09:34.697
2010-09-18T06:54:48.757
null
null
399,815
[ "python", "user-interface", "tkinter", "detailsview" ]
3,741,137
1
null
null
2
151
I'm showing code in an ordered list, so that it displays with line numbers. Each `li` has a `pre` tag filled with a line of code in it. My problem is that when I set the width of the `ol`, and I allow the overflow to scroll, the background color of the overflow is different than the background color of the area originally showing. The background of the `ol` has to be a different color than the background of the `li`s to make the line numbers stand out. Is there something wrong with my CSS, why is this happening? How can I have scrolling, and different background colors for line numbers and code? HTML: ``` <ol class="code"> <li> <pre>Hello World! This is a long line that you have to scroll to see.</pre> </li> <li> <pre>This is the second line that you have to scroll to see.</pre> </li> </ol> ``` CSS: ``` ol { width:200px; background-color:#CFCFCF; } pre { color:#FFF; background-color:#000; } .code { overflow:scroll; } ``` [Example page](http://jsbin.com/itiki5/2) The problem: ![alt text](https://i.stack.imgur.com/Ilg4Z.png)
In my LI, why is the bg color of the overflow different than the bg color of the rest?
CC BY-SA 2.5
null
2010-09-18T09:45:22.840
2012-10-06T12:02:01.597
null
null
186,636
[ "html", "css", "scroll" ]
3,741,345
1
3,741,518
null
1
103
I have a tab control (in my case a UltraTabControl from Infragistics) and I add a new tab. The text of this new tab is set to "Escape &Characters". ``` lTab.Text = "Escape &Characters" ``` When visualizing the tab control the will become an _ (underscore) for the next character - in this case "C" ![alt text](https://i.stack.imgur.com/11UGL.png) I know that is the Microsoft way of indicating a shortcut character - but is there any way of disabling this behaviour? Thanks in advance.
Disable conversion of & to shortcut indicator (winforms)
CC BY-SA 2.5
null
2010-09-18T10:37:29.243
2010-09-24T15:35:58.570
null
null
209,407
[ ".net", "vb.net", "winforms", "escaping" ]
3,741,596
1
3,741,963
null
5
219
I used below code and tried to debug in Visual studio 2008 by pressing F10. ``` //test.cpp #include<iostream> using namespace std; int main(void) { #line 100 "test.cpp" cout<<"Inside main()"<<endl; return 0; } ``` Below is the debugger screen shot. ![alt text](https://i.stack.imgur.com/TLPTw.png) #line 100 tells compiler to go to line 100 to get its next line. As 100th line doesn't exist, it goes outside the main function as shown in the screenshot. If i try to debug code with F10, control never comes back to main function. It keeps on showing the pointer outside the main function even though it is executing main(). If i give other file name in place of test.cpp, pointer goes to that file, but it doesn't come back to test.cpp Any idea why debugger is behaving like this ?
Strange behavior of debugger when #line control is used
CC BY-SA 2.5
null
2010-09-18T11:52:02.223
2012-09-20T21:03:40.160
2012-09-20T21:03:40.160
1,288
426,051
[ "c++", "visual-studio-2008" ]
3,741,842
1
3,742,040
null
1
1,440
I want to make simple content page with silverlight with next requirments: Page must contains: 1. top space for banners(html) 2. center - silverlight component. and he will stretch to fitt page. 3. bottom space for banners(html) Looks quite easy but i faced problem with internet explorer 8. Silverlight component have small size and doesnot stretch. In others browsers its works fine. Styles: ``` <style type="text/css"> html, body { height: 100%; overflow: auto; } body { padding: 0; margin: 0; } #silverlightControlHost { height: 100%; text-align: center; } </style> ``` HTML: ``` <body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" style="overflow: hidden; height: 100%; width: 100%;"> <table frame="none" cellpadding="0" cellspacing="0" style="height: 100%; width: 100%; border:0px solid White; padding: 0px;"> <tr style="background-color: Red; height: 30px; width: 100%;"> <td> </td> </tr> <tr style="background-color: Blue; height: 100%; width: 100%;"> <td> <div id="silverlightControlHost" style="height: 100%; width: 100%; background-color: Black;"> <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%"> <param name="source" value="ClientBin/test.xap" /> <param name="onError" value="onSilverlightError" /> <param name="background" value="white" /> <param name="minRuntimeVersion" value="4.0.50401.0" /> <param name="autoUpgrade" value="true" /> <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50401.0" style="text-decoration: none"> <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Получить Microsoft Silverlight" style="border-style: none" /> </a> </object> <iframe id="_sl_historyFrame" style="visibility: hidden; height: 0px; width: 0px; border: 0px"></iframe> </div> </td> </tr> <tr style="background-color: Red; height: 30px; width: 100%;"> <td> </td> </tr> </table> </body> ``` Chrome(works perfect): ![alt text](https://i.stack.imgur.com/1akTb.png) IE8(not so good): ![alt text](https://i.stack.imgur.com/1LNol.png) What wrong with it? How to fix it?
CSS problem with silverlight component position. Cannot set height that i want
CC BY-SA 2.5
null
2010-09-18T13:21:49.290
2010-09-19T19:27:50.760
2010-09-18T14:40:05.613
508,330
508,330
[ ".net", "html", "css", "wpf", "silverlight" ]
3,741,973
1
3,742,070
null
0
376
I'm trying to test the following code : [http://github.com/mobilemelting/nvpolyline](http://github.com/mobilemelting/nvpolyline). When I run the app, all I get is a black screen. There are only two View Controllers, MainWindow.xib and NVMapViewController.xib. See my settings for MainWindow.xib in the attached image. What am I missing ? Regards, Stephen ![alt text](https://i.stack.imgur.com/iaXix.png)
MainWindow.xib is just a black screen
CC BY-SA 2.5
null
2010-09-18T14:02:10.847
2010-09-18T14:38:33.673
null
null
387,552
[ "iphone", "viewcontroller" ]
3,741,972
1
3,753,415
null
9
7,610
Is there a look-and-feel-independent way to align a component (e.g. a `JLabel`) horizontally with the of a `JCheckBox`? I am trying to use values from the `UIDefaults` to predict the location of the text relative to the top-left corner of the `JCheckBox`. I have found a combination that gives the right result for the Metal, Windows, Motif and Aqua Look-and-Feels: ![Example: Metal (correctly-aligned)](https://i.stack.imgur.com/x4Y0N.png) But not in Nimbus: ![Example: Nimbus (incorrectly-aligned)](https://i.stack.imgur.com/LxO0D.png) Is there a utility method somewhere that will reliably give X,Y offsets for the text in all Look-and-Feels? --- Code (note: to avoid any layout side-effects I used a null layout for this test): ``` import java.awt.Insets; import javax.swing.JApplet; import javax.swing.JCheckBox; import javax.swing.JLabel; import javax.swing.UIManager; import javax.swing.border.Border; public class AlignCheckBoxText extends JApplet { public AlignCheckBoxText() { setLayout(null); checkBox = new JCheckBox("Hello, World!"); label = new JLabel("Hello, World!"); add(checkBox); add(label); } @Override protected void validateTree() { checkBox.setLocation(0, 0); checkBox.setSize(checkBox.getPreferredSize()); int labelX = UIManager.getIcon("CheckBox.icon").getIconWidth(); Insets cbInsets = UIManager.getInsets("CheckBox.margin"); if (cbInsets != null) labelX += cbInsets.left + cbInsets.right; Border cbBorder = UIManager.getBorder("CheckBox.border"); if (cbBorder != null) { Insets borderInsets = cbBorder.getBorderInsets(checkBox); if (borderInsets != null) { labelX += borderInsets.left; } } label.setLocation(labelX, checkBox.getHeight()); label.setSize(label.getPreferredSize()); super.validateTree(); } private JCheckBox checkBox; private JLabel label; } ```
Align a JLabel with the text of a JCheckBox
CC BY-SA 2.5
0
2010-09-18T14:01:08.453
2010-09-20T16:24:22.510
null
null
12,048
[ "java", "swing", "jcheckbox" ]
3,742,122
1
3,742,151
null
0
712
I'm working on a program that uses the Accelerate framework (for LAPACK) and I have several issues. The code is written in C but needs to include C++ headers. I renamed the file to .cpp but it caused two errors, shown below. ![C++ Error Image](https://cl.ly/2RNB/content) So I then realized tried to `#include <Accelerate/Accelerate.h>` to include the headers, since what our LAPACK coder did was retype the definitions (`dgemm_(), dposv_(), etc.`) at the beginning of the file and rely on the compiler/linker to work things out. So I commented out those and just did the #include. What came out was this: ![Accelerate Error Image](https://cl.ly/2RYX/content) So, how do I use the LAPACK functions using Accelerate in a C++ file? I'm not that familiar with LAPACK, so I'm not sure how that framework normally works.
Data Types in Accelerate.framework
CC BY-SA 2.5
null
2010-09-18T14:54:09.880
2010-09-18T15:02:34.993
2017-02-08T14:30:22.387
-1
119,572
[ "c++", "lapack" ]
3,742,300
1
3,742,312
null
10
3,294
I have a collection of (Podcast) in an array. When I use a loop to iterate through this collection, I don't have on the variable that contains the object pulled out of the collection (as I would in C#/VisualStudio for instance). ![alt text](https://i.stack.imgur.com/m1MvE.png) ``` <?php $podcasts = new Podcasts(); echo $podcasts->getListHtml(); class Podcasts { private $collection = array(); function __construct() { $this->collection[] = new Podcast('This is the first one'); $this->collection[] = new Podcast('This is the second one'); $this->collection[] = new Podcast('This is the third one'); } public function getListHtml() { $r = ''; if(count($this->collection) > 0) { $r .= '<ul>'; foreach($this->collection as $podcast) { $r .= '<li>' . $podcast->getTitle() . '</li>'; } $r .= '</ul>'; } return $r; } } class Podcast { private $title; public function getTitle() { return $this->title; } public function setTitle($value) { $this->title = $value;} function __construct($title) { $this->title = $title; } } ?> ``` # Addendum Thanks, Fanis, I updated my FOREACH template to include that line automatically: ``` if(count(${lines}) > 0) { foreach(${lines} as ${line}) { /* @var $$${var} ${Type} */ } } ``` ![alt text](https://i.stack.imgur.com/osLdr.png)
How can I get intellisense in PHP/Eclipse on custom objects pulled out of array in foreach loop?
CC BY-SA 2.5
0
2010-09-18T15:45:10.803
2018-08-07T22:16:24.083
2010-09-19T03:54:13.557
4,639
4,639
[ "php", "eclipse", "intellisense", "code-completion", "type-hinting" ]
3,742,332
1
3,743,492
null
0
525
For some reason, after a user enters text into an EditText within my Android app the white-bar which contains "suggestions" remains at the bottom of my Layout! If you press the "Back" button, it disappears. How can I stop this from remaining after completing text entry? EDIT: Screenshots Editing the text, white bar appears with suggestions: ![alt text](https://i.stack.imgur.com/4JiKy.png) And after going back to the ListView activity ![alt text](https://i.stack.imgur.com/jG1r4.png)
How to remove the white-bar which remains after typing in Android
CC BY-SA 2.5
null
2010-09-18T15:55:59.433
2010-10-06T15:50:50.923
2010-09-18T17:05:04.987
250,022
250,022
[ "android" ]
3,742,382
1
3,743,144
null
8
4,176
Greetings, I would like to detect if a segment only 'touches' a polygon or cross it. The Figure ![alt text](https://i.stack.imgur.com/Ah8ht.png) explains my doubt. How to know the difference between cases A and B? Note that in both situations the red line crosses the polygons in two vertices, one touching by outside and other crossing by inside. I have a segment-segment intersection algorithm, but I don't know how to use it properly. Any help is appreciated.
segment-polygon intersection
CC BY-SA 2.5
0
2010-09-18T16:09:18.127
2012-05-10T14:38:32.560
2010-09-18T19:36:24.663
50,476
451,472
[ "computational-geometry" ]
3,742,731
1
3,743,883
null
8
23,008
Have not done this before, so obviously I suck at it. Here 64 pixels around current mouse position get drawn little bigger on a form. Problem is, that it's 'kind of' to slow, and I have no idea where to start fixing. Besides that, I made a thread, that constantly calls update graphics when it's finished and a little fps like text, to show really how fast things are drawn. Image example: (Image is from letter 'a' in Eclipse) ![alt text](https://i.stack.imgur.com/i0OQQ.png) Code example : ``` @SuppressWarnings("serial") public static class AwtZoom extends Frame { private BufferedImage image; private long timeRef = new Date().getTime(); Robot robot = null; public AwtZoom() { super("Image zoom"); setLocation(new Point(640, 0)); setSize(400, 400); setVisible(true); final Ticker t = new Ticker(); this.image = (BufferedImage) (this.createImage(320, 330)); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent we) { t.done(); dispose(); } }); try { robot = new Robot(); } catch (AWTException e) { e.printStackTrace(); } t.start(); } private class Ticker extends Thread { public boolean update = true; public void done() { update = false; } public void run() { try { while (update == true) { update(getGraphics()); // try { // Thread.sleep(200); // } catch (InterruptedException e) { // e.printStackTrace(); // return; // } } } catch (Exception e) { update=false; } } } public void update(Graphics g) { paint(g); } boolean isdone = true; public void paint(Graphics g) { if (isdone) { isdone=false; int step = 40; Point p = MouseInfo.getPointerInfo().getLocation(); Graphics2D gc = this.image.createGraphics(); try { for (int x = 0; x < 8; x++) { for (int y = 0; y < 8; y++) { gc.setColor(robot.getPixelColor(p.x - 4 + x, p.y - 4 + y)); gc.fillOval(x * step, y * step, step - 3, step - 3); gc.setColor(Color.GRAY); gc.drawOval(x * step, y * step, step - 3, step - 3); } } } catch (Exception e) { e.printStackTrace(); } gc.dispose(); isdone = true; iter++; } g.drawImage(image, 40, 45, this); g.setColor(Color.black); StringBuilder sb = new StringBuilder(); sb.append(iter) .append(" frames in ") .append((double) (new Date().getTime() - this.timeRef) / 1000) .append("s."); g.drawString(sb.toString(), 50, 375); } int iter = 0; } ``` Changes made: * added "gc.dispose();" * added "isdone", so redraw could not be called faster, then it should. * added [this link](http://pastebin.com/huD9s6bq) to thrashgod source rewrite * added [this link](http://pastebin.com/V8mDfUiV) to thrashgod source rewrite 2
Java, how to draw constantly changing graphics
CC BY-SA 2.5
0
2010-09-18T17:35:55.967
2016-04-03T07:41:27.833
2010-09-19T09:42:47.480
97,754
97,754
[ "java", "graphics" ]
3,742,799
1
3,742,892
null
1
722
I have following entities: ![alt text](https://i.stack.imgur.com/BDyLl.jpg) In my code I need to update the `FKCategoryID` in entity `BudgetPost` but I'm getting the following error: > FKCategoryID is part of the object's key information Is it any way to update the key in this case or it's not possible? Thanks in advance
ADO.NET EF Composite primary key - can not update foreign key
CC BY-SA 3.0
null
2010-09-18T17:51:18.410
2013-04-10T20:33:18.300
2013-04-10T20:33:18.300
558,486
304,083
[ "c#", "asp.net", ".net", "entity-framework", "ado.net" ]
3,742,849
1
3,743,019
null
1
3,193
I'm trying to improve user compatibility of a site for 800 x 600px monitors. I have a 'headerbackground' div which is 900px wide, and contains nothing but a background image. The rest of the site is nested inside that div, with a width of 790px. What I'd like to do is show the full 900px 'headerbackground' div if the browser window is greater than 900px, but trigger a horizontal scrollbar in the browser if the screen res is between 790 & 900px. I'm aware that this can be easily achieved with a centered 'background' image on the body tag, but that isn't a feasible option in this case because the current body background image has a horizontally-repeating background, and the header background image doesn't repeat. Any suggestions appreciated Edit: Image attached for clarity. ![alt text](https://i.stack.imgur.com/jdyGs.jpg)
HTML/CSS: Creating a div that doesn't trigger a horizontal scrollbar if it's wider than the screen size
CC BY-SA 2.5
null
2010-09-18T18:07:21.863
2010-09-18T18:55:18.537
2010-09-18T18:31:36.887
346,977
346,977
[ "html", "css", "overflow" ]
3,742,928
1
3,743,232
null
4
5,479
I am trying to design a way to represent mathematical equations as Java Objects. This is what I've come up with so far: - - - -Objects that extend would include things such as to represent trigonometric functions.- - - The overall idea is that I would be able to programmatically manipulate the equations (for example, a dirivative method that would return an equation that is the derivative of the equation it was called for, or an evaluate method that would evaluate an equation for a certain variable equaling a certain value). What I have works fine for simple equations: ![x^2 + 3](https://i.stack.imgur.com/QXVYV.gif) This is just two s: one with a variable "x" and an exponent "2" and another which is just a constant "3." But not so much for more complex equations: ![alt text](https://i.stack.imgur.com/fyvNU.gif) Yes, this is a terrible example but I'm just making a point. So now for the question: what would be the best way to represent math equations as Java objects? Are there any libraries that already do this?
Representing Math Equations as Java Objects
CC BY-SA 2.5
0
2010-09-18T18:27:57.157
2011-05-30T03:24:59.453
null
null
355,325
[ "java", "math" ]
3,743,035
1
null
null
2
3,489
i tried running "Photo capture example" in android emulator , ``` http://labs.makemachine.net/wp-content/uploads/2010/03/2010_04_09_make_machine_photo_capture.zip ``` when the photocapture example is loaded in android emulator , it shows the screen with “No Image” Text and “Take Photo” button. as follows, ![alt text](https://i.stack.imgur.com/5qAZA.png) if i click on “Take Photo: Button then a camera window appears with a “black and white boxes” and after that a run time error generated to forcefully close the application. As far as sd card is concerned i have created it using AVD manager in eclipse. after that i have set one image file also and mount the sdcard. But still not be able to take the photo , so please tell me what is require to run this program.
take photo in android emmulator
CC BY-SA 2.5
0
2010-09-18T18:58:48.297
2010-09-19T01:48:02.157
null
null
405,383
[ "android", "android-emulator" ]
3,743,299
1
null
null
3
422
This is a beautiful image. I'm wondering how it can be generated programmatically with an image-processing library like imagemagick or gd? [http://robertbasic.com/img/sign-letters.gif](http://robertbasic.com/img/sign-letters.gif) ![alt text](https://i.stack.imgur.com/xvhsB.gif) My general idea is that the frame itself could be defined separately, but is there way to fill that frame with letters in the same way they're doing it here but programmatically?
Image created programmatically?
CC BY-SA 2.5
null
2010-09-18T20:05:59.010
2010-09-18T20:38:44.637
2010-09-18T20:38:44.637
435,565
435,565
[ "php", "image", "image-processing", "imagemagick", "gd" ]
3,743,347
1
3,743,356
null
0
387
I'm using IntelliJ IDEA 9 Community Edition for Java project. On "Create New Class" dialog you can see some strange UI element (highlighted in red). ![alt text](https://i.stack.imgur.com/n3x16.png) What is the purpose of this element?
IntelliJ IDEA 9 CE "Create New Class" dialog UI element purpose
CC BY-SA 2.5
0
2010-09-18T20:19:48.380
2010-09-18T20:34:19.333
null
null
153,349
[ "java", "ide", "intellij-idea" ]
3,743,415
1
null
null
5
2,232
I have an application with `UITabBarController` with a `UINavigationController` subview, which holds a table view. I want to be able to switch out the `UITabBarController` with a `UIToolbar` for a specific view controller when a cell is selected. Here's an example from some other application, which reacts the same way: ![Initial view with UITabBarController and UINavigationController](https://i.stack.imgur.com/6Iaq7.png) And when you select a table view cell: ![Detailed view with UIToolbar](https://i.stack.imgur.com/LT93i.png) The detailed view controller (second screen) needs to replace the parent `UITabBarController` with an `UIToolbar`. Does anyone know how I can do this?
Replace UITabBar with UIToolBar
CC BY-SA 2.5
0
2010-09-18T20:43:29.800
2011-04-16T11:31:45.103
null
null
68,674
[ "uitableview", "uinavigationbar", "uitabbar", "uitoolbar" ]
3,743,608
1
3,939,123
null
1
364
![alt text](https://i.stack.imgur.com/lINvw.png) So it seems like the new VS highlights whole sections of code when the mouse is over the collapsible line on the far left of the IDE. I don't know what this feature is called but I couldn't see any option in the Options to turn this off. Is this possible? If so, how?
How to turn off Visual Studio 2010's new collapsible section mouse over highlighter?
CC BY-SA 2.5
0
2010-09-18T21:37:42.473
2010-10-15T02:45:00.827
null
null
51,816
[ "visual-studio", "editor" ]
3,743,897
1
3,744,273
null
2
7,034
Have not done this before ([except in java](https://stackoverflow.com/questions/3742731/java-how-to-draw-constantly-changing-graphics), look how [Steve McLeod](https://stackoverflow.com/users/2959/steve-mcleod) fixed it), so obviously I suck at it. Here 64 pixels around current mouse position get drawn little bigger on a form. Problem is, that it's 'kind of' to slow, and I have no idea where to start fixing. Besides that, I made a timer thread, that constantly calls update graphics when it's finished and a little fps like text, to show really how fast things are drawn. Image example: (Image is from letter 'a' in "IntelliTrace" in Microsoft VS2010) ![alt text](https://i.stack.imgur.com/cxY7o.png) Source example: ``` using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; namespace Zoom { public partial class Form1 : Form { static class dllRef { [DllImport("user32.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool GetCursorPos(out Point lpPoint); [DllImport("user32.dll")] static extern IntPtr GetDC(IntPtr hwnd); [DllImport("user32.dll")] static extern Int32 ReleaseDC(IntPtr hwnd, IntPtr hdc); [DllImport("gdi32.dll")] static extern uint GetPixel(IntPtr hdc, int nXPos, int nYPos); // from http://www.pinvoke.net/default.aspx/gdi32/GetPixel.html static public System.Drawing.Color getPixelColor(int x, int y) { IntPtr hdc = GetDC(IntPtr.Zero); uint pixel = GetPixel(hdc, x, y); ReleaseDC(IntPtr.Zero, hdc); Color color = Color.FromArgb((int)(pixel & 0x000000FF), (int)(pixel & 0x0000FF00) >> 8, (int)(pixel & 0x00FF0000) >> 16); return color; } static public System.Drawing.Point getMousePosition() { Point p = new Point(); GetCursorPos(out p); return p; } } public Form1() { InitializeComponent(); this.Size = new Size(400,400); this.Text="Image zoom"; this.Location = new Point(640, 0); this.image = new Bitmap(320, 320); this.timeRef = DateTime.Now; this.BackColor = Color.White; Timer t = new Timer(); t.Interval = 25; t.Tick += new EventHandler(Timer_Tick); t.Start(); } public void Timer_Tick(object sender, EventArgs eArgs) { this.Form1_Paint(this, new PaintEventArgs(this.CreateGraphics(), new Rectangle(0, 0, this.Width, this.Height))); } private bool isdone = true; private int iter = 0; private Bitmap image; private DateTime timeRef; private void Form1_Paint(object sender, PaintEventArgs e) { if (isdone) { isdone = false; int step = 40; Point p = dllRef.getMousePosition(); Pen myPen = new Pen(Color.Gray, 1); SolidBrush myBrush = null; Bitmap image2 = new Bitmap(320, 340); Graphics gc = Graphics.FromImage(image2); for (int x = 0; x < 8; x++) { for (int y = 0; y < 8; y++) { myBrush = new SolidBrush(dllRef.getPixelColor(p.X - 4 + x, p.Y - 4 + y)); gc.FillEllipse(myBrush, x * step, y * step, step - 3, step - 3); gc.DrawEllipse(myPen, x * step, y * step, step - 3, step - 3); } } StringBuilder sb = new StringBuilder(); sb.Append(iter) .Append(" frames in ") .Append(String.Format("{0:0.###}", ((DateTime.Now-this.timeRef).TotalMilliseconds)/1000)) .Append("s."); gc.FillRectangle(new SolidBrush(this.BackColor), new Rectangle( 0, 320, 320, 40)); gc.DrawString(sb.ToString(),new Font("Arial", 12),new SolidBrush(Color.Black), 10, 320); gc.Dispose(); isdone = true; iter++; image = image2; } e.Graphics.DrawImage(image, 35f, 15f); } } } ``` After changes i made, this one is ~98% faster: ``` using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; namespace Zoom { public partial class Form1 : Form { static class dllRef { [DllImport("user32.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool GetCursorPos(out Point lpPoint); [DllImport("user32.dll")] static extern IntPtr GetDC(IntPtr hwnd); [DllImport("user32.dll")] static extern Int32 ReleaseDC(IntPtr hwnd, IntPtr hdc); [DllImport("gdi32.dll")] static extern uint GetPixel(IntPtr hdc, int nXPos, int nYPos); // from http://www.pinvoke.net/default.aspx/gdi32/GetPixel.html static public System.Drawing.Color getPixelColor(int x, int y) { IntPtr hdc = GetDC(IntPtr.Zero); uint pixel = GetPixel(hdc, x, y); ReleaseDC(IntPtr.Zero, hdc); Color color = Color.FromArgb((int)(pixel & 0x000000FF), (int)(pixel & 0x0000FF00) >> 8, (int)(pixel & 0x00FF0000) >> 16); return color; } static public System.Drawing.Point getMousePosition() { Point p = new Point(); GetCursorPos(out p); return p; } } public Form1() { InitializeComponent(); this.Size = new Size(400,400); this.Text="Image zoom"; this.Location = new Point(640, 0); this.image = new Bitmap(320, 340); this.timeRef = DateTime.Now; this.BackColor = Color.White; Timer t = new Timer(); t.Interval = 25; t.Tick += new EventHandler(Timer_Tick); t.Start(); } public void Timer_Tick(object sender, EventArgs eArgs) { this.Form1_Paint(this, new PaintEventArgs(this.CreateGraphics(), new Rectangle(0, 0, this.Width, this.Height))); } private bool isdone = true; private int iter = 0; private Bitmap image; private DateTime timeRef; private void Form1_Paint(object sender, PaintEventArgs e) { if (isdone) { isdone = false; int step = 40; Point p = dllRef.getMousePosition(); SolidBrush myBrush = null; Bitmap hc = new Bitmap(8, 8); using (Pen myPen = new Pen(Color.Gray, 1)) using (Graphics gc = Graphics.FromImage(image)) using (Graphics gf = Graphics.FromImage(hc)) { gf.CopyFromScreen(p.X - 4, p.Y - 4, 0, 0, new Size(8, 8), CopyPixelOperation.SourceCopy); for (int x = 0; x < 8; x++) { for (int y = 0; y < 8; y++) { myBrush = new SolidBrush(hc.GetPixel(x, y)); gc.FillEllipse(myBrush, x * step, y * step, step - 3, step - 3); gc.DrawEllipse(myPen, x * step, y * step, step - 3, step - 3); } } double ts = ((DateTime.Now - this.timeRef).TotalMilliseconds) / 1000; StringBuilder sb = new StringBuilder(); sb.Append(++iter).Append(" frames in ").Append(String.Format("{0:0.###}", ts)).Append("s."); gc.FillRectangle(new SolidBrush(this.BackColor), new Rectangle(0, 320, 320, 40)); gc.DrawString(sb.ToString(), new Font("Arial", 12), new SolidBrush(Color.Black), 10, 320); } isdone = true; } e.Graphics.DrawImage(image, 35f, 15f); } } } ```
how to draw constantly changing graphics
CC BY-SA 2.5
0
2010-09-18T23:13:07.253
2010-09-19T09:03:48.183
2017-05-23T11:48:27.577
-1
97,754
[ "c#", "graphics", "gdi+" ]
3,743,973
1
3,744,004
null
1
1,777
When I try to put final in method parameter eclipse doesn't help. Any idea how to get this to work? ![final in method parameter](https://i.stack.imgur.com/KZu3w.jpg)
Final in method parameter in eclipse
CC BY-SA 2.5
0
2010-09-18T23:50:08.400
2010-09-19T00:49:09.313
2010-09-19T00:49:09.313
184,730
184,730
[ "java", "eclipse", "methods", "final" ]
3,744,261
1
3,744,269
null
2
1,544
How would I create these buttons, so that clicking handles correctly? ![alt text](https://i.stack.imgur.com/CYEhJ.png) Each button is a `.png`, transparent outside of the coloured square. I need a transparent areas to be click-thru.
iOS: How do I create irregularly shaped / partially transparent & click-thru buttons
CC BY-SA 2.5
0
2010-09-19T02:03:50.017
2012-03-30T11:50:25.347
2010-09-19T02:05:20.993
313,758
435,129
[ "ios", "uibutton" ]
3,744,721
1
3,759,300
null
41
13,259
BMP being [Basic Multilingual Plane](http://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_Multilingual_Plane) According to : > JavaScript was built at a time when Unicode was a 16-bit character set, so all characters in JavaScript are 16 bits wide. This leads me to believe that JavaScript uses UCS-2 (not UTF-16!) and can only handle characters up to U+FFFF. Further investigation confirms this: ``` > String.fromCharCode(0x20001); ``` The `fromCharCode` method seems to only use the lowest 16 bits when returning the Unicode character. Trying to get U+20001 (CJK unified ideograph 20001) instead returns U+0001. Question: is it at all possible to handle post-BMP characters in JavaScript? --- 2011-07-31: slide twelve from covers issues related to this quite well: ![](https://i.imgur.com/dLwbz.png)
JavaScript strings outside of the BMP
CC BY-SA 3.0
0
2010-09-19T06:17:36.847
2022-06-22T13:27:55.997
2014-05-17T20:37:25.730
295,783
330,644
[ "javascript", "unicode", "utf-16", "surrogate-pairs", "astral-plane" ]
3,744,761
1
3,747,187
null
7
25,872
I am new to JPA & hibernate. In my web-app i have changed my JDBC codes to JPA. While running the web-app i am getting a BIG list of errors. But from my knowledge in JPA and Hibernate, I think the two errors below represent most of my problem. - - I have searched a lot for these errors on the web. But I can't find one solution. I have included all the required JARs and added persistence.xml to the class path. I am not able to find the reason. ``` SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/C:/Documents%20and%20Settings/tamilvendhank/Local%20Settings/Temp/Jetty_127_0_0_ 1_8080_ExpMgmtWeb.war__ExpMgmtWeb__w96xvk_3923622842201679764/webapp/WEB-INF/lib/slf4j-log4j12.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/C:/Documents%20and%20Settings/tamilvendhank/Local%20Settings/Temp/Jetty_127_0_0_1_8080_ExpMgmtWeb.war__ExpMgmtWeb__w96xvk_3923622842201679764/webapp/WEB-INF/lib/slf4j-simple-1.5.11.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. 15360 [31149935@qtp-23671010-1] INFO org.hibernate.cfg.annotations.Version - Hibernate Annotations 3.4.0.CR1 15375 [31149935@qtp-23671010-1] INFO org.hibernate.cfg.Environment - Hibernate 3.3.0.CR1 15375 [31149935@qtp-23671010-1] INFO org.hibernate.cfg.Environment - hibernate.properties not found 15375 [31149935@qtp-23671010-1] INFO org.hibernate.cfg.Environment - Bytecode provider name : cglib 15375 [31149935@qtp-23671010-1] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling 15469 [31149935@qtp-23671010-1] INFO org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.1.0.CR1 15469 [31149935@qtp-23671010-1] INFO org.hibernate.ejb.Version - Hibernate EntityManager 3.4.0.CR1 16047 [31149935@qtp-23671010-1] ERROR org.hibernate.util.XMLHelper - Error parsing XML: XML InputStream(2) cvc-complex-type.3.1: Value '2.0' of attribute 'version' of element 'entity-mappings' is not valid with respect to the corresponding attribute use. Attribute 'version' has a fixed value of '1.0'. 2010-09-19 11:23:40.265:WARN::Error for /ExpMgmtWeb/dwr/call/plaincall/ExpenseDetailsManagement.getexpenseList.dwr java.lang.ExceptionInInitializerError at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at org.directwebremoting.create.NewCreator.getInstance(NewCreator.java:66) at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:344) at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:279) at org.directwebremoting.servlet.PlainCallHandler.handle(PlainCallHandler.java:52) at org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:101) at org.directwebremoting.servlet.DwrServlet.doPost(DwrServlet.java:144) at javax.servlet.http.HttpServlet.service(HttpServlet.java:641) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) 2010-09-19 11:23:40.265:WARN::Nested in java.lang.ExceptionInInitializerError: javax.persistence.PersistenceException: [PersistenceUnit: ExpensePersistentUnit] Unable to configure EntityManagerFactory at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:265) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:125) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33) at com.pricar.JPAInteg.ExpenseDetailsManagement.<clinit>(ExpenseDetailsManagement.java:21) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at org.directwebremoting.create.NewCreator.getInstance(NewCreator.java:66) at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:344) at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:279) at org.directwebremoting.servlet.PlainCallHandler.handle(PlainCallHandler.java:52) at org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:101) at org.directwebremoting.servlet.DwrServlet.doPost(DwrServlet.java:144) at javax.servlet.http.HttpServlet.service(HttpServlet.java:641) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) ``` ![alt text](https://i.stack.imgur.com/rb3Ka.jpg) ``` <?xml version="1.0" encoding="UTF-8"?> <persistence> <persistence-unit name="ExpensePersistentUnit"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <class>com.pricar.JPAInteg.Role</class> <class>com.pricar.JPAInteg.User</class> <class>com.pricar.JPAInteg.Userdetail</class> <class>com.pricar.JPAInteg.Category</class> <class>com.pricar.JPAInteg.Expens</class> <class>com.pricar.JPAInteg.Leavetable</class> <class>com.pricar.JPAInteg.Permissiontoken</class> <class>com.pricar.JPAInteg.Roletokenassociation</class> <class>com.pricar.JPAInteg.UserPK</class> <properties> <property name="hibernate.connection.url" value="jdbc:mysql://localhost/officemgmt"/> <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"></property> <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/> <property name="hibernate.connection.password" value="1234"/> <property name="hibernate.connection.username" value="root"/> <property name="hibernate.hbm2ddl.auto" value="update"/> <property name="hibernate.show_sql" value="true"/> </properties> </persistence-unit> </persistence> ``` --- ``` javax.persistence.PersistenceException: [PersistenceUnit: ExpensePersistentUnit] Unable to configure EntityManagerFactory at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:371) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:55) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33) at com.pricar.JPAInteg.ExpenseDetailsManagement.<clinit>(ExpenseDetailsManagement.java:21) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) ``` --- I have some basic questions: 1. How many xml files involved in JPA+Hibernate combination, if JPA annotations were used? i am having just persistence.xml. But totally 3(dwr.xml & web.xml) 2. Is hibernate.cfg.xml needed, if i use JPA annotaions. Because, i didnt added it till now. 3. Shall you give me the list of basic JAR file names, in case of using JPA 2.0 & Hibernate!!! Because, i am having more than 15 files.
Unable to configure EntityManagerFactory
CC BY-SA 2.5
0
2010-09-19T06:35:02.283
2010-09-20T11:51:16.413
2020-06-20T09:12:55.060
-1
null
[ "java", "hibernate", "jpa" ]
3,745,017
1
3,745,037
null
10
14,065
How can I develop an alert system like Facebook's, where User A add User B, User B will get some number in Friend Request Section on the header like in the image below. How can I develop something like that? How can we get numbers like this??how can i get codes in PHP and JQuery? ![alt text](https://i.stack.imgur.com/hu2eb.gif)
How to develop alert system like facebook using PHP and Jquery?
CC BY-SA 2.5
0
2010-09-19T08:25:32.883
2016-09-22T07:31:25.827
2010-09-19T13:09:14.073
404,183
404,183
[ "php", "jquery", "css", "notifications" ]
3,745,103
1
3,745,145
null
1
2,846
in this [example](http://jqueryui.com/demos/dialog/#modal-confirmation) the dialog is added to an element. But I want it to be added just to the body and I do not want any predefined div#dialog-confirm element in my html. So how do I realize that? ![alt text](https://i.stack.imgur.com/LaLnY.png)
Add a dialog to the document root, jQuery
CC BY-SA 2.5
null
2010-09-19T09:08:39.517
2010-09-19T10:46:33.373
2010-09-19T10:46:33.373
401,025
401,025
[ "javascript", "jquery", "jquery-ui", "jquery-selectors" ]
3,745,254
1
3,745,385
null
4
811
Is there open code available for implementing a time selector like the one used in HTC Sense? It's a wheel and the user can push it up or down to select higher or lower number. If there isn't code available, how do I go about implementing it? At best I would like to have a 59 beneath the 00 to be more like a real wheel. ![htc number wheel](https://i.stack.imgur.com/V0lji.png)
How to implement HTC Sense style time selectors in android?
CC BY-SA 2.5
null
2010-09-19T10:02:39.190
2010-09-19T10:52:03.473
2010-09-19T10:15:24.590
25,282
25,282
[ "android" ]
3,745,240
1
3,746,456
null
1
1,802
I want to parse with XmlSlurper a HTML document which I read using HTTPBuilder. Initialy I tried to do it this way: ``` def response = http.get(path: "index.php", contentType: TEXT) def slurper = new XmlSlurper() def xml = slurper.parse(response) ``` But it produces an exception: ``` java.io.IOException: Server returned HTTP response code: 503 for URL: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ``` I found a workaround to provide cached DTD files. I found a simple implementation of class which should help [here](http://blog.bensmann.com/http-503-when-parsing-xml): ``` class CachedDTD { /** * Return DTD 'systemId' as InputSource. * @param publicId * @param systemId * @return InputSource for locally cached DTD. */ def static entityResolver = [ resolveEntity: { publicId, systemId -> try { String dtd = "dtd/" + systemId.split("/").last() Logger.getRootLogger().debug "DTD path: ${dtd}" new org.xml.sax.InputSource(CachedDTD.class.getResourceAsStream(dtd)) } catch (e) { //e.printStackTrace() Logger.getRootLogger().fatal "Fatal error", e null } } ] as org.xml.sax.EntityResolver } ``` My package tree looks as shown below: ![alt text](https://i.stack.imgur.com/1gqF9.jpg) I modified also a little code for parsing response, so it looks like this: ``` def response = http.get(path: "index.php", contentType: TEXT) def slurper = new XmlSlurper() slurper.setEntityResolver(org.yuri.CachedDTD.entityResolver) def xml = slurper.parse(response) ``` But now I'm getting `java.net.MalformedURLException`. Logged DTD path from CachedDTD entityResolver is `org/yuri/dtd/xhtml1-transitional.dtd` and I can't get it working...
Groovy XMLSlurper issue
CC BY-SA 2.5
null
2010-09-19T09:58:31.600
2014-11-28T19:33:34.497
null
null
327,079
[ "xhtml", "groovy", "dtd", "xmlslurper" ]
3,745,280
1
3,745,867
null
0
2,308
I'm working on a instant messaging client and i am looking for a way to display the contacts like Pigdin or Yahoo Messenger does. I was looking at a Tree Widget, but is there a way to customize the items? I would like them to look something like this: ![alt text](https://i.stack.imgur.com/VLGoh.png)
Custom items in Tree View Widget
CC BY-SA 2.5
null
2010-09-19T10:10:59.900
2010-09-19T13:33:04.673
null
null
9,789
[ "qt4" ]
3,745,305
1
null
null
0
3,278
Hey... i'm trying to create an activity with the layout structure like this: ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TabHost android:id="@+id/tabHost" android:layout_width="fill_parent" android:layout_height="fill_parent" > <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TabWidget android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@android:id/tabs" /> <FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="fill_parent" > </FrameLayout> </LinearLayout> </TabHost> <some code here> </LinearLayout> ``` What is wrong here? I'm getting nullPointerException in my activity ``` public class TabsActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tabs); // Resources res = getResources(); // TabHost tabHost = (TabHost)findViewById(R.id.tabHost); } } ``` The problem is with nesting. There is no problem with the TabHost as the main XML node. Thx! Error: ![Screenshot](https://i.stack.imgur.com/WIYtx.png)
Android TabHost inside LinearLayout
CC BY-SA 2.5
0
2010-09-19T10:19:13.437
2010-09-23T20:30:24.207
2010-09-19T11:59:30.333
132,257
132,257
[ "android", "android-tabhost", "android-linearlayout" ]
3,745,410
1
3,745,443
null
0
131
I am using jquery modal dialog, but the look of the dialog is other than the the look of the dialog [example](http://jqueryui.com/demos/dialog/#modal). jquery ui is included and enabled. any ideas? ![alt text](https://i.stack.imgur.com/p8S6s.png)
Strange look, jQuery UI
CC BY-SA 2.5
null
2010-09-19T11:02:40.027
2010-09-19T11:15:25.537
null
null
401,025
[ "jquery", "jquery-ui", "jquery-dialog" ]
3,745,574
1
3,787,864
null
0
2,504
Is there anyway to align the text in msflexgrid in vertical orientation like excel does? thanks ![alt text](https://i.stack.imgur.com/egrlR.png)
text orientation flexgrid
CC BY-SA 2.5
null
2010-09-19T12:00:45.957
2010-09-24T14:08:51.290
2010-09-21T12:40:56.160
362,461
362,461
[ "vb6", "text", "msflexgrid" ]
3,745,821
1
3,745,981
null
1
1,221
![alt text](https://i.stack.imgur.com/lvl6r.jpg) IMO,this should hold: ``` rva = raw - imagebase ``` which is not the case in the graph,why?
How to understand the PE header in this graph?
CC BY-SA 2.5
null
2010-09-19T13:15:28.380
2010-09-19T14:04:50.027
null
null
444,905
[ "portable-executable" ]
3,745,887
1
3,745,990
null
3
1,796
What I need is: plots creation, stuff for interpolation, stuff for counting such things as ![alt text](https://i.stack.imgur.com/ceEXO.png) and ![alt text](https://i.stack.imgur.com/oO8sJ.png) where L(x) is an interpolation built from some data (points) generated from original known function f(x). meaning we know original function. we have a range (-a, a) - known. We need library to help us calculate data points in range. we need to calculate L(x) a polinom using that data in that range. I need this library to be free and opensource
Wanted: C# programming library for mathematics
CC BY-SA 2.5
0
2010-09-19T13:40:58.230
2010-09-19T17:01:12.703
2010-09-19T14:18:16.330
434,051
434,051
[ "c#", ".net", "math", ".net-3.5", "interpolation" ]
3,746,281
1
3,746,295
null
0
98
``` <div style="width: 800px;border:1px solid black"> <div style="width:100px;height:100px;float:left;border:1px solid black"></div> <div style="float:left">ssdfsdfsdfsdgfag25w6a4g8w5614w5sge16dgf45d4sdffffffffffffffffffffffffffffffffffffffffffffffffffffff5s4f64s6f456a46f456a456456456f456we4f54we5gf45456v4sd5646sadf54s56f465as4f564as56f</div> <div style="clear:both"></div> </div> ``` It end up like this: ![alt text](https://i.stack.imgur.com/9Ymn5.png) how to fix it
Question about CSS float:left
CC BY-SA 2.5
null
2010-09-19T15:29:11.200
2012-07-17T12:47:38.593
null
null
329,424
[ "css" ]
3,746,322
1
null
null
3
6,718
How i can create a custom dialog like this: ![alt text](https://i.stack.imgur.com/hmIS4.png) I'm using iframe application with graph api/new js-api, but i cant figureout a way to reproduce this, the buttons and the title, keep the user languague. regards.
How to use custom a facebook dialog, like this example
CC BY-SA 2.5
0
2010-09-19T15:38:55.807
2012-03-23T04:36:24.743
null
null
109,545
[ "facebook", "iframe", "dialog", "facebook-graph-api" ]
3,746,679
1
null
null
1
833
Ok, we're stuck on this one for like 2 days and don't have a clue yet. We have a .asmx web service (configured as cookieless="true"): ``` [WebMethod(EnableSession =true)] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public string SimplestWebService() { return "Simplest web service works"; } ``` And we try to call it from both: c# form application, like so: ``` private void button1_Click(object sender, EventArgs e) { string url = "http://192.168.5.223:8989/MyAPI.asmx/SimplestWebService"; HttpWebRequest req = (HttpWebRequest) WebRequest.Create(url); req.Method = "POST"; req.ContentType = "application/json; charset=utf-8"; req.UseDefaultCredentials = true; req.PreAuthenticate = false; req.ContentLength = 0; var result = new StringBuilder(); using (HttpWebResponse res = (HttpWebResponse) req.GetResponse()) { StreamReader sr = new StreamReader(res.GetResponseStream()); result.Append(sr.ReadToEnd()); } label1.Text = result.ToString(); } ``` And Jquery, like so: ``` function simplestMethod() { var callParams = "{}" $.ajax({ type: "POST", url: "http://192.168.5.223:8989/MyAPI.asmx/SimplestWebService", data: callParams, contentType: "application/json; charset=utf-8", dataType: "json", success: function (data) { alert(data.d); }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("Error Occured!" + " | " + XMLHttpRequest.responseText + " | " + textStatus + " | " + errorThrown); } }); } ``` The Forms application yields the following error: The remote server returned an error: (401) Unauthorized. But when removing the contentType line - returns valid output- but in XML (instead of json.. which is obvious). The Jquery (which is on the same machine as the web service) gives: ![alt text](https://i.stack.imgur.com/WDMGP.jpg) Both work perfectly when we use them not in cookieless mode or with sessioneabled=false. But that's not what we need. I should also mention we work with IIS 6.0 & .NET 4.0. One last thing - If we go directly to the web service link (using a browser), it works but returns XML (instead of json). advice as to how to make this work with cookieless=true EnableSession=true would be appreciated. Thank you.
What do session enabling and cookieless have to do with authentication?
CC BY-SA 2.5
null
2010-09-19T17:20:33.150
2012-03-11T01:27:55.647
2010-09-26T15:45:35.973
424,952
424,952
[ "web-services" ]
3,746,839
1
3,746,863
null
1
250
I have a list of div pairs: MainDiv's and infPanel Divs. I need to put infPanel div's upon MainDiv and eliminate distance between MainDiv's. The best decision that I see is to set image in MainDiv with `background` option and just put infPanel inside MainDiv, but because of some technical requirements it is better to post image through just tag. Another solution is to use `position: absolute;` and with JS set the position for each infPanel, but it will be great to eliminate JS. Can you suggest more "agile" solution? Thank you. ![alt text](https://i.stack.imgur.com/VhNH8.png)
Div's overlapping
CC BY-SA 2.5
null
2010-09-19T18:04:38.960
2010-09-19T22:30:32.993
null
null
149,245
[ "css", "layout", "html" ]
3,747,298
1
3,826,330
null
1
4,679
I'm wondering why in my toc shown below, I have different dots style in the most detailed subsections ? ![alt text](https://i.stack.imgur.com/wuXwR.png) All I've used is: ``` \setcounter{secnumdepth}{5} \setcounter{tocdepth}{5} .... \tableofcontents ``` How can I create a consistent style at all levels of depth: section, subsection, etc?
Inconsistent styling in latex table of contents?
CC BY-SA 3.0
null
2010-09-19T20:19:36.523
2012-07-26T03:47:58.983
2011-08-23T05:42:10.953
317,773
270,315
[ "latex", "tableofcontents" ]
3,747,309
1
3,747,376
null
0
135
An example: ![alt text](https://i.stack.imgur.com/k6tOn.png)
Which event is called when I press on a part of the tab bar?
CC BY-SA 3.0
null
2010-09-19T20:22:09.460
2012-01-18T20:04:39.093
2012-01-18T20:04:39.093
918,414
318,205
[ "iphone", "cocoa-touch", "ios", "uitabbar" ]
3,747,601
1
3,747,615
null
3
1,202
I'm making a small tip calculator for the Windows Phone 7 and I'm almost done: ![alt text](https://i.stack.imgur.com/pB5rD.png) I'm having trouble getting the trailing decimals places to do what I want though. I want to display the result with only two values after the comma. Any suggestions? Here's my code: ``` private void btnSubmit_Click(object sender, RoutedEventArgs e) { if (ValidateInputs()) { lblTotalTip.Text = CalculateTip(txtTotalBill.Text, txtPercentage.Text); } } private string CalculateTip(string Total, string Percentage) { decimal totalBill = decimal.Parse(Total); decimal percentage = decimal.Parse(Percentage); string result = ((percentage / 100) * totalBill).ToString(); return result; } private bool ValidateInputs() { return true; } ```
How can I remove all of numbers after the dot?
CC BY-SA 2.5
null
2010-09-19T21:46:03.333
2010-09-19T21:55:16.573
null
null
null
[ "c#", "windows-phone-7" ]