Id
int64
1.68k
75.6M
PostTypeId
int64
1
2
AcceptedAnswerId
int64
1.7k
75.6M
ParentId
int64
1.68k
75.6M
Score
int64
-60
3.16k
ViewCount
int64
8
2.68M
Body
stringlengths
1
41.1k
Title
stringlengths
14
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
1
CreationDate
stringlengths
23
23
LastActivityDate
stringlengths
23
23
LastEditDate
stringlengths
23
23
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
1
21.3M
Tags
list
5,337,088
1
5,337,735
null
3
4,138
I wrote the following code to build a basic game that makes two cars race (randomgenerator) and let the user pick their bets on the end results. I've gone terribly wrong somewhere in that my cars only race halfway then get stuck behind the start line and the programme keeps repeating the beeping and the messsagebox.show and adding results to the 'incorrect' box. I've spent the last three days trying to figure out where I've gone wrong and I'm just missing it. Thank you for taking the time to look at this. I really appreciate any advice. The only way to terminate the application is to hit 'stop debugging'. ![Screen shot of application](https://i.stack.imgur.com/NIqyB.jpg) ``` Option Explicit On Option Strict On Public Class MainForm Private Sub exitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles exitButton.Click Me.Close() End Sub Private Sub MainForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 'fills the list box with items, then selects the first item resultListBox.Items.Add("No guess") resultListBox.Items.Add("Tie") resultListBox.Items.Add("Red Car wins") resultListBox.Items.Add("White car wins") resultListBox.SelectedIndex = 0 End Sub Private Sub startButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles startButton.Click raceTimer.Enabled = True End Sub Private Sub raceTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles raceTimer.Tick ' moves two cars from a starting line to a finish line on the form ' displays a message indicating the race results ' calculates and displays the number of times the user selects the ' correct race result from the resultlistbox, and the number ' of times the user selects an incorrect race result Dim randomgenerator As New Random Dim whitenewlocation As Integer Dim rednewlocation As Integer Dim raceresult As String Dim userchoice As String Dim finishline As Integer = finishTextBox.Left + 1 Static numbercorrect As Integer Static numberincorrect As Integer ' save the user's list box selection, then disable the list box userchoice = resultListBox.SelectedItem.ToString resultListBox.Enabled = False 'calculate the new location of each picture box's right border ' don't allow the right border to go beyond the finish line whitenewlocation = whitePictureBox.Right + randomgenerator.Next(0, 11) If whitenewlocation > finishline Then whitenewlocation = finishline End If rednewlocation = redPictureBox.Right + randomgenerator.Next(0, 11) If rednewlocation > finishline Then rednewlocation = finishline End If 'move each picture box toward the finish line whitePictureBox.SetBounds(whitenewlocation - whitePictureBox.Width, 0, 0, 0, BoundsSpecified.X) redPictureBox.SetBounds(rednewlocation - redPictureBox.Width, 0, 0, 0, BoundsSpecified.X) 'the following selection structure is processed only when at least ' one of the picture boxes is at the finish line If whitePictureBox.Right = finishline _ OrElse redPictureBox.Right = finishline Then 'disable the timer raceTimer.Enabled = False End If 'sound a beep to indicate the end of the race For x As Integer = 1 To 5 Console.Beep(100, 100) Next x 'store the result of the race in a variable If whitenewlocation = rednewlocation Then raceresult = "Tie" ElseIf whitenewlocation > rednewlocation Then raceresult = "White car wins" Else raceresult = "red car wins" End If 'display the race results MessageBox.Show("Race Over!" & ControlChars.NewLine & raceresult, _ "Car Race", MessageBoxButtons.OK, MessageBoxIcon.Information) 'move the picture boxes back to the starting line whitePictureBox.SetBounds(12, 0, 0, 0, BoundsSpecified.X) redPictureBox.SetBounds(12, 0, 0, 0, BoundsSpecified.X) 'if the user did not want to guess the race results, then 'don't update or display the counter values; otherwise, 'compare the race results to the user's selection and update ' the appropriate counter, then display both counter values If userchoice <> "no guess" Then If raceresult = userchoice Then numbercorrect = numbercorrect + 1 Else numberincorrect = numberincorrect + 1 End If correctLabel.Text = Convert.ToString(numbercorrect) incorrectLabel.Text = Convert.ToString(numberincorrect) End If 'enable the list box resultListBox.Enabled = True End Sub End Class ```
VB.net timer tick event question
CC BY-SA 2.5
null
2011-03-17T09:21:26.860
2011-05-16T07:11:19.127
2011-03-17T09:24:02.720
1,500
615,363
[ "vb.net", "loops", "timer" ]
5,337,484
1
5,337,771
null
0
420
i have coding a web application which has multi user. they are select data or insert data every thing is that. But selecting some data need too many time such as using LINQ or mathematical calculation. i thing that: my user1 : ``` select * from MyTable -----&#62; save as caching via proxy server in machine ``` my user2 : ``` select * from MyTable2 -----&#62; save as caching via proxy server in machine ``` my user3 : ``` insert into MyTable2 -----&#62; Update caching(select * from MyTable2) via proxy server in machine ``` How to write a proxy server to select Faster and update select result if another user update table? ![enter image description here](https://i.stack.imgur.com/C6RyB.png)
How to write a proxy with C#?
CC BY-SA 2.5
null
2011-03-17T09:57:57.740
2011-03-17T10:25:55.427
2011-03-17T09:59:43.847
41,956
298,875
[ "c#", "asp.net", "visual-studio", "visual-studio-2008", "proxy-classes" ]
5,337,602
1
5,337,709
null
1
351
My first input on the form has a tag. ``` <h:inputText id="kotajNumber" label="#{lbls.kotajNumber}" styleClass="ltr" value="#{issuePromise.declaration.kotajNumber}" required="true" style="min-width: 0px; width: 130px;"> <f:ajax event="blur" render="loader exporter personName nameOfMaterial count materialWeight materialWeight numberOfPackages messageKotajNumber" execute="@this" listener="#{issuePromise.showDeclaration}" onevent="showLoader()" /> </h:inputText> ``` But when I click on a link, the new page is loading while the request is sending also and I receive an alert which is saying that I've mixed a request with an one!!! How should I fix it? ![The error alert](https://i.stack.imgur.com/RtWST.gif)
JSF Ajax Problem
CC BY-SA 2.5
null
2011-03-17T10:08:44.370
2011-03-17T10:19:04.977
null
null
392,694
[ "ajax", "jsf", "jsf-2" ]
5,338,062
1
5,338,427
null
2
1,687
I created a . Sample screen attached. ![enter image description here](https://i.stack.imgur.com/0fuNQ.png) User can load a pdf file and select data area he wants. Then I grab pdf coordinates and page number and then save it as a template. Once user a give a list of pdf files tool is capable of extracting data according to the template file. [My tool is very much similar to this.](http://www.a-pdf.com/data-extractor/a-pdf-data-extractor.swf) Now problem is sometimes in some pdfs the portion of data required to extract is shifted to next page. (The reason for shifting is; I will give a . If you think a bill of list of items you purchased, is depend on the number of items you bought: if it's a long list total goes bottom otherwise, middle or near top). Therefore now I am thinking about But I don't have a clear idea to do that. Please share anything, you think that help to solve this problem. I repeat again that I am trying to grab data from a pdf. So It is possible to file. My idea is if I can identify the structure then I can say where the value is. For example I tried to convert pdf into html and try to navigate through the html tag values. (body->div->table->td-> etc.) But it wasn't successful.. :(
PDF Data Extraction - Need Suggestions
CC BY-SA 3.0
0
2011-03-17T10:57:45.520
2018-10-08T19:05:02.467
2015-11-12T09:41:18.857
4,370,109
441,628
[ "algorithm", "pdf", "data-structures", "data-extraction" ]
5,338,184
1
5,341,121
null
16
6,437
I'm trying to configure a new using (on my local development machine) to use a . eg. 1. my local dev machine. 2. kick open my web browser 3. goto http://dev.www.mydomain.com 4. my visual studio mvc project kicks in I've hacked my hosts file to include (yes, i saved the file .. which also meant i had to have admin rights enabled ... ``` 127.0.0.1 dev.www.mydomain.com ``` I just can't figure out how to use IIS7 express to get configured to do this. I went to `MVC Project => Properties => Web` and did the following :- ![enter image description here](https://i.stack.imgur.com/PrqDX.png) Then tried to run the site... ![enter image description here](https://i.stack.imgur.com/r5oJU.png) Can anyone help?
Is it possible to use custom host headers / bindings with IIS7 Express?
CC BY-SA 3.0
0
2011-03-17T11:09:54.543
2017-02-04T05:57:24.467
2011-04-11T02:45:24.803
30,674
30,674
[ ".net", "iis-express", "visual-studio-2010" ]
5,338,250
1
null
null
6
5,254
I searched around and couldn't find how to test a file download box using capybara/cucumber? The following image asks the question much clearer. --- ![How to test file download using capybara](https://i.stack.imgur.com/iMzvO.png)
How to test File Download dialog box using cucumber/capybara
CC BY-SA 2.5
0
2011-03-17T11:16:22.233
2011-07-14T07:44:26.667
null
null
60,072
[ "ruby-on-rails-3", "rspec", "cucumber", "capybara" ]
5,338,386
1
5,338,557
null
3
5,748
I am using [Ext](http://en.wikipedia.org/wiki/Ext_%28JavaScript_library%29)'s `Ext.grid.EditorGridPanel` to create a grid and using array-store with local data to populate rows in grid. When I edit the values in grid, they show a small red triangle at top-left, and also the store data is not updated. So how can I edit local data in EditorGridPanel? I see a similar problem in Ext [Editor Grid Example](http://dev.sencha.com/deploy/dev/examples/grid/edit-grid.html), though that example also set the URL, see image below. ![enter image description here](https://i.stack.imgur.com/bgtMR.png) Solution: As I just needed to save changes locally I just did the following. ``` settingsGrid.on('afteredit', function(evt){ settingsGrid.store.commitChanges() }) ``` It fixes the problem and all user edited data is happily updated in the local store.
Local editing in an Ext grid
CC BY-SA 2.5
0
2011-03-17T11:29:43.930
2011-03-29T11:16:39.950
2011-03-29T11:16:39.950
63,550
6,946
[ "extjs", "grid" ]
5,338,390
1
5,338,798
null
14
15,416
I am really new to iPhone development. Currentlly I am setting up an option module for my application. The user should be able to edit some preferences. My first approach was to have some text fields. But I really like how iOS handles editing preferences. There is some kind of label. Clicking on that label opens another view with a field for editing. I hope you understand what I mean. How does iOS achieve this? Is that table view? I mean this kind of design ![enter image description here](https://i.stack.imgur.com/siQsF.png)
How to build an iOS like settings module?
CC BY-SA 2.5
0
2011-03-17T11:30:03.833
2017-07-04T20:54:51.623
2011-04-06T10:43:20.723
235,297
401,025
[ "iphone", "xcode", "interface-builder", "inappsettingskit" ]
5,338,460
1
5,338,671
null
0
2,527
please, how do i draw image in listbox_DrawItem event by the left side i already read throught [this code](https://stackoverflow.com/questions/1774429/add-images-to-listbox-visual-basic), buts its not helping me ``` Dim targetsize As New Size(16, 16) Dim img As Image = Nothing img = My.Resources._error e.Graphics.DrawImage(img, targetsize) e.Graphics.DrawString(lsbLog.Items(e.Index).ToString(), _ e.Font, mybrush, e.Bounds, StringFormat.GenericDefault) ``` this is my current code EDIT i added your code with some other code, and i get a garbled text ``` '//Here it draws the border depeding on it's state (the listbox item) e.Graphics.DrawRectangle(myPen, e.Bounds.X + 16, e.Bounds.Y, _ e.Bounds.Width - 16, e.Bounds.Height) Using b As New SolidBrush(e.ForeColor) e.Graphics.DrawString(lsbLog.GetItemText(lsbLog.Items(e.Index)), e.Font, b, e.Bounds) End Using e.Graphics.DrawImage(img, New Rectangle(e.Bounds.Width - 15, e.Bounds.Y, 12, 12)) '// Draw the current item text based on the current '// Font and the custom brush settings. e.Graphics.DrawString(lsbLog.Items(e.Index).ToString(), e.Font, mybrush, _ New Rectangle(e.Bounds.X - 20, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height), _ StringFormat.GenericDefault) ``` This is the code in the MeasureItem event ``` Private Sub lsbLog_MeasureItem(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MeasureItemEventArgs) Handles lsbLog.MeasureItem Dim g As Graphics = e.Graphics 'We will get the size of the string which we are about to draw, 'so that we could set the ItemHeight and ItemWidth property Dim size As SizeF = g.MeasureString(lsbLog.Items.Item(e.Index).ToString, Me.Font, _ lsbLog.Width - (5 + SystemInformation.VerticalScrollBarWidth)) e.ItemHeight = CInt(size.Height) + 5 e.ItemWidth = CInt(size.Width) + 5 End Sub ``` I get a garbeled text and image ![I get a garbled image](https://i.stack.imgur.com/iyoQh.png)
add icon to listbox vb.net
CC BY-SA 2.5
null
2011-03-17T11:37:06.993
2013-12-20T18:11:29.637
2017-05-23T11:48:23.740
-1
362,461
[ "vb.net", "winforms", "image", "listbox", "draw" ]
5,338,501
1
5,338,811
null
11
14,380
I have written the function to notify and display at Notification bar: ``` private void showNotification() { CharSequence title = "Hello"; CharSequence message = "Notification Demo"; NotificationManager notificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE); Notification notification = new Notification(R.drawable.icon, "A Notification", System.currentTimeMillis()); Intent notificationIntent = new Intent(this, Main_Activity.class); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0); notification.setLatestEventInfo(Main_Activity.this, title, message, pendingIntent); notificationManager.notify(NOTIFICATION_ID, notification); } ``` Its working fine, But `what way we can keep the notification steady at Notification bar` even when user press the "clear" notificatios button from the notification bar ? Please have a look at the "Yahoo" application's notification bar. ![enter image description here](https://i.stack.imgur.com/IZvWc.png) I have gone through this SDK article: [http://developer.android.com/guide/topics/ui/notifiers/notifications.html#Updating](http://developer.android.com/guide/topics/ui/notifiers/notifications.html#Updating) , but failed to find out.
Android - Keep notification steady at Notification Bar
CC BY-SA 2.5
0
2011-03-17T11:40:49.457
2013-08-11T05:53:54.430
null
null
379,693
[ "android", "notification-bar", "android-notification-bar" ]
5,338,546
1
5,394,399
null
5
3,309
: In a Silverlight 4 MVVM project, we have a `ListBox` control containing items, the selected item is two-way-bound to the appropriate property in the ViewModel. Another control (for example reasons, I've stripped it down to a single `TextBox`) is data bound to the selected item's content. The value should update on leave/focus lost. : When the value in the `TextBox` is changed and we leave that `TextBox` by pressing the Tab key, everything works as desired - the value is updated. However, if the user clicks on a different item in the `ListBox`, then the SelectedItem setter is fired before the content of `TextBox` setter is fired, leaving no chance to handle the user input. ![Screen](https://imgur.com/NuEc0.png) You can see in debugger, when adding breakpoints to the property setters, that the new `ListView` selection is applied first, before the `TextBox` update is processed. : We need to know that the currently selected item was modified before the user has selected another item. It's not desired to have a custom update trigger which would notify on each key press (we know that's possible). Can you help? ``` public abstract class ViewModelBase : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; protected void OnPropertyChanged(string propertyName) { var handler = PropertyChanged; if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName)); } } public class ItemViewModel : ViewModelBase { private string _content; public ItemViewModel(string initContent) { _content = initContent; } public string Content { get { return _content; } set { if (_content != value) { _content = value; OnPropertyChanged("Content"); } } } } public class MainViewModel : ViewModelBase { private ObservableCollection<ItemViewModel> _items = new ObservableCollection<ItemViewModel>(); private ItemViewModel _selectedViewModel; public ObservableCollection<ItemViewModel> Items { get { return _items; } } public ItemViewModel SelectedItem { get { return _selectedViewModel; } set { if (_selectedViewModel != value) { _selectedViewModel = value; OnPropertyChanged("SelectedItem"); } } } } ``` ``` <Grid x:Name="LayoutRoot" Background="White"> <ListBox Height="100" HorizontalAlignment="Left" Margin="12,12,0,0" VerticalAlignment="Top" ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" DisplayMemberPath="Content" Width="220" /> <TextBox Height="23" HorizontalAlignment="Left" Margin="12,118,0,0" Text="{Binding SelectedItem.Content, Mode=TwoWay}" VerticalAlignment="Top" Width="220" /> </Grid> ``` ``` public MvvmTestView() { InitializeComponent(); Loaded += new RoutedEventHandler(MvvmTestView_Loaded); } void MvvmTestView_Loaded(object sender, RoutedEventArgs e) { MainViewModel viewModel = new MainViewModel(); viewModel.Items.Add(new ItemViewModel("Hello StackOverflow")); viewModel.Items.Add(new ItemViewModel("Thanks to Community")); DataContext = viewModel; } ``` I present [a self designed solution](https://stackoverflow.com/questions/5338546/silverlight-mvvm-binding-updates-fire-in-undesired-order/5394399#5394399) for you to check out, which will be probably be the accepted one, I still want to encourage you to make comments and give your hints. Thanks.
Silverlight MVVM binding updates fire in undesired order
CC BY-SA 2.5
0
2011-03-17T11:44:57.750
2012-10-29T10:13:19.713
2017-05-23T12:30:40.387
-1
265,165
[ "silverlight", "data-binding", "silverlight-4.0", "mvvm" ]
5,338,674
1
5,339,180
null
0
4,255
I currently am building a list of database driven results on an Android page. I've read that you should however, build your content views in XML, which I have done. My question is, should I really build 10 empty rows and populate them on the fly, or should I add the rows through building the views in Java? I may add more rows later on. The data I am displaying looks something like this: ![enter image description here](https://i.stack.imgur.com/J8pCt.png) The controls on the right increase and decrease the number of points allotted to a skill, so the list/row will have to enable some type of user control.
Creating a table list, XML or programmatically
CC BY-SA 2.5
null
2011-03-17T11:57:51.037
2011-03-21T22:17:30.300
2011-03-17T14:50:08.357
16,631
16,631
[ "android", "xml" ]
5,339,100
1
5,339,697
null
5
995
We need to build a model of the shop floor in which we can relate pixel coordinates(x, y) from camera images to the actual objects in the 3D space of the store. The camera images, which will act as sources for generating such a model, suffer from fish-eye distortions. Hence straight lines actually appear as curves in the camera images and the walls appear to meet each other at not exactly right angles. We are sub-dividing the region into polygons. Each polygon on the image refers to a particular region such as a shelf, display area, checkout counter etc. By mapping the pixels that fall in each polygon, we want to relate it as belonging to the shelf corresponding to that region. Any ideas how to go about it? Following is a sample image of the store with some polygons marked: ![enter image description here](https://i.stack.imgur.com/myO5C.jpg) We are not looking to find out the 3D coordinates, we just need to know which shelf is any polygon mapped to. So if the user clicks on a polygon, we can say he clicked on which shelf. We are able to manage the above for big polygons like the ones shown in the image, but the shelves away from the camera can be as small as a few pixels so we need some kind of a probabilistic result saying if the user clicked at (x,y) what is the probability that he was trying to click on Shelf-A or what is the probability that he was trying to click on Shelf-B and so on. One thing which is not apparent from the sample image is that the polygon size could be really small(as small as a few pixels) and polygons in turn could be really close to each other. Moreover, the use case is that a customer in the store picks a product from one of the shelves. The application user would click on a point in the image from which he thinks the products is picked up. Now since the polygons are so small and so close, the user can only guess the exact point of pickup, so we can only know at best that it could be any one of the 3-4 polygons close to the point of click. So the question is how to calculate probabilities for these 3-4 polygons given the click? As suggested here distance of the click from the center of polygon and its area could be parameters in calculation of this probability, what I am wondering is if there is algorithm to do so.
How to map 2D coordinates from store image to the actual shelves of the store?
CC BY-SA 2.5
null
2011-03-17T12:38:39.170
2011-03-17T17:51:51.520
2011-03-17T17:51:51.520
550,436
550,436
[ "math", "image-processing", "geometry", "computer-vision", "computational-geometry" ]
5,339,134
1
5,339,315
null
1
1,600
I am using this code this time. I am wondering what is going wrong this time? I am using a code that load image from net. As you can see. But Image lose its quality as it decodes to Bitmap.(May be I am wrong). You can check out this image. ![enter image description here](https://i.stack.imgur.com/HPX3S.jpg) I have tried this 1. Get Image from URL and save that as .jpg image in drawable. then load image from resources. Its works perfectly this time. BUT 2. When I get Bitmap from URL instead of resources then It make make more BLUR you can check it from Above. Its look like there may b a problem in BitmapFectory to de ``` public class MurgeActivity extends Activity { String abcc = "http://c3.ac-images.myspacecdn.com/images02/84/s_48e1fd15504c49ed8fd008f8592f3082.jpg"; String abcd = "http://c1.ac-images.myspacecdn.com/images02/92/s_3bf09d34200c4423a2b8cb73f12675b8.jpg"; @Override public void onCreate(Bundle savedInstanceState) { try { super.onCreate(savedInstanceState); setContentView(R.layout.main); ImageView img1 = (ImageView) findViewById(R.id.cus_image); ImageView img4 = (ImageView) findViewById(R.id.cus_image4); // Here I am getting image from net. Bitmap map = getImageFromWeb("http://c3.ac-images.myspacecdn.com/images02/84/s_48e1fd15504c49ed8fd008f8592f3082.jpg"); // Here I am getting image from resources //Bitmap map = BitmapFactory.decodeResource(getResources(),R.drawable.a1); Bitmap enlarge = BitmapFactory.decodeResource(getResources(), R.drawable.enlarge_image_button); img1.setImageBitmap(map); ByteArrayOutputStream baos = new ByteArrayOutputStream(); map.compress(Bitmap.CompressFormat.JPEG, 100, baos); byte[] b = baos.toByteArray(); String encodedImage = Base64.encodeBytes(b); String items = combineArticleImage(encodedImage, enlarge); String imgTag = "<img width='100' src='data:image/png;base64," + items + "' align='left' style='padding-right:5px; padding-bottom:5px'/>"; WebView webView = (WebView) findViewById(R.id.web); webView.setBackgroundColor(R.color.black); webView.loadData(imgTag, "text/html", "utf-8"); byte[] decodedString = Base64.decode(items, android.util.Base64.DEFAULT); Bitmap decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length); Drawable end = new BitmapDrawable(decodedByte); Drawable drb = Utils.combineSlidshowImages(new BitmapDrawable(map).getCurrent(), enlarge); img4.setImageDrawable(drb); } catch (Exception e) { Log.e("Exeption", this.getClass().getSimpleName() + e.toString()); } catch (Error error) { Log.e("Error", this.getClass().getSimpleName() + error.toString()); } } public static String combineArticleImage(String baseImage, Bitmap frontImage) { String base64Image = null; byte[] imagesBytes = null; try { imagesBytes = Base64.decode(baseImage); if (imagesBytes != null) { Bitmap map = BitmapFactory.decodeByteArray(imagesBytes, 0, imagesBytes.length); Bitmap icon = frontImage; Bitmap finalImag = combineImages(map, icon); ByteArrayOutputStream baos = new ByteArrayOutputStream(); finalImag.compress(Bitmap.CompressFormat.JPEG, 100, baos); byte[] b = baos.toByteArray(); base64Image = Base64.encodeBytes(b); } } catch (Exception e) { Log.e("Error", "Combining Article Image"); } return base64Image; } public static Bitmap getImageFromWeb(String imglink) { Bitmap bmpImage = null; try { URL imgURL = new URL(imglink); URLConnection conn = imgURL.openConnection(); conn.connect(); InputStream is = conn.getInputStream(); BufferedInputStream bis = new BufferedInputStream(is); bmpImage = BitmapFactory.decodeStream(bis); bis.close(); is.close(); } catch (Exception e) { Log.e("Exeption", e.toString()); } catch (Error error) { Log.e("Error", error.toString()); } return bmpImage; } public static Bitmap combineImages(Bitmap backgroungImage, Bitmap frontImage) { // can Bitmap cs = null; try { cs = Bitmap.createBitmap(backgroungImage.getWidth(), backgroungImage.getHeight(), backgroungImage .getConfig()); Canvas comboImage = new Canvas(cs); comboImage.drawBitmap(backgroungImage, 0, 0, null); comboImage.drawBitmap(frontImage, backgroungImage.getWidth() - frontImage.getWidth(), backgroungImage .getHeight() - frontImage.getHeight(), null); } catch (Exception e) { Log.e("Error", "Exception = " + e.toString()); } catch (Error e) { Log.e("Error", "Message = " + e.toString()); } return cs; } ``` } ``` <?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:background="@color/black" android:layout_height="fill_parent"> <LinearLayout android:layout_width="wrap_content" android:paddingRight="2dp" android:layout_height="wrap_content" android:layout_marginLeft="4dp" android:orientation="horizontal" android:layout_marginRight="4dp"> <ImageView android:id="@+id/cus_image" android:src="@drawable/preview_unavailable" android:layout_width="120dp" android:layout_height="120dp" android:background="@color/transparent" android:scaleType="fitCenter" /> <ImageView android:id="@+id/cus_image4" android:src="@drawable/preview_unavailable" android:layout_width="120dp" android:layout_height="120dp" android:background="@color/black" android:scaleType="fitCenter" /> </LinearLayout> <LinearLayout android:layout_width="wrap_content" android:paddingRight="2dp" android:layout_height="wrap_content" android:layout_marginLeft="4dp" android:orientation="horizontal" android:layout_marginRight="4dp"> <WebView android:id="@+id/web" android:layout_width="wrap_content" android:background="@color/black" android:layout_height="wrap_content" /> </LinearLayout> ```
Is this a bug for BitmapFactory while decoding InputStream?
CC BY-SA 3.0
null
2011-03-17T12:41:57.870
2012-06-15T09:28:55.993
2012-06-15T09:28:55.993
516,282
486,139
[ "java", "android", "image", "bitmap" ]
5,339,446
1
5,339,544
null
0
449
I get the following OpenFeint iOS warning: > OpenFeint Developer Warning: Please make sure to provide a delegate to OpenFeint Here is also a screenshot of the warning: ![OpenFeint Developer Warning: Please make sure to provide a delegate to OpenFeint](https://i.stack.imgur.com/08tTj.png) what does this warning means?
What does this OpenFeint Developer Warning mean?
CC BY-SA 3.0
null
2011-03-17T13:10:27.853
2012-08-14T11:52:26.913
2012-08-14T11:52:26.913
78,782
2,075,384
[ "iphone", "cocos2d-iphone", "openfeint" ]
5,339,518
1
5,339,557
null
34
42,813
When I do git revert via TortoiseGit, I get this lovely window : ![enter image description here](https://i.stack.imgur.com/0lV1p.png) However, when I want to do the same from the command line, [the documentation](http://www.kernel.org/pub/software/scm/git/docs/git-revert.html) manages to completely confuse me. How do I revert all local uncomitted changes?
How do I git-revert from the command line?
CC BY-SA 3.0
0
2011-03-17T13:16:41.287
2016-03-13T08:19:07.730
2016-03-13T08:19:07.730
3,160,747
11,236
[ "git", "tortoisegit" ]
5,339,678
1
5,405,360
null
3
3,383
We are using Tiny-MCE in our CMS, and our users would like to have the ability to change the width of a column in a table. Now, I know that from an HTML point, there is no such entity "column", but in the Moodle editor, HTMLAREA, there is a plugin that does that - allows to set a width (only in percents) to a column: ![enter image description here](https://i.stack.imgur.com/JdUey.gif) Sorry it's in Hebrew, I couldn't find a version in English... does anyone know of a plugin to Tiny-MCE that could do that? Or have an idea how I would go about writing such a plugin?
Tiny-MCE plugin for setting column width in table
CC BY-SA 2.5
null
2011-03-17T13:29:33.180
2011-03-23T12:39:44.957
null
null
278
[ "javascript", "html", "tinymce" ]
5,339,789
1
5,339,848
null
2
1,603
I have create the following layout, where the UI is consisted of two LinearLayouts, in everyone there is a header textview and a list view. I need to dynamically set the ListView heights so that both display properly. It is like this right now: ![Layout](https://i.stack.imgur.com/dbwco.png) Look how empty space is wasted below the first ListView while the other one displays scrollbars and can benefit that extra space? The layout xml looks like this: ``` <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:orientation="vertical"> <TextView android:layout_height="wrap_content" android:layout_width="fill_parent" android:text="Current outages" android:paddingLeft="3sp" android:background="@color/listHeader_Background" android:textColor="@color/listHeader_Foreground"/> <ListView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1"/> </LinearLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:orientation="vertical"> <TextView android:layout_height="wrap_content" android:layout_width="fill_parent" android:paddingLeft="3sp" android:text="Resolved outages" android:background="@color/listHeader_Background" android:textColor="@color/listHeader_Foreground"/> <ListView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" /> </LinearLayout> </LinearLayout> ```
Android two ListViews spacing and layout
CC BY-SA 2.5
0
2011-03-17T13:39:16.373
2011-03-17T13:43:08.943
null
null
54,538
[ "android", "android-layout" ]
5,339,895
1
5,344,989
null
1
740
Strange thing. I have a shellscript that needs to be run with `sudo` since it uses `dumpcap`. ``` #!/bin/bash # Simulates the transmissions with Sirannon mkdir -p 3dvideos_streamed mkdir -p 3dvideos_packetcapture for file in Alt_moabit Book_arrival Door_flowers Leaving_laptop do for qp in 10 15 25 32 45 60 do echo "Now simulating transmission of $file with QP $qp ... " echo "Starting dumpcap ... " touch 3dvideos_packetcapture/$file-$qp.cap dumpcap -i lo -f "udp port 5000" -a duration:15 -w 3dvideos_packetcapture/$file-$qp.cap & cp 3dvideos_encoded/$file/qp$qp/test.264 3dvideos_streamed/$file-$qp-in.264 & echo "Starting sirannon ... " sirannon sirannon-0.6.8/dat/xml/mvc.xml 3dvideos_encoded/$file/qp$qp/test.264 3dvideos_streamed/$file-$qp 3dvideos_streamed/$file-$qp-out.264 echo "Sirannon is done streaming." sleep 15 done done echo "Fixing permissions ... " chmod -R 655 3dvideos_streamed chmod -R 655 3dvideos_packetcapture ``` Now I'm left with this: ``` werner@savant:~/CACMTV$ ls -la 3dvideos_packetcapture/ ls: cannot access 3dvideos_packetcapture/Alt_moabit-60.cap: Permission denied ls: cannot access 3dvideos_packetcapture/Book_arrival-60.cap: Permission denied ls: cannot access 3dvideos_packetcapture/..: Permission denied ls: cannot access 3dvideos_packetcapture/Leaving_laptop-10.cap: Permission denied ls: cannot access 3dvideos_packetcapture/Leaving_laptop-32.cap: Permission denied ls: cannot access 3dvideos_packetcapture/Leaving_laptop-60.cap: Permission denied ls: cannot access 3dvideos_packetcapture/Alt_moabit-25.cap: Permission denied ls: cannot access 3dvideos_packetcapture/.: Permission denied ls: cannot access 3dvideos_packetcapture/Door_flowers-10.cap: Permission denied ls: cannot access 3dvideos_packetcapture/Door_flowers-15.cap: Permission denied ls: cannot access 3dvideos_packetcapture/Book_arrival-15.cap: Permission denied ls: cannot access 3dvideos_packetcapture/Leaving_laptop-15.cap: Permission denied ls: cannot access 3dvideos_packetcapture/Door_flowers-25.cap: Permission denied ls: cannot access 3dvideos_packetcapture/Alt_moabit-10.cap: Permission denied ls: cannot access 3dvideos_packetcapture/Door_flowers-32.cap: Permission denied ls: cannot access 3dvideos_packetcapture/Leaving_laptop-25.cap: Permission denied ls: cannot access 3dvideos_packetcapture/Book_arrival-45.cap: Permission denied ls: cannot access 3dvideos_packetcapture/Alt_moabit-45.cap: Permission denied ls: cannot access 3dvideos_packetcapture/Door_flowers-45.cap: Permission denied ls: cannot access 3dvideos_packetcapture/Book_arrival-10.cap: Permission denied ls: cannot access 3dvideos_packetcapture/Alt_moabit-15.cap: Permission denied ls: cannot access 3dvideos_packetcapture/Door_flowers-60.cap: Permission denied ls: cannot access 3dvideos_packetcapture/Leaving_laptop-45.cap: Permission denied ls: cannot access 3dvideos_packetcapture/Alt_moabit-32.cap: Permission denied ls: cannot access 3dvideos_packetcapture/Book_arrival-25.cap: Permission denied ls: cannot access 3dvideos_packetcapture/Book_arrival-32.cap: Permission denied total 0 d????????? ? ? ? ? ? . d????????? ? ? ? ? ? .. -????????? ? ? ? ? ? Alt_moabit-10.cap -????????? ? ? ? ? ? Alt_moabit-15.cap -????????? ? ? ? ? ? Alt_moabit-25.cap -????????? ? ? ? ? ? Alt_moabit-32.cap -????????? ? ? ? ? ? Alt_moabit-45.cap -????????? ? ? ? ? ? Alt_moabit-60.cap -????????? ? ? ? ? ? Book_arrival-10.cap -????????? ? ? ? ? ? Book_arrival-15.cap -????????? ? ? ? ? ? Book_arrival-25.cap -????????? ? ? ? ? ? Book_arrival-32.cap -????????? ? ? ? ? ? Book_arrival-45.cap -????????? ? ? ? ? ? Book_arrival-60.cap -????????? ? ? ? ? ? Door_flowers-10.cap -????????? ? ? ? ? ? Door_flowers-15.cap -????????? ? ? ? ? ? Door_flowers-25.cap -????????? ? ? ? ? ? Door_flowers-32.cap -????????? ? ? ? ? ? Door_flowers-45.cap -????????? ? ? ? ? ? Door_flowers-60.cap -????????? ? ? ? ? ? Leaving_laptop-10.cap -????????? ? ? ? ? ? Leaving_laptop-15.cap -????????? ? ? ? ? ? Leaving_laptop-25.cap -????????? ? ? ? ? ? Leaving_laptop-32.cap -????????? ? ? ? ? ? Leaving_laptop-45.cap -????????? ? ? ? ? ? Leaving_laptop-60.cap ``` I can see the files in Nautilus, but I can't open them: ![](https://i.stack.imgur.com/DIZ6G.png) How do I fix this - how would I need to change my shellscript in order for `dumpcap` to have the necessary permission but at the same time leave my permissions intact?
Files generated from shellscript can't be opened, permissions only show "???????"
CC BY-SA 2.5
null
2011-03-17T13:47:04.777
2011-03-17T20:39:51.130
null
null
435,093
[ "bash", "permissions" ]
5,339,977
1
null
null
11
5,504
OK, no matter how I define these mappings, my many-to-many mapping does not want to work with cascade insert. I have tried various combination of `Cascade()` with `Reverse()` and removing all unnecessary properties just to understand if they had anything to do with this not working, but no lock. It is really Simple stuff: I have a `Message` (like an email) which is sent from a user (I have called the entity `BasicUser`) to a number of users (through property `To`). `User` and `Message` in terms of recipients have a many-to-many relationship but `FromUser` has one-to-many. FromUser works fine and it is updated alright but my problem is with many-to-many. I even removed `FromUser` and relationship just to check if this was the problem, but did not help. So here is the table design (Have removed the relationship from `FromUser` to `BasicUser` for simplicity) ![enter image description here](https://i.stack.imgur.com/vSbpl.png) And here are the mappings: ``` public class MessageMap : ClassMap<Message> { public MessageMap() { Id(x => x.Id).Column("MessageId"); Map(x => x.Subject); Map(x => x.SentAt); Map(x => x.Body); References(x => x.From).Column("FromUser"); HasManyToMany(x => x.To).Table("BasicUserMessage").ChildKeyColumn("BasicUserId") .ParentKeyColumn("MessageId").Cascade().All(); } } public class BasicUserMap : ClassMap<BasicUser> { public BasicUserMap() { Id(x => x.Id).Column("BasicUserId"); Map(x => x.DisplayName); Map(x => x.Username); HasManyToMany(x => x.Messages).Table("BasicUserMessage").ChildKeyColumn("MessageId") .ParentKeyColumn("BasicUserId").Inverse(); } } ``` And I call this and it does not work (table `BasicUserMessage` does not get populated): (Note Users with Id 1, 2 and 3 do exist - I also tried getting them from database and then add to list still did not work) ``` ISessionFactory factory = GetSessionFactory(); ISession session = factory.OpenSession(); Message m = new Message() { Body = "Please note 2", Subject = "Secret 2", From = new BasicUser(){Id = 2}, SentAt = DateTime.Now, }; m.To.Add(new BasicUser(){Id = 1}); m.To.Add(new BasicUser(){Id=3}); session.SaveOrUpdate(m); session.Close(); ```
Fluent-NHibernate many-to-many cascade does not populate the link table
CC BY-SA 2.5
0
2011-03-17T13:54:26.083
2012-03-02T16:10:33.167
2011-03-17T20:04:43.723
440,502
440,502
[ "c#", ".net", "nhibernate", "fluent-nhibernate", "many-to-many" ]
5,340,070
1
null
null
6
837
I am used to supplying the dependencies for my objects from the outside. Interface Builder is a tool that helps doing this, but I can’t make it work with multiple nibs. As soon as I break the main nib into more files, I can no longer make connections between objects in different nibs. Using File Owner does not help very much, since it only allows me to pass one single object into a nib. Example: ![enter image description here](https://i.stack.imgur.com/iaUuK.png) Here A and B are some higher-level objects and C and D some kind of lower-level services. As long as all objects are inside one big nib (first picture), everything is fine. But when I split the nib to separate A and B, I have trouble connecting them to C and D. (Obviously I do not want to create two instances of C and D, I want both A and B talking to the same C and D without using a singleton.) Is it possible to do this in Interface Builder? How?
Can I use Interface Builder to inject dependencies across multiple nibs?
CC BY-SA 2.5
0
2011-03-17T14:01:02.633
2017-07-28T12:21:35.980
2011-03-17T14:07:01.967
17,279
17,279
[ "cocoa", "dependency-injection", "interface-builder" ]
5,340,183
1
6,149,818
null
9
6,171
I made an Spring(2.5.6) webapplication with i18n support with property files (ex: messages_en_US.properties, messages_de_DE.properties). This .properties files with uni-codes. for example: ``` busy = Besch\u00E4ftigt ``` When reading `busy` keyword from the `messageSource` gives this result: ``` ... private static ReloadableResourceBundleMessageSource messageSource; /** * Gets a message from the resources (.properties) defined in the applicationContext.xml * * @param input string to hook up * @return the the message hooked up from the resources */ public static String getMessage(String input){ System.out.println(input); //busy System.out.println(messageSource.getDefaultEncoding()); //UTF-8 System.out.println(messageSource.getMessage(input, null, null)); //Beschu00E4ftigt return messageSource.getMessage(input, null, null); } ... ``` so without the `\` The files on the server are also UTF-8: ![enter image description here](https://i.stack.imgur.com/fJeyw.png) The environments where the problem occurred: - `jsp-api.jar``servlet-api.jar``common/lib`- - JSTL 1.1.2 (read from application `lib`)- Tomcat 6.0.32 (Run `jsp-api.jar` and `servlet-api.jar` from `lib` )- - `lib` The environments where the problem is solved (exactly the same distribution): - Tomcat 6.0.32 (Run `jsp-api.jar` and `servlet-api.jar` from `lib` ) - JDK 1.6.0_13 - JSTL 1.1.2 (read from application `lib`) Please let me know if you need more information. And don't say I need to update my JDK because this isn't possible. ``` <b:bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> <b:property name="defaultEncoding" value="UTF-8"/> <b:property name="fallbackToSystemLocale" value="false" /> <b:property name="basenames"> <b:list> <b:value>classpath:messages</b:value> <b:value>/public/custom/i18n/portalmessages</b:value> </b:list> </b:property> <b:property name="cacheSeconds" value="1"/> </b:bean> ``` ``` URLClassLoader cl = (URLClassLoader) IOUtils.class.getClassLoader(); InputStream resourceAsStream = cl.getResourceAsStream("messages_de_DE.properties"); Properties prop = new Properties(); prop.load(resourceAsStream); System.out.println("From classpath --> " + prop.get("busy")); //Beschäftigt System.out.println("From i18n folder --> " + I18nFunctions.getMessage("busy")); //Beschu00E4ftigt ```
Reading unicode from messageSource gives problem with Java 5
CC BY-SA 3.0
null
2011-03-17T14:09:56.267
2011-05-27T08:44:33.567
2011-05-26T21:05:07.717
193,850
193,850
[ "java", "unicode", "utf-8", "internationalization", "character-encoding" ]
5,341,151
1
5,341,221
null
6
24,531
I want to position my textview with numbers under the textview that contains text. I use this layout and the textviews overlap: ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:background="@drawable/back" xmlns:android="http://schemas.android.com/apk/res/android"> <!-- we include header --> <include layout="@layout/header"/> <Spinner android:id="@+id/spinner" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_marginTop="15dip" android:layout_marginLeft="5dip" android:layout_marginRight="5dip" android:textColor="#ffffff" android:background="@drawable/spin" /> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#000000"> <TextView android:id="@+id/tv1" android:text="Some text to display:" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:layout_marginTop="10dip" android:textColor="#ffffff" /> <TextView android:id="@+id/number" android:text="123 456 789" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:textSize="30dip" android:layout_marginTop="10dip" android:textColor="#ffffcc"/> </RelativeLayout> </LinearLayout> ``` What i get with this is: ![enter image description here](https://i.stack.imgur.com/u5b8t.png)
Problems with positioning textView under another textView in relative layout
CC BY-SA 2.5
0
2011-03-17T15:21:57.453
2015-09-07T13:21:33.710
null
null
324,417
[ "android", "layout" ]
5,341,321
1
6,049,257
null
0
1,218
I am running Instruments to find the memoryleaks in my iPhone app. As you can see on the screenshot below, I get some weird memory leaks, from some Foundation objects. ![Screenshot form Instruments](https://i.stack.imgur.com/8SyXY.png) The ones that bother me the most are the one that should be released "automatically" if I understood right. Such as: NSPredicate predicateWithFormat, NSKeyedUnarchiver unarchiveObjectWithData, and so... Here a screenshot with more info for the NSPredicate one: ![enter image description here](https://i.stack.imgur.com/RqGEy.png) Can you please help me to understand what ma I doing wrong? In the code I am simply doing that: ``` NSPredicate *basePredicate = [NSPredicate predicateWithFormat:@"ANY fcLists IN %@", listsIds]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"Item" inManagedObjectContext:self.context]; [self.fetchRequest setEntity:entity]; // Load the list of new items NSPredicate *addedPredicate = [NSPredicate predicateWithFormat:@"fcStatus = -2"]; NSPredicate *predicate = [NSCompoundPredicate andPredicateWithSubpredicates:[NSArray arrayWithObjects:basePredicate, addedPredicate, nil]]; [self.fetchRequest setFetchLimit:self.nbOfNewItems]; [self.fetchRequest setPredicate:predicate]; tmp = [self.context executeFetchRequest:self.fetchRequest error:&error]; ``` so I shouldn't have to release predicate right? Anyway I tried and it makes my code to crash... Thank you in advance for your help!
Memory leaks on autorelease objects?
CC BY-SA 2.5
null
2011-03-17T15:33:56.600
2011-05-18T18:20:39.217
2011-03-17T16:19:50.433
564,672
114,635
[ "objective-c", "memory-leaks", "instruments", "autorelease" ]
5,341,463
1
5,341,781
null
3
2,256
I'm doing a code review for one project. It's architecture you can see on the following scheme: ![system architecture](https://i.stack.imgur.com/g1Ml8.png) At this moment DTO - are simple POJO's and Domains - contains Hibernate anotations. As I know one of the benefits using DTO is that you can make all domain fields as and remove all that stub code with getters and setters. Is this correct approach? What do you think about removing getters and setters from DTO's too? Also may be there are some pros implementing DTO's in Groovy? What do think about that?
Public Fields in DTO and Domain object
CC BY-SA 2.5
0
2011-03-17T15:44:37.013
2011-03-19T18:57:36.573
null
null
191,088
[ "java", "architecture", "dto", "getter", "facade" ]
5,341,481
1
5,341,643
null
0
400
I noticed that when I test my app on the iPad 3.2 software, my buttons on the keypad do not look correct, they are enlarged. When I test it on the 4.0 or above, everything looks great. Any suggestions of what is going on? ![enter image description here](https://i.stack.imgur.com/l5pzO.png) I'll be more than happy to post code, just don't know which part to post? Keep in mind the buttons are not enlarged like this in 4.0 or above. Are there any programming difference between the two. Also, all these buttons were created in interface builder.
Images too large under iOS 3.2
CC BY-SA 2.5
null
2011-03-17T15:45:32.280
2011-03-17T16:35:48.753
2011-03-17T16:35:48.753
643,383
597,775
[ "iphone", "objective-c", "ios4", "iphone-sdk-3.0" ]
5,341,566
1
5,342,463
null
1
2,325
Big picture: This is what I am trying to accomplish. Send a text message to someone. The UI/UX should look something similar to this: ![enter image description here](https://i.stack.imgur.com/1sRjf.png) So, currently, I am using UITableView with 3 cells. The first two (for "To:" and "From:") are 44px high. I put a UITextField inside the "contentView" of a UITableViewCell. Everything is good. I can get the user to edit the content of the cell. Now, I am using the leftView property to display a UILabel with text "To:". It works but the "To" label is always on the very left of the UITextField (shown in img below): ![enter image description here](https://i.stack.imgur.com/sWRk3.png) So, according to the SDK documentation. The left view mode is dictated by this method: leftViewRectForBounds: According to the discussion: > You should not call this method directly. If you want to place the left overlay view in a different location, you can override this method and return the new rectangle. So, I tried overriding without much success. If anyone have any code snippets, I would greatly appreciate it. In the bottom picture, I set the "From" to be " From" which is "hacking" it a little bit but I would like to do it correctly. This is what I have tried: ``` // override leftViewRectForBounds method: - (CGRect)leftViewRectForBounds:(CGRect)bounds{ CGRect leftBounds = CGRectMake(bounds.origin.x + 30, 0, 45, 44); return leftBounds; } ``` and small variants of it and it doesn't seem to work so any help is appreciated. Thanks!!!
I cannot seem to override UITextField leftViewRectForBounds method
CC BY-SA 2.5
0
2011-03-17T15:52:15.367
2011-03-17T16:57:13.780
null
null
384,964
[ "iphone", "user-interface", "uitextfield", "uilabel" ]
5,341,602
1
5,467,294
null
2
354
I was doing my unit testing for the form, and found out that there is some serious problem with the automatic tab index that Orbeon gives. In my case I have the need for following tab indexes 1-7 as shown by number in the figure. Model: ``` <xforms:model> <xforms:instance id="dropdown-values"> <form> <yes-no> <options>Yes</options> <options>No</options> </yes-no> </form> </xforms:instance> </xforms:model> ``` Logic to create the radio in form: ``` <xforms:itemset nodeset="instance('dropdown-values')/yes-no/options"> <xforms:label ref="." /> <xforms:value ref="." /> </xforms:itemset> ``` ![http://i.stack.imgur.com/9QvKq.jpg](https://i.stack.imgur.com/MqORo.jpg) The example above has a functionality like when "No" is selected in the "Enable text" option, the following text-boxes are disabled. Currently Orbeon is providing a default tabindex and switching from selected radio button to the next field. I.e.: - - But the functionality intended is: - -
Is tabindex feature there in xforms?
CC BY-SA 2.5
null
2011-03-17T15:54:29.407
2011-03-29T02:38:49.740
2011-03-29T02:26:42.600
5,295
648,157
[ "xforms", "orbeon" ]
5,341,699
1
6,835,299
null
5
12,095
Is it possible to represent one data series as points and another as lines? In the chart below I want the blue 'Data' line to be represented as points whilst retaining the other series as lines, can this be done using the Google Visualisations? ![Google Visualisation (Line Graph)](https://i.stack.imgur.com/frNFN.png) I generated the graph above in [this fiddle](https://jsfiddle.net/p6vzjut4/) using the following code ``` function drawVisualization() { // Create and populate the data table. var data = new google.visualization.DataTable(); data.addColumn('string', 'x'); data.addColumn('number', 'Data'); data.addColumn('number', 'High'); data.addColumn('number', 'Low'); data.addRow(["A", 1, 5.5, 2.3]); data.addRow(["B", 2, 5.5, 2.3]); data.addRow(["C", 7, 5.5, 2.3]); data.addRow(["D", 3, 5.5, 2.3]); data.addRow(["E", 6, 5.5, 2.3]); data.addRow(["F", 5, 5.5, 2.3]); // Create and draw the visualization. new google.visualization.LineChart(document.getElementById('visualization')). draw(data, { width: 500, height: 400} ); } ```
Display Lines AND Points on the Line Chart - Google Visualisation API
CC BY-SA 3.0
0
2011-03-17T16:00:46.827
2016-09-20T09:28:25.200
2016-09-20T09:28:25.200
226,241
226,241
[ "google-api", "google-visualization" ]
5,342,147
1
5,455,613
null
11
565
I'm using the [Unit Test Sessions window](http://www.jetbrains.com/resharper/webhelp/Reference__Windows__Unit_Test_Sessions.html) of ReSharper 5.1 in order to run NUnit tests. It gives great visualization and 90% of the time it is just what I need. ![enter image description here](https://i.stack.imgur.com/h0zzA.png) The only problem is that the Unit Test Sessions window does not support tests that have parameters. I would like to have a separate node for each value of the parameters, like in [the screenshots here](http://blog.benhall.me.uk/2008/08/taking-look-at-nunit-25-alpha-3.html). In ReSharper I only see one node for the whole method, and there is no way to know which parameters it passed with and which parameters it failed with. Is there any way that I can see the various runs in ReSharper, or do I need a different tool (and which one is the best)? Thank you!
Is it possible to visualize parametrized NUnit tests using the Resharper GUI?
CC BY-SA 2.5
0
2011-03-17T16:32:04.803
2011-09-02T19:27:34.950
null
null
326,370
[ "visual-studio-2010", "unit-testing", "nunit", "resharper" ]
5,342,329
1
5,342,891
null
13
2,273
I'm using [IMDbPY](http://imdbpy.sourceforge.net/) to retrieve all kinds of data about movies. For example, if I have a movie object of "Pulp Fiction (1994)" then I can get the name of its (first) director like this: ``` >>> pulp_fiction['director'][0]['name'] u'Quentin Tarantino' ``` Or the name of the third actor: ``` >>> pulp_fiction['cast'][2]['name'] u'Samuel L. Jackson' ``` In ways similar to this I can retrieve all kinds of information for a given movie (budget, length, storyline, list of goofs, trivia, etc). The piece of information I'm looking for is recommendations (other movies similar to the current movie). IMDb provides such a thing for each movie: ![pulp fiction recommendations](https://i.stack.imgur.com/uoi6c.jpg) Is it possible to access the recommendations using IMDbPY? If not, is there another way to access the recommendations which doesn't require me to parse webpages?
Can I retrieve IMDb's movie recommendations for a given movie using IMDbPY?
CC BY-SA 2.5
0
2011-03-17T16:45:44.277
2011-03-17T17:33:07.817
null
null
110,028
[ "python", "imdb" ]
5,342,522
1
null
null
0
438
I have downloaded trial of Spoon Studio, yet it crashes on startup. ![enter image description here](https://i.stack.imgur.com/Rpt6z.jpg) Any ideas what might be causing it? Their support keeps silent. Or maybe you could suggest another obfuscator(?), i.e. a tool or a way to pack all the needed *.DLLs and other stuff into one .exe file? Thanks!
Spoon Studio crashes or please suggest another all-to-one-exe-packer. :)
CC BY-SA 2.5
null
2011-03-17T17:01:50.097
2012-01-27T13:06:42.407
null
null
651,418
[ "c#", ".net", "obfuscation" ]
5,343,172
1
5,343,228
null
4
4,039
I am getting this error: ``` *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<NSObject 0x5a37750> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key destination.' ``` Following is the code: ``` - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"ReservationCell"; ReservationCell *cell = (ReservationCell*) [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"ReservationCell" owner:nil options:nil]; for (id currentObject in topLevelObjects){ if ([currentObject isKindOfClass:[UITableViewCell class]]){ cell = (ReservationCell *) currentObject; break; } } } //cell.origin.text = [[data objectAtIndex:indexPath.row] origin]; //cell.destination.text = [[data objectAtIndex:indexPath.row] destination]; //cell.time_range.text = [[data objectAtIndex:indexPath.row] time_range]; return cell; } ``` Here is the ReservationCell.h ``` @interface ReservationCell : UITableViewCell { UILabel * origin; UILabel * destination; UILabel * time_range; } @property (nonatomic, retain) IBOutlet UILabel * origin; @property (nonatomic, retain) IBOutlet UILabel * destination; @property (nonatomic, retain) IBOutlet UILabel * time_range; @end ``` Here's how I wired it up: ![enter image description here](https://i.stack.imgur.com/tGsYL.png)
error with custom UITableViewCell
CC BY-SA 2.5
0
2011-03-17T17:57:19.577
2013-09-10T19:46:05.057
2011-03-17T18:13:56.937
95,265
95,265
[ "iphone", "objective-c", "uitableview" ]
5,343,201
1
5,343,236
null
1
128
I'm watching the PluralSight tutorial videos, and during one of the code samples I noticed this in the solution explorer. ![Solution Explorer](https://i.stack.imgur.com/TkbKm.png) What is the name of the plugin/tool that lists the `All Open Unsaved Edited` in the solution explorer?
What is the name of this Visual Studio 2010 plugin?
CC BY-SA 2.5
null
2011-03-17T17:59:54.870
2016-03-25T11:11:53.383
2016-03-25T11:11:53.383
1,091,386
74,022
[ "visual-studio-2010", "plugins" ]
5,343,379
1
5,353,027
null
0
1,380
I am running an app with a SurfaceView. When the Surface view is visible and I press the 'power' button to lock the phone then return to the app the perspective is off. It appears to be rendering a "tall and skinny" view on the left side of my "short and wide" view. When I look at onSurfaceChanged it is being called once when the phone is powered on with 'width=480 height=800' then again when after the phone is unlocked with 'width=800 height=480'. I am calling gl.glFrustumf() each frame with the correct new width/height data collected from onSurfaceChanged but something is still making my window appear skinny and tall, any ideas? Edit: Perhaps it has something to do with my view structure. The Activities contentView is called MainView.. ``` MainView / \ UIView SurfaceView (I look wrong) / UI Elements (These all look correct) ``` Edit #2: Screenshot: ![LockScreenFail](https://i.stack.imgur.com/OR3rX.png) The globe and the 'Download More' button are drawn in 3d. The Square in is a child of the UI view (other children of UIView also show up correctly). It appears as if the SurfaceView thinks the width is the height and the height is the width. I did more printing of the Surface View's Width and height and get this output: ``` --Phone On Unlock Screen --Activity onWindowFocusChanged called I/System.out( 8817): ***********UI Width: 480 UI Height: 800 I/System.out( 8817): ***********Main Width: 480 Main Height: 800 I/System.out( 8817): ***********GL Width: 480 GL Height: 800 --App continues to run. These are triggered in GLSurfaceView onLayout I/System.out( 8061): ***********UI Width: 800 UI Height: 480 I/System.out( 8061): ***********Main Width: 800 Main Height: 480 I/System.out( 8061): ***********GL Width: 800 GL Height: 480 I/System.out( 8061): ***********UI Width: 800 UI Height: 480 I/System.out( 8061): ***********Main Width: 800 Main Height: 480 I/System.out( 8061): ***********GL Width: 800 GL Height: 480 ``` So the Width and Height appear to fix themselves sometime after onWindowFocusChanged but graphically it never looks correct. Edit #3: ``` public void onSurfaceCreated(GL10 gl, EGLConfig config) { } ``` :) ``` public void onSurfaceChanged(GL10 gl, int width, int height) { mWidth = width; mHeight = height; mAspectRatio = (float) width / height; mSurfaceChangedID++; } ``` Then I since I have something ideas rendered in 3d and others as 2d UI elements I setup the projection each frame in the onDraw ``` public void onDrawFrame(GL10 gl) { gl.glClearColor( mClearColorR, mClearColorG, mClearColorB, 1.0f ); gl.glClear( GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT ); for( each item ) { if( item.Is3d() ) { //For 3d Elements: gl.glMatrixMode( GL10.GL_PROJECTION ); gl.glLoadIdentity(); gl.glFrustumf( mAspectRatio*-mHalfViewAngleTan, mAspectRatio*mHalfViewAngleTan, -mHalfViewAngleTan, mHalfViewAngleTan, mNearZClip, mFarZClip ); //Enable Lighting, Setup fog ... } else { //For UI Elements: gl.glMatrixMode( GL10.GL_PROJECTION ); gl.glLoadIdentity(); gl.glOrthof( -0.5f*mAspectRatio, 0.5f*mAspectRatio, -0.5f, 0.5f, -1, 1 ); //Disable Lighting, Disable fog, Setup blending ... } //Setup client state and vertex buffers ... gl.glDrawArrays( GL10.GL_TRIANGLES, 0, mdl.getVtxCount() ); } } ``` Edit #4: Turns out it did have to do with View, I changed how the SurfaceView was added to its parent... It was... ``` getMainView().addView( m3DView ); ``` It is now... ``` // add to parent view { Display display = getWindow().getWindowManager().getDefaultDisplay(); android.widget.AbsoluteLayout absLayout = new android.widget.AbsoluteLayout(this); absLayout.setLayoutParams(new android.view.ViewGroup.LayoutParams(display.getWidth(), display.getHeight())); absLayout.addView( m3DView, new android.view.ViewGroup.LayoutParams(display.getWidth(), display.getHeight()) ); getMainView().addView( absLayout ); } ```
Layout Problems with Open GL SurfaceView after phone is locked
CC BY-SA 2.5
null
2011-03-17T18:15:59.907
2011-03-22T17:22:17.270
2011-03-22T17:22:17.270
647,315
647,315
[ "android", "opengl-es", "android-layout" ]
5,343,440
1
5,400,943
null
7
13,543
So I can't seem to be able to create any new projects or solutions. I can navigate and open existing solutions but cannot create any new solutions. All help is appreciated. See screenshot below: ![Shot of my VS instance](https://i.stack.imgur.com/O7Dc0.png)
Can't Create Project or Solution in Visual Studio 2010
CC BY-SA 2.5
0
2011-03-17T18:21:12.570
2019-08-17T09:10:08.970
null
null
593,010
[ "visual-studio", "visual-studio-2010", "solution" ]
5,343,455
1
5,422,074
null
0
541
START ![enter image description here](https://i.stack.imgur.com/27mqj.png) 1. The path to the Icon is valid (Ex. "C:\MyIcon.ico") 2. The path to the Target was valid (Ex. "N:\My Folder\MyApp.exe") 3. I did not touch the shortcut file at all 4. I renamed the folder on the file system (Ex. "N:\My Folder2\MyApp.exe") 5. Icon disappears (see below) ![enter image description here](https://i.stack.imgur.com/29ZcV.png) END
Shortcut Icon disappears when Target points to invalid path (Windows XP)
CC BY-SA 2.5
null
2011-03-17T18:22:41.683
2011-03-24T16:05:53.880
null
null
287,311
[ "windows-xp", "shortcut" ]
5,343,974
1
5,344,159
null
1
2,572
![enter image description here](https://i.stack.imgur.com/tkdoP.jpg)How can I change the color or type of the column name on a DataGridView in WinForms?
How to change datagridview columnname color or style?
CC BY-SA 2.5
0
2011-03-17T19:09:09.040
2014-04-10T04:30:04.477
2011-03-18T17:44:59.697
558,053
558,053
[ "c#", "winforms" ]
5,344,050
1
5,407,968
null
1
2,421
having a problem while drawing a complex combinations of TextFields into BitmapData in as3, and i can't understand the reason for that, so please help me with it. The problem happens when i change the parent's (x,y) or (width, height) and the drawn object got a bad effect like left blur. I attached an image of what going, and here is a snippet of the code : ``` //defining TextField object var textField:TextField = new TextField(); textField.embedFonts = true; textField.width = width; textField.selectable = false; textField.border = true; var stylesheet:StyleSheet = new StyleSheet(); stylesheet.parseCSS(css); textField.styleSheet = stylesheet; textField.multiline = true; textField.autoSize = TextFieldAutoSize.LEFT; textField.antiAliasType = AntiAliasType.ADVANCED; textField.wordWrap = true; textField.condenseWhite = true; textField.htmlText = "<p>"+text+"</p>"; //after adding it to a MovieClip i draw it into a BitmapData var btmd:BitmapData = new BitmapData(width, height); btmd.draw(this.page,null,null,null,null, true); ``` ![enter image description here](https://i.stack.imgur.com/CEYKr.jpg)
in AS3, Drawing TextField into BitmapData get a bad effect when parent get moved ( changing x, y )?
CC BY-SA 2.5
0
2011-03-17T19:17:32.847
2017-07-21T23:06:36.460
null
null
297,406
[ "apache-flex", "actionscript-3", "flash-cs4", "bitmapdata" ]
5,344,090
1
5,344,331
null
1
583
I'm using .NET1 and I want to draw text as native. Is it possible by configuring graphics? I need to render the text as the System.Windows.Forms.Label does when the FlatStyle is set to System. I have configured the SmoothingMode and the AntiAliasGridFit, but unfortunately the result is not the same: ![enter image description here](https://i.stack.imgur.com/fzOv8.png) I'm using the same font in both cases (Segoe UI 9pt). Any ideas?
Drawing text in .NET with native look & feel
CC BY-SA 2.5
null
2011-03-17T19:20:59.703
2011-03-17T19:43:56.197
2011-03-17T19:38:35.657
179,386
402,081
[ ".net", "winforms", "text", "drawing" ]
5,344,448
1
5,344,594
null
0
738
Dear folks, staring at the CSS I put together so proudly the other night, I desparately tried to remove more chars here or there, like those wasted whitespace: " " `meanwhile the more I stared at this code, the more I started to see patterns, clearly emerging from these bodies, asif this was the absolute minimum, plus some hidden message` Now let me get to the point for this question is already too contaminated with nonvital letters already: Is there a way we could further minify my otherwise humungously gigantuous monster css file into a more bandwith friendly, really small file? Much appreceated! ![enter image description here](https://i.stack.imgur.com/aQw3P.png)
How to Minify CSS to its Absolute Minimalistic Essence?
CC BY-SA 2.5
0
2011-03-17T19:53:21.593
2011-03-17T23:21:27.803
2011-03-17T23:10:11.480
509,670
509,670
[ "css", "performance", "whitespace", "minify" ]
5,344,523
1
5,344,550
null
0
527
Hey, so I am not looking to do anything along the lines of a pre-loader, I just want to know how to keep the browser from displaying this image: ![enter image description here](https://i.stack.imgur.com/Z3fHf.png) Before the image loads. Thanks!
Remove default image before image load
CC BY-SA 2.5
null
2011-03-17T20:00:06.270
2011-03-17T20:15:59.273
null
null
638,887
[ "html", "image", "default" ]
5,344,645
1
5,344,783
null
0
773
I'm not sure if this is an error or not. The code compiles fine (no warnings), but when I enter a method, a local's value (an NSMutableString) displays this content in the debugger: ``` __NSAutoreleaseFreedObject(): release of previously deallocated object ``` ![enter image description here](https://i.stack.imgur.com/cx1CU.png) I'm not getting an exception, it looks like the contents of the string (which is not even allocated at that time) is that NSAutoReleaseFreedObject warning. What's going on?
"__NSAutoreleaseFreedObject(): release of previously deallocated object" out of the blue
CC BY-SA 2.5
0
2011-03-17T20:11:27.220
2011-03-17T20:23:33.607
null
null
74,415
[ "cocoa", "xcode", "debugging", "nsmutablestring" ]
5,344,649
1
5,349,526
null
4
302
I get a warning in Visual Studio when I reference the latest version of Microsoft.Scripting (the one included with IronPython). Is it possible to deploy / use them side by side in the same application? Is there a better / more dynamic way to instantiate the runtimes? ``` private ScriptRuntime GetScriptRuntime() { if ("IronRuby".Equals(scriptUnit.Type)) { return IronRuby.Ruby.CreateRuntime(); } if ("IronPython".Equals(scriptUnit.Type)) { return IronPython.Hosting.Python.CreateRuntime(); } throw new Exception("Unknown Script Type [" + scriptUnit.Type + "]"); } ``` ![Image of Warning in Visual Studio](https://i.stack.imgur.com/CeId9.png) ``` Text of Warning - Module 'Microsoft.Scripting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' should be referenced. ```
Is it possible to use IronPython and IronRuby side by side in the same Application?
CC BY-SA 2.5
0
2011-03-17T20:11:30.177
2011-03-18T08:19:08.647
null
null
1,310
[ "c#", "ironpython", "ironruby", "dynamic-language-runtime" ]
5,344,804
1
null
null
0
604
I would like your help about this graph which I have.I would like to find a way how write a script to create a table named COMPS to represent this component/subcomponent tree structure, as an edge list for the graph. I can use these names for the columns of the table COMPONENT, SUBCOMPONENT, SUBCOMPCOUNT. Any ideas? Components of type b occur in more than one place in the structure of component a. But the structure of component b is the same, regardless of its position Component d also occurs in various different locations, but all objects of type d are the same kind of object ![enter image description here](https://i.stack.imgur.com/zLek8.jpg)
trees and tables in DB2
CC BY-SA 2.5
null
2011-03-17T20:25:01.307
2013-08-12T08:56:04.850
null
null
576,998
[ "sql", "database", "tree", "db2" ]
5,344,812
1
null
null
4
4,056
I have some formatted text : [link to JSFiddle](http://jsfiddle.net/JKzeG/16/) and i want to make it to look like this : ![enter image description here](https://i.stack.imgur.com/buXMk.png) How can this be done?
css text background diffrent for space between text lines
CC BY-SA 2.5
null
2011-03-17T20:25:37.740
2017-07-28T12:56:14.493
2020-06-20T09:12:55.060
-1
508,415
[ "html", "css", "text", "formatting", "background" ]
5,344,825
1
5,344,847
null
10
744
I just started using resharper and it barks at this generated assemblyinfo.cs file. Reason/Logic tells me I'm fine to take the line out because it's the latest version of resharper and it's a popular tool. My worry is something along the lines of my limited understanding w.s.t. interactions of newer c# features like extension methods in combination with taking a "using" out that appears to not be "used". Hope that made some sense. Here's the screen shot for clarity's sake. ![enter image description here](https://i.stack.imgur.com/V9IAB.png)
is there any reason to leave ref to System.Runtime.CompilerServices in AssemblyInfo.cs?
CC BY-SA 2.5
null
2011-03-17T20:26:40.780
2011-03-17T20:28:34.067
null
null
398,546
[ "c#", "resharper", "using" ]
5,344,880
1
null
null
1
207
For example if I was creating a Pizza shop database it would look like this ![http://i.stack.imgur.com/xQGUY.png](https://i.stack.imgur.com/XyL3Q.png)
SQL Query too add up how many times a unique string occurs
CC BY-SA 3.0
null
2011-03-17T20:31:11.523
2014-09-21T10:31:27.857
2014-09-21T10:31:27.857
759,866
665,064
[ "sql", "add" ]
5,345,392
1
5,369,902
null
3
992
How do you calculate UV coordinates for points on a plane? I have a polygon - 3 or 4 or more points - that is on a plane - that is to say, all the points are on a plane. But it can be at any angle in space. One side of this polygon - two points - are to be mapped to two corresponding 2D points in a texture - I know these two points in advance. I also know the x and y scale for the texture, and that no points fall outside the texture extent or other 'edge cases'. Here's an image where the up-most textured quad is distorted: ![enter image description here](https://i.stack.imgur.com/y3cbe.png) I outlined a bad quad in yellow. Imagine that I know the UV coordinates of those two bottom-most corners on that quad, and want to calculate the proper UV coordinates of the other two points... Imagine my texture is a piece of paper in real life, and I want to texture your (flat) car door. I place two dots on my paper, which I line up with two dots on your car door. How do I calculate where the other locations on the car door are under the paper? --- Success using brainjam's code: ``` def set_texture(self,texture,a_ofs,a,b): self.texture = texture self.colour = (1,1,1) self.texture_coords = tx = [] A, B = self.m[a_ofs:a_ofs+2] for P in self.m: if P == A: tx.append(a) elif P == B: tx.append(b) else: scale = P.distance(A)/B.distance(A) theta = (P-A).dot((B-A)/(P.distance(A)*B.distance(A))) theta = math.acos(theta) x, y = b[0]-a[0], b[1]-a[1] x, y = x*math.cos(theta) - y*math.sin(theta), \ x*math.sin(theta) + y*math.cos(theta) x, y = a[0]+ x*scale, a[1]+ y*scale tx.append((x,y)) ``` ![enter image description here](https://i.stack.imgur.com/yXpub.png)
undistorted texture coordinates
CC BY-SA 2.5
0
2011-03-17T21:20:06.850
2011-03-21T18:33:27.390
2011-03-21T18:33:27.390
15,721
15,721
[ "3d", "texture-mapping", "trilateration" ]
5,345,446
1
5,345,915
null
5
22,898
I'm using the `<body>` tag as a wrapper for three divs on a site where every single background color is white. I've set the background color to #fff for the html and body in the css, and the site is rendering correctly in every browser (including IE 6 and 7) except IE8: ![Only one of the divs (the central content) is displaying its background color](https://i.stack.imgur.com/DiZVo.png) I've even tried setting the style for html directly inline like so: `<html style="background-color: #fff">` but that doesn't seem to change anything. Not even sure what might be causing the bug.
html element background color not showing in IE 8
CC BY-SA 2.5
null
2011-03-17T21:25:24.480
2014-09-20T14:01:41.900
2014-09-20T14:01:41.900
124,238
265,324
[ "html", "css", "internet-explorer", "internet-explorer-8", "background-color" ]
5,345,505
1
5,345,529
null
2
711
I've decided to add a logging mechanism to my application so I can catch any errors or exceptions that are thrown. I've noticed that when an entry to the log is created it is not added to the log, it seems to overwrite everything that is in the file so there is only ever one entry. I have a feeling it's something simple that I'm missing but I don't really use the System.IO namespace very often. ``` public static void SetWorkingDirectory(string path) { _workingDirectory = path + "\\ErrorLog.txt"; if(!File.Exists(_workingDirectory)) { File.Create(_workingDirectory); } pathSet = true; } ``` ``` public static bool Add(string message) { StringBuilder str = new StringBuilder(); str.Append(System.DateTime.Now); str.Append(" "); str.Append(message); str.Append(" \n"); using (StreamWriter writer = new StreamWriter(_workingDirectory)) { writer.Write(str.ToString()); } return true; } ``` ![Log file](https://i.stack.imgur.com/UkQDp.jpg)
Text in file is not appended - C#
CC BY-SA 2.5
null
2011-03-17T21:30:39.113
2011-03-17T21:48:22.100
2011-03-17T21:37:20.180
218,159
218,159
[ "c#", "logging", ".net", "streamwriter" ]
5,345,670
1
null
null
1
463
I am getting the following warnings in the code: ![enter image description here](https://i.stack.imgur.com/FIFNl.png) Should I just remove all of these methods in the code or what? ``` #import "ReservationCell.h" @implementation ReservationCell @synthesize origin; @synthesize destination; @synthesize time_range; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (void)dealloc { [origin release]; [destination release]; [time_range release]; [super dealloc]; } - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } #pragma mark - View lifecycle - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. } - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortrait); } @end ``` Also I am getting this final linker warning, anyone know how to fix it? ![enter image description here](https://i.stack.imgur.com/4EkwZ.png)
removing warnings caused by custom UITableViewCell class
CC BY-SA 2.5
null
2011-03-17T21:46:37.853
2011-03-17T21:50:53.770
null
null
95,265
[ "iphone", "objective-c", "xcode", "warnings" ]
5,345,873
1
null
null
0
288
Here is the jfiddle: [http://jsfiddle.net/sPBtg/1/](http://jsfiddle.net/sPBtg/1/) In IE7, the input box for the quiz goes down a line and I can't figure out why it's doing that. Here is a screenshot of what I mean: ![screenshot](https://i.stack.imgur.com/OtxdE.png) What do I need to change? Also, I noticed that in the IE7 developer tool, I get a strange empty text node. If I delete that text node, through the developer tool, everything works right again. ![screenshot2](https://i.stack.imgur.com/NuPpF.jpg)
form looks off in ie7. css help. (screenshot incl.)
CC BY-SA 2.5
null
2011-03-17T22:08:45.523
2011-03-17T23:26:06.067
2011-03-17T23:26:06.067
645,836
645,836
[ "css", "internet-explorer-7" ]
5,345,981
1
5,350,833
null
6
2,050
I've just stated working in haskell semi-explicit parallelism with GHC 6.12. I've write the following haskell code to compute in parallel the map of the fibonnaci function upon 4 elements on a list, and in the same time the map of the function sumEuler upon two elements. ``` import Control.Parallel import Control.Parallel.Strategies fib :: Int -> Int fib 0 = 0 fib 1 = 1 fib n = fib (n-1) + fib (n-2) mkList :: Int -> [Int] mkList n = [1..n-1] relprime :: Int -> Int -> Bool relprime x y = gcd x y == 1 euler :: Int -> Int euler n = length (filter (relprime n) (mkList n)) sumEuler :: Int -> Int sumEuler = sum . (map euler) . mkList -- parallel initiation of list walk mapFib :: [Int] mapFib = map fib [37, 38, 39, 40] mapEuler :: [Int] mapEuler = map sumEuler [7600, 7600] parMapFibEuler :: Int parMapFibEuler = (forceList mapFib) `par` (forceList mapEuler `pseq` (sum mapFib + sum mapEuler)) -- how to evaluate in whnf form by forcing forceList :: [a] -> () forceList [] = () forceList (x:xs) = x `pseq` (forceList xs) main = do putStrLn (" sum : " ++ show parMapFibEuler) ``` to improve my program in parallel I rewrote it with and and a function to force whnf evaluation. My problem is that by looking in the threadscope it appear that i didn't gain any parallelism. Things are worse because i didn't gain any speedup. ![Threadscope observation](https://i.stack.imgur.com/uBRt4.png) That why I have theses two questions How could I modify my code to exploit any parallelism ? How could I write my program in order to use Strategies (parMap, parList, rdeepseq and so on ...) ? according to his contribution ``` parMapFibEuler = (mapFib, mapEuler) `using` s `seq` (sum mapFib + sum mapEuler) where s = parTuple2 (seqList rseq) (seqList rseq) ``` the parallelism appears in the threadscope but not enough to have a significant speedup ![enter image description here](https://i.stack.imgur.com/pMp32.png)
How to exploit any parallelism in my haskell parallel code?
CC BY-SA 3.0
0
2011-03-17T22:19:56.230
2012-05-14T13:17:20.307
2012-05-14T13:17:20.307
151,019
403,279
[ "haskell", "parallel-processing", "multicore" ]
5,346,195
1
null
null
0
1,246
I am trying to display custom drawable on the map view but I can observe very strange behavior, the drawable draws multiple times and the worst thing it displays one time incorrectly. Also this drawable displays perfect with ImageView, but not as MapView overlay... ![enter image description here](https://i.stack.imgur.com/5ME10.png) Here is my custom drawable: ``` public class CustomDrawable extends Drawable { private Bitmap mBitmap; private int mWidth; private int mHeight; private int mDrawLeft; private int mDrawTop; private int mColor; public ChatIconDrawable(Resources res, int color) { this.mColor = color; this.mBitmap = BitmapFactory.decodeResource(res, R.drawable.chat_icon); this.mWidth = mBitmap.getWidth(); this.mHeight = mBitmap.getHeight(); setBounds(-mWidth, -mHeight, 0, 0); } @Override public void draw(Canvas canvas) { ShapeDrawable shapeDrawable = new ShapeDrawable(new OvalShape()); shapeDrawable.getPaint().setColor(mColor); shapeDrawable.setBounds(2 - mWidth, 3 - mHeight, mWidth - 2 - mWidth, mHeight - mHeight / 4 - mHeight); shapeDrawable.draw(canvas); canvas.drawBitmap(mBitmap, mDrawLeft, mDrawTop, null); } @Override public int getOpacity() { return PixelFormat.OPAQUE; } @Override public void setBounds(int left, int top, int right, int bottom) { mDrawLeft = left + (right - left - mWidth) / 2; mDrawTop = top + (bottom - top - mHeight) / 2; } @Override public void setBounds(Rect bounds) { super.setBounds(bounds); } @Override public void setAlpha(int alpha) { // throw new UnsupportedOperationException( // "Not supported with this drawable"); } @Override public void setColorFilter(ColorFilter cf) { // throw new UnsupportedOperationException("Not supported with this drawable"); } @Override public void setDither(boolean dither) { // throw new UnsupportedOperationException("Not supported with this drawable"); } @Override public void setFilterBitmap(boolean filter) { // throw new UnsupportedOperationException("Not supported with this drawable"); } @Override public int getIntrinsicWidth() { return mWidth; } @Override public int getIntrinsicHeight() { return mHeight; } @Override public int getMinimumWidth() { return mWidth; } @Override public int getMinimumHeight() { return mHeight; } } ``` Basically custom drawable draws the background with some color (it may vary) and then draws on top static bitmap to produce right figure. To draw this on the map I use ItemizedOverlay. As you can see the problem in that this drawable draws multiple times and with different placement... please advice because it is not clear for me whats wrong. Thank you.
Android display drawable on the map
CC BY-SA 2.5
null
2011-03-17T22:44:17.157
2011-03-17T23:00:12.830
null
null
390,323
[ "java", "android", "google-maps", "bitmap", "drawable" ]
5,346,755
1
null
null
2
1,406
I've created custom UITableCells a bunch of times and I've never run into this problem, so I'm hoping you can help me find the thing I've missed or messed up. When I run my app, the cells in my table view appear to be standard cells with Default style. I have SettingsTableCell which is a subclass of UITableViewCell. I have a SettingsTableCell.xib which contains a UITableViewCell and inside that are a couple labels and a textfield. I've set the class type in the xib to be SettingsTableCell and the File's Owner of the xib to my table controller. My SettingsTableController has an IBOutlet property named tableCell. My cellForRowAtIndexPath contains the following code to load my table view xib and assign it to my table controller's tableCell property: ``` - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"CellSettings"; SettingsTableCell *cell = (SettingsTableCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { [[NSBundle mainBundle] loadNibNamed:@"SettingsTableCell" owner:self options:nil]; cell = self.tableCell; self.tableCell = nil; NSLog(@"cell=%@", cell); } // Configure the cell... NSArray *sections = [self.settingsDictionary objectForKey:KEY_GROUPS]; NSDictionary *sectionInfo = [sections objectAtIndex:[indexPath section]]; NSArray *itemsInSection = [sectionInfo objectForKey:KEY_FIELDS]; NSDictionary *item = [itemsInSection objectAtIndex:[indexPath row]]; cell.textLabel.text = [item objectForKey:KEY_LABEL_NAME]; cell.labelName.text = [item objectForKey:KEY_LABEL_NAME]; cell.labelUnitsType.text = [item objectForKey:KEY_LABEL_UNITS]; return cell; } ``` This is what my xib set up looks like in IB: ![Screenshot of Interface Builder](https://i.stack.imgur.com/Pe0dg.png) When I run my app, the table displays as if all of the cells are standard Default style cells though: ![Screenshot of my table view](https://i.stack.imgur.com/vkPrP.png) The seriously weird part is though... if I tap on the area of the cell where the textfield SHOULD be, the keyboard does come up! The textfield isn't visible, there's no cursor or anything like that... but it does respond. The visible UILabel is obviously not the UILabel from my xib though because the label in my xib is right justified and the one showing in the app is left justified. I'm incredibly confused about how this is happening. Any help is appreciated. EDIT: Here is the code for my SettingsTableCell class: ``` @interface SettingsTableCell : UITableViewCell { UILabel *labelName; UILabel *labelUnitsType; UITextField *field; } @property (nonatomic, retain) IBOutlet UILabel *labelName; @property (nonatomic, retain) IBOutlet UILabel *labelUnitsType; @property (nonatomic, retain) IBOutlet UITextField *field; @end #import "SettingsTableCell.h" @implementation SettingsTableCell @synthesize labelName; @synthesize labelUnitsType; @synthesize field; - (void)dealloc { [labelName release]; labelName = nil; [labelUnitsType release]; labelUnitsType = nil; [field release]; field = nil; [super dealloc]; } @end ```
Custom UITableViewCell from xib isn't displaying properly
CC BY-SA 2.5
0
2011-03-18T00:06:03.723
2011-03-18T10:47:31.050
2011-03-18T02:24:09.050
416,631
416,631
[ "iphone", "ios", "uitableview", "interface-builder" ]
5,346,780
1
null
null
0
5,402
I have been researching for days on how to do this and nobody has an answer. I am creating an app with 5 timers on the same view. I need to create a timer that counts down from "15:00" (minutes and seconds), and, another that counts down from "2:58" (minutes and seconds). The 15 minute timer should not repeat, but it should stop all other timers when it reaches "00:00." The "2:58" timer should repeat until the "15:00" or "Game Clock" reaches 0. Right now, I have scrapped almost all of my code and I'm working on the "2:58" repeating timer, or "rocketTimer." Does anyone know how to do this? EDIT 2: My simulator will not even run the app so I currently have no idea if the timer is actually working or not, but from my previous attempts, it has not worked. It doesn't show up in the format that I want and it counts down by 2's (from the last time it actually worked). The problem is, also, that I'm not fluent in objective-C. I can write pseudocode all day, just like everyone else, but I cannot put what I want into code because I do not fully understand the NSTimer. EDIT: In my output, I get this error "terminate called after throwing an instance of 'NSException'" and this error? ![my error](https://i.stack.imgur.com/TDpeb.png) Here is my code: ``` #import <UIKit/UIKit.h> @interface FirstViewController : UIViewController { //Rocket Timer int totalSeconds; bool timerActive; NSTimer *rocketTimer; IBOutlet UILabel *rocketCount; int newTotalSeconds; int totalRocketSeconds; int minutes; int seconds; } - (IBAction)Start; @end ``` and my .m ``` #import "FirstViewController.h" @implementation FirstViewController - (NSString *)timeFormatted:(int)newTotalSeconds { int seconds = totalSeconds % 60; int minutes = (totalSeconds / 60) % 60; return [NSString stringWithFormat:@"%i:%02d"], minutes, seconds; } -(IBAction)Start { newTotalSeconds = 178; //for 2:58 newTotalSeconds = newTotalSeconds-1; rocketCount.text = [self timeFormatted:newTotalSeconds]; if(timerActive == NO){ timerActive = YES; newTotalSeconds = 178; [rocketTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(timerLoop) userInfo:nil repeats:YES]; } else{ timerActive = NO; [rocketTimer invalidate]; rocketTimer = nil; } } -(void)timerLoop:(id)sender { totalSeconds = totalSeconds-1; rocketCount.text = [self timeFormatted:totalSeconds]; } - (void)dealloc { [super dealloc]; [rocketTimer release]; } - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. timerActive = NO; } - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortrait); } @end ```
Countdown timer using NSTimer in "0:00" format
CC BY-SA 2.5
null
2011-03-18T00:10:15.327
2011-03-21T08:17:24.723
2011-03-21T08:17:24.723
-1
665,293
[ "objective-c", "cocoa-touch", "nstimer", "countdown" ]
5,347,043
1
5,347,123
null
1
1,104
I am building a navigation bar that has a tiny arrow on the active tab (see attached picture) DESIRED LOOK ![navigation bar](https://i.stack.imgur.com/3Gi1L.jpg) CURRENT LOOK ![navbar 2](https://i.stack.imgur.com/QPNiD.png) The navigation bar is dynamically created based on my wordpress pages. The problem I am having is centering the little arrow on the active tab. Currently, I am using jquery to place span tags after the current/active link. ``` $('li.current-menu-item a').after('<span></span>'); ``` and my css is as follows: ``` #menu-nav{float:right; clear:right; margin-top:30px;font-family:'Arvo'} #menu-nav li{margin: 0 10px; float:left; } #menu-nav a{color:#9c9c98;padding:6px 9px; font-size:17px; background:#e4e4e0; text-decoration:none;} #menu-nav li.current-menu-item{position:relative;} #menu-nav li.current-menu-item a{background: #41618c; color:#f4f4f3;} #menu-nav span{ width:20px; height:11px; float:left;clear:left; background:url(images/active.png) no-repeat; position:absolute; top:27px; left:0; } ``` The problem I am having is again, getting the arrow to be centered on each tab. Currently, the span has a positoion of left:0. Typically, I would give it a value of 50% and set a negative margin-left of half the parent's width; however, the parent's widths keep changing (because each tab has different text. SO, I need a jquery solution that will center the arrow based on it's parents width. I hope that makes sense!
.Centering absolutely positioned div based on parent's width (Jquery)
CC BY-SA 2.5
null
2011-03-18T01:15:29.150
2011-03-18T03:42:03.727
null
null
121,630
[ "jquery", "css", "css-position", "centering" ]
5,347,078
1
null
null
12
4,167
I'm trying to create an Android app that uses a webview to allow users to enter their username/password, but on tapping the input boxes they get doubled (see the picture below). I'm using the iScroll jQuery plugin to allow users to scroll the page up when the keyboard comes up and blocks the input area. Here is the layout/css: CSS: ``` #scroller{ position:absolute; overflow:hidden; top: 0; bottom: 0; left: 0; right: 0; z-index:0; } #scroll_content { margin-top: 70px;/*must match the topbar height*/ padding-bottom:70px; } ``` html: ``` ... <div id="scroller"> <div id="scroll_content"> <!-- page content here --> </div> </div> ... ``` I do notice that no matter what webpage I view on the Android platform, it overlays an extra input box over the input I just tapped. The key, I guess, would be to disable the webview's default in this case? How do you do that, or can you even? Thanks ![Doubled Input](https://i.stack.imgur.com/fIvV9.png)
Android--Webview, Input boxes doubled?
CC BY-SA 2.5
0
2011-03-18T01:23:32.363
2012-09-20T07:28:32.447
null
null
272,302
[ "javascript", "android", "html", "webview", "cordova" ]
5,347,426
1
5,347,650
null
1
388
I'm currently developing an automate system which require ExtendedWebBrowser control. I have found many sample code that using ExtendedWebBrowser. But now i want to develop it by myself. I don't know how to add in ExtendedWebBrowser control as the picture below. Anyone know about it? ![enter image description here](https://i.stack.imgur.com/VTr7a.png)
How to add in ExtendedWebBrowser into toolbox?
CC BY-SA 2.5
null
2011-03-18T02:30:32.383
2011-03-18T03:11:37.893
2011-03-18T03:05:28.230
500,529
500,529
[ "c#", "webforms" ]
5,347,483
1
39,173,311
null
4
5,709
I need a line chart control for Windows Forms that allows me to specify a color for each segment. For example, something like the stock chart shown below. The problem with rolling my own is that if I draw each segment separately, I don't get the benefit of LineJoins such as Miter, Round, or Bevel. If I use [Graphics.DrawLines](http://msdn.microsoft.com/en-us/library/system.drawing.graphics.drawlines.aspx) to get the nice joins, I can't control the segment colors individually. Is there a workaround, or better yet a commercially available chart control that has this kind of flexibility? ![line chart](https://i.stack.imgur.com/phKoS.png)
Is there a WinForms line chart control that can individually color segments?
CC BY-SA 2.5
0
2011-03-18T02:39:48.953
2016-08-26T19:15:42.167
null
null
8,677
[ "c#", "winforms", "charts" ]
5,348,047
1
5,397,284
null
0
814
I'm trying to display "Announcement" list using CQW but there is a bullet coming in front of every document. I've tried finding using "IE developer tool" but don't see any `<li>` tags.How to remove this ? ![enter image description here](https://i.stack.imgur.com/WVOI7.png)
SharePoint Content Query Web Part question
CC BY-SA 2.5
null
2011-03-18T04:21:47.190
2011-03-22T20:16:18.093
null
null
263,357
[ "sharepoint-2010" ]
5,348,485
1
5,396,082
null
3
2,645
I have a categories table which is set up to allow an infinite number of sub category levels. I would like to mimic the following: ![enter image description here](https://i.stack.imgur.com/5h7Rb.png) It should be clarified that sub categories can have sub categories. E.g. Parent cat -> level 1 -> level 2 -> level 3 etc. My categories table has two columns, `CategoryName` and `ParentID`. This list box will be used when assigning the correct category to a product. How can I write this? In response to `thedugas` I had to modify your answer to work with my situation. I found some errors that needed to be fixed, but below is a final, working solution. ``` protected void Page_Load(object sender, EventArgs e) { using (DataClasses1DataContext db = new DataClasses1DataContext()) { var c = db.Categories.Select(x => x); List<Category> categories = new List<Category>(); foreach (var n in c) { categories.Add(new Category() { categoryID = n.categoryID, title = n.title, parentID = n.parentID, isVisible = n.isVisible }); } List<string> xx = new List<string>(); foreach (Category cat in categories) { BuildCatString(string.Empty, cat, categories, xx); } ListBox1.DataSource = xx; ListBox1.DataBind(); } } private void BuildCatString(string prefix, Category cat, IEnumerable<Category> categories, List<string> xx) { if (cat.parentID == 0) { xx.Add(cat.title); prefix = cat.title; } var children = categories.Where(x => x.parentID == cat.categoryID); if (children.Count() == 0) { return; } foreach (Category child in children) { if(prefix.Any()) { xx.Add(prefix + "/" + child.title); BuildCatString(prefix + "/" + child.title, child, categories, xx); } } } ``` Here is the almost finished work: ![enter image description here](https://i.stack.imgur.com/EpmqL.png)
How can I populate a list box with many categories using recursive programming
CC BY-SA 2.5
0
2011-03-18T05:37:11.677
2011-03-24T16:25:35.390
2011-03-24T16:25:35.390
445,303
445,303
[ "c#", "asp.net", "linq-to-sql", "recursion" ]
5,348,552
1
5,348,582
null
0
152
I just started a new project in XCode and now what I got is this: ![enter image description here](https://i.stack.imgur.com/8wUcO.png) How do I fix this?
linker error in XCode
CC BY-SA 2.5
null
2011-03-18T05:48:14.037
2011-03-18T06:02:25.587
null
null
95,265
[ "iphone", "objective-c", "xcode" ]
5,348,546
1
5,348,865
null
0
471
I have a table structure that uses a link table to relate Jobs to People, the link table contains data information for how long a person was at a particular job. ![Schema section EER Diagram](https://i.stack.imgur.com/S47nn.jpg) I have a simple rails application that is trying to get all jobs and display the job's employment date ranges. ``` class Employment < ActiveRecord::Base belongs_to :person belongs_to :job end class Job < ActiveRecord::Base belongs_to :employer has_many :employment accepts_nested_attributes_for :employment end def index @jobs = Job.joins(:employment).find(:all) end ``` Now when i try to access properties 'employment_started'/ended I get a 'NoMethodError in Experience#index' ``` undefined method `employment_started' for #<Class:0x000000026927e0> 17: <span><%=job.employment.employment_started%> - <%=job.employment.to_yaml%> ``` When I use the 'to_yaml' function I can see there is data in the object: ``` !ruby/object:Employment attributes: job_id: 1 person_id: 1 employment_started: 2008-04-21 employment_ended: attributes_cache: {} changed_attributes: {} destroyed: false marked_for_destruction: false new_record: false previously_changed: {} readonly: false ``` Why can't rails access this 3'rd level attribute?
Activerecord using a Link table with additional information
CC BY-SA 2.5
null
2011-03-18T05:47:28.123
2011-03-18T08:56:24.200
null
null
89,183
[ "ruby-on-rails", "ruby-on-rails-3", "activerecord", "associations" ]
5,348,574
1
null
null
0
1,109
I am using XtraGrid in my app. I want to group some cells togethere and replace them with group name. Following is the description. ![](https://i.stack.imgur.com/Tlnn6.jpg) I above image I have selected few cells from First columns. Now, from context menu when I will click on "Group", I will popup up a dialog for group name. Now here onwards the problem is. 1. I want to replace the cell containts logically with the group name. So in grid, for first column's selected cells, but while viweing it should appear as single cell. I have tried the cell merging feature of the xtragrid but that disbales the row selection feature. How to do this? 2. The grid shown above is bounded grid, so if I tried to do grouping for lets say Integer type of column, then how can I replace the group name which is string in integer column? is this possible in grid? 3. Can I add the unbounded column in bounded grid? Please help. Thanks, Omky
XtraGrid Cell Grouping
CC BY-SA 2.5
0
2011-03-18T05:51:09.627
2015-05-20T15:09:29.557
2011-03-18T13:23:15.687
3,416
408,941
[ "c#", ".net", "devexpress", "xtragrid" ]
5,348,739
1
5,348,768
null
0
1,235
For example in my code I want to override (for a image) and (to set a max-width). But this affects my grids. So I need to set the ui stuff programmatically ``` .ui-dialog { width: 650px !important; } #tabs .ui-widget-header { background-image: url('images/menu_bg_right.png'); background-repeat: no-repeat; /*-- begin IE 7 --7% to left, 30% to 100%;55px to 50px*/ background-position: left 100%; height: 50px; /*-- end IE 7 --*/ background-color: Transparent; border: none; width: 610px; float: left; } ``` Picture of the grid(Actual): ![enter image description here](https://i.stack.imgur.com/LDmlX.jpg) Picture of the grid(Expected): ![enter image description here](https://i.stack.imgur.com/IALbK.jpg) Thanks
How to override specific jquery classes?
CC BY-SA 2.5
null
2011-03-18T06:21:03.817
2011-03-18T06:26:14.490
null
null
350,648
[ "jquery", "jquery-ui" ]
5,348,749
1
null
null
0
330
I have just started using WPF and I am trying to design an application for logging hours for my volunteering group. Anyhow I am trying to make my buttons look like the calculator for Windows 7 buttons since that application is also designed in WPF and it would also impress the whole group. I have gotten them to look like the buttons from Calculator (I have styles that look like the function and the digit buttons) but I can't get them to behave in the same way (a picture of the normal, the MouseOver and the click are attached at the end). I have my .xaml structured in the following way, I have `baseStyleButton` and `baseStyleButtonMouseOver` (I need help with defining this style too) defined in app.xaml and then I want to design `styleButtonUniversal` that "encapsulates" the two base styles and switches between them when the `MouseOver` event occurs. Similarly, I want to be able to extend this style to have a `click` event style too. How do I achieve this in WPF or is there some other way that I can design my buttons that they both look cool and they are easy for a WPF beginner? Also if anyone has any tips on how to achieve the MouseOver look of the calculator button, that would also be greatly appreciated. ![](https://i.stack.imgur.com/tDhTJ.png)
Changing the style of a button to a different style through a mouseover in WPF
CC BY-SA 2.5
null
2011-03-18T06:22:15.140
2011-03-18T06:30:19.303
2011-03-18T06:28:45.003
572,644
661,198
[ "c#", ".net-4.0", "wpf-controls" ]
5,349,074
1
null
null
1
169
This is my code to new a google map after sliding to the div that displaying the map: ``` !self.map && (self.map = new google.maps.Map(self.$map[0], { center : self.location, zoom : 15, streetViewControl:false, scrollwheel:false, mapTypeId: google.maps.MapTypeId.ROADMAP })); ``` The base 2D tiles is transparent in IE8 ![IE8](https://i.stack.imgur.com/UWN2q.jpg) but not in FF, Safari and Chrome ![Safari](https://i.stack.imgur.com/2Geu2.jpg)
Google Map Base Layer can't display in IE
CC BY-SA 2.5
null
2011-03-18T07:11:51.997
2011-03-18T07:46:54.490
2011-03-18T07:46:54.490
17,343
492,338
[ "google-maps" ]
5,349,125
1
5,349,195
null
6
1,374
How can I make my custom visual control to appear on delphi splash screen? Like this: ![](https://i.stack.imgur.com/DjtTK.jpg)
Custom component on delphi loading screen
CC BY-SA 2.5
0
2011-03-18T07:19:47.737
2014-05-31T19:39:32.897
null
null
644,511
[ "delphi", "delphi-2010" ]
5,349,307
1
5,659,520
null
0
1,277
I'm using core plot in an application and from past one week I am trying to show labels on x-axis and y-axis. But haven't succeed yet. I'm posting my code here with screen shot. If someone knows any solution to fix the problem let me know urgently. Code - ``` -(void)viewDidLoad { [super viewDidLoad]; // Initialize all graph dependent data. //self.dataForPlot = [[NSMutableArray alloc] initWithCapacity:0]; minYValues = [[NSMutableArray alloc] initWithCapacity:0]; maxYValues = [[NSMutableArray alloc] initWithCapacity:0]; [self createGraph]; [self customizeGraph]; } - (void) createGraph{ // Create graph graph = [[CPXYGraph alloc] initWithFrame:CGRectZero]; CPGraphHostingView *hostingView = (CPGraphHostingView *)self.view; hostingView.collapsesLayers = YES; hostingView.hostedGraph = graph; hostingView.frame = self.view.frame; //Create a blue plot area CPScatterPlot *boundLinePlot = [[[CPScatterPlot alloc] init] autorelease]; boundLinePlot.dataLineStyle.miterLimit = 1.0f; boundLinePlot.dataLineStyle.lineWidth = 1.0f; UIColor* color = [UIColor orangeColor]; boundLinePlot.dataLineStyle.lineColor = [CPColor colorWithCGColor:[color CGColor]]; boundLinePlot.dataSource = self; [graph addPlot:boundLinePlot]; } - (void) customizeGraph{ if(graph) { graph.paddingLeft = 20.0; graph.paddingTop = 20.0; graph.paddingRight = 20.0; graph.paddingBottom = 20.0; CPScatterPlot *goalWeightPlot = [[[CPScatterPlot alloc] init] autorelease]; goalWeightPlot.identifier = kGoalWeightPlot; //boundLinePlot.dataLineStyle.miterLimit = 5.0f; goalWeightPlot.dataLineStyle.lineWidth = 1.0f; goalWeightPlot.dataLineStyle.lineColor = [CPColor redColor]; goalWeightPlot.dataLineStyle.dashPattern = [NSArray arrayWithObjects:[NSNumber numberWithFloat:5.0],[NSNumber numberWithFloat:2.0],nil]; goalWeightPlot.dataSource = self; [graph addPlot:goalWeightPlot]; // Create a blue plot area CPScatterPlot *boundLinePlot = [[[CPScatterPlot alloc] init] autorelease]; boundLinePlot.identifier = kActualWeightPlot; //boundLinePlot.dataLineStyle.miterLimit = 5.0f; boundLinePlot.dataLineStyle.lineWidth = 1.0f; boundLinePlot.dataLineStyle.lineColor = [CPColor orangeColor]; boundLinePlot.dataSource = self; // Add plot symbols CPLineStyle *symbolLineStyle = [CPLineStyle lineStyle]; symbolLineStyle.lineColor = [CPColor orangeColor]; CPPlotSymbol *plotSymbol = [CPPlotSymbol ellipsePlotSymbol]; plotSymbol.fill = [CPFill fillWithColor:[CPColor orangeColor]]; plotSymbol.lineStyle = symbolLineStyle; plotSymbol.size = CGSizeMake(5.0, 5.0); boundLinePlot.plotSymbol = plotSymbol; [graph addPlot:boundLinePlot]; } } - (void) resetData{ dataForPlot = nil; } - (void) setGraphData:(NSArray*)graphData andRefrenceValue:(float)goalValue{ self.refereceValue = goalValue; [self setGraphData:graphData]; } - (void) setGraphData:(NSArray*)graphData{ //Check if we have any single weight entry in the array if(graphData && [graphData count] > 0) { [self prepareGraphData:graphData]; [self setRangeForGraph]; [graph reloadData]; } } - (NSArray *)sortedWeightEntriesByWeightDate:(NSArray *)unsortedArray { NSMutableArray *tempArray = [NSMutableArray array]; for(int i=0;i<[unsortedArray count];i++) { NSDateFormatter *df = [[NSDateFormatter alloc]init]; WeightEntry *entry = [unsortedArray objectAtIndex:i]; [df setDateFormat:@"yyyy-MM-dd"]; NSDate *date = [df dateFromString:entry.weightDate]; NSMutableDictionary *dict = [NSMutableDictionary dictionary]; if(date) { [dict setObject:entry forKey:@"entity"]; [dict setObject:date forKey:@"date"]; [tempArray addObject:dict]; } [df release]; } NSInteger counter = [tempArray count]; NSDate *compareDate; NSInteger index; for(int i = 0 ; i < counter; i++) { index = i; compareDate = [[tempArray objectAtIndex:i] valueForKey:@"date"]; NSDate *compareDateSecond; for(int j = i+1 ; j < counter; j++) { compareDateSecond=[[tempArray objectAtIndex:j] valueForKey:@"date"]; NSComparisonResult result = [compareDate compare:compareDateSecond]; if(result == NSOrderedDescending) { compareDate = compareDateSecond; index=j; } } if(i!=index) [tempArray exchangeObjectAtIndex:i withObjectAtIndex:index]; } NSMutableArray *sortedArray = [NSMutableArray arrayWithCapacity:0]; NSInteger counterIndex = [tempArray count]; for(int i = 0; i < counterIndex ; i++) { [sortedArray addObject:[[tempArray objectAtIndex:i] valueForKey:@"entity"]]; } return [NSArray arrayWithArray:sortedArray]; } - (void) prepareGraphData:(NSArray*)data{ data = [self sortedWeightEntriesByWeightDate:data]; NSNumber* minYValue = nil; NSNumber* maxYValue = nil; NSMutableArray *contentArray = [NSMutableArray arrayWithCapacity:[data count]]; NSUInteger i; for ( i = 0; i < [data count]; i++ ) { WeightEntry* weightEntry = [data objectAtIndex:i]; if(i == 0){ maxYValue = [NSNumber numberWithFloat:weightEntry.weight]; minYValue = [NSNumber numberWithFloat:weightEntry.weight]; } //id x = [NSNumber numberWithFloat:weightEntry.weight]; //id y = [NSNumber numberWithFloat:1.2*rand()/(float)RAND_MAX + 1.2]; id x = [NSNumber numberWithFloat:i]; id y = [NSNumber numberWithFloat:weightEntry.weight]; if([y floatValue] > [maxYValue floatValue]) maxYValue = y; if([y floatValue] < [minYValue floatValue]) minYValue = y; //[contentArray addObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:x, @"x", y, @"y",[NSNumber numberWithFloat:goalWeight],@"goalY",nil]]; [contentArray addObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:x, @"x", y, @"y",nil]]; } self.dataForPlot = [NSArray arrayWithArray:contentArray]; [minYValues addObject:minYValue]; [maxYValues addObject:maxYValue]; lblHighValue.text = [NSString stringWithFormat:@"High = %0.2f", [maxYValue floatValue]]; lblLowValue.text = [NSString stringWithFormat:@"Low = %0.2f", [minYValue floatValue]]; lblRefrenceValue.text = [NSString stringWithFormat:@"Goal = %0.2f", self.refereceValue]; } // Update the Plot Space Range to cover all graphs - (void) setRangeForGraph{ NSNumber* minimumYValue; NSNumber* maxmumYValue; if([minYValues count] > 0 && [maxYValues count] > 0){ minimumYValue = [minYValues objectAtIndex:0]; maxmumYValue = [maxYValues objectAtIndex:0]; // Calculate minimum y value among all graphs. for (int i = 0 ; i < [minYValues count] ; i++) { if([[minYValues objectAtIndex:i] floatValue] < [minimumYValue floatValue]) minimumYValue = [minYValues objectAtIndex:i]; } // Calculate maximum y value among all graphs. for (int i = 0 ; i < [maxYValues count] ; i++) { if([[maxYValues objectAtIndex:i] floatValue] > [maxmumYValue floatValue]) maxmumYValue = [maxYValues objectAtIndex:i]; } NSDecimalNumber *high = [NSDecimalNumber decimalNumberWithDecimal:[maxmumYValue decimalValue]]; high = [high decimalNumberByAdding:[NSDecimalNumber decimalNumberWithString:@"30"]]; // Modify the y range for plot space to cover all values. CPXYPlotSpace *plotSpace = (CPXYPlotSpace *)graph.defaultPlotSpace; plotSpace.yRange = [CPPlotRange plotRangeWithLocation:CPDecimalFromFloat(0.0) length:[high decimalValue]]; plotSpace.xRange = [CPPlotRange plotRangeWithLocation:CPDecimalFromFloat(0.0) length:CPDecimalFromInt([self.dataForPlot count])]; CPPlotAreaFrame *area = (CPPlotAreaFrame *)graph.plotAreaFrame; area.paddingLeft = 20; area.paddingBottom = 10; CPXYAxisSet *axisSet = (CPXYAxisSet*)graph.axisSet; //axis.paddingLeft = 20.0; axisSet.xAxis.paddingBottom = 50.0; CPXYAxis *x = axisSet.xAxis; x.majorIntervalLength = CPDecimalFromInteger([self.dataForPlot count]); CPXYAxis *y = axisSet.yAxis; y.majorIntervalLength = CPDecimalFromFloat([high floatValue]); axisSet.xAxis.orthogonalCoordinateDecimal = CPDecimalFromFloat([minimumYValue floatValue]); //axisSet.xAxis.labelOffset = 0.0; CPLineStyle *lineStyle = [CPLineStyle lineStyle]; lineStyle.lineColor = [CPColor colorWithCGColor:((UIColor*)kProtienColor).CGColor]; lineStyle.lineWidth = 1.0f; // style the graph with white text and lines CPTextStyle *whiteText = [CPTextStyle textStyle]; whiteText.color = [CPColor redColor]; //CPXYAxis *x = axisSet.xAxis; x.majorIntervalLength = CPDecimalFromString(@"1"); x.axisLineStyle = lineStyle; //x.majorGridLineStyle=lineStyle; //x.minorTicksPerInterval = 0; //x.minorTickLineStyle = lineStyle; x.title = @"Weight"; x.titleOffset = 3.0f; x.titleLocation = CPDecimalFromFloat(3.0f); x.titleTextStyle = whiteText; x.labelTextStyle = whiteText; //y.majorIntervalLength = CPDecimalFromString(@"150"); //y.minorTicksPerInterval = 10; y.axisLineStyle = lineStyle; y.title = @"Date"; y.titleTextStyle = whiteText; y.titleOffset = 0; y.minorTickLineStyle = lineStyle; //y.titleLocation = CPDecimalFromFloat(graph.frame.origin.y+10); //y.majorGridLineStyle=lineStyle; //y.labelTextStyle=whiteText; } } - (NSUInteger)numberOfRecordsForPlot:(CPPlot *)plot { int nofOfRecords = 0; @try { nofOfRecords = [self.dataForPlot count]; } @catch (NSException * e) { NSLog(@"Exception while calculating graph index : %@", [e description]); } @finally { //NSLog(@"Number of Records : %d For Graph Index : %d", nofOfRecords, graphIndex); return nofOfRecords; } } - (NSNumber *)numberForPlot:(CPPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { NSNumber *num = 0; //int plotIndex = [(NSString *)plot.identifier intValue]; if([self.dataForPlot count] > 0){ if(![((NSString*)[plot identifier]) isEqualToString:kGoalWeightPlot]){ num = [[dataForPlot objectAtIndex:index] valueForKey:(fieldEnum == CPScatterPlotFieldX ? @"x" : @"y")]; }else { if(fieldEnum == CPScatterPlotFieldX) num = [[dataForPlot objectAtIndex:index] valueForKey:@"x"]; else { num = [NSNumber numberWithFloat:self.refereceValue]; } } } return num; } ``` Screenshot - ![My Graph](https://i.stack.imgur.com/NKpQn.png) I want to show custom labels on x-axis and default labels on y-axis. EDIT: I've tried adding sample class of barChart+XIB from CPTest-iPhoneApp. The bar chart appears but axis label's don't. Here is the screenshot form CPTest-iPhone app and mine. ![CPTest-iPhoneApp](https://i.stack.imgur.com/9UVnX.png) ![mine](https://i.stack.imgur.com/iePN7.png)
unable to show anything on x-axis and y-axis labels in core-plot
CC BY-SA 2.5
null
2011-03-18T07:45:47.487
2011-04-14T06:42:22.360
2011-03-21T05:19:55.007
83,905
83,905
[ "iphone-sdk-3.0", "core-plot" ]
5,349,503
1
5,349,515
null
0
796
![Screenshot](https://i.stack.imgur.com/3Jymf.png) As you can see ,I use windows command line running one line: ``` import httplib2 ``` There is no error. But when using Eclipse and PyDev, I got an error! And the version of Python is same. I did have two versions of python, 2.7.1 and 3.1.3, and my system path points to 2.7.1. Who can explain this to me? Thanks.
Why does importing httplib2 work on the command line, but not in Eclipse with PyDev?
CC BY-SA 2.5
null
2011-03-18T08:15:49.133
2011-03-18T08:19:53.420
2011-03-18T08:19:53.420
40,342
401,441
[ "python", "python-3.x" ]
5,349,642
1
5,354,823
null
1
8,518
I would like to show my own icon instead of the Java cup in the window. ![screenshot of JFrame](https://i.stack.imgur.com/BjYRe.png) Also when minimized, I would like to display, my own image. How will I be able to do so? And where should I position my image relative to the source file? I tried but no luck ``` TrayIcon trayIcon = new TrayIcon(Toolkit.getDefaultToolkit().createImage("image/accounting.gif")); //setIconImage(); SystemTray tray = SystemTray.getSystemTray(); try { tray.add(trayIcon); } catch (AWTException e) { System.out.println("TrayIcon could not be added."); } ``` Also i tried ``` TrayIcon trayIcon = new TrayIcon(createImage("images/bulb.gif", "tray icon")); ``` But seriously doubt `createImage(` and even if it is Object don't know what to import. Regards,
how to set icon for JFrame window and tray
CC BY-SA 2.5
0
2011-03-18T08:36:30.053
2016-09-30T04:52:15.350
2011-03-18T10:49:31.480
447,023
447,023
[ "java", "swing" ]
5,349,671
1
5,353,989
null
10
5,632
The following app.yaml works great on my local dev server.. but when I deploy it to production all static files throw 404. Server isn't able to locate any static files. Have been searching for hours couldn't find a valid solution. Note: I am developing with mac, so aware of the case sensitive nature of the system. ``` application: dev-scanner version: 1 runtime: python api_version: 1 handlers: - url: /(.+) static_files: static_files/\1 upload: ./static_files/(.+) - url: / static_files: static_files/index.html upload: ./static_files/index.html ``` Here is the error from the log > 2011-03-18 01:18:07.033 / 404 21ms 0cpu_ms 0kb Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16,gzip(gfe),gzip(gfe),gzip(gfe) 76.126.174.202 - - [18/Mar/2011:01:18:07 -0700] "GET / HTTP/1.1" 404 0 - "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16,gzip(gfe),gzip(gfe),gzip(gfe)" "dev.app-scanner.com" ms=21 cpu_ms=0 api_cpu_ms=0 cpm_usd=0.000053 W 2011-03-18 01:18:07.012 Static file referenced by handler not found: static_files/index.html Here is the file system structure after I use `appcfg.py download_app -A` ![enter image description here](https://i.stack.imgur.com/7eh17.png)
Google App Engine Static Files GET 404
CC BY-SA 2.5
0
2011-03-18T08:40:16.587
2011-03-18T15:15:00.983
null
null
115,278
[ "python", "google-app-engine", "http-status-code-404" ]
5,349,712
1
5,350,515
null
1
1,622
## Solved (see comments) --- The title says everything... I thought I can write RE (have done really complicated ones in Java or on the paper). Now I cannot write this simple one that I need to validate user names in ASP.NET MVC model attribute. I would say that `"\\.*\\w\\.*"` should work according to resources that I've found. But it does not... --- Here is what I have in my model code: ![enter image description here](https://i.stack.imgur.com/6CmsG.png) --- Here is the walidation taking place: ![enter image description here](https://i.stack.imgur.com/RtKxb.png) As you can see string `a12` does not match but it should...
Regular expression for C# that matches all strings that has one or more word characters
CC BY-SA 2.5
0
2011-03-18T08:44:34.677
2011-03-18T12:12:15.767
2011-03-18T12:12:15.767
311,865
311,865
[ "c#", "asp.net", "regex" ]
5,349,681
1
null
null
0
474
I have five tables which is needed to recieve the correct information to a advanced custom menu in a Wordpress project These are the five tables and the columns I need ``` wp_term_taxonomy - Need: term_id, taxonomy WHERE: taxonomy="nav_menu" wp_terms - Need: term_id, name WHERE: term_id matches wp_term_taxonomy.term_id wp_term_relationships - Need: object_id, term_taxonomy_id WHERE: term_taxonomy_id matches wp_term_taxonomy.term_id wp_postmeta - Need: post_id, meta_key, meta_value WHERE: post_id matches wp_term_relationships.object_id AND meta_key="_menu_item_object_id" wp_posts - Need: id, post_title, post_status, guid, post_parent, post_type WHERE: id matches wp_postmeta.meta_value But that is not it I then need to: wp_posts - Need: guid, post_parent, post_type WHERE: post_parent matches wp_posts.id AND post_type="attachment" wp_postmeta - Need: post_id, meta_key, meta_value WHERE: post_id matches wp_posts.id AND meta_key="description" ``` I hope this makes just a little sense. What i'm trying to do is basicly, to create a drop down menu that contains the list of pages in the WordPress custom menu feature, take each page's featured image, and their Custom field Description where I have a little text to display. The final menu looks like this with styling: ![](https://i.stack.imgur.com/s6iQS.png) So far I have had a succes making the menu work, but not with a very nice type of code: ``` <ul> <?php $getMenus = mysql_query('SELECT term_id, taxonomy FROM wp_term_taxonomy WHERE taxonomy="nav_menu"'); while ($addMenus = mysql_fetch_assoc($getMenus)) { $menus_id = $addMenus['term_id']; ?> <?php $getTerms = mysql_query('SELECT term_id, name FROM wp_terms WHERE term_id='.$menus_id.''); while ($addTerms = mysql_fetch_assoc($getTerms)) { ?> <li> <span class="menu-sub-headline"><?php echo $addTerms['name']; ?></span> <ul> <?php $getTermsRelationship = mysql_query('SELECT object_id, term_taxonomy_id FROM wp_term_relationships WHERE term_taxonomy_id='.$menus_id.''); while ($addTermsRelationship = mysql_fetch_assoc($getTermsRelationship)) { $termsRelationship = $addTermsRelationship['object_id']; $getMetaRelationship = mysql_query('SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id='.$termsRelationship.' and meta_key="_menu_item_object_id"'); while ($addMetaRelationship = mysql_fetch_assoc($getMetaRelationship)) { $metaKeyValue = $addMetaRelationship['meta_value']; ?> <?php $result = mysql_query('SELECT id, post_title, post_status, guid, post_parent FROM wp_posts WHERE id='.$metaKeyValue.''); while ($row = mysql_fetch_assoc($result)) { ?> <li> <span><a href="<?php echo $row['guid']; ?>"><?php echo $row['post_title']; ?></a></span> <?php $thumb = $row['id']; ?> <ul class="menu-sub-sub-item-ul"> <li> <span class="menu-product-headline"><?php echo $row['post_title']; ?></span> <?php $getThumb = mysql_query('SELECT guid, post_parent, post_type FROM wp_posts WHERE post_parent='.$thumb.' AND post_type="attachment"'); while ($addThumb = mysql_fetch_assoc($getThumb)) { ?> <img src="<?php echo $addThumb['guid']; ?>"/> <? } ?> <?php $getMeta = mysql_query('SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id='.$thumb.' AND meta_key="description"'); while ($addMeta = mysql_fetch_assoc($getMeta)) { ?> <p><?php echo $addMeta['meta_value']; ?></p> <a href="<?php echo $row['guid']; ?>"><img src="/wp-content/themes/mygind-co/images/design/read_more.png"/></a> <?php } ?> </li> </ul> <?php }}} ?> </ul> </li> <? } ?> <?php } ?> </ul> ``` Hopefully, some of you can help me achieve the same result, but with a better query and maybe even explain me how to use joins properly. I'm quite new to SQL, which is the reason for my very limited knowledge. I have prior to this read the instructions of joins, and made an attempt myself, but it just seems like this menu is a bit too hard to do trial and error on for me.
Join 5 tables PHP SQL
CC BY-SA 3.0
null
2011-03-18T08:40:53.277
2016-12-18T23:07:38.803
2016-12-18T23:07:38.803
4,370,109
665,732
[ "php", "sql", "wordpress", "multiple-tables" ]
5,349,907
1
5,353,019
null
5
5,960
i don't want to use the scale as classic zoom, instead i want to change the form of quadrates to a rectangle for example. After a lot of trying i'm that far that my fingers are the corners of the rectangle. So but if i start a new pinch gesture inside my view gets smaller to my fingers instead of getting bigger like the normal scale does. ``` if ([gestureRecognizer numberOfTouches] >1) { //getting width and height between gestureCenter and one of my finger float x = [gestureRecognizer locationInView:self].x - [gestureRecognizer locationOfTouch:0 inView:self].x; if (x<0) { x *= -1; } float y = [gestureRecognizer locationInView:self].y - [gestureRecognizer locationOfTouch:0 inView:self].y; if (y<0) { y *= -1; } //double size cause x and y is just the way from the middle to my finger float width = x*2; if (width < 1) { width = 1; } float height = y*2; if (height < 1) { height = 1; } self.bounds = CGRectMake(self.bounds.origin.x , self.bounds.origin.y , width, height); [gestureRecognizer setScale:1]; [[self layer] setBorderWidth:2.f]; } ``` does anyone know a way to make a X-Y-Scale which don't resize to my fingers position as corners. ![Example](https://i.stack.imgur.com/wT4XF.png) Thank you very much
UIPinchGestureRecognizer Scale view in different x and y directions
CC BY-SA 2.5
0
2011-03-18T09:04:51.727
2014-04-25T06:16:08.697
2011-03-18T10:41:39.413
626,639
626,639
[ "iphone", "objective-c", "scale", "pinch" ]
5,349,920
1
5,350,239
null
1
2,980
I'm new to Xcode and Objective C coding, and I already have a little problem. So I have a mainview with a button. When I press the button a table is showing. (the table is another tableViewController) When I press an item on the table, There should be shown another view (on my main window). I know when you try to add a subview you use it like this: ``` [self.view addSubview:thisistheController.view]; ``` But when I use the table, the new view is shown in the table and not on my mainview but on my table. like this: ![enter image description here](https://i.stack.imgur.com/BJDY4.png) When I try this: ``` [MainviewController.view addSubview:thisistheController.view]; ``` i don't get any errors, or warnings. but the view isn't shown on my main window. I also tried to use: ``` [self.parentController.view addSubview:thisistheController.view]; ``` But here I get the same problem.
Xcode problem - add view to parent
CC BY-SA 2.5
null
2011-03-18T09:06:06.857
2011-03-18T11:29:01.903
2011-03-18T11:29:01.903
457,406
665,745
[ "objective-c", "xcode" ]
5,349,969
1
null
null
0
736
I have setup a little example application where the idea is to navigate from one Activity to another and to study Memory consumption because I don't really understand when/where memory is released during this process. Idea is to create an Activity which consume quite a lot of memory to see if memory is released correctly when we leave it before recreating it. - - List of BlogPost is created dynamically in the onCreate method of BlogListActivity and then passed to an Adapter to display each PostBlog object in row of my ListView. On an emulator with Android 2.3.3 and 128Mo of memory, I manage to move from HomeActivity to BlogListActivity and then come back to HomeActivity two times. On the third try, I get an OutOfMemoryError from BitmapFactory. This mean I have a Memory Leak: objects that are not used anymore but still have a reference on it so they are not released. But I don't where I do it wrong. Can someone help me finding it. Thanks in advance for your help. Bertrand [Link to complete source code and Eclipse project](http://dl.dropbox.com/u/92487/WebContentListView.zip) Here is an extract of the code we are interested in HomeActivity source code ``` public class HomeActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_home); } public void onSecondActivityClick(View v) { startActivity(new Intent(this, BlogListActivity.class)); } } ``` BlogListActivity source code ``` public class BlogListActivity extends ListActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_bloglist); List<BlogPost> items = new ArrayList<BlogPost>(); Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.mn); for (int i = 0; i < 5; i++) { BlogPost post = new BlogPost(); post.author = String.format("Author%d", i); post.title = String.format("Title%d", i); post.date = new Date(); post.imageURL = "https://si3.twimg.com/profile_images/1143791319/MN_BLEU.png"; post.image = bmp; post.image = BitmapFactory.decodeResource(getResources(), R.drawable.mn); items.add(post); } setListAdapter(new LazyArrayAdapter(this, R.layout.listitem_blog, items)); } ``` } LazyArrayAdapter source code ``` public class LazyArrayAdapter extends ArrayAdapter<BlogPost> { public LazyArrayAdapter(Context context, int textViewResourceId, List<BlogPost> objects) { super(context, textViewResourceId, objects); } @Override public View getView(int index, View view, ViewGroup parent) { LayoutInflater inflater = LayoutInflater.from(parent.getContext()); if (view == null) { view = inflater.inflate(R.layout.listitem_blog, parent, false); } TextView title = (TextView)view.findViewById(R.id.listitemblog_title); TextView date = (TextView)view.findViewById(R.id.listitemblog_date); ImageView icon = (ImageView)view.findViewById(R.id.listitemblog_icon); BlogPost post = this.getItem(index); title.setText(post.title); date.setText(new SimpleDateFormat().format(post.date)); icon.setImageBitmap(post.image); return view; } } ``` BlogPost source code ``` public class BlogPost { public String title; public String author; public Date date; public String imageURL; public Bitmap image; } ``` activity_bloglist Layout ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ListView android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@android:id/list"> </ListView> </LinearLayout> ``` ListItemBlog Layout ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:weightSum="100" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:layout_width="0px" android:layout_weight="70" android:id="@+id/linearLayout2" android:orientation="vertical" android:layout_height="fill_parent"> <TextView android:id="@+id/listitemblog_title" android:layout_width="wrap_content" android:text="TextView" android:textStyle="bold" android:layout_height="wrap_content"> </TextView> <TextView android:id="@+id/listitemblog_date" android:layout_width="wrap_content" android:text="TextView" android:layout_height="wrap_content" android:textStyle="bold"> </TextView> </LinearLayout> <ImageView android:id="@+id/listitemblog_icon" android:layout_width="0px" android:scaleType="centerInside" android:layout_weight="30" android:src="@drawable/icon" android:layout_height="fill_parent"/> </LinearLayout> ``` HomeActivity layout: ``` <?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"> <Button android:layout_height="wrap_content" android:onClick="onSecondActivityClick" android:layout_width="wrap_content" android:id="@+id/button1" android:text="Button"> </Button> </LinearLayout> ``` I have studied memory usage with DDMS + MAT. Here are screenshots of what I see in MAT for the com.webcontentlistview I create: Memory usage after navigating to BlogListActivity one time ![Memory usage after navigating to BlogListActivity one time](https://i.stack.imgur.com/rtaFk.png) Memory usage after navigatin to BlogListActivity several times ![Memory usage after navigatin to BlogListActivity several times](https://i.stack.imgur.com/QRJQO.png) As we can see, even after navigating between both Activity, we still have only one BlogListActivity object in memory (with it's associated content). But numbers of java and android objects are increasing (lines 2 and 3).
Understanding memory management when navigating inside Activities
CC BY-SA 2.5
null
2011-03-18T09:11:55.160
2011-03-18T10:49:19.823
2011-03-18T10:49:19.823
11,563
11,563
[ "android", "memory-management", "android-activity" ]
5,349,998
1
5,350,021
null
8
65,326
I have trying to write a query in Access 2010. I have a table: ![power](https://i.stack.imgur.com/zbE3F.jpg) Table name is `power`. I have trying to write IF statement: ``` Select IIf(power.gain_type = 'D', power.gain_max + 2.15) ``` > If gain_type equals D, then gain_max sum 2.15 For example: > 14.8 + 2.15 = 16.95. Thanks in advance!
SQL: IF statement Access 2010
CC BY-SA 3.0
0
2011-03-18T09:14:57.343
2014-01-24T11:27:02.523
2014-01-24T11:27:02.523
1,654,121
572,853
[ "sql", "if-statement", "ms-access-2010" ]
5,350,607
1
5,350,838
null
1
2,143
I would like to create an `AlertDialog` similar to this figure. I can't resize the `EditText` view. How do I resize it? ![enter image description here](https://i.stack.imgur.com/ciMTm.png) ``` alert = new AlertDialog.Builder(this); alert.setTitle("Enter Destination"); alert.setIcon(R.drawable.icon); final EditText editAddress = new EditText(this); editAddress.setLayoutParams(new LayoutParams(200, 20)); alert.setView(editAddress); alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int id) { } }); alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int id) { } }); alert.show(); ```
Resize Edit box inside Alert dialog in Android
CC BY-SA 3.0
null
2011-03-18T10:22:08.740
2016-06-29T12:09:49.543
2016-06-29T12:09:49.543
414,345
536,091
[ "android" ]
5,350,841
1
5,351,448
null
0
897
I would like to know how buttons are flipped in the following app: [http://itunes.apple.com/app/brain-cafe-geoquiz/id334815548?mt=8](http://itunes.apple.com/app/brain-cafe-geoquiz/id334815548?mt=8) I am refering to this screen in the app: ![enter image description here](https://i.stack.imgur.com/FGG7t.jpg)
How to flip button in iphone sdk?
CC BY-SA 2.5
null
2011-03-18T10:44:40.680
2011-03-18T11:40:44.520
null
null
480,346
[ "iphone", "objective-c", "cocoa-touch", "ios4", "iphone-sdk-3.0" ]
5,351,070
1
5,351,232
null
0
222
I am creating a simple shopping list application, and with it I am displaying an array of items. ![ArrayOfitems](https://i.stack.imgur.com/f94SG.jpg) How can I display quantity of each item after its name?
How can I add name and quantity in a single row in a table view?
CC BY-SA 2.5
null
2011-03-18T11:08:30.087
2011-03-20T16:50:00.053
2011-03-18T11:20:44.513
283,240
699,226
[ "iphone" ]
5,351,190
1
null
null
2
317
I like to have VS break on any thrown CLR exception so I tick the corresponding box in Debug -> Exceptions. ![Dialog](https://i.stack.imgur.com/rk3ql.png) But a couple of times a day this option seems to get reset to 'disabled' randomly, so I have to go there and check it again. Any ideas?
Visual Studio: "Break when an exception is thrown" option gets reset randomly
CC BY-SA 2.5
0
2011-03-18T11:18:03.253
2013-06-25T03:35:15.263
null
null
122,687
[ "visual-studio-2008", "debugging", "exception" ]
5,351,768
1
5,351,941
null
0
1,811
I've written and tested an app that runs perfectly on Win7 using the [XP Tablet PC SDK 1.7](http://www.microsoft.com/downloads/en/details.aspx?familyid=b46d4b83-a821-40bc-aa85-c9ee3d6e9699&displaylang=en), but am having problems getting this to work on standard XP which a number of our clients use. I guess XP is missing some components that XP tablet edition would have - does anyone know where I can get these components - possibly a runtime distribution of XP Tablet PC SDK or something like that? The occurs when trying to open the form with the ink related components on, the error is: ![enter image description here](https://i.stack.imgur.com/AKTBb.png) ``` Retrieving the COM class factory for component with CLSID {43FB1553-AD74-4EE8-88E4-3E6DAAC915DB} failed due to the following error: 80040154. Error Stack Trace: at Microsoft.Ink.InkCollector..ctor() at Microsoft.Ink.InkCollector..ctor(IntPtr handle) at autoVHC.Uc_SquashedFrog.Init() at autoVHC.frmCheckList..ctor(VHCTOManager VHCTO, TemplateTree t) Error Message: Microsoft.Ink Error to string: System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {43FB1553-AD74-4EE8-88E4-3E6DAAC915DB} failed due to the following error: 80040154. at Microsoft.Ink.InkCollector..ctor() at Microsoft.Ink.InkCollector..ctor(IntPtr handle) at autoVHC.Uc_SquashedFrog.Init() at autoVHC.frmCheckList..ctor(VHCTOManager VHCTO, TemplateTree t) ``` Microsoft.Ink has proven to be a headache, none of the tools in visual studio work for it (which is ok by me as I only used the ink collector) - and even that seems to have some weird quirks to it :( - like random null ref exceptions that don't really cause a problem. go figure. Note: we must use this SDK as our clients use .Net2 and won't upgrade.
How to get a microsoft.ink (XP Tablet PC SDK) app that works on windows 7 to work in winXP (not tablet edition)
CC BY-SA 2.5
null
2011-03-18T12:09:23.683
2014-02-18T22:23:34.367
2014-01-13T04:12:15.583
665,507
198,048
[ "windows-7", "windows-xp", "tablet-pc", "microsoft.ink" ]
5,351,835
1
5,469,487
null
0
2,302
I'm trying to look on on the root of a AD server for users with tomcat5.5 and JNDIRealm, but it seems that there are several referrals to other locations in the whole AD structure and one of the referrals give a `"connection refused"` . With LDAP you can use the option `referrals="ignore"` but this doesn't work if you use AD so you must use `referrals=follow` otherwise you get a `Unprocessed Continuation Reference(s)` exception Is there a way that I can ignore all referrals to other servers? current config in a server.xml file: ``` <Realm className="org.apache.catalina.realm.JNDIRealm" debug="99" connectionName="CN=root_user,OU= foo,OU= bar ,dc=example,dc=com" connectionPassword="hideMe!" connectionURL="ldap://****:389" userBase="DC=example,DC=com" userSearch="(&amp;(objectClass=user)(sAMAccountName={0}))" userSubtree="true" roleBase="OU=rolles,dc=example,dc=com" roleName="CN" roleSearch="(member={0})" roleSubtree="false" /> ``` ![enter image description here](https://i.stack.imgur.com/ai589.png)
Active directory authentication on tomcat by JNDIRealm referrals problem
CC BY-SA 2.5
null
2011-03-18T12:15:56.540
2011-03-29T07:56:24.273
null
null
193,850
[ "authentication", "tomcat", "active-directory", "ldap", "jndi" ]
5,352,193
1
5,352,645
null
1
12,472
I'm having trouble using the layout manager system with Qt. This is going to be a Symbian app, so it should resize to different devices. This is done by using the Layouts. On the image below I used the Vertical Layout, but I don't understand how I can decide how much each cell should take in width and height. I want the blue to be a top label background, but I don't want it to be as high as it is now. Does anyone know how I can do this? (I'm new to Qt :)) ![Qt layout design](https://i.stack.imgur.com/dFSYv.png)
Qt: How do i set the height on a Vertical layout?
CC BY-SA 4.0
null
2011-03-18T12:49:49.713
2021-06-22T02:43:24.623
2021-06-21T23:33:39.210
212,378
24,872
[ "qt", "layout" ]
5,352,274
1
5,352,842
null
0
146
I am working on a project where I create 2 instances of CLLocationManager, my question is that when I look in instrument whilst my code is running is shows 3 instances, is this right, what is creating the 3rd one, or is it just a system thing? ![enter image description here](https://i.stack.imgur.com/4mYzp.png) ![enter image description here](https://i.stack.imgur.com/aJ72H.png)
Extra instance of CLLocationManager?
CC BY-SA 2.5
null
2011-03-18T12:56:54.133
2011-03-18T13:44:18.490
null
null
164,216
[ "iphone", "objective-c", "cocoa-touch" ]
5,352,327
1
5,352,355
null
0
248
I want to create a dynamic 2d array by function but it seems that something is very wrong. It throws me an error when I want to put something in it. Error > Unhandled exception at 0x003a19c8 in p01.exe: 0xC0000005: Access violation writing location 0xcdcdcdcd. CreateDynamicArray() ``` short int** CreateDynamicArray(int row, int col) { // Creating variable short int** dynamicArray; // Creating rows dynamicArray = (short int**)malloc(row * sizeof(short int*)); // Going trough every row and creating columns for them for (int i = 0; i < row; i++) { dynamicArray[row] = (short int*)malloc(col * sizeof(short int)); } // Returning created array return dynamicArray; } ``` main() ``` // Creating it dynamicArray = CreateDynamicArray(row, col); // Filling up with random numbers for (i = 0; i < row; i++) { randomNumber = rand() % 20; dynamicArray[i][n] = randomNumber; // Here it throws me exception for (n = 0; n < col; n++) { randomNumber = rand() % 20; dynamicArray[i][n] = randomNumber; } } ``` ![Image](https://i.stack.imgur.com/DPiVg.png) P.S. Yes, this is somewhat of a homework, but I still need help om this matter :)
Dynamic 2d array is not creating properly
CC BY-SA 2.5
null
2011-03-18T13:01:15.083
2011-03-18T13:04:10.990
null
null
440,611
[ "c", "arrays", "dynamic" ]
5,352,724
1
5,352,826
null
2
343
I am analyzing some .net desktop application. I have found that code: ``` if (System.Environment.ProcessorCount > 1) { Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.High; Process.GetCurrentProcess().ProcessorAffinity = new IntPtr(2); } else { Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.AboveNormal; } Process.GetCurrentProcess().PriorityBoostEnabled = true; ``` I have launched this application on machine that has the multi core (4) processor: ![enter image description here](https://i.stack.imgur.com/JScwW.png) As we can see application loads only the core (see code), but at the same time I cannot do anything on my computer even so 3 cores are in idle. What is happing?? Does it make sense to run application using the particular core? There is other application(2) that can hold the rest processor time. It works with high priority and I cannot change it's setting. So this application should be in competition with that one.
The weird load balancing on a multicore process machine
CC BY-SA 2.5
null
2011-03-18T13:35:14.777
2011-03-18T13:54:51.973
2011-03-18T13:54:51.973
183,600
183,600
[ ".net", "load-balancing", "multicore" ]
5,353,076
1
5,353,314
null
9
21,791
I have a CSS rule for input like this: ``` input { border: 1px solid black; } ``` The problem is that checkboxes in IE (have tested on IE 8 and 9) and Opera also inherit this border and instead of showing the default style they show their custom mode for checkboxes with white background and black checks like this: ![custom checkbox](https://i.stack.imgur.com/WQkSY.png) instead of the native style, like in Windows 7 with gradient-grey background and dark blue checks that are shown in Chrome and Firefox: ![default checkbox](https://i.stack.imgur.com/bWzmU.png) I would like to keep the border for the input-rule in the CSS, but I have a class called "checkbox" that I put on all checkboxes like this: ``` <input type="checkbox" class="checkbox" /> ``` Is there any way to reset the border style with the .checkbox rule? I have tried: ``` .checkbox { border: none; } ``` which works in Opera to revert to the default style, but not in IE. I have also tried many different combinations of: ``` .checkbox { border: 1 none transparent; } ``` but none of these seems to reset to the default style of the checkboxes in IE. Is it possible to revert the default style for checkboxes in IE do without removing the border for the input-rule and instead use the .checkbox class?
Reset input style for checkboxes to default in IE
CC BY-SA 2.5
0
2011-03-18T14:01:50.380
2014-02-20T03:14:12.780
null
null
337,734
[ "css", "internet-explorer", "html", "checkbox" ]
5,353,136
1
null
null
3
7,250
I am using Java 6.0 + Swing + JTable. Normally, JTable renders the header as the first row. (Left image) However, I would like to render the header as the first column. (Right image) I don't think this is a simple flag in JTable. Can you please recommend an approach or existing widget library? I assume I need to override the paint() methods for JTableHeader and JTable. Thanks ![Table with header as first row](https://i.stack.imgur.com/lp19X.jpg) ![Table with header as first column](https://i.stack.imgur.com/Jf5TK.jpg)
How do I create a Java Swing JTable with header as first column, not as first row?
CC BY-SA 2.5
null
2011-03-18T14:06:22.340
2015-03-17T07:01:16.730
null
null
257,299
[ "java", "swing", "header", "jtable", "transpose" ]
5,353,184
1
5,538,551
null
21
15,430
I'm plotting some points on a map of the world using the R `maps` package, something like: ![Map of the world, -180° to 180° longitude](https://i.stack.imgur.com/vmtDo.png) The command to draw the base map is: ``` map("world", fill=TRUE, col="white", bg="gray", ylim=c(-60, 90), mar=c(0,0,0,0)) ``` But I need to display Pacific centred map. I use `map("world2",` etc to use the Pacific centred basemap from the maps package, and convert the coordinates of the data points in my dataframe (`df`) with: ``` df$longitude[df$longitude < 0] = df$longitude[df$longitude < 0] + 360 ``` This works if I don't use the `fill` option, but with `fill` the polygons which cross 0° cause problems. ![Map of the world, 0° to 360° longitude](https://i.stack.imgur.com/H2Goo.png) I guess I need to transform the polygon data from the `maps` library somehow to sort this out, but I have no idea how to get at this. My ideal solution would be to draw a maps with a left boundary at -20° and a right boundary at -30° (i.e. 330°). The following gets the correct points and coastlines onto the map, but the crossing-zero problem is the same ``` df$longitude[df$longitude < -20] = df$longitude[d$longitude < -20] + 360 map("world", fill=TRUE, col="white", bg="gray", mar=c(0,0,0,0), ylim=c(-60, 90), xlim=c(-20, 330)) map("world2", add=TRUE, col="white", bg="gray", fill=TRUE, xlim=c(180, 330)) ``` Any help would be greatly appreciated.
Fixing maps library data for Pacific centred (0°-360° longitude) display
CC BY-SA 2.5
0
2011-03-18T14:10:40.983
2021-09-15T07:38:32.863
null
null
188,595
[ "r", "maps" ]
5,353,285
1
null
null
0
975
[http://localhost/rkk/work-type/non-profit](http://localhost/rkk/work-type/non-profit) I created a vocabulary and terms under for work-type. and I created some posts... Then I created a View Block to list my entries, and assigned to a page... everything fine so far. I display the work-type at entry details page. and I have a link "click to see other non-profit(assigned work type) works". When I click this link, it lists entries assigned to that particular work-type. thats fine, but it displays title/body/readmorelink :/ I need custom view for this page, like I did View Block for listing all posts... Can I assign custom created View Block to this taxonomy entry list page? the url changes according to work-type, so how do I assign view to changing-url :/ Appreciate helps!! thanks a lot! --- I have a vocabulary (work type), and terms under (corporate, non-profit, etc...) I have a CCK for "work", and as a field I have select terms of work-type vocabulary. I have a Custom Views Block to display works in a page (thumb, title, desc, link, etc.). When I click a work, it goes to particular Work entry details page, I place a link in there "click to see other -term (corporate)- works", etc. When I click this link, it displays the Work Entries under that particular term. it works fine. but it displays as default look (shown as below), but I need this page same as main works page list (thumb, title, desc, link, etc.) I already have a View for this, but how can assign this View to this dynamic url taxonomy page? I found the module [http://drupal.org/project/tvi](http://drupal.org/project/tvi) , but cant make it work. ![enter image description here](https://i.stack.imgur.com/Y2IsZ.jpg)
How to assign view block to dynamic taxonomy term page for CCK entries
CC BY-SA 2.5
null
2011-03-18T14:19:20.823
2011-03-21T03:31:22.860
2011-03-21T03:31:22.860
225,647
150,225
[ "drupal", "drupal-modules", "drupal-7", "taxonomy", "drupal-theming" ]
5,353,904
1
5,383,355
null
1
1,086
In the AppletViewer, my Applet looks like this: ![screenshot AppletViewer](https://i.stack.imgur.com/Q6EQ3.png) In the browser, my Applet looks like this: ![screenshot browser](https://i.stack.imgur.com/CzNox.png) As you can see, the font is not antialiased. Also the background color is different. And all the text is cutted on the right side. What could that be? You can also try it yourself [here](http://www.matha.rwth-aachen.de/~ilias/jars/Termumformungen%20in%20der%20Technik/Termumformungen%20in%20der%20Technik.html). --- From [here](https://stackoverflow.com/questions/179955/how-do-you-enable-anti-aliasing-in-arbitrary-java-apps/179971#179971) I tried to use this code: ``` System.setProperty("awt.useSystemAAFontSettings","on"); System.setProperty("swing.aatext", "true"); ``` But that results only in this exception: ``` java.security.AccessControlException: access denied (java.util.PropertyPermission awt.useSystemAAFontSettings write) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374) at java.security.AccessController.checkPermission(AccessController.java:546) at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) at java.lang.System.setProperty(System.java:742) at applets.Termumformungen$in$der$Technik_08_Ethanolloesungen.Applet.init(Applet.java:51) at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1640) at java.lang.Thread.run(Thread.java:680) Exception: java.security.AccessControlException: access denied (java.util.PropertyPermission awt.useSystemAAFontSettings write) ```
Java Applet: no antialiased font in browser (but in AppletViewer)
CC BY-SA 2.5
0
2011-03-18T15:09:04.893
2013-09-10T20:28:59.713
2017-05-23T11:48:25.477
-1
133,374
[ "java", "fonts", "applet", "antialiasing", "appletviewer" ]
5,354,055
1
5,354,363
null
2
1,266
How would I create a simple 2-column layout with a 5 pixel margin between them? Like so: ![](https://i.stack.imgur.com/rNKQg.png) It's tricky because if you try and set both column's widths to 50%, and then try to add a margin to one or both of them, one will get pushed below the other so that it can fill the 50%.
Is it possible to create 2 50% columns with a 5 pixel margin without specifying exact widths for each column?
CC BY-SA 2.5
0
2011-03-18T15:19:57.210
2011-03-19T00:54:45.483
2011-03-19T00:54:45.483
65,387
65,387
[ "html", "css" ]
5,354,347
1
null
null
9
8,484
I'm trying to use an image from a `ClientBundle` as a background-image in a UIBInder template. I used [this discussion](https://groups.google.com/forum/#!topic/google-web-toolkit/ExOJAEfQmkY) as a guide, but was unable to get it to work. In my Java class I have: ``` public static interface PriceButtonStyles extends ClientBundle { String paidIcon(); @ClientBundle.Source("paid_button_53x31.png") DataResource paid_buttonAsDataResource(); } @UiField PriceButtonStyles priceButtonStyle; ``` And then in the corresponding template file I reference it like: ``` <ui:style field="priceButtonStyle" type="com.example.client.PriceButton.PriceButtonStyles"> @url paidIconUrl paid_buttonAsDataResource; .paidIcon { background: paidIconUrl 0 0 no-repeat; } </ui:style> ``` Already at this point my IDE is showing the "paidIconUrl" string in red, indicating that something's not quite right: ![ide shows red](https://i.stack.imgur.com/4FC05.png) And indeed, when I try to run it I get: ``` ERROR: Type com.ecample.client.PriceButton.PriceButtonStyles does not extend com.google.gwt.resources.client.CssResource Element <ui:style field='priceButtonStyle' type='com.example.client.PriceButton.PriceButtonStyles'> (:7). ERROR: Uncaught exception escaped. com.google.gwt.event.shared.UmbrellaException: One or more exceptions caught, see full set in UmbrellaException#getCauses ``` Further on in the [Google Groups discussion](https://groups.google.com/d/msg/google-web-toolkit/ExOJAEfQmkY/g1CLbWvVvhIJ) it is suggested that this might work with `<ui:data>` rather than `<ui:style>`, so I tried to make that work. But it seems like you can't include both CSS styles (e.g. my `paidIcon()` method) and DataResources in `<ui:data>` resources. I wasn't able to find much documentation on `<ui:data>`, so I'm really just grasping at straws with this.
Use ClientBundle image as background-image
CC BY-SA 2.5
0
2011-03-18T15:39:00.140
2015-09-24T04:46:28.103
2011-03-18T17:40:31.617
126,562
93,995
[ "gwt", "uibinder" ]
5,354,696
1
5,354,844
null
8
1,624
I recently came across some behaviour that I simply could not and cannot explain, related to Delphi interface variables. Essentially, it boils down to an implicit interface variable that the compiler generates in the `Broadcast` method. At the end statement that terminates the method, the epilogue code contains two calls to `IntfClear`. One of which I can explain, it corresponds to the `Listener` local variable. The other one I cannot explain and it takes you to `TComponent._Release` (Debug DCUs) after the object instance has been destroyed. It doesn't result in an AV, but that's just lucky, and with full FastMM debug a post-destruction instance access is reported. Here's the code: ``` program UnexpectedImplicitInterfaceVariable; {$APPTYPE CONSOLE} uses SysUtils, Classes; type IListener = interface ['{6D905909-98F6-442A-974F-9BF5D381108E}'] procedure HandleMessage(Msg: Integer); end; TListener = class(TComponent, IListener) //TComponent._AddRef and TComponent_Release return -1 private procedure HandleMessage(Msg: Integer); end; { TListener } procedure TListener.HandleMessage(Msg: Integer); begin end; type TBroadcaster = class private FListeners: IInterfaceList; FListener: TListener; public constructor Create; procedure Broadcast(Msg: Integer); end; constructor TBroadcaster.Create; begin inherited; FListeners := TInterfaceList.Create; FListener := TListener.Create(nil); FListeners.Add(FListener); end; procedure TBroadcaster.Broadcast(Msg: Integer); var i: Integer; Listener: IListener; begin for i := 0 to FListeners.Count-1 do begin Listener := FListeners[i] as IListener; Listener.HandleMessage(Msg); end; Listener := nil; FListeners.Clear; FreeAndNil(FListener); end;//method epilogue: why is there a call to IntfClear and then TComponent._Release? begin with TBroadcaster.Create do begin Broadcast(42); Free; end; end. ``` And here's the disassembly of the epilogue: ![enter image description here](https://i.stack.imgur.com/uUWza.png) There, clear as day, are the two calls to IntfClear. So, who can see the obvious explanation that I am missing? --- Well, Uwe got it straight away. `FListeners[i]` needs a temporary implicit variable for its result variable. I didn't see that since I was assigning to `Listener`, but of course that's a different variable. The following variant is an explicit representation of what the compiler is generating for my original code. ``` procedure TBroadcaster.Broadcast(Msg: Integer); var i: Integer; Intf: IInterface; Listener: IListener; begin for i := 0 to FListeners.Count-1 do begin Intf := FListeners[i]; Listener := Intf as IListener; Listener.HandleMessage(Msg); end; Listener := nil; FListeners.Clear; FreeAndNil(FListener); end; ``` When written this way it is obvious that Intf cannot be cleared until the epilogue.
The mysterious case of the unexpected implicit interface variable
CC BY-SA 2.5
0
2011-03-18T16:06:13.970
2011-03-18T16:27:04.523
2011-03-18T16:22:44.097
505,088
505,088
[ "delphi", "interface" ]
5,354,968
1
5,356,041
null
19
7,505
The font size of my code snippets are too small relative to the default font size of the Wiki, which makes them hard to read (see below for an example). Is there anything I can do to change it? Example: ![enter image description here](https://i.stack.imgur.com/9iojT.png) The code that generates the above is: ``` ==== Histograms ==== This is the code to compute the histogram: <source lang="matlab"> nEls = numel(unique_vals); edges = zeros(nEls+2,1); </source> ```
Changing the font size of code formatted by SyntaxHighlight GeSHi in MediaWiki
CC BY-SA 2.5
0
2011-03-18T16:27:52.153
2015-10-19T05:22:31.690
null
null
283,296
[ "syntax-highlighting", "mediawiki", "geshi" ]
5,355,153
1
5,359,925
null
6
1,595
During debugging I was trying to look at a StringBuilder's contents in order to visualize it. I work with a lot of HTML and I would like to be able to view the content in HTML mode like it was possible in VS 2008. As you can see in the image attached, in 2008 I could very easily get the html mode right in the debugger on the line I wanted. How can I get the abilities of 2008 back in 2010? ![VS 2010 compared to VS 2008](https://i.stack.imgur.com/84a7x.jpg) Thank you.
VS 2010 Debugging - Where's the visualizers
CC BY-SA 2.5
0
2011-03-18T16:44:19.017
2016-09-29T07:07:03.650
null
null
64,015
[ "c#", "visual-studio-2010", "debugging", "visual-studio-debugging" ]