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
6,172,350
1
6,175,066
null
12
2,327
Using Firebug and Chrome developer tools, I can see loading some javascript and css files through an action can take an extra 500ms on my development machine. This happens to different files on different calls and doesn't matter what order I put them in. If I link directly to the files this 500ms delay doesn't ever occur. I can refresh the page over and over and get different values, but they always look like 500ms was added to the request time. If I keep refreshing the page, the extra 500ms shows up on different single files or sometimes two files where one is a 1000ms delay like in the image below. --- Putting Monitor.Enter in my HttpModule's BeginRequest and Monitor.Exit in the EndRequest caused the delay to go away, so my guess is it has something to do with threading multiple requests. --- I use the method descibed by Evan Nagel [here](http://www.weirdlover.com/2010/05/08/caching-javascript-and-css-files-in-asp-net/) for caching, but the same thing happens when I replace the links with calls to my own controller with an action that just passes a raw file through: ``` public FileResult RawFile(string path, string contentType) { var server = HttpContext.Server; string decodedPath = server.UrlDecode(path); string mappedPath = server.MapPath(decodedPath); return File(mappedPath, contentType); } ``` Here's the code I have in the head section of my html: ``` <link rel="stylesheet" href="@Url.Action("RawFile", new { controller = "Content", path = "~/Content/Site.css", contentType = "text/css" })" type="text/css" /> <script src="@Url.Action("RawFile", new { controller = "Content", path = "~/Scripts/debug/FBINFO.js", contentType = "application/x-javascript" })" type="text/javascript"></script> <script src="@Url.Action("RawFile", new { controller = "Content", path = "~/Scripts/jquery-1.4.1.min.js", contentType = "application/x-javascript" })" type="text/javascript"></script> ``` This doesn't seem to happen on my production server, at least not as often but it is harder to tell because the latency is higher normally. Is this something not to worry about? What would cause it? It happens both with Cassini and with my local IIS server on Windows 7 Home Ultimate 64 bit. I've added a custom attribute to time the calls and the times between OnAction/OnResult Executing and Executed are generally sub-millisecond. I've used a stopwatch around the action method (the ZipController writes to the response stream and doesn't return a result) and the times are likewise always small, average 1.5ms and always under 10ms. The only real difference I can see in the Fiddler headers is the X-AspNetMvc-Version header, so I set it to not be appended and even removed the X-AspNet-Version header to no avail. I've tried enabling and disabling compression and about everything else I can think of too. This is after I added my own Cache-Control and ETag headers which had no effect. Interestingly the 500ms delay happens even in the case of a 304 Not Modified response where the body is not sent. Sometimes two of the files will have delays, one 500ms and the other 1000ms. Direct file: ``` HTTP/1.1 200 OK Content-Type: application/x-javascript Last-Modified: Sun, 29 May 2011 22:42:27 GMT Accept-Ranges: bytes ETag: "b57a84af511ecc1:0" Server: Microsoft-IIS/7.5 Date: Mon, 30 May 2011 04:38:20 GMT Content-Length: 1336 ``` RawFile action: ``` HTTP/1.1 200 OK Cache-Control: public Content-Type: application/x-javascript ETag: "CD9F383D0537373C6D2DC8F60D6519A6" Server: Microsoft-IIS/7.5 Date: Mon, 30 May 2011 04:34:37 GMT Content-Length: 1336 ``` ![Action Method](https://i.stack.imgur.com/qvJjK.jpg) ![Direct File](https://i.stack.imgur.com/6MRP9.jpg) Following IanT8's comment, I added an HttpModule to track begin/end request, as well as adding log calls as the first and last statements of my action methods. Long story short both requests come in at the same time and the 500ms delay occurs after the first EndRequest, before the action method of the second call is executed. This delay is usually 499ms, but it was 497ms once, 498ms once and 492ms once. ``` 2011-05-31 00:55:19.1874|INFO|20110531 00:55:19.196 BeginRequest: http://localhost:51042/Zip/Style?Path=~/Content/Site.css 2011-05-31 00:55:19.1874|INFO|20110531 00:55:19.197 BeginRequest: http://localhost:51042/Zip/Script?Path=~/Scripts/jquery-1.4.1.min.js|~/Scripts/debug/FBINFO.js 2011-05-31 00:55:19.2034|INFO|20110531 00:55:19.203 Style() Start 2011-05-31 00:55:19.2034|INFO|20110531 00:55:19.208 Style() End 2011-05-31 00:55:19.2034|INFO|20110531 00:55:19.212 EndRequest: http://localhost:51042/Zip/Style?Path=~/Content/Site.css 2011-05-31 00:55:19.7044|INFO|20110531 00:55:19.704 Script() Start 2011-05-31 00:55:19.7044|INFO|20110531 00:55:19.712 Script() End 2011-05-31 00:55:19.7044|INFO|20110531 00:55:19.713 EndRequest: http://localhost:51042/Zip/Script?Path=~/Scripts/jquery-1.4.1.min.js|~/Scripts/debug/FBINFO.js ``` Now for the really interesting part. I created a static object on my HttpModule and called Monitor.Enter in the BeginRequest and Monitor.Exit in the EndRequest. The delay dissappeared. Chrome shows one call taking about 15-20ms and the other taking about 30-40ms because it has to wait for the first call to end, but the 500ms delay is gone. Obviously this solution is not optimal.
Mysterious ASP.NET MVC Action High latency issue?
CC BY-SA 3.0
0
2011-05-30T04:43:49.503
2011-06-11T09:23:45.340
2011-05-31T06:30:08.510
369,792
369,792
[ "asp.net-mvc", "asp.net-mvc-3" ]
6,172,369
1
null
null
-2
620
I have problem in my new rails project.I want to implement a function which can show the user's info completeness by a bar like Linkedin. I think I can use a variable to record the completeness,but I don't have any idea about how to calculate it. P.S I have two ,one is the ,another is the . ![a picture from Linkedin,show the completeness bar](https://i.stack.imgur.com/lnYaJ.png)
How to calculate user's info completeness in Rails
CC BY-SA 3.0
null
2011-05-30T04:49:39.180
2012-08-04T20:54:31.257
2012-08-04T20:54:31.257
168,868
637,676
[ "ruby-on-rails" ]
6,172,621
1
11,455,067
null
0
62
I'm using some old Table Activex with Report / printing and even graphics to easy create useful reports. It' looking like that (Look pictures in the bottom of message) But using so heavy ActiveX controls for it is a bit weird way. Is there something free like that for .NET Winforms ? Something to display the printable report based on my table. ![enter image description here](https://i.stack.imgur.com/Uhuzj.jpg) ![enter image description here](https://i.stack.imgur.com/SAdOc.jpg)
Looking for free webforms Report compopnent for Table
CC BY-SA 3.0
null
2011-05-30T05:37:20.767
2012-07-12T15:17:56.933
null
null
238,232
[ ".net", "winforms", "report" ]
6,172,637
1
6,172,822
null
25
36,856
[DiveIntoHTML5 Canvas](http://diveintohtml5.ep.io/canvas.html) claims that IE9 supports canvas. However, when I tried doing canvas on IE9, it doesn't work: > Object doesn't support property or method 'getContext' I'm using IE9.0.8112.16421: ![enter image description here](https://i.stack.imgur.com/Wfj5d.gif) This is the code: ``` <html> <head> </head> <body style="background:black;margin:0;padding:0;"> <canvas id="canvas" style="background:white;width:100%;height:100%;">noob</canvas> <script> var img=new Image(); img.onload=function(){ var c=document.getElementById('canvas'); var ctx = c.getContext('2d'); var left,top; left=top=0; ctx.drawImage(img,left,top,20,20); var f=function(){ left+=1; top+=1; c.width=c.width; ctx.drawImage(img,left,top,20,20); }; setInterval(f,20); }; img.src="http://a.wearehugh.com/dih5/aoc-h.png"; </script> </body> </html> ```
Why does my IE9 does not support canvas?
CC BY-SA 3.0
0
2011-05-30T05:40:28.387
2014-05-22T20:36:49.523
2014-05-22T20:36:49.523
632,951
632,951
[ "javascript", "canvas", "internet-explorer-9" ]
6,172,725
1
6,172,852
null
0
329
While working with project I upgraded the version of IOS SDK 3.2 to 4.2 I don't know what to do, please help me out. ![enter image description here](https://i.stack.imgur.com/6gWuP.png)
Xcode Internal Error while upgrading the project
CC BY-SA 3.0
null
2011-05-30T05:53:21.077
2013-12-20T07:17:00.380
2013-12-20T07:17:00.380
3,041,194
465,800
[ "iphone" ]
6,172,746
1
6,173,598
null
2
900
I want to calculate the variance in a dataset collected at a given time (t) for which we know the frequency of the conditional and decision attributes. Every conditional attribute can take 3 possible values while the outcome consists of a two-classe attribute, as can be seen in the picture given below. What I need is to calculate the variance of this given data snapshot. I would also be interested in sample code or algorithm. !![enter image description here](https://i.stack.imgur.com/NE7oo.png)
Calculate variance of 3 or more attributes with known frequencies
CC BY-SA 3.0
null
2011-05-30T05:56:32.387
2011-05-30T09:16:52.323
2011-05-30T08:14:28.707
420,055
353,915
[ "java", "statistics", "machine-learning", "data-mining" ]
6,172,866
1
6,172,918
null
3
2,341
![How to design a Listview of this type in which selctor should only be focused on list not the list icon](https://i.stack.imgur.com/CA8sP.jpg)
How to design custom list view in android?
CC BY-SA 3.0
0
2011-05-30T06:16:09.273
2011-05-30T07:22:48.850
2011-05-30T06:34:04.380
707,942
707,942
[ "android" ]
6,172,855
1
6,172,877
null
0
292
I have an asynctask that parses an xml file from the net. I'm storing its value to a variable of the main activity. When I run the following code, it force closes. ``` private class parseXMLAsync extends AsyncTask <String, String, String>{ protected void onPreExecute(){ super.onPreExecute(); showDialog(PARSE_XML); } @Override protected String doInBackground(String... strings) { try{ Engagia.this.url.openConnection(); SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser sp = spf.newSAXParser(); XMLReader xr = sp.getXMLReader(); ExampleHandler myExampleHandler = new ExampleHandler(); xr.setContentHandler(myExampleHandler); xr.parse(new InputSource(Engagia.this.url.openStream())); List<ParsedExampleDataSet> parsedExampleDataSet = myExampleHandler.getParsedData(); Iterator i; i = parsedExampleDataSet.iterator(); ParsedExampleDataSet dataItem; while(i.hasNext()){ dataItem = (ParsedExampleDataSet) i.next(); String folder = dataItem.getParentTag(); if( folder == "Videos" ){ MainAct.this.videoNames[MainAct.this.videoCount] = dataItem.getName(); MainAct.this.videoCount++; } } }catch(Exception e){ Log.e(LOG_TAG, e.getMessage()); } return null; } @Override protected void onPostExecute(String lenghtOfFile) { if( mProgressDialog.isShowing() ){ dismissDialog(PARSE_XML); } String str_contents = null; PopIt("Parsing Done", "STR CONTENTS >> " + str_contents, "Denied"); } } ``` ![enter image description here](https://i.stack.imgur.com/WVKov.jpg)
Android: AsyncTask force closes
CC BY-SA 3.0
null
2011-05-30T06:14:07.813
2011-05-30T06:26:35.300
null
null
827,530
[ "java", "android", "android-asynctask", "xml-parsing" ]
6,173,024
1
6,175,994
null
0
3,421
I was trying with the class "Process" but I always throws an exception. The same happens when I try to get the path of other processes, processes such as: "System", among others. I already tried with the class "WMI", but neither could get the path of the processes already mentioned. I was thinking by the use of native APIs, however i think that's not a good idea, but no matter, if necessary will use them. Does anyone know of any alternatives? I ask this because, applications such as "Process Hacker" show the exact path of the processes that need get the path an example: ![Example 1 with the "audiodg.exe" process path](https://i.stack.imgur.com/e2KHi.png) ![Example 2 with the "System" process path](https://i.stack.imgur.com/IpmP7.png) For this reason, I think it is possible to get those paths. I apologize for my poor english but I think the point of the question is understood.
How to get the path of "audiodg.exe" Windows 7? VB.NET
CC BY-SA 3.0
0
2011-05-30T06:37:34.350
2014-05-01T09:31:15.917
null
null
744,159
[ "vb.net", "exception", "process", "path" ]
6,173,198
1
6,187,366
null
3
5,793
Here is the result of a profiled simulation run of my MATLAB program. I need to run this simulation (~100,000 times). ![The abnormally slow xlsread](https://i.stack.imgur.com/iuhWw.jpg) Thus I need a faster way to read the Excel file. Specifications: The Excel file is of 10000x2 cells and each simulation run is reading one such sheet each from 5 separate Excel files. I put the xlsread in basic mode and also reduced the number of calls by combining my input into a single file. Next target is xlswrite now. Ah, that sinking feeling. :| ![Updated Profile Summary](https://i.stack.imgur.com/0xb1c.png) Although writing to a [CSV](http://en.wikipedia.org/wiki/Comma-separated_values) file using dlmread is very fast (around 20 times), I need to use the comfort of separate sheets that an .xls file provides.
Slow xlsread in MATLAB
CC BY-SA 3.0
0
2011-05-30T06:58:44.660
2012-06-09T15:51:52.150
2012-06-09T15:51:52.150
97,160
127,212
[ "excel", "matlab", "file-io" ]
6,173,424
1
6,195,784
null
11
2,199
How do I locate the end points of a bridge-like structure in an image? ![Enter image description here](https://i.stack.imgur.com/goVxE.png) I have a set of images that look like what you see on the left hand column as shown in the above picture. What I am trying to detect/locate is actually the two endpoints that are shown on the right hand column in the above picture. It's quite like locating the "two ends points" of the 'bridge'. I have applied some basic morphological operations; however, either I'm doing it wrong or those basic morphological operations aren't working in this scenario. (I have tried making it into skeletons; however, once the skeletons are formed, I can't seem to detect the cross with three edges). ## EDITS Thanks for the previous suggestion; however, it looks like the original sets of images cannot be completely generalized like what I'd previously drawn. I have attached the latest updates to this question. Below is a more detailed representation that includes the original segmented regions and the corresponding images that'd undergone a "thinning" morphological operation. Again, the left side is the originally segmented region; while on the right would be the points to be detected. ![Enter image description here](https://i.stack.imgur.com/lLZIJ.png)
Locating the end points of a bridge-like structure in an image
CC BY-SA 3.0
0
2011-05-30T07:30:06.197
2013-11-04T03:35:47.690
2012-05-28T21:07:55.240
63,550
770,674
[ "algorithm", "image", "language-agnostic", "image-processing" ]
6,173,418
1
null
null
1
585
I want to store some values on a main activity's variable after parsing an xml file from the net, I have the following codes, it runs but then it force closes: ``` private class parseXMLAsync extends AsyncTask <String, String, String>{ protected void onPreExecute(){ super.onPreExecute(); showDialog(PARSE_XML); } @Override protected String doInBackground(String... strings) { try{ Engagia.this.url.openConnection(); SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser sp = spf.newSAXParser(); XMLReader xr = sp.getXMLReader(); ExampleHandler myExampleHandler = new ExampleHandler(); xr.setContentHandler(myExampleHandler); xr.parse(new InputSource(Engagia.this.url.openStream())); List<ParsedExampleDataSet> parsedExampleDataSet = myExampleHandler.getParsedData(); Iterator i; i = parsedExampleDataSet.iterator(); ParsedExampleDataSet dataItem; while(i.hasNext()){ dataItem = (ParsedExampleDataSet) i.next(); String folder = dataItem.getParentTag(); if( folder == "Videos" ){ MainAct.this.videoNames[MainAct.this.videoCount] = dataItem.getName(); MainAct.this.videoCount++; } } }catch(Exception e){ Log.e(LOG_TAG, e.toString()); } return null; } @Override protected void onPostExecute(String lenghtOfFile) { try{ if( mProgressDialog.isShowing() ){ dismissDialog(PARSE_XML); } //String str_contents = null; /* for(String str : MainAct.this.videoNames ){ str_contents = str_contents + str + "\n"; } */ }catch(Exception e){ Log.e(LOG_TAG, e.toString()); } PopIt("Parsing Done", "STR CONTENTS >> " + Engagia.this.videoNames[0], "Denied"); } } ``` The logcat says: ![enter image description here](https://i.stack.imgur.com/L9zcX.jpg)
Android: How to store value in main activity's variable?
CC BY-SA 3.0
null
2011-05-30T07:29:28.883
2013-12-20T07:14:55.307
2013-12-20T07:14:55.307
3,041,194
827,530
[ "java", "android", "xml", "parsing", "android-asynctask" ]
6,173,439
1
6,183,998
null
26
49,357
Would OCR Software be able to reliably translate an image such as the following into a list of values? ![Table of values](https://i.stack.imgur.com/oXvAM.png) In more detail the task is as follows: We have a client application, where the user can open a report. This report contains a table of values. But not every report looks the same - different fonts, different spacing, different colors, maybe the report contains many tables with different number of rows/columns... The user selects an area of the report which contains a table. Using the mouse. Now we want to convert the selected table into values - using our OCR tool. At the time when the user selects the rectangular area I can ask for extra information to help with the OCR process, and ask for confirmation that the values have been correct recognised. It will initially be an experimental project, and therefore most likely with an OpenSource OCR tool - or at least one that does not cost any money for experimental purposes.
Can OCR software reliably read values from a table?
CC BY-SA 3.0
0
2011-05-30T07:31:45.623
2020-10-19T19:28:22.037
2011-05-31T07:41:59.283
144,486
144,486
[ "ocr" ]
6,173,534
1
17,714,865
null
7
2,625
I have a sample managed object model depicted in the image below. What I would like to happen is this: When the object that is the value for the currency relationship in a Bar object is changed, to automatically have that same object be set as the currency relationship in all Foos that are related to that Bar through the foos relationship. ![enter image description here](https://i.stack.imgur.com/flhN4.png) Am I right to understand that this can be done through KVO? My inclination was to start by adding this to the Foo.m: ``` + (NSSet *)keyPathsForValuesAffectingCurrency { return [NSSet setWithObject:@"bar.currency"]; } ``` but I can't figure out if this is right or how I would proceed further. Thanks for any advice.
Core Data: Observing changes in related entities
CC BY-SA 3.0
0
2011-05-30T07:42:12.447
2021-04-22T14:26:13.150
null
null
234,394
[ "objective-c", "ios", "core-data", "key-value-observing" ]
6,173,754
1
6,173,991
null
1
251
I have added an action sheet in my app. My application is tab bar based app. I have added this in this way ``` actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Take photo",@"Use existing photo",nil]; actionSheet.actionSheetStyle = UIBarStyleBlackTranslucent; [actionSheet showFromTabBar:self.view]; ``` But it shows warning: ![enter image description here](https://i.stack.imgur.com/F5xSp.png) How can I remove it. As the same time I am in the tab in which I want to display the action sheet.
Action Sheet warning?
CC BY-SA 3.0
0
2011-05-30T08:06:12.670
2013-12-20T07:12:37.543
2013-12-20T07:12:37.543
3,041,194
489,904
[ "iphone", "ipad", "uiview", "delegates", "uiactionsheet" ]
6,173,898
1
6,187,910
null
1
342
I know we can stretch item to the right or down using ColumnSpan and RowSpan However I got an Item I want to display in grid cell and have it centered according to this cell center, so it will span right and left in case of text, here I provide an image of how it currently looks, "12345" text can't fit the column and is displayed as "234", is there a way to make 1 & 5 visible leaving all columns untouched?![enter image description here](https://i.stack.imgur.com/4l6BT.png) Text can be changed to anything and has to be centered correctly, I can hack a way to display 12345 this way , but need a solution that will work with any text, just in case,and textBlock grid.Column has to be left untouched 1 (or 2 to be precise for my case) , not 0 for this picture case.
Silverlight Grid - display value that doesnt fit its cell
CC BY-SA 3.0
null
2011-05-30T08:22:29.893
2011-06-29T04:21:48.380
2011-06-29T04:21:48.380
236,247
514,382
[ "silverlight", "silverlight-4.0" ]
6,173,985
1
6,174,001
null
167
169,443
I'm trying to filter logcat output from a real device (not an emulator) by tag name but I get all the messages which is quite a spam. I just want to read messages from browser which should be something like "browser:" , but it doesn't work... Here it is what I get: ![actual output](https://i.stack.imgur.com/CJtoX.png)
Filter output in logcat by tagname
CC BY-SA 3.0
0
2011-05-30T08:31:03.200
2018-01-29T17:02:43.133
null
null
465,242
[ "android", "logcat", "android-logcat" ]
6,173,984
1
6,174,030
null
3
8,718
in my app i am using a media player with a seek bar. The seek bar of works along with a surface view. Now my problem is the surface view appears at a corner of my layout which appears to be a black screen. How can i make the surface view to be an invisible. Following is the image of my layout, ![enter image description here](https://i.stack.imgur.com/MyCZb.png)
How can I to make surfaceview invisible in Android?
CC BY-SA 3.0
null
2011-05-30T08:30:58.347
2012-01-15T06:11:50.400
2012-01-15T06:11:50.400
27,727
596,364
[ "android", "surfaceview", "seekbar" ]
6,174,033
1
6,183,558
null
7
7,971
![Matching with nothing in the top right corner](https://i.stack.imgur.com/AizLj.png) I have modified the OpenCV demo application "matching_to_many_images.cpp" to query a image (left) to a frames from the webcam (right). What have gone wrong with the top right corner of the first image? We think this is related to another problem we have. We begin with an empty database and we only add unique (features that not match the features in our database) but after adding only three features, we get a match on all new features.... we are using: SurfFeatureDetector surfFeatureDetector(400,3,4); SurfDescriptorExtractor surfDescriptorExtractor; FlannBasedMatcher flannDescriptorMatcher; Complete code can be found at: [http://www.copypastecode.com/71973/](http://www.copypastecode.com/71973/)
OpenCV 2.2 SURF Feature matching problems
CC BY-SA 3.0
0
2011-05-30T08:37:30.640
2012-02-26T19:07:57.470
2011-11-18T20:53:39.117
13,313
750,082
[ "c++", "opencv", "computer-vision", "surf" ]
6,174,056
1
null
null
2
7,822
See image below ![enter image description here](https://i.stack.imgur.com/u7GKB.jpg) Since 1 account has 1 profile relationship, Why have a profile table? what is the purpose of the profile table, apart from storing the status. Why not include status in the Account table and make a direct relationship from the "account" table to BasicInformation, PersonalInformation etc. [http://i.stack.imgur.com/u7GKB.jpg](https://i.stack.imgur.com/u7GKB.jpg)
Facebook database design...why have a profile table?
CC BY-SA 3.0
null
2011-05-30T08:40:36.663
2011-05-30T14:36:12.783
null
null
103,264
[ "database", "database-design", "relational-database", "entity-relationship", "erd" ]
6,174,375
1
6,174,479
null
2
306
I am a bit stuck implementing a rather simple layout requirement. I want to show an image and below the image a button. The image should be shown as a whole - so it should be scaled down if necessary but it should not be scaled up. Here is what I want: ![mockup](https://i.stack.imgur.com/fgxMY.png) Seems simple but I can't figure out if this is even possible in XAML. Obviously a `Stackpanel` isn't working, neither is a `DockPanel` and I can't see a solution with a `Grid` either. Here is my try with a DockPanel: ``` <DockPanel> <Button DockPanel.Dock="Bottom">Button</Button> <Viewbox Stretch="Uniform" MaxWidth="{Binding ElementName=bigImage, Path=ActualWidth}" MaxHeight="{Binding ElementName=bigImage, Path=ActualHeight}"> <Image x:Name="bigImage"/> </Viewbox> </DockPanel> ``` Obviously the image viewbox will always fill the remaining space so the button will always be at the bottom of the whole container and not at the bottom of the image. Any ideas?
WPF layout: Show button below a scaled down image
CC BY-SA 4.0
null
2011-05-30T09:16:53.010
2019-12-16T05:20:59.857
2019-12-16T05:20:59.857
10,779
10,779
[ "wpf", "layout" ]
6,174,602
1
6,175,912
null
5
6,136
How can I show ms outlook's notification like popup in java swing? is it possible? any other alternative for this? ![enter image description here](https://i.stack.imgur.com/e6vu0.jpg)
How can I show ms outlook's notification like popup in java?
CC BY-SA 3.0
0
2011-05-30T09:40:56.527
2014-04-10T21:33:42.640
null
null
559,070
[ "java", "swing", "popup" ]
6,174,712
1
6,179,311
null
-1
548
At this page : [http://www.facebook.com/monsterfantasy](http://www.facebook.com/monsterfantasy) They have this button as you can see : ![enter image description here](https://i.stack.imgur.com/StAht.png)
How to add custom playnow tab to the application page - Facebook
CC BY-SA 3.0
null
2011-05-30T09:49:17.183
2011-05-30T17:48:23.563
null
null
310,370
[ "facebook", "tabs" ]
6,174,741
1
6,174,888
null
3
1,117
Is it possible (and how) to run eclipse in and not in a ? When I open eclipse, I keep receiving the following error: ``` Eclipse is running in a JRE, but a JDK is required ``` (the error is generated by the m2eclipse plug-in) --- Here's some of the relevant configuration I already have: ![enter image description here](https://i.stack.imgur.com/pP1Wl.jpg) ![enter image description here](https://i.stack.imgur.com/FCYBj.jpg) --- After following rhinds's advice, I split the -vm and path between lines and now I receive the following upon starting eclipse: ![enter image description here](https://i.stack.imgur.com/94kEA.jpg) My configuration is: - - -
Run Eclipse in JDK?
CC BY-SA 3.0
null
2011-05-30T09:52:25.393
2012-01-06T09:53:06.127
2011-05-30T12:32:20.090
348,545
348,545
[ "eclipse", "java" ]
6,174,746
1
6,174,996
null
2
421
I am using gridview and layout inflater to display icon with text. It should look like this: ![enter image description here](https://i.stack.imgur.com/HgB9l.png) My text file contains following data: ``` Profile 0|Profile 1|Profile 2 ``` I am using following code: ``` public View getView(final int position, View convertView, ViewGroup parent) { View v; //String text; final ImageView picturesView; if (convertView == null) { LayoutInflater li = getLayoutInflater(); v = li.inflate(R.layout.icon, null); File sdcard = Environment.getExternalStorageDirectory(); File file = new File(sdcard,"string.txt"); //StringBuilder stext = new StringBuilder(); TextView tv = (TextView)v.findViewById(R.id.icon_text); try { BufferedReader br = new BufferedReader(new FileReader(file)); String line; while ((line = br.readLine()) != null) { String[] columns = line.split("\\|"); for (String name : columns){ tv.setText(name); } //stext.append(line); //stext.append('\n'); } } catch (IOException e) { //You'll need to add proper error handling here } tv.setTextSize(12); tv.setTextColor(Color.BLACK); } else { v = convertView; } } ``` I want to set the text view with the string values ``` TextView tv = (TextView)v.findViewById(R.id.icon_text); tv.setText(); ``` I tried to check the columns length through `Toast.makeText(SDCardImagesActivity.this, ""+columns.length, Toast.LENGTH_LONG).show();` but it is showing 1(5 times) I am confused how to use columns value in tv.setText and whether columns array is correct or not.
How do i retrive text from sdcard and set text view accordingly?
CC BY-SA 4.0
null
2011-05-30T09:52:49.997
2022-04-18T10:36:40.473
2022-04-18T10:36:40.473
1,839,439
146,192
[ "android", "android-gridview" ]
6,175,067
1
6,176,151
null
0
2,933
HI guys, I am trying to implement a horizontal gallery like option in my iPad app. I'v heard that there is an option called "gallery" in Android to do this kind of implementation. But, is there any way in which we can implement this feature in iPad..I am attaching a screen shot to make the question more clear.... () ![enter image description here](https://i.stack.imgur.com/qgdYH.png)
How to implement horizontal gallery in iPhone/iPad
CC BY-SA 3.0
0
2011-05-30T10:22:45.127
2011-06-17T18:25:36.240
2011-05-30T12:05:11.777
541,582
541,582
[ "iphone", "ios", "ipad", "gallery", "uislider" ]
6,175,134
1
6,175,242
null
2
315
This application works as if you were playing the lottery, you pick 5 numbers from a comboBox, click a button to generate the 5 key numbers and then you press another button to check the results (after you introduce the prize monei on the textbox below, AKA "prémio"). ![Main Form](https://i.stack.imgur.com/2pOEU.png) The button that does the checking is the highlighted one . Here's it's code: ``` private void button5_Click(object sender, EventArgs e) { if (textBox1.Text != "" && textBox1.Text!="Prémio em €") { int contador = 0; for (int i = 1; i <= 5; i++) { string posicao = i.ToString(); for (int c = 1; c <= 5; c++) { string poschave = c.ToString(); if (listBox1.Items.IndexOf(posicao) == listBox2.Items.IndexOf(poschave)) { contador = contador + 1; } } i = int.Parse(posicao); double valor; double premio = double.Parse(textBox1.Text); if (contador == 5) { MessageBox.Show(" Parabens ganhou o 1º premio acertou 5 números o seu prémio é de " + premio + "€"); } else { if (contador == 4) { valor = premio * 0.75; MessageBox.Show(" Acertou 4 numeros o seu premio é: " + valor + "€"); } else { if (contador == 3) { valor = premio * 0.5; MessageBox.Show("Acertou 3 numeros o seu premio é: " + valor + "€"); } else if (contador <= 2) { MessageBox.Show(" Infelizmente nao ganhou, nada tente outra vez"); } } } } } } ``` Whatever I do, it always shows the messageBox saying I got all 5 correct... EDIT: listBox1 is the one on the left, (3, 9, 17, 20, 10), you choose them from the combobox and when you Click "Apostar" it is added to it. listBox2 is the box on the right. EDIT2: By replacing ``` for (int c = 1; c <= 5; c++) { string poschave = c.ToString(); if (listBox1.Items.IndexOf(posicao) == listBox2.Items.IndexOf(poschave)) { contador = contador + 1; } } ``` with ``` foreach (var item in listBox1.Items) { // Convert it to string to avoid object reference comparison. Not 100% // sure if this is needed string value = item.ToString(); if (listBox2.Items.Contains(value)) contador++; } ``` The error doesnt show anymore however it still isnt working properly, my guess is that the program is checking if they match, then get the result, therefore it always show "you won nothing" 5 times in a row... How can I fix this?
Checking if both keys match isn't working right
CC BY-SA 3.0
null
2011-05-30T10:29:30.743
2014-06-25T22:30:19.383
2014-06-25T22:30:19.383
881,229
758,111
[ "c#", "visual-studio-2008", "combobox" ]
6,175,179
1
6,175,396
null
0
274
I am new to SSRS and I have developed a few reports running of SSRS in a web frame. Everything is working 100% on my local PC. But now I want to move the reports and the new page to a web server. I managed to get it running on the web server but for some reason I think has to do the config setting on SQL server 2008 SSRS, every time I run the report it asked me to specify a username and password for the datasource. The report run in a web frame, the page was developed in ASP.NET and I pass the paramater selected on the page to the report to generate the report. I will attache an image here to illustrate what I am getting. It is probably something really silly that I am missing. But any help will be greatly appreciated. ![SSRS Error on webpage](https://i.stack.imgur.com/gia89.png)
SSRS - login error
CC BY-SA 3.0
null
2011-05-30T10:34:12.143
2011-05-30T10:58:44.280
null
null
492,201
[ "c#", "asp.net", "ssrs-2008", "reporting-services" ]
6,175,255
1
6,175,321
null
38
11,453
How would you allow a `UIGestureRecognizer` of a `UIView` to receive a touch event but also make sure that another, underlaying/overlaying `UIView` also receives that very same touch event? Lets say I have got the following view-hierachie: ![view hierachie scribble](https://i.stack.imgur.com/BtYpK.jpg) Views A (blue) and B (red) are both subviews of the same superview (gray). In other words, they are both siblings and the order decides on which of them covers the other. Option 1: View B (red) has a regular `UIButton` as its subview. Option 2: View A (blue) has a regular `UIButton` as its subview. Given Option 1 for the sake of explanations: View A (blue) has a `UITapGestureRecognizer` (or maybe even more, other UIGestureRecognizers) attached. What would be the most elegant approach to make sure that the `UIButton` does receive all touches on its region but also the view A (blue) receives those touches on its `UITapGestureRecognizer`? If possible by any means, the solution should not involve extending the `UIButton`-class and manually forwarding any events from the button itself. Imagine view B would contain a lot more controls and not just a button. All of those controls should somehow allow view A to receive the touches on its `UIGestureRecognizer`. I did provide two options as I do not care which of those views (A or B) comes first as long as both receive the touches. All of my approaches so far abruptly reached dead-ends. Maybe a custom responder-chain would be a nice solution? I keep thinking that there must be an elegant solution within the entire `UIKit`/`UIEvent`/`UIResponder` stack.
UIGestureRecognizer receive touch but forward it to UIControl as well
CC BY-SA 3.0
0
2011-05-30T10:43:56.370
2011-05-30T11:22:09.940
null
null
91,282
[ "ios", "uiview", "uigesturerecognizer", "uiresponder", "uievent" ]
6,175,397
1
6,175,432
null
5
19,174
Here is my current MySQL syntax (but this doesn't work): ``` SELECT * FROM posts WHERE userID = $userID AND postBy = $postBy AND postType = 'unread' ``` Here is the picture of my MySQL table (a picture can show more than words!) ![enter image description here](https://i.stack.imgur.com/Kiket.jpg) I want to know if there is any other way of doing it or if I have to forget this idea?
How to use three conditions in WHERE clause of mysql query?
CC BY-SA 3.0
0
2011-05-30T10:58:44.967
2014-01-27T08:27:21.343
2012-12-20T19:33:03.307
367,456
null
[ "php", "mysql" ]
6,175,392
1
6,176,624
null
5
1,353
I have this xaml ``` <Image Width="240" Height="240"> <Image.Source> <DrawingImage> <DrawingImage.Drawing> <DrawingGroup> <DrawingGroup> <DrawingGroup> <DrawingGroup.Transform> <TransformGroup> <RotateTransform Angle="-15" CenterX="120" CenterY="120" /> <TranslateTransform Y="-20" /> </TransformGroup> </DrawingGroup.Transform> <ImageDrawing ImageSource="Images\pNxVK.png" Rect="0,0,240,240" /> </DrawingGroup> <DrawingGroup.ClipGeometry> <EllipseGeometry Center="120,120" RadiusX="60" RadiusY="60" /> </DrawingGroup.ClipGeometry> </DrawingGroup> <DrawingGroup> <DrawingGroup> <!--<DrawingGroup.Transform> <RotateTransform Angle="-15" CenterX="120" CenterY="120" /> </DrawingGroup.Transform>--> <ImageDrawing ImageSource="Images\zUr8D.png" Rect="0,0,240,240" /> </DrawingGroup> <ImageDrawing ImageSource="Images\XPZW9.png" Rect="0,0,240,240" /> </DrawingGroup> </DrawingGroup> </DrawingImage.Drawing> </DrawingImage> </Image.Source> </Image> ``` The result of that xaml is (Correct size) ![enter image description here](https://i.stack.imgur.com/697uv.png) If I uncomment the rotate transform in the xaml above i get this (Wrong size) ![enter image description here](https://i.stack.imgur.com/ihrul.png)
Rotate also resizes?
CC BY-SA 3.0
null
2011-05-30T10:58:37.073
2011-05-30T13:40:34.203
2011-05-30T13:40:34.203
38,256
548,048
[ "wpf", "xaml", "rotatetransform" ]
6,175,637
1
6,176,081
null
1
117
I have List of objects from MyClassForDatatable class, where ``` public class MyClassForDatatable public String PropertyA public String PropertyB public String PropertyC public String PropertyD //getters and setters ... ``` Is it possible to create a Datatable like: ![Datatable Example Image](https://i.stack.imgur.com/ggpTE.jpg) instead of the usual way: ![Datatable Example Image](https://i.stack.imgur.com/khWud.jpg)
JSF Datatable Alingnement
CC BY-SA 3.0
null
2011-05-30T11:22:55.363
2011-05-30T15:50:19.223
null
null
565,605
[ "java", "jsf", "datatable", "jsf-2" ]
6,175,928
1
6,227,513
null
0
519
Am having trouble getting the Atom feed function to work on my blog. I am using the Kaminari plug-in to paginate my articles - 6 per page. With the code below, when a user clicks on the RSS Feed image they are asked to log-in instead of subscribing to the feed! Any help would be appreciated with this issue... ![screenshot](https://i.stack.imgur.com/mQuwl.png) <%= auto_discovery_link_tag(:atom, feed_path, { :title => "My ATOM Feed" }) %> <%= image_tag("feed.png", {:alt => 'Atom feed', :class=>"feed"}) %>Subscribe ``` match '/feed' => 'articles#feed', :as => :feed, :defaults => { :format => 'atom' } ``` ``` class ArticlesController < ApplicationController before_filter :authenticate_user!, :except => [:index, :show] # GET /articles # GET /articles.xml # display articles on the home page def index @articles = Article.published.page(params[:page]).per(6).ordered respond_to do |format| format.html # index.html.erb format.xml { render :xml => @articles } format.atom { render :atom => @articles } end end # GET /articles/1 # GET /articles/1.xml def show @article = Article.find(params[:id]) @comment = Comment.new(:article=>@article) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @article } end end # GET /articles/new # GET /articles/new.xml def new @article = Article.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @article } end end # GET /articles/1/edit def edit @article = Article.find(params[:id]) authorize! :edit, @article end # POST /articles # POST /articles.xml def create #authorize! :create, @article @article = Article.new(params[:article]) @article.user_id = current_user.id respond_to do |format| if @article.save format.html { redirect_to(@article, :notice => 'Worry was successfully created.') } format.xml { render :xml => @article, :status => :created, :location => @article } else format.html { render :action => "new" } format.xml { render :xml => @article.errors, :status => :unprocessable_entity } end end end # PUT /articles/1 # PUT /articles/1.xml def update @article = Article.find(params[:id]) authorize! :update, @article respond_to do |format| if @article.update_attributes(params[:article]) format.html { redirect_to(@article, :notice => 'Worry was successfully updated.') } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @article.errors, :status => :unprocessable_entity } end end end # DELETE /articles/1 # DELETE /articles/1.xml def destroy @article = Article.find(params[:id]) authorize! :destroy, @article @article.destroy respond_to do |format| format.html { redirect_to(articles_url) } format.xml { head :ok } end end end ``` ``` atom_feed :language => 'en-US' do |feed| feed.title "mysite.com" feed.updated(@articles.blank? ? Time.now : @articles.first.created_at) @articles.each do |article| feed.entry article, :published => article.accepted do |entry| entry.title article.title entry.author do |author| author.name article.user.fullname end end end end ```
Rails 3 - Atom Feed Help Needed?
CC BY-SA 3.0
null
2011-05-30T11:52:03.777
2011-06-03T13:11:36.050
2011-06-03T12:47:07.150
372,237
372,237
[ "ruby-on-rails-3" ]
6,175,944
1
null
null
3
10,096
hi i have a jtable with checkbox in column and column header problem is if i click on the first column header, the first column header is select and the the second one ``` String[] columnNames = {"Am", "Pm", "Integer", "String"}; Object[][] data = {{true, true, 1, "BBB"}, {false, true, 12, "AAA"}, {true, false, 2, "DDD"}, {false, false, 5, "CCC"}, {true, true, 3, "EEE"}, {false, false, 6, "GGG"}, {true, true, 4, "FFF"}, {false, false, 7, "HHH"}}; DefaultTableModel model = new DefaultTableModel(data, columnNames) { @Override public Class<?> getColumnClass(int column) { return getValueAt(0, column).getClass(); } }; JTable table = new JTable(model); table.getColumnModel().getColumn(0).setHeaderRenderer( new HeaderRenderer2(table.getTableHeader())); table.getColumnModel().getColumn(1).setHeaderRenderer( new HeaderRenderer2(table.getTableHeader())); ``` i created a table cell renderer ``` public class HeaderRenderer2 implements TableCellRenderer { private final JCheckBox check = new JCheckBox(); public HeaderRenderer2(JTableHeader header) { check.setOpaque(false); check.setFont(header.getFont()); header.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { JTable table = ((JTableHeader) e.getSource()).getTable(); TableColumnModel columnModel = table.getColumnModel(); int viewColumn = columnModel.getColumnIndexAtX(e.getX()); int modelColumn = table.convertColumnIndexToModel(viewColumn); if (modelColumn == 0) { check.setSelected(!check.isSelected()); TableModel m = table.getModel(); Boolean f = check.isSelected(); for (int i = 0; i < m.getRowCount(); i++) { m.setValueAt(f, i, 0); } ((JTableHeader) e.getSource()).repaint(); } } }); } @Override public Component getTableCellRendererComponent( JTable tbl, Object val, boolean isS, boolean hasF, int row, int col) { TableCellRenderer r = tbl.getTableHeader().getDefaultRenderer(); JLabel l = (JLabel) r.getTableCellRendererComponent(tbl, val, isS, hasF, row, col); l.setIcon(new CheckBoxIcon(check)); return l; } private static class CheckBoxIcon implements Icon { private final JCheckBox check; public CheckBoxIcon(JCheckBox check) { this.check = check; } @Override public int getIconWidth() { return check.getPreferredSize().width; } @Override public int getIconHeight() { return check.getPreferredSize().height; } @Override public void paintIcon(Component c, Graphics g, int x, int y) { SwingUtilities.paintComponent( g, check, (Container) c, x, y, getIconWidth(), getIconHeight()); } } } ``` image at the top nothing selected![problem displayed](https://i.stack.imgur.com/jrZwr.png) image at the bottom after a click on the column header (AM) getTableCellRendererComponent happen before the mouseClicked event so i'm not able to get the clicked column any idea?
event for check box in jtable header
CC BY-SA 3.0
0
2011-05-30T11:54:20.430
2014-06-06T16:28:33.023
null
null
660,503
[ "java", "swing", "checkbox", "jtable", "jtableheader" ]
6,176,084
1
6,178,551
null
1
2,917
I am totally new in building Visual Studio Project through a script, so feel free to correct me if you feel that my understanding about the process is incorrect. I have a visual studio solution which consists of a Wpf.exe project and few class library projects. Currently I am successfully building `.sln` file using script below `"%VS_IDE_DIR%devenv.com" "...Solution-File-Path.sln" /rebuild Release /useenv` Currently the `Wpf.exe` file gets the `File Version` and `Product Version` `1.0.0.0` which is the default specified in `Publish -> Publish Version` Property of Wpf project. ![enter image description here](https://i.stack.imgur.com/CCztA.jpg) I want to somehow set the `File Version` and `Product Version` through my script. How can I achieve that? I have an `environment variable` which contains the `Product Version` and `File Version`, Basically I want to set value of Product Version and File Version equal to my environment variable.
How to specify Publish Version in Devenv?
CC BY-SA 3.0
null
2011-05-30T12:07:22.980
2011-05-30T16:16:26.237
null
null
421,611
[ "c#", "build", "devenv", "version-numbering" ]
6,176,119
1
null
null
0
331
![Screenshot](https://i.stack.imgur.com/Stnta.jpg) Hi , I am creating a box which has few buttons in it. When I am executing it a weired recatangualr box is coming which denotes it's default selection. I want to remove it.Can some one please help me. Below is the snapshot of my code: ``` JPanel buttons = new JPanel(); buttons.add(Box.createHorizontalGlue()); buttons.add(NCDEX); buttons.add(Box.createHorizontalGlue()); buttons.add(MCX); ``` Attached screenshot for reference.I want to remvoe the recatngular box surrounding the button named NCDEX
JRemove default selection in JButton
CC BY-SA 3.0
null
2011-05-30T12:10:25.403
2011-05-30T12:41:27.483
2011-05-30T12:28:59.013
151,525
151,525
[ "java", "swing" ]
6,176,227
1
6,177,788
null
6
4,679
Given an irregular polygon and a point within that polygon, how do I determine which edge in the polygon is closest to the point? ![Example](https://i.stack.imgur.com/3bt3B.png) I will likely have to run this calculation for a large set of points within the polygon (e.g. 50-200 points).
For a point in an irregular polygon, what is the most efficient way to select the edge closest to the point?
CC BY-SA 3.0
0
2011-05-30T12:20:50.637
2016-11-20T21:30:38.873
2011-05-30T12:21:47.987
21,234
98,389
[ "geometry", "computational-geometry" ]
6,176,380
1
6,176,458
null
1
339
Related to this question: [Memory leak tool tells me zero leaks but memory footprint keeps rising](https://stackoverflow.com/questions/2339279/memory-leak-tool-tells-me-zero-leaks-but-memory-footprint-keeps-rising) I also have a rising memory-footprint, but I don't allocate images, and more importantly, I don't do anything in the background. There's just a UIWebView on the screen, showing a JavaScript-free page. Here are two screenshots from the profiling instrument, one is 10 minutes after the other, with zero interaction and zero background activity: ![Two minutes after start](https://i.stack.imgur.com/sDoJ7.png) ![Twelve minutes after start](https://i.stack.imgur.com/Fomou.png) (NOTE: If I set the Allocation Lifespan radio button on the left on another value, it does no difference. The live bytes have rising by about 6MB within 10 minutes.) Now my question: Is this an instruments-bug? Or is the WebView allocating more and more memory? Or do you think it's impossible and that I must have gotten something wrong here?
Objective-C Cocoa-Touch WebView Memory Allocation doesn't stop rising
CC BY-SA 3.0
null
2011-05-30T12:37:24.927
2011-05-30T12:45:22.210
2017-05-23T12:07:02.087
-1
258,539
[ "objective-c", "cocoa-touch", "uiwebview", "memory-management" ]
6,176,485
1
6,176,642
null
5
13,907
I need list or enumerate of existing serial ports, Till now I was using this method , but its not working with windows 7. Do you know some alternative how can I find out available serial ports under windows 7? ``` def enumerate_serial_ports(): """ Uses the Win32 registry to return an iterator of serial (COM) ports existing on this computer. """ path = 'HARDWARE\\DEVICEMAP\\SERIALCOMM' try: key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, path) except WindowsError: raise IterationError for i in itertools.count(): try: val = winreg.EnumValue(key, i) yield str(val[1]) except EnvironmentError: break ``` I get IterationError ![enter image description here](https://i.stack.imgur.com/WOb5h.jpg)
pyserial enumerate ports
CC BY-SA 3.0
0
2011-05-30T12:47:42.140
2016-06-14T15:26:16.267
2013-06-04T06:36:05.057
55,129
55,129
[ "python", "pyserial" ]
6,177,294
1
null
null
35
17,298
I'm trying to concatenate several strings containing both arabic and western characters (mixed in the same string). The problem is that the result is a String that is, most likely, semantically correct, but different from what I want to obtain, because the order of the characters is altered by the Unicode Bidirectional Algorithm. Basically, I just want to concatenate as if they were all LTR, ignoring the fact that some are RTL, a sort of "agnostic" concatenation. I'm not sure if I was clear in my explanation, but I don't think I can do it any better. Hope someone can help me. Kind regards, Carlos Ferreira BTW, the strings are being obtained from the database. ![enter image description here](https://i.stack.imgur.com/dwBWZ.png) The first 2 Strings are the strings I want to concatenate and the third is the result. Actually, the concatenated String is a little different from the one in the image, it got altered during the copy+paste, the 1 is after the first A and not immediately before the second A.
String concatenation containing Arabic and Western characters
CC BY-SA 3.0
0
2011-05-30T14:03:39.933
2012-09-11T20:22:34.840
2011-05-30T14:36:35.253
496,544
496,544
[ "java", "string", "internationalization", "arabic" ]
6,177,321
1
null
null
0
606
![Hex editor](https://i.stack.imgur.com/Hu5dm.png) Address 1D indicates the image is eight bits per pixel, but it isn't, each pixel is represented by 3 bytes (24 bits). At first, I thought photoshop did this in error, but I found that this format was used for all greyscale images. Instead of using four bytes for pixel, why don't .bmp images use a value from 0 - FF to describe the greyscale value of each pixel? [from Wikipedia](http://en.wikipedia.org/wiki/.bmp) > The 8-bit per pixel (8bpp) format supports 256 distinct colors and stores 1 pixel per 1 byte.Each byte is an index into a table of up to 256 colors. This Color Table is in 32bpp 8.8.8.0.8 RGBAX format. The color table shown in the hex editor is four bytes per pixel. Far below that is the actual pixel array, which is 8 bits per pixel. ![the actual pixel array](https://i.stack.imgur.com/939tu.png) I figured that out by a calculation, the image is 64 x 64, 4096 pixels. The pixel array starts at 436, and ends at 1437. In decimal, the difference between those two numbers is 4097, so the pixel array is exactly one byte per pixel.
Why is the bpp information at 0x1C in this .bmp image wrong?
CC BY-SA 3.0
null
2011-05-30T14:05:50.487
2011-06-12T17:28:01.407
2020-06-20T09:12:55.060
-1
355,912
[ "colors", "bmp", "8-bit", "bpp" ]
6,177,341
1
6,177,445
null
-1
133
I am trying to create an round corner with an image. But I get get on top of the other images. My code: ``` <div style="width:468;height:60; border:1px solid #cccccc;border-right:none;position:relative;"> <span style="background: url("../images/showkontopleft.png") no-repeat scroll 0% 0% transparent; width: 5px; height: 5px; top: 0pt; left: 0pt; display: block;"></span> <a target="_blank" href="/link/8" style="float:left;display:inline;"> <img style="width: 468px; height: 60px; border: 0pt none; display: block;" src="http://dk.orvillemedia.com/ads/banners/514/468x60.jpg" alt="468x60"> </a> </div> ``` Problem: ![enter image description here](https://i.stack.imgur.com/eMYR5.png)
Html CSS round corner help stacking elements
CC BY-SA 3.0
null
2011-05-30T14:08:16.643
2011-05-30T14:30:36.140
2011-05-30T14:25:57.007
468,793
557,527
[ "html", "css" ]
6,177,550
1
6,178,813
null
28
7,484
Im having a problem rendering icons for a dynamic menu which uses viewmodels as an ItemsSource. The solution I've used is outlined here [MVVM Dynamic Menu UI from binding with ViewModel](https://stackoverflow.com/questions/1392160/mvvm-dynamic-menu-ui-from-binding-with-viewmodel/4816588#4816588) The basic layout is as follows ``` <Grid> <Grid.Resources> <HierarchicalDataTemplate DataType="{x:Type ViewModels:HeaderedItemViewModel}" ItemsSource="{Binding Path=Children}"> <ContentPresenter RecognizesAccessKey="True"></ContentPresenter> </HierarchicalDataTemplate> <Style TargetType="{x:Type MenuItem}"> <Setter Property="Header" Value="{Binding Path=Header}" /> <Setter Property="InputGestureText" Value="{Binding Path=InputGestureText}" /> <Setter Property="Command" Value="{Binding Path=Command}" /> <Setter Property="Icon"> <Setter.Value> <Image Source="{Binding Path=Icon}" Height="16px" Width="16px" /> </Setter.Value> </Setter> </Style> </Grid.Resources> <Menu Grid.Row="0" ItemsSource="{Binding Path=Shell.Navigation.Menus}" /> </Grid> ``` In the above style the binding 'Icon' is 'ImageSource'. This is set up as follows. ``` BitmapImage image = null; if (!string.IsNullOrEmpty(imagePath)) { image = new BitmapImage(new Uri(imagePath, UriKind.Relative)); image.CacheOption = BitmapCacheOption.OnLoad; image.CreateOptions = BitmapCreateOptions.IgnoreImageCache; } var menu = new HeaderedItemViewModel { Header = header, InputGestureText = inputGesture, ImagePath = imagePath, Icon = image, Command = command, IsEnabled = isEnabled }; ``` The problem I'm having is with the icons. It seems only one icon will render at a time? Heres what I mean. ![enter image description here](https://i.stack.imgur.com/Twn2n.png) And opening the dropdown menu ... ![enter image description here](https://i.stack.imgur.com/Hok3a.png) As soon as another image is rendered the first one disappears? In other words only the last image is visible. This happens with all the images in the menu. Any ideas?
MenuItem style with icon creates only one icon
CC BY-SA 3.0
0
2011-05-30T14:30:51.517
2020-12-14T16:02:41.253
2017-05-23T12:10:12.657
-1
99,804
[ "wpf", "mvvm" ]
6,177,851
1
6,237,827
null
21
5,262
I would like to use Eclipse as IDE for a Scala web application using [Play Framework](http://scala.playframework.org/). I downloaded Eclipse 3.6.2. Then I installed [Scala IDE 2.0 (beta) for Eclipse](http://www.scala-ide.org/). I downloaded [Play Framework 1.2.2RC1](http://www.playframework.org/download) and installed the [Scala Module](http://scala.playframework.org/) using `play install scala-0.9.1` and generated a new site with `play new mysite`. Then I eclipsified it with `play eclipsify mysite` and imported the project in Eclipse. But now I get many errors in Eclipse. Is this anything I can fix or are the different projects incompatible? This is the generated code that contains errors in Eclipse (but it works when I run the application). ``` package controllers import play._ import play.mvc._ object Application extends Controller { import views.Application._ def index = { html.index("Your Scala application is ready to go home!") } } ``` And this is how it looks like in Eclipse:![Scala Play application in Eclipse](https://i.stack.imgur.com/N5OtB.png)
Errors in Eclipse for Scala project generated by Play Framework
CC BY-SA 3.0
0
2011-05-30T14:57:53.393
2012-08-31T09:27:07.793
null
null
213,269
[ "eclipse", "scala", "playframework", "scala-ide" ]
6,177,870
1
6,177,947
null
0
147
I have an array to store a set of coordinates for painting a piece of line. So here are some example coordinates ``` double[][] plotMatrix = {{10,20},{55,80}, {120,40},{225,30}, {327.5,100}, {427.5,30}, {529,60}}; ``` The next step is to create a markov matrix which is two-dimensional. ![enter image description here](https://i.stack.imgur.com/DpPR6.png) First I count the times where a point from the left column is followed by a point in the top column. Since I want a line each point is followed by another single point. That means if we have {10,20} as input the propability of {55,80} being the next point is 100%. I am not really sure about all this so please correct me! So this is my matrix ``` double[][] markovMatrix = { {0.0,1.0,0.0,0.0,0.0,0.0,0.0}, {0.0,0.0,1.0,0.0,0.0,0.0,0.0}, {0.0,0.0,0.0,1.0,0.0,0.0,0.0}, {0.0,0.0,0.0,0.0,1.0,0.0,0.0}, {0.0,0.0,0.0,0.0,0.0,1.0,0.0}, {0.0,0.0,0.0,0.0,0.0,0.0,1.0}, {0.0,0.0,0.0,0.0,0.0,0.0,0.0}}; ``` My algorithm: ``` int seed = 0; int output = 0; for(int i = 0; i < 40;i++){ double choice = r.nextDouble(); double currentSum = 0.0; for(;output < markovMatrix.length;output++){ currentSum += markovMatrix[seed][output]; if(choice <= currentSum){ break; } } System.out.println(output); polygon.lineTo(plotMatrix[output][0], plotMatrix[output][1]); seed = output; output = 0; } ``` My problem is that I get an `ArrayOutOfBoundsException:7` when I try to access both plotMatrix and markovMatrix. However output is set to 0 at the end of each loop. Any ideas how to solve that problem?
Getting an ArrayIndexOutOfBoundsException when working with markov chains
CC BY-SA 3.0
0
2011-05-30T14:59:04.500
2011-05-30T15:15:22.937
null
null
401,025
[ "java", "arrays", "algorithm", "markov-chains" ]
6,178,052
1
null
null
1
1,398
![enter image description here](https://i.stack.imgur.com/9N0x1.jpg) Here I have a column name "Status" in which I am using `ComboBox` whose values are "Pending" and "Delivered" now I want that when a user selects the delivered from the ComboBox then the entire row or this control should be disabled so user could not change it again and by default its value should be "Pending" how can i do it? Is it possible to disable a single row in gridview?
How to disable a row by selecting value from comboBox in datagridview?
CC BY-SA 3.0
null
2011-05-30T15:19:11.647
2011-05-30T16:22:54.147
2011-05-30T16:19:12.987
723,763
709,458
[ "c#", "gridview" ]
6,178,236
1
6,178,374
null
2
1,072
Iam using a custom layer for drawing on my `UIView`. And to invalidate and update the layer I need to set my view to be the delegate of my `CALayer`. When this is done it draws my text correctly when the view receives touches the app crashes. What I am a doing wrong? ``` - (void) layoutSubView { if (drawLayer == nil) { drawLayer = [[CALayer alloc] init]; [drawLayer setDelegate:self]; [[self layer] addSublayer:drawLayer]; } [drawLayer setFrame:[self bounds]]; [drawLayer setNeedsDisplay]; } ``` Above is my code to setup the CALayer, and below is the overridden drawLayer method. ``` - (void) drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx { if (layer == drawLayer) { UIGraphicsPushContext(ctx); [self drawTitle:ctx]; UIGraphicsPopContext(); } } ``` Here is the stack. ![enter image description here](https://i.stack.imgur.com/OGNTL.png)
CALayer/UIView crashes when I touch the UIVIew
CC BY-SA 3.0
0
2011-05-30T15:39:36.493
2011-05-30T15:56:21.087
2020-06-20T09:12:55.060
-1
591,137
[ "iphone", "xcode", "uiview", "calayer", "stack-trace" ]
6,178,371
1
null
null
0
148
What is the best way to make a page with `DIV`s that have different positions? Here is an example: ![Page with DIVs having different positions.](https://i.stack.imgur.com/R1INH.png)
question about css and html
CC BY-SA 3.0
null
2011-05-30T15:55:49.963
2011-05-30T16:15:24.007
2011-05-30T16:03:11.880
489,560
290,082
[ "html", "css" ]
6,178,699
1
6,179,908
null
1
567
Does anyone know how can I remove this gradient highlighted in red? I'm using the theme Light.NoTitleBar". ![With Gradient](https://i.stack.imgur.com/hnj7T.png)
Remove Gradient at Android Bar Control
CC BY-SA 3.0
0
2011-05-30T16:33:35.013
2011-05-30T19:08:05.033
null
null
564,416
[ "android", "user-interface" ]
6,178,763
1
6,179,288
null
22
20,077
I want to make the following graph in R: ![enter image description here](https://i.stack.imgur.com/gOnIQ.gif) How can I plot those horizontal braces?
How to add braces to a graph?
CC BY-SA 3.0
0
2011-05-30T16:41:14.950
2021-05-30T09:03:55.340
null
null
732,822
[ "r", "graph" ]
6,178,879
1
6,178,966
null
0
276
I'm creating a video editing program with QTKit. There is a sample program provided by apple here, [http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/QTKitApplicationTutorial/CreatingaQTKitStoporStillMotionApplication/CreatingaQTKitStoporStillMotionApplication.html](http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/QTKitApplicationTutorial/CreatingaQTKitStoporStillMotionApplication/CreatingaQTKitStoporStillMotionApplication.html) My test program is based on this program, but use QTMovie *movie = [[[QTMovie alloc] initToWritableFile:@"foo.mov" error:nil] autorelease]; and [movie updateMovieFile]; for saving memories. If there are not so many frames, the program runs well. But with so many frames, the program begins to show `QTKitServer(5618,0xa0924540) malloc: *** mmap(size=33554432) failed (error code=12) *** error: can't allocate region *** set a breakpoint in malloc_error_break to debug` I checked memory leaks with Instruments, ![enter image description here](https://i.stack.imgur.com/iErhb.png) but Live Bytes are not so big and found no memory leaks. Overall Bytes is really big but is this a reason of this problem? Any ideas will be appreciated. Thanks,
Overall memory bytes limited?
CC BY-SA 3.0
null
2011-05-30T16:55:00.480
2011-05-30T17:03:15.003
null
null
47,986
[ "quicktime", "qtkit" ]
6,178,907
1
6,179,069
null
1
1,162
I've got following 9patch, which I got thanks to nice people who answered my previous question: ![enter image description here](https://i.stack.imgur.com/5R0mh.png) I use it for background in relative layout and TextView and got following. Thats for RelativeLayout: ``` <RelativeLayout android:id="@+id/relativeHeader" android:layout_width="fill_parent" android:layout_height="60dp" android:orientation="horizontal" android: background="@drawable/cap_stack"> ``` ![enter image description here](https://i.stack.imgur.com/BR2h0.png) And for TextView: ``` <TextView android:paddingTop="5dp" android:gravity="center_vertical" android:layout_width="fill_parent" android:layout_height="22dp" android:background="@drawable/cap_stack" android:textStyle="bold" android:textColor="#FFFFFF"/> ``` ![enter image description here](https://i.stack.imgur.com/EWvgx.png) As you can see, I got 1px wide line visible in both cases. And in case of TextView text is not placed in the center vertical. How can I fix it(is it drawable problem or xml)? Will appreciate any help
9patch drawable 1px black line visible & content positioning
CC BY-SA 3.0
0
2011-05-30T16:57:26.500
2011-05-30T18:39:50.217
2020-06-20T09:12:55.060
-1
null
[ "android", "android-layout" ]
6,178,983
1
null
null
0
6,750
I am trying to add data into 3 table using PHP, atm I can only view the results of the tables that are joined . ``` $sql = mysql_query("SELECT PART_ID, PART_DESC, SERIAL_NUM, PART.RACK_NUM, PART.PART_TYPE_ID, PART_TYPE_DESC, LOCATION FROM PART INNER JOIN PART_TYPE ON PART.PART_TYPE_ID = PART_TYPE.PART_TYPE_ID INNER JOIN RACK ON RACK.RACK_NUM = PART.RACK_NUM ``` This will get all the rows from the PART table, and for each of the rows we find, match that row to a row in the PART_TYPE table (the condition being that they have the same PART_TYPE_ID). If no match between the PART and PART_TYPE tables can be found for a given row in the PART table, that row will not be included in the result. How do I add the data to the PART_ID, PART_TYPE and RACK tables? ``` <?php // Parse the form data and add inventory item to the system if (isset($_POST['PART_ID'])) { $id = mysql_real_escape_string($_POST['PART_ID']); $PART_DESC = mysql_real_escape_string($_POST['PART_DESC']); $SERIAL_NUM = mysql_real_escape_string($_POST['SERIAL_NUM']); $RACK_NUM = mysql_real_escape_string($_POST['RACK_NUM']); $PART_TYPE_ID = mysql_real_escape_string($_POST['PART_TYPE_ID']); $LOCATION = mysql_real_escape_string($_POST['LOCATION']); $PART_TYPE_DESC = mysql_real_escape_string($_POST['PART_TYPE_DESC']); // See if that product name is an identical match to another product in the system $sql = mysql_query("SELECT PART_ID FROM PART WHERE PART_ID='$id' LIMIT 1"); $productMatch = mysql_num_rows($sql); // count the output amount if ($productMatch > 0) { echo 'Sorry you tried to place a duplicate "Product Name" into the system, <a href="inventory_list.php">click here</a>'; exit(); } // Add this product into the database now **$sql = mysql_query("INSERT INTO PART (PART_ID, PART_DESC, SERIAL_NUM, RACK_NUM, PART_TYPE_ID) VALUES('$id','$PART_DESC','$SERIAL_NUM','$RACK_NUM','$PART_TYPE_ID')") or die (mysql_error());** header("location: inventory_list.php"); exit(); } ?> ``` ![enter image description here](https://i.stack.imgur.com/jr1bn.jpg)
PHP/ MYSQL Inserting Data Into Multiple Tables
CC BY-SA 3.0
0
2011-05-30T17:05:08.963
2014-03-10T22:39:45.457
2011-05-30T17:23:43.877
327,073
327,073
[ "php", "mysql" ]
6,179,105
1
null
null
0
227
I've been getting this random crash, in which I don't know how to reproduce again. It happens when I was browsing/using the apps for some time, switching views here and there and I got this: ![enter image description here](https://i.stack.imgur.com/UWFCx.png) First of all I don't know which UIImage is this crash referring to. I do have a crash report, but I don't know how to read it. I would like to reproduce the error, but I don't know how to.. it seems that it's quite random. Can someone help me out in debugging this?
autorelease and retain causes message sent to deallocated message
CC BY-SA 3.0
null
2011-05-30T17:21:06.240
2011-05-30T17:42:00.547
null
null
95,265
[ "iphone", "objective-c" ]
6,179,142
1
6,179,256
null
-3
466
It seems everything in back of the camera get's inverted back or something: ![current screenshot](https://i.stack.imgur.com/HiszE.png) This is the original model: ![original model](https://i.stack.imgur.com/y1h12.png) So the camera is in the right opening of the "frame". Here's the depth calculation (I think the problem is here): ``` function 3dto2d(x, y, z) { var scale = cameradistance / (cameradistance - z); return { 'x' : x * scale, 'y' : y * scale }; } ``` Does someone know this problem? ``` function 3dto2d(x, y, z) { var scale = cameradistance / (cameradistance - (z >= cameradistance ? cameradistance - 1 : z)); return { 'x' : x * scale, 'y' : y * scale }; } ```
Projecting a 3D point to a 2D point makes things get inverted
CC BY-SA 3.0
null
2011-05-30T17:27:19.947
2012-02-11T21:27:10.630
2011-09-30T11:10:09.933
514,749
502,236
[ "javascript", "3d", "projection", "html5-canvas" ]
6,179,206
1
6,179,226
null
3
917
I just stumbled across this guys site: [http://mantia.me/](http://mantia.me/) He has an awesome logo that reacts to the content the site is currently showing, if you wait on his homepage the logo changes with the slide show of images. I was wondering if anyone knows how to replicate the effect. I'm guessing it's a transparent png with a rotating master background then the site is layered on top, but I'm probably wrong. Any guesses on how to make something similiar? Images:![enter image description here](https://i.stack.imgur.com/5Jlxm.png) ![enter image description here](https://i.stack.imgur.com/6RbAO.png)
Transparent PNG Reacting to Sites Image Sliders and Content
CC BY-SA 3.0
null
2011-05-30T17:35:53.547
2011-08-25T09:40:16.740
2011-08-25T09:40:16.740
468,793
776,590
[ "javascript", "css", "slideshow", "transparent", "graphical-logo" ]
6,179,174
1
null
null
3
797
The slider should function nice and smooth. Instead the animation isn't working smoothly. Here are the HTML, CSS and Javascript. I looked and looked and looked and can't find the clue. Rotating is not smooth, caption does not match the image, the last image doesn't even appear. (Here is the [actual demo](http://www.sohtanaka.com/web-design/examples/image-slider)). Here are some sample images showing a bit of the problem: ![enter image description here](https://i.stack.imgur.com/3mO6o.png) ![enter image description here](https://i.stack.imgur.com/rdxeT.png) ``` <IMG ID="slideshowPicturePlaceholder" src="/_layouts/images/GEARS_AN.GIF" style="display:none"/> <div id="slideshowContentArea" style="display:none; width:255px;"> <div class="main_view"> <div class="window"> <div class="image_reel"> </div> </div> <div class="paging"> <a href="#" rel="1">1</a> <a href="#" rel="2">2</a> <a href="#" rel="3">3</a> <a href="#" rel="4">4</a> </div> </div> </div> <style type="text/css"> /*--Main Container--*/ .main_view { float: left; position: relative; } /*--Window/Masking Styles--*/ .window { height: 286px; width: 790px; overflow: hidden; /*--Hides anything outside of the set width/height--*/ position: relative; } .image_reel { position: absolute; top: 0; left: 0; } .image_reel img {float: left;} /*--Paging Styles--*/ .paging { position: absolute; bottom: 40px; right: -7px; width: 178px; height:47px; z-index: 100; /*--Assures the paging stays on the top layer--*/ text-align: center; line-height: 40px; background: url(paging_bg2.png) no-repeat; display: none; /*--Hidden by default, will be later shown with jQuery--*/ } .paging a { padding: 5px; text-decoration: none; color: #fff; } .paging a.active { font-weight: bold; background: #920000; border: 1px solid #610000; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; } .paging a:hover {font-weight: bold;} </style> <script type="text/javascript" src="_layouts/jquery/jquery-1.6.1.min.js"></script> <script type="text/javascript" src="_layouts/jquery/jquery.cycle.all.js"></script> <script type="text/javascript"> $(document).ready(function() { function GetAllImages() { $("#slideshowPicturePlaceholder").css("display", "block"); var soapEnv = "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'><soapenv:Body><GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'>"; soapEnv += "<listName>NewsRotator</listName>"; soapEnv += "<query><Query><OrderBy Override='TRUE'><FieldRef Name='Created' Ascending='FALSE' /></OrderBy></Query></query>"; soapEnv += "<viewFields><ViewFields><FieldRef Name='Title'/><FieldRef Name='ows_FileLeafRef'/><FieldRef Name='NewsLink'/><FieldRef Name='Description'/></ViewFields></viewFields><rowLimit></rowLimit>"; soapEnv += "</GetListItems></soapenv:Body></soapenv:Envelope>"; var port = window.location.port; if (port.length <= 0) port = ""; else port = ":" + port; var webservice = window.location.protocol + "//" + window.location.hostname + port + L_Menu_BaseUrl + "/_vti_bin/lists.asmx"; $.ajax( { url : webservice, type : "POST", dataType : "xml", data : soapEnv, complete : processQueryResults, contentType : "text/xml; charset=utf-8", error : function (xhr) { alert('Error! Status = ' + xhr.status); } }); } function processQueryResults(xData, status) { var port = window.location.port; if (port.length <= 0) port = ""; else port = ":" + port; // Change the below to point to your image library var imageURL = window.location.protocol + "//" + window.location.hostname + port + L_Menu_BaseUrl + "/Splash Image Rotator/"; var itemURL = window.location.protocol + "//" + window.location.hostname + port + L_Menu_BaseUrl + "/Splash Image Rotator/Forms/DispForm.aspx?ID="; // $("#slideshowContentArea").html("") $(xData.responseXML).find("z\\:row").each(function () { var title = $(this).attr("ows_Title"); var headlines = $(this).attr("ows_Description"); var imageLink = imageURL + $(this).attr("ows_FileLeafRef").substring($(this).attr("ows_FileLeafRef").indexOf('#') + 1); // // var itemLink = itemURL + $(this).attr("ows_ID"); var itemLink = $(this).attr("ows_NewsLink"); //var liHtml = "<div><a href='" + itemLink + "' target='_blank'><img src='" + imageLink + "'/></a></div>"; //var liHtml ="<a target='_blank' border='0' href='"+itemLink+"'><img src='"+ imageLink +"'/></a>"; var liHtml = "<a href='"+itemLink+"' target='_blank' border='0'><img src='" + imageLink +"'/></a><p>"+ title + " - " + headlines + "</p>"; $(".image_reel").append(liHtml); }); $("#slideshowPicturePlaceholder").css("display", "none"); $("#slideshowContentArea").css("display", "block"); // Show the paging and activate its first link $(".paging").show(); $(".paging a:first").addClass("active"); // Get size of the image, how many images there are, then determin the size of the image reel. var imageWidth = $(".window").width(); var imageSum = $(".image_reel img").size(); var imageReelWidth = imageWidth * imageSum; // Adjust the image reel to its new size $(".image_reel").css( { 'width' : imageReelWidth } ); // Paging and Slider Function rotate = function () { var triggerID = $active.attr("rel") - 1; // Get number of times to slide var image_reelPosition = triggerID * imageWidth; // Determines the distance the image reel needs to slide $(".paging a").removeClass('active'); // Remove all active class $active.addClass('active'); // Add active class (the $active is declared in the rotateSwitch function) // Slider Animation $(".image_reel").animate( { left : - image_reelPosition } , 500); } ; // Rotation and Timing Event rotateSwitch = function () { play = setInterval(function () { // Set timer - this will repeat itself every 7 seconds $active = $('.paging a.active').next(); // Move to the next paging if ($active.length === 0) { // If paging reaches the end... $active = $('.paging a:first'); // go back to first } rotate(); // Trigger the paging and slider function } , 3000); // Timer speed in milliseconds (7 seconds) } ; rotateSwitch(); // Run function on launch // On Hover $(".image_reel a").hover(function () { clearInterval(play); // Stop the rotation } , function () { rotateSwitch(); // Resume rotation timer } ); // On Click $(".paging a").click(function () { $active = $(this); // Activate the clicked paging // Reset Timer clearInterval(play); // Stop the rotation rotate(); // Trigger rotation immediately rotateSwitch(); // Resume rotation timer return false; // Prevent browser jump to link anchor } ); } GetAllImages(); }); </script> ```
Whose fault is it? CSS or JavaScript?
CC BY-SA 3.0
0
2011-05-30T17:31:46.153
2019-12-14T13:03:40.600
2011-05-30T18:53:18.173
229,044
735,192
[ "javascript", "jquery", "css", "sharepoint-2010" ]
6,179,437
1
6,182,512
null
-1
1,051
I have a WinForms application that needs to download many (tens of thousands) fairly large (multi-MB) files per day. I wrote a simple test using the following code: ``` using (var wc = new System.Net.WebClient()) { foreach (string url in UrlsToDownload()) { string targetPath = SafeFilePathOf(url); wc.DownloadFile(url, targetPath); } } ``` The target machine has a 1 Gb/s connection, but testing shows a sustained download of about 1MB/s. This is less than what I was expecting, but the source servers may have slower connections. A full day's download will require several hours of connectivity, which is acceptable. Network utilization is fairly constant at about 1%: ![DownloadFile in UI thread](https://i.stack.imgur.com/sGYYl.png) However, I need to perform downloads in a background thread and support cancelling and download progress. The .Net `System.ComponentModel.BackgroundWorker` seems designed for this, so I put the exact same code in a `BackgroundWorker` instance and call `RunWorkerAsync`: ![DownloadFile in BackgroundWorker](https://i.stack.imgur.com/WnMMp.png) Download performance plummets to about 0.05 MB/s. A day's work will require about a week to perform; this is not going to fly. Why is `BackgroundWorker` performance so bad? Neither the CPU nor network is overloaded. The application is not blocked, I simply moved the download code from the UI thread to a `BackgroundWorker`. Calling `backgroundWorker.Priority = ThreadPriority.AboveNormal` has no effect.
WebClient.DownloadFile in BackgroundWorker performance unacceptable
CC BY-SA 3.0
0
2011-05-30T18:05:21.610
2022-02-17T17:23:41.490
2022-02-17T17:23:41.490
6,634,591
22,437
[ ".net", "webclient", "backgroundworker" ]
6,179,527
1
6,181,091
null
4
1,549
[QuickFix](http://www.quickfixengine.org/) includes bindings for Python. How do I install QuickFix so that I can `import quickfix` in Python on Windows? - `easy_install quickfix`- [downloads](http://www.quickfixengine.org/download.html)`setup.py`- ![enter image description here](https://i.stack.imgur.com/9sLNY.jpg) Even less promising is the binary download which has a `.lib` file and an include folder with all the header files. Please don't assume knowledge about makefiles or swig :)
How to install a Swig enabled Python extension (QuickFix)
CC BY-SA 3.0
0
2011-05-30T18:18:19.453
2011-05-30T22:01:25.920
2011-05-30T18:53:30.403
348,545
348,545
[ "python", "windows", "installation", "quickfix" ]
6,179,786
1
6,179,815
null
5
8,252
Edit: So the answer was in this post: [Loading javascript into a UIWebView from resources](https://stackoverflow.com/questions/5733883/loading-javascript-into-a-uiwebview-from-resources) You'll find everything you need to know for loading an HTML5 app with directories there, just make sure you drop files on your Xcode project clicking the radio button that reads "Create folder references for any added folders". Then just use the code on that links I've added up there. Thanks to Sergio for the help. --- I've been through StackOverflow several times already and none of the code I find there can display the images of my html5 App. The hard part seems to be loading files from different subdirectories. I do not want to throw everything in the root and then use the groups in Xcode because I would have to re-factor a lot of the HTML5 code. I'd like to build this in as a light container, not have to use PhoneGap. Besides PhoneGap comes with a bigger bagage of bugs (I tested our app and it crashed on the iPad and worked on the iPhone). It's hard enough to deal with the HTML5 side of things and Cocoa Touch. So here's how I load the HTML page: ``` [webView loadRequest:[NSURLRequest requestWithURL: [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"]isDirectory:NO]]]; ``` I have found some solution that it's getting me closer to "Create folder references for any added folders" when adding the files to the resources folder, I can now see some of the images being loaded. The JS doesn't seem to be working properly. I have tested this app loading it from a URL running on a local server and it does work in that case. So CSS is obviously working, images too but JS seems to be an issue. Hopefully I'll find the answer soon. --- Old (this is when I was including the folders the wrong way) So as you guys don't have to be wondering what am I seeing ( it looks to me like js and images are not loading and I do have subdirectories on the HTML5 app ): ![enter image description here](https://i.stack.imgur.com/yEKgT.jpg) --- Interesting posts which are related to this: [Loading javascript into a UIWebView from resources](https://stackoverflow.com/questions/5733883/loading-javascript-into-a-uiwebview-from-resources) [Link to resources inside WebView - iPhone](https://stackoverflow.com/questions/478665/link-to-resources-inside-webview-iphone)
iPad loading local HTML into web view with images and javascript
CC BY-SA 3.0
0
2011-05-30T18:51:45.447
2011-05-31T15:20:54.590
2017-05-23T12:33:00.993
-1
435,131
[ "iphone", "ios", "ipad", "uiwebview" ]
6,179,847
1
6,179,952
null
2
528
I am using this code to draw different cubes with different colors using the LWJGL: ``` GL11.glBegin(GL11.GL_QUADS); GL11.glColor3f(rcol.x, rcol.y, rcol.z); // Color Vector GL11.glVertex3f(rpos.x + rsiz.x, rpos.y + rsiz.y, rpos.z - rsiz.z); // Top Right Of The Quad (Top) GL11.glVertex3f(rpos.x - rsiz.x, rpos.y + rsiz.y, rpos.z - rsiz.z); // Top Left Of The Quad (Top) GL11.glVertex3f(rpos.x - rsiz.x, rpos.y + rsiz.y, rpos.z + rsiz.z); // Bottom Left Of The Quad (Top) GL11.glVertex3f(rpos.x + rsiz.x, rpos.y + rsiz.y, rpos.z + rsiz.z); // Bottom Right Of The Quad (Top) GL11.glVertex3f(rpos.x + rsiz.x, rpos.y - rsiz.y, rpos.z + rsiz.z); // Top Right Of The Quad (Bottom) GL11.glVertex3f(rpos.x - rsiz.x, rpos.y - rsiz.y, rpos.z + rsiz.z); // Top Left Of The Quad (Bottom) GL11.glVertex3f(rpos.x - rsiz.x, rpos.y - rsiz.y, rpos.z - rsiz.z); // Bottom Left Of The Quad (Bottom) GL11.glVertex3f(rpos.x + rsiz.x, rpos.y - rsiz.y, rpos.z - rsiz.z); // Bottom Right Of The Quad (Bottom) GL11.glVertex3f(rpos.x + rsiz.x, rpos.y + rsiz.y, rpos.z + rsiz.z); // Top Right Of The Quad (Front) GL11.glVertex3f(rpos.x - rsiz.x, rpos.y + rsiz.y, rpos.z + rsiz.z); // Top Left Of The Quad (Front) GL11.glVertex3f(rpos.x - rsiz.x, rpos.y - rsiz.y, rpos.z + rsiz.z); // Bottom Left Of The Quad (Front) GL11.glVertex3f(rpos.x + rsiz.x, rpos.y - rsiz.y, rpos.z + rsiz.z); // Bottom Right Of The Quad (Front) GL11.glVertex3f(rpos.x + rsiz.x, rpos.y - rsiz.y, rpos.z - rsiz.z); // Bottom Left Of The Quad (Back) GL11.glVertex3f(rpos.x - rsiz.x, rpos.y - rsiz.y, rpos.z - rsiz.z); // Bottom Right Of The Quad (Back) GL11.glVertex3f(rpos.x - rsiz.x, rpos.y + rsiz.y, rpos.z - rsiz.z); // Top Right Of The Quad (Back) GL11.glVertex3f(rpos.x + rsiz.x, rpos.y + rsiz.y, rpos.z - rsiz.z); // Top Left Of The Quad (Back) GL11.glVertex3f(rpos.x - rsiz.x, rpos.y + rsiz.y, rpos.z + rsiz.z); // Top Right Of The Quad (Left) GL11.glVertex3f(rpos.x - rsiz.x, rpos.y + rsiz.y, rpos.z - rsiz.z); // Top Left Of The Quad (Left) GL11.glVertex3f(rpos.x - rsiz.x, rpos.y - rsiz.y, rpos.z - rsiz.z); // Bottom Left Of The Quad (Left) GL11.glVertex3f(rpos.x - rsiz.x, rpos.y - rsiz.y, rpos.z + rsiz.z); // Bottom Right Of The Quad (Left) GL11.glVertex3f(rpos.x + rsiz.x, rpos.y + rsiz.y, rpos.z - rsiz.z); // Top Right Of The Quad (Right) GL11.glVertex3f(rpos.x + rsiz.x, rpos.y + rsiz.y, rpos.z + rsiz.z); // Top Left Of The Quad (Right) GL11.glVertex3f(rpos.x + rsiz.x, rpos.y - rsiz.y, rpos.z + rsiz.z); // Bottom Left Of The Quad (Right) GL11.glVertex3f(rpos.x + rsiz.x, rpos.y - rsiz.y, rpos.z - rsiz.z); // Bottom Right Of The Quad (Right) GL11.glEnd(); ``` It draws the cube fine and the color is perfect, but as soon as I add light to it, everything turns white and looks horrible. Here is my lighting code: ``` GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_LIGHT0); float lightAmbient[] = { 0.5f, 0.5f, 0.5f, 1.0f }; // Ambient Light Values float lightDiffuse[] = { 1.0f, 1.0f, 1.0f, 1.0f }; // Diffuse Light Values float lightPosition[] = { 20.0f, 15.0f, 20.0f, 1.0f }; // Light Position float lightSpecular[] = { 1.0f, 1.0f, 1.0f, 1.0f }; // Light Position ByteBuffer temp = ByteBuffer.allocateDirect(16); temp.order(ByteOrder.nativeOrder()) GL11.glLight(GL11.GL_LIGHT0, GL11.GL_SPECULAR, (FloatBuffer)temp.asFloatBuffer().put(lightSpecular).flip()); GL11.glLight(GL11.GL_LIGHT0, GL11.GL_AMBIENT, (FloatBuffer)temp.asFloatBuffer().put(lightAmbient).flip()); // Setup The Ambient Light GL11.glLight(GL11.GL_LIGHT0, GL11.GL_DIFFUSE, (FloatBuffer)temp.asFloatBuffer().put(lightDiffuse).flip()); // Setup The Diffuse Light GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION,(FloatBuffer)temp.asFloatBuffer().put(lightPosition).flip()); // Position The Light ``` Does anyone know what I am doing wrong here? Here is come example pictures: ![No Lighting](https://i.stack.imgur.com/Tl3pC.png) ![Lighting](https://i.stack.imgur.com/LVpsa.png)
OpenGL light not working
CC BY-SA 3.0
null
2011-05-30T19:00:01.577
2011-05-30T19:21:15.737
2011-05-30T19:13:44.273
419,090
419,090
[ "java", "opengl", "lighting" ]
6,180,128
1
6,185,204
null
4
2,702
I would like to warp an image based on lines given with different orientations: 1. for each line on the input image, I can get the coordinates of the pixels on the line 2. then I would map these pixels to the warped image so that each line is now a column. I would use `interp2` since I already have `X`, `Y` and `Z`, and I would make `Xi` and `Yi` with the coordinates obtained for each line. However, how would you: - `for`- - - The input image here is a tire, there is this nice pattern of circles. I could make radial lines from the center of the tire and I would like to get a new image whose columns are the pixels from the radial lines. Here is the code I have so far (no `interp2` yet as I have not solved the problems explained above). ``` close all %% Image Z = imread('tire.tif'); % The corresponding mesh sz = size(Z); [X,Y] = meshgrid(1:sz(2), 1:sz(1)); %% Line lineEquation = @(c, v) (v(1)*(X-c(2))+v(2)*(Y-c(1)))/norm(v); getLine = @(c, v) abs(lineEquation(c, v))<1/2; % Example c = [93, 109]; v = [2, 1]; line = getLine(c, v); %% Circle circleEquation = @(c, r) ((X-c(2)).^2+(Y-c(1)).^2-r^2)/r^2; getCircle = @(c, r) abs(circleEquation(c, r))<1/r; % Example r = 24; circle = getCircle(c, r); %% Plot a sequence of line figure; for delta = -1:0.1:1 v = [0.1, delta]; line_delta = getLine(c, v); Z_line = Z; Z_line(line_delta) = 255; imagesc(Z_line); colormap('gray'); pause(0.05); end %% Plot examples figure; subplot(221); imagesc(Z); title('Image'); subplot(222); Z_line = Z; Z_line(line) = 255; imagesc(Z_line); title('Line'); subplot(223); Z_circle = Z; Z_circle(circle) = 255; imagesc(Z_circle); title('Circle'); subplot(224); % TODO title('Warped image'); colormap('gray'); ``` Here are different outputs: ![Examples](https://i.stack.imgur.com/dF2Cb.jpg) ![Lines](https://i.stack.imgur.com/6ejX2.gif) ![Circles](https://i.stack.imgur.com/IjWXk.gif) --- Here is the warped image: ![Warped image](https://i.stack.imgur.com/2pVZR.jpg) Here is the code from the answer: ``` [ANG, RAD] = meshgrid(0:0.01:2*pi, 0:0.5:166); XI = c(2) + cos(ANG).*RAD; YI = c(1) + sin(ANG).*RAD; WARPED = interp2(X, Y, double(Z), XI, YI); WARPED(isnan(WARPED))= max(WARPED(:)); imagesc(WARPED); title('Warped image'); colormap('gray'); ```
Warping an image based on lines given with different orientations
CC BY-SA 3.0
null
2011-05-30T19:36:25.940
2011-06-02T21:26:07.497
2011-06-02T08:11:14.843
376,454
376,454
[ "matlab", "line", "computer-vision", "interpolation", "geometry" ]
6,180,609
1
6,180,817
null
1
443
I have several files, each of which has data like this (filename:data inside separated by newline): 1. Mike: Plane\nCar 2. Paula: Plane\nTrain\nBoat\nCar 3. Bill: Boat\nTrain 4. Scott: Car How can I create a csv file using python that groups all the different vehicles and then puts a X on the applicable person, like: ![output](https://i.stack.imgur.com/bVuwm.png)
Group and Check-mark using Python
CC BY-SA 3.0
0
2011-05-30T20:43:35.037
2011-05-30T21:40:48.363
null
null
198,358
[ "python", "csv" ]
6,180,851
1
6,214,869
null
7
2,447
I have a problem with QTabBar/QTabWidget. This is what my program looks like at the moment, using QTabBar: ![enter image description here](https://i.stack.imgur.com/mELC6.png) As you can see, there is an unsightly line between the QTabBar and the QScrollArea underneath it. This line is part of the frame of the QScrollArea, which I can't simply get rid of, because it is required on the other three sides. I realise I could use QTabWidget, but then I would have to create a widget for each tab, which is not feasible here: the contents of the QScrollArea change according to the selected tab, but there is only one QScrollArea widget. (Duplicating it each time a new tab is created would cause its own problems.) So does anybody know a way to either: (i) tell the QScrollArea to draw a frame without the top line; or (ii) use the same widget for each tab in a QTabWidget? For another approach, see my answer below. I have implemented zvezdi's suggestion, and the unsightly line has disappeared: ![enter image description here](https://i.stack.imgur.com/6HN2C.png) This is an improvement. But it's not right. Look at the gaps between the scroll bars and the border. On the right, it's two pixels instead of one; on the bottom, it's pixels. And the gap on the right between the QScrollArea border and the mainWidget border is one pixel too big. This is due to QTabWidget's border style, which I am losing my sanity trying to change. If I say: ``` MyTabWidget -> setStyleSheet ("QTabWidget::pane { margin: 0px,0px,0px,0px }") ; ``` then the margins seem to be right, but the borders disappear: ![enter image description here](https://i.stack.imgur.com/9Ucnh.png) If I say: ``` MyTabWidget -> setStyleSheet ("QTabWidget::pane { " " margin: 0px,0px,0px,0px;" " border: 1px solid darkgray;" "}") ; ``` then I'm almost back to where I started: ![enter image description here](https://i.stack.imgur.com/8Namz.png) If I try to remedy this with: ``` ApplicationTabWidget -> setStyleSheet ("QTabWidget::pane { " " margin: 0px,0px,0px,0px;" " border: 1px solid darkgray;" " border-top: 0px;" "}") ; ``` then again I am mocked for my pains: ![enter image description here](https://i.stack.imgur.com/KTlUw.png) If I forget `setStyleSheet` and just turn `documentMode` on, this is what I get: ![enter image description here](https://i.stack.imgur.com/oHn1s.png) Please somebody, tell me I'm being stupid, and there's a perfectly simple solution to all this.
Widget under a QTabBar with unwanted frame
CC BY-SA 3.0
0
2011-05-30T21:22:03.663
2011-06-03T18:17:28.047
2011-06-03T10:13:16.240
428,857
428,857
[ "c++", "qt", "qt4" ]
6,180,996
1
6,183,354
null
1
2,097
I'm using the zend framework to write an app and I'm having lots of problems getting my relational database models to work. I've read the quickstart and the docs several times and I'm still not sure how to do this. I post a picture of the relationships between the different tables involved to avoid having to explain everything since English is not my first language and I tend not to make myself clear when I try to explain...well complex things. ![enter image description here](https://i.stack.imgur.com/YqQul.png) The tables press_releases, social_networking, blog_posts, rss_feed, directorios, users and articulos are all set as foreign keys in the table named planilla_users. I coded my table models the way the quickstart shows: ``` class Application_Model_DbTable_PlanillaUsers extends Zend_Db_Table_Abstract { protected $_name = 'planilla_users'; protected $_referenceMap = array( 'User' => array( 'columns' => 'users_id', 'refTableClass' => 'Application_Model_DbTable_Users', 'refColumns' => 'id' ), 'Articulo' => array( 'columns' => 'art_id', 'refTableClass' => 'Application_Model_DbTable_Articulos', 'refColumns' => 'id' ),...etc ``` ...and the rest following the format of: ``` class Application_Model_DbTable_Users extends Zend_Db_Table_Abstract { protected $_name = 'users'; protected $_dependentTables = array('Application_Model_DbTable_PlanillaUsers'); ``` I also have a model Planilla.php with all the setters and getters for the information to be stored/updated/retrieved/deleted,...however...I'm completely blank on what to do with the mapper. I don't know how it's supposed to work and I honestly haven't found a good example on how to do something like this yet. So any help would be mostly appreciated.
How do you work with a relational database in Zend Framework?
CC BY-SA 3.0
0
2011-05-30T21:45:04.243
2014-02-16T13:39:53.123
null
null
741,933
[ "zend-framework", "zend-db", "zend-db-table" ]
6,181,178
1
6,181,779
null
2
3,530
![Explain SQL](https://i.stack.imgur.com/fJVVC.jpg) Explain SQL (in phpmyadmin) of a query that is taking more than 5 seconds is giving me the above. I read that we can study the `Explain SQL` to optimize a query. Can anyone tell if this Explain SQL telling anything as such? Thanks guys. The query itself: ``` SELECT a.`depart` , a.user, m.civ, m.prenom, m.nom, CAST( GROUP_CONCAT( DISTINCT concat( c.id, '~', c.prenom, ' ', c.nom ) ) AS char ) AS coordinateur, z.dr FROM `0_activite` AS a JOIN `0_member` AS m ON a.user = m.id LEFT JOIN `0_depart` AS d ON ( m.depart = d.depart AND d.rank = 'mod' AND d.user_sec =2 ) LEFT JOIN `0_member` AS c ON d.user_id = c.id LEFT JOIN `zone_base` AS z ON m.depart = z.deprt_num GROUP BY a.user ``` Structures of the two tables `a` and `d`![Table structures](https://i.stack.imgur.com/pJq58.jpg). Top: `a` and bottom: `d` What I want in this query? I first want to get the value of 'depart' and 'user' (which is an id) from the table `0_activite`. Next, I want to get name of the person (civ, prenom and name) from `0_member` whose id I am getting from `0_activite` via 'user', by matching `0_activite`.user with `0_member`.id. Here depart is short of department which is also an id. So at this point, I have depart, id, civ, nom and prenom of a person from two tables, `0_activite` and `0_member`. Next, I want to know which dr is related with this depart, and this I get from `zone_base`. The value of depart is same in both `0_activite` and `0_member`. Then comes the trickier part. A person from `0_member` can be associated with multiple departs and this is stored in `0_depart`. Also, every user has a level, one of what is 'mod', stands for moderator. Now I want to get all the people who are moderators in the depart from where the first user is, and then get those moderaor's name from `0_member` again. I also have a variable user_sec, but this is probably less important in this context, though I cannot overlook it. This is what makes the query a tricky one. 0_member is storing id, name of users, + one depart, 0_depart is storing all departs of users, one line for each depart, and `0_activite` is storing some other stuffs and I want to relate those through userid of `0_activite` and the rest. Hope I have been clear. If I am not, please let me know and I will try again to edit this post. Many many thanks again.
Explain SQL and Query optimization
CC BY-SA 3.0
0
2011-05-30T22:15:12.903
2011-06-01T00:42:53.623
2011-05-31T21:37:35.283
613,018
613,018
[ "mysql", "phpmyadmin", "query-optimization" ]
6,181,184
1
6,194,312
null
9
8,460
First some non-essential context for fun. My real question is far below. Please don't touch the dial. I'm playing with the new probabilistic functions of Mathematica 8. Goal is to do a simple power analysis. The power of an experiment is 1 minus the probability of a type II error (i.e., anouncing 'no effect', whereas there is an effect in reality). As an example I chose an experiment to determine whether a coin is fair. Suppose the probability to throw tails is given by (a fair coin has b=0.5), then the power to determine that the coin is biased for an experiment with coin flips is given by ``` 1 - Probability[-in <= x - n/2 <= in, x \[Distributed] BinomialDistribution[n, b]] ``` with the size of the deviation from the expected mean for a fair coin that I an willing to call not suspicious ( is chosen so that for a fair coin flipped times the number of tails will be about 95% of the time within mean +/- ; this, BTW, determines the size of the type I error, the probability to incorrectly claim the existence of an effect). Mathematica nicely draws a plot of the calculated power: ``` n = 40; in = 6; Plot[1-Probability[-in<=x-n/2<=in,x \[Distributed] BinomialDistribution[n, b]], {b, 0, 1}, Epilog -> Line[{{0, 0.85}, {1, 0.85}}], Frame -> True, FrameLabel -> {"P(tail)", "Power", "", ""}, BaseStyle -> {FontFamily -> "Arial", FontSize -> 16, FontWeight -> Bold}, ImageSize -> 500] ``` ![enter image description here](https://i.stack.imgur.com/Y4pAM.png) I drew a line at a power of 85%, which is generally considered to be a reasonable amount of power. Now, all I want is the points where the power curve intersects with this line. This tells me the minimum bias the coin must have so that I have a reasonable expectation to find it in an experiment with 40 flips. So, I tried: ``` In[47]:= Solve[ Probability[-in <= x - n/2 <= in, x \[Distributed] BinomialDistribution[n, b]] == 0.15 && 0 <= b <= 1, b] Out[47]= {{b -> 0.75}} ``` This fails miserably, because for b = 0.75 the power is: ``` In[54]:= 1 - Probability[-in <= x - n/2 <= in, x \[Distributed] BinomialDistribution[n, 0.75]] Out[54]= 0.896768 ``` `NSolve` finds the same result. `Reduce`does the following: ``` In[55]:= res = Reduce[Probability[-in <= x - n/2 <= in, x \[Distributed] BinomialDistribution[n, b]] == 0.15 && 0 <= b <= 1, b, Reals] Out[55]= b == 0.265122 || b == 0.73635 || b == 0.801548 || b == 0.825269 || b == 0.844398 || b == 0.894066 || b == 0.932018 || b == 0.957616 || b == 0.987099 In[56]:= 1 -Probability[-in <= x - n/2 <= in, x \[Distributed] BinomialDistribution[n, b]] /. {ToRules[res]} Out[56]= {0.85, 0.855032, 0.981807, 0.994014, 0.99799, 0.999965, 1., 1., 1.} ``` So, `Reduce` manages to find the two solutions, but it finds quite a few others that are dead wrong. `FindRoot` works best here: ``` In[57]:= FindRoot[{Probability[-in <= x - n/2 <= in, x \[Distributed] BinomialDistribution[n, b]] - 0.15`}, {b, 0.2, 0, 0.5}] FindRoot[{Probability[-in <= x - n/2 <= in, x \[Distributed] BinomialDistribution[n, b]] - 0.15`}, {b, 0.8, 0.5, 1}] Out[57]= {b -> 0.265122} Out[58]= {b -> 0.734878} ``` OK, long introduction. My question is: why do Solve, NSolve, and Reduce fail so miserably (and silently!) here? IMHO, it can't be numerical accuracy since the power values found for the various solutions seem to be correct (they lie perfectly on the power curve) and are considerably removed from the real solution. For the mma8-deprived Mr.Wizard: The expression for the power is a heavy one: ``` In[42]:= Probability[-in <= x - n/2 <= in, x \[Distributed] BinomialDistribution[n, b]] Out[42]= 23206929840 (1 - b)^26 b^14 + 40225345056 (1 - b)^25 b^15 + 62852101650 (1 - b)^24 b^16 + 88732378800 (1 - b)^23 b^17 + 113380261800 (1 - b)^22 b^18 + 131282408400 (1 - b)^21 b^19 + 137846528820 (1 - b)^20 b^20 + 131282408400 (1 - b)^19 b^21 + 113380261800 (1 - b)^18 b^22 + 88732378800 (1 - b)^17 b^23 + 62852101650 (1 - b)^16 b^24 + 40225345056 (1 - b)^15 b^25 + 23206929840 (1 - b)^14 b^26 ``` and I wouldn't have expected `Solve` to handle this, but I had high hopes for `NSolve` and `Reduce`. Note that for =30, =5 `Solve`, `NSolve`, `Reduce` and `FindRoot` all find the same, correct solutions (of course, the polynomial order is lower there).
FindRoot vs Solve, NSolve and Reduce
CC BY-SA 3.0
0
2011-05-30T22:17:01.487
2011-06-01T13:10:03.520
null
null
615,464
[ "wolfram-mathematica" ]
6,181,485
1
6,184,137
null
2
1,665
I've got an entity which is identified by no own id but an unique combination of properties, each of which is a foreign key. But Entity Framework designer does not seem to allow to make a foreign key (a "navigation property") a part of a primary key. Am I misunderstanding something or is it just unsupported? Example: ![enter image description here](https://i.stack.imgur.com/rG2pZ.png) here an instrument is designated by a very short symbolic identifier (name), which doesn't seem to be wise to be replaced by a numeric code.
How to use a foreign key as a part of a composite primary key in Entity Framework?
CC BY-SA 3.0
null
2011-05-30T23:07:08.417
2011-05-31T07:12:33.077
null
null
274,627
[ ".net", "sql-server", "entity-framework", "database-design", "composite-key" ]
6,181,900
1
6,477,152
null
2
971
I'm trying to create a simple Entity model for the chinook database with all the tables and Vs2010 isn't creating any relationships or navigation properties. They certainly exist, they appear in a database diagram in SSMS. I have another machine (also vs2010 sp1 and sql express 2008 r2) that isn't having this problem, but I have no idea what's different there. Here's what the created model looks like: ![Chinook Model Without Associations](https://i.stack.imgur.com/8Hn5q.png)
Why doesn't entity framework wizard see my foreign keys in chinook database?
CC BY-SA 3.0
null
2011-05-31T00:45:28.293
2011-06-25T10:16:59.013
2011-06-12T00:06:07.533
2,775
2,775
[ "sql-server", "visual-studio-2010", "entity-framework" ]
6,181,896
1
6,209,473
null
9
2,193
I face a strange problem while I'm trying to document a project of mine. I have the following code: ``` //! Set default ::$action for called controller. If no action is called, default (index) will be set. $action = isset($_GET[ 'action']) ? $_GET[ 'action'] : 'index'; if ($action) { echo 'something 1'; }else{ echo 'something 2'; } //! Set default ::$action2 for called controller. If no action is called, default (index) will be set. $action2 = isset($_GET[ 'action']) ? $_GET[ 'action'] : 'index'; //! Set default ::$action3 for called controller. If no action is called, default (index) will be set. $action3 = isset($_GET[ 'action']) ? $_GET[ 'action'] : 'index'; ``` Doxygen generates the following: ![No $action2](https://i.stack.imgur.com/FSVC0.png) As you may see, $action2 is missing. I check one of my other files and saw same problem. Next thing after `if` statement is never documented, but the one after that is documented. If I remove the `if` statement from above example, I get documentation for all 4 variables - `$page`, `$action`, `action2` and `action3`. I spend enormous time of trying to understand what exactly is wrong, but no luck, so every suggestion is welcomed. Windows XP x64 with Doxygen 1.7.4. (I'm using the Doxygen GUI) Also, when I have something like that in my code (notice the missing `else` for the `if` statement). When I add the `}else{}` however it works. Next `$variables` is not documented again, but that update was about the `if/else`. ![if in code](https://i.stack.imgur.com/1nhHw.jpg) Doxygen converts it to this![Wrong listing of variables](https://i.stack.imgur.com/kAfEK.png)
Doxygen strange problem while documenting PHP if
CC BY-SA 3.0
0
2011-05-31T00:43:25.920
2018-12-25T17:17:31.660
2011-05-31T11:43:54.020
156,172
156,172
[ "php", "doxygen" ]
6,181,929
1
6,181,956
null
0
1,721
I like the idea of the of editing inside the terminal and like the key bindings of Vim, but the text highlighting in my Vim is much worse than in Textmate. The comparison (textmate is first): ![Textmate](https://i.stack.imgur.com/EaMAW.png) ![Vim](https://i.stack.imgur.com/sBLCr.png) Obviously Vim is much worse. I've turned on syntax highlighting in my .vimrc, and have installed python.vim (not sure if this works with python 2.7). Any suggesting on how to get it up to par would be appreciated. Thanks
How can I get Vim to highlight syntax as well as textmate
CC BY-SA 3.0
0
2011-05-31T00:52:19.650
2011-05-31T03:00:53.643
null
null
402,468
[ "python", "vim", "textmate" ]
6,182,270
1
6,182,417
null
0
491
I have of button & check box like on my pages (the of the first two arguments in this examole it's 'login' & 'basics' is for each button( ``` <button class="square_button button_background" type="button" onclick="run_through_ajax('login','basics','false')"> run </button> <input name="restore" title="restore before ant run" type="checkbox"> ``` Can I somehow - `onclick="run_through_ajax('login','basics','false')"`- `onclick="run_through_ajax('login','basics','true')"`- I can use jQuery, doesn't have to be pure javascript solution. Every 'run' button runs javascript with different parameters. The checkbox is there to distinguish if one extra action needs to be performed before the `run`. ![enter image description here](https://i.stack.imgur.com/aLlp9.png)
can ticking checkbox update javascript function call arguments?
CC BY-SA 3.0
null
2011-05-31T02:01:32.230
2011-05-31T03:07:38.380
2011-05-31T02:54:52.397
250,422
250,422
[ "javascript", "jquery" ]
6,182,320
1
null
null
7
1,210
I have a `Canvas` onto which I draw a `Path`: ``` <Path Data="M 380 110 v -10 l 100 -100" Stroke="#C0C0C2" StrokeThickness="1" UseLayoutRounding="True" /> ``` Even though the `StrokeThickness` is set to 1, the vertical part of the path is drawn across 2 pixels and in a lighter color. ![Silverlight Path](https://i.stack.imgur.com/L8FMm.png) I know that WPF has the `SnapsToDevicePixels` property that would fix it, and I read that in Silverlight there is a `UseLayoutRounding` property that you can use in some cases to have the same effect, however it does not seem to apply to `Path`. Is there anything I can do to get that line drawn properly?
Silverlight Path is blurry - How to snap to pixels?
CC BY-SA 3.0
0
2011-05-31T02:10:47.533
2012-08-26T01:59:58.520
2012-08-26T01:59:58.520
154,112
77,004
[ "silverlight", "silverlight-4.0" ]
6,182,753
1
null
null
0
469
I have Doctrine setup with all my tables in my database, and working properly. I have those three entities: Users, Groups and News There is a many-to-many relationship between Users and Groups. (I put my users in groups) There is also a many-to-many relationship between News and Groups. (I give access to a News item to a few Groups) Database Schema: ![My database schema for the relevant part](https://i.stack.imgur.com/THLyf.jpg) I want to get the News that a given User has access to. Is there an efficient way to do this in Doctrine? EDIT: I should add that I already had the solution nailed down with a straight SQL query before I started to use Doctrine, I want to know the Doctrine way to do this.
Relationship between three entities in Doctrine
CC BY-SA 3.0
null
2011-05-31T03:34:02.783
2012-03-21T16:47:51.607
2011-05-31T03:43:18.193
715,365
715,365
[ "php", "database", "doctrine" ]
6,182,804
1
6,182,902
null
5
2,197
I gave up trying to understand Mathematica 3D axes configuration. When I make 3D plot, and label the 3 axes to identify which axes is which, and then make points on these axes, the points appear on different axes than what I expect them to show at using the Point command, which takes {x,y,z} coordinates. Here is an example ``` g=Graphics3D[ { {PointSize[0],Point[{0,0,0}]} }, AxesOrigin->{0,0,0}, PlotRange->{{-3,3},{-3,3},{-3,3}}, Axes->True, AxesLabel->{"X","Y","Z"}, LabelStyle->Directive[Bold,Red,16], PreserveImageOptions->False, Ticks->None,Boxed->False] ``` The above results in ![enter image description here](https://i.stack.imgur.com/NQOUh.png) So, now I added a point at at end of the x-axis, and at the end of the y-axis, and at the end of the z-axis. I make each point different color to help identify them on the plot. ``` g=Graphics3D[ { {Red,PointSize[.03],Point[{3,0,0}]}, {Black,PointSize[.03],Point[{0,3,0}]}, {Blue,PointSize[.03],Point[{0,0,3}]} }, AxesOrigin->{0,0,0},PlotRange->{{-3,3},{-3,3},{-3,3}}, Axes->True,AxesLabel->{"X","Y","Z"}, LabelStyle->Directive[Bold,Red,16],PreserveImageOptions->False, Ticks->None,Boxed->False] ``` The result is this: ![enter image description here](https://i.stack.imgur.com/f5i0Y.png) You can see, the RED point, which I expected it to go to end of the x-axis, shows up at the end of the Z axis. And the Black point, instead of showing up at the end of the Y-axis, shows up at X-axis, and the blue point, instead of showing at the end of the Z axis, shows up at the end of the Y-axis. May be the labels are wrong? May be I am looking at the image in wrong way? I am really confused, as I am clearly not understanding something. I looked at documentation, and I could not find something to help me see what I am doing wrong. I am just starting to learn Mathematica 3D graphics. EDIT: add image with Ticks on it, reply to Simon, I did not know how to do it the comment box: ``` g=Graphics3D[ { Cuboid[{-.1,-.1,-.1},{.1,.1,.1}], {Red,PointSize[.03],Point[{2,0,0}]}, {Black,PointSize[.03],Point[{0,2,0}]}, {Blue,PointSize[.03],Point[{0,0,2}]} }, AxesOrigin->{0,0,0}, PlotRange->{{-2,2},{-2,2},{-2,2}}, Axes->True, AxesLabel->{"X","Y","Z"}, LabelStyle->Directive[Bold,Red,16], PreserveImageOptions->False, Ticks->True, TicksStyle->Directive[Black,8], Boxed->False ] ``` here is the result: ![enter image description here](https://i.stack.imgur.com/WSQVt.png) EDIT: OK, I decided to forget about using AxesLabels, and I put them myself . Much more clear now ``` m=3; labels={Text[Style["X",16],{1.2 m,0,0}],Text[Style["Y",16],{0,1.2 m,0}], Text[Style["Z",16],{0,0,1.2 m}]}; g=Graphics3D[ { {Red,PointSize[.03],Point[{m,0,0}]}, {Black,PointSize[.03],Point[{0,m,0}]}, {Blue,PointSize[.03],Point[{0,0,m}]}, labels }, AxesOrigin->{0,0,0}, PlotRange->{{-m,m},{-m,m},{-m,m}}, Axes->True, AxesLabel->None, LabelStyle->Directive[Bold,Red,16], PreserveImageOptions->False, Ticks->True, TicksStyle->Directive[Black,8], Boxed->False ] ``` ![enter image description here](https://i.stack.imgur.com/B4ves.png)
Mathematica: Help me understand Mathematica 3D coordinates system
CC BY-SA 3.0
0
2011-05-31T03:44:27.240
2011-05-31T10:23:24.120
2011-05-31T04:27:19.050
765,271
765,271
[ "wolfram-mathematica" ]
6,182,921
1
6,183,096
null
2
2,135
I have the following code: ``` UIImageView *imgView = [[UIImageView alloc]initWithFrame: description.frame]; imgView.image = [UIImage imageNamed: @"textview.png"]; [description addSubview: imgView]; [description sendSubviewToBack: imgView]; [imgView release]; ``` where description here is a UITextView. I have an image that I would like to set as the background of this. However the resulting interface looks like this: ![](https://i.stack.imgur.com/0spaS.png) The size of the image is exactly the same as the size of the UITextView
UIImageView as background of UITextView
CC BY-SA 3.0
null
2011-05-31T04:10:00.870
2011-05-31T11:13:35.177
2020-06-20T09:12:55.060
-1
95,265
[ "iphone", "objective-c", "ipad" ]
6,183,102
1
null
null
1
10,231
When I press a button with this code on ebay.com in my webview: html of button: ``` input id="addPicturesBtn" name="addPicturesBtn" type="button" value="Add pictures" class="button" onclick="ebay.run(this.id,'onclick');return false;" onkeydown="ebay.run(this.id,'onkeydown');return false;" title="Add pictures" ``` If this button is pressed inside my webview, It sends the new window from my webview to the android browser. But if the same button is pressed from within the android browser it pops up this cool dialog type popup window (see picture) I would like to open the popup style window on eBay like the browser does, if this button is pressed inside my webview. So that it can be closed by the user to return them to my app behind it when they are done with the popup. Is that possible? Here is what I have so far: ``` webChromeClient = new WebChromeClient() { @Override public boolean onCreateWindow(WebView view, boolean dialog, boolean userGesture, Message resultMsg) { WebView childView = new WebView(Ebay.this); final WebSettings settings = childView.getSettings(); settings.setJavaScriptEnabled(true); childView.setWebChromeClient(this); childView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; transport.setWebView(childView); resultMsg.sendToTarget(); return true; } @Override public boolean onJsAlert(WebView view, String url, String message, JsResult result) { new AlertDialog.Builder(view.getContext()).setMessage(message).setCancelable(true).show(); result.confirm(); return true; } ``` Am I missing something? Here is a picture of the android browser popup (That I'm trying to get my webview to launch from the button on ebay.com): ![popup](https://i.stack.imgur.com/cFfWm.png)
possible WebView OnCreateWindow to make popup window(Dialog style)? like android browser
CC BY-SA 3.0
0
2011-05-31T04:46:50.440
2011-06-10T00:17:16.300
2011-06-10T00:17:16.300
683,085
683,085
[ "android", "popup" ]
6,183,123
1
6,183,716
null
4
118
Consider this example: ``` expr = a (1 + b + c d + Sqrt[-2 d e + fg + h^2] + a j ); ``` Now I'd like to insert a complex `I` before the term in the square root and retain the rest of the expression. I know that `expr` has only one `Sqrt` term in it. So I tried the following: ``` ToBoxes@# /. SqrtBox@x_ :> RowBox[{I, " ", SqrtBox@x}] &[ expr] // ToExpression Out[1] = $Failed ``` Why does it fail? The workaround was to use a different variable and then replace it with `I` as so: ``` (ToBoxes@# /. SqrtBox@x_ :> RowBox[{k, " ", SqrtBox@x}] &[expr] // ToExpression) /. k -> I ``` ![enter image description here](https://i.stack.imgur.com/AY4nI.png) Why does this work? Are there alternate/better ways to do this?
Prepend complex I to a sub-expression of an expression?
CC BY-SA 3.0
null
2011-05-31T04:51:04.697
2011-05-31T12:48:11.783
2011-05-31T05:17:32.247
null
null
[ "wolfram-mathematica" ]
6,183,631
1
null
null
1
1,537
unexpected error occurred on a service, An existing connection was forcibly closed be a remote host, attached error message for more details. Any help to resolve the issue would be appreciated. Thanks, Kumar ![enter image description here](https://i.stack.imgur.com/ZuSH5.png)
unexpected error occurred on a service, An existing connection was forcibly closed be a remote host
CC BY-SA 3.0
null
2011-05-31T06:09:27.587
2011-05-31T07:08:46.853
null
null
366,947
[ "c#", "asp.net", "service" ]
6,183,688
1
7,691,754
null
3
1,790
My app has a scrollview and a webview inside a LinearLayout. When the Ads from millenial come in it happens some jittering and some webview parts get white. I have tried ALL possible parameter combination and nothing works. Does anyone a better solution or even a explanation? Notice the blank text in the bottom: ![Notice the blank text in the bottom](https://i.stack.imgur.com/LjVLY.png) Notice 9 10 11 and 11 sections: ![Notice 9 10 11 and 11 sections](https://i.stack.imgur.com/Ufh7y.png) thanks
Honeycomb webview flickering jittering
CC BY-SA 3.0
0
2011-05-31T06:17:10.997
2012-09-07T13:25:41.150
2011-05-31T06:22:58.077
410,293
410,293
[ "android", "webview" ]
6,183,824
1
6,184,110
null
0
237
I have created desktop application wherein there are three projects include. any one can give me idea to create installable setup in visual studio 2008 ![enter image description here](https://i.stack.imgur.com/WuobD.jpg) & i feel second problem with ![enter image description here](https://i.stack.imgur.com/oQnbl.jpg)
How I create installable package of desktop projects as single setup
CC BY-SA 4.0
null
2011-05-31T06:34:36.730
2018-06-09T15:59:46.873
2018-06-09T15:59:46.873
1,033,581
554,828
[ "asp.net", "release", "setup-project", "windows" ]
6,183,867
1
6,186,928
null
3
8,424
I am working in asp.net and have radiobutton list and I want to align their text as I require. Here is what I have currently: ![enter image description here](https://i.stack.imgur.com/d9Uzv.png) I want to make them like this: ![enter image description here](https://i.stack.imgur.com/8xvNi.png) Secondly, when I click Ages From radiobutton, I display a div against this like: ![enter image description here](https://i.stack.imgur.com/488de.png) and when I click back to All Ages radio button, I want to hide that div. But SelectedIndexChanged doesn't work second time and onwards. It only works first time. Code of aspx: ``` <table> <tr> <td> <asp:RadioButtonList ID="rdoAge" runat="server" RepeatDirection="Horizontal" onselectedindexchanged="rdoAge_SelectedIndexChanged" AutoPostBack="true" > <asp:ListItem Text="All Ages" Value="All Ages" Selected="True"></asp:ListItem> <asp:ListItem Text="Ages From" Value="Ages From"></asp:ListItem> </asp:RadioButtonList> </td> <div id="divAge" runat="server" visible="false"> <td> <asp:TextBox ID="txtAgeFrom" runat="server" CssClass="textEntry2" MaxLength="3" Width="65"></asp:TextBox> </td> <td> <asp:Label ID="lblTo" runat="server" Text="To"></asp:Label> </td> <td> <asp:TextBox ID="txtAgeTo" runat="server" CssClass="textEntry2" MaxLength="3" Width="65"></asp:TextBox> </td> </div> </tr> </table> ``` Code of cs file: ``` protected void rdoAge_SelectedIndexChanged(object sender, EventArgs e) { switch (rdoAge.SelectedValue) { case "All Ages": divAge.Visible = false; break; case "Ages From": divAge.Visible = true; break; } } ``` I'll be grateful if anyone suggests something useful for this issue. Thanks in advance.
Radiobutton Text alignment Issue
CC BY-SA 3.0
0
2011-05-31T06:39:32.120
2011-05-31T11:34:01.763
2011-05-31T07:00:35.207
669,448
669,448
[ "asp.net", "text", "radio-button" ]
6,184,169
1
6,184,470
null
12
120,501
![error](https://i.stack.imgur.com/0ss3g.png) 'nuff said. I have absolutely no clue why using alert() there wouldn't work. It works perfectly in Firefox, but gives that error in Chrome.
alert() not working in Chrome
CC BY-SA 3.0
0
2011-05-31T07:15:35.043
2017-03-11T06:32:17.363
2011-06-01T08:53:36.030
21,234
null
[ "javascript", "google-chrome", "alert" ]
6,184,199
1
6,185,142
null
2
1,308
I have to use Flash CS3, so I can't use the properties rotationX, roationY and rotationZ. I have a movieclip, that looks like this. It is now flat, no 3D rotation or shearing ![enter image description here](https://i.stack.imgur.com/cZPtx.jpg) But what I want is that this movieclip has a rotationX, or that it is a bit in perspective like this: ![enter image description here](https://i.stack.imgur.com/Randz.jpg) As I said, I can't use rotationX, so I have been playing around with Matrix. But I can not get it right. Here is how I try to do it > myMC.transform.matrix = new Matrix(1,0.15,0.35, 1, 0, 0); And this is the result ![enter image description here](https://i.stack.imgur.com/T6RSG.jpg) Can you help me to get the matrix right, or is there another way? Thank you, Vincent
AS3: Simulating RotationX with Matrix
CC BY-SA 3.0
0
2011-05-31T07:18:44.057
2013-01-31T20:45:27.080
2013-01-31T20:40:13.887
1,892,635
99,360
[ "actionscript-3", "flash", "animation", "rotation" ]
6,184,509
1
6,185,156
null
0
1,503
I have a jquery's autocomplete texbox and, upon a click of a button, I need to check if the value entered has come from the autocomplete or is it a completely new value. The problems is that my code constantly gives me 'alert("no")'... maybe I shouldn't be checking against 'cache', but something else? ``` //////////////////////////////////////////// autocomplete code ////////////////// var cache = {}, lastXhr; $( "#inputV" ).autocomplete({ minLength: 2, source: function( request, response ) { var term = request.term; if ( term in cache ) { response( cache[ term ] ); return; } lastXhr = $.getJSON( "search.php", request, function( data, status, xhr ) { cache[ term ] = data; if ( xhr === lastXhr ) { response( data ); } }); } }); ////////////////////////// check if input comes from autocomplete ////////////////// $('#btn_check').click(function() { var input = $("#inputV").val(); alert(input); if ( input in cache ) { alert("yes"); } else { alert("no"); } }); ``` ![enter image description here](https://i.stack.imgur.com/Z5eYF.jpg)
How to check in an entered value is from autocomplete?
CC BY-SA 3.0
null
2011-05-31T07:52:14.350
2011-05-31T08:56:08.887
2011-05-31T08:42:21.587
560,648
651,418
[ "jquery" ]
6,184,800
1
6,188,408
null
13
11,907
I have successfully installed: 1) IntelliJ IDEA 10.0.3 with Lua Plugin 2) Corona SDK 3) Corona API for IntelliJ I can now use autocompletion features of Lua and Corona using IntelliJ IDEA Now my problem is : When I try to run a sample main.lua script file using IntelliJ IDEA, i get this error ``` "C:\Program Files\Lua\5.1\lua.exe" C:/Users/mshahab/IdeaProjects/TestOne/main.lua C:\Program Files\Lua\5.1\lua.exe: C:/Users/mshahab/IdeaProjects/TestOne/main.lua:1: attempt to index global 'display' (a nil value) stack traceback: C:/Users/mshahab/IdeaProjects/TestOne/main.lua:1: in main chunk [C]: ? Process finished with exit code 1 ``` And when I run it (main.lua file) manually using the Corona Simulator it works fine. I am not sure what am I missing here ? Any pointers would be great :) Thanks I am attaching the screenshot too ![enter image description here](https://i.stack.imgur.com/zySaw.png)
Using IntelliJ IDE and Lua Programming Language to make Corona Applications
CC BY-SA 3.0
0
2011-05-31T08:21:06.617
2012-02-27T13:47:22.700
2011-06-06T12:37:39.937
151,501
435,597
[ "windows", "lua", "intellij-idea", "coronasdk" ]
6,185,167
1
null
null
5
1,423
For my internship I'm currently working on a web-based newsletter sending application in ASP.Net (C#). This application registers the open-rate of the send newsletters. I'm using the one by one transparent image method, explained in the following article: [http://www.pinpointe.com/blog/how-email-open-and-click-tracking-works](http://www.pinpointe.com/blog/how-email-open-and-click-tracking-works) to register the open-rate. The applicaton can register the amount of opens, and the date/time an email was opened. The only thing missing is the client (program) the email was opened with. This information can help the design team to code proper HTML for the newsletter, that is readable in the most common email clients. To track the client withs opened the email i'm currently using the user agent requesting the one by one image form our server. This information is stored in our database as shown below: ![UserAgent string in database](https://i.stack.imgur.com/6eL0T.png) Records 12 and 13 in this example holds an user agent "Microsoft Office Protocol Discovery". This user agent was registered when opening a newsletter in Microsoft Outlook. Is there a way to get more specific information about a client?
How to register the client who opened an email / a newsletter in ASP.net
CC BY-SA 3.0
null
2011-05-31T08:56:35.080
2011-05-31T10:42:45.947
null
null
709,363
[ "c#", "email", "user-agent" ]
6,185,169
1
null
null
9
17,594
![Screen Grab](https://i.stack.imgur.com/4JqJH.jpg) `microsoft visual c++ 2010 Express` I am unable to do it. I was writing some C code but it is compiled with errors. Please suggest some way to do it? I wrote this code: ``` #include "jni.h" #include "stdio.h" #include "HelloWorld.h" JNIEXPORT void JNICALL Java_HelloWorld_print(JNIEnv *env, jobject obj) { printf("This is a JNI tester"); return; } ``` I got the following error: > helloworld.cpp(1): fatal error C1083: Cannot open include file: 'jni.h' No such file or directory
How to write code to call JNI using microsoft visual c++
CC BY-SA 3.0
0
2011-05-31T08:56:38.613
2019-05-29T00:03:20.720
2011-05-31T09:40:42.227
592,182
682,662
[ "c++", "c", "visual-c++", "java-native-interface" ]
6,185,221
1
6,185,276
null
0
5,031
This is probably basic stuff, so if there's some kind of online reference for how html text & margins work, please just throw me a link. Anyway, I'm having some trouble defining exact margins for text. Below is an example of an image, a div containing text below it and more text below the div. Other margins are set to 0, and margins for the div is 10px top & bottom, 0 left & right. For reasons unknown to me, it turns out 16px top, 14px bottom. I could just compensate the error with the margin definitions, but I would actually like to know what's going on instead of treating the symptoms. ``` <img src="images/temp/img.png" /> <div><p>Testing</p></div> <h2>Siirry</h2> ``` And style for the div is ``` div { color:#f00; text-transform:uppercase; font-size:9px; line-height:9px; height:9px; margin:10px 0; overflow:hidden; } ``` Example image: ![Example](https://i.stack.imgur.com/orMru.png) EDIT: More info since my point didn't apparently come out very clearly: The margin is 10px according to tools such as Firebug. That is not what I'm asking. However because of the way the fonts are rendered, the box of the text is actually larger than the actual size of the text. This causes the VISUAL margin to be larger than the defined margin (which you can verify by measuring it in Photoshop or simnilar software). I'm looking for information about the relation between text's box size and actual size, so I can define margins properly.
HTML, CSS & Vertical text margins
CC BY-SA 3.0
null
2011-05-31T08:59:49.980
2011-05-31T12:04:16.673
2011-05-31T11:50:38.857
425,530
425,530
[ "html", "css", "text", "margins" ]
6,185,341
1
null
null
0
284
If `row[0]` is too long, the width of the yellow part does not adapt. How can I solve this? ![enter image description here](https://i.stack.imgur.com/fGzuh.jpg) ``` $(document).ready(function () { var b = $("#<%=TextBox1.ClientID %>").val(); $("#<%=txtSearch.ClientID%>").autocomplete('Search_CS.ashx?id=' + b, { max:10, formatItem: formatItem, // width:300 width: $("#p0").width() + $("#s0").width() } ); }); function formatItem(row) { return " <p id=\"p0\">"+row[0] +" </p>"+ " <span id=\"s0\">about&nbsp;13456Items</span>"; } ``` tks in advance!
jquery.AutoComplete.js adaptive width
CC BY-SA 3.0
0
2011-05-31T09:09:37.540
2011-05-31T09:46:22.143
2011-05-31T09:19:47.477
144,491
441,222
[ "javascript", "jquery" ]
6,185,407
1
6,297,994
null
2
1,516
I'm loading files into a WebView directly using `webView.loadUrl("http://whatever.com/file.swf");`. It works perfectly in the vast majority of cases. When loading a few specific files on certain devices, though, shortly after the Flash media begins to be displayed, my app closes with a Signal 11 fault caused by the Flash Player plugin. [Example LogCat dump here](http://pastebin.com/drx0ckT9). No Exception is thrown. The same thing happens if I load those files into the . When loading them into or the , however, shortly after the media begins to be displayed, the following is printed to LogCat: ``` 05-31 18:13:15.498: DEBUG/FONT(9183): WARNING: **************************** Detect FLEngine error 1 **************************** 05-31 18:13:15.558: DEBUG/(9183): ---------------------------------------------------------------> call AudioTrack stop() ``` and an error icon is displayed on-screen: ![Flash Player plugin error icon in stock Android browser](https://i.stack.imgur.com/mhc76.png) No SIGSEGV fault occurs, and the browser is not terminated. --- Does anyone know how I could do the exact same thing? Prevent the Flash Player plugin from causing the SIGSEGV fault, and simply handle the error myself, without the app being terminated? Any help would be greatly appreciated.
Prevent Flash Player fault in WebView, as is done by the Android Browser
CC BY-SA 3.0
null
2011-05-31T09:15:15.827
2011-06-09T19:12:17.110
null
null
683,501
[ "android", "webview", "flash", "segmentation-fault" ]
6,185,638
1
null
null
3
189
For example see edges in this image. where red arrow is indicating ![enter image description here](https://i.stack.imgur.com/KDiO3.png) Any solution for this?
At edges last 2 dots of dotted borders mixing to each other in Safari for iphone and ipad, any solution?
CC BY-SA 3.0
null
2011-05-31T09:35:23.710
2012-05-22T14:22:46.793
2012-05-22T14:22:46.793
187,100
84,201
[ "css", "safari", "mobile-safari", "mobile-website" ]
6,185,761
1
6,197,568
null
1
2,508
I use the cleanlooks style for my application which fits best the look and feel I want. The annoying thing a stumbled on is that the QHeaderView (horizontal header of a QTableWidget for instance) doesn't paint the resize handle between sections when running uner an Unix host. what I want: ![windows screenshot](https://i.stack.imgur.com/utwS0.png) what I get: ![unix screenshot](https://i.stack.imgur.com/7GOY3.png) I started to search a solution using style sheets but it seems there is no way to control the handle rendering. Do I have to play with borders style ? Is there anything obvious thing I am missing? I don't want to subclass QHeaderView or QStyle for such a little (trivial ?) problem. Any help appreciated.
Customizing QHeaderView resize handle
CC BY-SA 3.0
0
2011-05-31T09:47:13.373
2011-06-01T07:17:12.353
null
null
768,000
[ "css", "qt", "customization", "qheaderview" ]
6,185,980
1
null
null
0
1,084
I am just not able to figure out how to proceed: I am trying to build a model: - - It would perform the following: - If I have to write in Matlab, I would write something like this : ``` if (portA==1) PSDU_Data_Rate=1; elseif(portB==1) PSDU_Data_Rate=2; elseif (portC==1) PSDU_Data_Rate=5.5; elseif(portD==1) PSDU_Data_Rate=11; end ``` I am attaching, the part of the model which I am developing for the same functionality: ![Data Rate Calculate](https://i.stack.imgur.com/t7Plr.png) Any idea on how to proceed or code correction or suggestion on how it can be improved would be really helpful. Thanks
Case Statement in Simulink
CC BY-SA 3.0
null
2011-05-31T10:06:38.167
2011-06-08T08:03:27.953
null
null
276,859
[ "fpga", "simulink", "xilinx" ]
6,186,008
1
6,191,655
null
1
3,755
I use ASP.NET MVC in my application. Users can specify their own images, styles, scripts by including them on the page. But when they specify URL to the file which not exists then routing mechanism tries to find controller and action by URL to image or styles etc. I've added a method IgnoreRoute and specified there all extensions I don't want to handle by routing. It works correctly until URL doesn't starts with "Views/...". In this case URL passes into application and executes error 404 inside of application. But I want to handle this error with IIS. This can be tested with empty project. You can simply use this code for Global.asax.cs file: ``` using System; using System.Web.Mvc; using System.Web.Routing; namespace MvcApplication1 { public class MvcApplication : System.Web.HttpApplication { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute( "{*staticfile}", new { staticfile = @".*\.(jpg|gif|jpeg|png|js|css|htm|html|htc)$" } ); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = "" } // Parameter defaults ); } protected void Application_Start() { RegisterRoutes(RouteTable.Routes); } void Application_Error(object sender, EventArgs e) { } } } ``` Now we need to host this application at IIS, for example at [http://localhost/testmvc/](http://localhost/testmvc/) You can place a break-point inside of Application_Error method to see when error executes inside of application So now open test URL: [http://localhost/testmvc/test.css](http://localhost/testmvc/test.css) We can see that IIS handled that error: ![enter image description here](https://i.stack.imgur.com/27tge.png) Now we open another test URL with "/Views/..." in the path: [http://localhost/testmvc/Views/test.css](http://localhost/testmvc/Views/test.css) And we see that error was handled by ASP.NET: ![enter image description here](https://i.stack.imgur.com/EuMLf.png) So the question is: maybe there exists some setting to tell MVC to not handle URL with "Views" in the path?
ASP.NET MVC IgnoreRoute method doesn't work correctly when URL starts with "/Views/"
CC BY-SA 3.0
null
2011-05-31T10:09:39.907
2013-08-28T13:40:04.520
2013-03-01T00:14:49.067
727,208
421,891
[ "asp.net-mvc", "asp.net-mvc-routing", "ignoreroute" ]
6,186,090
1
6,195,945
null
8
1,681
I've implemented a sample app like the one [here](http://geekswithblogs.net/michelotti/archive/2011/04/21/wcf-web-api-is-pure-simplicity-with-nuget.aspx). It is a really basic app just to get things started. Everything works fine in IIS on my local machine, I've got it running on my IIS Express as well, but now come the tricky part. I do want to host this on [AppHarbor](https://appharbor.com/), but I get 404 error. I've started a [discussion](http://support.appharbor.com/discussions/problems/603-deploy-a-wcf-web-api-is-it-possible) on the support forum of AppHarbor, and they have taken a screen shot of the error when they run it. ![ScreenShot](https://i.stack.imgur.com/RSgtp.png) It seems like it is something wrong with the routing since the StaticFile handler is used, but I'm just guessing. Does anyone have any suggestions?
Hosting a WCF Web API app on AppHarbor?
CC BY-SA 3.0
0
2011-05-31T10:16:59.720
2011-06-01T03:25:53.920
2011-05-31T16:38:55.167
280,693
280,693
[ "iis", "iis-7", "appharbor", "wcf-web-api" ]
6,186,268
1
6,237,010
null
1
1,164
Image corner coordinates are known: - - - - (Basically map over Finland and a little bit of Sweden/Norway/Russia) I couldn't find a way to change image projection to Google maps overlay image, preferably using Python. It's possible to do that with [pyproj](https://web.archive.org/web/20141226153942/https://code.google.com/p/pyproj/) and [PIL](https://web.archive.org/web/20201111170816/https://www.pythonware.com/products/pil/), but I wasn't able to figure out how to do that. I also found [GDAL](https://gdal.org/), and more specifically [gdalwarp](https://gdal.org/gdalwarp.html), but couldn't find options for changing projection in a correct way. ![Example image](https://i.stack.imgur.com/Z7vVf.png)
Changing image projection using Python
CC BY-SA 4.0
0
2011-05-31T10:33:20.780
2022-06-07T17:27:14.363
2022-06-07T17:27:14.363
4,751,173
592,174
[ "python", "dictionary", "google-maps", "map-projections" ]
6,186,343
1
6,186,524
null
1
363
I want to remove splits (gaps) between buttons in . Segmented control is created with three images, each 60 pixels width, control is 180 pixels width. Style of segmented control is . But it still looks like this: ![enter image description here](https://i.stack.imgur.com/uNkSP.png) I have tried to set control width to 170 pixels or even less with no effect. Thank you for your help. Martin
UISegmentedControl without gaps between buttons
CC BY-SA 3.0
null
2011-05-31T10:41:31.370
2013-04-18T19:36:41.270
2013-04-18T19:36:41.270
1,655,144
329,242
[ "cocoa-touch", "uiimage", "uisegmentedcontrol", "gaps-in-visuals" ]
6,186,384
1
6,187,503
null
2
4,692
I got this ASPxGridView which is populated by a LinqServerModeDataSource. What I want to do is when creating a new row one (or more) of the fields should have their values generated by code-behind. I figured something like ``` protected void ASPxGridView1_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { e.NewValues["CompanyGuid"] = Guid.NewGuid(); } ``` But no luck there. Any advices? Thanks ![enter image description here](https://i.stack.imgur.com/NzxzU.png)
Pre-fill vaule when adding new row in ASPxGridView
CC BY-SA 3.0
null
2011-05-31T10:44:55.820
2011-05-31T12:23:02.847
null
null
296,568
[ "aspxgridview" ]
6,186,468
1
null
null
0
416
![enter image description here](https://i.stack.imgur.com/iFvLK.jpg) My Drop down HTML code looks like below, ``` <select onchange="if (this.value != '') {Add_Search_Param('f-' + this.value.split('|')[1], this.value.split('|')[0]); Refine();}"><option value="">Find by Model Number</option><option value="45|V709">V709 (6)</option><option value="52|V714">V714 (4)</option></select> ``` Currently the above HTML code displays a drop down which shows the following Find by Model Number, V709 (6), V714 (4). What i need done is read the Drop Down, display in the same page but instead of drop down make it clickable links, something like below. ``` <a href="V709 (6).htm">V709 (6)</a> ``` So is this possible ?
Tough Javascript Question : Read DropDown Values and Show it as clickable links in Javascript
CC BY-SA 3.0
null
2011-05-31T10:52:13.780
2011-05-31T11:05:54.677
null
null
580,950
[ "javascript" ]