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,899,169
1
4,899,731
null
13
33,460
Please recommend some Multi-Column ComboBox control for Winforms application in .net. Better if they are free. I found [Syncfusion - Multi-column-combo-box](http://www.syncfusion.com/products/user-interface-edition/windows-forms/tools/multi-column-combo-box) it can show datagrid which is bound to datasource but it is not free. There is an awesome control used in inFlow Inventroy, please also tell if you know something like this > ![inFlow Inventory multi-column combox](https://i.stack.imgur.com/44dNs.png)
Multi-Column ComboBox Controls for Winforms
CC BY-SA 2.5
0
2011-02-04T14:34:43.233
2011-08-16T16:19:53.333
2011-02-05T09:13:05.250
342,095
342,095
[ ".net", "datagrid", "controls", "combobox", "multiple-columns" ]
4,899,339
1
4,899,385
null
1
2,135
I Use VSTwain Component To Scan Images With Scanner.How Can I Solve Flowing Error? My Application Compile And Run Correctly,But Resharper show the following error. When I write "VSTwaint1." in Visual Studio, Red Methods Can Not Show In Vs. But My Software work Correctly. ![enter image description here](https://i.stack.imgur.com/jrJEM.png)
Solve Resharper Error in C#
CC BY-SA 2.5
null
2011-02-04T14:51:38.547
2011-05-15T13:36:20.157
2011-05-15T13:36:20.157
21,234
242,079
[ "c#", "resharper", "image-scanner" ]
4,899,373
1
4,899,427
null
8
10,098
I want to create a text style similar to a label. Looky here: ![enter image description here](https://i.stack.imgur.com/vf6Zd.gif) I can nearly do it using just: [http://jsfiddle.net/STApE/](http://jsfiddle.net/STApE/) ``` p{display: inline; background: yellow;} ``` BUT, I want to add some padding. When I do, things go downhill. Same happens if I add a border: [http://jsfiddle.net/JN72d/](http://jsfiddle.net/JN72d/) Any ideas on a simple way to achieve this effect?
Text highlighting (label effect) using CSS
CC BY-SA 2.5
0
2011-02-04T14:55:09.433
2014-04-30T12:22:02.230
null
null
311,074
[ "css", "typography" ]
4,899,422
1
null
null
1
4,559
I have very simple (in fact empty ) project which i have created by command from command-line. So, i want to import it to NetBeans IDE. I click "new project" -> "RoR" -> "from existing source", select Ruby 1.9.2 (instead of embedded JRuby) in the wizard form. After that i have got errors [see the picture below]: ![enter image description here](https://i.stack.imgur.com/bvqUR.png) So.. i click OK. And then try to run the RoR application from NetBeans clicking on the run-button and i got the following error in the log-panel: ``` /home/ses/.rvm/rubies/ruby-1.9.2-p136/bin/ruby: No such file or directory -- script/server (LoadError) ``` So how to handle these two problems? and, replying the comment to my question. , i performed following commands: ``` bundle install Using rake (0.8.7) Using abstract (1.0.0) Using activesupport (3.0.3) Using builder (2.1.2) Using i18n (0.5.0) Using activemodel (3.0.3) Using erubis (2.6.6) Using rack (1.2.1) Using rack-mount (0.6.13) Using rack-test (0.5.7) Using tzinfo (0.3.24) Using actionpack (3.0.3) Using mime-types (1.16) Using polyglot (0.3.1) Using treetop (1.4.9) Using mail (2.2.15) Using actionmailer (3.0.3) Using arel (2.0.7) Using activerecord (3.0.3) Using activeresource (3.0.3) Using bundler (1.0.10) Using mysql2 (0.2.6) Using thor (0.14.6) Using railties (3.0.3) Using rails (3.0.3) bundle pack Using rake (0.8.7) Using abstract (1.0.0) Using activesupport (3.0.3) Using builder (2.1.2) Using i18n (0.5.0) Using activemodel (3.0.3) Using erubis (2.6.6) Using rack (1.2.1) Using rack-mount (0.6.13) Using rack-test (0.5.7) Using tzinfo (0.3.24) Using actionpack (3.0.3) Using mime-types (1.16) Using polyglot (0.3.1) Using treetop (1.4.9) Using mail (2.2.15) Using actionmailer (3.0.3) Using arel (2.0.7) Using activerecord (3.0.3) Using activeresource (3.0.3) Using bundler (1.0.10) Using mysql2 (0.2.6) Using thor (0.14.6) Using railties (3.0.3) Using rails (3.0.3) Updating .gem files in vendor/cache Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. Updating .gem files in vendor/cache ``` and following this page [http://wiki.netbeans.org/FaqRubyRakeFetchingFailed](http://wiki.netbeans.org/FaqRubyRakeFetchingFailed) i did `rake -D`
How to import RoR project to Netbeans
CC BY-SA 2.5
null
2011-02-04T15:00:24.547
2011-02-04T16:06:53.980
2011-02-04T15:31:31.843
369,759
369,759
[ "ruby-on-rails", "ruby", "netbeans" ]
4,899,442
1
4,899,473
null
15
12,120
I'd like to rotate a text by 90 degrees counter-clockwise. Firefox and Chrome are no problem, using: ``` -webkit-transform-origin: top left; -webkit-transform: rotate(-90deg); -moz-transform-origin: top left; -moz-transform: rotate(-90deg); ``` For Internet Explorer, it should be this line, as far as I know: ``` filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); ``` (The other method, , can only rotate text clockwise 90 degrees). However, in IE the rotated text looks like a badly scaled image on its side (comparison below). ![Firefox/Chrome](https://i.stack.imgur.com/ur0VB.png) Firefox / Chrome -- vs -- Internet Explorer: ![Internet Explorer](https://i.stack.imgur.com/ZabjI.png) Is there any way that Internet Explorer can rotate the text in a more elegant way (possibly Javascript/jQuery)? I've been Googling, but I can only find more references to this method...
Rotate text in IE, without it getting ugly
CC BY-SA 2.5
0
2011-02-04T15:02:26.530
2014-08-31T23:27:40.353
null
null
318,053
[ "javascript", "jquery", "internet-explorer", "css" ]
4,899,474
1
4,901,660
null
1
727
i am trying to use cakes baking console and when i use cake bake model all i am getting the following error ![enter image description here](https://i.stack.imgur.com/6JD1R.png) Attendance Table Structure ``` CREATE TABLE IF NOT EXISTS `mydb`.`attendences` ( `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT , `dateTime` DATETIME NULL , PRIMARY KEY (`id`) ) ENGINE = InnoDB; ```
Cake Bake error
CC BY-SA 2.5
null
2011-02-04T15:04:49.323
2013-02-10T13:21:58.760
2013-02-10T13:21:58.760
727,208
155,196
[ "cakephp", "cakephp-1.3", "cakephp-bake" ]
4,899,516
1
4,900,139
null
7
4,637
Consider the following code: ``` from numpy import log2 import matplotlib.pyplot as plt xdata = [log2(x)*(10/log2(10)) for x in range(1,11)] ydata = range(10) plt.plot(xdata, ydata) plt.show() ``` This produces the following plot: ![The plot I do not want](https://i.stack.imgur.com/dlF3b.png) My question is, how can I modify this, so that the plot, with the exact same data as input, appears as a straight line? This basically requires scaling the x-axis appropriately, but I cannot figure how to do this. The reason for doing this is that I am displaying a function that changes very little at the beginning, but starts to fluctuate more towards the end of the valid interval, so I want to have a higher horizontal resolution towards the end. If anyone can propose an alternative solution to my approach, feel free to do so!
How to produce an exponentially scaled axis?
CC BY-SA 2.5
null
2011-02-04T15:09:14.310
2018-09-19T20:57:08.830
2011-02-04T15:22:07.243
160,206
160,206
[ "python", "matplotlib" ]
4,899,776
1
4,901,620
null
2
138
I'm having a VERY weird problem, I have added a tabbed content style switcher on the right hand sidebar of my site but it's only showing up in FF4.0, all other browsers are showing the old version, I have tried cache clearing and everything but to no avail, Screenshots: FF4.0b10: ![Firefox 4.0 beta 10](https://i.stack.imgur.com/zshRo.png) Any other browser: ![enter image description here](https://i.stack.imgur.com/WzaTn.png) Anyone else ever experienced this? Link: [http://mutant-tractor.com](http://mutant-tractor.com)
Changes showing in FF4.0 but no other browsers?
CC BY-SA 2.5
null
2011-02-04T15:36:44.290
2011-02-04T18:33:04.993
null
null
571,593
[ "javascript", "jquery", "html", "browser" ]
4,899,987
1
4,900,025
null
4
4,012
I have a black and white image like this (color overlays are mine, and can be removed): ![enter image description here](https://i.stack.imgur.com/1XTaZ.png) I need to figure out the edge of the hand shown, how can I do that? My current algorithm: ``` List<Point> edgePoints = new List<Point>(); for (int x = 0; x < largest.Rectangle.Width && edgePoints.Count == 0; x++) { //top for (int y = 0; y < largest.Rectangle.Height - 3 && edgePoints.Count == 0; y++) { if (colorGrid[x, y].ToArgb() == Color.White.ToArgb() && colorGrid[x, y + 1].ToArgb() == Color.White.ToArgb() && colorGrid[x, y + 2].ToArgb() == Color.White.ToArgb() && colorGrid[x, y + 3].ToArgb() == Color.White.ToArgb() ) { edgePoints.Add(new Point(x, y)); //g.DrawLine(new System.Drawing.Pen(Color.Orange), new Point(largest.Rectangle.X + x, largest.Rectangle.Y + y), new Point(largest.Rectangle.X + x, largest.Rectangle.Y + y + 3)); break; } } //bottom for (int y = largest.Rectangle.Height - 1; y > 3 && edgePoints.Count == 0; y++) { if (colorGrid[x, y].ToArgb() == Color.White.ToArgb() && colorGrid[x, y - 1].ToArgb() == Color.White.ToArgb() && colorGrid[x, y - 2].ToArgb() == Color.White.ToArgb() && colorGrid[x, y - 3].ToArgb() == Color.White.ToArgb() ) { edgePoints.Add(new Point(x, y)); //g.DrawLine(new System.Drawing.Pen(Color.Orange), new Point(largest.Rectangle.X + x, largest.Rectangle.Y + y), new Point(largest.Rectangle.X + x, largest.Rectangle.Y + y + 3)); break; } } } ``` Results in a fairly well defined outline, but if the and curves in anywhere, that edge is not detected. I.E., if I held my hand sideways, I'd get the edge of the top finger and bottom finger, but that's it. What can I do to correct this and get a real edge?
Edge detection on C#
CC BY-SA 2.5
null
2011-02-04T15:54:50.100
2011-02-07T06:17:18.563
null
null
12,243
[ "c#", "computer-vision", "edge-detection" ]
4,900,101
1
4,900,133
null
5
23,072
I'm creating a PHP site for property. I'm new to jQuery and jQuery UI but can't seem to find the answer anywhere else. Please see this screen shot ([full size](https://i.stack.imgur.com/b3yQX.png)): ![Screen shot](https://i.stack.imgur.com/b3yQX.png) For for every "received" and "expiry" box I want a jQuery datePicker box to appear and format as shown. To test this I tried to create an example. ``` <link type="text/css" href="css/ui-lightness/jquery-ui-1.8.9.custom.css" rel="Stylesheet" /> <script type="text/javascript" src="js/jquery-1.4.4.min.js"></script> <script type="text/javascript" src="js/jquery-ui-1.8.9.custom.min.js"></script> <script> $(function() { $( "#datepicker" ).datepicker({ dateFormat: 'yy-mm-dd' }); $( "#datepicker2" ).datepicker({ dateFormat: 'yy-mm-dd' }); }); </script> <style> .ui-datepicker { font-size: 80%; } </style> <p>Date: <input id="datepicker" type="text" /></p> <p>Date2: <input id="datepicker2" type="text" /></p> ``` Which works fine, but how do I get a date picker to come up for ANY textbox without having to repeat the JS so many times. For say, 50 properties, there may be 200 input boxes on the page with a date needing to be filled in. Here is some example code from the screen shot. ``` <tr> <td>Property ID</td> <td>House Number</td> <td>Address Line 1</td> <td>Gas Expiry</td> <td>Gas Received</td> <td>Electric Expiry</td> <td>Electric Received</td> <td>Property Active</td> <td>Update</td> </tr> <tr> <td>4</td> <td>6</td> <td>East Street</td> <td><input name="gas_expiry[4]" type="text" id="gas_expiry[4]" value="2011-08-03" /></td> <td><input name="gas_received[4]" type="text" id="gas_received[4]" value="" /></td> <td><input name="electric_expiry[4]" type="text" id="electric_expiry[4]" value="" /></td> <td><input name="electric_received[4]" type="text" id="electric_received[4]" value="" /></td> <td> <select name="active[4]" id="active[4]"> <option value="0" selected="selected">No</option> <option value="1">Yes</option> </select> </td> <td><input name="edit[]" type="checkbox" id="edit[]" value="4" /></td> </tr> ``` Probably something really simple, I appreciate any help.
JQuery UI, multiple datepickers on single page
CC BY-SA 3.0
0
2011-02-04T16:06:16.973
2021-11-19T14:45:38.453
2011-12-22T07:50:48.840
937,870
603,427
[ "php", "jquery", "user-interface" ]
4,900,525
1
4,901,088
null
0
436
I have a simple little issue with webmatrix. I created an orchard site, I uploaded it to an ftp a/c. But there was a problem with that ftp a/c with the hosting guys, so I have a . I set the ftp a/c details and tried to publish the website, orchard shows me only the files How can I get orchard to upload all the files again? This is what I see when I hit publish to the , that link is not much help and points here : [http://www.iis.net](http://www.iis.net) I tried googling, but nothing so far. ![enter image description here](https://i.stack.imgur.com/lkJbs.png)
web matrix does not let me upload all my files to a new ftp (cannot upload all files again)
CC BY-SA 2.5
null
2011-02-04T16:41:26.303
2011-02-04T17:34:57.547
null
null
368,070
[ "ftp", "webmatrix", "orchardcms" ]
4,900,523
1
4,903,521
null
2
1,480
Not entirely sure if this should belong on Stack Overflow, but here goes. I'm creating a simple version of tic-tac-toe in 3D using the HTML5 `<canvas>` object. The first player uses the cross symbol, whereas the second player uses the circle symbol. The point is that I'm not sure how to put circular shapes into perspective. Currently, the method I'm using is creating a regular polygon with as many angles as possible (to a certain extent, though) to fake a circle by drawing straight lines between those points. The coordinates of these points (angles) I have calculated using sine / cosine. Using 6 angles: ![enter image description here](https://i.stack.imgur.com/cXdG8.png) Using 50 angles (looks like a circle well enough): ![enter image description here](https://i.stack.imgur.com/Iriyx.png) This works well, but it requires quite a lot of points to fake a circle nicely. Moreover, if I were to create a ball, I'd be in more trouble. The picture at Wikipedia, for example, shows that even with a great deal of points, it would still have a rather 'blocky' surface: [http://en.wikipedia.org/wiki/File:Sphere_wireframe.svg](http://en.wikipedia.org/wiki/File:Sphere_wireframe.svg) I was wondering if there is any way to put a circle in perspective more effectively, perhaps without points, so as to be able to create a realistic looking circular shapes in a more practical way. Thanks in advance for any suggestions.
Practical method of putting circular shapes into perspective?
CC BY-SA 2.5
null
2011-02-04T16:41:20.627
2014-10-09T22:40:59.157
2011-02-06T23:01:45.487
242,848
514,749
[ "math", "3d", "perspective" ]
4,900,624
1
null
null
0
76
I want to be able to have a scrollable set of data fetched from a SQLite database (ArrayList) in which when an item is clicked it remains clicked (i.e. the background changes) and some reference to which element has been clicked and then if another widget (say a button) is pressed it carries out some action on the highlighted item. See below for an illustration of what I mean. This is a very simplified version. ![enter image description here](https://i.stack.imgur.com/KxKxP.jpg) So when 'Test Item 1' is selected the background stays yellow and when delete is pressed the item is deleted from the list and the database. How do I go about this? Are there any tutorials out there? Any help is appreciated.
UI help, maybe need to change from a list view?
CC BY-SA 2.5
null
2011-02-04T16:53:10.893
2011-04-02T23:39:48.273
null
null
400,406
[ "java", "android", "listview" ]
4,900,673
1
4,900,706
null
0
1,142
I've upgraded from mvc 2 to mvc 3. I've grabbed the new mvc contrib dll's for mvc 3 from here [http://mvccontrib.codeplex.com/releases](http://mvccontrib.codeplex.com/releases) I'm having some issues with the new mvc grid syntax. See attached. ![enter image description here](https://i.stack.imgur.com/9mEMx.png) Does anyone know the new syntax?
mvccontrib gridview, using new mvc3 syntax issue
CC BY-SA 2.5
null
2011-02-04T16:58:48.793
2011-02-04T17:01:37.347
null
null
461,880
[ "asp.net-mvc-3", "mvccontrib-grid" ]
4,900,741
1
4,900,943
null
0
369
I am a beginner so please take it easy. First some history, I am trying to modify a flash movie (not created by me) that has 4 images in it. I have to now add 2 more images (pic5.png and pic6.jpg) to the "slideshow" as shown in the attachment, I have added the 2 images to the library. The problem I am having (as I understand, I may be incorrect) is that `_root.count = 4` causes the movie to jump back to the first image after it displays the 4th one which does not display the 5th & 6th image. My question, how do I edit the value of _root.count to 6, so that it will show all the 6 images. Additionally how do I create a hyperlink on each image. Please can someone guide me. Many thanks. ![enter image description here](https://i.stack.imgur.com/TEFXq.jpg)
Edit onClipEvent Actionscript
CC BY-SA 2.5
null
2011-02-04T17:05:21.523
2014-08-24T03:46:40.720
2014-08-24T03:46:40.720
3,366,929
80,368
[ "events", "actionscript-2" ]
4,900,840
1
4,901,079
null
2
858
I want to convert image into HTML sections ( see image below marked as red , blue , orange , green and yellow). That means when i click on these parts they will appear as a separate section in a separate window just like online news paper. Well one can do this by using photoshop slicing tool may be m not sure.. but don't want to use photoshop rather i want to implement such functionality where i can select the section over image and then later on it will get convert into html page or part. so can anyone give me some idea , example or a road map to do that ![enter image description here](https://i.stack.imgur.com/3OD29.png)
convert image into html sections
CC BY-SA 2.5
null
2011-02-04T17:15:10.453
2011-02-04T19:19:02.240
2011-02-04T17:17:32.273
1,583
405,383
[ "javascript", "html", "image" ]
4,900,747
1
4,901,516
null
60
3,814
I've profiled my Python program to death, and there is one function that is slowing everything down. It uses Python dictionaries heavily, so I may not have used them in the best way. If I can't get it running faster, I will have to re-write it in C++, so is there anyone who can help me optimise it in Python? I hope I've given the right sort of explanation, and that you can make some sense of my code! Thanks in advance for any help. This is the offending function, profiled using [line_profiler and kernprof](https://pythonhosted.org/line_profiler/). I'm running Python 2.7 I'm particularly puzzled by things like lines 363, 389 and 405, where an `if` statement with a comparison of two variables seems to take an inordinate amount of time. I've considered using [NumPy](https://numpy.org/) (as it does sparse matrices) but I don't think it's appropriate because: (1) I'm not indexing my matrix using integers (I'm using object instances); and (2) I'm not storing simple data types in the matrix (I'm storing tuples of a float and an object instance). But I'm willing to be persuaded about NumPy. If anyone knows about NumPy's sparse matrix performance vs. Python's hash tables, I'd be interested. Sorry I haven't given a simple example that you can run, but this function is tied up in a much larger project and I couldn't work out how to set up a simple example to test it, without giving you half of my code base! ``` Timer unit: 3.33366e-10 s File: routing_distances.py Function: propagate_distances_node at line 328 Total time: 807.234 s Line # Hits Time Per Hit % Time Line Contents 328 @profile 329 def propagate_distances_node(self, node_a, cutoff_distance=200): 330 331 # a makes sure its immediate neighbours are correctly in its distance table 332 # because its immediate neighbours may change as binds/folding change 333 737753 3733642341 5060.8 0.2 for (node_b, neighbour_distance_b_a) in self.neighbours[node_a].iteritems(): 334 512120 2077788924 4057.2 0.1 use_neighbour_link = False 335 336 512120 2465798454 4814.9 0.1 if(node_b not in self.node_distances[node_a]): # a doesn't know distance to b 337 15857 66075687 4167.0 0.0 use_neighbour_link = True 338 else: # a does know distance to b 339 496263 2390534838 4817.1 0.1 (node_distance_b_a, next_node) = self.node_distances[node_a][node_b] 340 496263 2058112872 4147.2 0.1 if(node_distance_b_a > neighbour_distance_b_a): # neighbour distance is shorter 341 81 331794 4096.2 0.0 use_neighbour_link = True 342 496182 2665644192 5372.3 0.1 elif((None == next_node) and (float('+inf') == neighbour_distance_b_a)): # direct route that has just broken 343 75 313623 4181.6 0.0 use_neighbour_link = True 344 345 512120 1992514932 3890.7 0.1 if(use_neighbour_link): 346 16013 78149007 4880.3 0.0 self.node_distances[node_a][node_b] = (neighbour_distance_b_a, None) 347 16013 83489949 5213.9 0.0 self.nodes_changed.add(node_a) 348 349 ## Affinity distances update 350 16013 86020794 5371.9 0.0 if((node_a.type == Atom.BINDING_SITE) and (node_b.type == Atom.BINDING_SITE)): 351 164 3950487 24088.3 0.0 self.add_affinityDistance(node_a, node_b, self.chemistry.affinity(node_a.data, node_b.data)) 352 353 # a sends its table to all its immediate neighbours 354 737753 3549685140 4811.5 0.1 for (node_b, neighbour_distance_b_a) in self.neighbours[node_a].iteritems(): 355 512120 2129343210 4157.9 0.1 node_b_changed = False 356 357 # b integrates a's distance table with its own 358 512120 2203821081 4303.3 0.1 node_b_chemical = node_b.chemical 359 512120 2409257898 4704.5 0.1 node_b_distances = node_b_chemical.node_distances[node_b] 360 361 # For all b's routes (to c) that go to a first, update their distances 362 41756882 183992040153 4406.3 7.6 for node_c, (distance_b_c, node_after_b) in node_b_distances.iteritems(): # Think it's ok to modify items while iterating over them (just not insert/delete) (seems to work ok) 363 41244762 172425596985 4180.5 7.1 if(node_after_b == node_a): 364 365 16673654 64255631616 3853.7 2.7 try: 366 16673654 88781802534 5324.7 3.7 distance_b_a_c = neighbour_distance_b_a + self.node_distances[node_a][node_c][0] 367 187083 929898684 4970.5 0.0 except KeyError: 368 187083 1056787479 5648.8 0.0 distance_b_a_c = float('+inf') 369 370 16673654 69374705256 4160.7 2.9 if(distance_b_c != distance_b_a_c): # a's distance to c has changed 371 710083 3136751361 4417.4 0.1 node_b_distances[node_c] = (distance_b_a_c, node_a) 372 710083 2848845276 4012.0 0.1 node_b_changed = True 373 374 ## Affinity distances update 375 710083 3484577241 4907.3 0.1 if((node_b.type == Atom.BINDING_SITE) and (node_c.type == Atom.BINDING_SITE)): 376 99592 1591029009 15975.5 0.1 node_b_chemical.add_affinityDistance(node_b, node_c, self.chemistry.affinity(node_b.data, node_c.data)) 377 378 # If distance got longer, then ask b's neighbours to update 379 ## TODO: document this! 380 16673654 70998570837 4258.1 2.9 if(distance_b_a_c > distance_b_c): 381 #for (node, neighbour_distance) in node_b_chemical.neighbours[node_b].iteritems(): 382 1702852 7413182064 4353.4 0.3 for node in node_b_chemical.neighbours[node_b]: 383 1204903 5912053272 4906.7 0.2 node.chemical.nodes_changed.add(node) 384 385 # Look for routes from a to c that are quicker than ones b knows already 386 42076729 184216680432 4378.1 7.6 for node_c, (distance_a_c, node_after_a) in self.node_distances[node_a].iteritems(): 387 388 41564609 171150289218 4117.7 7.1 node_b_update = False 389 41564609 172040284089 4139.1 7.1 if(node_c == node_b): # a-b path 390 512120 2040112548 3983.7 0.1 pass 391 41052489 169406668962 4126.6 7.0 elif(node_after_a == node_b): # a-b-a-b path 392 16251407 63918804600 3933.1 2.6 pass 393 24801082 101577038778 4095.7 4.2 elif(node_c in node_b_distances): # b can already get to c 394 24004846 103404357180 4307.6 4.3 (distance_b_c, node_after_b) = node_b_distances[node_c] 395 24004846 102717271836 4279.0 4.2 if(node_after_b != node_a): # b doesn't already go to a first 396 7518275 31858204500 4237.4 1.3 distance_b_a_c = neighbour_distance_b_a + distance_a_c 397 7518275 33470022717 4451.8 1.4 if(distance_b_a_c < distance_b_c): # quicker to go via a 398 225357 956440656 4244.1 0.0 node_b_update = True 399 else: # b can't already get to c 400 796236 3415455549 4289.5 0.1 distance_b_a_c = neighbour_distance_b_a + distance_a_c 401 796236 3412145520 4285.3 0.1 if(distance_b_a_c < cutoff_distance): # not too for to go 402 593352 2514800052 4238.3 0.1 node_b_update = True 403 404 ## Affinity distances update 405 41564609 164585250189 3959.7 6.8 if node_b_update: 406 818709 3933555120 4804.6 0.2 node_b_distances[node_c] = (distance_b_a_c, node_a) 407 818709 4151464335 5070.7 0.2 if((node_b.type == Atom.BINDING_SITE) and (node_c.type == Atom.BINDING_SITE)): 408 104293 1704446289 16342.9 0.1 node_b_chemical.add_affinityDistance(node_b, node_c, self.chemistry.affinity(node_b.data, node_c.data)) 409 818709 3557529531 4345.3 0.1 node_b_changed = True 410 411 # If any of node b's rows have exceeded the cutoff distance, then remove them 412 42350234 197075504439 4653.5 8.1 for node_c, (distance_b_c, node_after_b) in node_b_distances.items(): # Can't use iteritems() here, as deleting from the dictionary 413 41838114 180297579789 4309.4 7.4 if(distance_b_c > cutoff_distance): 414 206296 894881754 4337.9 0.0 del node_b_distances[node_c] 415 206296 860508045 4171.2 0.0 node_b_changed = True 416 417 ## Affinity distances update 418 206296 4698692217 22776.5 0.2 node_b_chemical.del_affinityDistance(node_b, node_c) 419 420 # If we've modified node_b's distance table, tell its chemical to update accordingly 421 512120 2130466347 4160.1 0.1 if(node_b_changed): 422 217858 1201064454 5513.1 0.0 node_b_chemical.nodes_changed.add(node_b) 423 424 # Remove any neighbours that have infinite distance (have just unbound) 425 ## TODO: not sure what difference it makes to do this here rather than above (after updating self.node_distances for neighbours) 426 ## but doing it above seems to break the walker's movement 427 737753 3830386968 5192.0 0.2 for (node_b, neighbour_distance_b_a) in self.neighbours[node_a].items(): # Can't use iteritems() here, as deleting from the dictionary 428 512120 2249770068 4393.1 0.1 if(neighbour_distance_b_a > cutoff_distance): 429 150 747747 4985.0 0.0 del self.neighbours[node_a][node_b] 430 431 ## Affinity distances update 432 150 2148813 14325.4 0.0 self.del_affinityDistance(node_a, node_b) ``` This function maintains a sparse distance matrix representing the network distance (sum of edge weights on the shortest path) between nodes in a (very big) network. To work with the complete table and use the [Floyd-Warshall algorithm](https://en.wikipedia.org/wiki/Floyd%E2%80%93Warshall_algorithm) would be very slow. (I tried this first, and it was orders of magnitude slower than the current version.) So my code uses a sparse matrix to represent a thresholded version of the full distance matrix (any paths with a distance greater than 200 units are ignored). The network topolgy changes over time, so this distance matrix needs updating over time. To do this, I am using a rough implementation of a [distance-vector routing protocol](https://en.wikipedia.org/wiki/Distance-vector_routing_protocol): each node in the network knows the distance to each other node and the next node on the path. When a topology change happens, the node(s) associated with this change update their distance table(s) accordingly, and tell their immediate neighbours. The information spreads through the network by nodes sending their distance tables to their neighbours, who update their distance tables and spread them to their neighbours. There is an object representing the distance matrix: `self.node_distances`. This is a dictionary mapping nodes to routing tables. A node is an object that I've defined. A routing table is a dictionary mapping nodes to tuples of (distance, next_node). Distance is the graph distance from node_a to node_b, and next_node is the neighbour of node_a that you must go to first, on the path between node_a and node_b. A next_node of None indicates that node_a and node_b are graph neighbours. For example, a sample of a distance matrix could be: ``` self.node_distances = { node_1 : { node_2 : (2.0, None), node_3 : (5.7, node_2), node_5 : (22.9, node_2) }, node_2 : { node_1 : (2.0, None), node_3 : (3.7, None), node_5 : (20.9, node_7)}, ...etc... ``` Because of topology changes, two nodes that were far apart (or not connected at all) can become close. When this happens, entries are added to this matrix. Because of the thresholding, two nodes can become too far apart to care about. When this happens, entries are deleted from this matrix. The `self.neighbours` matrix is similar to `self.node_distances`, but contains information about the direct links (edges) in the network. `self.neighbours` is continually being modified externally to this function, by the chemical reaction. This is where the network topology changes come from. The actual function that I'm having problems with: `propagate_distances_node()` performs one step of the [distance-vector routing protocol](https://en.wikipedia.org/wiki/Distance-vector_routing_protocol). Given a node, `node_a`, the function makes sure that `node_a`'s neighbours are correctly in the distance matrix (topology changes). The function then sends `node_a`'s routing table to all of `node_a`'s immediate neighbours in the network. It integrates `node_a`'s routing table with each neighbour's own routing table. In the rest of my program, the `propagate_distances_node()` function is called repeatedly, until the distance matrix converges. A set, `self.nodes_changed`, is maintained, of the nodes that have changed their routing table since they were last updated. On every iteration of my algorithm, a random subset of these nodes are chosen and `propagate_distances_node()` is called on them. This means the nodes spread their routing tables asynchronously and stochastically. This algorithm converges on the true distance matrix when the set `self.nodes_changed` becomes empty. The "affinity distances" parts (`add_affinityDistance` and `del_affinityDistance`) are a cache of a (small) sub-matrix of the distance matrix, that is used by a different part of the program. The reason I'm doing this is that I'm simulating computational analogues of chemicals participating in reactions, as part of my PhD. A "chemical" is a graph of "atoms" (nodes in the graph). Two chemicals binding together is simulated as their two graphs being joined by new edges. A chemical reaction happens (by a complicated process that isn't relevant here), changing the topology of the graph. But what happens in the reaction depends on how far apart the different atoms are that make up the chemicals. So for each atom in the simulation, I want to know which other atoms it is close to. A sparse, thresholded distance matrix is the most efficient way to store this information. Since the topology of the network changes as the reaction happens, I need to update the matrix. A [distance-vector routing protocol](https://en.wikipedia.org/wiki/Distance-vector_routing_protocol) is the fastest way I could come up with of doing this. I don't need a more compliacted routing protocol, because things like routing loops don't happen in my particular application (because of how my chemicals are structured). The reason I'm doing it stochastically is so that I can interleve the chemical reaction processes with the distance spreading, and simulate a chemical gradually changing shape over time as the reaction happens (rather than changing shape instantly). The `self` in this function is an object representing a chemical. The nodes in `self.node_distances.keys()` are the atoms that make up the chemical. The nodes in `self.node_distances[node_x].keys()` are nodes from the chemical and potentially nodes from any chemicals that the chemical is bound to (and reacting with). I tried replacing every instance of `node_x == node_y` with `node_x is node_y` (as per @Sven Marnach's comment), Sorry, I was doing the profiling wrong! I was using line_by_line, which (on my code) had far too much variance (that difference of ~90 seconds was all in the noise). When profiling it properly, `is` is detinitely faster than `==`. Using [CProfile](https://docs.python.org/3/library/profile.html), my code with `==` took 34.394s, but with `is`, it took 33.535s (which I can confirm is out of the noise). Existing libraries I'm unsure as to whether there will be an existing library that can do what I want, since my requirements are unusual: I need to compute the shortest-path lengths between all pairs of nodes in a weighted, undirected graph. I only care about path lengths that are lower than a threshold value. After computing the path lengths, I make a small change to the network topology (adding or removing an edge), and then I want to re-compute the path lengths. My graphs are huge compared to the threshold value (from a given node, most of the graph is further away than the threshold), and so the topology changes don't affect most of the shortest-path lengths. This is why I am using the routing algorithm: because this spreads topology-change information through the graph structure, so I can stop spreading it when it's gone further than the threshold. i.e., I don't need to re-compute all the paths each time. I can use the previous path information (from before the topology change) to speed up the calculation. This is why I think my algorithm will be faster than any library implementations of shortest-path algorithms. I've never seen routing algorithms used outside of actually routing packets through physical networks (but if anyone has, then I'd be interested). [NetworkX](https://web.archive.org/web/20121115182146/http://networkx.lanl.gov:80/) was suggested by @Thomas K. It has [lots of algorithms](https://web.archive.org/web/20150216223026/http://networkx.lanl.gov:80/reference/algorithms.shortest_paths.html) for calculating shortest paths. It has an algorithm for computing the [all-pairs shortest path lengths](https://web.archive.org/web/20150306141810/http://networkx.lanl.gov:80/reference/generated/networkx.algorithms.shortest_paths.unweighted.all_pairs_shortest_path_length.html) with a cutoff (which is what I want), but it only works on unweighted graphs (mine are weighted). Unfortunately, its [algorithms for weighted graphs](https://web.archive.org/web/20111114235558/http://networkx.lanl.gov:80/reference/generated/networkx.algorithms.shortest_paths.weighted.bellman_ford.html) don't allow the use of a cutoff (which might make them slow for my graphs). And none of its algorithms appear to support the use of pre-calculated paths on a very similar network (i.e. the routing stuff). [igraph](https://web.archive.org/web/20220128234206/http://cneurocvs.rmki.kfki.hu/igraph/) is another graph library that I know of, but looking at [its documentation](https://web.archive.org/web/20191019073543/http://cneurocvs.rmki.kfki.hu/igraph/doc/python/index.html), I can't find anything about shortest-paths. But I might have missed it - its documentation doesn't seem very comprehensive. [NumPy](https://numpy.org/) might be possible, thanks to @9000's comment. I can store my sparse matrix in a NumPy array if I assign a unique integer to each instance of my nodes. I can then index a NumPy array with integers instead of node instances. I will also need two NumPy arrays: one for the distances and one for the "next_node" references. This might be faster than using Python dictionaries (I don't know yet). Does anyone know of any other libraries that might be useful? Memory usage I'm running Windows (XP), so here is some info about memory usage, from [Process Explorer](https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer). The CPU usage is at 50% because I have a dual-core machine. ![global memory usage](https://i.stack.imgur.com/69K0X.png) ![my program's memory usage](https://i.stack.imgur.com/KlkdY.png) My program doesn't run out of RAM and start hitting the swap. You can see that from the numbers, and from the IO graph not having any activity. The spikes on the IO graph are where the program prints to the screen to say how it's doing. However, my program does keep using up more and more RAM over time, which is probably not a good thing (but it's not using up much RAM overall, which is why I didn't notice the increase until now). And the distance between the spikes on the IO graph increases over time. This is bad - my program prints to the screen every 100,000 iterations, so that means that each iteration is taking longer to execute as time goes on... I've confirmed this by doing a long run of my program and measuring the time between print statements (the time between each 10,000 iterations of the program). This should be constant, but as you can see from the graph, it increases linearly... so something's up there. (The noise on this graph is because my program uses lots of random numbers, so the time for each iteration varies.) ![lag between print statements increasing over time](https://i.stack.imgur.com/icTyF.png) After my program's been running for a long time, the memory usage looks like this (so it's definitely not running out of RAM): ![global memory usage - after a long run](https://i.stack.imgur.com/Et3us.png) ![my program's memory usage - after a long run](https://i.stack.imgur.com/8Rv1O.png)
How can I optimise this use of Python dictionaries?
CC BY-SA 4.0
0
2011-02-04T17:06:18.823
2022-12-24T19:03:29.913
2022-12-24T19:03:29.913
4,751,173
598,749
[ "python", "optimization", "dictionary", "sparse-matrix" ]
4,900,938
1
4,900,994
null
0
825
I'm trying to do a fully customized Facebook "Like-Box". I want to have this fixed width div and be able to slide left or right to show more faces (I would prefer ajax, but that doesn't seem possible, or does it?). If there's no ajax way to LOAD more faces, I would like to pre-load, let's say, 50 faces, on this small div and press left or right to slide more content (faces) from inside the div. ![Facebook Like-box](https://i.stack.imgur.com/i91MO.gif)
Slide to show more content overflowed on div
CC BY-SA 2.5
null
2011-02-04T17:23:11.480
2011-02-04T19:28:05.547
null
null
110,282
[ "jquery", "css", "facebook", "facebook-like" ]
4,900,963
1
null
null
2
677
I am using an OpenGL texture on an iPad and get on the , while the shows all . I believe the iPhone would show the same artifacts. If I look at the headers, I see that once I include OpenGLES/ES2/gl.h, and in another file OpenGLES/ES1/*.h. Could this be a problem? Or what may be the reason for the artifacts on the device? Simulator: ![screenshot from simulator](https://i.stack.imgur.com/UcLhr.png) Real device: ![screenshot from real device](https://i.stack.imgur.com/DP6Y3.png)
Visual artifacts in a OpenGL texture on device (iPad) - but NOT on Simulator
CC BY-SA 2.5
null
2011-02-04T17:25:08.287
2011-04-25T20:44:55.303
2011-02-06T12:40:20.617
427,332
497,649
[ "iphone", "ipad", "opengl-es", "textures", "artifacts" ]
4,901,064
1
null
null
2
3,112
I am trying to grab a path value from an array for an NSURL to set an icon in my app. I get an > NSInvalidArgumentException', reason: '-[__NSArrayI length]: unrecognized selector sent to instance 0x5622590. If I use an nslog I get the expected output: ``` NSLog(@"%@",[[wforecast.wicons objectAtIndex:0]valueForKey:@"nodeContent"]); ``` Which gives me: ![enter image description here](https://i.stack.imgur.com/hM7ei.png) Im setting the value as follows ``` NSURL *urlpath; NSString *urls = [[wforecast.wicons objectAtIndex:0] valueForKey:@"nodeContent"]; urlpath = [NSURL URLWithString:(NSString *)urls]; ``` I appreciate this is a longwinded way of doing things but I was trying to break up the individual components to find out what was going wrong but I am at a loss!
NSURL Exceptions
CC BY-SA 3.0
null
2011-02-04T17:32:19.453
2011-12-16T21:33:46.673
2011-12-16T21:33:46.673
171,206
596,968
[ "iphone", "objective-c", "cocoa" ]
4,901,122
1
4,901,142
null
3
279
How i can add [intellimouse](http://edn.embarcadero.com/article/34325) support to a TMemo or TRichEdit component i am using Delphi XE ![enter image description here](https://i.stack.imgur.com/PsCVs.png)
Add intellimouse support to a TMemo or TRichEdit component
CC BY-SA 2.5
0
2011-02-04T17:37:39.717
2011-02-04T18:19:22.110
null
null
167,454
[ "delphi", "delphi-xe" ]
4,901,253
1
4,901,298
null
2
8,550
I'm developing a full-screen web app for an iPad that will have a series of images on screen in a slider whereby the user will be able to scroll between them and then click on one. Here is an example image of how it would look: ![http://www.geardiary.com/wp-content/uploads/2010/10/wired-mag-ipad-screen-caps-001-525x700.png](https://i.stack.imgur.com/TDMRK.png) There are plenty of jQuery-based sliders out-there but all require the use of a user clicking some form of button. What I want to do is replicate it so that the user would swipe the screen to move between the different images. Here is some example markup: ``` <ul id="magazine-slider"> <li> <div class="image"> <img src="magazine-cover-jan.png" width="640" height="640" /> </div> <div class="meta"> <h3>Magazine Title</h3> <h4>January 2010</h4> </div> <ul class="options"> <li><a title="Delete" href="#">Delete</a></li> <li><a title="View" href="#">View</a></li> </ul> </li> <li> <div class="image"> <img src="magazine-cover-feb.png" width="640" height="640" /> </div> <div class="meta"> <h3>Magazine Title</h3> <h4>February 2010</h4> </div> <ul class="options"> <li><a title="Delete" href="#">Delete</a></li> <li><a title="View" href="#">View</a></li> </ul> </li> <li> <div class="image"> <img src="magazine-cover-mar.png" width="640" height="640" /> </div> <div class="meta"> <h3>Magazine Title</h3> <h4>March 2010</h4> </div> <ul class="options"> <li><a title="Delete" href="#">Delete</a></li> <li><a title="View" href="#">View</a></li> </ul> </li> </ul> <ul id="magazine-slider-pagination"> <li>1</li> <li>2</li> <li>3</li> </ul> ``` Can anyone help? Thanks
iPad WebApp that simulates swipe slider
CC BY-SA 2.5
0
2011-02-04T17:54:04.123
2011-05-23T19:20:10.267
null
null
302,533
[ "javascript", "jquery", "ipad" ]
4,901,460
1
4,901,725
null
2
3,584
I would like to have a GUI setup like the diagram below. ![](https://i.stack.imgur.com/w2MnP.png) The `JLayeredPane` should always be the same size, but the `JPanel` and the `JScrollPane` can change in size. I need the `JScrollPane` to be able to display the `JLayedPane` by clicking the arrows and what not if the `JPanel` and `JScrollPane` are not large enough to show the entire `JLayeredPane`. The problem is that with the code below, the `JLayeredPane` always expands to fit the size of the `JScrollPane` and in the event that the `JScrollPane` is smaller than the `JLayeredPane`, it does not provide the scrolling ability. Any Ideas on what is going on? Is there simpler code to achieve this? Thanks ``` contentPanePanel = new javax.swing.JPanel(); contentPaneScollPane = new javax.swing.JScrollPane(); contentPane = new javax.swing.JLayeredPane(); contentPanePanel.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true)); contentPane.setRequestFocusEnabled(false); contentPane.setVerifyInputWhenFocusTarget(false); contentPaneScollPane.setViewportView(contentPane); javax.swing.GroupLayout contentPanePanelLayout = new javax.swing.GroupLayout(contentPanePanel); contentPanePanel.setLayout(contentPanePanelLayout); contentPanePanelLayout.setHorizontalGroup( contentPanePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(contentPaneScollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 968, Short.MAX_VALUE) ); contentPanePanelLayout.setVerticalGroup( contentPanePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(contentPaneScollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 628, Short.MAX_VALUE) ); ``` ````
Swing GUI design with JScrollPane and JLayeredPane
CC BY-SA 3.0
null
2011-02-04T18:16:41.533
2015-12-14T14:38:58.530
2015-12-14T14:38:58.530
4,857,909
489,041
[ "java", "user-interface", "swing" ]
4,901,578
1
4,902,145
null
2
1,020
I have a view setup in the Views module that outputs an RSS feed of nodes. In the Fields section I have specified that I want the Title, Date and Body in the feed, but Views seems to ignore all but the title (and the link which I haven't specified to include). I know it's using the Views module because if I remove the title for each item or rename the entire feed it is reflected in the actual feed. I don't think there's any tpl files that are restricting the output either, but I don't know all the places to look. Does this sound familiar? ![](https://i.stack.imgur.com/GZsTc.png) ``` <?xml version="1.0" encoding="utf-8" ?> <rss version="2.0" > <channel> <title>RSS Feed Title</title> <description>...</description> <link>http://...</link> <item> <title>Title</title> <link>http://...</link> </item> <item> <title>Title</title> <link>http://...</link> </item> . . . ```
Can't get fields to show in Drupal Views module
CC BY-SA 2.5
null
2011-02-04T18:28:58.080
2011-02-04T19:35:20.463
2011-02-04T18:57:17.243
84,783
84,783
[ "drupal", "module", "view", "drupal-views" ]
4,901,773
1
4,939,015
null
7
602
I am pulling my hair out on this one. We're just about done with the development of an overhaul to our site. As a last step, we're trying to wrap up all the glyphs and icons into a sprite. They're all transparent .png's so the sprite is too. It appears that if a background comes from a sptire, IE distorts it. If it comes from the original file, it does not. FF and Chrome are fine either way. I am looking at the orignal image and the sprited version side-by-side with grids to see that the pixels are identical. I have counted the pixels in the sprite many times to ensure I'm using the right coordinates. My CSS looks like this: ``` XXbackground: url(sprite.png) no-repeat 0px -837px; /* lozRedRedSpacer */ background: url(lozRedRedSpacer.png) no-repeat; ``` The 'XX' lets me toggle back and forth. With the single-file version, it looks perfect: ![seperate file background](https://i.stack.imgur.com/AY3a9.png). The sprite-version looks like this: ![sprite](https://i.stack.imgur.com/k0YA6.png). It looks like it is 'squished' both vertically and horizontally. This does not happen in FF or Chrome. Any ideas? I was able to strip out most of the noise and post an example [here](http://stream.insigniagroup.com/temptest/index.htm). I've added notes to the example to describe my problem. Thank you so much for taking the time to look at this! We've since replaced these 'overlapped divider images' with CSS pseudo-classes that REALLY do overlap and the zooming issue seems to have gone away. Of course now we have new problems - IE8 gets the z-order wrong and IE7 doesn't understand psuedo-elements at all. But at least the markup is simpler and the zooming issue is gone.
Does IE(7?) distort backgrounds from sprites?
CC BY-SA 3.0
0
2011-02-04T18:47:42.563
2012-04-16T11:42:31.750
2012-04-16T11:42:31.750
37,710
37,710
[ "css", "internet-explorer", "background-image", "sprite" ]
4,902,306
1
4,902,446
null
1
3,912
Hey, I am new to asp and I would like to ask you for some help. I built store with MvcMusicStore tutorial help. Now I want to add a View to manage orders which will display just OrderID (in Index View), then more info in Details View. Info will come from table which looks like this: ![](https://i.stack.imgur.com/RBOWz.jpg) When I list OrderID, its multiplying because each product creates new record with the same OrderID in the table. Is there any way to display each Id just once? Then I tried to display more info in Detaild View but I failed again. I used this code in Controller: ``` public ActionResult Details(int id) { var orderdetail = storeDB.OrderDetails.Single(a => a.Order.OrderId == id); return View(orderdetail); } ``` but obviously it wont work because only one element can be displayed. I also tried with foreach loop in Details.aspx but I was getting some IEnumerables-related error. Any advice is welcome, sorry for newbie question and bad English. Thank you. Edit: Here is Controller's code for Index View (Product in my table equals Album in tutorial): ``` public ActionResult Index() { var manageorders = storeDB.OrderDetails .Include("Product").Include("Order") .ToList(); return View(manageorders); } ``` And Details View code: ``` <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/MasterPage.Master" Inherits="System.Web.Mvc.ViewPage<ss.Models.OrderDetail>" %> ``` Index ``` <div id="style3">manage orders</div> <div id="style1"> <table> <tr> <th></th> <th> user </th> <th> data </th> <th> product </th> <th> quantity </th> </tr> <% foreach (var item in Model) { %> <tr> <td> <%: Html.ActionLink("Edit", "Edit", new { id=item.Order.OrderId }) %> | <%: Html.ActionLink("Details", "Delete", new { id=item.Order.OrderId })%> </td> <td> <%: item.Order.Username %> </td> <td> <%: item.Order.OrderDate %> </td> <td> <%: item.Quantity %> </td> <td> <%: item.Quantity %> </td> </tr> <% } %> ``` ``` <p> <%: Html.ActionLink("Create New", "Create") %> </p> ``` And error I am recieving: > Compiler Error Message: CS1579: foreach statement cannot operate on variables of type 'ss.Models.OrderDetail' because 'ss.Models.OrderDetail' does not contain a public definition for 'GetEnumerator'
MVC, view displaying data
CC BY-SA 2.5
null
2011-02-04T19:53:39.533
2011-02-05T16:21:55.940
2011-02-05T16:21:55.940
128,546
603,727
[ "c#", "asp.net-mvc-2" ]
4,902,509
1
4,902,883
null
5
3,823
I'm trying to extend the `python.lang` file so that it will make methods like `__init__` highlighted. I've been trying to come up with a Regex that will match all `__privateMethods()`. The `python.lang` is a XML file containing all of the highlighting rules for python files. Ex: ``` <context id="special-variables" style-ref="special-variable"> <prefix>(?&lt;![\w\.])</prefix> <keyword>self</keyword> <keyword>__name__</keyword> <keyword>__debug__</keyword> </context> ``` How can I extend this so that it matches double underscores? --- What I added to my `python.lang` file (if anyone's interested): First off you need to add this line near the top where the styles are defined. ``` <style id="private-methods" _name="Private Methods" map-to="def:special-constant"/> ``` Then you'll add the Regex that [Carles provided in his answer](https://stackoverflow.com/questions/4902509/regex-to-match-double-underscores/4902883#4902883): ``` <context id="private-methods" style-ref="private-methods"> <match>(__[a-zA-Z_]*(__)?)</match> </context> ``` And here is what it looks like when your done! ![enter image description here](https://i.stack.imgur.com/q1jGv.png)
Regex to match double underscores?
CC BY-SA 2.5
null
2011-02-04T20:17:40.673
2011-02-05T20:31:15.863
2017-05-23T11:48:25.477
-1
56,555
[ "python", "xml", "regex", "gedit" ]
4,902,568
1
4,905,349
null
2
3,458
![enter image description here](https://i.stack.imgur.com/fJPWk.png) I'm building a tableView that has three sections. I've got the first two working but the last one is a bit resistant. My problem seems to involve trying to declare a variable inside a switch statement, actually a nested switch statement. From what I've read that's not a good idea but in this case it seems like the only option. The section in question dynamically accommodates the number of Alert objects that are associated with a particular piece of equipment. The Alerts are coming from Core Data and in place of "Date" and "Alert Message" I want to display the info from the Alert. I'm retrieving the relevant alerts using a NSFetchRequest. That returns an array of Alert objects that are sorted the way I want them. To display the proper information in the cellForRowAtIndexPath I've been trying to pull back that correct alert for the row using ``` Alert *alert = [allAlerts objectAtIndex:indexPath.row]; ``` It seems I'm not allowed to declare a variable inside a switch statement. Any ideas how I can get around this? I'm going to have to do something similar in didSelectRowForIndexPath because I need to push a detail view when the cell is selected. I've tried declaring the variable outside the switch statement but that's not going to work because the index.row can ask for an object at an index that doesn't exist in the array of Alert and that crashes the program. The code in question is at the bottom of this method: ``` - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { //Cell Identifiers static NSString *attributeCellIdentifier = @"attributeCellIdentifier"; static NSString *operatingInfoCellIdentifier = @"operatingInfoCellIdentifier"; static NSString *alertCellIdentifier = @"alertCellIdentifier"; //Create Attribute Cell If Required UITableViewCell *attributeCell = [tableView dequeueReusableCellWithIdentifier:attributeCellIdentifier]; if (attributeCell == nil) { attributeCell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:attributeCellIdentifier] autorelease]; attributeCell.selectionStyle = UITableViewCellSelectionStyleNone; } //Create Operating Info Cell If Required UITableViewCell *operatingInfoCell = [tableView dequeueReusableCellWithIdentifier:operatingInfoCellIdentifier]; if (operatingInfoCell == nil) { operatingInfoCell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:operatingInfoCellIdentifier] autorelease]; operatingInfoCell.selectionStyle = UITableViewCellSelectionStyleNone; } //Create Alert Cell UITableViewCell *alertCell = [tableView dequeueReusableCellWithIdentifier:alertCellIdentifier]; if (alertCell == nil) { alertCell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:alertCellIdentifier] autorelease]; alertCell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; } switch (indexPath.section) { //Attribute Section case 0: switch (indexPath.row) { case kEquipmentAttributeSectionNameRow: attributeCell.textLabel.text = @"Name"; attributeCell.textLabel.textAlignment = UITextAlignmentRight; attributeCell.selectionStyle = UITableViewCellSelectionStyleNone; [attributeCell.contentView addSubview: self.nameField]; break; case kEquipmentAttributeSectionLocationRow: attributeCell.textLabel.text = @"Location"; attributeCell.textLabel.textAlignment = UITextAlignmentRight; attributeCell.selectionStyle = UITableViewCellSelectionStyleNone; [attributeCell.contentView addSubview: self.locationField]; break; case kEquipmentAttributeSectionControllerSNRow: attributeCell.textLabel.text = @"Serial #"; attributeCell.textLabel.textAlignment = UITextAlignmentRight; attributeCell.selectionStyle = UITableViewCellSelectionStyleNone; [attributeCell.contentView addSubview: self.controllerSNField]; break; case kEquipmentAttributeSectionEquipTypeRow: attributeCell.textLabel.text = @"EquipType"; attributeCell.textLabel.textAlignment = UITextAlignmentRight; attributeCell.selectionStyle = UITableViewCellSelectionStyleNone; [attributeCell.contentView addSubview: self.equipTypeField]; break; return attributeCell; } break; //Operating Info Section case 1: //Grab First Item in Event Array switch (indexPath.row) { //Event *recentEvent = [allEvents objectAtIndex:0]; //Last Update Row case 0: //Event *recentEvent = [allEvents objectAtIndex:0]; operatingInfoCell.textLabel.numberOfLines = 0; operatingInfoCell.textLabel.textAlignment = UITextAlignmentCenter; operatingInfoCell.textLabel.text = @"Last Update"; //operatingInfoCell.detailTextLabel.baselineAdjustment = UIBaselineAdjustmentAlignCenters; operatingInfoCell.detailTextLabel.text = recentEvent.date; return operatingInfoCell; break; //AvgSpeed Row case 1: operatingInfoCell.textLabel.numberOfLines = 0; operatingInfoCell.textLabel.textAlignment = UITextAlignmentCenter; operatingInfoCell.textLabel.text = @"Avg Speed"; operatingInfoCell.detailTextLabel.text = recentEvent.avgSpeed; return operatingInfoCell; break; //MaxSpeed Row case 2: operatingInfoCell.textLabel.numberOfLines = 0; operatingInfoCell.textLabel.textAlignment = UITextAlignmentCenter; operatingInfoCell.textLabel.text = @"Max Speed"; operatingInfoCell.detailTextLabel.text = recentEvent.maxSpeed; return operatingInfoCell; break; //Lifetime Row case 3: operatingInfoCell.textLabel.numberOfLines = 0; operatingInfoCell.textLabel.textAlignment = UITextAlignmentCenter; operatingInfoCell.textLabel.text = @"Lifetime"; operatingInfoCell.detailTextLabel.text = recentEvent.lifetime; return operatingInfoCell; break; } break; //Alert Section //==========================right here========================================= Alert *alert = [[allAlerts objectAtIndex:indexPath.row]; //[alert retain]; case 2: alertCell.textLabel.text = alert.date;//@"Date"; alertCell.detailTextLabel.text = @"Alert Message"; return alertCell; //End of Outside Switch Statement default: break; } return attributeCell; //For the Compiler } ```
How do I create a variable inside a switch statement for a UITableView?
CC BY-SA 2.5
0
2011-02-04T20:26:02.557
2011-02-05T09:28:58.423
2011-02-05T05:39:43.917
161,815
519,493
[ "ios", "uitableview", "core-data" ]
4,902,853
1
4,902,945
null
0
15,853
Is there a standard method for calculating fixed width values for tables in HTML? Right now, I'm working on formatting tables on a web page to be a fixed width, I have a table that's within another table, when testing the page in IE I notice that the alignment of the colon is off as the second picture below illustrates. My intention is to make sure the colons are properly aligned as they are in Firefox and was just curious if the misalignment was due to the settings in the HTML or if it has more to do with how the browser renders the page. Firefox: ![enter image description here](https://i.stack.imgur.com/gk0nB.png) Internet Explorer: ![enter image description here](https://i.stack.imgur.com/j0VwM.png) UPDATE: Sorry for not providing any reference code, here's a snippet of the particular section I'm working with. ``` <div style="width: 1600px; text-align: center; position: absolute; top: 10%; left: 0%;"> <span id="labelInstructions" style="font-size: xx-large;">PAGE TITLE <br><br></span> <table style="width: 1000px;" align="Center" border="0"> <tbody> <tr> <td style="width: 1000px;"><label for="FileUpload1" style="font-size: x-large;">ENTER: </label><input name="FileUpload1" id="FileUpload1" size="70%" type="file"></td> </tr> <tr> <td style="width: 1000px;"><span id="fileUploadError" style="color: Red; font-size: medium;"><br><br></span></td> </tr> <tr> <td style="width: 1000px;"> <table style="width: 1260px;" border="0"> <tbody> <tr> <td style="font-size: x-large; width: 800px;" align="right" valign="top">FILE INSTRUCTIONS:</td> <td style="font-size: x-large; width: 1800px;" align="left" valign="top">INSTRUCTION 1<br>INSTRUCTION 2<br></td> </tr> <tr> <td></td> </tr> <tr> <td style="font-size: x-large; width: 800px;" align="right" valign="top">FILE EXAMPLE:</td> <td style="font-size: x-large; width: 1800px;" align="left" valign="top">EXAMPLE 1<br>EXAMPLE 2<br><br></td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </div> ``` I know it's ugly, just a note, this is an ASP.Net generated webpage and I'm setting the attributes of the HTML elements pro-grammatically from the code behind. I sorta inherited this and my employer wants to keep major changes to a minimum. UPDATE 2: When I adjust the inner table width I can get it to align in IE when set to 1377px. For Firefox, the sweet spot for alignment is 1260px.
Standard fixed table width
CC BY-SA 2.5
null
2011-02-04T20:56:40.560
2011-02-04T22:15:43.033
2011-02-04T22:15:43.033
94,541
94,541
[ "asp.net", "html", "xhtml", "w3c" ]
4,903,083
1
4,903,348
null
33
69,184
I've searched through the internet, I must be using the wrong keywords because I can't find anything. I want to create a textbox that has text starting from a little far from the left. ![http://dab.biz/images/screenie/2011-02-04_1316.png](https://i.stack.imgur.com/SWKz9.png) Just like that.
Textbox padding
CC BY-SA 3.0
0
2011-02-04T21:23:15.137
2020-01-08T18:32:55.903
2015-11-09T07:27:38.477
107,625
486,058
[ "c#", ".net", "winforms", "textbox", "padding" ]
4,903,081
1
4,903,459
null
1
11,565
Using the jqGrid i am trying to figure out how to dynamically load my category combo box below. ![enter image description here](https://i.stack.imgur.com/9w4X1.png) This article shows me how the data must be formed in one of three ways. [http://www.trirand.com/jqgridwiki/doku.php?id=wiki%3Acommon_rules](http://www.trirand.com/jqgridwiki/doku.php?id=wiki%3Acommon_rules). Option #1 or #2 would work just fine as i don't want to load this every time i click the edit button on the grid. Or do i have too? My javascript: ``` $(document).ready(function () { $('#grid').jqGrid({ colNames: ['TypeId', 'Type', 'CR Active', 'Category'], colModel: [ { name: 'TYPE_ID', index: 'TYPE_ID', hidden: true, search: false, editable: true, editoptions: { readonly: true, size: 10 }, formoptions: { rowpos: 1, label: "Type Id", elmprefix: "(*)"} }, { name: 'TYPE', index: 'TYPE', sortable: true, hidden: false, editable: true, editoptions: { size: 25, maxlength: 30 }, formoptions: { rowpos: 2, label: "Type", elmprefix: "(*)" }, editrules: { required: true} }, { name: 'CR_ACTIVE', index: 'CR_ACTIVE', align: 'right', sortable: true, hidden: false, editable: true, edittype: "checkbox", editoptions: { size: 25, value: "Yes:No", defaultValue: "Yes" }, formoptions: { rowpos: 3, elmprefix: "&nbsp;&nbsp;&nbsp;&nbsp;"} }, { name: 'description', index: 'description', editable: true, edittype: "select", editoptions: { value: { 1: 'One', 2: 'Two'} }, formoptions: { rowpos: 4, elmprefix: "&nbsp;&nbsp;&nbsp;&nbsp;"} } ], pager: jQuery('#pager'), sortname: 'TYPE', rowNum: 10, rowList: [10, 20, 50], sortorder: "asc", width: 600, height: 250, datatype: 'json', caption: 'Available Types', viewrecords: true, mtype: 'GET', jsonReader: { root: "rows", page: "page", total: "total", records: "records", repeatitems: false, userdata: "userdata", id: "TYPE_ID" }, url: "/Type/GetData" }).navGrid('#pager', { view: false, del: true, add: true, edit: true }, { height:150, reloadAfterSubmit:false, jqModal:false, closeOnEscape:true, bottominfo: "Fields marked with (*) are required", closeAfterEdit: true, url: "/Type/Edit" }, // default settings for edit { height:150, reloadAfterSubmit:false, jqModal:false, closeOnEscape:true, bottominfo: "Fields marked with (*) are required", closeAfterAdd: true, url: "/Type/Create" }, // default settings for add { reloadAfterSubmit: false, jqModal: false, closeOnEscape: true, url: "/Type/Delete" }, // delete instead that del:false we need this { closeOnEscape: true, multipleSearch: true, closeAfterSearch: true, afterSubmit: function (response, postdata) { alert("testing"); } }, // search options { height: 150, jqModal: false, closeOnEscape: true} /* view parameters*/ ); }); ``` My Controller to be called somehow to load the categories: ``` public JsonResult GetCategories() { string test = "Will be a string contructed as needed"; //have to return something if there is an issue return Json(test); } ``` As i understand it dataUrl="GetCategories" of the colmodel descriptions editoptions would basically call this json action every time the add/edit button is pressed. I am hoping that somebody has an example of how to incorporate this so that it only occurs on page load. Thanks in advance.
jqGrid - how to dynamically load combo box in edit toolbar (ASP.NET MVC 2)
CC BY-SA 2.5
0
2011-02-04T21:23:09.597
2011-02-04T22:08:44.850
2011-02-04T21:52:08.507
315,935
152,467
[ "jquery", "asp.net-mvc-2", "jqgrid" ]
4,903,549
1
4,903,697
null
10
16,105
So first a bit of meat to set the scene: ``` <div id="container"> <div id="inner">test</div> </div> ``` ``` #container { width:300px; height:150px; background-color:#d7ebff; } #inner { width:100%; height:100%; padding:5px; background-color:#4c0015; opacity:.3; } ``` This will produce something that looks like this in all modern browsers: ![CSS interior width test showing the inner box exceeding the container](https://i.stack.imgur.com/phXKP.png) Now I know this is the standards-compliant behavior (as I knew before, but reconfirmed in [this post](https://stackoverflow.com/questions/4698054/css-does-the-width-include-the-padding), and I also know that if I include this code in the inner CSS declaration: ``` box-sizing:border-box; -moz-box-sizing:border-box; -webkit-box-sizing:border-box ``` ...it will adopt the "border-box" model and get the behavior that seems more intuitive to me, but I just found myself trying to logically justify the reasoning behind why this is the way it is and I was unable to do it. It seems (on the surface of things) more logical to me for the inner box to always fill the container to exactly 100% of the container's width, regardless of the padding or border of the inner box. I run into this problem all the time when I'm trying to set the width of a textarea to 100% that has a border or something like a 4px interior padding...the textarea will always overflow the container. So my question is...what is the logic behind setting the default behavior to ignore the border and padding of an element when setting its width?
Why do the CSS width and height properties not adjust for padding?
CC BY-SA 2.5
0
2011-02-04T22:23:53.247
2011-02-05T03:05:36.530
2017-05-23T12:30:36.930
-1
385,950
[ "html", "standards", "css" ]
4,903,686
1
4,905,470
null
1
1,213
I want to ensure that my list images (i.e., bullet symbols for unordered lists and numbers/letters/etc. for ordered lists) never truncate on the left, regardless of the font size they use. This seems to be an issue for WebKit-based browsers and I'm not sure of a decent workaround. For example, the following piece of HTML displays improperly with Chrome 8/9: ``` <html> <body> <ol style="font-size: 48px;"> <li>one</li> <li>two</li> <li>three</li> </ol> </body> </html> ``` The same piece of HTML displays properly (i.e., it doesn't truncate on the left) in Internet Explorer 8. Two (undesirable) workarounds I've discovered are: 1. Specify list-style-position: inside; on the list. This forces the list image to flow with the content, but it makes for a non-standard/messy look, IMO. 2. Specify some type of margin/padding on the list. This works, but then it adds too much padding to lists with smaller font sizes. Here's a screenshot that shows the problem in Chrome 9.0.597.98; note how the numbers are cut off on the left margin: ![Chrome 9 list image bug](https://i.stack.imgur.com/VrCUC.png)
Ensuring that list images are never truncated on the left
CC BY-SA 2.5
null
2011-02-04T22:49:43.310
2011-02-18T14:35:09.560
2020-06-20T09:12:55.060
-1
33,837
[ "html", "css", "webkit" ]
4,903,771
1
4,904,167
null
0
1,301
I'm working on generating a PHP/MySQL report that compares current and last year's sales data for a list of retail stores. All of the data comes in fine from the SQL database. The sticking point is that the report needs to show how the stores are ranked this year, and what their ranking was last year. Here's what the table should look like. ![wanted result](https://i.stack.imgur.com/9cEEJ.png) [http://i.stack.imgur.com/trEsO.png](https://i.stack.imgur.com/trEsO.png) Here's the related part of my code. ``` $this->result = mysql_query($totalSalesQuery); echo "<table>"; while($rows = mysql_fetch_object($this->result)) { echo "<tr>"; echo "<td>" .$rows->store . "</td">; // RANK COLUMN WOULD GO HERE echo "<td>" . $rows->CurrentSales. "<td>"; // LAST YEAR'S RANK WOULD GO HERE echo "<td>" . $rows->LastYrSales . "<td>"; echo "<td>" . ($rows->CurrentSales - $rows->LastYrSales)/$rows->LastYrSales) . "<td>"; echo "</tr>"; } echo "</table>"; ``` Is there a good way to use arrays to represent the columns? And then sort the arrays based on the different value? Also, has anyone found any brilliant ways to total and average the columns and append that to the table?
What's the best way add "rank" columns in PHP-generated table? Find the total / average of columns?
CC BY-SA 3.0
0
2011-02-04T23:01:14.347
2015-04-27T03:55:35.903
2011-12-10T04:20:54.110
234,976
603,888
[ "php", "mysql", "rank" ]
4,903,986
1
4,904,111
null
2
1,640
Running the `dbcc checkident` command in SQL Server Management Studio, trying to reset the identity column. As you can see in the picture below clearly my table exists and the schema is the default dbo. But when attempt to execute: ``` dbcc checkident (Article, RESEED, 4); ``` I get the following response from the query: ``` Msg 2501, Level 16, State 45, Line 1 Cannot find a table or object with the name "Article". Check the system catalog. ``` ![evidence my table exists](https://i.stack.imgur.com/JlkME.jpg) This happens for every table in all of my databases. But this one is the specific one I'm trying to use. The table does have data in it. What can I do/check?
TSql dbcc checkident command fails when database exists
CC BY-SA 2.5
null
2011-02-04T23:38:35.717
2011-02-05T00:01:17.397
null
null
186,359
[ "tsql", "ssms" ]
4,904,023
1
4,905,025
null
1
288
In sites providing OpenID, I usually logging in using my domain like this: ![enter image description here](https://i.stack.imgur.com/I6M5j.png) The underlying framework is able to resolve the domain I've inserted to a Url like this: ![enter image description here](https://i.stack.imgur.com/nPrpm.png) Is it something hard-coded or is there an Http request to discover the login Url before redirecting the user to the Blogger login page?
How the Blogger OpenID endpoint is resolved?
CC BY-SA 2.5
0
2011-02-04T23:45:33.970
2011-02-05T12:35:54.903
2011-02-05T12:35:54.903
130,929
130,929
[ "openid", "blogger" ]
4,904,220
1
null
null
2
907
I use Soundcloud for my tracks. I'm using their jquery player to place a widget on my new site, as you can see on the top right: ![I'm using their jquery player to place a widget on my new site, as you can see on the top right:](https://i.stack.imgur.com/hQqvM.png) The problem is, the waveform Souncloud provides is a one colour only deal: ![Soundcloud waveform only in one colour](https://i.stack.imgur.com/y3PF6.png) I know I can change things using PHPs GD library, and I've done this successfully with a test image on my server using this code: [http://php.net/manual/en/function.imagefilter.php](http://php.net/manual/en/function.imagefilter.php) (Search for "IMG_FILTER_BRIGHTNESS") ``` <?php $im = imagecreatefrompng('hello.png'); if($im && imagefilter($im, IMG_FILTER_BRIGHTNESS, -255)) { echo 'Image brightness changed.'; imagepng($im, 'hello.png'); imagedestroy($im); } else { echo 'Image brightness change failed.'; } ?> ``` It works perfectly! BUT It changes the actual image on my server! Pretty cool, but not possible... Obviously I cant change the image on Soundcloud's server (all the data, images, music comes from there API) So What I'm looking for is a way were I can change the colour of the PNG client side, on the fly. I have a lot of tracks on there, so basically each time the user clicks next or previous, the waveform loads in and before it does it needs to change that image's colour :-? Is this possible? To see the player in action on my test site (the styling on that one is old, by the way, but it's functionality is correct) [http://marckremers.com/2011/](http://marckremers.com/2011/) NB the entire site does not work beyond what you see there. Still a WIP. Thanks so much
Can I filter an image client side, Not server side, using PHP GD Library?
CC BY-SA 2.5
0
2011-02-05T00:21:34.007
2011-02-05T00:48:20.587
2011-02-05T00:39:54.497
394,117
394,117
[ "php", "javascript", "css", "image-manipulation", "client-side" ]
4,904,308
1
4,904,330
null
3
4,575
I'm trying to make an arkanoid-like game, and now I'm facing a problem with the collisions. As usual, the bricks are rectangles (in my case, squares) and the ball is a circle, so it's all about axis aligned bounding boxes. So far, I've got the trivial collision detection algorithm, but I need to know what side of each brick the ball hits. For example: ![Collision cases](https://i.stack.imgur.com/H0YA1.png) So far I have an algorithm that checks whether each side has been hit: ``` up = left = right = down = 0; if(mouse.left < brick.left && brick.left < mouse.right && mouse.right < brick.right){ left = 1; } if(brick.left < mouse.left && mouse.left < brick.right && brick.right < mouse.right){ right = 1; } if(mouse.top < brick.top && brick.top < mouse.bottom && mouse.bottom < brick.bottom){ up = 1; } if(brick .top < mouse.top && mouse.top < brick.bottom && brick.bottom < mouse.bottom){ down = 1; } ``` But in the collisions close to the corners, like the third in the image, two flags (for instance, left and down) are set to 1, so I don't know how to decide. What is usually done in these cases?
Axis aligned bounding boxes collision: what sides are colliding
CC BY-SA 2.5
0
2011-02-05T00:39:01.680
2011-02-05T00:49:57.110
null
null
276,451
[ "c++", "collision-detection", "aabb" ]
4,904,366
1
4,904,493
null
0
104
Here is my layout's top: ![enter image description here](https://i.stack.imgur.com/kpfNM.jpg) the Blue portion has the css code as follows: ``` margin-left:auto; margin-right:auto; width:960px; background-image:url(images/ribbon.png); ``` The yellow is fine as it is empty, but i need the red to continue the ribbon all the way to the page's right end but i'm not sure how to go about doing it. Any help would be appreciated. code: [http://dl.dropbox.com/u/4086656/index.php](http://dl.dropbox.com/u/4086656/index.php) [http://dl.dropbox.com/u/4086656/main.css](http://dl.dropbox.com/u/4086656/main.css)
middle extended to right end div
CC BY-SA 2.5
null
2011-02-05T00:51:29.343
2011-02-05T01:22:50.130
2011-02-05T01:13:35.790
554,195
554,195
[ "html", "css" ]
4,904,831
1
23,484,929
null
1
581
I want to create a data driven diagram/chart/image like the one here ![enter image description here](https://i.stack.imgur.com/pNZiD.png) Is there any .Net component which can help me to create this. I've searched and this diagram is called by different names like Radial Tree, Peacock Table, Relationship diagram etc. I have to basically show relationship between a set of records (like A is connects to B 20 times, C -> D 40 times etc.) Any help would be welcome, Thanks Nitin :)
How can a Data-Driven Radial Chart be achieved in .Net?
CC BY-SA 2.5
null
2011-02-05T02:57:43.567
2014-05-06T02:16:18.773
2011-02-05T03:13:23.553
76,337
290,174
[ ".net", "tree", "components", "diagram", "radial" ]
4,904,835
1
4,905,866
null
0
115
When I create new MVC 3 project in Visual Studio the first thing I do is create a new controller called Home, and then right click in the Index stub and create a new view. My question is when I have the Index file selected in the solution explorer and build the solution I get an error saying it can't be found. If I navigate to the page using root/ Home or root/Home/Index it still doesn't work. I also created a new project using the sample website that ships with MVC and cannot figure out what code differs between an empty solution and the sample solution that could be giving me this problem. In the global.asax it looks like there is already a route setup for a home controller so I'm confused. ![enter image description here](https://i.stack.imgur.com/vi0oN.png)
Help with MVC view
CC BY-SA 2.5
null
2011-02-05T02:58:08.553
2011-02-05T08:23:51.873
2011-02-05T05:51:53.793
445,303
445,303
[ "asp.net-mvc" ]
4,905,465
1
4,905,502
null
5
6,610
With C#, I was easily able to get the effect I wanted: ![standard window without icon in title bar](https://i.stack.imgur.com/mzmYi.png) However, I'm having trouble doing the same thing using the Win32 API in C. I don't know how to create a window that has (at all), but still has a caption, a minimize button, and a close button. I registered my class properly, but I can't figure out what to put for the window styles/extended window styles. ``` static const TCHAR lpctszTitle[] = TEXT("Stuff"), lpctszClass[] = TEXT("StuffClass"); HWND hWnd = CreateWindowEx(WS_EX_LAYERED | WS_EX_TOPMOST, lpctszClass, lpctszTitle, WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION | WS_MINIMIZEBOX, CW_USEDEFAULT, 0, 250, 55, NULL, NULL, hThisInstance, NULL); ``` The code above produced: ![standard window WITH an icon in the title bar](https://i.stack.imgur.com/y0Cue.png) which still has an icon in the title bar and is not what I wanted.
Creating a window using CreateWindowEx without an icon
CC BY-SA 2.5
0
2011-02-05T06:19:28.180
2011-02-05T08:32:06.477
2011-02-05T06:34:52.767
366,904
388,225
[ "c", "windows", "winapi", "createwindow", "createwindowex" ]
4,905,540
1
4,906,329
null
8
315
Suppose you have an NxN maze with a Knight, Princess and Exit. ![enter image description here](https://i.stack.imgur.com/2hrlC.jpg) There is also an evil Witch that is planning to block `M` squares (set them on fire). She will set all these blocks on fire before the Knight makes his first move (they alternate turns). Given the map to the maze, and M, can you decide in O(N^2) whether the Knight will be able to reach the princess, and then the exit, for any choice of blocks by the Witch (meaning - can the Witch make choices that would prevent the Knight & Princess from escaping)?
m-Reachability in graphs
CC BY-SA 2.5
0
2011-02-05T06:49:01.433
2012-09-18T16:55:59.293
2012-09-18T16:55:59.293
1,288
11,236
[ "algorithm", "graph" ]
4,905,627
1
4,905,793
null
4
462
Let's say I got this set of data. After sorting the distribution can be drawn out like below. ``` M=[-99 -99 -44.5 -7.375 -5.5 -1.666666667 -1.333333333 -1.285714286 0.436363636 2.35 3.3 4.285714286 5.052631579 6.2 7.076923077 7.230769231 7.916666667 9.7 10.66666667 16.16666667 17.4 19.2 19.6 20.75 24.25 34.5 49.5] ``` ![plot for the data](https://i.stack.imgur.com/ulJ7g.png) My question is how do I find out those values that are among the middle range and record the indices. Using normal distribution or anything else? Appreciate your help! Picture for Jonas' ![enter image description here](https://i.stack.imgur.com/7fO7d.jpg)
Simple data processing
CC BY-SA 3.0
null
2011-02-05T07:07:59.890
2015-11-23T12:20:20.383
2015-11-23T12:20:20.383
4,370,109
436,515
[ "matlab", "function", "matrix", "distribution" ]
4,905,650
1
4,906,100
null
0
593
HI all, I'm working on line graph. I'm able to draw line graph perfectly. But the thing is I want the effect like shown in the below image. ![enter image description here](https://i.stack.imgur.com/6pk6X.png) I want the slider effect. I'm storing the graph path using CGPath. If the slider moves on the graph according value has to display on the upper label.. Please help me.
How to get point on the graph in iPhone Line graph
CC BY-SA 2.5
null
2011-02-05T07:16:01.843
2011-02-05T09:31:54.163
2011-02-05T09:16:13.237
246,310
434,643
[ "iphone", "cgpath", "linegraph" ]
4,905,644
1
4,905,659
null
0
721
Using Visual WebDeveloper 2010 Express and ASP.NET 4.0 Don't know whether its relevant but the whole thing is in a ContentPlaceHolder and inside an UpdatePanel. To avoid using the old table tr td model, I have created a simple form like this ``` <div class="admin-form"> <asp:Label ID="UserNameLabel" runat="server" CssClass="form-label" Text="User Name" /> <asp:TextBox ID="UserNameText" runat="server" Width="200px"/> <br /> <asp:Label ID="PasswordLabel" runat="server" CssClass="form-label" Text="Password" /> <asp:TextBox ID="PasswordText" runat="server" TextMode="Password" Width="200px"/> <br /> <asp:Label ID="ConfirmPasswordLabel" runat="server" CssClass="form-label" Text="Confirm Password" /> <asp:TextBox ID="ConfirmPasswordText" runat="server" TextMode="Password" Width="200px"/> <br /> <asp:Label ID="EmailLabel" runat="server" CssClass="form-label" Text="Email" /> <asp:TextBox ID="EmailText" runat="server" Width="200px"/> <br /> <br /> <br /> <span class="form-label"></span> <asp:Button ID="CreateUserButton" runat="server" CssClass="button blue" Text="Create New User"/> </div> ``` And the CSS ``` .form-label { width: 300px !important; } ``` This renders incorrectly as ![enter image description here](https://i.stack.imgur.com/UhswA.png) I would like to have all textboxes vertically lined after taking 300px. What is wrong? P.S: I cannot use HTML Controls like label as I have resx for globalization
Alternative for table mark-up in ASP.NET not working properly
CC BY-SA 2.5
null
2011-02-05T07:13:13.177
2011-02-05T07:18:41.640
2020-06-20T09:12:55.060
-1
17,447
[ "asp.net", "css", "alignment" ]
4,905,662
1
4,906,566
null
7
8,258
I have an XML file and I want to create a graph based on some entities, then store this graph in an image, JPG or PNG. So is there a library in Java to do something like this? Or are there some tricks by parsing XML files? Here an example XML file: ``` <?xml version="1.0"?> <process> <p n="1">Tove</p> <p n="2">Jani</p> <p n="2">Bill</p> <p n="4">John</p> </process> ``` And the output will be like this: ![enter image description here](https://i.stack.imgur.com/n2AX9.png)
Create a graph image (png, jpg ..) from an XML file with Java
CC BY-SA 4.0
0
2011-02-05T07:19:28.267
2021-04-10T21:17:26.340
2021-04-10T21:17:26.340
604,156
604,156
[ "java", "xml", "image", "graph" ]
4,905,891
1
null
null
1
6,035
I have read that the number of leaf nodes in a tree of height h is at least h+1 But as shown here in the pic ![http://i.stack.imgur.com/aDuho.png](https://i.stack.imgur.com/Q6Fqk.png) the tree is of height 2 but the number of leaf nodes is just 2 (at least) and not 3. Where am I mistaken?
Number of leaf nodes in a binary tree
CC BY-SA 3.0
null
2011-02-05T08:31:26.010
2013-05-09T05:07:26.603
2011-11-28T02:47:11.440
234,976
604,213
[ "data-structures", "tree", "binary-tree" ]
4,906,373
1
4,922,397
null
10
1,792
I want to add a "subtitles" to a video played in an iPhone app. I don't want those subtitles encoded into the video itself - ideally I'd love to have a view showing the video (with pause, play, volume and such standard controls) together with a view displaying the text that changes together with movie time changing. If I drawn that, it's something like this, ![movie with subtitle](https://i.stack.imgur.com/qWtyz.png) So, basicly, I would need a way to get a method called when movie is playing, and then synchronize the text displayed on the label with the movie timing. Anyone used a solution that was able to do it?
Is it possible to play a video on iPhone and have a subtitles synchronized with it show up?
CC BY-SA 2.5
0
2011-02-05T10:39:12.757
2011-02-07T14:28:21.017
2011-02-05T21:13:22.880
4,172
4,172
[ "iphone", "cocoa-touch", "video", "movieplayer", "subtitle" ]
4,906,508
1
4,906,542
null
0
2,706
My eclipse is pointing to a jdk. I am using GWT. sometimes my eclipse is crashing with the following error, can someone help![enter image description here](https://i.stack.imgur.com/1y9sy.jpg) i'm getting a new error when Xmx2000m ![enter image description here](https://i.stack.imgur.com/tL1YA.jpg) these are some of the last lines of the error log ``` !ENTRY org.eclipse.ui 4 4 2011-02-05 05:56:06.306 !MESSAGE Plug-in 'org.eclipse.papyrus.diagram.common' contributed an invalid Menu Extension (Path: 'diagramMenu/filtersMenu' is invalid): org.eclipse.papyrus.diagram.common.myShowHideCompartmentAction !ENTRY org.eclipse.ui 4 4 2011-02-05 05:56:06.331 !MESSAGE Plug-in 'org.eclipse.papyrus.diagram.common' contributed an invalid Menu Extension (Path: 'diagramMenu/filtersMenu' is invalid): org.eclipse.papyrus.diagram.common.myShowHideContentsAction !SESSION 2011-02-05 05:57:13.577 ----------------------------------------------- eclipse.buildId=M20100909-0800 java.version=1.6.0_23-ea java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Framework arguments: -product -XX:+AggressiveHeap org.eclipse.epp.package.modeling.product Command-line arguments: -os win32 -ws win32 -arch x86 -product -XX:+AggressiveHeap org.eclipse.epp.package.modeling.product !ENTRY org.eclipse.core.resources 2 10035 2011-02-05 05:57:16.411 !MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. !ENTRY org.eclipse.ui 4 4 2011-02-05 05:57:24.076 !MESSAGE Plug-in 'org.eclipse.papyrus.diagram.common' contributed an invalid Menu Extension (Path: 'diagramMenu/filtersMenu' is invalid): org.eclipse.papyrus.diagram.common.myShowHideCompartmentAction !ENTRY org.eclipse.ui 4 4 2011-02-05 05:57:24.098 !MESSAGE Plug-in 'org.eclipse.papyrus.diagram.common' contributed an invalid Menu Extension (Path: 'diagramMenu/filtersMenu' is invalid): org.eclipse.papyrus.diagram.common.myShowHideContentsAction ```
Increase memory allocated to jdk
CC BY-SA 2.5
null
2011-02-05T11:10:44.907
2011-02-05T17:27:38.737
2011-02-05T13:59:15.107
484,290
484,290
[ "java", "memory-leaks", "crash-reports", "jvm-crash" ]
4,906,911
1
null
null
1
116
I am part of a studentproject and we are to develop a product for a company using Java EE. As "lead architect" in the project I am responsible for composing a good design which should be flexible for further extensions. Background info: We are to develop a website with a drag and drop GUI with possibilites to connect data sources with data manipulations to perform on that specific data. The GUI should be generic and possible to integrate with upcoming products. This means that we cannot code to an implementation in the presentation layer. Instead we will use an interface to define what kind of data manipulations that are possible for all kinds of products. However, each product might also sport product specific data manipulations (thus extending the interface with more methods). The problem I have with the scenario above is that I dont see how we could pass on these "product specific data manipulations" to the GUI and say that, in addition to the generic interface, we also possess these data manipulation actions... Now I had a discussion with some of the more experienced programmers from the company and they told me that there is a common solution to this problem - more specifically known as the "Observer pattern". They draw something like `[1]` on the whiteboard and explained that it would be possible to "register" to a third party (getApplicationContext) that in turn could convey our product specific interface. This is a common problem to get rid of those nasty circular dependencies, they explained. I have now had a look on the observer pattern and how it works and I still dont really get how I am supposed to solve the design problem. Could someone possibly try to explain how it would turn out in my specific scenario? I have no real problem understanding how it works with "subjects" and "observers". Here is an UML diagram of the design where we are using a reference of the specific product. This is what is undesirable and something we would like to get around. (maybe I got this all wrong...) I am sorry but I cant change the picture to the correct one as I am a new user... Here is a link to an updated UML diagram: ![http://i55.tinypic.com/2mbfno.png](https://i.stack.imgur.com/4PTpx.png)
Help with design problem (extending a generic inteface)
CC BY-SA 2.5
null
2011-02-05T12:52:22.307
2011-02-08T18:48:28.143
2011-02-06T22:29:09.943
39,106
604,349
[ "oop", "design-patterns", "jakarta-ee", "observer-pattern" ]
4,906,939
1
4,907,232
null
0
197
I probably have one of the easiest questions of the day, but I'm having a hard time finding a direct answer for how to fix it (HTML/CSS -n00b)... I have in my mark-up an img-tag and under that a div-tag containing an horizontal list. In the lists ul-CSS I have declared a top and bottom border, the img (which is a .PNG with transparent background) is showed in front of the ul border-top, which is what I want. But for the li-CSS I have border-right for each element to separate them, and this border is in front of the img... Here you see what I mean: ![enter image description here](https://i.stack.imgur.com/r23LQ.jpg) Edit: ``` #topLeftImage { z-index: 999; margin-left: 1em; margin-top: 3px; #navigationlist li { z-index: 0; display: inline; list-style-type: none; padding-right: 2px; font-size: 75%; border-right: 2px solid #C0C0C0; ``` } So how do I declare the img for it to be showed in-front of that li-border? And another fast question, can I declare so that the last li-element doesn't get that border-right, since it doesn't have a right-neighbour? Any tips would be helpful! -Thanks
image above list borders.. probably very easy
CC BY-SA 2.5
null
2011-02-05T12:56:37.727
2011-02-05T14:05:27.507
2011-02-05T13:34:05.960
603,151
603,151
[ "html", "css" ]
4,907,059
1
4,907,430
null
6
5,992
I seem to be having a very odd problem with my iPhone project in XCode4. By accident, I seem to have dragged a new group I created out of my main project group: ![Problem](https://i.stack.imgur.com/mIMaH.png) When I try to move the group back into the project group, XCode crashes. When I try to delete the group by dragging it to the trash can, no such luck either. Is this because it's an iPhone project, and I somehow have messed up the entire directory of groups?
Deleting/Removing Group in Xcode
CC BY-SA 3.0
null
2011-02-05T13:19:19.540
2017-12-01T10:39:08.397
2017-12-01T10:39:08.397
1,905,949
353,878
[ "iphone", "xcode", "xcode4" ]
4,907,259
1
4,907,859
null
1
583
I'm planning to port an app from Android to Blackberry (targeting BB 6.0 only). On Android, I've developed a custom expandable text field component, where the user can click on a more/less link to expand the text. My question is whether there's an existing UI component coming with BB SDK (6.0) or any open source project that already implemented the demanded feature, or whether it also needs to be implemented from scratch. Some details: - - - - ![expandable textfield](https://i.stack.imgur.com/oYTk8.png)
Expandable TextField UI component on Blackberry/RIM OS?
CC BY-SA 2.5
null
2011-02-05T14:08:09.360
2011-04-26T22:59:27.123
2011-02-05T15:39:04.667
21,234
241,475
[ "user-interface", "blackberry", "blackberry-jde" ]
4,907,275
1
4,907,327
null
19
116,010
I am stuck on figuring out some css, I need a section of my form to look like the following, ![CSS float left](https://i.stack.imgur.com/wxsv5.gif) I have tried every variation I can think of, I have given the labels a fixed width and floated them left, then given the inputs the same width and floated them left. I am all out of ideas, how can I achieve this please?
How can I get two form fields side-by-side, with each field’s label above the field, in CSS?
CC BY-SA 2.5
0
2011-02-05T14:10:28.573
2022-05-08T16:37:03.043
2011-02-05T14:18:49.437
20,578
307,007
[ "html", "css" ]
4,907,508
1
4,909,849
null
2
4,939
I have a simple question regarding SQL Server Authentication. I am working with SQL Server 2008 Express which came along with VS2010. As SQL Server Express was installed along with VS2010, there was no option to enter the password for SQL Server authentication (had I gone for SQL Server 2008 Standard, I get a screen where I can enter the password). Now when I try to create a new database with SQL Server authentication, I tells me enter the username and password which I have never created. ![enter image description here](https://i.stack.imgur.com/NKlow.png) Where should I go from here? Thanks in advance.
Unable to use SQL Server Authentication with SQL Server Express 2008
CC BY-SA 2.5
null
2011-02-05T14:56:35.987
2011-02-05T21:41:08.603
2011-02-05T21:41:08.603
569,436
277,087
[ "c#", ".net", "sql-server", "sql-server-2008", "sql-server-express" ]
4,907,572
1
4,907,604
null
0
3,892
i try to make a Form program in c# to rename a lot of folders. The Customers has to choose the folder (and the name to rename), where all the folders are include, for example in c:\folders\ are this folders: ``` 1991 - title1 1992 - title2 1993 - title3 1994 - title4 ``` And now i will change the year into a name, like this: ``` name - title1 name - title2 name - title3 name - title4 ``` Example pic: ![example program](https://i.stack.imgur.com/uCacF.png) I hope you unterstand what i want :-) and you can help me with this. Regards, matthias
Rename folders in c# Form
CC BY-SA 2.5
null
2011-02-05T15:07:08.763
2011-02-05T15:28:40.443
2011-02-05T15:14:27.547
21,679
360,155
[ "c#", "winforms", "string", "rename" ]
4,907,601
1
4,907,640
null
0
565
My page is perfect with a doctype, and breaks horribly when one is applied. (More specifically, it breaks with any HTML4 doctype. An HTML3 one works fine, but that's clearly not acceptable.) As is typical, I have cut the page down to only include the minimum needed to demonstrate the problem, but the main problem remains. Without doctype, desired: ![desired](https://i.stack.imgur.com/Afg3y.png) With doctype, horribly broken: ![enter image description here](https://i.stack.imgur.com/JUl5q.png) And the code, of course. Add a doctype to break it. ``` <html> <head> <title>Test</title> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <div id="container1"> <div id="main"></div> </div> <div id="container2"> <div id="test1"> <p style="text-align: center;">content goes here</p> </div> <div id="test2"> <p style="text-align: center;">more content goes here</p> </div> </div> </body> </html> ``` And style.css: ``` body { margin: 0px; overflow:hidden; color: white; background-color: black; text-transform: lowercase; height: 100%; } #container1 { background-color: black; width: 100%; height: 75%; margin-left: auto; margin-right: auto; margin-top: 0%; } #main { width: 800px; height: 480px; margin-left: auto; margin-right: auto; position: relative; background-color: blue; } #container2 { background-color: black; width: 100%; height: 22%; margin-left: auto; margin-right: auto; position: relative; } #test1 { position: absolute; width: 50%; height: 100%; background-color: blue; } #test2 { position: absolute; width: 50%; margin-left: 50%; height: 100%; overflow: auto; background-color: green; } ```
Why does my page break horribly in standards mode?
CC BY-SA 2.5
null
2011-02-05T15:11:50.673
2011-08-23T21:20:26.443
2011-08-23T21:20:26.443
1,114
263,929
[ "html", "css", "quirks-mode" ]
4,907,873
1
4,912,288
null
1
133
![enter image description here](https://i.stack.imgur.com/NGTGh.jpg)I was developing an android app using java language. The body of the method was below: a string "3" was passed to it as first argument--nextCmdId, but in the method it turned out to be a Rect, and the application crashed. Quite odd!! thanks BR shawn ``` public String formatSyncTagPreamble(String nextCmdId, String sourceName, String sourceUri) { StringBuffer syncTag = new StringBuffer(); syncTag.append("<CmdID>").append(nextCmdId) .append("</CmdID>\n") .append("<Target><LocURI>") .append(sourceUri) .append("</LocURI></Target>\n") .append("<Source><LocURI>") .append(sourceName) .append("</LocURI></Source>\n"); return syncTag.toString(); } ``` ![enter image description here](https://i.stack.imgur.com/dKrf2.jpg)
String was passed as argument, but in the function it turned out to be a Rec
CC BY-SA 2.5
null
2011-02-05T15:56:29.413
2015-05-07T10:19:47.723
2015-05-07T10:19:47.723
2,829,009
557,911
[ "java", "android", "arguments" ]
4,907,978
1
null
null
6
2,891
I have 2000 sets of data which contain little over 1000 2D variables each. I'm looking to cluster these sets of data into anywhere from 20-100 clusters based on similarity. However, I'm having trouble coming up with a reliable method of comparing sets of data. I've tried a few (rather primitive) approaches and done loads of research, but I can't seem to find anything that fits what I need to do. I've posted an image below of 3 sets of my data plotted. The data is bounded 0-1 in the y axis, and is within the ~0-0.10 range in the x axis (in practice, but could be greater then 0.10 in theory). The shape and relative proportions of the data are probably the most important things to compare. However, the absolute locations of each data set are important as well. In other words, the closer the relative position of each individual point to the individual points of another dataset, the more similar they would be and then their absolute positions would need to be accounted for. Green and red should be considered as very different, but push comes to shove, they should be more similar than blue and red. ![http://img153.imageshack.us/img153/6730/screenshot20110204at004.png](https://i.stack.imgur.com/QOLKh.png) I have tried to: - - - All of these have produced faulty results. The closest answer I could find in my research was "[Appropriate similarity metrics for multiple sets of 2D coordinates](https://stackoverflow.com/questions/2101467)". However, the answer given there suggests comparing the average distance among nearest neighbours from the centroid, which I don't think will work for me as the direction, is as important as the distance for my purposes. I might add, that this will be used to generate data for the input of another program and will only be used sporadically (mainly to generate different sets of data with different numbers of clusters), so semi time consuming algorithms are not out of the question.
Comparing sets of 2D data/scatterplots
CC BY-SA 2.5
0
2011-02-05T16:18:30.037
2011-02-14T16:56:58.257
2017-05-23T10:32:35.693
-1
604,513
[ "algorithm", "language-agnostic", "graphics", "cluster-analysis", "similarity" ]
4,908,021
1
4,913,641
null
3
2,964
I've used the distance tranform thinning on an image. Now trying to extract each connected component separtely - if there are two thin lines, then it should detect three such separate lines and components. ``` /*finding contours*/ IplImage *cc_color; cc_color = cvCreateImage(cvGetSize(thin_img), IPL_DEPTH_8U, 3); CvMemStorage *mem; mem = cvCreateMemStorage(0); int count = 0; char* ch = new char [2]; CvSeq *contours = 0; CvSeq *ptr; /*finding contours of morphed image*/ cvFindContours(thin_img, mem, &contours, sizeof(CvContour), CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE, cvPoint(0,0)); /*all contours on one image - random coloring*/ for (ptr = contours; ptr != NULL; ptr = ptr->h_next) { CvScalar ext_color = CV_RGB( rand()&255, rand()&255, rand()&255 ); /*randomly coloring different contours*/ cvDrawContours(cc_color, ptr, ext_color, CV_RGB(0,0,0), -1, CV_FILLED, 8, cvPoint(0,0)); } ``` thin_image is the input. the output should have each line colored randomly as a different contour/component. However it's only detecting closed shapes as contours. How do i detect as components?? Output image: ![Input image](https://i.stack.imgur.com/OOiaD.jpg) Input image: ![enter image description here](https://i.stack.imgur.com/QhrVd.jpg) The red boxes indicate example parts that should be detected as components. But only closed-shapes are detected.
How to extract thin lines as separate contours/connected components with OpenCV?
CC BY-SA 2.5
0
2011-02-05T16:27:16.260
2011-02-06T13:44:31.670
null
null
297,353
[ "image-processing", "opencv" ]
4,908,114
1
4,908,227
null
7
58,804
using `onSaveInstanceState(Bundle ..) and onRestoreInstanceState(Bundle ..)` was really good and work, but it is working when click Turn off button on Emulator. Now, i want to save state and restore the saved data when below button used: ![Emulator](https://i.stack.imgur.com/wEWUY.jpg) I think it is possible to use OnPause() OR oOnStop(), if i am right, How to use it, it will be enough to show me Java source of saving one boolean variable, and restore it, Thanks.
How to use onPause with Android?
CC BY-SA 2.5
0
2011-02-05T16:43:04.097
2014-08-24T21:48:19.057
null
null
315,264
[ "android" ]
4,908,106
1
4,927,875
null
0
3,539
How would I add next/previous buttons to this snippet, cause as you can see ,it will display as many links as it needs, so if you have a high number of pages then this might not be the best solution ``` <c:choose> <c:when test="${pages >1}"> <div class="pagination art-hiddenfield" > <c:forEach var="i" begin="1"end="${pages}" step="1"> <c:url value="MaintenanceListVehicles.htm" var="url"> <c:param name="current" value="${i}"/> </c:url> <c:if test="${i==current}"> <a href="<c:out value="${url}"/> " class="current" > <c:out value="${i}" /></a> </c:if> <c:if test="${i!=current}"> <a href="<c:out value="${url}"/> " > <c:out value="${i}" /></a> </c:if> </c:forEach> </div> </c:when> <c:otherwise> <div align="center"> </div> </c:otherwise> </c:choose> ``` CSS: ``` .pagination .current { background: #26B; border: 1px solid #226EAD; color: white; } .pagination a { display: block; border: 1px solid #226EAD; color: #15B; text-decoration: none; float: left; margin-bottom: 5px; margin-right: 5px; padding: 0.3em 0.5em; } .pagination { font-size: 80%; float: right; } div { display: block; } ``` This is what I get with my current code: ![enter image description here](https://i.stack.imgur.com/8qGKO.jpg) And this is what I'd like to display, with ellipsis if possible ![enter image description here](https://i.stack.imgur.com/DGbvJ.jpg) Hope you can help me out.
How to add next and previous buttons to my pager row
CC BY-SA 2.5
0
2011-02-05T16:42:21.267
2011-02-07T23:22:22.780
null
null
530,911
[ "jsp", "jstl" ]
4,908,203
1
4,909,947
null
0
347
I want to learn, how Intel C++ Compiler works. I want to find a diagramm, which will show the internal structure of Intel compiler for X86 and X86_64 with major parts of it drawn. Parts I want are "Code generation", "Front-end", "Back-end", register allocation, analysises, etc. I was able only to find a picture for Itanium compiler here download.intel.com/technology/itj/q41999/pdf/compiler.pdf. This picture is good, but x86 compiler can't have a "Predication" part as it have no predicate registers, ... Question: Where can I find a image or description of structure if Intel C++ Compiler for x86 ![IA-64 Intel compiler structure](https://i.stack.imgur.com/LDdMW.png)
Generic structure of Intel C++ Compiler itself
CC BY-SA 2.5
0
2011-02-05T17:00:23.587
2011-04-07T13:43:26.347
2011-02-05T17:21:47.373
196,561
196,561
[ "c++", "compiler-construction", "intel" ]
4,908,348
1
null
null
1
1,255
How can I create a counter for my view results? ![this is before](https://i.stack.imgur.com/jtQZD.jpg) ![this is how i need it:](https://i.stack.imgur.com/9dxzf.jpg)
How to creating a counter for (Drupal) view results?
CC BY-SA 2.5
null
2011-02-05T17:27:10.183
2011-02-05T20:14:28.627
2011-02-05T20:07:55.677
452,982
452,982
[ "drupal", "view" ]
4,908,631
1
4,913,060
null
1
270
What I need help with is: I want the menu to be on the scrollview and when I swipe it, the menu should become highlighted. For example; Menu is default color, once it is swiped, the color shall change to red. I'm not to sure how I can do this, can anyone help? UPDATE: Basically what i mean to say is... m trying to HILGHLIGHT the view that i scroll... for example ![enter image description here](https://i.stack.imgur.com/nFHAg.png) the 1st image on scroll view is totally visible..i want this image to be highlighted. then when scroll the next image... 2nd image shud come up and get highlighted.. ![enter image description here](https://i.stack.imgur.com/Vseps.png)
Highlight menu in scrollview
CC BY-SA 2.5
0
2011-02-05T18:10:41.307
2011-02-06T11:43:00.943
2011-02-06T07:30:48.930
462,533
462,533
[ "iphone", "objective-c", "uiscrollview" ]
4,908,919
1
4,931,336
null
16
41,755
Well I'm using a complied .NET version of this OCR which can be found @ [http://www.pixel-technology.com/freeware/tessnet2/](http://www.pixel-technology.com/freeware/tessnet2/) I have it working, however the aim of this is to translate license plates, sadly the engine really doesn't accurately translate some letters, for example here's an image I scanned to determine the character problems ![enter image description here](https://i.stack.imgur.com/CDQ3n.jpg) Result: 12345B7B9U ABCDEFGHIJKLMNUPIJRSTUVHXYZ Therefore the following characters are being translated incorrectly: This doesn't seem too bad, however on my license plates, the result isn't so great: ![enter image description here](https://i.stack.imgur.com/SEqNC.jpg) = H4 ODM ![enter image description here](https://i.stack.imgur.com/Wh2KV.jpg) = LDH IFW Fake Test ![enter image description here](https://i.stack.imgur.com/sNrQG.jpg) = NR4 y2k As you might be able to tell, I've tried noise reduction, increasing contrast, and remove pixels that aren't absolute black, with no real improvements. Apparently you can 'learn' the engine new fonts, but I think I would need to re-compile the library for .NET, also it seems this is performed on a Linux OS which I don't have. [http://www.scribd.com/doc/16747664/Tesseract-Trainingfor-Khmer-LanguageFor-Posting](http://www.scribd.com/doc/16747664/Tesseract-Trainingfor-Khmer-LanguageFor-Posting) So I'm stuck as what to try next, I've wrote a quick console application purely for testing purposes if anyone wants to try it. If anyone has any ideas/graphic manipulation/library thoughts, I'd appreciate hearing them.
Tesseract OCR Library - Learning Font
CC BY-SA 2.5
0
2011-02-05T18:58:22.387
2017-05-30T14:31:56.883
null
null
408,757
[ "c#", "image-processing", "ocr", "tesseract" ]
4,909,105
1
4,948,849
null
1
293
I'm designing a database schema using PostgreSQL. I have some doubts about which design should I use. The table `tdir_details_uris_text` will have many millions of registers, each key `domain`, `uri`, `id_language` will have about 10/20 registers. Which design should perform well? The 3 tables design or the 2 tables design? Best Regards, PS: Sorry for my poor English. ![enter image description here](https://i.stack.imgur.com/VbFgJ.png) ![enter image description here](https://i.stack.imgur.com/csjVB.png) --- Update: Just to add an INSERT INTO example ``` insert into tdir_details_uris_text (domain, uri, id_language, id_categorie, id_data, id_ordinal, n_text) values ('motors.shop.ebay.com', 'http://cgi.ebay.com/ebaymotors/2009-FORD-MUSTANG-GT-BLACK-BEAUTY-16K-MILES-WOW-/230580626087?pt=US_Cars_Trucks&hash=item35afad22a7', 'en', '23', 'title_webpage', '1', '2009 Ford Mustang GT'); insert into tdir_details_uris_text (domain, uri, id_language, id_categorie, id_data, id_ordinal, n_text) values ('motors.shop.ebay.com', 'http://cgi.ebay.com/ebaymotors/2009-FORD-MUSTANG-GT-BLACK-BEAUTY-16K-MILES-WOW-/230580626087?pt=US_Cars_Trucks&hash=item35afad22a7', 'en', '23', 'highlights', '1', 'No Accidents / Damage Reported to CARFAX'); insert into tdir_details_uris_text (domain, uri, id_language, id_categorie, id_data, id_ordinal, n_text) values ('motors.shop.ebay.com', 'http://cgi.ebay.com/ebaymotors/2009-FORD-MUSTANG-GT-BLACK-BEAUTY-16K-MILES-WOW-/230580626087?pt=US_Cars_Trucks&hash=item35afad22a7', 'en', '23', 'highlights', '2', 'No Airbag Deployment Reported to CARFAX'); insert into tdir_details_uris_text (domain, uri, id_language, id_categorie, id_data, id_ordinal, n_text) values ('motors.shop.ebay.com', 'http://cgi.ebay.com/ebaymotors/2009-FORD-MUSTANG-GT-BLACK-BEAUTY-16K-MILES-WOW-/230580626087?pt=US_Cars_Trucks&hash=item35afad22a7', 'en', '23', 'highlights', '3', 'Vehicle Qualifies for the CARFAX Buyback Guarantee'); insert into tdir_details_uris_text (domain, uri, id_language, id_categorie, id_data, id_ordinal, n_text) values ('motors.shop.ebay.com', 'http://cgi.ebay.com/ebaymotors/2009-FORD-MUSTANG-GT-BLACK-BEAUTY-16K-MILES-WOW-/230580626087?pt=US_Cars_Trucks&hash=item35afad22a7', 'en', '23', 'highlights', '4', 'No Structural/Frame Damage Reported to CARFAX'); insert into tdir_details_uris_text (domain, uri, id_language, id_categorie, id_data, id_ordinal, n_text) values ('motors.shop.ebay.com', 'http://cgi.ebay.com/ebaymotors/2009-FORD-MUSTANG-GT-BLACK-BEAUTY-16K-MILES-WOW-/230580626087?pt=US_Cars_Trucks&hash=item35afad22a7', 'en', '23', 'highlights', '5', 'No Manufacturer Recalls Reported to CARFAX'); insert into tdir_details_uris_text (domain, uri, id_language, id_categorie, id_data, id_ordinal, n_text) values ('motors.shop.ebay.com', 'http://cgi.ebay.com/ebaymotors/2009-FORD-MUSTANG-GT-BLACK-BEAUTY-16K-MILES-WOW-/230580626087?pt=US_Cars_Trucks&hash=item35afad22a7', 'en', '23', 'highlights', '6', 'No Indication of an Odometer Rollback'); ```
Database Design - Which design should I use? Two options
CC BY-SA 2.5
null
2011-02-05T19:24:56.830
2011-02-09T18:21:50.130
2011-02-05T19:53:26.330
488,735
488,735
[ "database-design", "postgresql" ]
4,909,395
1
4,910,259
null
0
1,129
I have the following window definition ``` <Window x:Class="MyWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Style="{StaticResource ShapedWindow}" Title="Title"> <Grid Name="grid1" /> </Window> ``` with the following style and template definition ``` <Style x:Key="ShapedWindow" TargetType="{x:Type Window}"> <Setter Property="AllowsTransparency" Value="True"></Setter> <Setter Property="WindowStyle" Value="None"></Setter> <Setter Property="Background" Value="Transparent"></Setter> <Setter Property="MinWidth" Value="300" /> <Setter Property="MinHeight" Value="300" /> <Setter Property="Template" Value="{StaticResource ShapedWindowTemplate}"></Setter> </Style> <ControlTemplate x:Key="ShapedWindowTemplate" TargetType="{x:Type Window}"> <!--<AdornerDecorator> <ContentPresenter /> </AdornerDecorator>--> </ControlTemplate> ``` which produces the following window in the designer ![Window before control template](https://i.stack.imgur.com/MegVN.png) When I remove the comments from the template definition the grid doesn't seem to be rendered in the same position? What am I missing here? ![enter image description here](https://i.stack.imgur.com/TbGnx.png)
AdornerDecorator for WPF Window changes offset of controls
CC BY-SA 2.5
null
2011-02-05T20:15:37.747
2011-08-12T19:48:24.840
2011-08-12T19:48:24.840
305,637
31,770
[ ".net", "wpf", "window", "styles", "visual-studio-designer" ]
4,909,396
1
4,945,131
null
13
10,615
I'm trying to use tesseract-OCR via python-tesseract to read a low resolution font that looks like this: ![enter image description here](https://i.stack.imgur.com/76K3V.gif) Unfortunately that image returns ``` ZIJZHZI ``` I think the resolution is too low and that is causing problems. I've tried magnifying the image, and cropping it down to individual characters, but neither of these provide much improvement. Is there anything else I should consider doing, preferably something that could be done using the Python Imaging Library? Or should I just give up/train tesseract. For what it's worth, the PIL has the following built in filters: > BLUR, CONTOUR, DETAIL, EDGE_ENHANCE, EDGE_ENHANCE_MORE, EMBOSS, FIND_EDGES, SMOOTH, SMOOTH_MORE, and SHARPEN
Is there any way to improve tesseract OCR with small fonts?
CC BY-SA 2.5
0
2011-02-05T20:15:56.640
2011-02-09T12:56:11.037
2011-02-05T20:29:39.420
108,130
551,018
[ "ocr", "tesseract", "python-imaging-library" ]
4,909,511
1
4,919,733
null
6
1,122
I am posting my Stack Overflow problem on StackOverflow.com. Irony at its best! Anyways. I am calling this procedure on my SkypeReply event handler, which gets fired a lot: ``` Procedure OnCategoryRename; Var CategoryID : Integer; sCtgName : String; Begin if (AnsiContainsStr(pCommand.Reply,'GROUP')) and (AnsiContainsStr(pCommand.Reply,'DISPLAYNAME')) then begin sCtgName := pCommand.Reply; Delete(sCtgName,1,Pos('GROUP',sCtgName)+5); CategoryID := StrToInt(Trim(LeftStr(sCtgName,Pos(' ',sCtgName)))); sCtgName := GetCategoryByID(CategoryID).DisplayName; // Removing THIS line does not produce a Stack Overflow! ShowMessage(sCtgName); end; ``` The idea of this is to loop thru my list of Skype Groups, to see what group has been renamed. AFAIK thats of no importance, as my S.O has been traced to appear ``` Function GetCategoryByID(ID : Integer):IGroup; Var I : Integer; Category : IGroup; Begin // Make the default result nil Result := nil; // Loop thru the CUSTOM CATEGORIES of the ONLY SKYPE CONTROL used in this project // (which 100% positive IS attached ;) ) for I := 1 to frmMain.Skype.CustomGroups.Count do Begin // The Category Variable Category := frmMain.Skype.CustomGroups.Item[I]; // If the current category ID returned by the loop matches the passed ID if Category.Id = ID then begin // Return the Category as Result (IGroup) Result := Category; // Exit the function. Exit; end; End; End; ``` When I set a breakpoint at Result := Category; and Single Step thru, those 2 lines get executed over and over, right after each other! And when I comment out the `sCtgName := GetCategoryByID(CategoryID).DisplayName;` in the first code snippet, there is no Overflow, the message gets shown that one time it is supposed to. However, the `GetCategoryByID` is a function I wrote, and I wrote one similar, too, which works just fine (GetCategoryByName), so I don't get why it decided to repeat the ``` // Return the Category as Result (IGroup) Result := Category; // Exit the function. Exit; ``` over and over again. EDIT: Here is how you can reproduce it: [https://gist.github.com/813389](https://gist.github.com/813389) EDIT: Here is my CallStack, as requested: ![CallStack](https://i.stack.imgur.com/OWwDO.png) Edit2: More info: ![More Info](https://i.stack.imgur.com/8Rn5c.png)
Stack Overflow in Delphi
CC BY-SA 4.0
0
2011-02-05T20:38:49.363
2019-12-11T05:57:13.787
2019-12-11T05:57:13.787
1,033,581
561,545
[ "delphi", "function", "stack-overflow", "skype" ]
4,909,552
1
4,909,557
null
1
1,034
I'm trying to learn ASP.NET MVC, so I did as test project this where I want to display in Index a list of cities and when you click on city to see the properties in those cities. ![my edmx](https://i.stack.imgur.com/voo0h.jpg) Then I did some changes in global.asax in order to come up with nice URLs: ``` public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Home-Browse", "Accommodation-{city}", new { controller = "Home", action = "Browse", city = "" }); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults ); } ``` So now after I see the list of cities and I click one I get a URL like: `/Accommodation-Amsterdam` My problem is that I don't know how to do the inner join in order to tell the controller to show me the properties in the area selected. (I told you I'm just learning this) My home controller: ``` using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using accomm2.Models; namespace accomm2.Controllers { [HandleError] public class HomeController : Controller { dataEntities _db; public HomeController() { _db = new dataEntities(); } public ActionResult Index() { ViewData.Model = _db.Cities.ToList(); return View(); } public ActionResult Browse() { //ViewData.Model = _db.Properties.ToList(); var properties = from c in _db.Cities from p in c.Properties where c.CityId == CityId select c; return View(properties.ToList()); } } } ``` Could somebody help me with my Linq query or at least direct me to the right way?
Return inner join in EF
CC BY-SA 2.5
null
2011-02-05T20:46:55.300
2011-02-05T21:06:49.140
2011-02-05T21:06:49.140
23,897
397,865
[ "asp.net-mvc" ]
4,909,637
1
4,909,650
null
3
10,081
How can I change the color of the text on my UIButton. Here is my current code: ``` UIButton *b1 = [[UIButton alloc] init]; b1.frame = CGRectMake(280,395,30,30); [[b1 layer] setCornerRadius:8.0f]; [[b1 layer] setMasksToBounds:YES]; [[b1 layer] setBorderWidth:1.0f]; [[b1 layer] setBackgroundColor:[botCol CGColor]]; b1.titleLabel.font = [UIFont boldSystemFontOfSize:24]; [b1 setTitleColor:[UIColor redColor] forState:UIControlEventAllEvents]; [b1 addTarget:self action:@selector(NextButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; [b1 setTitle:@">" forState:UIControlStateNormal]; [self.view addSubview:b1]; ``` Here is what it looks like (ignore the background color and stuff): ![enter image description here](https://i.stack.imgur.com/wLdOp.png) Now, how can I get the arrow to be red? As you see above, I already have the following: ``` [b1 setTitleColor:[UIColor redColor] forState:UIControlEventAllEvents]; ``` but it isn't working.
UIButton color issues
CC BY-SA 2.5
null
2011-02-05T21:04:51.450
2011-02-06T08:28:45.047
null
null
412,082
[ "iphone", "ios", "uibutton" ]
4,910,091
1
null
null
0
276
So last night I had a cpu spike for 100% for 30 minutes which made the server not very usable :-( The server doesn't seem to be the quickest even today (its running on Amazon cloud!). The application is a chat application which only has about registered 5 users who's client polls a php script every every 5 seconds for new information ( each request hits mysql). Running some commands I found on the net it returned that I have 200 thousand connections - is this active or since the server was up? Can anyon offer any advice if there is anything out of the ordinary in the below. (Note these stats are from today where there were only 2 users logged in) ![enter image description here](https://i.stack.imgur.com/gBn6a.png)
PHP mysql connections help ( ubuntu LAMP server)
CC BY-SA 2.5
null
2011-02-05T22:22:46.163
2012-05-16T14:58:55.330
2011-02-06T00:28:06.440
106,623
138,234
[ "php", "mysql", "amazon-ec2", "lamp" ]
4,910,231
1
null
null
4
2,407
I can't be clearer than my title. :P I want to run my program whenever a user renames a file in Windows Explorer (and only within the Explorer). Here's a simple mock up: ![Rename Hook Mockup](https://i.stack.imgur.com/0NYwe.png) A simple link to a tutorial will be very helpful. I couldn't find anything. :/ Thank you in advance. P.S. I'm new in C++
How to hook C++ in Explorer's rename event
CC BY-SA 2.5
null
2011-02-05T22:53:36.740
2012-09-14T05:05:01.357
2011-02-08T16:58:42.833
2,644
2,644
[ "c++", "winapi" ]
4,910,556
1
4,910,667
null
0
170
I'm using heightForRowAtIndexPath and sizeWithFont to calculate the height for a cell. After 3 or 4 lines of text, the label containing the text grows past the top and bottom of the cell's view. Anything from 0-3 lines grows and shrinks properly. I can't find where the cell would have a hard cap on height. ``` - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath; { NSArray *array = [sectionsArray objectAtIndex:indexPath.section]; NSDictionary *dictionary = [array objectAtIndex:indexPath.row]; id key = [[dictionary allKeys] objectAtIndex:0]; NSString *keyString = [NSString stringWithFormat:@"%@", key]; NSString *keyContents = [NSString stringWithFormat:@"%@", [dictionary objectForKey:key]]; CGFloat height = 44; if ([keyString isEqualToString:@"Notes"]) { if ([keyContents length] > 0) { CGSize constraint = CGSizeMake(320.0f - (10.0f * 2), 20000.0f); height = 20 + [keyContents sizeWithFont:[UIFont boldSystemFontOfSize:15] constrainedToSize:constraint lineBreakMode:UILineBreakModeWordWrap].height; } } NSLog(@"Height of %@ with content %@ is %f", keyString, keyContents, height); if (height <= 44) { return 44; } else { return height; } } ``` Here's a screenshot of what a too large entry looks like. ![Clipped cell view](https://i.stack.imgur.com/PFkah.png)
UITableView cell content going past the cell graphic
CC BY-SA 2.5
null
2011-02-05T23:59:43.930
2011-02-06T00:21:56.057
null
null
557,913
[ "objective-c", "cocoa-touch", "uitableview" ]
4,910,815
1
4,910,824
null
2
356
My program is up and running but there is a problem with my if statements somewhere that is making "scalene" be the output in addition to the correct output (unless scalene is the correct output). take a look at the issue: ![enter image description here](https://i.stack.imgur.com/Y0mw3.png) Can anyone spot the bug? ``` # include "header.h" triangleType triangleShape(float sideLength1, float sideLength2, float sideLength3) { triangleType triangle; if (sideLength1 + sideLength2 < sideLength3) triangle = noTriangle; else if (sideLength1 + sideLength3 < sideLength2) triangle = noTriangle; else if (sideLength3 + sideLength2 < sideLength1) triangle = noTriangle; else if (sideLength1 == sideLength2 == sideLength3) triangle = equilateral; else if (sideLength1 == sideLength2) triangle = isoceles; else if (sideLength1 == sideLength3) triangle = isoceles; else if (sideLength2 == sideLength3) triangle = isoceles; else triangle = scalene; return triangle; } ``` ``` # include "header.h" void output (float sideLength1, float sideLength2, float sideLength3) { if (triangleShape (sideLength1, sideLength2, sideLength3) == noTriangle) cout << "Side lenghts of " << sideLength1 << " " << sideLength2 << " and " << sideLength3 << " would not form a triangle." << endl; else if (triangleShape (sideLength1, sideLength2, sideLength3) == equilateral) cout << "A triangle with sides of lengths " << sideLength1 << " " << sideLength2 << " and " << sideLength3 << "would be " << "an equilateral triangle."<< endl; else if (triangleShape (sideLength1, sideLength2, sideLength3) == isoceles) cout << "A triangle with sides of lengths " << sideLength1 << " " << sideLength2 << " and " << sideLength3 << "would be " << "an isoceles triangle."<< endl; else (triangleShape (sideLength1, sideLength2, sideLength3) == scalene); cout << "A triangle with sides of lengths " << sideLength1 << " " << sideLength2 << " and " << sideLength3 << " would be " << "a scalene triangle."<< endl; } ```
if statement problem?
CC BY-SA 2.5
null
2011-02-06T01:02:25.797
2011-02-06T01:14:13.707
2011-02-06T01:04:44.367
77,914
538,293
[ "c++", "if-statement" ]
4,911,097
1
4,911,128
null
-1
4,223
What I want to do here is to be able to assign the values from sql query into arrays. And then compute for the total. ``` <?php include('conn.php'); $qreports=query_database("SELECT S_PRICE, PID, QTY_PUR, ITEM_ID, CUSID, CNUM, Cust_Name, TDATE FROM prod_table, customer_credit, sales_trans_items WHERE prod_table.PID=sales_trans_items.ITEM_ID AND sales_trans_items.CNUM=customer_credit.CUSID AND sales_trans_items.TDATE='2011-02-06 09:14:09'","onstor",$link); $grandtotal=0; $customer=""; while($qrep=mysql_fetch_assoc($qreports)){ $pid=$qrep['PID']; foreach ($pid as $k => $v) { $sids=$v; $qtypur=$qrep['QTY_PUR'][$k]; $sprice=$qrep['S_PRICE'][$k]; $customer=$qrep['Cust_Name'][$k]; $tdate=$qrep['TDATE'][$k]; $stot=$qtypur * $sprice; $grandtotal =$grandtotal + $stot; } } echo "Customer: ". $customer."<br/>"; echo "Profit: ". $grandtotal; ``` ?> I tried the query on phpmyadmin before I place it in the code, and it output this: ![enter image description here](https://i.stack.imgur.com/IdPcC.png)
How to use arrays to store values fetch from sql query in php
CC BY-SA 2.5
null
2011-02-06T02:20:11.130
2011-02-06T02:40:15.843
null
null
472,034
[ "php", "sql", "arrays" ]
4,911,101
1
4,911,110
null
0
383
With markup like [http://jsfiddle.net/rUsbJ/](http://jsfiddle.net/rUsbJ/) ``` <h1><a href="#">Header with link</a></h1> <h1>Header without link</h1> ``` ![](https://imgur.com/t0Wor.jpg) As you can see theres some space between the `<a>` and the parent `<h1>`. How can I remove it?
How to remove the little space between h1 & inner a
CC BY-SA 2.5
null
2011-02-06T02:21:48.307
2011-02-06T02:23:38.927
null
null
292,291
[ "css" ]
4,911,182
1
4,911,196
null
0
498
I have inherited a webforms application that was working and now is not. The error text is "Object reference not set to an instance of an object. ". Im sorry it is sooo generic, but I was wondering if anyone could read the Stack Trace and point me in right direction? Stack Trace: ``` [NullReferenceException: Object reference not set to an instance of an object.] GAP07.Index_UK.LoadData() +2060 GAP07.Index_UK.Page_Load(Object sender, EventArgs e) +5 System.Web.UI.Control.OnLoad(EventArgs e) +67 System.Web.UI.Control.LoadRecursive() +35 System.Web.UI.Page.ProcessRequestMain() +750 ``` --- Version Information: Microsoft .NET Framework Version:1.1.4322.2443; ASP.NET Version:1.1.4322.2470 Thanks Paul ![screenshot](https://i.stack.imgur.com/32Ryb.png)
"Object reference not set to an instance of an object" Issue
CC BY-SA 2.5
null
2011-02-06T02:43:25.290
2011-02-06T03:10:50.633
2011-02-06T03:10:50.633
106,224
545,490
[ "asp.net", ".net-1.1" ]
4,911,251
1
4,911,256
null
1
2,167
I'm trying to use CSS sprites to reduce the number of HTTP requests on page. I want the these images to render without borders. As best I can tell I have configured the CSS correctly, yet I am experiencing the render issues below (note: The Google logo is intentionally clipped): ![](https://s3.amazonaws.com/abt-cdn/border_issue.png) As you can see, all the browsers still render a border. Also, IE and FireFox render 'broken link' type icons as well. The HTML used in this example is: ``` <html> <head> <style> img {border:none} img.css_sprite { background:url("http://www.google.com/images/nav_logo29.png") -20px -10px; height:24px; width:100px; border:none;} </style> </head> <body> <img class="css_sprite"/> </body> </html> ``` Can anyone tell me what I'm doing wrong here? I'm sure it must be something simple. Thanks in advance.
Border renders when using CSS Sprites
CC BY-SA 2.5
null
2011-02-06T03:02:24.553
2014-02-13T11:16:07.277
null
null
328,679
[ "html", "css", "css-sprites" ]
4,911,379
1
null
null
59
75,294
The XML formatting works perfect but not the html formatting. In fact if I use "cmd-shift-F" for a html file, it just left aligns almost everything. I've attached the before and after pictures. ![No eclipse html formatting applied](https://i.stack.imgur.com/eKwJP.png) ![After eclipse html formatting applied](https://i.stack.imgur.com/YYHbo.png) Does anyone know how to fix this? I played around with HTML formatting preferences but had no luck. Note that the same document, if it is saved as xml will format perfectly. I am using eclipse 3.6 with WTP plugin.
How to format html files in Eclipse?
CC BY-SA 2.5
0
2011-02-06T03:33:30.840
2019-09-05T21:01:59.093
null
null
null
[ "eclipse", "code-formatting", "eclipse-wtp" ]
4,911,649
1
null
null
0
512
Looking for a way in CSS (in the child theme) to make a pop out from one div display over another, without blocking the links in the lower div when the pop-out is closed. I am trying to use the Facebook Like Button with the comment pop-out on the pages of my site and have made the .widget-pad area of my section appropriately sized to display it when it pops up, so that it goes over another section and div that is containing a large image that links to another page. ![](https://i.stack.imgur.com/8fF9j.png) However, when the Like button is unclicked and the pop-up is not displayed the linked area (silver part in this pick) is not-clickable. ![](https://i.stack.imgur.com/DVsBF.png) The area below where the transparant div from the Like Button is still clickable. How to make it so I can still click the links below where a popout happens on my page?
How to Style Facebook Like Comment Pop Out Over Links?
CC BY-SA 2.5
null
2011-02-06T04:47:06.960
2011-02-07T00:59:45.303
2011-02-06T05:12:25.853
366,904
577,166
[ "html", "css", "fbml" ]
4,911,688
1
4,911,876
null
4
12,180
I am writing an iPhone game and have it working well with my level data hard coded but I would like to store the level data in a plist a load it at launch. I have never used plists and am having trouble understanding how I should set the plist up based on my data model. Here is how I have it hard coded now: (in my appDelegate) ``` - (void)loadLevels { //setup NSNumber objects to load into sequences NSNumber * rID = [[[NSNumber alloc] initWithInt:0] autorelease]; NSNumber * bID = [[[NSNumber alloc] initWithInt:1] autorelease]; NSNumber * gID = [[[NSNumber alloc] initWithInt:2] autorelease]; NSNumber * yID = [[[NSNumber alloc] initWithInt:3] autorelease]; NSNumber * rbID = [[[NSNumber alloc] initWithInt:4] autorelease]; NSNumber * rgID = [[[NSNumber alloc] initWithInt:5] autorelease]; NSNumber * ryID = [[[NSNumber alloc] initWithInt:6] autorelease]; NSNumber * bgID = [[[NSNumber alloc] initWithInt:7] autorelease]; NSNumber * byID = [[[NSNumber alloc] initWithInt:8] autorelease]; NSNumber * gyID = [[[NSNumber alloc] initWithInt:9] autorelease]; //Level One's Sequence NSMutableArray * aSequence = [[[NSMutableArray alloc] initWithCapacity:1] autorelease]; [aSequence addObject: rID]; [aSequence addObject: bID]; [aSequence addObject: gID]; [aSequence addObject: yID]; [aSequence addObject: rbID]; [aSequence addObject: rgID]; [aSequence addObject: ryID]; [aSequence addObject: bgID]; [aSequence addObject: byID]; [aSequence addObject: gyID]; // Load level One _levels = [[[NSMutableArray alloc] init] autorelease]; Level *level1 = [[[Level alloc] initWithLevelNum:1 levelSpeed:1.0 levelSequence:aSequence] autorelease]; [_levels addObject:level1]; //do the same thing for subsequent levels// } ``` (this is how I have my Level Class implemented) ``` #import "Level.h" @implementation Level @synthesize levelNum = _levelNum; @synthesize levelSpeed = _levelSpeed; @synthesize levelSequence = _levelSequence; - (id)initWithLevelNum:(int)levelNum levelSpeed:(float)levelSpeed levelSequence:(NSMutableArray *)levelSequence { if ((self = [super init])) { self.levelNum = levelNum; self.levelSpeed = levelSpeed; self.levelSequence = [[[NSMutableArray alloc] initWithArray:levelSequence] autorelease]; } return self; } - (void)dealloc { [_levelSequence release]; _levelSequence = nil; [super dealloc]; } @end ``` I'm just not getting how to set up a plist to store my data to match my model. Can anyone give me some advise please? ADDITION: (here is how I think I need to setup the plist - the data model is simply the three variables initializing my level (above). If you look at my current plist it might be more clear how it is setup, but each level is comprised of: a level number, a level speed, and an array of numbers denoting the required sequence for that level.) ![My current plist setup](https://i.stack.imgur.com/8xxN3.png) Now, if I do have this setup correctly how do I load the values into my program?
Setting up a plist to store application data (not settings) for an iPhone game
CC BY-SA 3.0
0
2011-02-06T04:59:29.803
2015-12-18T23:32:05.007
2015-12-18T23:32:05.007
4,370,109
485,390
[ "ios", "objective-c", "iphone", "xcode", "plist" ]
4,912,046
1
4,912,656
null
3
978
I have an array: ``` array([[ 4, 10], [ 4, 2], [ 0, 7], [ 5, 11], [ 6, 8], [ 3, 6], [ 9, 7], [ 2, 11], [ 9, 5], [ 8, 1]]) ``` I want a method by which to order the value pairs so that as many as possible pairwise 2-element sets have a common value. This is an example of the desired ordered array: ``` array([[ 4, 10], [ 4, 2], [ 2, 11], [ 5, 11], [ 9, 5], [ 9, 7], [ 0, 7], #note the gap here: [ 8, 1], [ 6, 8], [ 3, 6]]) ``` Several conditions are true about these arrays. There are no duplicate pairs (ie: [1,0] nor [0,1] will appear elsewhere in the array if [0,1] already exists). No pair has the same value (ie: [1,1] will not exist). No pair will have more than two matches (iow: no value exists more than twice in the entire array.) but a pair can have as few as zero matches (note in the above array the gap across which there is no match). Obviously, I can create every permutation of the array, but this seems brutish. I think there might be some way of cutting the deck and re-stacking in a logical way such that it becomes sorted in a small number of cuts. But before I go down that road, I want to: 1) Be sure that there is no `numpy` or `collections` function that already does this. 2) Know that there is no tricky-genius way to use numpy `.sort()` (or similar) to do it. 3) Find whether this is a common task and there is algorithm that does this. ("Oh, that's the Blumen-Funke algorithm!") Here is some code that generates shuffled test arrays and checks sorted arrays: ``` def shuffled(N=12, ans=1): '''returns is now the unsorted test array''' r = range(N) random.shuffle(r) l = [] for i in range(N): l.append((r[i-1], r[i])) random.shuffle(l) return np.array(l)[ans+1:] # step 2: ??? def test_ordered(a): '''checks if generated array has been sorted''' c0 = a[1:,0]==a[:-1,0] c1 = a[1:,0]==a[:-1,1] c2 = a[1:,1]==a[:-1,0] c3 = a[1:,1]==a[:-1,1] cond = c0+c1+c2+c3 ans = sum(numpy.logical_not(cond)) # when sorted this should return the same number input into # shuffled() as 'ans': return ans ``` (Is this a subjective question? I'm being warned that it is.) ## Results: Thank you so much for all your help. Sven's solution was about 20% faster than Paul's and happily, they both run in linear time, Doug's answer did not solve the problem. There was a high, but also largely linear dependence of performance on the number of "breaks" or "gaps" in the input data. See the plot below. The 10,000 magnitude axis is N. the 0.5 axis is the percentage of breaks. the z axis is performance in seconds. Thanks again! ![enter image description here](https://i.stack.imgur.com/vhjxu.png)
Ordering an array for maximal pairwise matches
CC BY-SA 2.5
0
2011-02-06T06:46:05.797
2011-04-15T09:24:10.390
2011-02-10T20:53:17.177
31,676
31,676
[ "python", "arrays", "numpy" ]
4,912,092
1
6,678,156
null
1,037
608,190
Google's "Report a Bug" or "Feedback Tool" lets you select an area of your browser window to create a screenshot that is submitted with your feedback about a bug. ![Google Feedback Tool Screenshot](https://i.stack.imgur.com/CDhEi.png) [duplicate question](https://stackoverflow.com/questions/6608327/google-style-send-feedback) How are they doing this? Google's JavaScript feedback API is loaded from [here](https://ssl.gstatic.com/feedback/api.js) and [their overview of the feedback module](http://www.google.com/tools/feedback/intl/en/learnmore.html) will demonstrate the screenshot capability.
Using HTML5/Canvas/JavaScript to take in-browser screenshots
CC BY-SA 4.0
0
2011-02-06T06:58:53.113
2022-02-06T13:10:41.710
2021-09-10T09:24:34.620
9,935,654
105,565
[ "javascript", "html", "canvas", "screenshot", "html2canvas" ]
4,912,192
1
4,912,331
null
1
450
As seen below, my image is being cropped, yet there appears to be enough space to render it. As well, the image seems to be at the top. I have no title set so want no text there. How can I get the button to center and fit the image? ![enter image description here](https://i.stack.imgur.com/LdYGI.png)
ipad - TabBarItem image cropping
CC BY-SA 2.5
null
2011-02-06T07:37:13.277
2014-04-25T17:49:09.920
null
null
172,861
[ "ipad", "uitabbarcontroller", "uitabbaritem" ]
4,912,315
1
4,917,977
null
2
1,118
In the image below the button is being pressed. The shadow is square. How do I make the shadow have rounded edges? ![enter image description here](https://i.stack.imgur.com/faBcY.png)
UIButton - rounded corners in highlight state
CC BY-SA 2.5
null
2011-02-06T08:19:29.683
2011-05-11T09:07:58.053
2011-02-07T08:25:23.490
21,234
172,861
[ "iphone", "ipad", "uibutton", "highlight" ]
4,912,487
1
4,912,506
null
2
4,594
In VB.NET for the combo box, I have set the autocomplete mode to "SuggestAppend" and autocomplete source to "ListItems". Its working as expected. But the width of the autosuggest dropdown box is not same as that of combo box and so it looks weird. I tried changing the value dropdown width property but it changes the value of normal dropdown box (seen after clicking down arrow on combobox), and not the autosuggest dropdown box. So what code or property needs to be set to make autosuggest dropdown box the same width as that of combobox width? ![This image shows difference between the width of autosuggest dropdownbox and that of combobox width](https://i.stack.imgur.com/lkwHX.jpg) ![This images show normal dropdown box , width of which is controlled by dropdown width propery of combobox](https://i.stack.imgur.com/kIhHA.jpg)
Why does the width of the auto-suggest dropdown box not match the width of the combobox?
CC BY-SA 2.5
0
2011-02-06T09:12:10.503
2011-02-06T09:26:55.580
2011-02-06T09:26:55.580
366,904
553,223
[ ".net", "vb.net", "winforms", "combobox", "autosuggest" ]
4,912,661
1
4,912,774
null
1
933
I have 2 divs. Second is under first. ![enter image description here](https://i.stack.imgur.com/5pA2n.png) 2nd div has `z-index: -1; top: -20px; position: relative`. Now I want to put some links(a-tag) into 2nd div: `<a href="#">test</a>`. Now I see my link but it's inactive. I can't click at it. When I remove `z-index: -1` it works. What's wrong?
Relative positioning with z-index
CC BY-SA 2.5
null
2011-02-06T10:09:59.687
2011-02-06T11:06:03.677
2011-02-06T11:06:03.677
334,243
87,152
[ "css", "html", "click", "z-index" ]
4,912,791
1
null
null
5
3,777
I am wondering how to reproduce image effects that we can see in several Mac and iPhone applications, all of them starting from a black and white picture: - In UiTabbar on iPhone, how, the black and white picture become a blue gradient when it is selected - in Twitter for mac, we can see several effects (glow, bevel, ....) Any help on this topic is welcome. :)![enter image description here](https://i.stack.imgur.com/Mss2S.png) EDIT : I am interested for these effects on MAC OS, not on iPhone.
Image effects with core graphics
CC BY-SA 2.5
0
2011-02-06T10:43:19.820
2011-02-22T07:02:02.990
2011-02-06T11:09:00.633
230,632
230,632
[ "iphone", "cocoa", "image", "macos", "core-graphics" ]
4,912,981
1
4,913,058
null
0
106
There is a table with the following stucture: ![Structure of table](https://dl.dropbox.com/u/17136439/net/dev/mysql_collations_question_table_structure.png) Here are the data in this table: [](https://dl.dropbox.com/u/17136439/net/dev/mysql_collations_question_table_data.png) Ok, let's try the following: The result is: [](https://dl.dropbox.com/u/17136439/net/dev/mysql_collations_question_experimental_query_result.png) why the postfix `_bin` have been ignored? According to [MySQL manual](http://dev.mysql.com/doc/refman/5.0/en/charset-binary-collations.html), we can say that `_bin` affects to such functions like LOWER and UPPER too (and make them not working because binary-type collaction is used in these fields). But we've got another results in practice. Why?
Collations in MySQL
CC BY-SA 2.5
null
2011-02-06T11:28:22.003
2011-02-06T11:42:57.473
2017-02-08T14:31:30.267
-1
554,823
[ "mysql", "database", "phpmyadmin", "collation" ]
4,913,156
1
4,913,285
null
17
57,338
I want to replace the black color in this image with transparency. This would also mean that the gradient in the center of the image would not fade to black but fade to transparency. How is this possible? ![enter image description here](https://i.stack.imgur.com/OZyZ6.png)
Photoshop: Replace Color With Transparency
CC BY-SA 2.5
0
2011-02-06T12:06:35.073
2012-10-16T15:09:41.387
2011-02-06T12:15:12.167
330,286
330,286
[ "photoshop" ]
4,913,170
1
4,913,221
null
1
315
I'm trying to create a spectral image with a constant grey-scale value for every row. I've written some fantastically slow code that basically tries 1000 different variation between black and white for a given hue and it finds the one whose grey-scale value most closely approximates the target value, resulting in the following image: ![FarbenKugel](https://i.stack.imgur.com/6bydR.png) On my laptop screen (HP) there is a very noticeable 'dip' near the blue peak, where blue pixels near the bottom of the image appear much brighter than the neighbouring purple and cyan pixels. On my second screen (Acer, which has far superior colour display) the dip is smaller, but still there. I use the following function to compute the grey-scale approximation of a colour: ``` Math.Abs(targetGrey - (0.2989 * R + 0.5870 * G + 0.1140 * B)) ``` when I convert the image to grey-scale using Paint.NET, I get a perfect black to white gradient, so that part of the code at least works. So, question: Is this purely an artefact of the display qualities of my screens? Or can the above mentioned grey-scale algorithm be improved upon to give a visually more consistent result? --- EDIT: The problem seems to be mostly monitor calibration. Not, I repeat not, a problem with the code.
A better Greyscale algorithm
CC BY-SA 2.5
0
2011-02-06T12:08:59.980
2011-02-06T13:23:59.390
2011-02-06T13:23:59.390
81,947
81,947
[ "graphics", "colors" ]
4,913,168
1
4,977,103
null
0
738
I have an `UIViewController` that has two UIViews inside, whose layout (set in Interface Builder) is something like this (the magenta colored view is the UIViewController default view): ![enter image description here](https://i.stack.imgur.com/oGlAy.png) and I added the main view to a root view obtaining this effect (by not showing the darker view placing its `frame` at the bottom): ![enter image description here](https://i.stack.imgur.com/2PWRI.png) Now when the device rotates, what I obtain is this: ![enter image description here](https://i.stack.imgur.com/TGbEp.png) whereas I'd like to still hide the darker view. This is the code I use to hide it when it appears (I use it in the `viewDidLoad` method): ``` - (void)hideAll:(float)time{ CGRect hiddenFrame = CGRectMake(0, 1024, self.view.frame.size.width, self.view.frame.size.height); [self.view setFrame:hiddenFrame]; [self.view setNeedsDisplay]; } ``` and it appears to work, but when I call a variant of it when rotating (in `willRotateToInterfaceOrientation:duration:`), nothing happens: ``` CGRect hiddenFrame = CGRectMake(0, 748, self.view.frame.size.width, self.view.frame.size.height); [self.view setFrame:hiddenFrame]; [self.view setNeedsDisplay]; ``` What am I missing? have I to set some other view property in Interface Builder? It seems to me that the coordinate system does not change after the device has been rotated (ie the origin set in the upper-left corner in portrait mode will become the upper-right after a clockwise rotation in landscape mode)
Cannot properly rotate a translated UIView on the iPad
CC BY-SA 2.5
null
2011-02-06T12:08:01.397
2011-02-12T08:18:35.707
2011-02-08T17:04:42.760
370,158
370,158
[ "iphone", "ipad", "ios", "uiviewcontroller", "rotation" ]
4,913,259
1
4,913,603
null
1
325
I'll try to explain this as best as i can, but i appologize if it gets too confusing - I've been stuck on this problem for many hours now. In my application i have a search screen where the user will be able to select a bunch of criterias to perform the search by. Some of these criterias consists of fairly long lists of values to choose from and therefor i want a tableview on my searchscreen which have 4 rows - Each row representing a criteria that the user can set. Once the user clicks on a row i want to push a new window in my navigationcontroller which consists of a new table containing the selectable values for that criteria - Once the user clicks on one of these rows on the new window, i want the selected value to be sent back to my main searchscreen and pop back to my search screen. What would be the best way to do this? My searchscreen is called SearchViewController and is contained in a navigationController. SearchViewController contains two sliders and a tableView with 4 rows called "Searchtype", "Property type", "Salestype", "Area" and a searchbutton. If the user clicks on "Searchtype" then i want a new view to be pushed in the navigationController which should contain a new tableView with a bunch of rows representing different possible values for the "Searchtype" criteria - The same goes for all 4 rows in SearchViewController. When the user clicks on one of the value rows in the newly pushed tableView i want that tableView to be popped away and the selected value sent back to the SearchViewController allowing the user to either select more criterias or push the search button to actually perform a search based on the selected criterias. But i can't figure out the best way to do this? I really appreciate any help i can get - I'm going nuts trying to figure this out :) Btw. i don't use Interface Builder - All UI elements are coded manually. ![enter image description here](https://i.stack.imgur.com/1jkHu.jpg)
How to use a tableView as a selector to send values to another viewcontroller?
CC BY-SA 2.5
null
2011-02-06T12:26:15.183
2011-02-06T13:35:11.673
null
null
588,813
[ "iphone", "tableview", "viewcontroller" ]
4,913,344
1
4,913,475
null
2
2,493
I'm building a dropdown menu and I've got an issue showed on this img: ![enter image description here](https://i.stack.imgur.com/sSna8.jpg) I want the "2.1" text to be displayed next to the "Item" text. For some reaason, every new word gets a new line. Here's the html: ``` <ul id='nav'> <li><a href='/'>Item 1</a></li> <li><a href='/'>Item 2</a> <ul> <li><a href='/'>Item 2.1</a></li> </ul> </li> <li><a href='/'>Item 3</a></li> <li><a href='/'>Item 4</a></li> <li><a href='/'>Item 5</a></li> </ul> ``` And here's the CSS: ``` #nav { list-style: none; } #nav li { float: left; position: relative; } #nav li a { display: block; text-decoration: none; text-align: center; background: #ccc; margin-right: 5px; } #nav li ul { position: absolute; } #nav li ul li { display: block; } #nav li ul li a { padding: 0px 10px; height: 20px; text-align: left; background: #999; } ``` Thanks for any help, Mike.
CSS - How to display dropdown text in one row?
CC BY-SA 2.5
null
2011-02-06T12:40:53.950
2011-02-06T13:07:30.987
null
null
134,602
[ "html", "css", "menu", "drop-down-menu" ]
4,913,409
1
null
null
27
16,692
In and other browsers my dropdown looks : ![enter image description here](https://i.stack.imgur.com/OihyJ.png) However, in it has unwanted lines: ![enter image description here](https://i.stack.imgur.com/l9FFm.png) I have successfully removed the unwanted Firefox dotted lines for and elements with these CSS statements: ``` button::-moz-focus-inner { border: 0; } input::-moz-focus-inner { border: 0; } ``` so I thought these would work for the select/option elements, but they don't: ``` select::-moz-focus-inner { border: 0; } option::-moz-focus-inner { border: 0; } ``` # Addendum These don't work either: ``` select::-moz-focus-inner { border: 0; outline: 0 } option::-moz-focus-inner { border: 0; outline: 0 } ``` nor these: ``` select { outline: 0; } option { outline: 0; } ``` nor these: ``` select { outline: none; } option { outline: none; } ```
How can I remove the dotted lines on a SELECT/OPTION dropdown control in Firefox?
CC BY-SA 3.0
0
2011-02-06T12:53:43.100
2020-01-13T00:06:48.893
2015-12-14T01:28:44.987
1,849,664
4,639
[ "firefox", "dotted-line" ]
4,913,810
1
4,913,913
null
6
3,655
This may be a more math focused question, but wanted to ask here because it is in a CS context. I'm looking to inscribe a rectangle inside another (arbitrary) quad with the inscribed quad having the largest height and width possible. Since I think the algorithm will be similar, I'm looking to see if I can do this with a circle as well. To be more clear hear is what I mean by the bounding quadrilateral as an example. ![enter image description here](https://i.stack.imgur.com/sUgyP.png) Here are 2 examples of the inscribed maximization I'm trying to achieve: ![enter image description here](https://i.stack.imgur.com/tecvm.png) ![enter image description here](https://i.stack.imgur.com/OLNmS.png) I have done some preliminary searching but have not found anything definitive. It seems that some form of dynamic programming could be the solution. It seems that this should be a linear optimization problem that should be more common than I have found, and perhaps I'm searching for the wrong terms. For the inscribed square assume that we know a target w/h ratio we are looking for (e.g. 4:3). For the quad, assume that the sides will not cross and that it will be concave (if that simplifies the calculation).
How can I inscribe a rectangle or circle inside an arbitrary quadrilateral
CC BY-SA 2.5
0
2011-02-06T14:18:35.847
2015-06-04T02:05:36.793
2011-02-07T17:54:45.350
311,525
311,525
[ "algorithm", "optimization", "graphics", "bounding-box", "linear-programming" ]
4,914,504
1
4,915,100
null
22
204,687
installing Netbeans 6.0.1 on my windows computer, I find this error: ![enter image description here](https://i.stack.imgur.com/Cqu1O.png) Even if I my enviroment variables seems to be ok, when executing: ![enter image description here](https://i.stack.imgur.com/gDKeU.png) I rebooted my system, but the error persists. Does anybody know why?? Thans in advance
Netbeans installation doesn't find JDK
CC BY-SA 2.5
0
2011-02-06T16:23:01.473
2013-04-16T09:43:37.220
null
null
457,208
[ "java", "netbeans" ]