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
4,213,853
1
null
null
0
248
``` <div class="wholediv"> <div class="rightdiv"> <strong>Your Company Name</strong><br /> Evergreen Terrace 742<br /> Kansas Missouri<br /> Phone: 432-653-3121<br /> [email protected] </div> <div class="sitemap"> <a href="#">Home</a>&nbsp;|&nbsp;<a href="#">Sitemap</a>&nbsp;|&nbsp;<a href="#">Contact Us</a></div> </div> </div> div div.wholediv { height:97px; width:500px; float:left; background-color:#F0F0F0; } div div.sitemap { background-color:#F0F0F0; position:relative; float:right; width:200px; height:87px; padding-right:10px; padding-top:10px; font: 0.7em Tahoma, sans-serif; font-weight:bold; } div div.rightdiv { float:left; position:static; background-color:#F0F0F0; width:200px; height:87px; padding-left:10px; padding-top:10px; font: 0.7em Tahoma, sans-serif; } ``` IE displays like this. ![alt text](https://i.stack.imgur.com/7x7h2.jpg) Chrome displays like this. ![alt text](https://i.stack.imgur.com/QuVHv.jpg)
Below Code displays differently in Chrome and IE
CC BY-SA 2.5
null
2010-11-18T10:36:31.400
2010-11-18T10:57:28.987
2010-11-18T10:45:56.307
251,173
484,462
[ "html" ]
4,214,304
1
4,214,475
null
5
5,398
When the user focuses on a certain element, I display a save button. On `focusout`, I remove the save button. ![alt text](https://i.stack.imgur.com/4wiED.png) The user can submit the input by either hitting return or click save. When they click the save button, the input loses focus and the save button is removed, thus not registering the click. Can I tell in the `focusout`, if the save button has been clicked? Within my focus function I do something like this: ``` $('#save_button').click(function(){ saveEditingField(this); //save input $('#save_button').die("click"); }); $('.editing').focusout( function(e) { $('#isediting').attr('value','false'); $('#edit_controls').remove() }); ``` I've tried adding a delay to the `remove()`, but when tabbing between inputs it shows multiple save buttons (while the others are being removed). Any ideas?
Focusout only when another element not clicked
CC BY-SA 4.0
null
2010-11-18T11:35:30.483
2022-12-15T22:22:20.400
2022-12-15T22:22:20.400
4,370,109
114,696
[ "javascript", "jquery", "jquery-events" ]
4,214,435
1
4,217,365
null
5
3,614
I have a custom Line Shape that use an adorner to display an array and some text in the middle of that line. ![alt text](https://i.stack.imgur.com/FcYu0.jpg) The problem is that the adorned behaves independently of the adorned element, and does not "transfer" the event to it. In the following code I am forced to manually relink the adorner elements to adorned element (`ta.MouseLeftButtonDown += Adorner_MouseLeftButtonDown;`), but unfortunately even this does not work... Could somebody advice what is wrong when calling this.OnMouseLeftButtonDown, why I don't receive the respective event? ``` public class SegmentLine : Shape { AdornerLayer aLayer; public static readonly DependencyProperty X1Property; public static readonly DependencyProperty X2Property; public static readonly DependencyProperty Y1Property; public static readonly DependencyProperty Y2Property; ... static SegmentLine() { X1Property = DependencyProperty.Register("X1", typeof(double), typeof(SegmentLine), new FrameworkPropertyMetadata(double.NaN, FrameworkPropertyMetadataOptions.AffectsRender)); X2Pro... } public SegmentLine() : base() { this.Loaded += SegmentLine_Loaded; } void SegmentLine_Loaded(object sender, RoutedEventArgs e) { aLayer = AdornerLayer.GetAdornerLayer(this); if (aLayer != null) { TextAdorner ta = new TextAdorner(this); //ta.IsHitTestVisible = false; ta.MouseLeftButtonDown += Adorner_MouseLeftButtonDown; aLayer.Add(ta); } } void Adorner_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { // !! try to rise the MouseLeftButtonDown event this.OnMouseLeftButtonDown(e); } protected override void OnRender(DrawingContext drawingContext) { base.OnRender(drawingContext); if (aLayer != null) aLayer.Update(); } class TextAdorner : Adorner { public TextAdorner(UIElement adornedElement) : base(adornedElement) { } protected override void OnRender(DrawingContext drawingContext) { // ADD LABEL ... FormattedText ft = new FormattedText(...); drawingContext.DrawText(ft, midPoint); // Add ARROW ... var myPathGeometry = new PathGeometry { Figures = myPathFigureCollection }; drawingContext.DrawGeometry(Brushes.Black, null, myPathGeometry); } } protected override System.Windows.Media.Geometry DefiningGeometry { get { var geometryGroup = new GeometryGroup(); // Add line geometryGroup.Children.Add(new LineGeometry(new Point(X1, Y1), new Point(X2, Y2))); return geometryGroup; } } } ```
Adorner and Events on Adorned element
CC BY-SA 2.5
0
2010-11-18T11:53:15.520
2012-10-11T11:29:04.993
2010-11-18T12:25:20.180
185,593
185,593
[ "wpf", "wpf-controls", "adorner" ]
4,214,568
1
4,214,590
null
1
79
I've used this exact code with a slight modification of the values in another script and it worked just fine, but this time it's giving me errors. This is the line: ``` $result = mysql_query("INSERT INTO contacts (name, email, telephone, companyname, postcode, message, date) VALUES('" . $name . "', '" . $userEmail . "', '" . $telephone . "', '" . $companyName . "', '" . $message . "', '" . $date . "'") or die (mysql_error()); ``` I've tried echo-ing out all of the variables with this: ``` <p>Name: <?php echo $name; ?>, <br />Email: <?php echo $userEmail; ?>, <br />Telephone: <?php echo $telephone; ?>, <br />Company name: <?php echo $companyName; ?>, <br />Message: <?php echo $message; ?>, <br />Date: <?php echo $date; ?>, <br /></p> ``` Which displays them all fine when the form is submitted. However, when I try to add them to a database it flips out and says this: > You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 I'm assuming I'm either missing something simple, I've made a typo somewhere (although I've re-typed it to double check it wasn't that). Here's the way my database is set-up: ![database set-up](https://i.stack.imgur.com/WvaQi.png) Any ideas? --- I added the missing `)` to the query and that got rid of the first error, but now I'm getting this error when I submit it: > Column count doesn't match value count at row 1 --- I was missing the `$postcode` variable. Doh!
Weird mySQL error when adding to a database
CC BY-SA 2.5
null
2010-11-18T12:08:08.017
2010-11-18T12:20:26.353
2010-11-18T12:15:15.363
446,260
446,260
[ "php", "mysql", "database", "forms" ]
4,214,620
1
4,242,509
null
1
257
In TapToZoom sample(apple code), If i pinch(inwards) the image becomes smaller than the window size(If i remove fingers it will fit correctly to window). How to fix the image to the window if the content size of scroll view is less than window size. I spent a day to fix this problem but of no use... I am attaching the snap.. ![alt text](https://i.stack.imgur.com/C7r1x.png) The black color is my window of size(320*480) if i pinch the image has gone smaller than the window size(highlighted image) If i stop pinching at this time It will fit correctly to window. But i don't want my imageView to become smaller than window while pinching how to accomplish this? Thanks,
ScrollView Zooming problem
CC BY-SA 2.5
null
2010-11-18T12:15:40.653
2010-11-22T05:19:33.270
2010-11-18T12:23:18.280
300,517
300,517
[ "iphone", "cocoa-touch", "uiscrollview" ]
4,214,770
1
4,215,139
null
0
294
So u can see that my test is blurred at the UITextfield in my cell. But I search in the internet about it, and the only solution is to use int-coordinates and I do that! But when I push to my other subview's ('Kollege', 'Fahrten', etc.) then the text gets more blurred and when I want to write another text in the textfield there is still this text and doesn't clear when I push the delete-button! Please help :) ![Screenshot](https://i.stack.imgur.com/m8Xso.png)
UITextfield blurred text
CC BY-SA 2.5
0
2010-11-18T12:35:15.973
2010-11-18T13:16:45.610
null
null
1,333,276
[ "iphone", "sdk", "uitextfield", "blurry" ]
4,215,095
1
4,215,238
null
1
754
I have seen a lot of related questions but none really helped. I'm trying to create a zip archive from a folder (on the iPhone). The structure of the folder is the following: ![alt text](https://i.stack.imgur.com/v5e6W.png) In this example the zip would be "folderToBeZipped.zip" What is the easiest way to accomplish this and how do I unzip it (also iPhone) later on?
How do I zip a folder on the iPhone
CC BY-SA 2.5
0
2010-11-18T13:12:56.260
2010-11-19T12:52:15.643
2010-11-19T12:52:15.643
106,435
508,462
[ "iphone", "cocoa-touch", "compression", "zip", "unzip" ]
4,215,182
1
4,215,716
null
0
1,802
I am having a tableView which lists the contents directory which includes jpg, pdf, zip, mp3, mp4, sql,.. files and even folders. In the next step, I am having a detailView which displays some properties of the selected file such as fileName, fileSize, filePath, fileType. Everything works perfect. But actually my plan is to include a additional option in the detailView. That is, 1. If the selected file in the tableView is a image file, it should open a imageView in the detailView to display that image. 2. If the selected file is a mp3, it should open a player to play the song in the detailView. 3. If the selected file is a video or mp4 file, it should open a player to play that video in detailView. 4. If the selected item is a folder, it should again open a tableView which dispalys the contents of the folder. 5. For other files, it should push a alertView regarding that it is a unknown file. Hope my concept was narrated well. I got the methods for playing the .mp3 and .mp4 files. Now I am stuck in pushing the imageView and in case of a folder. I have no ideas to proceed both the methods. This is my tableView ![alt text](https://i.stack.imgur.com/6GW4C.png) This is my detailView for video file ![alt text](https://i.stack.imgur.com/MnZ4r.png) This is my detailView for a .mp3 file ![alt text](https://i.stack.imgur.com/Cy2Fb.png) This is the detailView left empty for my imageView. ![alt text](https://i.stack.imgur.com/NB7qe.png) Please help me to proceed with some sample codes. Thank you in advance.
iPhone - detailView controller
CC BY-SA 2.5
null
2010-11-18T13:22:02.817
2010-11-18T14:27:53.243
null
null
500,625
[ "iphone", "uitableview", "uiimageview", "detailsview" ]
4,215,475
1
4,216,140
null
6
3,817
Anyone know of a way that I can get CSS to make a PNG image with transparency look completely blacked out like a silhouette? In other words- Going from something like this: ![http://susanbuck.net/upenn/examples/images/apple.jpg](https://i.stack.imgur.com/somZ7.jpg) To this: ![alt text](https://i.stack.imgur.com/wglFt.png) It's for a lot of images which is why I'd like to avoid doing it via Photoshop.
Silhouette a PNG image using CSS
CC BY-SA 2.5
0
2010-11-18T13:55:08.060
2016-12-04T13:21:16.220
2010-11-18T14:01:03.777
287,047
59,479
[ "css", "image", "image-processing" ]
4,215,608
1
4,215,640
null
3
1,020
I'm having a little problem using Navigation properties and inheritance on ADO.NET. This is my Data Model: ![ADO.NET Data Model](https://i.stack.imgur.com/gGtPO.png) First, some vocabulary: > Categoria = Category Formulario = Form Campo = Field Imagem = Image Paragrafo = Paragraph Escolha = Choice Texto = Text Resposta = Answer So, I'm trying to create a custom property on a Form returning it's answers count. The normal approach (i think) would be: ``` public partial class Formulario { public int Respostas { get { List<Item> itens = this.Itens.ToList(); IEnumerable<Campo> campos = from m in itens where m as Campo != null select (Campo)m; int soma = campos.Sum(m => m.Respostas.Count); return soma; } } } ``` But it doesn't work. The `itens` list returns 0 elements. But when I do as below, it return the 4 items it should: ``` public partial class Formulario { public int Respostas { get { FormulariosDB db = new FormulariosDB(); List<Item> itens = db.Items.Where(m => m.Formulario.Id == this.Id).ToList(); IEnumerable<Campo> campos = from m in itens where m as Campo != null select (Campo)m; int soma = campos.Sum(m => m.Respostas.Count); return soma; } } } ``` It only works when I instanciate the entire data model. Does anyone knows why? PS: I'm using the `.toList()` method so I can use all `Linq` queries, not only the ones `Linq2Entities` allows me to
ADO.NET Navigation Properties
CC BY-SA 2.5
null
2010-11-18T14:07:45.040
2010-11-18T14:40:31.963
2010-11-18T14:40:31.963
443,395
443,395
[ "c#", "ado.net", "linq-to-entities" ]
4,216,051
1
4,216,488
null
0
927
This is a CSS-Question. In [this fiddle](http://jsfiddle.net/cNY5v/1/) you can see a button. It has got two span-elements inside. One with `float:left;` the other with `float:right;`. The style is a normal button-style. When clicking that button on the iPhone or hover it in a Browser the style gets lost. This is because I changed the background-color. Is there a way to change the background-color without losing the whole button-style? EDIT: Here are the two images: The first button is a normal button-element. The second button is a button where I changed the background-color ... this is what it looks like when I'm hovering over a button. ![Normal Button](https://i.stack.imgur.com/.png) ![hovered button](https://i.stack.imgur.com/.png)
hovered button-element loses style after changing background-color
CC BY-SA 2.5
null
2010-11-18T14:53:54.350
2010-11-19T10:58:17.867
2010-11-19T10:58:17.867
375,291
375,291
[ "css", "button" ]
4,216,148
1
null
null
1
104
I've had a report from the client who had issues printing (my) charts in WPF with a large number of data points. On the screen everything is visible. Here's a screenshot ![screenshot](https://i.stack.imgur.com/xwfhQ.jpg) But when he prints it the part of the graph disappears in a pretty strange way. Here's a screenshot from printed PDF (same thing happens with actual printer) ![printed version](https://i.stack.imgur.com/xinck.jpg) The printing is done using simple PrintVisual code ``` PrintDialog dialog = new PrintDialog(); if (dialog.ShowDialog() == true) { dialog.PrintVisual(chart, "Chart"); } ``` I've tried to debug this but it seems that none of my rendering code gets called on printing (or at least no breakpoints get hit in Visual Studio) so I'm out of ideas of where to look. If number of data points is relatively small everything prints out as expected. Any ideas? Thanks!
Issue printing complex visuals
CC BY-SA 2.5
null
2010-11-18T15:02:13.810
2010-11-19T10:21:38.187
null
null
19,546
[ "c#", ".net", "wpf" ]
4,216,147
1
null
null
6
7,456
i am trying to use the old facebook connect authentication to authenticate my android client to get the necessary session id's and other credentials thats needed to start using the web service of facebook. the issue i am having is that when my android application launces and tries to load the login page for facebook, that very same login page is blank and it only displays the the facebook logo as the title of the screen. No login fields or buttons are visible leaving me nowhere to login and authenticate a user. i have tried two API's one is facebook connect api for android [http://code.google.com/p/fbconnect-android/](http://code.google.com/p/fbconnect-android/) and the other one is the official android facebook sdk that is recommended to be used instead of the previous one i have just mentioned [https://github.com/facebook/facebook-android-sdk/](https://github.com/facebook/facebook-android-sdk/) . please see the image below of how it looks like on my app. ![alt text](https://i.stack.imgur.com/vRkSZ.png) Here is code that uses the latest android sdk facebook: ``` /** * Authenticate facebook network */ private void authenticateFacebook() { // TODO: move this away from this activty class into some kind of // helper/wrapper class Log.d(TAG, "Clicked on the facebook"); Facebook facebook = new Facebook(OAUTH_KEY_FACEBOOK_API); facebook.authorize(this, new AuthorizeListener()); } class AuthorizeListener implements DialogListener{ @Override public void onComplete(Bundle values) { // TODO Auto-generated method stub Log.d(TAG, "finished authorizing facebook user"); } @Override public void onFacebookError(FacebookError e) { // TODO Auto-generated method stub } @Override public void onError(DialogError e) { // TODO Auto-generated method stub } @Override public void onCancel() { // TODO Auto-generated method stub } } ``` And a simple example of how to use it: [http://developers.facebook.com/docs/guides/mobile/](http://developers.facebook.com/docs/guides/mobile/) My code is more or less identical to the above example. edit: i did not catch what logcat was inputing in my first attempted at my code above but their was no exceptions or warnings thrown at the time. just a blank page. i then tried it again and diddnt touch my code and what happens now is that a loading dialogue view pops up and stays their for a few minutes until the facebook windows disapears and the logcat outputs the error below: > 11-18 17:26:19.913: DEBUG/Facebook-WebView(783): Webview loading URL: [https://www.facebook.com/dialog/oauth?type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess&display=touch&client_id=e](https://www.facebook.com/dialog/oauth?type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess&display=touch&client_id=e)??????????????????? 11-18 17:27:01.756: DEBUG/Facebook-authorize(783): Login failed: com.kc.unity.agent.util.oauth.facebook.DialogError: The connection to the server was unsuccessful. 11-18 17:27:01.783: DEBUG/Facebook-WebView(783): Webview loading URL: [https://www.facebook.com/dialog/oauth?type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess&display=touch&client_id=](https://www.facebook.com/dialog/oauth?type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess&display=touch&client_id=)??????????????? please note that the client id i have amended for obvious reasons but the rest of the logcat is untouched
facebook connect for android returns a blank login screen?
CC BY-SA 2.5
0
2010-11-18T15:02:13.547
2014-01-29T03:30:50.773
2010-11-18T17:30:39.020
444,668
444,668
[ "android", "facebook" ]
4,216,427
1
4,216,920
null
1
598
I'd like to have a custom usercontrol based on textbox where I could type in text (for example names) and the names would be then converted to custom items (that would have an X button to remove them, etc). This is what I would like: ![alt text](https://i.stack.imgur.com/OFYkH.png) How can I achieve this? Can I replace a piece of text with a custom item? Thanks for any ideas.
WPF textbox usercontrol containing custom items, not simple text
CC BY-SA 2.5
null
2010-11-18T15:25:05.067
2022-03-20T09:03:50.873
2013-01-15T05:27:58.063
305,637
300,696
[ "c#", "wpf", "user-controls", "textbox" ]
4,217,304
1
4,242,411
null
16
4,824
In case somebody doesn't know: A [cartogram](http://en.wikipedia.org/wiki/Cartogram) is a type of map where some country/region-dependent numeric property scales the respective regions so that that property's density is (close to) constant. An example is ![Example cartogram](https://i.stack.imgur.com/p8O3c.png) from [worldmapper.org](http://www.worldmapper.org/). In this example, countries are scaled according to their population, resulting in near-constant population density. Needless to say, this is really cool. Does anyone know of a Matplotlib-based library for drawing such maps? The method used at worldmapper.org is described in (1), so it would surprise me if no one has implemented this yet... I'm also interested in hearing about other cartogram libraries, even if they're not made for Matplotlib. (1) Michael T. Gastner and M. E. J. Newman, Diffusion-based method for producing density-equalizing maps, Proc. Nat. Acad. Sci. USA, 101, 7499-7504 (2004). Available at [arXiv](http://aps.arxiv.org/abs/physics/0401102/).
Drawing cartograms with Matplotlib?
CC BY-SA 2.5
0
2010-11-18T16:41:52.230
2020-05-20T07:05:13.960
2015-09-07T20:07:37.883
3,576,984
453,616
[ "matplotlib", "visualization", "cartography", "cartogram" ]
4,217,370
1
4,218,537
null
6
2,405
The issue we are trying to solve the issue of locating a point in two different representations of a plane. The first plane we have is rotated to create perspective; the second is a 2d view of that same plane. We have 4 points on each of the plans that we know to be equivalent. The question is if we have an arbitrary point in plane 1, how do we find the corresponding point in plane 2? It is best probably to illustrate the use case in order to best clarify the question. We have an image illustrated on the left. [Projective plane](http://en.wikipedia.org/wiki/Projective_plane) ![alt text](https://i.stack.imgur.com/BS9CU.png) 2D layout diagram of space ![alt text](https://i.stack.imgur.com/jrBa0.png) So the givens that we have are the red squares from both pictures. Note that if possible, I’d like it to be possible that the 2D space isn’t necessarily a square. These are available to us ahead of time and known. I also have green dots laid out on the plane in the first image. I’d like to be able to do a projection of the dot in image 1 onto the space in image 2. Note also for the image 1 I do not have a defined window or eye position. I just know that the red square from image 1 is a transform of the red square form image 2 and that the image 2 is in 2D space.
How can I project an arbitrary plane identified by 4 points onto a 2d plane?
CC BY-SA 3.0
0
2010-11-18T16:48:55.090
2020-02-13T21:49:35.107
2011-04-28T22:49:32.537
311,525
311,525
[ "graphics", "3d", "geometry", "projective-geometry", "planerotation" ]
4,217,869
1
4,232,414
null
4
2,255
Imagine a red circle with a black dropshadow that fades away on top of a fully transparent background. When I open and resave the image with PIL the background remains fully transparent but the dropshadow becomes full black. The problem appears without even altering the image: ``` image = Image.open('input.png') image = image.convert('RGBA') image.save('output.png') ``` I want to keep the image looking exactly as the original so that I can crop or resize it. EDIT: Here's a PNG that demonstrates the effect. It was converted to 8bit by using PNGNQ. ![alt text](https://i.stack.imgur.com/kHrY6.png) When using the above Python code it comes out as the following: ![alt text](https://i.stack.imgur.com/IfRAx.png)
Python PIL - All areas of PNG with opacity > 0 have their opacity set to 1
CC BY-SA 2.5
0
2010-11-18T17:44:50.710
2010-11-20T11:14:59.240
2010-11-19T19:16:20.253
176,323
176,323
[ "python", "png", "python-imaging-library" ]
4,217,936
1
null
null
1
3,711
Using CSS3 columns to take a somewhat large text document and make it scroll horizontally. I want each column to be close to the size of the iPad screen, as I am displaying the content in a UIWebView. If I make the -webkit-column-width: property a relatively small number, everything works great. The text stops at the max-height set for the containing and columns out horizontally. If I make -webkit-column-width anything larger than about 300px, though, this css seems to get completely ignored. The text displays vertically as it would without styling. Any fixes? Display when -webkit-column-width is 325px. The view scrolls to the right normally: ![325](https://i.stack.imgur.com/xj97m.png) Display when -webkit-column-width is 500px. Text appears as one column and the view scrolls downward to the end of the document, ignoring max-height: ![500](https://i.stack.imgur.com/dcveQ.png)
CSS3 Columns and UIWebView
CC BY-SA 2.5
0
2010-11-18T17:52:39.447
2010-11-19T21:26:23.880
2010-11-18T19:09:45.740
432,281
432,281
[ "ios", "uiwebview", "css" ]
4,217,946
1
4,220,732
null
1
2,195
I was just wondering how can I assign different cell style for same column? Cell style might be combo box or text box. Image uploaded. Is it really hard? I want to display a table in data grid. The first column should be name of the table field, second column should be the value of the column. now if the first column cell data type is var char , then second column cell should display text box. if the first column cell data type is int, then second column cell should display combo box. ![DataGrid Cell Style](https://i.stack.imgur.com/hn2H8.png) Thanks, N avatar ![alt text](https://i.stack.imgur.com/zDwER.png)
WPF DataGrid with cell style -- different cell style in same column
CC BY-SA 2.5
null
2010-11-18T17:53:56.467
2011-08-13T15:55:49.067
2011-08-13T15:55:49.067
305,637
205,291
[ "c#", "wpf", "styles", "wpfdatagrid" ]
4,218,062
1
4,630,605
null
2
112
Is there a way to configure the font used for the Query editor in Visual Studio 2008 or 2010? I found this same question for VS 2005 and the answer from Microsoft saying you can't. I'm hoping that this is not true with 2008 or 2010. [http://social.msdn.microsoft.com/Forums/en/vssetup/thread/a4aa8790-7a72-4e0f-8901-0188ec0f3104](http://social.msdn.microsoft.com/Forums/en/vssetup/thread/a4aa8790-7a72-4e0f-8901-0188ec0f3104) This is the screen shot from 2005 but it's almost the same in 2008. ![VS 2005](https://i.stack.imgur.com/8pGy0.gif)
Can you configure font for Query Editor in Visual Studio 2008 or 2010
CC BY-SA 2.5
0
2010-11-18T18:10:32.897
2011-01-07T21:47:48.197
2010-11-18T18:53:09.353
118,703
118,703
[ "visual-studio" ]
4,218,727
1
4,218,793
null
12
29,274
When running sp_who2, it appears one of my SQL commands is blocking but waiting on a process that is "Sleeping" and "Awaiting Command". This doesn't make any sense. ![alt text](https://i.stack.imgur.com/1mNHy.png) Any ideas what might be causing this? I know the DELETE is running inside a transaction that previously inserted a lot of rows into the table, could that be the problem?
sp_who2 BlkBy Sleeping Process Awaiting Command
CC BY-SA 2.5
0
2010-11-18T19:29:18.880
2014-04-15T11:44:04.403
null
null
13,257
[ "sql-server", "ssis", "sp-who2" ]
4,218,992
1
4,219,707
null
0
1,592
I am working on a bilingual site in the latest version of Drupal 6. I installed the Internationalization module and the Views translation module, among many others. The problem: On /admin/build/translate/search, some elements (e.g. the view title) appear in the text group "Views" and Drupal assumes they are in German, requiring an English translation. Other elements (e.g. exposed filter labels) appear in the text group "Built-in Interface" and Drupal assumes they are in English, requiring a German translation. But in fact all the strings are in German: ![alt text](https://i.stack.imgur.com/30Ib7.png) To be clear, I am not seeing an issue with the language selection or the display of the view. The issue is when the page is first parsed by the language system and any translatable strings are inserted into the translation table. Drupal assignes different source languages for elements on the same page. The result is a mix of languages, once these strings are translated. I thought that maybe it is the language preference of the user who hits the page first that interferes with this, but once I started changing it, I ran into [this issue](http://drupal.org/node/204946) (reading the thread was eye-opening - it should be mandatory reading for anyone considering Drupal for enterprise-class solutions). Ok, now I have the URL prefix in the mix, which means that when a user changes the language preference, the site language does not change until they manually change the URL. Once I managed to get the page rendered in English, it turned out that Drupal does not pick up the translation strings when the display language equals the source language. So no luck there. I am ready to code my view in 2 languages, depending on what Drupal thinks the source language is for the various elements, but even that won't work. Has anybody else experienced this?
Drupal I18N - Default language of View elements
CC BY-SA 2.5
null
2010-11-18T20:00:53.390
2010-11-20T04:05:51.830
2010-11-20T04:05:51.830
58,880
58,880
[ "drupal", "internationalization", "translation" ]
4,219,125
1
4,219,542
null
0
654
I have an UIViewController subclass and an IBOutlet named map to an MKMapView instance. So far, so great, but sometimes the app crashes without a reason when the view controller triggers the `viewDidLoad` method. This is absolutely randomly, but only happens when I created around three instances and then create a new one and push it into a navigation controller (however, I have only one of these view controllers at the same time in the navigation controller stack!). Here is the code of the `viewDidLoad` method: ``` - (void)viewDidLoad { [super viewDidLoad]; [map setDelegate:self]; [map setMapType:MKMapTypeStandard]; [map setShowsUserLocation:YES]; if(area) self.area = area; } ``` The stacktrace shows that it crashes when I call `[map setShowsUserLocation:YES];` but only on this line (when I comment it out, it never crashes). Here is the stacktrace: ![alt text](https://i.stack.imgur.com/BggJe.png) (Sorry for the picture, but I was too lazy to type it all). Does anyone knows what happens there an why it crashes?
MKMapView strange crash when tracking location
CC BY-SA 2.5
null
2010-11-18T20:14:56.250
2010-11-18T21:00:35.977
null
null
350,272
[ "uikit", "mapkit", "mkmapview" ]
4,220,228
1
4,220,290
null
0
385
I have a form that appears as shown in the attached image. I have two parts of the form that concern this question: the TabControl, and the Panel, as shown in the image. It should be noted that the panel is NOT within the TabControl. ![alt text](https://i.stack.imgur.com/Xojaq.jpg) My situation is that I have a thread that executes continuously when the button, displayed in melt-your-eyes green in the Panel, is clicked. The thread polls the device which I'm interfacing with and updates the controls in the "Status" GroupBox at the bottom of the TabControl. When the user clicks on a control in the TabControl (`tabControl_Enter` event), I trigger a ManualResetEvent which lets the thread finish its iteration so that I can perform the IO required by the clicked control. The code to to suspend the thread is as follows: ``` private void StopSynchThread() { synchWaitHandle.Reset(); //various UI changes } private void updateSynchStat() { while (true) { synchWaitHandle.WaitOne(); try { updateSynch(); } } ``` What I would like to do is then restart the thread automatically, instead of by button press, as is currently done. What I'm trying to do is avoid having to restart the thread by conditionally calling `StartSynchThread()` within each of the "bazillion" UI event handlers. `StartSynchThread()` is defined as: ``` private void StartSynchThread() { synchWaitHandle.Set(); } ``` Is there a precedent or decent paradigm for handling this? Without any concept of how to do so, I was thinking that I could alter my function that performs the IO with the device to generate an event after it gets a response from the device, but that seems inelegant. Any ideas? I appreciate your insights. Thanks.
How would I stop a thread, allow a UI event to be handled, and then "restart" the thread?
CC BY-SA 2.5
null
2010-11-18T22:23:03.917
2010-11-18T22:30:26.127
null
null
416,190
[ "c#", "multithreading" ]
4,220,422
1
4,220,471
null
2
7,407
When I am drawing `UIImage* image` on UIView using the below code, the image is mirrored horizontally. It is like that if I draw 4, it is drawing like this ![alt text](https://i.stack.imgur.com/6MJnZ.png) .. ``` CGRect rect = CGRectMake(x, y, imageWidth, imageHeight); CGContextDrawImage((CGContextRef) g, rect, ((UIImage*)image).CGImage); ``` That is the problem??? I am doing wrong??? or if somebody know how to fix it, please let me also know. I very appreciate that in advance. Thanks a loooooooooot.
Image drawing problem when using CGContext. Image is mirrored horizontally
CC BY-SA 2.5
null
2010-11-18T22:47:07.340
2013-04-25T12:49:17.260
2010-11-18T23:30:38.713
106,435
417,294
[ "iphone", "drawing", "uiimage", "cgcontext" ]
4,220,719
1
4,222,400
null
1
469
If you see google finance or other such charts, they usually have a small pentagon on the chart that indicates when the divident was paid. ![alt text](https://i.stack.imgur.com/qfNVk.png) note the markers in the screenshot [http://www.google.com/finance?q=NASDAQ:INTC](http://www.google.com/finance?q=NASDAQ:INTC) In this link you will see A,B,C,D .... along the charts X-Axis. If you choose a larger data range say 2005- 2010 , then you will see blue divident markers along the x-Axis. Is there any thing in Flex that will allow us to do that ? What is that feature known as? Regards, Shah
Adding Custom Elements to Flex Charts
CC BY-SA 2.5
null
2010-11-18T23:26:59.923
2010-11-19T05:42:34.723
2010-11-19T05:42:34.723
87,002
345,522
[ "apache-flex", "charts", "element" ]
4,221,138
1
4,221,206
null
4
3,149
I'm trying to achieve this layout with CSS (without tables, I guess. Whatever). Any ideas? ![PUPPY!!](https://i.stack.imgur.com/2EC5P.png)
Vertically center a caption to the right of an image using CSS
CC BY-SA 2.5
null
2010-11-19T00:41:22.090
2012-01-30T13:05:52.673
null
null
25,068
[ "css", "vertical-alignment", "centering" ]
4,221,168
1
4,221,253
null
16
11,105
I am trying to use `geom_point` to illustrate the count of my data. I would also like to annotate a few of the points in my graph with `geom_text`. When I add the call to `geom_text`, it appears that it is plotting something underneath the points in the legend. I've tried reversing the order of the layers to no avail. I can't wrap my head around why it is doing this. Has anyone seen this before? ``` set.seed(42) df <- data.frame(x = 1:10 , y = 1:10 , label = sample(LETTERS,10, replace = TRUE) , count = sample(1:300, 10, replace = FALSE) ) p <- ggplot(data = df, aes(x = x, y = y, size = count)) + geom_point() p + geom_text(aes(label = label, size = 150, vjust = 2)) ``` ![alt text](https://i.stack.imgur.com/TbAMQ.jpg)
ggplot legend issue w/ geom_point and geom_text
CC BY-SA 3.0
0
2010-11-19T00:46:16.050
2014-10-14T10:09:01.457
2014-10-14T10:09:01.457
1,457,051
415,635
[ "r", "ggplot2", "legend" ]
4,221,200
1
4,226,846
null
2
1,403
I'm setting my MKMapView region inside the viewWillAppear: so that the map displays the good region right as soon as the user sees it: ``` [mapView setRegion:region animated:NO]; ``` The fist time I do it, I get the region trimmed like so: ![alt text](https://i.stack.imgur.com/QIhcf.png) Then from there on, when I set , I get something like this: ![alt text](https://i.stack.imgur.com/KiQBe.png) . My guess is the first time I set the region, the mapview isn't fully loaded or something along these lines. Any pointer of what I should do to fix this? This is probably related: adding an annotation to the mapView before a first call to viewDidAppear is made isn't working either. The pinView just doesn't show up. How can I make sure the map view is ready to be used within viewWillAppear?
MKMapView setRegion isn't constant
CC BY-SA 2.5
null
2010-11-19T00:54:18.863
2014-06-03T12:44:37.683
2010-11-19T15:58:08.687
87,158
87,158
[ "iphone", "mkmapview", "region" ]
4,221,439
1
4,221,456
null
9
24,646
I am looking a multi columns combo box by using HTML + JavaScript only. Is there any example or library available? As I came across some solution, they are in ASP.NET, but not pure HTML + JavaScript. Here is an example but it is implemented using Java Swing. ![alt text](https://i.stack.imgur.com/fpgK6.png)
Implement multi column combo box using HTML + JavaScript
CC BY-SA 2.5
0
2010-11-19T01:47:57.350
2010-11-19T02:28:08.360
null
null
72,437
[ "javascript", "html" ]
4,221,508
1
null
null
0
1,177
My DataGridView is not sorting my date column correclty and it doesn't seem to be sorting it by String either. The column is bound to a date property, all is done using the designer. The set which I'm viewing it on is 424 entries long, there should be two entries for each date and they should be next to each other (regardless if sorting by date or string) The last few dozen entries are sorted correctly but the initial entries are not. Initially every second entry at the start is correct. Here is an extract if some of the sorting it does. (The beginning of the sorted grid is on the left, and the end of grid is on the right) ![alt text](https://i.stack.imgur.com/x4Px2.png) I've no idea what is causing this, or how to fix it. Any ideas would be greatly appreciated! Thanks!
Databound DataGridView not sorting date correctly
CC BY-SA 2.5
null
2010-11-19T02:07:25.573
2016-05-08T06:57:17.907
2010-11-22T04:25:04.150
250,324
250,324
[ ".net", "vb.net", "sorting", "datagridview" ]
4,221,633
1
4,221,678
null
0
1,043
I am trying to do a plot in Mathematica of something like ``` x^2 + y^2 ``` with x, y € [-10, 10]. Besides showing the plot, I'd also like it to include points (for example, (0, 0)) painted in a different color. Point (0,0) would be shown as (0, 0, 0). Point (1, 1) would be shown as (1, 1, 2), etc. Here is what I am looking for: ![alt text](https://i.stack.imgur.com/VR1M3.png) How can I achieve this?
Making plots that also show up points/dots for specific coordinates
CC BY-SA 2.5
null
2010-11-19T02:33:31.177
2010-11-19T04:20:33.917
2010-11-19T03:03:17.810
130,758
130,758
[ "wolfram-mathematica" ]
4,221,660
1
4,222,684
null
2
5,563
I have created the following form with qt designer. I added a Add Files button that works with QDir and QFileDialog and loads files into a listWidget. ![alt text](https://i.stack.imgur.com/QAhuX.png) Here are my methods that fill this form with the files. ``` void RightDoneIt::changeDirectory() { /* select a directory using file dialog */ QString path = QFileDialog::getExistingDirectory (this, tr("Directory"), directory.path()); if ( path.isNull() == false ) { directory.setPath(path); fillList(); } } /*get list of file from given directory and the append it to listWidget */ void RightDoneIt::fillList() { ui->listWidget->clear(); ui->listWidget->addItems(directory.entryList()); } ``` I would like to modified my code so I can list the file location and the file size next to the file name and also to make this remove files button working. I just want to be able to choose files using ctrl or command key(for macs) and press delete to remove these files from my list. Do i have to use a QtreeWidget instead of listwidget ? What are the best practices for doing that ? any code suggestions ? Thank you all!
Browse, List and Delete files with qt
CC BY-SA 2.5
0
2010-11-19T02:42:09.060
2010-11-19T06:36:15.380
null
null
387,221
[ "c++", "qt", "qt4", "qt-designer" ]
4,222,057
1
4,222,085
null
4
5,011
This Is Not Homework. I have changed the names of the tables and fields, for illustrative purposes only. I admit that I am completely new to MySQL. Please consider that in your answer. The best way to illustrate the function of the query I need is like this: I have two tables. One table has a 0..1 to 0..n relationship to the other table. For Simplicities Sake Only, Suppose that the two tables were Recipe and Ingredient. One of the fields in the Ingredient table refers to the Recipe table, but may be null. Just For Example: ![alt text](https://i.stack.imgur.com/zfAcZ.png) I want to know the SQL for something like: Being brand new to The Structured Query Language, I'm not even sure what to google for this information. Am I on the right track with the following?: ``` SELECT COUNT(DISTINCT Recipe.ID) AS Answer FROM Recipe, Ingredient WHERE Ingredient.RecipeID=Recipe.ID AND Ingredient.Name='Olives' AND Ingredient.Amount=1 AND Ingredient.Name='Mushrooms' AND Ingredient.Amount=2 ``` I realize this is totally wrong because Name cannot be BOTH Olives And Mushrooms... but don't know what to put instead, since I need to count all recipes with both, but only all recipes with both. How can I properly write such a query for MySQL?
Counting Distinct Records Using Multiple Criteria From Another Table In MySQL
CC BY-SA 2.5
null
2010-11-19T04:20:44.173
2010-11-19T05:45:04.777
2010-11-19T04:39:00.567
247,029
247,029
[ "sql", "mysql", "relational-database" ]
4,222,410
1
4,223,117
null
0
4,293
I'm working chequePrinting project using windows-form, where one of my requirement is to print Cheque Receiving voucher by clicking print button, but it's giving me the print out of whole window form instead of giving only white part of the following image. ![alt text](https://i.stack.imgur.com/DUnl9.jpg) The code, which I'm using for print preview event handler is: ``` Graphics myGraphics = this.CreateGraphics(); Size s = this.Size; memoryImage = new Bitmap(s.Width, s.Height, myGraphics);// Graphics memoryGraphics = Graphics.FromImage(memoryImage); memoryGraphics.CopyFromScreen(label9.Location.X, label9.Location.Y, 52, 9, s); printPreviewDialog1.Document = PrintDoc1; PrintDoc1.PrintPage += printDocument2_PrintPage; printPreviewDialog1.ShowDialog() ``` Could anyone please tell how can I solve my problem?
How to print only tablelayoutpanel and label of windows form?
CC BY-SA 2.5
null
2010-11-19T05:40:10.197
2010-11-19T08:09:07.620
null
null
153,086
[ "c#", "project" ]
4,222,511
1
4,224,528
null
0
1,168
i want to display google map in android emulator. i also follow the step described in below link. [http://developer.android.com/guide/tutorials/views/hello-mapview.html](http://developer.android.com/guide/tutorials/views/hello-mapview.html) when i run my application it will not display google map. just display grids like below. ![alt text](https://i.stack.imgur.com/3cI4s.png) Please help me to show google map. thanks in advance.
android google map view problem
CC BY-SA 2.5
null
2010-11-19T06:05:13.763
2013-02-25T05:24:08.763
null
null
489,902
[ "android", "google-maps" ]
4,222,756
1
4,223,036
null
0
261
Suppose I have a UserControl `Editor` it has a `TextBox`. It also have a property `Content`. Here I just set the text content to a static value "Hey" ``` <UserControl x:Class="WpfApplication1.Editor" ...> <TextBox Text="Hey" /> <!--<TextBox Text="{Binding Content}" />--> </UserControl> ``` Then I have a Window to display all this. ``` <Window x:Class="WpfApplication1.Window1" ...> <StackPanel> <local:Editor Content="Heya" /> </StackPanel> </Window> ``` When I run it, I get ![alt text](https://i.stack.imgur.com/KvYVm.jpg) Its not even a TextBox? And why do I get the content set in `<local:Editor />`. I tried Clean & Rebuild solution and I still get this wierd thing.
TextBox in UserControl not rendering correctly
CC BY-SA 2.5
null
2010-11-19T06:47:53.120
2011-08-23T17:42:03.763
2011-08-23T17:42:03.763
305,637
292,291
[ "wpf", "binding", "user-controls", "textbox" ]
4,223,582
1
null
null
0
2,543
I am using Unix Language for scripting. I am in need of Unix Commands for FTP particular folder & its contents. Main Folder Contains many Sub-folders & Sub-folder contains many files inside. I need to FTP Main folder (with its Sub-folders & it's contents) to Local server using Unix Language. Or Suggest Command to FTP Particular & its contents to another Server in ![alt text](https://i.stack.imgur.com/uYQYQ.png)
How to FTP particular Folder ? ??
CC BY-SA 2.5
null
2010-11-19T09:21:15.287
2010-11-19T09:37:33.293
null
null
404,512
[ "unix" ]
4,223,700
1
4,223,804
null
0
1,325
I need to create downloading bar, when URL is loading on UIWebview to my application. I need to following format when URL is loading time to my application. ![alt text](https://i.stack.imgur.com/OaOcA.jpg)
How to create Downloading Bar to UIWebview
CC BY-SA 3.0
null
2010-11-19T09:38:23.460
2017-08-07T00:05:46.633
2017-08-07T00:05:46.633
472,495
409,571
[ "iphone" ]
4,223,838
1
4,224,155
null
9
963
So I've got a web applcation in the midst of wireframing, but I've run into an issue that requires a technical solution before I can solidify this model; that being: - User creates new 'text-field' element (a div with a max-width.) User then begins typing into said element until...- The element reaches it's max-width, the text drops to a new line and a 'new' background image (in the form of another div) is created (with it's opacity and position animated for effect) to accommodate the larger element sze. ![UX model concept](https://i.stack.imgur.com/jCY2Q.jpg) This is a rough outline of the intended functionality (given at this moment, I'm not sure how to have a text-field that behaves like a div with max-width yet) but ; I thought about checking on every 'keydown' event, but that seems inefficient... Does anyone have any advice or ideas for tackling something like this? Thanks!
How to check when a div resizes, using Javascript or Jquery
CC BY-SA 2.5
0
2010-11-19T09:53:58.653
2010-11-20T02:04:57.690
2010-11-19T10:01:38.277
371,525
371,525
[ "javascript", "jquery", "events" ]
4,223,860
1
4,224,029
null
1
1,317
my program has a picturebox, and I want, apon a mouse click, or on ContextMenuStrip choice, to make something appear at the same spot of the click. as seen in the picture, i would like to add some kind of a note on the specific clicked date area (probably add a user control) How do i go at it ? how can i send the click cordinates (x,y) and make something appear at these same coordinates ? Thanks ! ![alt text](https://i.stack.imgur.com/lqTno.jpg)
How to add a label apon mouse click on the same spot in C#?
CC BY-SA 2.5
null
2010-11-19T09:56:28.327
2010-11-19T10:21:23.537
null
null
437,997
[ "c#", ".net", "coordinates", "mouseclick-event", "onmouseclick" ]
4,223,953
1
6,425,092
null
1
1,194
I've always liked the ability to do simple calculations in the same place I'm entering a number when working in MS Money. ![alt text](https://i.stack.imgur.com/W6yYw.png) I know that [DevExpress](http://community.devexpress.com/blogs/theprogressbar/archive/2010/08/11/new-editor-controls-for-wpf-and-silverlight-coming-in-v2010-vol-2.aspx) is working on one, but don't want to buy the full WPF bloat only for this control. Do you know a control like that for WPF?
WPF Numeric Textbox control with a calculator?
CC BY-SA 2.5
null
2010-11-19T10:07:22.990
2011-06-21T12:17:35.183
2010-11-23T23:48:39.363
2,385
2,385
[ "wpf", "user-interface", "controls" ]
4,224,216
1
null
null
2
335
I am new to ANTLR and am trying to parse queries using the following ``` grammar SearchEngineQuery; options { language = CSharp2; output = AST; } tokens { AndNode; } LPARENTHESIS : '('; RPARENTHESIS : ')'; AND : 'and'; OR : 'or'; ANDNOT : 'andnot'; NOT : 'not'; NEAR : 'near'; fragment CHARACTER : ('a'..'z'|'0'..'9'|'-'); fragment QUOTE : ('"'); fragment WILDCARD : ('*'|'?'); fragment SPACE : (' '|'\n'|'\r'|'\t'|'\u000C'); WILD_STRING : (CHARACTER)* ( ('?') (CHARACTER)* )+ ; PREFIX_STRING : (CHARACTER)+ ( ('*') )+ ; WS : (SPACE) { $channel=HIDDEN; }; PHRASE : (QUOTE)(WORD)(WILDCARD)?((SPACE)+(WORD)(WILDCARD)?)*(QUOTE); WORD : (CHARACTER)+; startExpression : nearExpression; nearExpression : andExpression (NEAR^ andExpression)*; andExpression : (andnotExpression -> andnotExpression) (AND? a=andnotExpression -> ^(AndNode $andnotExpression $a))* ; andnotExpression : orExpression (ANDNOT^ orExpression)*; orExpression : notExpression (OR^ notExpression)* ; notExpression : (NOT^)? (phraseExpression | wildExpression | prefixExpression | atomicExpression); phraseExpression : (PHRASE^); wildExpression : (WILD_STRING^); prefixExpression : (PREFIX_STRING^); atomicExpression : WORD | LPARENTHESIS! andExpression RPARENTHESIS!; ``` This seems to work ok for general queries. However, the case of `a near (b or c)` needs to be actually handled as: ![alt text](https://i.stack.imgur.com/LaF7s.png) and `a near (b or c and (d or e))` needs to be handled as: ![alt text](https://i.stack.imgur.com/kufG5.png) I am unable to determine how to do this. Any help would be most appreciated. Thanks
ANTLR rewrite query text to repeat text with earlier nodes
CC BY-SA 2.5
0
2010-11-19T10:45:28.527
2012-01-19T20:40:44.947
2010-11-23T09:45:02.660
50,476
509,493
[ "antlr", "antlr3", "antlrworks" ]
4,224,301
1
4,228,080
null
0
603
I want to try to get nice buttons that will work similar to tabs down the bottom of my app, but I am wondering if there are buttons like this built in: ![](https://i.stack.imgur.com/DNv5F.png) It would make navigation better, and developing a lot easier & faster if they are.
Are there buttons like these built into the Android that Devs can use?
CC BY-SA 2.5
null
2010-11-19T10:59:07.227
2010-11-19T18:13:39.967
2010-11-19T11:46:28.360
348,261
348,261
[ "android", "button", "tabs", "navigation", "built-in" ]
4,224,418
1
4,224,431
null
0
410
I have this problem that my .php file is presented as clear text in the browser. I.e., the page is not transcoded in any way. This is my html-fil with a form ``` <html> <head> </head> <body> <form id="myForm" action="commentNoJQ.php" method="post"> Name: <input type="text" name="name" /> Comment: <textarea name="comment"></textarea> <input type="submit" value="Submit Comment" /> </form> <p>Click on the button to load result.html file:</p> <div id="stage" style="background-color:blue;"> STAGE </div> <input type="button" id="driver" value="Load Data" /> </body> </html> ``` This is my .php file that the form is posting to. This file is presented as it is in the browser: ``` <html> <head> </head> <body> <?php $myFile = "/Library/WebServer/testFile.txt"; $fh = fopen($myFile, 'w') or die("can't open file"); fwrite($fh, $_POST["name"]); fclose($fh); ?> </body> </html> ``` What is the problem? It's php-related sine when I create a normal html-file to post to, the normal file is processed as it should be. This is how it looks in the browser: ![alt text](https://i.stack.imgur.com/xey4t.png) I checked the logs (access_log, error_log), no info at all. Are there any other logs I should check? Using Apache 2.2 and Mac OSX 10.6.4 Thanks in advance! /Niklas
My HTML/php page is presented as clear text in browser
CC BY-SA 2.5
null
2010-11-19T11:14:27.130
2018-11-17T17:32:25.877
null
null
229,144
[ "php", "html", "apache" ]
4,224,449
1
null
null
1
1,107
There is a need for selecting specified number of points on the image (actually on the part of that image). Darker parts of the image are more important. The easiest way of doing this is by selecting them randomly. But even dropping used points usually finished with some points being located too close to others especially when respecting weights. Maybe after selecting the point the weight should be decreased dynamically? Haven't tried. I've noticed that original image has too many different colors so I wanted to smooth it to cut off similar colors. However converting to grayscale was not enough. I used [Emgu CV](http://www.emgu.com/) (OpenCV wrapper) functions to binarize image. Than I tried to calculate watershed but calculated areas are not so easy to separate. Generally watershed is pretty 'non-intuitive' approach to detect darker places. Simply: I would like to mark points on the image starting from darker parts - that parts should be marked more frequently than lighter. Points should be scattered over group of colors that are similar to avoid being piled-up in nearby places. The algorithm doesn't have to be accurate. It can give different results in next iterations. Number of points would not be very big from 10 to 150-200. How to calculate specified number of points scattered on the image starting from the darker regions? To visualize what I mean see the picture below. It contains selected points (qty. ~20). Mostly darker parts are selected. The points don't have to appear on the same locations after next iteration. But what I want is to select points on lighter regions when number of them would be higher. Of course for different images the numbers of points needed to jump out of darkness would differ. ![Picture after points selection](https://i.stack.imgur.com/rLP6X.jpg)
Selecting points on image parts by color weight
CC BY-SA 2.5
null
2010-11-19T11:18:59.490
2012-04-12T11:04:29.897
2010-11-22T07:54:52.320
469,961
469,961
[ "c#", "image-processing", "opencv", "emgucv" ]
4,224,616
1
4,226,748
null
0
1,511
I am having a tableView which lists the contents directory which includes jpg, pdf, zip, mp3, mp4, sql,.. files and even folders. In the next step, I am having a detailView which displays some properties of the selected file such as fileName, fileSize, filePath, fileType. Everything works perfect. But actually I have included an additional option in the detailView. That is, 1. If the selected file in the tableView is a image file, it opens an imageView in the detailView to display that image. 2. If the selected file is a mp3, it opens a player to play the song in the detailView. 3. If the selected file is a video or mp4 file, it opens a player to play that video in detailView. 4. For other files, it pushes an alertView regarding that it is an unknown file. (and I got stuck here..) 5. If the selected item is a folder, it should again open a tableView which displays the contents of the folder. That is, it should open the subfiles and subfolders in a tableView which should be a recursive function. Please help me to do this.. I think my screen shots may give some ideas. This is my tableView listing the contents of my directory.. ![alt text](https://i.stack.imgur.com/O9KqV.png) where "SQLTutorial" is a folder in the above list This is the detailView of an image file ![alt text](https://i.stack.imgur.com/cvawz.png) This is the detailView of a video file ![alt text](https://i.stack.imgur.com/qTBeQ.png) This is the detailView of an audio file ![alt text](https://i.stack.imgur.com/4d0hs.png) Please help me to complete the process with some sample codes to view the folders and subfolders in a tableView. Thank you in advance.
iPhone - Work with subfolder
CC BY-SA 2.5
0
2010-11-19T11:42:36.467
2012-02-21T23:59:50.307
null
null
500,625
[ "iphone", "uitableview", "detailsview" ]
4,224,910
1
4,225,873
null
0
599
I have a small problem with a list of tags into a wordpress blog! My list of tags are contained into a fixed width UL. I would like to avoid word-wrap like for the tag "Human Resources"... I would prefer that the entire tag goes on a second line. ![alt text](https://i.stack.imgur.com/vavej.png) I'm using the function the_tags like this : ``` <?php the_tags('<ul id="my-tags"><li class="cute-tag">','</li><li class="cute-tag">','</li></ul>'); ?> ``` My Css ``` #my-tags{ margin:0; width:350px; float:left; } #my-tags li { display: inline; font-family: Verdana, Arial,sans-serif; text-transform:uppercase; font-size: 10px; margin-right:5px; font-weight:600; padding:4px; background:#2d0e0f; list-style-type: none; -moz-border-radius: 4px; -webkit-border-radius: 4px; } #my-tags li a{ color:#FFFFFF; text-transform:uppercase; font-weight:100; font-style: normal; } #my-tags li a:hover{ text-decoration:none; } ``` Thanks in advance for your time. Cheers, Jk_
Problem with tags list <li> inside a fixed width UL
CC BY-SA 2.5
null
2010-11-19T12:23:19.997
2010-11-19T14:21:12.833
null
null
345,901
[ "html", "css", "wordpress" ]
4,224,917
1
4,226,069
null
2
15,037
I am trying to put some spinboxes,line edits in a layout. But the size extends more than the neccesity. Below is the figure ![alt text](https://i.stack.imgur.com/dP11u.jpg) Here I am adding a QScrollArea widget,and a QVBoxLayout into a QHBoxLayout. Then I am adding the line edits,spin boxes into the QVBoxLayout. But I want to reduce the width as 2/10 of the total width. Can anybody help me in this?
Qt - How to control the widget sizes in QLayout
CC BY-SA 2.5
0
2010-11-19T12:23:57.100
2010-11-19T22:47:45.900
null
null
344,822
[ "c++", "user-interface", "qt" ]
4,224,933
1
4,224,975
null
12
8,974
I am intersted in building some text based GUIs, things that look like the terminal, but has functions like selecting rows and performing actions. You know, things like htop and atop, ex: ![atop](https://lh5.ggpht.com/_fF0LO28FGYY/Sc6CBjZICQI/AAAAAAAAAhE/9GcnTxk9J7w/s800/atop.png) ![htop](https://lh6.ggpht.com/_fF0LO28FGYY/Sc6CB_3MSVI/AAAAAAAAAhM/NRhi8koSdEk/s800/htop.png) Any resource on that?
"htop" style gui with python, how?
CC BY-SA 3.0
0
2010-11-19T12:26:19.893
2020-03-26T17:36:48.447
2017-02-08T14:31:02.370
-1
513,449
[ "python", "user-interface", "text" ]
4,225,072
1
4,225,096
null
37
16,704
From the project "MarkdownEditorTest" I am trying to refer to controls from another project called "MarkdownEditor" but am getting the "Undefined CLR namespace" error as seen in the image below. Isn't the way to refer to that project something like below? ``` xmlns:me="clr-namespace:MarkdownEditor" ``` ![](https://imgur.com/YPrFO.jpg)
Referring to another project in XAML: Undefined CLR namespace
CC BY-SA 4.0
0
2010-11-19T12:42:03.307
2021-01-27T19:35:31.447
2021-01-27T19:34:48.367
3,195,477
292,291
[ "wpf", "xaml" ]
4,225,164
1
4,225,200
null
2
4,258
It’s been days that I’m working on a project which I have to use convex hull in it, and specific method of graham scan. The problem has been solved till the place I want to sort the points. So the story is that I have collected bunch of points which they are from the type Point and their coordinates are relatives. Mean they come from the mouse event x and y. So I have collected the mouse positions as x and y of the points. And I want to find the angle related to the pivot point. Does anyone have a piece of code to calculate that angle? Many and many thanks, the image below is what I need: ![Angles over pivote](https://i.stack.imgur.com/EUHRs.jpg)
find the angle of point related to pivot
CC BY-SA 2.5
null
2010-11-19T12:51:47.530
2010-11-19T13:17:33.660
2010-11-19T13:11:11.733
276,052
435,245
[ "java", "math", "trigonometry" ]
4,225,272
1
4,227,073
null
0
223
I have a very specific problem. I had a django project which was running the application [django-brookie](https://github.com/bread-and-pepper/django-brookie). Everything worked fine. I have since added [django-grappelli](http://code.google.com/p/django-grappelli/) to my project and everything works except for one small thing. If you create a new invoice or quote it should total up the amount in your currency automatically. This is not working anymore and I really can't figure out why. Perhaps something with brookie's javascript clashing with grappelli's javascript? Any suggestions welcome and if you need more info just ask. Here is a screenshot of the items. When I place time in minutes it totals up without grappelli:![alt text](https://i.stack.imgur.com/6tWt0.jpg) Here you can see when I put in my time it doesn't total up anything. This has grappelli as you can see in the screenshot:![alt text](https://i.stack.imgur.com/vQwbg.jpg)
django-grappelli and django-brookie together cause the items for invoice and quote not to total up automatically
CC BY-SA 2.5
null
2010-11-19T13:06:29.710
2010-11-19T16:27:20.717
null
null
234,543
[ "javascript", "django", "django-grappelli" ]
4,225,355
1
4,227,751
null
0
130
I have used jCarousel to create what? A carousel. Then, the boss wanted me to create some selectors so that the user could select different lists of the results (as if it were the same carousel, but showing different results). The strategy I used was simple: I created multiple carousels and hide them. Only the selected carousel will appear. It works fine except for one thing: In Firefox (and now in IE8) I am forced to change to another tab of the browser and then get back or change the window size if I want to to see it the it should. Of course, this is not the kind of thing that a user guesses or even tolerates. ## EDIT Here's what I am trying to achieve: ![Second tab selected](https://webtiago.com/teste/Capture.png) ![First tab selected](https://webtiago.com/teste/Capture2.png) Here's what is wrong: ![The problem](https://webtiago.com/teste/problem.png) When I change tabs in the browser or change the size of the window, it starts working correctly. I believe that if I call and an handler for an event (like resize window, tabchanged or something like that). What do you think? ## More data : I am not sure if this will be relevant to the case, but I am using jCarousel. The element that an incorrect width is the corresponding unordered list that contains the elements that you see in the images above.
Have to change tabs in order to HTML appear properly
CC BY-SA 4.0
0
2010-11-19T13:18:41.420
2022-02-24T13:33:33.547
2022-02-24T13:33:33.547
4,370,109
169,034
[ "javascript", "jquery", "firefox", "jquery-events", "jcarousel" ]
4,225,389
1
4,226,594
null
8
38,054
All I want to do is . I've tried all the of suggestions on [this question](https://stackoverflow.com/questions/4166648/why-doesnt-a-simple-click-function-work-in-extjs) plus all I could find elsewhere but in the ways described below. [: For the sake of others who may find this question later, I'll add some comments inline to make this easier to decipher --@bmoeskau] doesn't execute handler: ``` var menuItem1 = new Ext.Panel({ id: 'panelStart', title: 'Start', html: 'This is the start page.', cls:'menuItem', listeners: { click: function() { alert('ok'); } } }); ``` [Ed: `click` is not a Panel event] doesn't execute handler: ``` var menuItem1 = new Ext.Panel({ id: 'panelStart', title: 'Start', html: 'This is the start page.', cls:'menuItem', listeners: { render: function(c) { c.body.on('click', function() { alert('ok'); }); } } }); ``` [Ed: The Panel is never being rendered -- add renderTo config. Next, you'll hit a null error telling you that `c` is not a valid variable. Do you mean `menuItem1` instead?] doesn't execute handler: ``` var menuItem1 = new Ext.Panel({ id: 'panelStart', title: 'Start', html: 'This is the start page.', cls:'menuItem' }); Ext.getCmp('panelStart').on('click', function() { alert('ok'); }); ``` [Ed: `click` is not a Panel event. Also, the Panel is not yet rendered, so if you switched the callback to be on the element rather than the Component you'd get a null error.] gets error: Ext.get('panelStart') is null: ``` var menuItem1 = new Ext.Panel({ id: 'panelStart', title: 'Start', html: 'This is the start page.', cls:'menuItem' }); Ext.get('panelStart').on('click', function() { alert('ok'); }); ``` [Ed: It's not rendered, see above. Switching from `getCmp` to `get` means you are switching from referencing the `Component` (which does exist, but does not have a `click` event) to referencing the `Element` (which does have a `click` event, but is not yet rendered/valid).] makes the panel disappear: ``` var menuItem1 = new Ext.Panel({ id: 'panelStart', title: 'Start', html: 'This is the start page.', cls:'menuItem', listeners: { 'render': { fn: function() { this.body.on('click', this.handleClick, this); }, scope: content, single: true } }, handleClick: function(e, t){ alert('ok'); } }); ``` [Ed: The scope being passed into the callback (`content`) is not a valid ref in this code (this was copy-pasted incorrectly from another sample). Since the Panel var is created as `menuItem1` and the callback is intended to run in the panel's scope, scope var should be `menuItem1`. Also, this Panel is never rendered, see prev comments.] gives the error "Ext.fly(menuItem1.id) is null": ``` var menuItem1 = new Ext.Panel({ id: 'panelStart', title: 'Start', html: 'This is the start page.', cls:'menuItem' }); Ext.fly(menuItem1.id).addListener('click', Ext.getCmp(menuItem1.id) , this); ``` [Ed: Panel is not rendered, see above] ...put outside Ext.onReady()... gets error: Ext.getCmp('panelStart') is null ``` Ext.getCmp('panelStart').on('click', function() { alert('okoutside'); }); ``` [Ed: Panel is likely not rendered at the time this code is run. Also, `click` is not a Panel event.] ...put outside Ext.onReady()... gets error: Ext.get('panelStart') is null ``` Ext.get('panelStart').on('click', function() { alert('okoutside'); }); ``` [Ed: See above] ...put outside Ext.onReady()... gets error: Ext.fly('panelStart') is null ``` Ext.fly('panelStart').on('click', function() { alert('okoutside'); }); ``` [Ed: See above] For the last three, I checked in Firebug and `<div id="startPanel">` exists: ![alt text](https://i.stack.imgur.com/Eo5JM.png) # It works with JQuery: So with JQuery I simply have to do this and it works: ``` $('body').delegate(('#panelStart'), 'click', function(){ alert('ok with jquery'); }); ``` [Ed: This is not a good approach. It's simply delaying attaching of the handler until later, when the element actually shows up in the DOM (which could also be done via Ext btw, but would still not be the proper approach). I spelled out the correct approach, as linked in my answer below. The OP's attempts are all very close, but each is missing one or two key pieces.]
How do I attach an event handler to a panel in extJS?
CC BY-SA 2.5
0
2010-11-19T13:22:30.800
2015-11-18T19:23:55.720
2017-05-23T12:24:41.003
-1
4,639
[ "events", "extjs", "event-handling" ]
4,225,764
1
4,511,028
null
2
846
I'm attempting to create a grid of availability from a number of tables to present information as follows: ``` ------------------------------------------------------ venue | 22/11 | 23/11 | 24/11 | 25/11 | 26/11 | ------------------------------------------------------ Some venue | £24 | £25 | £32 | N/A | £65 | ------------------------------------------------------ Some venue | £20 | N/A | £22 | £34 | £43 | ------------------------------------------------------- ``` For each venue I can create a recordset for the selected date period using a query such as: ``` SELECT temp_date.queryDate, availability.venueId FROM temp_date LEFT JOIN availability ON temp_date.queryDate = availability.date AND availability.venueId = 7 GROUP BY temp_date.queryDate ORDER BY temp_date.queryDate; ``` The key here being that I can return a null value for any dates that are unavailable whilst keeping my recordset to the correct number of days (ie. 5 entries for a working week). To add each of the other venues to this list I was considering simply using a UNION query to combine the datasets into one like so: ``` (SELECT temp_date.queryDate, availability.venueId FROM temp_date LEFT JOIN availability ON temp_date.queryDate = availability.date AND availability.venueId = 7 GROUP BY temp_date.queryDate ORDER BY temp_date.queryDate) UNION (SELECT temp_date.queryDate, availability.venueId FROM temp_date LEFT JOIN availability ON temp_date.queryDate = availability.date AND availability.venueId = 8 GROUP BY temp_date.queryDate ORDER BY temp_date.queryDate); ``` My concern with this is with say 10 different venues that could be queried then the query could take quite a long time to run through. So my question is as follows: Is a UNION query my only option here or is there some alternative JOIN I can use to ensure that I get a full weeks results for all the venues being queried. Hopefully this is clear :-S To indicate what I'm after below are screenshots of the recordset required and current query: ![alt text](https://i.stack.imgur.com/NOPVT.jpg) ![alt text](https://i.stack.imgur.com/qSFYo.jpg) Using IN() as suggested: ![alt text](https://i.stack.imgur.com/ecTTg.jpg)
Creating a grid of data with php/mysql - union queries?
CC BY-SA 2.5
0
2010-11-19T14:10:24.813
2010-12-22T16:01:57.320
2010-11-19T14:36:59.850
255,755
255,755
[ "php", "mysql", "union" ]
4,226,035
1
4,247,129
null
11
10,923
I have a recursive query which executes very fast if the `WHERE` clause contains a constant but becomes very slow if I replace the constant with a parameter having the same value. ``` ;WITH Hierarchy (Id, ParentId, Data, Depth) AS ( SELECT Id, ParentId, NULL AS Data, 0 AS Depth FROM Test UNION ALL SELECT h.Id, t.ParentId, COALESCE(h.Data, t.Data), Depth + 1 AS Depth FROM Hierarchy h INNER JOIN Test t ON t.Id = h.ParentId ) SELECT * FROM Hierarchy WHERE Id = 69 ``` ``` DECLARE @Id INT SELECT @Id = 69 ;WITH Hierarchy (Id, ParentId, Data, Depth) AS ( SELECT Id, ParentId, NULL AS Data, 0 AS Depth FROM Test UNION ALL SELECT h.Id, t.ParentId, COALESCE(h.Data, t.Data), Depth + 1 AS Depth FROM Hierarchy h INNER JOIN Test t ON t.Id = h.ParentId ) SELECT * FROM Hierarchy WHERE Id = @Id ``` In case of a table with 50,000 rows the query with the constant runs for 10 milliseconds and the one with the parameter runs for 30 seconds (3,000 times slower). It is not an option to move the last `WHERE` clause to the anchor definition of the recursion, as I would like to use the query to create a view (without the last `WHERE`). The select from the view would have the `WHERE` clause (`WHERE Id = @Id`) - I need this because of Entity Framework, but that is another story. Can anybody suggest a way to force query #2 (with the parameter) to use the same query plan as query #1 (with the constant)? I already tried playing with indexes but that did not help. If somebody would like I can post the table definition and some sample data as well. I am using SQL 2008 R2. Thank you for your help in advance! ![alt text](https://i.stack.imgur.com/4kSgQ.png) ![alt text](https://i.stack.imgur.com/QxioY.png)
Why does a query slow down drastically if in the WHERE clause a constant is replaced by a parameter (having the same value)?
CC BY-SA 2.5
0
2010-11-19T14:40:19.700
2010-11-22T15:37:45.530
2010-11-20T09:35:53.970
513,599
513,599
[ "sql", "sql-server-2008", "where-clause" ]
4,226,127
1
4,226,190
null
2
151
How is it possible, that 2 ellipses with the same Radius where not (visually) with the same Radius? in the image bellow, Black and Red ellipses has the same RadiusX... but look on the picture! ![alt text](https://i.stack.imgur.com/gmo49.jpg) ``` <GeometryDrawing Brush="Red"> <GeometryDrawing.Pen> <Pen Brush="Yellow" Thickness="1"/> </GeometryDrawing.Pen> <GeometryDrawing.Geometry> <GeometryGroup> <EllipseGeometry x:Name="MediumCircle" Center="0,0" RadiusX="4" RadiusY="4" /> </GeometryGroup> </GeometryDrawing.Geometry> </GeometryDrawing> <GeometryDrawing Brush="Black"> <GeometryDrawing.Geometry> <GeometryGroup> <EllipseGeometry x:Name="SmallCircle" Center="0,0" RadiusX="4" RadiusY="2"/> </GeometryGroup> </GeometryDrawing.Geometry> </GeometryDrawing> ```
WPF Drawing Paradox
CC BY-SA 2.5
null
2010-11-19T14:51:20.700
2010-11-19T15:03:30.340
null
null
185,593
[ "wpf", "drawing", "paradox" ]
4,226,276
1
4,226,332
null
1
5,411
I am working through a facebook-sdk example and trying to utilize the collection of classes as provided as a .JAR. I am relatively new to java and eclipse so I expect I am making some obvious blunder. The issue is that everything seems to compile fine, but when I run the project (using the android emulator) dalvik vm is unable to find the first class I reference from this facebook sdk. ( com/facebook/android/Facebook.class ) As an aside, if I copy the source directly into my project as an additional package everything works fine. Step 1: I exported the com_facebook_android project as a .JAR file. ( right click project, export, java / jar file ) I choose c:\data\jag\jar as my location to save facebooksdk.jar. Step 2: I hit properties on the project HelloGoogleMaps, Selected Java Build Path, Libraries, Add External JARS... I the directly selected the c:\data\jag\jar\facebooksdk.jar file. At this point my project seems to be building just fine ( no errors ). ![alt text](https://i.stack.imgur.com/4zowf.png) Step 3: Debug the project and receive the error: [2010-11-19 09:05:08 - Example] ActivityManager: Error: Activity class {com.facebook.android/com.facebook.android.Example} does not exist. [2010-11-19 09:05:11 - Example] Starting activity com.facebook.android.Example on device [2010-11-19 09:05:12 - Example] New package not yet registered with the system. Waiting 3 seconds before next attempt. [2010-11-19 09:05:15 - Example] Starting activity com.facebook.android.Example on device [2010-11-19 09:05:17 - Example] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.facebook.android/.Example } [2010-11-19 09:05:17 - Example] New package not yet registered with the system. Waiting 3 seconds before next attempt. [2010-11-19 09:05:20 - Example] Starting activity com.facebook.android.Example on device [2010-11-19 09:05:21 - Example] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.facebook.android/.Example } [2010-11-19 09:05:21 - Example] ActivityManager: Error type 3 [2010-11-19 09:05:21 - Example] ActivityManager: Error: Activity class {com.facebook.android/com.facebook.android.Example} does not exist. SHAWN -- Here are the Android properties for my project. ![alt text](https://i.stack.imgur.com/KEkww.png)
Android:Java Unable to find class at runtime from JAR I created
CC BY-SA 2.5
0
2010-11-19T15:07:55.940
2010-11-22T01:50:51.887
2010-11-21T15:40:51.043
104,975
104,975
[ "java", "android", "eclipse", "jar" ]
4,226,356
1
4,226,473
null
9
3,316
I'm struggling to find a rock solid solution to detecting collisions between a circle and a circle segment. Imagine a Field of View cone for a game enemy, with the circles representing objects of interest. The diagram at the bottom is something I drew to try and work out some possible cases, but i'm sure there are more. I understand how to quickly exlude extreme cases, I discard any targets that don't collide with the entire circle, and any cases where the center of the main circle is within the target circle are automatically true (E in the diagram). I'm struggling to find a good way to check the rest of the cases. I've tried comparing distances between circle centers and the end points of the segments outer lines, and i've tried working out the angle of the center of the target circle from the center of the main circle and determining whether that is within the segment, but neither way seems to catch all cases. Specifically it seems to go funky if the target circle is close to the center but not touching it (somewhere between E and B below), or if the segment is narrower than the target circle (so that the center is within the segment but both edges are outside it). Is there a reliable method for doing this? The segment is described by position P, orientation O (whose magnitude is the circle radius), and a view size, S. My most successful attempt to date involved determining the angles of the vectors ca1 and ca2, and checking if either of them lies between the angles of vectors a1 and a2. This works for some cases as explained above, but not situations where the target circle is larger than the segment. After implementing the best suggestion from below, there is still a false positive which I am unsure how best to eliminate. See the pink diagram below. The circle in the lower right is reporting as colliding with the segment because it's bounds overlap both half spaces and the main circle. ![collision types](https://i.stack.imgur.com/4ZCBt.png) ![current solution](https://i.stack.imgur.com/jLc9e.png) ![false positive](https://i.stack.imgur.com/NgIAE.png) ![edge case](https://i.stack.imgur.com/mH2Mv.png) --- ## Final Edit After discovering another edge case (4th image), i've settled on an approach which combines the two top answers from below and seems to cover all bases. I'll describe it here for the sake of those who follow. First exclude anything that fails a quick circle-to-circle test. Then test for collision between the circle and the two outer lines of the segment. If it touches either, return true. Finally, do a couple of point-to-halfspace tests using the center of the circle and the two outer lines (as described by Gareth below). If it passes both of those it's in, otherwise return false.
Circle to Circle Segment Collision
CC BY-SA 2.5
0
2010-11-19T15:17:54.533
2010-11-23T20:58:41.800
2010-11-23T20:58:41.800
151,111
151,111
[ "algorithm", "collision-detection", "trigonometry", "geometry", "game-physics" ]
4,226,813
1
4,227,268
null
0
814
I would like to re-design my application into components, so it is more modular and easier to re-use in the future, but I've never really designed applications, so I don't really know how I should do this. Here is a brief description of the application: - The purpose of the Application is to allow the User to create "Events" that are going to be stored locally on the Device and sent over the network.- The User can interact with the application through 2 Activities: A "NewEventActivity" that allows him to create the new Events and a "LogbookActivity" that allows him to browse previously created Events.- The local storage should be handled by a SQLite Database- The Event should be sent in a specific Binary format.- Other applications should be able to Use the Sending component to Format and send other type of messages in the same format. This drawing represents how I was thinking of organizing the components. Boxes represent components, and arrows represent interactions without those components. ![alt text](https://i.stack.imgur.com/GW9BV.png) Here are my questions: - - - Thank you!
Android components-based application design: How should I represent this model?
CC BY-SA 2.5
null
2010-11-19T16:03:39.337
2010-11-19T16:45:42.093
null
null
488,054
[ "android", "components" ]
4,226,852
1
4,230,118
null
0
5,001
The question says it all: My canvas application has been configured to enable the OAuth 2.0 for Canvas (beta) among other things. ![alt text](https://i.stack.imgur.com/7LPQj.png) This means I am getting the `signed_request` parameter on my iframe which I am successfully reading. From the [oficial documentation on canvas authentication](http://developers.facebook.com/docs/authentication/canvas) > The signed_request parameter is the concatenation of a HMAC SHA-256 signature string, a period (.), and a base64url encoded JSON object. There is a php code in the documentation which decodes the `signed_request` but I haven't been able to implement it propertly in C# partly beacuse to be honest I prefer not to reinvet the wheel but to use someone else code that has been already tested. This is where my quest for a good C# Facebook SDK started again (since facebook changes everything every few months librarys get usually obsolete). I have used the codeplex's [Facebook Developer Toolkit](http://facebooktoolkit.codeplex.com/) in the past but it seems to be getting outdated ans the lastest stable release is very old (in facebook API time) Some months ago used the [Oficial Facebook C# SDK](http://github.com/facebook/csharp-sdk) from GitHub but it lacks completly the authentication support. Now I have found on Nuget and really liked the Facebook C# SDK from [Nathan Totten](https://stackoverflow.com/users/75505/nathan-totten) who is one of the [top Facebook Experts](https://stackoverflow.com/tags/facebook/topusers) here in StackOverflow. If you Nathan read this (or anyone that also uses this sdk), how can I use this SDK to get an access token to use in my canvas app. Anyway if there is a better way to get a token, maybe with the Javascript library please let me ( and the people who wonder the same as me ) know.
Get oAuth 2.0 access token from asp.net webforms iframe canvas application
CC BY-SA 2.5
null
2010-11-19T16:06:37.950
2010-11-19T22:53:57.007
2017-05-23T11:55:10.850
-1
186,133
[ "facebook", "facebook-graph-api", "webforms", "facebook-c#-sdk", "facebook-authentication" ]
4,227,064
1
4,227,355
null
0
253
On one page on my site, I have a table in the right column that is too wide and rather than showing scrollbars, IE is wrapping it below the content in the left column. I can't find a fix for this because I don't know how to describe what's happening. Here's the code I'm using to demonstrate the problem: ``` <style> #col1 { float: left; width:189px; font-size:8pt;} #col3 { width: auto; margin: 0 0 0 191px; } </style> <body> <div id="col1"> <div style="padding-top:30em;border:1px solid red">really tall</div> </div> <div id="col3"> <h1>title</h1> <table border="1"> <tr> <td>aaaaaaaaaa</td><td>aaaaaaaaaa</td> <td>aaaaaaaaaa</td><td>aaaaaaaaaa</td> <td>aaaaaaaaaa</td><td>aaaaaaaaaa</td> <td>aaaaaaaaaa</td><td>aaaaaaaaaa</td> <td>aaaaaaaaaa</td><td>aaaaaaaaaa</td> <td>aaaaaaaaaa</td><td>aaaaaaaaaa</td> <td>aaaaaaaaaa</td><td>aaaaaaaaaa</td> <td>aaaaaaaaaa</td><td>aaaaaaaaaa</td> <td>aaaaaaaaaa</td><td>aaaaaaaaaa</td> <td>aaaaaaaaaa</td><td>aaaaaaaaaa</td> <td>aaaaaaaaaa</td><td>aaaaaaaaaa</td> </tr> </table> </div> </body> ``` And here's how it renders in IE: ![](https://i.stack.imgur.com/IMajS.png) In all other browsers, the table of a's shows just under "title" and I get a horizontal scrollbar. This is what I'd expect, but for some reason, IE wants to clear the content in col1. I've tried applying widths, floats, etc, but I can't get IE to put the table under the title without clearing the col1 content. I assume there's some IE hack for this, but what is it?
Unwrappable float is clearing in IE, but renders with scrollbars in all other browsers
CC BY-SA 2.5
null
2010-11-19T16:26:41.357
2010-11-19T17:16:01.013
null
null
150,445
[ "css", "internet-explorer", "css-float" ]
4,227,185
1
4,229,096
null
1
2,283
I give... after days trying to figure out what I'm missing I give up. I cannot figure out how to get my simple container control to properly display in the designer. Here is the basic markup of the custom control: ``` <div> <div>Title</div> <div> <!-- ASP.Net child controls --> </div> </div> ``` Here is how it looks at runtime (title and then the child control is a GridView): ![alt text](https://i.stack.imgur.com/TLbfC.jpg) Here is the simple code for the basic container control: ``` namespace Shoe.Controls { //[Designer(typeof(ApplicationWindowDesigner))] //[ParseChildren(false)] //[PersistChildren(true)] [ToolboxData("<{0}:ApplicationWindow runat=\"server\"></{0}:ApplicationWindow>")] public class ApplicationWindow : System.Web.UI.WebControls.Panel { #region Designer Properties [Category("Appearance")] [DefaultValue("Application")] [Description("Title that will appear at the top of the Window.")] [Browsable(true)] /* public string Title { get{return (ViewState["ApplicationWindowTitle"] == null)? string.Empty : (string)ViewState["ApplicationWindowTitle"];} set{ViewState["ApplicationWindowTitle"] = value;} } */ public string Title {get; set;} #endregion #region Rending Methods /* protected override void Render(HtmlTextWriter writer) { this.EnsureChildControls(); writer.Write("<div class=\""+CssClass+"\" style=\"width: "+Width+"; height: "+Height+";\"><div>"+Title+"</div><div>"); RenderChildren(writer); writer.Write("</div></div>"); } */ public override void RenderBeginTag(HtmlTextWriter writer) { writer.Write("<div class=\""+CssClass+"\" style=\"width: "+Width+"; height: "+Height+";\"><div>"+Title+"</div><div>"); //base.RenderBeginTag(writer); } public override void RenderEndTag(HtmlTextWriter writer) { //base.RenderEndTag(writer); writer.Write("</div></div>"); } #endregion } } ``` As you see the code above, it is currently based off of the Panel control. However, I have also tried just using WebControl as the base class and then providing my own designer as follows: ``` namespace Shoe.Controls { public class ApplicationWindowDesigner : ContainerControlDesigner //public class ApplicationWindowDesigner : ControlDesigner { /* public override void Initialize(IComponent component) { base.Initialize(component); SetViewFlags(ViewFlags.DesignTimeHtmlRequiresLoadComplete, true); } public override string GetDesignTimeHtml() { //return base.GetDesignTimeHtml(); StringBuilder sb = new StringBuilder(); TextWriter s = new StringWriter(sb); HtmlTextWriter h = new HtmlTextWriter(s); ApplicationWindow app_wnd = (ApplicationWindow)this.Component; app_wnd.RenderControl(h); h.Dispose(); s.Dispose(); return sb.ToString(); } */ /* public override string GetDesignTimeHtml(DesignerRegionCollection regions) { //return base.GetDesignTimeHtml(regions); ApplicationWindow app_wnd = (ApplicationWindow)this.Component; / return GetDesignTimeHtml(); } */ } } ``` As you can see, I've tried using ControlDesigner as the base class and ContainerControlDesigner as the base class. When I use the ControlDesigner I get the designer to properly render my title bar and divs; however it does not render the child controls (GridView). If I use ContainerControlDesigner it renders the child controls, but not the title bar and divs. I cannot figure out the magic combination that will give me a designer that renders my surrounding frame and the child controls. Here is what it looks like in the designer when using the Panel as the base class for the control, no designer, and the Begin / End tag approach: ![alt text](https://i.stack.imgur.com/jkF0k.jpg) This is also what it looks like when I use WebControl as the base class for the control and use a designer based off of ContainerControlDesigner (child controld, but my title bar and divs are missing). What am I missing? I've found several examples of ContainerControlDesigner but none of them really add anything to the surrounding control like I am.
ASP.Net Container Control Designer
CC BY-SA 2.5
0
2010-11-19T16:37:21.470
2010-11-19T20:27:11.077
null
null
77,725
[ "asp.net", "custom-controls", "containers", "designer", "design-time" ]
4,227,299
1
4,238,436
null
1
264
Hi iam trying to use de NameScope.SetNameScope to start an animation in a xaml for a Silverligth application, but it seems like the visual studio does not recognise the NameScope.SetNameScope, why is that? ![alt text](https://i.stack.imgur.com/Rbod1.jpg)
NameScope.SetNameScope Not found
CC BY-SA 2.5
null
2010-11-19T16:48:07.883
2010-11-21T14:47:49.163
2010-11-21T14:47:49.163
17,516
333,838
[ "silverlight", "silverlight-4.0" ]
4,227,317
1
4,227,599
null
0
814
In a WPF label, is aligned like this, that if the font size is increased, the label size increases in -right. ![alt text](https://i.stack.imgur.com/vCbni.jpg) Is there a possibility to make it increase in -right direction? PS. The labels are contained in a `Canvas`.
WPF Label content alignment
CC BY-SA 4.0
null
2010-11-19T16:49:23.157
2019-05-03T13:30:39.163
2020-06-20T09:12:55.060
-1
185,593
[ "wpf", "wpf-controls" ]
4,227,424
1
4,227,701
null
5
10,098
I've been trawling the internet looking for an answer for several hours, but I can't seem to find anyone who has been able to solve this. I've got a listview which uses a custom adapter. A row looks like this ![alt text](https://i.stack.imgur.com/ugvGc.png) The list is filled by an array. Everything works great. Now, I want the ImageView and the ToggleButton to react to clicks, so I implement the OnClickListener in my adapter, put the items position in each view's tag, and then I set their onclicklistener to this. Works great, except now I can't use the onListItemClick for starting an activity for the item! OK, I say, I just make the relativelayout holding the text in the middle there use the same onclicklistener. Works great. Everything is clickable, and life is good. EXCEPT! Now, when I scroll the list, I cannot "continue" the scroll by just flinging again. This causes the scrolling to stop, and I have to fling once more to get it going again. It seems the onclick-thingy causes the fling-motion to be interpreted as a tap or something (it does not trigger the logic within onClick). I know that this is possible by just going to the phone list on my HTC Hero, which has exactly the kind of layout and behaviour I want from my app. This app even seems to have the onItemClickListener working. So how can I make sure the list keeps scrolling, and still be able to click the togglebutton, listitem and the imageview? I've been stuck on this all day, and it's giving me a headache :(
Android ListView with clickable items in it's rows causes problems continuing scrolling
CC BY-SA 3.0
0
2010-11-19T16:58:57.087
2015-01-19T12:18:30.200
2015-01-19T12:18:30.200
310,852
397,060
[ "android", "listview", "scroll", "onclick", "listadapter" ]
4,228,418
1
4,906,194
null
2
453
In visual studio 2010 professional, when I maximize the window on a monitor that is 2048 x 1152, Windows 7 changes to the basic color theme (disables aero). Most of the time now I manually resize the window to be the full screen, just not actually maximized which gets around the problem, but is quite annoying. Maximizing to one of my smaller 1680 x 1050 monitors on the same machine does not cause this problem. ![alt text](https://i.stack.imgur.com/DC5in.jpg) Done quite a few searches with no results... Any ideas?
Why does maximizing Visual Studio 2010 trigger the Windows 7 Basic color scheme
CC BY-SA 2.5
0
2010-11-19T19:00:52.633
2011-02-17T11:31:09.203
null
null
379,395
[ "visual-studio-2010", "windows-7" ]
4,228,926
1
4,228,988
null
2
959
I want this kind of result ![alt text](https://i.stack.imgur.com/RKP66.jpg) from these tables. ![alt text](https://i.stack.imgur.com/9TvLh.jpg) ![alt text](https://i.stack.imgur.com/pwyKN.jpg) ![alt text](https://i.stack.imgur.com/Bs07s.jpg) I even can't figure out how to do it with php. I even tried to join payment and invoice table on date but in vain. It's a purchase system and this query will show summary of all payments made and total of invoices by date. I thought of a solution that first select all dates from invoices and then select all dates from payments and take their union. Then check if there is an invoice on that date and then check if there is a payment on that date. But this way there will be too many queries.
mysql query: show summary of all payments made and total of invoices by date
CC BY-SA 4.0
null
2010-11-19T20:05:56.247
2019-07-07T14:24:30.057
2019-07-07T14:24:30.057
1,033,581
395,206
[ "sql", "mysql" ]
4,228,992
1
4,229,006
null
170
240,054
I am getting this error: > The type or namespace name 'AutoMapper' could not be found (are you missing a using directive or an assembly reference?) The funny thing is that I have that reference in my project already: ![ProjectThatFails](https://i.stack.imgur.com/lbFBZ.png) And this is my code: ``` using System.Collections.Generic; using DataContract; using SelectorDAL; using AutoMapper; namespace SpecimenSelect { public class SpecimenSelect : ISpecimenSelect { public SpecimenSelect() { SetupMaps(); } private static void SetupMaps() { Mapper.CreateMap<SpecimenDetail, SpecimenDetailContract>(); } ``` The other weird thing is that I have two other projects in my solution that both use AutoMapper and are referencing the exact same AutoMapper.dll file. They both work perfectly fine. Here is a screen shot of one: ![ProjectThatWorks](https://i.stack.imgur.com/EDUyh.png) and here is that code (that compiles fine): ``` using System.Collections.Generic; using AutoMapper; using DataContract; using SelectorDAL; namespace PatientSelect { public class PatientSelect : IPatientSelect { public PatientSelect() { SetupMaps(); } private void SetupMaps() { Mapper.CreateMap<Patient, PatientContract>(); Mapper.CreateMap<OrderedTest, OrderedTestsContract>(); Mapper.CreateMap<Gender, GenderContract>(); } ``` Both references seem to have the same data on the properties page. What am I missing? I tried: 1. Restarting Visual Studio 2. Referencing without a using statement (ie AutoMapper.Mapper.CreateMap) 3. Clean and Rebuild Any other ideas?
Namespace not recognized (even though it is there)
CC BY-SA 2.5
0
2010-11-19T20:13:25.133
2021-03-31T23:11:33.267
null
null
16,241
[ "c#", "reference" ]
4,229,182
1
null
null
3
5,353
I've already looked at various approaches to solve my issue, so please read this before labeling this as a duplicate question I have a javascript running on `https://xyz.com` which has to retrieve information from an application `ABC` running on the user's local machine say port 8080. My constraints are that I cannot modify the HTTP headers emanating form the `ABC` nor do I want the user to install another application which will be a conduit to route my requests through to `ABC`. a) Ruled out since I cannot have script running on the local machine b) Ruled out since I cannot modify the header c) Again this will not work since I am unable to enclose the response within the function name As a workaround, only meant for testing I've added the `http://xyz.com` to the trusted list and have enabled `Access Data Across Domains` for sites on this list. AFAIK, this option is only available on IE 5+ browsers. This workaround allows me to send and receive messages from `http://127.0.0.1:8080` ![alt text](https://i.stack.imgur.com/ARSSp.png) My question is two-fold 1) If I were to continue with the above approach when I go into production what are the security implications that I'm exposing the user to? Can I plug those holes? 2) Are there any other options that I can pursue to achieve my objective. I would like to be as far away from ActiveX or Flash as possible, but in case that is the only workable alternative to my current approach then I'll have to toe the line Cheers
Cross Domain Request to localhost
CC BY-SA 2.5
0
2010-11-19T20:40:59.317
2010-11-27T23:04:20.573
2010-11-23T10:27:09.947
427,582
427,582
[ "javascript", "ajax", "cross-domain" ]
4,229,430
1
4,229,977
null
0
197
I'm trying to draw a gradient in Flash using `beginGradientFill` and `drawRect`, but when the rect being drawn is partially outside the bounds of the parent, the gradient isn't drawn at all. For example, consider the code below: ``` function testGradient():void { var g:Graphics = container.graphics; var width:Number = container.width; var height:Number = container.height; var y:Number = 0; var x:Number = 0; var ratios:Array = [255 * y / height, 255 * (y + height) / height]; g.beginGradientFill(GradientType.LINEAR, [0xFF, 0xFF], [0.6, 0], ratios, null); g.lineStyle(1, 0xFF0000); g.drawRect(x, y, width, height); g.endFill(); } ``` When the rectangle being drawn lies within the bounds of `container`, everything works: ![working gradient](https://i.stack.imgur.com/wKraX.png) However, if the rectangle lies outside of the bounds of the container, the gradient isn't drawn at all. For example, if the code is changed to: ``` ... var x:Number = 10; var y:Number = 10; ... ``` Then the gradient disappears: ![broken gradient](https://i.stack.imgur.com/CGzvl.png) Short of doing the math required to draw the box inside the bounds of the parent (and fixing up the gradient so it looks correct), is there any way to deal with this?
Flash: gradient fill disappears when it's drawn outside the bounds of its parent?
CC BY-SA 2.5
null
2010-11-19T21:15:39.057
2010-11-19T22:34:54.300
null
null
71,522
[ "flash", "gradient" ]
4,229,759
1
4,229,795
null
1
516
![alt text](https://i.stack.imgur.com/5Sy8F.jpg) I have an entity called Incident, as you can see on the picture, it holds a list with several bugs. Then I have a datagrid that I connect a list with all my incident to: ``` List<ExtendedIncident> allIncidents; myGrid.ItemsSource = allIncidents; ``` Now I bind some of the values from every incident, like this in the xaml code: ``` <sdk:DataGrid AutoGenerateColumns="False" Name="grid" SelectionMode="Single" SelectionChanged="grid_SelectionChanged"> <sdk:DataGrid.Columns> <sdk:DataGridTemplateColumn Header="Incident"> <sdk:DataGridTemplateColumn.CellTemplate> <DataTemplate> <HyperlinkButton Content="{Binding CallId}" Click="HyperlinkButton_Click"></HyperlinkButton> </DataTemplate> </sdk:DataGridTemplateColumn.CellTemplate> </sdk:DataGridTemplateColumn> <sdk:DataGridTextColumn Header="Beskrivnig" Binding="{Binding Description}"></sdk:DataGridTextColumn> <sdk:DataGridTextColumn Header="Beskrivnig" Binding="{Binding Status}"></sdk:DataGridTextColumn> </sdk:DataGrid.Columns> ``` My problem now is that I would like to add some columns that presents some data from the bugs, that are relevant (stored in the list for the incident) in the same row. How can I present data from the list of buggs from the incident? Would be very thankful for any help
Help binding my silverlight datagrid
CC BY-SA 2.5
null
2010-11-19T21:56:04.813
2010-11-19T22:27:53.380
null
null
482,783
[ "c#", "silverlight", "datagrid" ]
4,229,760
1
4,230,514
null
1
1,099
The say: 1 View has 1 ViewModel. Sometimes Multiple Views has 1 ViewModel (using a ). If you regard my image you see 6 colored Views/UserControls. The YELLOW,GREEN and ORANGE UserControls are used multiple times in my application. The pink,blue and red UserControls are used only once. Questions: Should I make them UserControls too? If yes, why if I do not reuse them. Assume those are 6 UserControls, should they share the same ViewModel? OR should each View have its own ViewModel? A.) Create Classcode in GREEN Send class code to YELLOW B.) Select class code in YELLOW Change current pupil in BLUE C.) Select current pupil in BLUE Change pupil details in RED Change pupil documents in ORANGE D.) Create pupil in PINK Send pupil to BLUE E.)... many more Is that the way to go, firing around data with a Messenger class to keep the relations up to date? There is a major flaw for me: I create a PupilViewModel but I do not know in the NewPupilViewModel(PINK) wether a SchoolclassCodeViewModel exists in the YELLOW UserControl so I could add my new PupilViewModel to the BLUE UserControl. SchoolclassCodeViewModel 1 : N PupilViewModel. How would you solve this problem? ![alt text](https://i.stack.imgur.com/Nkblt.png)
MVVM: Design a ViewModel architecture with aggregated/depending ViewModels
CC BY-SA 2.5
0
2010-11-19T21:56:06.370
2010-11-20T00:16:38.773
2010-11-19T22:20:13.797
320,460
320,460
[ "wpf", "mvvm", "communication", "viewmodel", "mediator" ]
4,229,871
1
4,230,146
null
8
5,903
I have a `UIView` and within it I've drawn a line using Core Graphics by overriding `drawRect`. This view also contains one subview which also draws a line. However, whilst both views are using pretty much the same code (for testing purposes at least), the lines drawn on them do not appear the same: ![Image problem](https://i.stack.imgur.com/e7y5t.png) As you can see - the dashed line at the top is noticeably thicker than the bottom one and I have no idea why. Below is the code used by the two `UIViews` in their `drawRect` methods. If you have any idea why this is happening then I'd appreciate your help and advice! First View: ``` CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetStrokeColorWithColor(context, [[UIColor whiteColor] CGColor]); CGFloat dashes[] = {1,1}; CGContextSetLineDash(context, 0.0, dashes, 2); CGContextSetLineWidth(context, 0.6); CGContextMoveToPoint(context, CGRectGetMinX(rect), CGRectGetMaxY(rect)); CGContextAddLineToPoint(context, CGRectGetMaxX(rect), CGRectGetMaxY(rect)); CGContextStrokePath(context); SubUIView *view = [[SubUIView alloc] initWithFrame:rect]; [self addSubview:view]; [view release]; ``` `drawRect``initWithFrame` Second View: ``` CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetStrokeColorWithColor(context, [[UIColor whiteColor] CGColor]); CGFloat dashes[] = {1,1}; CGContextSetLineDash(context, 0.0, dashes, 2); CGContextSetLineWidth(context, 0.6); CGContextMoveToPoint(context, CGRectGetMinX(rect), CGRectGetMidY(rect)); CGContextAddLineToPoint(context, CGRectGetMaxX(rect), CGRectGetMidY(rect)); CGContextStrokePath(context); ```
iPhone Core Graphics thicker dashed line for subview
CC BY-SA 2.5
0
2010-11-19T22:15:51.207
2010-11-19T23:19:05.957
2010-11-19T22:56:42.350
348,308
348,308
[ "iphone", "uiview", "core-graphics" ]
4,229,894
1
4,230,105
null
1
590
I'm currently developing an application for Android which needs to use a custom made Tabs. I have encountered two problems: I will start from my first problem: ``` java.lang.NullPointerException at android.widget.TabWidget.initTabWidget(TabWidget.java:115) at android.widget.TabWidget.<init>(TabWidget.java:86) at android.widget.TabWidget.<init>(TabWidget.java:69) ... ``` I'm getting this exception when i want to switch from a text mode to wyswig mode in Eclipse. This is the actual xml code that gives me that error: ``` <?xml version="1.0" encoding="utf-8"?> <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="1" android:padding="20dip" android:background="#fff" /> <RadioGroup android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:checkedButton="@+id/first" android:id="@+id/states"> <RadioButton android:id="@+id/first" android:background="#FF00FF" android:width="80dip" android:height="70dip" /> <RadioButton android:id="@+id/second" android:background="#FFFFFF" android:width="80dip" android:height="70dip" /> <RadioButton android:id="@+id/third" android:background="#00FFFF" android:width="80dip" android:height="70dip" /> <RadioButton android:id="@+id/fourth" android:background="#0000FF" android:width="80dip" android:height="70dip" /> </RadioGroup> <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="0" android:visibility="gone" /> </LinearLayout> </TabHost> ``` Now the second problem is an Graphic-Artifact: ![http://img529.imageshack.us/img529/8216/99725485.png](https://i.stack.imgur.com/lJcmQ.png) How can i resolve my problems?
nullpointerexception in wyswig xml layout in eclipse for android and visual-artifacts
CC BY-SA 2.5
null
2010-11-19T22:19:29.443
2010-11-19T22:52:01.353
2010-11-19T22:21:36.423
418,183
514,006
[ "android", "nullpointerexception", "tabwidget", "visual-artifacts" ]
4,230,353
1
4,235,335
null
3
4,925
I have a simple UITableView Controller that shows CoreData. I'm trying to implement - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath; and having trouble with the animation. The Core Data store gets updated, but the animation is not working. How can I get the animation to correctly reflect the changes that are happening to the core data objects? For example: Initial order: ![alt text](https://i.stack.imgur.com/YagYl.jpg) After item 2 to the top: ![alt text](https://i.stack.imgur.com/jRtaV.jpg) or, Initial Order: ![alt text](https://i.stack.imgur.com/YagYl.jpg) After moving item 1 to position 3: ![alt text](https://i.stack.imgur.com/ns5FH.jpg) Here's the relevant code: ``` - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { //this implementation is from this tutorial: http://www.cimgf.com/2010/06/05/re-ordering-nsfetchedresultscontroller/ NSMutableArray *things = [[fetchedResultsController fetchedObjects] mutableCopy]; // Grab the item we're moving. NSManagedObject *thing = [fetchedResultsController objectAtIndexPath:fromIndexPath]; // Remove the object we're moving from the array. [things removeObject:thing]; // Now re-insert it at the destination. [things insertObject:thing atIndex:[toIndexPath row]]; // All of the objects are now in their correct order. Update each // object's displayOrder field by iterating through the array. int i = 0; for (NSManagedObject *mo in things) { [mo setValue:[NSNumber numberWithInt:i++] forKey:@"order"]; } NSLog(@"things: %@", things); [things release], things = nil; [managedObjectContext save:nil]; } ``` and the delegate: ``` - (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath { NSLog(@"didChangeObject:"); UITableView *tableView = self.tableView; switch(type) { case NSFetchedResultsChangeInsert: NSLog(@"ResultsChangeInsert:"); [tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexPath] withRowAnimation:UITableViewRowAnimationFade]; break; case NSFetchedResultsChangeDelete: [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; break; case NSFetchedResultsChangeMove: [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; [tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexPath] withRowAnimation:UITableViewRowAnimationFade]; break; } } ```
moveRowAtIndexPath in UITableView causes incorrect animation
CC BY-SA 2.5
0
2010-11-19T23:39:20.110
2012-11-03T03:05:33.873
2010-11-20T02:41:47.747
459,116
459,116
[ "iphone", "cocoa-touch", "core-data", "uitableview" ]
4,230,461
1
4,230,685
null
1
1,185
I have a "news" div and a "banner" div. I want user to see the "banner" div when page loads. This "banner" div should show over the "news" div, exactly over the position, covering the "news" div. So: - How should I do to detect position of "news" div and show the "banner" div over, floating, without affecting the grid structure? - Any jQuery plugin that allows user to hide that div and never show again? w/ cookie? Hope you've understood my idea. I leave an image: ![Image describing my problem](https://i.stack.imgur.com/YCpW4.jpg)
Superimpose a banner div over another div, with jQuery if possible
CC BY-SA 2.5
0
2010-11-20T00:03:05.827
2010-11-21T10:28:56.360
2010-11-21T10:28:56.360
313,758
198,544
[ "php", "jquery", "css", "cookies" ]
4,230,646
1
4,230,655
null
0
4,557
> ``` Msg 515, Level 16, State 2, Procedure CreateParty, Line 16 Cannot insert the value NULL into column 'Id', table 'DEVIN.dbo.Party'; ``` column does not allow nulls. INSERT fails. The statement has been terminated.``` (1 row(s) affected) ``` What the hell? My table consists of ``` Id (Primary Key) FirstName LastName ``` Here's my stored procedure: ``` USE [DEVIN] GO /****** Object: StoredProcedure [dbo].[CreateParty] Script Date: 11/19/2010 16:59:43 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: -- Create date: -- Description: -- ============================================= ALTER PROCEDURE [dbo].[CreateParty] @firstname varchar(50), @lastname varchar(50) --@emailaddress varchar(100), --@zipcode char(5) AS BEGIN SET NOCOUNT ON; INSERT INTO Party (FirstName, LastName) Values (@firstname,@lastname) END ``` Can someone find out why the heck I would be getting that error? It's so annoying... --- Also, for some reason, SQL Management is only showing the "Id" column in intellisense. I have no idea why... SCREENSHOT: ![alt text](https://i.stack.imgur.com/VcxsN.png) Does it not already have the identity "PK_Party"? It does this automatically.. I must be missing something...
SQL Server: Stored Procedure trying to insert NULL?
CC BY-SA 2.5
null
2010-11-20T00:59:27.527
2016-05-19T11:25:15.557
2010-11-21T07:07:45.100
337,806
337,806
[ "sql", "sql-server", "tsql", "sql-server-2008", "stored-procedures" ]
4,230,714
1
4,230,817
null
1
74
For example, I have a userControl that I want a user to be able to "Select". Here is the code I'm using: ``` private void ptbImage_Click(object sender, EventArgs e) { SelectControl(); } private void SelectControl() { this.BackColor = Color.FromArgb(235, 243, 253); } ``` If I have many controls inside of this user control things get messy soon! :P Is there a to globally wrap around every control? Like a Click event for everything inside the control. If there isn't I'll just manually create a click even for every control to globally capture input. Thanks! ![alt text](https://i.stack.imgur.com/iiDg3.png)
How to visually let the user know that something is selected?
CC BY-SA 2.5
null
2010-11-20T01:15:33.203
2010-11-20T03:17:10.197
null
null
null
[ "c#", "winforms", "user-controls" ]
4,230,821
1
4,230,970
null
15
6,074
[Scott Hanselman](http://www.hanselman.com/blog/) ([alternate link](https://stackoverflow.com/users/6380/scott-hanselman)) suggested in a [twitter tweet](https://twitter.com/shanselman/status/5490500635205632) on November 18, 2010 that "OpenID might be Dead". ![OpenID is Dead](https://i.stack.imgur.com/vmtBE.png) --- ### further info I'm currently involved in a pretty good sized project, and it's public facing log-ins are completely OpenID driven (Using [DotNetOpenAuth](http://www.dotnetopenauth.net/)). If this is going to be too challenging for users (as per the comments made around Scott's original tweet), I'm going to need to know of some GOOD alternative solutions... if there even is one. Any information would be appreciated. ### edit To clarify and rephrase. I'm not trying to launch a debate on ""... I'm simply asking "What is there to take the place of OpenID, should it be ". I'm also NOT saying that I think OpenID dead, but merely asking the question based on a comment made by a well respected developer. ### addition As @marc pointed out in a comment. There is a pretty good rant/blog post by Rob Conery titled [Open ID Is A Nightmare](http://blog.wekeroad.com/thoughts/open-id-is-a-party-that-happened) where the Rob makes some pretty compelling arguments as to why OpenID is not desirable. I have to agree that I don't want to be wasting a large amount of time recovering accounts for my users, my time is better spent in other places. So back to the original question. What is there for alternatives? Is there a better "standard" out there that is "open" yet doesn't fall apart if a provider decides to change something? (changing API's or encryption logic for example)... but also one that can span across multiple providers and still recognize a single user?
If OpenID "is dead", what is out there to take its place?
CC BY-SA 3.0
0
2010-11-20T01:59:41.973
2014-05-01T20:42:38.247
2017-05-23T11:46:15.097
-1
124,069
[ "openid", "single-sign-on" ]
4,230,933
1
6,190,485
null
13
4,715
I'm attempting to make an interface similar to the Photos app where the status bar & navigation bar fade in/out but I'm running into a problem. If I tap to hide the interface then rotate the device, then tap to bring it back up, then the navigation bar is repositioned underneath the status bar (see photo). If I then rotate the device, the navigation bar goes back into it's proper place. How can I fix this? ![alt text](https://i.stack.imgur.com/Gd42R.png)
UINavigationBar Appears Under StatusBar
CC BY-SA 2.5
0
2010-11-20T02:41:13.433
2013-09-12T19:24:41.263
2020-06-20T09:12:55.060
-1
435,471
[ "iphone", "ios4" ]
4,231,004
1
null
null
0
540
I have a problem where everything looks as expected in Chrome and Firefox but when I open my homepage in IE, I have two tables in particular that shift to the left quite a bit. One part of the table kind of stays in place but the rest of it moves...seems really odd to me. How can I make these tables stay in the same place? Is there any attribute I can use to keep the tables in fixed places? Cheers guys looks like this in chrome ![alt text](https://i.stack.imgur.com/zyPNn.png) and this in IE ![alt text](https://i.stack.imgur.com/Fx7sb.png)
table in wrong place in different browsers?
CC BY-SA 2.5
null
2010-11-20T03:06:54.553
2010-11-20T03:46:53.997
2010-11-20T03:19:43.230
489,272
489,272
[ "html", "css", "internet-explorer", "web" ]
4,231,161
1
4,236,219
null
1
1,362
I am developing a Genetic Algorithm framework and initially decided on the following `IIndividual` definition: ``` public interface IIndividual : ICloneable { int NumberOfGenes { get; } double Fitness { get; } IGene GetGeneAt(int index); void AddGene(IGene gene); void SetGeneAt(int index, IGene gene); void Mutate(); IIndividual CrossOverWith(IIndividual individual); void CalculateFitness(); string ToString(); } ``` It looked alright, but as soon as I developed other classes that used `IIndividual`, I came to the conclusion that making Unit-Tests for those classes would be kind of painful. To understand why, I'll show you the dependency graph of `IIndividual`: ![alt text](https://i.stack.imgur.com/bF0yG.png) So, when using `IIndividual`, I end up to also having to create/manage instances of `IGene` and `IInterval`. I can easily solve the issue, redefining my `IIndividual` interface to the following: ``` public interface IIndividual : ICloneable { int NumberOfGenes { get; } void AddGene(double value, double minValue, double maxValue); void SetGeneAt(int index, double value); double GetGeneMinimumValue(int index); double GetGeneMaximumValue(int index); double Fitness { get; } double GetGeneAt(int index); void Mutate(); IIndividual CrossOverWith(IIndividual individual); void CalculateFitness(); string ToString(); } ``` with the following dependency graph: ![alt text](https://i.stack.imgur.com/CYQGr.png) This will be pretty easy to test, at the expense of some performance degradation (I'm at this moment not that worried about that) and having `IIndividual` heavier (more methods). There is also a big problem for the clients of IIndividual, as if they want to add a Gene, they'll have to add all the little parameters of Gene "manually" in `AddGene(value, minimumValue, maximumValue)`, instead of `AddGene(gene)`! ## My question is: What design do you prefer and why? Also, what is the criteria to know where to stop? I could do just the same thing I did to `IIndividual` to `IGene`, so anyone that uses `IGene` doesn't have to know about `Interval`. I have a class `Population` that will serve as a collection of `IIndividuals`. What stops me from doing the same I did to `IIndividual` to `Population`? There must be some kind of boundary, some kind of criteria to understand in which cases is best to just let it be (have some dependencies) and in which cases it is best to hide them (like in the second `IIndividual` implementation). Also, when implementing a framework that's supposed to be used by other people, I feel like the second design is less pretty (and is maybe harder for others to understand). Thanks!
How to better reduce classes dependencies so it is easier to Unit-Test them
CC BY-SA 2.5
0
2010-11-20T04:09:17.343
2010-11-21T03:06:01.113
2010-11-20T05:13:23.337
130,758
130,758
[ "c#", "java", "unit-testing", "oop", "dependencies" ]
4,231,478
1
4,232,004
null
1
2,961
I have a custom control with bindings like below ``` <DataTemplate DataType="{x:Type vm:EditorTabViewModel}"> <me:MarkdownEditor Options="{Binding Path=Options, RelativeSource={RelativeSource AncestorType=Window}}" /> </DataTemplate> ``` I find that binding (`Window1.Options`) is being set (after stepping through code in debug mode), the markdown editor options (supposed to set Fonts, Colors etc) does not get set, or at least the UI does not update. I want to bug whats happening with in the `MarkdownEditor.xaml.cs` but thats another (referenced) project. How can I verify that the `MarkdownEditor.Options` is being set at least? I have actually tested that the `MarkdownEditor` side is working by the below ``` <Window ...> <Grid> <Button Content="Options" Click="Button_Click" Grid.Row="0" /> <me:MarkdownEditor Options="{Binding Options, RelativeSource={RelativeSource AncestorType=Window}}" Grid.Row="1" /> </Grid> </Window> ``` So the difference is the latter is a `MarkdownEditor` just in a `Grid` in a `Window`. The one failing is a `MarkdownEditor` within a `TabControl` bound to a `ObservableCollection<TabViewModel>` I am not really good at explaining things, so a simple project I made up minus all the unnecessary noise uploaded to [media fire](http://www.mediafire.com/?d88dsine5vug5gz) so you can take a look at whats wrong The video showing the problem on [Screenr](http://screenr.com/hQc) With just a simple usage, editor in a window/grid. ![](https://imgur.com/8OjAG.jpg) the binding works ok Then when used in conjunction with `TabControl` bound to `ObservableCollection<EditorTabViewModel>`, the binding works as shown in the 2 `TextBox`es updating its values. but the editor does not update ![](https://imgur.com/p6Ub6.jpg)
Binding Setting Property but UI not updating. Can I debug within referenced project/control?
CC BY-SA 2.5
0
2010-11-20T06:13:54.237
2010-11-20T15:07:13.243
null
null
292,291
[ "wpf", "user-controls", "binding" ]
4,231,689
1
4,240,640
null
0
557
So, I have a Core data object, let's call it a session (Okay, that's what it actually is called), and it has four attributes (Name, Driver, Track and Car) that I'd like to show in a table view. I've had it working before, but, alas, I'm trying to make my view controllers a little more generic and reusable, so, I'm changing it up a bit. Anywho, here's what the table looks like... ![alt text](https://i.stack.imgur.com/W1u7w.png) Passed into the view controller is a Session, which is a subclass of NSManagedObject that CoreData whipped up for me. Driver, Car and Track are all object relationships, while name is simply a string. Driver, Car and Track all have a name attribute that I'm displaying in this table. I wanted a quick and dirty way of displaying this text into the table. So, I was doing something like... ``` NSDictionary *parameterValues = [[NSDictionary alloc] initWithObjectsAndKeys: sessionName, [NSNumber numberWithInt: 0], sessionDriver, [NSNumber numberWithInt: 1], sessionCar, [NSNumber numberWithInt: 2], sessionTrack, [NSNumber numberWithInt: 3], nil]; NSString *parameterString; if([indexPath row] > 0) { if([parameterValues objectForKey: [NSNumber numberWithInt: [indexPath row]]] == [NSNull null]) { parameterString = [[NSString alloc] initWithFormat: @"Select a %@", [parameterNames objectAtIndex: [indexPath row]]]; } else{ parameterString = [[parameterValues objectForKey: [NSNumber numberWithInt: [indexPath row]]] name]; } } else{ parameterString = [parameterValues objectForKey: [NSNumber numberWithInt: 0]]; if([parameterString isEqualToString: @""]) { parameterString = @"Enter A Name"; } } ``` This worked before I started passing the session as an instance variable, instead of keeping track of specific string, driver, car and track objects. Since [[self session] driver], would return nil when a new session object is passed, a dictionary object cannot be used. This is how I do it now... ``` //these come in handy, they're the object names (We can use KVC), and we can use them in the table titles NSArray *parameterNames = [[NSArray alloc] initWithObjects: @"Name", @"Driver", @"Car", @"Track", nil]; //get the object for this row... (Name, Driver, Car, Track), and create a string to hold it's value.. id object = [session valueForKey: [parameterNames objectAtIndex: [indexPath row]]]; NSString *parameterValue; NSLog(@"%@", [session name]); //if this isn't the name row... if(object != nil) { //if the indexPath is greater than 0, object is not name (NSString) if([indexPath row] > 0) { parameterValue = [object name]; } else{ parameterValue = object; } } else{ //object doesn't exist yet... placeholder! parameterValue = [@"Select a " stringByAppendingString: (NSString *)[parameterNames objectAtIndex: [indexPath row]]]; } ``` What I'm asking is... am I doing this right? Thanks, Matt - A Core Data newbie :/
UITableView and CoreData - Displaying Data in Specific Rows and Efficiency?
CC BY-SA 2.5
null
2010-11-20T07:27:09.523
2010-11-21T22:02:02.500
2010-11-20T07:38:33.300
30,461
242,608
[ "iphone", "cocoa-touch", "uitableview", "core-data", "uikit" ]
4,231,830
1
4,244,678
null
0
853
I've created my own undo system for the RichTextBox whereby whenever you do something an undo action is added to a stack, and when you press undo, this action is undone. This behavior works perfectly with all controls I've implemented it for, except for RichTextBoxes. I have reduced the system down to its simplest elements, where whenever you press delete, it adds the current selected text and its index to a stack, and when you undo this, it puts the text back at this index. Here is the code with the simplest elements stripped out (like the actual reading of the text file): ``` // Struct I use to store undo data public struct UndoSection { public string Undo; public int Index; public UndoSection(int index, string undo) { Index = index; Undo = undo; } } public partial class Form1 : Form { // Stack for holding Undo Data Stack<UndoSection> UndoStack = new Stack<UndoSection>(); // If delete is pressed, add a new UndoSection, if ctrl+z is pressed, peform undo. private void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.Modifiers == Keys.None && e.KeyCode == Keys.Delete) UndoStack.Push(new UndoSection(textBox1.SelectionStart, textBox1.SelectedText)); else if (e.Control && e.KeyCode == Keys.Z) { e.Handled = true; UndoMenuItem_Click(textBox1, new EventArgs()); } } // Perform undo by setting selected text at stored index. private void UndoMenuItem_Click(object sender, EventArgs e) { if (UndoStack.Count > 0) { // Save last selection for user int LastStart = textBox1.SelectionStart; int LastLength = textBox1.SelectionLength; UndoSection Undo = UndoStack.Pop(); textBox1.Select(Undo.Index, 0); textBox1.SelectedText = Undo.Undo; textBox1.Select(LastStart, LastLength); } } } ``` However if you select just the \n from one line, and more text below like this: ![alt text](https://i.stack.imgur.com/48LOi.jpg), then press delete, and then undo, it seems to undo this \n character twice.
RichTextBox Undo Adding Spaces
CC BY-SA 2.5
0
2010-11-20T08:17:21.237
2010-11-22T10:57:19.180
2010-11-22T01:52:53.713
2,148,718
2,148,718
[ "c#", "winforms", "c#-4.0", "richtextbox", "undo" ]
4,231,913
1
4,231,920
null
2
711
I'm using jQuery 1.2.7 (I cannot upgrade) In order to trigger events when a dropdown menu selected value changes, I've been told to use the following code: ``` $('#dropdownWidget').bind($.browser.msie ? 'click' : 'change', function(event) { //myEvent }); ``` This is a screenshot of the widget: ![alt text](https://i.stack.imgur.com/z3vOT.png) It works perfectly on all browsers, however in IE, the event is triggered everytime the user clicks on the widget (even before the new value is selected). Since I'm triggering AJAX calls, I cannot tolerate this. Thanks
jQuery: What's the correct code to trigger events in Internet Explorer?
CC BY-SA 2.5
null
2010-11-20T08:50:02.337
2010-11-20T09:12:38.190
2010-11-20T09:08:03.067
257,022
257,022
[ "jquery", "internet-explorer" ]
4,231,937
1
4,231,967
null
0
87
I have written c# application that uses mdf file for database.when i make setup of that project and runs on other computer having dotnetframework and sql server compact 3.5 then id dose not runs and exception is shown saying something sql server not found or not ready for connection something like that what should i do ![alt text](https://i.stack.imgur.com/qghj0.jpg)
Database connection fails
CC BY-SA 2.5
null
2010-11-20T09:00:48.923
2010-11-20T09:26:36.827
2010-11-20T09:25:50.553
430,167
430,167
[ "c#", "sql-server", "installation", "desktop-application" ]
4,232,152
1
null
null
1
1,871
> Is it possible to generate a specific set of font from the below given image ?My idea is to generate a specific font for the below given image of text ,by manually selecting portion of the image and mapping it to a set of letter's.Generate the font for this and then use this font to make it readable for an OCR.Is generation of font possible using any open-source implementation ? Also please suggest any good OCR's. ![alt text](https://i.stack.imgur.com/0g1nH.gif)
Generate font from an image of text
CC BY-SA 2.5
0
2010-11-20T09:59:04.190
2010-11-20T23:19:36.087
2010-11-20T10:19:45.223
306,855
306,855
[ "image-processing", "fonts", "ocr" ]
4,232,391
1
4,236,907
null
5
1,652
I want to listen for continuous changes from CouchDB using jQuery - now this works: ``` http://localhost:5984/testdb/_changes?feed=continuous ``` which means that I get a new line of json every time there is a db update - but how do I read updates off this URL using jQuery? I tried using this but it doesn't work: ``` $.ajax( { url : "http://localhost:5984/testdb/_changes?feed=continuous&callback=?", dataType : 'json', success : function(data) { alert(data.results.length); } }); ``` : $.ajax calls the "success" function and returns immediately, it doesn't "poll" for changes.. (timeline column for ajax column in image below is 16ms) ![alt text](https://i.stack.imgur.com/1e5uS.gif) And no, it isn't a cross-domain ajax problem - I can see in fireBug there is a response with the right number of elements So any guidance/advice would be appreciated - it doesn't have to be jQuery - plain old javscript would do as well
Read continuous feed from CouchDB using Ajax/jQuery
CC BY-SA 2.5
0
2010-11-20T11:08:37.290
2021-03-31T05:27:18.693
2010-11-20T11:30:47.407
150,878
150,878
[ "jquery", "ajax", "couchdb", "jsonp" ]
4,232,857
1
null
null
0
1,304
![alt text](https://i.stack.imgur.com/YDqEi.jpg) I can only specify a single `.as` file,how can I have 2 classes in it?
How to use two .as files in Flash using actionscript 3?
CC BY-SA 2.5
null
2010-11-20T13:05:59.737
2010-11-20T13:45:17.963
null
null
417,798
[ "flash", "actionscript-3" ]
4,233,193
1
4,233,963
null
3
222
I have a `TabControl` bound to a `ICollectionView` with derives from `ObservableCollection<EditorTabViewModel>`. I think quite standard MVVM Multi-Document pattern? Anyways, `EditorTabViewModel` has a property `Content` that contains the string to be displayed. I find that the binding is working ... ``` // Add 2 default tabs for a test, also set their Content property to the respective values ... _tabs.Add(new EditorTabViewModel { Content = "Tab 1" }); _tabs.Add(new EditorTabViewModel { Content = "Tab 2" }); ``` Its values are correctly rendered ``` <!-- DataTemplate to render EditorTabViewModels --> <DataTemplate DataType="{x:Type vm:EditorTabViewModel}"> <me:MarkdownEditor TextContent="{Binding Path=Content.Content, RelativeSource={RelativeSource Mode=TemplatedParent}, Mode=TwoWay}" Options="{Binding Path=Options, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" /> </DataTemplate> ``` ![](https://imgur.com/RFi0e.jpg) But when I change the value, switch tabs and return, I get the string set in the constructor again ... shown in [this video (on screenr)](http://screenr.com/oQc) The [Visual Studio Solution](http://www.mediafire.com/?ahk686k44vsxuc9)
Binding Does not Commit?
CC BY-SA 2.5
null
2010-11-20T14:30:22.663
2010-11-20T17:16:12.630
null
null
292,291
[ "wpf", "binding" ]
4,233,352
1
null
null
5
1,771
Since the Brazilian government does not have a public API for postal codes, I am trying to reverse engineer the code that [correios.com.br](http://www.buscacep.correios.com.br/servicos/dnec/menuAction.do?Metodo=menuEndereco) uses to generate the image below so I can generate my own images to train the OCR program. ![alt text](https://i.stack.imgur.com/An0bO.jpg) I believe that I have already got almost everything right besides the text spacing and the colors: ![alt text](https://i.stack.imgur.com/1jPJU.jpg) I am not interested on the colors now, but the text spacing is really bothering me. For instance, have a look on the 'Ti' in 'Tijuca'. The two letters are really close together in the original image and I can't reproduce this feature. I have already tried to derive the font, setting values to `TextAttribute.TRACKING` and `TextAttribute.KERNING`, but it did not work. Here follows my code: ``` import java.awt.Color; import java.awt.font.TextAttribute; import java.awt.Font; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.util.Hashtable; import javax.imageio.ImageIO; public class CreateImage { /** * @param args */ public static void main(String[] args) { int width = 570; int height = 120; boolean new_image = true; BufferedImage img; if (!new_image) { try { img = ImageIO.read(new File("original.jpg")); } catch (IOException e) { e.printStackTrace(); new_image = true; img = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); } } else { img = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); } Graphics2D g2d = img.createGraphics(); if (new_image) { // white background g2d.setPaint(Color.WHITE); g2d.fillRect(0, 0, width, height); g2d.setPaint(Color.BLACK); } else { g2d.setPaint(Color.RED); } Font myfont = new Font("SansSerif", Font.BOLD, 11); /* Hashtable<TextAttribute, Float> attributes = new Hashtable<TextAttribute, Float>(); attributes.put(TextAttribute.TRACKING, new Float(-0.01)); myfont = myfont.deriveFont(attributes); */ g2d.setFont(myfont); g2d.drawString("Logradouro:", 5, 13); g2d.drawString("Bairro:", 5, 33); g2d.drawString("Localidade / UF:", 5, 53); g2d.drawString("CEP:", 5, 73); g2d.drawString("Avenida das Américas - de 3979 a 5151 - lado ímpar", 105, 13); g2d.drawString("Barra da Tijuca", 105, 33); g2d.drawString("Rio de Janeiro/RJ", 105, 53); g2d.drawString("22631-004", 105, 73); g2d.dispose(); File file = new File("clone.jpg"); try { ImageIO.write(img, "jpg", file); } catch (IOException e) { e.printStackTrace(); } System.out.println("clone.jpg file created."); } } ``` My question is: What are the other options to control how a string is spaced when it's drawn? Do you have any ideas on what the original code may be doing? Thanks!
Java awt font spacing options
CC BY-SA 2.5
null
2010-11-20T15:06:50.643
2010-11-20T20:29:49.100
2010-11-20T20:29:49.100
230,636
230,636
[ "java", "image", "fonts", "awt" ]
4,233,600
1
4,233,622
null
10
15,099
!!! and really can't stand the white background. ![alt text](https://i.stack.imgur.com/VXM1m.gif) Does anyone have a PyCharm schema for monokai by chance? :)
Does anyone have the monokai theme for PyCharm?
CC BY-SA 2.5
0
2010-11-20T15:58:37.490
2013-10-26T08:17:31.953
2010-11-20T16:08:02.560
208,827
208,827
[ "python", "django", "pycharm" ]
4,233,848
1
4,270,732
null
0
1,377
I am having this problem in the image: ![alt text](https://i.stack.imgur.com/UWE9B.jpg) even if in the path displayed is correct and exists. I tryed anyway to change this variable and the files in `C:\\Program Files\Java\apache-maven-2.2.1` or `C:\\Program Files\Java\apache-maven-2.2.1\bin` or `C:\\Program Files\apache-maven-2.2.1\bin` as I read in different forums. My enviroment variables are set up as follow: ``` Path=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%ROO_HOME%\bin;%M2_HOME%\bin; M2_HOME=C:\Program Files\apache-maven-2.2.1 JAVA_HOME=C:\Program Files\Java\jdk1.6.0_18 ROO_HOME=C:\spring-roo-1.1.0.RC1 ``` Must I do something extra? Thanks in advance
Problem spring roo and Maven enviroment variables
CC BY-SA 2.5
null
2010-11-20T16:54:03.350
2010-11-24T19:30:09.050
2020-06-20T09:12:55.060
-1
457,208
[ "maven-2", "environment-variables", "spring-roo" ]
4,233,869
1
4,233,884
null
18
42,350
I'm using CSS (via JQuery , but not relevant to this question) to highlight certain elements within an HTML file: I'm using "pre" tags to separate out logical elements in my file, but I noticed that "pre" tags seem to leave newlines between elements. Can I get rid of these using CSS ? (Or what shall I use instead of "pre" tags? The text elements may contain HTML elements themeselves : which should be rendered, and should be shown literally as source-code: hence my initial choice with "pre" tags) Here's an example of the HTML I'm using: (Requires [http://docs.jquery.com/Downloading_jQuery](http://docs.jquery.com/Downloading_jQuery) for this example) ``` <html> <head> <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"> </script> </head> <body> <pre class="error"> This is an error line. stack.trace.blah.blah more.blah.blah yadda.yadda.blah</pre> <pre class="ok"> this is not an error line.it contains html &lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;hello&lt;/body&gt;&lt;/html&gt;</pre> <pre class="error"> This is an error line. stack.trace.blah.blah more.blah.blah yadda.yadda.blah</pre> <pre class="ok"> <script type="text/javascript"> $("pre.error").css({"background-color":"red","color":"white","display":"block","padding":"0", "margin":"0"}); </script> </body> </html> ``` I'm using Firefox 3.6.12. This is what the code above results in: ![alt text](https://i.stack.imgur.com/wsjE0.jpg) And this is simulated output of what I want (switched to yellow, only because I used my vim editor to this, pretend it's red!) ![alt text](https://i.stack.imgur.com/RR4JF.jpg) SOLUTION: Is to use 'display:inline' for all PRE tags. (Previously I was only applying the 'display:inline' to the 'error' tags in the example above, and had forget to do the same for 'ok' pre tags.
HTML <pre> tag causes linebreaks
CC BY-SA 2.5
0
2010-11-20T16:59:08.547
2018-10-26T12:34:18.127
2010-11-21T13:01:46.667
184,456
184,456
[ "html", "css", "newline", "line-breaks", "pre" ]
4,234,176
1
5,489,118
null
2
3,107
I'm seeing a strange rendering issue in an SVG that I'm generating. I've narrowed it down to a small reproducible case. ``` <?xml version="1.0" encoding="UTF-8"?> <svg xmlns="http://www.w3.org/2000/svg"> <polyline points="41,36 40,35 42,37" style="stroke:black; stroke-linecap:round; stroke-linejoin:round; stroke-width:70"/> </svg> ``` This renders as ![http://cl.ly/3f023z1w281D1Y2K3d0Q](https://i.stack.imgur.com/CnNXH.png) (at least when viewed in Safari, Mac Chrome, or Mac Firefox). I would expect something that looks more like a very slightly deformed circle. Am I missing something? I'm very new to SVG, so hopefully there's something obvious I've overlooked.
SVG Polyline with stroke-linejoin:round not showing a rounded corner
CC BY-SA 3.0
0
2010-11-20T18:05:45.763
2011-11-26T03:59:20.183
2011-11-26T03:59:20.183
234,976
514,633
[ "svg" ]
4,234,185
1
4,234,236
null
1
364
I want my row items to look like this: ![alt text](https://i.stack.imgur.com/2rwEQ.png) I want to have an image on the left, top and bottom text and a date. I have started to lay it out, but am not sure how to proceed with the rest of the XML: ``` <?xml version="1.0" encoding="utf-8"?> <RelativeLayout android:id="@+id/RelativeLayout01" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_alignParentLeft="true" android:id="@+id/avatarImageView"> </ImageView> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/usernameTextView" android:text="username" android:layout_toRightOf="@+id/avatarImageView" android:layout_alignParentTop="true"> </TextView> <TextView android:id="@+id/bodyTextView" android:layout_below="@+id/usernameTextView" android:layout_toRightOf="@+id/avatarImageView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="body"> </TextView> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@+id/usernameTextView" android:id="@+id/dateTextView" android:text="date"> </TextView> </RelativeLayout> ```
How can I make my ListViewItem look like the Twitter app?
CC BY-SA 2.5
0
2010-11-20T18:06:55.133
2010-11-20T19:53:06.197
2010-11-20T19:53:06.197
19,875
19,875
[ "java", "android", "listview", "twitter", "android-layout" ]
4,234,330
1
null
null
15
4,598
In my app I have some complex logic surrounding the hiding and showing of the keyboard. I am interested in detecting when the user (who has an iPad) specifically taps on the iPad keyboard hide button: ![alt text](https://i.stack.imgur.com/68Yvx.png) I am interested in detecting when the keyboard is supposed to hide, only when the user actually physically taps on this button. Any suggestions? Thank you!
How to detect iPad user tap on keyboard hide button?
CC BY-SA 2.5
0
2010-11-20T18:38:04.007
2011-09-23T05:38:00.953
null
null
353,137
[ "ipad", "ios", "keyboard" ]