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,231,294
1
6,231,334
null
90
51,635
How to add hint for the form field in django admin like in next example? ![form field description in django admin](https://i.stack.imgur.com/nciDr.png) (here: and descriptions are shown with gray color under field)
Form field description in django admin
CC BY-SA 3.0
0
2011-06-03T18:43:13.713
2020-12-26T17:13:41.740
null
null
378,767
[ "django", "django-admin", "django-forms" ]
6,231,350
1
6,236,122
null
1
1,407
I am currently working with a db that utilizes a subtype / supertype structure. I am wondering the best approach to handling INSERTs. Do I keep the population of multiple tables in the SQL itself, or with PHP, or even a combo of the two? I am using MySQL / PHP (w/ Yii Framework) Don't know whats up with a down vote. Didn't realize the importance of any tables as this is a general approach question. But here is an example. If a Party is created how do Business and or User get populated with that PartyId? SQL/PHP/Both? ![enter image description here](https://i.stack.imgur.com/amvRM.png)
INSERT with Subtype SuperType
CC BY-SA 3.0
0
2011-06-03T18:47:17.850
2011-06-07T02:10:06.447
2011-06-03T22:37:25.950
672,315
672,315
[ "php", "mysql", "database", "yii" ]
6,231,536
1
6,231,954
null
3
679
I've run into a bug with my app that I traced down to inconsistent text rendering between Chrome and Firefox 4. Chrome tells me that a certain string of text is 215px wide whereas Firefox 4 tells me its 218px wide: ![Chrome vs Firefox Text Rendering](https://leandesigns-misc.s3.amazonaws.com/ff_chrome_bug.png) A bit of searching [indicates](http://www.google.com/search?q=inconstent&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#sclient=psy&hl=en&client=firefox-a&rls=org.mozilla:en-US%3Aofficial&source=hp&q=firefox+4+text+rendering&aq=f&aqi=&aql=&oq=&pbx=1&bav=on.2,or.r_gc.r_pw.&fp=942a00f1e606939&biw=1920&bih=977) that the issue is with Firefox 4, not Chrome. The following code renders the text on the canvas element as well as via HTML and outputs the width: ``` <html> <head> <title>Firefox 4 Text Rendering Bug</title> <script type="text/javascript"> function draw(){ var canvas = document.getElementById('tutorial'); if (canvas.getContext){ var ctx = canvas.getContext('2d'); ctx.font = "bold 16pt Helvetica" ctx.fillText("MORE INFORMATION", 0, 16) alert(ctx.measureText("MORE INFORMATION").width); } } </script> <style type="text/css"> canvas { border: 1px solid black; } h2 {font-size: 16pt; font-family: Helvetica; font-weight: bold } </style> </head> <body onload="draw();"> <canvas id="tutorial" width="220" height="20"></canvas> <h2>MORE INFORMATION</h2> </body> </html> ``` Is there a way to render text consistently between the browsers?
Firefox 4 Text Rendering Bug
CC BY-SA 3.0
null
2011-06-03T19:07:22.947
2011-06-06T00:46:46.380
2017-02-08T14:32:23.043
-1
156,835
[ "canvas", "firefox4" ]
6,231,583
1
6,231,595
null
0
71
How come when using a YUI tree using `TaskNode` (illustrated below) my listener on `labelClick` isn't called, while it is called if I create the same tree with `TextNode`? ![YUI tree with TaskNode](https://i.stack.imgur.com/d0XGO.png)
When using YUI TaskNode, when clicking on labels, my listener on labelClick isn't called?
CC BY-SA 3.0
null
2011-06-03T19:12:48.370
2011-06-03T19:13:52.580
null
null
5,295
[ "tree", "yui" ]
6,231,700
1
6,231,797
null
0
146
Here is my code. Not sure what's awry. controller.h ``` #import <UIKit/UIKit.h> @interface ch4iOSPracticeViewController : UIViewController { UITextField *nameField; UITextField *numberField; } @property (nonatomic, retain) IBOutlet UITextField *nameField; @property (nonatomic, retain) IBOutlet UITextField *numberField; @end ``` controller.m ``` #import "ch4iOSPracticeViewController.h" @implementation ch4iOSPracticeViewController @synthesize nameField; @synthesize numberField; ``` delegate.m Everything properly released. ``` - (void)dealloc { [viewController release]; [window release]; [super dealloc]; ``` } ![Here is what it's supposed to look like.](https://i.stack.imgur.com/Rnk0p.png) ![here is what it looks like now.](https://i.stack.imgur.com/iGuFf.png)
iPhone Simulator Text Box Takes up Whole Screen
CC BY-SA 3.0
null
2011-06-03T19:25:03.493
2011-06-03T19:33:34.840
null
null
707,105
[ "iphone" ]
6,231,868
1
6,231,922
null
2
1,661
Using [ColorZilla](http://www.colorzilla.com/) I found an interesting feature. If I pick a color from firefox (bars,tabs or anything else of the browser) and then go to: > ColorZilla > Inspect Last Element > In Firebug Then I can see the markup,css,js that firefox uses in the firebug panel just like a website. ![enter image description here](https://i.stack.imgur.com/tUFDO.jpg) Is there any solution to view this code without use Colorzilla?
Inspecting firefox with firebug
CC BY-SA 3.0
null
2011-06-03T19:40:32.967
2015-02-17T23:06:54.927
2011-06-26T02:47:11.133
331,508
407,382
[ "firefox", "firebug", "inspect", "chromebug" ]
6,232,185
1
6,711,732
null
5
2,147
While going through SQL profiler, I noticed the following query generated by EF4. ``` exec sp_executesql N'declare @p int update [dbo].[User] set @p = 0 where (([UserID] = @0) and ([RowVersion] = @1)) select [RowVersion] from [dbo].[User] where @@ROWCOUNT > 0 and [UserID] = @0',N'@0 int,@1 binary(8)',@0=1,@1=0x000000000042DDCD ``` I am not sure why EF4 generates this while I am actually not updating any columns of the User table in that UnitOfWork. Running this query updates the which leads to OptimisticConcurrencyException in the next UnitOfWork. A quick googling led me to this [link](http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/e2444f09-d6e1-4fdc-84d3-aaa28dc98fd8/), which confirms that others have also run into this scenario without finding a solution yet. Would greatly appreciate any pointers. A sample code to replicate the issue. ![enter image description here](https://i.stack.imgur.com/Km7ga.png) User and Session tables have a relationship. Also, in EF4 I have set the property of RowVersion columns of both entities to . Below is a sample method to replicate the scenario. ``` private static void UpdateSession() { using (var context = new TestEntities()) { context.ContextOptions.ProxyCreationEnabled = false; var session = context.Users.Include("Sessions").First().Sessions.First(); session.LastActivityTime = DateTime.Now; context.ApplyCurrentValues("Sessions", session); context.SaveChanges(); } } ``` I see from Sql profiler the following queries being genrated by EF4. ``` exec sp_executesql N'update [dbo].[Session] set [LastActivityTime] = @0 where (([SessionID] = @1) and ([RowVersion] = @2)) select [RowVersion] from [dbo].[Session] where @@ROWCOUNT > 0 and [SessionID] = @1',N'@0 datetime2(7),@1 int,@2 binary(8)',@0='2011-06-20 09:43:30.6919628',@1=1,@2=0x00000000000007D7 ``` And the next query is weird. ``` exec sp_executesql N'declare @p int update [dbo].[User] set @p = 0 where (([UserID] = @0) and ([RowVersion] = @1)) select [RowVersion] from [dbo].[User] where @@ROWCOUNT > 0 and [UserID] = @0',N'@0 int,@1 binary(8)',@0=1,@1=0x00000000000007D3 ```
EF4 - update [Table] set @p = 0 where
CC BY-SA 3.0
0
2011-06-03T20:16:17.003
2012-07-27T00:31:35.013
2011-06-20T16:27:49.867
265,881
265,881
[ "entity-framework", "entity-framework-4" ]
6,232,239
1
null
null
1
1,965
I'm trying to make a website with a header that repeats along the entire page width, with the website's name centered in the header, and a logo slightly offset from the website name. If the screen width is too small to display the entirety of the logo, I just want it to cut off the logo to the right, otherwise the entire logo will be displayed (i.e. the monitor/window is big enough. What I don't want is to float the image to the right. I want it to, more or less, be absolutely positioned near the title. However, I can't figure out a way to do this. I can't use overflow-x or overflow-y (because of browser support) and the mark-up i currently have just widens the window with a scroll bar to accomodate the entire image (see screenshot). Here is the screen shot ![image](https://i.stack.imgur.com/zQ2xK.jpg) [http://img691.imageshack.us/img691/3188/screenshot03062011.jpg](http://img691.imageshack.us/img691/3188/screenshot03062011.jpg) Here is the mark up and CSS: ``` <div id="header-wrap"> <div id="header"> <img src="title-card.png" /> <img id="this-chick-logo" src="this-chick-logo.png" /> </div> </div> -- body { background: #dfb1e4; padding: 0px; margin: 0px; } #header-wrap { background: url('header-bg.png') repeat-x; width: 100%; height: 291px; } #header { margin: 0 auto; width: 1000px; text-align: center; } #header img { margin-top: 105px; } #header img#this-chick-logo { margin-top: -75px; margin-left: 680px; overflow: hidden; } ``` Thanks.
html image position forcing window width too wide
CC BY-SA 3.0
null
2011-06-03T20:21:28.333
2011-12-11T02:03:09.900
2011-12-11T02:03:09.900
234,976
783,328
[ "html", "css", "overflow", "positioning" ]
6,232,434
1
6,232,451
null
1
3,811
I have a custom UITextField with a UIImage as a background. Now when I type in a text into this UITextField and the cursor is blinking I get this: ![enter image description here](https://i.stack.imgur.com/w5Oml.png) I don't want to have a white image on the cursor blinking as it destroys the aesthetics. I tried playing around with this and tried setting the background view to have the same color as the image, however the issue is that the UITextField shape is always a rectangle. How do I solve this?
custom UITextField with image as a background blinking cursor issue
CC BY-SA 3.0
null
2011-06-03T20:39:53.440
2011-06-03T21:06:56.040
null
null
721,937
[ "iphone", "objective-c", "ipad", "uitextfield" ]
6,232,464
1
6,232,644
null
9
7,534
I'm creating a graphical timeline out of an excel document and I need to have small tags of the name of the event next to the marker for that event. Some of these are easy and are right justified but others are left justified and I need to figure out their width so that I can properly offset them. ``` window.drawString("7/4-Fourth of July",horizontalIndex-Offset,verticalIndex); ``` Currently I'm averaging the pixel width using an average of both font sizes 10 and 32, but this doesn't really cut it. Can someone help me get the exact offset?![enter image description here](https://i.stack.imgur.com/1T2Hc.jpg)
How to determine the length of a graphic string?
CC BY-SA 3.0
0
2011-06-03T20:43:46.627
2012-01-10T11:57:02.030
2012-01-10T11:57:02.030
203,657
783,280
[ "java", "swing", "graphics", "font-size" ]
6,232,568
1
6,252,988
null
0
234
I need to edit this HTML page and re-upload it. The problem is that somehow all of the newlines have been eliminated from it so that its just one long line. I'm using Notepad++ now, although I don't have to be. What is a good way to view and edit this HTML/PHP/Javascript source in a way that a reasonable human being can read it? Thanks! ![enter image description here](https://i.stack.imgur.com/oS7mR.jpg)
View nicely formatted version of HTML source
CC BY-SA 3.0
null
2011-06-03T20:53:23.580
2011-06-06T13:48:47.700
null
null
84,131
[ "dom", "text-editor", "notepad++", "text-formatting" ]
6,232,621
1
6,232,836
null
3
661
If I define a Scala class: ``` class X(i:Int) { println (i) } ``` How do I use this class in Java code? [EDIT] Actually, my problem is slightly more complicated I have an abstract class ``` abstract class X(i:Int) { println (i) def hello(s:String):Unit } ``` I need to use this in Java code. Is it possible to do it easily? [EDIT2] Consider the following code ``` object B { case class C(i:Int) } abstract class X(i:Int) { println (i) def hello(a:B.C):Unit } ``` In this case, the following java code gives an error in Netbeans IDE but builds fine: ``` public class Y extends X { public void hello(B.C c) { System.out.println("here"); } public Y(int i) { super(i); } } ``` The error I get is: ``` hello(B.C) in Y cannot override hello(B.C) in X; overridden method is static, final ``` Netbeans 6.8, Scala 2.8. As of now I think the only solution is to ignore the NB errors. Here is an image showing the exact error(s) I get: ![IDE error using scala code from java](https://i.stack.imgur.com/aApE9.jpg)
Calling scala abstract classes with parameters and inner classes from Java
CC BY-SA 3.0
0
2011-06-03T20:57:29.350
2011-07-01T08:24:40.090
2011-07-01T08:24:40.090
243,233
243,233
[ "java", "scala", "scala-java-interop" ]
6,232,817
1
6,232,829
null
0
377
I want to create a windows interface in ASP.net which include Taskbar, Windows(have option:Maximum, Minimize) I m also attaching the screen shot what i want to do. Is there is any 3rd party control??? ![enter image description here](https://i.stack.imgur.com/XZGAi.png)
How to create Windows User interface in asp.net
CC BY-SA 3.0
0
2011-06-03T21:20:45.500
2011-06-03T21:22:55.743
null
null
588,821
[ "asp.net", "windows", "interface", "controls", "taskbar" ]
6,232,809
1
null
null
2
490
By setting the lineHeightMultiple of a NSParagraphStyle that is used in a text view I'm getting drawing artifacts when selecting text. This is reproducible in TextEdit. More specifically: 1. Open TextEdit in rich text mode 2. Pick Courier 14 as the font 3. Set line height multiple to 1.4 4. Insert a bunch of text 5. Select a portion of text with the mouse until the top 6. Start decreasing the selection (moving the mouse down) In some lines, the selection is not totally cleared, leaving a 1px horizontal artifact behind (see screnshot). This also occurs with different fonts, font sizes as lineHeightMultiple values (although not all). Has anyone experience this or has any idea why this is happening? Thanks, Rúben ![screenshot](https://i.stack.imgur.com/dFx7V.png)
NSTextView lineHeightMultiple drawing issues
CC BY-SA 3.0
0
2011-06-03T21:20:14.167
2021-03-06T22:53:19.693
2020-06-20T09:12:55.060
-1
null
[ "cocoa", "nstextview", "textedit", "nslayoutmanager" ]
6,233,073
1
6,233,185
null
0
913
> [custom UITextField with image as a background blinking cursor issue](https://stackoverflow.com/questions/6232434/custom-uitextfield-with-image-as-a-background-blinking-cursor-issue) I have a UIImageView (the image has a pattern, gradient, and shadow in it). I have added a UITextField as a subview of this UIImageView and set the textField background to clear so that it's seen through, the code is: ``` UITextField *textField = [[UITextField alloc]initWithFrame:CGRectMake(10, 12, 359 , 36)]; textField.autocorrectionType = UITextAutocorrectionTypeNo; textField.textColor = [UIColor whiteColor]; textField.placeholder = @"USERNAME"; textField.backgroundColor = [UIColor clearColor]; textField.font = [UIFont systemFontOfSize:15]; textField.delegate = self; [username_background addSubview:textField]; ``` The issue is that when I start editing the UITextField, I got the following layout issues: Before editing: ![enter image description here](https://i.stack.imgur.com/GQmXM.png) When editing: ![enter image description here](https://i.stack.imgur.com/N8RZv.png)![enter image description here](https://i.stack.imgur.com/GA1Tv.png) I can fix this if I change the UIColor clearColor background to some other color, but apparently I find difficulties getting the appropriate color for the background. I did try doing: ``` [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"bkg-username.png"]]; ``` However, what I am getting is: ![enter image description here](https://i.stack.imgur.com/9paP8.png)
adding UITextField to UIImageView layout issue
CC BY-SA 3.0
null
2011-06-03T21:58:40.530
2011-06-03T22:16:53.347
2017-05-23T12:01:09.563
-1
721,937
[ "iphone", "objective-c", "uiimageview", "uitextfield" ]
6,233,134
1
6,233,358
null
0
2,327
Right now, I have a layout that looks like one of the two images below, depending on the exact size of the screen. Bot that on one, the Play Game! button is on top, and on the other, the copyright text is on top. ![enter image description here](https://i.stack.imgur.com/2fpyM.png) ![enter image description here](https://i.stack.imgur.com/0UP5q.png) What I'm trying to do is to put an image between the adview and the higher of the top text box/layout. Depending on different screen sizes, the entry that's on top can vary. I would like to not have this problem at all... I know how to put it below the imageview, but not put it above both items. So far, I've tried a relativeLayout that encloses the bottom variables, and told the image to be above that, but below the AdView. Problem is, the top of the RelativeView goes clear to the top, despite it being set to wrap_content and none of the below values go that high. I've also considered aligning either the top of the text to the top of the button, or visa versa, but I'm seeing a potentially ugly interface in my mind, one in which the top button might be bigger, or part of the copyright text obscured. So, I'm looking for one of two solutions. A way to tell my image to be above 2 items, the button and the text, or some way to wrap the context such that I can just be above the wrapped value. Here's the relevant XML code I've tested. ``` <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <com.google.ads.AdView android:id="@+id/adView" ads:loadAdOnCreate="true" ads:adSize="BANNER" ads:adUnitId="@string/admob_unit_id" android:layout_width="wrap_content" android:layout_height="wrap_content" ></com.google.ads.AdView> <ImageView android:src="@drawable/start_logo" android:gravity="center" android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/logo_view" android:layout_below="@+id/adView" android:layout_above="@+id/buttons_copyright"></ImageView> <RelativeLayout android:id="@+id/buttons_copyright" android:layout_width="fill_parent" android:layout_alignParentLeft="true" android:layout_alignParentBottom="true" android:layout_alignParentTop="false" android:layout_height="wrap_content"> (NOTE: LOTS OF STUFF GOES HERE) </RelativeLayout> </RelativeLayout> ```
How can I set a layout_Above with 2 values?
CC BY-SA 3.0
null
2011-06-03T22:06:22.810
2011-06-03T23:02:20.077
2011-06-03T22:56:01.683
544,198
544,198
[ "android", "android-layout", "android-relativelayout", "android-xml" ]
6,233,204
1
6,233,480
null
0
297
![enter image description here](https://i.stack.imgur.com/kuin7.png) In the attached screenshot, the grey areas around the activity are translucent and have activity is shown with the following xml. ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@color/candidate_normal" android:scrollX="-100dp" android:scrollY="-100dp" android:onClick="backgrndListner"> <LinearLayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/overlay1" android:clickable="false"> <LinearLayout android:layout_width="1100dp" android:layout_height="wrap_content" android:orientation="horizontal"> <ImageButton android:id="@+id/homeButton" android:src="@drawable/home" android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="true"/> <LinearLayout android:layout_width="1100dp" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:textSize="18dp" android:text="Header" android:editable="true" android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/headerInfo" android:layout_marginLeft="25dp" android:layout_marginTop="2dp"/> <TextView android:id="@+id/yellowCardItem" android:textSize="30dp" android:textStyle="bold" android:text="Yellow Card Item" android:layout_marginTop="25dp" android:layout_marginLeft="300dp" android:layout_height="wrap_content" android:layout_width="wrap_content" android:gravity="center_horizontal"/> </LinearLayout> <ImageButton android:id="@+id/statusComplete" android:src="@drawable/notification_done_red" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="right|top"/> </LinearLayout> <LinearLayout android:layout_width="1100dp" android:layout_height="wrap_content" android:orientation="vertical"> <TextView android:id="@+id/yellowCardDescription" android:textSize="20dp" android:padding="30dp" android:layout_marginLeft="50dp" android:layout_marginRight="50dp" android:layout_width="wrap_content" android:layout_height="300dp" android:gravity="center_horizontal" android:text="Description should come here" android:textColor="#FF0000"/> </LinearLayout> <LinearLayout android:id="@+id/mediaItems" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_marginLeft="200dp"> </LinearLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_marginTop="10dp"> <ImageButton android:id="@+id/share" android:src="@drawable/share" android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="true" android:layout_gravity="right|top" android:layout_marginLeft="1185dp"/> </LinearLayout> </LinearLayout> ``` The problem that I am facing is that whenever I touch the white area(where the activity is present) it senses the which I just want for the areas in grey(highlighted in red colors). I just want the touch to be activated for the area outside the white activity area for hte complete screen. Any help would be really appreciated. yout>
On click function for the border greyed around the activity?
CC BY-SA 3.0
0
2011-06-03T22:17:51.520
2011-06-03T23:05:17.493
null
null
402,637
[ "android", "android-layout" ]
6,233,270
1
null
null
7
3,810
### I'm using jQuery Isotope to fill in the spaces on a multi-width multi-height grid (equal proportions). The grid is sorted using ui-sortable with a button to toggle back to Isotope after sorting. There are some sort orders that leave empty blocks. How can I use Isotope to fill in the spaces? I've experimented with multiple Isotope layout methods. ### See http://jsfiddle.net/zdSYG/41/ ``` $(document).ready(function() { var $itemList = $('#sortable'); $itemList.isotope({ resizesContainer: false, masonry: { rowHeight: 250, columnWidth: 325 } }); $('#wp-admin-bar-edit').click(function() { $itemList.isotope('destroy'); $itemList.sortable({ //Do Ajax Stuff with UI-Sort Order }); }); }); //Toggle back to Isotope after jQuery UI-Sortable Ajax stuff $(document).ready(function() { $('#wp-admin-bar-sort').click(function() { $('#sortable').isotope({ resizesContainer: false, masonry: { rowHeight: 250, columnWidth: 325 } }); }); }); ``` ## Udate: The desired affect is achieved in Firefox 4, and IE 8 & 9 but the issue seems to be with Google Chrome (Latest version stable channel). ## Chrome: ![enter image description here](https://i.stack.imgur.com/lQzVD.png) ## Firefox 4: ![enter image description here](https://i.stack.imgur.com/ekYWt.png)
jQuery Isotope Possible Chrome Bug?
CC BY-SA 3.0
0
2011-06-03T22:27:49.360
2012-05-01T08:38:47.657
2012-05-01T08:38:47.657
230,167
427,421
[ "jquery", "jquery-isotope" ]
6,233,343
1
6,238,366
null
0
1,191
I am currently trying to use `pHash.dll` on [http://phash.org](http://phash.org/) Unfortunately it was written in C++, I'd have to use `DLLImport` But the problem I am having is how to register `pHash.dll` (compiled thru VS2010/C++) I've tried to register using `regsrv32` and have been fruitless giving an error message. ![enter image description here](https://i.stack.imgur.com/DFJnf.png) Now, How can i register `pHash` to show up in COM tab?![enter image description here](https://i.stack.imgur.com/iqMmI.jpg)
How to add unmanaged dll to show up in Add Reference's COM tab
CC BY-SA 3.0
null
2011-06-03T22:40:20.563
2011-06-04T17:39:38.747
2011-06-04T17:28:06.587
4,035
4,035
[ ".net", "com", "reference", "phash" ]
6,233,418
1
null
null
4
1,373
I want the two vertical borders in this mockup to be the same height (i.e., the height of the containing block): ![enter image description here](https://i.stack.imgur.com/9sA8r.png) As you can see, the left border looks good (because the left column is the tallest column), but the right border is too short (since the middle column is shorter than the left column) I know I can do this by giving the containing block an explicit height and giving each child a height of 100%, but I'd prefer not to do this – instead I'd like to allow for different height "forum thread holders" without ugly scrollbars / overflow
Columns with full-height vertical borders
CC BY-SA 3.0
0
2011-06-03T22:53:32.667
2011-06-03T23:00:54.353
null
null
25,068
[ "css" ]
6,233,451
1
null
null
1
116
There's a website I built a few years ago using sIFR. Nothing's really changed on it at all in terms of styling — just some content added/removed edited via XML. The site owner emailed me today asking why suddenly some of the text (rendered in sIFR3) is breaking like this: ![problem with sIFR rendering](https://i.stack.imgur.com/B1Q6S.png) I could not reproduce this on of my browsers. It was happening to him in both FF and Safari (Mac). We are using the same browser versions on the same OS. He was on OS X 10.6.6 but upgraded to 10.6.7 while were trying to narrow down what would cause it. He still got the "incorrect" version. I downgraded my Flash plugins to the exact version he had on his computer, and I still had the "correct" version. He checked all the other computers at his office, and all rendered it correctly as well. So in two environments where all of these things were identical: - - - What other possibilities could be causing the discrepancy?
What could cause sIFR text to display differently on different systems?
CC BY-SA 3.0
null
2011-06-03T22:59:37.567
2011-06-08T20:34:34.263
null
null
272,209
[ "sifr", "sifr3" ]
6,233,679
1
null
null
1
6,297
I have a simple plane `Mesh` that is 100x100. Following the libgdx tutorials I've successfully mapped a texture over the mesh. However, it looks odd right from the start, and even stranger when I zoom out. What I'm aiming for is a simple grid pattern. ## Here's the plane zoomed in: ![Zoomed in](https://i.stack.imgur.com/GCU7J.png) ## Now zoomed out: ![Zoomed out](https://i.stack.imgur.com/pBD2L.png) The texture itself is a small 64x64 square, outlined. My `Grid` class looks like this (Grid extends gdx.graphics.Mesh): ``` private final int HALFWIDTH = 50, HALFLENGTH = 50; private Texture texture; public Grid() { super( true, 4, 4, new VertexAttribute(Usage.Position, 3, "a_position"), new VertexAttribute(Usage.ColorPacked, 4, "a_color"), new VertexAttribute(Usage.TextureCoordinates, 2, "a_texCoords") ); setVertices(new float[] { -HALFWIDTH, -HALFLENGTH, -2f, Color.toFloatBits(255, 0, 0, 255), -HALFWIDTH, HALFLENGTH, HALFWIDTH, -HALFLENGTH, -2f, Color.toFloatBits(0, 255, 0, 255), HALFWIDTH, -HALFLENGTH, -HALFWIDTH, HALFLENGTH, -2f, Color.toFloatBits(0, 0, 255, 255), -HALFWIDTH, HALFLENGTH, HALFWIDTH, HALFLENGTH, -2f, Color.toFloatBits(0, 255, 255, 0), HALFWIDTH, HALFLENGTH }); setIndices(new short[] { 0, 1, 2, 3 }); this.texture = new Texture( Gdx.files.internal("assets/grid.png") ); this.texture.setWrap( TextureWrap.Repeat, TextureWrap.Repeat ); this.texture.setFilter( TextureFilter.Linear, TextureFilter.Linear ); } void draw() { Gdx.graphics.getGL10().glEnable(GL10.GL_TEXTURE_2D); this.texture.bind(); render(GL10.GL_TRIANGLE_STRIP, 0, 4); } ```
Libgdx texture mapping
CC BY-SA 3.0
null
2011-06-03T23:44:12.443
2013-12-18T00:05:28.307
2013-12-18T00:05:28.307
1,895,303
408,178
[ "java", "libgdx", "texture-mapping" ]
6,233,841
1
6,233,891
null
2
1,058
I have the following situation: 1) 1 X PhotoTableViewController to display a list of photos (one photo per cell) like what Instagram does 2) A refresh button in the navbar of PhotoTableViewController to do a table reload (top right) 3) An option button in the navbar of PhotoTableViewController to select a list of options e.g. "Latest photos, most popular etc) (top left) ![enter image description here](https://i.stack.imgur.com/fX9ex.png) 4) A "Load more" cell at the end of the list (limit to 20 photos) to append the next set of photos to the table view. ![enter image description here](https://i.stack.imgur.com/tmFPo.png) The photos are obtained from a server and comes in a form of a JSON file. Query: I believe that all 3 buttons (point 2,3 and 4) essentially want to do the same thing, which is to refresh and reload the table. Also my understanding is that this is a common sort of practice in a few apps, so I would like some advise on the following 1) How do I implement this sort of 'Refresh' and 'Reload' method in the most effective way without repeating code. 2) After I click each button, the intention is to sort of have a 'Blank page' with a spinner and show only the reloaded table after processing is completed. I am thinking of popping the current tableview controller at point of button click and push a new controller back once processing is completed. Does this make sense? Or is there a better way of doing it?
How to implement "Refresh" and "Reload" Table (re-factoring of code)
CC BY-SA 3.0
null
2011-06-04T00:24:31.427
2011-11-29T14:27:05.363
2011-06-05T07:12:46.057
603,977
683,898
[ "objective-c", "cocoa-touch", "ios", "uitableview" ]
6,234,202
1
6,234,275
null
2
2,495
I have found some nice dark themes for editing code in Eclipse (screenshot below), but they only apply to the code window itself. The package explorer and outline view are still white background. It would be great if there was some way to make everything dark, even the toolbar at the top. Is this possible? Thanks, Jonah ![](https://i.stack.imgur.com/z3WaX.png)
Skinning Entire Eclipse GUI, Not Just Code Window
CC BY-SA 3.0
null
2011-06-04T01:56:48.540
2013-03-03T12:37:02.803
null
null
438,615
[ "java", "eclipse" ]
6,234,260
1
6,236,722
null
1
845
I am rendering a complex scene in WebGL (180 meshes) corresponding to a car model (Nissan GTX) ![car](https://i.stack.imgur.com/ooZmA.png). However when I move the camera around , it seems as if triangles were missing ![far](https://i.stack.imgur.com/MHEfN.png), These 'missing triangles' seem to jump randomly over the surface. Can this be a depth buffer problem or a normal calculation problem? I have no idea. Nevertheless, if I zoom-in near the surface of the model, all triangles are there ![zoom](https://i.stack.imgur.com/s9KCy.png). Does anyone have had this problem? any tips?!
WebGL: missing triangles when moving camera
CC BY-SA 3.0
0
2011-06-04T02:14:11.893
2011-06-05T08:56:51.583
2011-06-04T06:41:07.163
44,729
369,747
[ "opengl-es", "3d", "webgl" ]
6,234,519
1
6,235,747
null
3
3,476
I need to write a simple app for a [Symbol MC70 scanner](http://www.nationalbarcode.com/Symbol/Symbol-MC70-Specifications.htm) My device is loaded with: Microsoft Windows Mobile 6.1 Premium I have VS 2010 Premium on my desktop. When installing the Window Mobile 6 SDK I get this error: ![enter image description here](https://i.stack.imgur.com/DmdsZ.png) I read this article: [Windows Mobile 6 Standard SDK Refresh install issue on Visual Studio 2010 Professional Beta 2](https://stackoverflow.com/questions/1779874/windows-mobile-6-standard-sdk-refresh-install-issue-on-visual-studio-2010-profess) Using WinForms I can knock this app out in 3 hours. I'm hoping I don't burn 3 days fooling around with SDK's etc. Would it be best to try and update the devise to Mobile 7 and use VS 2010? Thanks so much for any help!!
Best way to write a Mobile 6 app with Visual Studio 2010
CC BY-SA 3.0
null
2011-06-04T03:35:34.677
2013-03-16T02:54:10.673
2017-05-23T12:13:39.697
-1
87,302
[ "mobile", "windows-mobile", "windows-mobile-6", "windows-mobile-6.1" ]
6,234,526
1
6,234,619
null
0
454
I'm using XCode 4 and I just created a subclass of UIViewController, status bar enabled (grey), and dropped in a MKMapView. My UIView has x,y and w,h of (0,20) / (320,460) Then I click on my MKMapView and it has coordinates of: (0,0) / (320, 460) Is there a reason that IB doesn't resize itself so the MKMapView will take up the entire screen by making it (0,0)/(320, 480), or putting itself at (0,20)/(320,460)? The picture below should identify my problem. Sorry if I am missing something super obvious. Thanks. ![enter image description here](https://i.stack.imgur.com/Jex2b.png)
Dropping MKMapView into Interface Builder
CC BY-SA 3.0
null
2011-06-04T03:37:34.640
2011-06-04T06:06:38.937
2011-06-04T06:06:38.937
207,524
207,524
[ "iphone", "interface-builder", "mkmapview" ]
6,234,539
1
6,234,551
null
3
3,290
I am trying to center a spinner in the middle of the page using the code below. ``` self.aSpinner.center = self.view.center; ``` However when when I run the program, the spinner does not seem to be in the center ![Screen shot of iPad simulator; activity indicator in blank view to right of center](https://i.stack.imgur.com/3bgD4.png) Is there any way to fix this? EDIT: I found the problem. It's not that the spinner is not in the center, but instead the subview has different bounds than its superview. ![Screenshot of iPad simulator; view with subviews and activity indicator to right of center](https://i.stack.imgur.com/DqWMl.png) I am doing something like this in my code: ``` self.navcon = [[UINavigationController alloc]init]; self.photoViewTable = [[PhotoTableViewController alloc]init]; self.loadingPage = [[LoadingPageViewController alloc]init]; [self.photoViewTable.view addSubview:loadingPage.view]; [navcon pushViewController:photoViewTable animated:NO]; [self.window addSubview:navcon.view]; ``` How can I set the size of `loadingPage` view to be equal to the parent view?
Activity indicator not in center of the subview (which is not same size as parentview)
CC BY-SA 3.0
null
2011-06-04T03:40:35.357
2015-06-19T11:04:16.693
2011-06-05T07:11:55.603
603,977
683,898
[ "objective-c", "cocoa-touch", "ios", "uiactivityindicatorview" ]
6,235,038
1
6,235,099
null
6
12,154
I have converted HTML to DOC format using PHP. kindly view the below screen shot. ![enter image description here](https://i.stack.imgur.com/hohBT.jpg) My Problem is Here is my set of code. ``` header("Content-type: application/vnd.ms-word"); header("Content-Disposition: attachment;Filename=document_name.doc"); echo $html = '<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>HTML TO WORD</title> </head> <style type="text/css"> .table { page-break-after: always; } </style> <body> <table width="600" border="1"> <tr> <td height="105">&nbsp;</td> </tr> <tr> <td style="text-align:center; font-size:30px;color:#ed6500;"><b>Title</b></td> </tr> <tr> <td style="text-align:center; color:#595959;">Author: <span style="color:#9d402b; text-decoration:underline;">Author name</span></td> </tr> </table> <table width="600" border="1"> <tr> <td>Table Of Contents</td> </tr> <tr> <td>&nbsp;</td> </tr> <tr> <td>Category 1</td> </tr> <tr> <td style="padding-left:30px;">Sub Category 1</td> </tr> </table> </body> </html>'; ``` How can this be done? Thanks in advance...
PageBreak in converting HTML to doc and docx fromat - PHP
CC BY-SA 3.0
0
2011-06-04T05:53:36.803
2011-06-04T06:11:45.993
null
null
154,137
[ "php", "html", "doc" ]
6,235,140
1
6,235,184
null
0
6,992
In the attached picture of a fragment layout from google's blog I have a listview in my code. My question here is to set the first two items(Henry IV and Henry V) with background colors RED and others remain as defaul backgroudn values. Is this possible? Any help would be really appreciated. Thanks, Sana. The code that I use to get the ListView is ``` Log.i(TAG, "Selected item position = "+getListView().getCount()+" Child count = "+getListView().getChildCount()); for (int i=0; i<getListView().getCount();i++) { Log.i(TAG, "Item id = "+getListView().getItemIdAtPosition(i)); View v = getActivity().findViewById((int) getListView().getItemIdAtPosition(i)); View v1 = getListView().getChildAt(i); Log.i(TAG, "Condition = "+(v == null)); //Here I get the display as true Log.i(TAG, "Condition1 = "+(v1 == null)); //Here I get again a true, so basically both are none! } ``` ![enter image description here](https://i.stack.imgur.com/RBPvX.png)
ListView - Set first two items with a different background color
CC BY-SA 3.0
null
2011-06-04T06:22:50.287
2011-06-04T11:06:19.970
2011-06-04T06:32:51.797
402,637
402,637
[ "android", "android-listview" ]
6,235,161
1
6,235,335
null
0
138
![enter image description here](https://i.stack.imgur.com/KFCEW.jpg) Hi everyone, This is the problems i'm getting. What type of error is this? Is this a Browser issue? Is there any solution? any help would appreciated.
Error: Bad Request while submitted a form
CC BY-SA 3.0
null
2011-06-04T06:29:12.283
2011-06-04T07:16:17.687
null
null
200,862
[ "php", "apache", "cookies" ]
6,235,255
1
6,235,300
null
2
436
I followed a tutorial to make a Custom Control. What I basically did was make a new project, add a file `CategoryBar.cs` and a directory called `Themes` with a file `Themes\generic.xaml` (with Compile type set to 'resource'). Then I wrote a class `CategoryBar.cs`, filled up the `generic.xaml` with a ResourceDictionary. Let's call this project the 'UILib': ``` <?xml version="1.0" encoding="utf-8" ?> <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows" xmlns:local="clr-namespace:ErnestUILib"> <Style TargetType="local:CategoryBar"> <Setter Property="Background" Value="Black" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="local:CategoryBar"> <Grid x:Name="GridView" Background="{TemplateBinding Background}" Margin="0,0,0,8"> <!-- The grid rowdefs, coldefs and whatever makes up the grid --> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> </ResourceDictionary> ``` And it all runs completely fine in a project where I add a reference to this library. I added the attribute `xmlns:EULib="clr-namespace:UILib;assembly=UILib"` to `<phone:PhoneApplicationPage .. />` and it's working fine. Now, I wanted to implement another control (as I want to have one separate and exactly one library for custom UI controls). So now my generic.xaml looks like: ``` <?xml version="1.0" encoding="utf-8" ?> <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows" xmlns:local="clr-namespace:ErnestUILib"> <!-- THE NEW CUSTOM CONTROL --> <Style TargetType="local:PaginationBar"> <Setter Property="Background" Value="Black" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="local:PaginationBar"> <Grid x:Name="GridView" Background="{TemplateBinding Background}" Margin="0,0,0,8"> <!-- The grid rowdefs, coldefs and whatever makes up the grid --> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> <!-- THE PREVIOUS CUSTOM CONTROL --> <Style TargetType="local:CategoryBar"> <Setter Property="Background" Value="Black" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="local:CategoryBar"> <Grid x:Name="GridView" Background="{TemplateBinding Background}" Margin="0,0,0,8"> <!-- The grid rowdefs, coldefs and whatever makes up the grid --> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> </ResourceDictionary> ``` Here, I've created a class `PaginationBar` in `PaginationBar.cs` and it's all setup, but when I try to use it in my application's xaml file, it shows a white-filled rectangle in the designer view with a cross at it's top left corner and it says that an exception was caused 'Control_TargetTypeMismatch'. After a few trickeries of mine, nothing still worked, but the Designer just doesn't load when I use `<UILib:PaginationBar .. />` and instead gives an error `System.Reflection.TargetInvocationException` (Exception has been thrown by the target of an invocation). When I run the project, it gives some XamlParseException error. This is the only exception I'm able to get some details out of, none of which I think are even remotely useful. Anyhow, this is what I get with the XamlParseException:![XamlParseExceptionDetails](https://i.stack.imgur.com/b2bRp.jpg) I have no clue how to proceed. Any help is greatly appreciated. Thanks in anticipation :)
Making multipe custom controls in WP7 Silverlight gives Weird exceptions
CC BY-SA 3.0
null
2011-06-04T06:50:38.567
2011-06-04T12:34:13.263
2011-06-04T07:31:57.427
183,133
183,133
[ ".net", "silverlight", "xaml", "windows-phone-7", "xamlparseexception" ]
6,235,365
1
6,235,395
null
1
133
Thanks a lot for your help. I really need to make it clear :( ![enter image description here](https://i.stack.imgur.com/NJmRe.jpg)
What do we call this diagram as?Do we call it as E-R diagram?
CC BY-SA 3.0
null
2011-06-04T07:14:31.777
2011-06-04T07:20:18.370
2011-06-04T07:17:39.130
383,167
783,712
[ "diagram", "entity-relationship" ]
6,235,475
1
6,235,600
null
1
6,721
![enter image description here](https://i.stack.imgur.com/xIyla.png) Hello, I have to implement a form like above. Apart from other required fields, text boxes near the check boxes are not required to be filled in unless the associated check boxes are checked. How can i implement this. Thanks...
ASP.NET Custom Required Field Validator With CheckBox
CC BY-SA 3.0
null
2011-06-04T07:39:27.543
2016-02-16T15:53:37.557
2011-06-04T08:14:20.813
97,010
253,401
[ "javascript", "asp.net", "validation" ]
6,235,735
1
6,275,102
null
40
56,162
I want to add the following buttons to my website for providing users with option to login using more services like Google, Facebook etc. ![Login Options](https://i.stack.imgur.com/JhwNZ.png) Please answer the following questions: 1. How can I add various services like this free of cost? (Please note that I do not want to use any paid service like Janrain and ) 2. How can I store user information of the user (like email, phone no.) that are stored in the accounts to my database? 3. Please provide any links/libraries that can be used. I appreciate any other information that you can provide. Thank you!
How to add Social login services from Google, Facebook, Yahoo etc. to my website?
CC BY-SA 3.0
0
2011-06-04T08:50:01.893
2017-03-13T07:35:18.177
null
null
722,531
[ "authentication", "openid", "single-sign-on" ]
6,235,756
1
6,235,835
null
-2
192
![enter image description here][1] I want to make a tab layout application, in which there are four tabs. Now I would like to set multiple layouts in one tab. For example, the example below of a tab layout they make four tabs, ![I like turtles](https://i.stack.imgur.com/6cK6h.png) Now in the first tab (Timeline) make a button that give next page link, press next button and other layout display in the first tab (timeline tab). So what thing do I need to do?
Tab layout problem
CC BY-SA 3.0
0
2011-06-04T08:54:30.327
2011-07-11T21:54:02.083
2011-07-11T21:51:55.190
63,550
863,257
[ "android" ]
6,235,772
1
6,277,857
null
1
1,812
Good Evening, I'm building a website which will will look something like this: ![Mockup](https://i.stack.imgur.com/wVRk7.png) So probably a widget-centred web-framework would be best... Which C++ web-framework supports cookies (for user-login [session] storage+config storage) and SQL (MySQL or SQLite)? My information about Wt was outdated, it looks like they now have full-support for cookies ([http://redmine.webtoolkit.eu/boards/1/topics/2111](http://redmine.webtoolkit.eu/boards/1/topics/2111)) CppCMS however has a vibrant community, and there product seems to scale better. I will do the diplomatic thing, create a project using both frameworks. It will be a cutdown version with only: - - - - Should be an interesting project... I wonder if any have done this in the past?!
C++ Web-framework with cookie and SQL support
CC BY-SA 3.0
0
2011-06-04T09:00:03.087
2012-08-28T04:41:28.587
2011-11-14T18:33:56.100
229,044
587,021
[ "wt", "cppcms" ]
6,235,810
1
null
null
1
338
I have an UINavigationBar, and I'm trying to add the user avatar to before the text, and I want 't so it's just before, and thought if I add it with IB, if the tabBar title is longer it would look ugly, so how could I add it on the front of the navBar? It would look like this of Osfoora: ![image before title](https://i.stack.imgur.com/yo6e7.jpg)
Is possible to add an UIImageView to an UINavigationBar title?
CC BY-SA 3.0
null
2011-06-04T09:06:53.690
2011-06-04T13:24:40.827
null
null
601,909
[ "iphone", "cocoa-touch", "ios4" ]
6,235,938
1
6,236,019
null
16
25,458
### HTML: ``` <div class="imgcontainer"> <ul> <li><img src="1.jpg" alt="" /></li> <li><img src="2.jpg" alt="" /></li> ..... </ul> </div> ``` I'm coding a simple gallery page by creating unordered list and each list item of it contains an image. ``` ul li { float: left; } ``` I set the width of the container as "max-width" so I can make possible to fit the list items (images) to the browser width.. meaning that they will be re-arranged when the browser window re-sized. ``` .imgcontainer{ max-width: 750px; } ``` Now the problem is those images or list items are not aligned to center, they are aligned to the left of .imgcontainer body (colored gray in the attached link below), leaving a space on the right when the window re-sized! ![enter image description here](https://i.stack.imgur.com/mhAXw.jpg) How can I center those images every time the window resized? Here's the whole page/code you can preview it or edit it at JS Bin [http://jsbin.com/etiso5](http://jsbin.com/etiso5)
Centering floating list items <li> inside a div or their <ul>
CC BY-SA 3.0
0
2011-06-04T09:33:27.140
2013-08-02T17:24:33.437
2020-06-20T09:12:55.060
-1
743,506
[ "css", "gallery", "css-float", "center", "listitem" ]
6,236,054
1
6,237,735
null
19
5,521
I'm applying a blur effect to an image in WPF like so: ``` <Image ClipToBounds="True"> <Image.Effect> <BlurEffect Radius="100" KernelType="Gaussian" RenderingBias="Performance" /> </Image.Effect> </Image> ``` As you can see, the radius is large, because the image is large and I need it to be blurry. However, for a radius that large I'm getting a light frame around my image as seen in the attached image. How can I suppress this? In case you're wondering: The result is the same not matter the `RenderingBias`. A border is also produced in quality-mode. ![White border around image](https://i.stack.imgur.com/5LDP5.png)
Gaussian blur leads to white frame around image
CC BY-SA 3.0
0
2011-06-04T09:59:04.620
2023-02-13T10:15:05.537
2011-06-04T16:12:48.353
546,730
117,362
[ "c#", "wpf", "image", "blur" ]
6,236,206
1
6,237,221
null
0
128
I have categories saved in databse, ex. ``` Category 1 Category 2 . . Category 10 ``` ![enter image description here](https://i.stack.imgur.com/Z8tTM.jpg) Now my menus are, ``` <ul> <li><a href="/home/Category_page.php?id=1" >Category name</a></li> <li><a href="/home/Category_page.php?id=2" >Category name</a></li> <li><a href="/home/Category_page.php?id=3" >Category name</a></li> <li><a href="/home/Category_page.php?id=4" >Category name</a></li> <li><a href="/home/Category_page.php?id=5" >Category name</a></li> <li><a href="/home/Category_page.php?id=6" >Category name</a></li> <ul> ``` i wanted to do like this ``` <ul> <li><a href="/home/Category_name" >Category name</a></li> <li><a href="/home/Category_name" >Category name</a></li> <li><a href="/home/Category_name" >Category name</a></li> <li><a href="/home/Category_name" >Category name</a></li> <li><a href="/home/Category_name" >Category name</a></li> <li><a href="/home/Category_name" >Category name</a></li> <ul> ``` category names will be different, in href only category name is given, in .htaccess i can redirect to another page,like > Rule in .htaccess:- ``` RewriteRule ^home/([a-zA-Z0-9_-]+)$ /details.php/$1.php ``` Here on details page should i check category name in database to fetch details? or what are the another options? I don't want category id in url.
url assistance while web development using php
CC BY-SA 3.0
null
2011-06-04T10:34:20.350
2011-06-04T14:15:24.413
2011-06-04T13:34:42.673
750,634
750,634
[ "php", ".htaccess", "url-rewriting" ]
6,236,238
1
6,237,193
null
3
753
Is there a way to whiten out the background of the axis label so that when it crosses the axis line itself, the latter does not run through it? For example, this script (the best I managed so far) ``` #!/usr/bin/python import matplotlib.pyplot as plt xx=[1,2,3] yy=[2,3,4] dy=[0.1,0.2,0.05] fig=plt.figure() ax=fig.add_subplot(111) ax.errorbar(xx,yy,dy,fmt='ro-',ms=6,elinewidth=4) ax.set_xlim([0.,3.4]) ax.set_ylim([0.,4.4]) ax.set_xlabel(r'$T/t$',fontsize=16) ax.set_ylabel(r'$S(\mathbf{Q})L^{1+\eta}$',fontsize=16) # position the axis labels ax.xaxis.set_label_coords(1,0) ax.yaxis.set_label_coords(0.1,0.93) ax.yaxis.get_label().set_rotation('horizontal') ax.yaxis.get_label().set_backgroundcolor('w') #ax.yaxis.get_label().set_zorder(222) #doesn't do the trick plt.show() ``` produces almost what I'm looking for, but still the y-axis runs over the label: ![the y-axis label](https://i.stack.imgur.com/OyNrS.png).
Using matplotlib, how do I whiten the background of the axis label?
CC BY-SA 3.0
null
2011-06-04T10:39:47.733
2011-06-04T14:54:57.180
2011-06-04T14:54:57.180
487,339
143,765
[ "python", "matplotlib" ]
6,236,391
1
6,236,435
null
3
2,791
I have a folder containing about 2500 PNG images, with no transparency. Every image is about 500 x 500 (some are 491 x 433, others 511 x 499 etc). I want to programatically downsize every image to 10% of its original size, and to set the white background of every image as the transparent color. To test the functionality of my application without resizing 2500 images every time, I used 15 images of billiard balls as a "test" folder. Now my problem is with the following code, I get a resized and cropped PNG, whith a transparent background. The problem is that a white border on the left and top appears in every image viewer (Irfan View, Paint.Net and GIMP) How can I avoid this border? Here is the code I used for this: ``` void ResizeI(string[] Paths, string OutPut, Methods m, PointF Values, bool TwoCheck, bool Overwrite, float[] CropVals) { for (int i = 0; i < Paths.Length; i++)//Paths is the array of all images { string Path = Paths[i];//current image Bitmap Oimg = (Bitmap)Bitmap.FromFile(Path);//original image Bitmap img = new Bitmap((int)(Oimg.Width - CropVals[0] - CropVals[1]), (int)(Oimg.Height - CropVals[2] - CropVals[3]));//cropped image Graphics ggg = Graphics.FromImage(img); ggg.DrawImage(Oimg, new RectangleF(((float)-CropVals[0]), ((float)-CropVals[2]), Oimg.Width - CropVals[1], Oimg.Height - CropVals[3])); ggg.Flush(System.Drawing.Drawing2D.FlushIntention.Flush); ggg.Dispose(); PointF scalefactor = GetScaleFactor(img, Values, TwoCheck);//the scale factor equals 0.1 for 10% Bitmap newimg = new Bitmap((int)(Math.Ceiling(((float)img.Width) * scalefactor.X)), (int)(Math.Ceiling(((float)img.Height) * scalefactor.Y))); System.Drawing.Imaging.ImageFormat curform = img.RawFormat; string OutPath = System.IO.Path.Combine(OutPut, System.IO.Path.GetFileName(Path)); OutPath = CheckPath(OutPath, Overwrite);//Delete if exsits Graphics g = Graphics.FromImage(newimg); g.InterpolationMode = GetModeFromMethod(m);//Bicubic interpolation g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; g.ScaleTransform(scalefactor.X, scalefactor.Y); g.DrawImage(img, new Rectangle(0, 0, (int)Math.Ceiling(((float)newimg.Width) / scalefactor.X) + 1, (int)Math.Ceiling(((float)newimg.Height) / scalefactor.Y) + 1)); //g.Flush(System.Drawing.Drawing2D.FlushIntention.Flush); newimg.MakeTransparent(Color.White); newimg.Save(OutPath, curform); g.Dispose(); img.Dispose(); } } ``` And here is a example of the white border I mentioned. Download the image or drag it around and put a black background under it to see the border: ![The resized Image and the white border](https://i.stack.imgur.com/SMmhv.png) -- EDIT -- I managed to write this function instead of `newimg.MakeTransparent(...)`: ``` void SetTransparent(ref Bitmap b) { for (int i = 0; i < b.Width; i++) { for (int ii = 0; ii < b.Height; ii++) { Color cc = b.GetPixel(i, ii); int tog = cc.R + cc.G + cc.B; float durch = 255f - (((float)tog) / 3f); b.SetPixel(i, ii, Color.FromArgb((int)durch, cc.R, cc.G, cc.B)); } } } ``` the problem is that my billiard ball now look like this: ![Second version of the billiard ball](https://i.stack.imgur.com/8TmDS.png)
How to avoid useless white border in resized PNG with transparent background?
CC BY-SA 3.0
0
2011-06-04T11:11:09.413
2011-06-04T21:16:24.940
2011-06-04T21:16:24.940
128,421
207,861
[ "c#", "image-processing", "resize", "transparency", "system.drawing.imaging" ]
6,236,458
1
6,236,808
null
30
4,307
I want to describe an issue I have been having with `Plot` using `With` to keep defined parameters 'local'. I am not necessarily asking for a fix: the problem I have is one of understanding. Sometimes I use a construction such as the following to obtain a Plot: ``` plot1 = With[{vmax = 10, km = 10}, Plot[Evaluate@((vmax x)/(km + x)), {x, 0, 100}, AxesOrigin -> {0, 0}]] ``` I like this method, and it is reasonably clear even to non- users exactly what is going on. When the equations to be plotted become more complex, I like to define them external to the plot (using SetDelayed). For example: ``` f[x_] := (vmax x)/(km + x) ``` However, the following ``` plot2 = With[{vmax = 10, km = 10}, Plot[Evaluate@f[x], {x, 0, 100}, AxesOrigin -> {0, 0}]] ``` I have always naively thought that it should. However, based on the Help statement that > Plot treats the variable x as local, effectively using Block I have used various workarounds, mostly something like the following ``` plot3 = Plot[With[{vmax = 10, km = 10}, Evaluate@f[x]], {x, 0, 100}, AxesOrigin -> {0, 0}] ``` This one seems very awkward, and usually requires further explanation even to users. ![enter image description here](https://i.stack.imgur.com/nK5MH.gif) However, recently I found out by chance that substituting `Block` for `With` in Method 2 works exactly as expected. I can, for example, do something like the following (which to me seems a very versatile approach): ``` plot4 = Block[{vmax = {10, 10, 10}, km = { 10, 100, 1000}}, Plot[Evaluate@f[x], {x, 0, 100}, AxesOrigin -> {0, 0}, PlotStyle -> {Red, Green, Blue}]] ``` giving ![enter image description here](https://i.stack.imgur.com/BQ4Pk.gif) My questiions are as follows. What is the explanation for the difference in behaviour with `With` in Method 1 and 2? Should I have expected Method 2 not to work? Furthermore, what is the explanation for the difference in behaviour with `Block` and `With` in Method 2? Should I have been able to predict that `Block` would work? Funnily enough many workarounds have been suggested to me by those more experienced than I, but nobody suggested using `Block`. Finally, I need to keep `vmax` and `km` local.(They have been defined algebraically elsewhere)
Plot using With versus Plot using Block (Mathematica)
CC BY-SA 3.0
0
2011-06-04T11:23:17.413
2019-11-30T12:41:48.630
null
null
499,167
[ "wolfram-mathematica" ]
6,236,479
1
6,236,693
null
1
655
I use eclipse as my IDE for python. Recently I encountered a strange problem. A file contains an import from external libraries (such as wx, matplotlib etc.) if I put it inside the src directory, it will run as expected, but in the editor, I get error marks all over the places where I use the imported libraries. The errors say things like "Undefined variable from import". If I put it in top level of the project, the error marks disappear. I have added a screenshot of the configuration. I have a feeling that the source of the problem is there, but do not know what to do. ![enter image description here](https://i.stack.imgur.com/KSHrx.png)
Python with eclipse import problem
CC BY-SA 3.0
null
2011-06-04T11:30:03.783
2011-06-04T12:16:14.467
null
null
452,483
[ "python", "eclipse", "eclipse-plugin" ]
6,236,480
1
null
null
7
13,960
I want to customize seekbar in android. ![enter image description here](https://i.stack.imgur.com/ljl0v.png) Can anybody guide me how it can be done? I am new to android.
Customizing seekbar in android
CC BY-SA 3.0
0
2011-06-04T11:30:15.303
2013-07-04T20:25:44.933
null
null
529,121
[ "android" ]
6,236,499
1
null
null
2
1,146
Simple example - on one side we see camera rendered via standard software rendered "Input" on other hand (labeled "Output") rendered via some directX stuff (at least it seems to me) : ![enter image description here](https://i.stack.imgur.com/aSjBN.jpg) So what function is provided by windows api or DirectX api for capturing such mixed scenes?
How to capture desktop on windows so that it would capture both directX and normally rendered parts of screen?
CC BY-SA 3.0
null
2011-06-04T11:34:10.473
2011-06-04T13:34:11.760
2011-06-04T12:08:53.447
147,442
434,051
[ "c++", "windows", "directx", "screenshot" ]
6,236,524
1
6,236,754
null
2
975
HI, I am assigned a task to develop module for an already existing web application or to look for some third party plugin. The web application is developed using ASP.net and C# under .Net Framework 4.0. So if i develop by myself or i go for some 3rd party plugin then in both cases, my solutions need to work with above website specifications. # What I am Assigned: I need to draw a figure(or map) which illustrates that how companies registered on our website are connected with each other and then their sub companies, i am sorry i don't know how to explain it exactly :(, but following image would give a better idea what i want to achieve. I never do such task before, and only need guidance. ![enter image description here](https://i.stack.imgur.com/KGGZB.jpg) Image Taken From: [http://www.visualcomplexity.com/vc/project_details.cfm?id=709&index=709&domain](http://www.visualcomplexity.com/vc/project_details.cfm?id=709&index=709&domain)
ASP.Net: how to draw map
CC BY-SA 3.0
0
2011-06-04T11:40:16.437
2011-06-04T12:33:02.650
null
null
586,528
[ "asp.net" ]
6,236,837
1
null
null
0
135
How do I remove the gap highlighted from my window? ![enter image description here](https://i.stack.imgur.com/LupVO.png) I'm extending the glass into the client area, but there is a gap underneath the miminize, maximize/restore and close buttons.
Gap between window controls and client area
CC BY-SA 3.0
null
2011-06-04T12:50:17.813
2011-06-04T16:11:14.970
2011-06-04T16:11:14.970
546,730
23,528
[ "c#", "wpf", "windows", "layout", "window" ]
6,237,229
1
6,241,231
null
0
269
I've been having an issue which is extremely odd to me. The graphic I'm using is sometimes centered, for reasons I can't understand, but only on certain displays. The top graphic is the bad example, the bottom one is the one I'd like to have. It seems to not be Android version dependent, both the good and bad were replicated on Android 1.6, and the bad was replicated on 2.1. It seems to only be size dependent... ![Bad version](https://i.stack.imgur.com/nsvmj.png) ![Good level layout](https://i.stack.imgur.com/9vHSR.png) relevant XML code: ``` <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" android:layout_height="fill_parent" android:layout_width="fill_parent"> <com.google.ads.AdView android:id="@+id/adView" ads:loadAdOnCreate="true" ads:adSize="BANNER" ads:adUnitId="@string/admob_unit_id" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" ></com.google.ads.AdView> <pearsonartphoto.AJEG.number_pad android:id="@+id/numberpad" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_above="@id/adView" android:layout_centerHorizontal="true"></pearsonartphoto.AJEG.number_pad> <pearsonartphoto.AJEG.Level_Score_bar android:id="@+id/Score_Bar" android:layout_height="wrap_content" android:layout_width="fill_parent"></pearsonartphoto.AJEG.Level_Score_bar> <ImageView android:id="@+id/logo_image" android:layout_below="@id/Score_Bar" android:layout_above="@id/numberpad" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/level_logo" android:layout_alignParentLeft="true" android:layout_centerInParent="false" android:gravity="left"></ImageView> <TextView android:id="@+id/number_select" android:layout_above="@id/numberpad" android:layout_below="@id/Score_Bar" android:text="0" android:layout_width="wrap_content" android:layout_height="wrap_content" style="@style/numberSelect" android:layout_centerHorizontal="true" android:gravity="center"></TextView> <pearsonartphoto.AJEG.number_viewer android:id="@+id/numberviewer" android:layout_alignParentRight="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/Score_Bar"></pearsonartphoto.AJEG.number_viewer> </RelativeLayout> ``` As you can see, I've clearly set the gravity of the image to left, told it to align with Parent left, yet for some unknown reason it wants to align center.
Why is my graphic sometimes centering using a relative layout?
CC BY-SA 3.0
null
2011-06-04T14:17:07.233
2011-06-25T10:19:40.520
2011-06-04T14:42:25.203
544,198
544,198
[ "android", "android-layout", "android-xml" ]
6,237,308
1
6,237,411
null
0
688
I am trying to add a subview to a `UITableViewController`'s view via the following code ``` //In a UITableViewController Implementation file self.loadingPageView = [[[UIView alloc]initWithFrame:[UIScreen mainScreen].applicationFrame] autorelease]; self.loadingPageView.frame = self.view.bounds; self.loadingPageView.backgroundColor = [UIColor darkGrayColor]; [self.view addSubview:loadingPageView]; ``` After I run, I get the following display ![Image of empty table view on iPad simulator](https://i.stack.imgur.com/4Cbzf.png) Is there a way to hide the table view completely from the display after adding the `UIView` as the subview?
Add a UIView as a subview to a UITableViewController's view
CC BY-SA 3.0
null
2011-06-04T14:30:52.490
2011-06-04T23:52:21.997
2011-06-04T23:52:21.997
603,977
683,898
[ "objective-c", "cocoa-touch", "ios", "uitableview", "subview" ]
6,237,455
1
6,338,124
null
85
69,878
Chrome renders #FF3A00 as #FF0000 for some reason. I included a screenshot from [jsfiddle](http://jsfiddle.net/L9xy4/) to illustrate the point. The colour that the Color Meter reports (and what I see) differs from what CSS says. This happens to other colours too. For example, #FFAF00 is rendered as #FFA400 according to the Color Meter. However, the colours are rendered without problems on Safari and Firefox. I'm on a Mac using Chrome 11, Safari 5 and Firefox 5. I'm sure there's a logical explanation. Any ideas? Update: I'm attaching a screenshot of Chrome next to Safari showing the very same page. I checked this image in Photoshop: the colours are #F00 in Chrome and #FF3A00 in Safari.![Chrome vs Safari](https://i.stack.imgur.com/R5QvN.png) ![Chrome renders #FF3A00 as #F00](https://i.stack.imgur.com/La5WR.png)
Chrome renders colours differently from Safari and Firefox
CC BY-SA 3.0
0
2011-06-04T14:59:54.147
2021-01-27T18:14:59.783
2011-06-04T15:35:02.567
219,977
219,977
[ "css", "google-chrome", "colors", "rendering" ]
6,237,513
1
6,237,551
null
4
234
I have a menu: ``` <div class="headerMenu"> <ul> <li><a href="#">Home <span>Home Page<span></a></li> <li><a href="#">About <span>About My Website<span></a></li> <li><a href="#">Contact <span>Get in touch<span></a></a></li> </ul> </div> ``` My current CSS is as follow: ``` .headerMenu{ width: 100%; } .headerMenu ul{ margin: 0; padding: 0; float: left; } .headerMenu ul li{ display: inline; } .headerMenu ul li a{ float: left; color: white; padding-top:25px; padding-left:50px; font-size:24pt; } .headerMenu ul li a:visited{ color: white; } .headerMenu ul li a:hover, .menu ul li .current{ color: #fff; background: url(../../Content/Images/menu-selector.png) repeat-x; /* 25x10 arrow/* } ``` And now for the question: 1. How can i get the content in the span tag to be below the Main text. 2. When i hover over the anchor, How do i add the hover image as shown in screen shot The Mockup i created in Photoshop looks like this: ![enter image description here](https://i.stack.imgur.com/W0Mgf.png) I know this would be easily achievable by making use of images, but my solution requires that menu to be created dynamically.
Complex css menu
CC BY-SA 3.0
null
2011-06-04T15:11:07.947
2011-06-04T15:21:56.603
2011-06-04T15:13:43.937
164,998
261,257
[ "css" ]
6,237,869
1
6,237,893
null
0
180
I have a big form. This form contains some inputs that can be duplicated by the user. So they can choose for example how many Claimants have worked on a song and enter some fields for EACH claimant, with a limit of 10 Claimants. The form will look like this (I will show only 3 now) ``` echo "<form action=\"\" id=\"submForm\" name=\"submForm\" method=\"get\">"; //1 CLAIMANT echo "<p><span class=\"labelInput\">".(_t('_cR_name_mandatory'))." </span><input id=\"nameClaimant\" name=\"nameClaimant[]\" value=\"\" type=\"text\" class=\"required commonInput\"></p>"; echo "<p><span class=\"labelInput\">".(_t('_cR_DOB_mandatory'))." </span><input id=\"DOBClaimant\" name=\"DOBClaimant[]\" value=\"\" type=\"text\" class=\"required littleInput\"></p>"; echo "<p><span class=\"labelInput\">".(_t('_cR_company'))." </span><input id=\"companyClaimant\" name=\"companyClaimant[]\" value=\"\" type=\"text\" class=\"commonInput\"></p>"; //2 CLAIMANT echo "<p><span class=\"labelInput\">".(_t('_cR_name_mandatory'))." </span><input id=\"nameClaimant\" name=\"nameClaimant[]\" value=\"\" type=\"text\" class=\"required commonInput\"></p>"; echo "<p><span class=\"labelInput\">".(_t('_cR_DOB_mandatory'))." </span><input id=\"DOBClaimant\" name=\"DOBClaimant[]\" value=\"\" type=\"text\" class=\"required littleInput\"></p>"; echo "<p><span class=\"labelInput\">".(_t('_cR_company'))." </span><input id=\"companyClaimant\" name=\"companyClaimant[]\" value=\"\" type=\"text\" class=\"commonInput\"></p>"; //3 CLAIMANT echo "<p><span class=\"labelInput\">".(_t('_cR_name_mandatory'))." </span><input id=\"nameClaimant\" name=\"nameClaimant[]\" value=\"\" type=\"text\" class=\"required commonInput\"></p>"; echo "<p><span class=\"labelInput\">".(_t('_cR_DOB_mandatory'))." </span><input id=\"DOBClaimant\" name=\"DOBClaimant[]\" value=\"\" type=\"text\" class=\"required littleInput\"></p>"; echo "<p><span class=\"labelInput\">".(_t('_cR_company'))." </span><input id=\"companyClaimant\" name=\"companyClaimant[]\" value=\"\" type=\"text\" class=\"commonInput\"></p>"; echo "<input type=\"submit\" class=\"submBttnClass\" id=\"buttSubm\" name=\"buttSubm\" value=\"".(_t('_cR_submit_button'))."\">"; echo "</form>"; ``` When the user submits the form I use a jQuery serialize function (I am on jQuery 1.3.2) ``` echo "<script type=\"text/javascript\"> $(document).ready(function() { $('#submForm').validate({ submitHandler: function(form) { var serialized = $('#submForm').serialize() $.get('".$site['url']."modules/yobilab/copyright/classes/DO_submission.php', serialized); //alert($('#submForm').serialize()); window.setTimeout('location.reload()', 8000); return false; form.submit(); } }) ``` The problem is that the file that processes the Insert in the Database uses a foreach(I will show you my entire foreach with all the inputs that are passed with the serialize function: ``` if(!empty($_GET['nameClaimant'])){ $nameClaimant = $_GET['nameClaimant']; $DOBClaimant = $_GET['DOBClaimant']; $companyClaimant = mysql_real_escape_string($_GET['companyClaimant']); $emailClaimant = $_GET['emailClaimant']; $mainPhoneClaimant = $_GET['mainPhoneClaimant']; $alternatePhoneClaimant = $_GET['alternatePhoneClaimant']; $mobilePhoneClaimant = $_GET['mobilePhoneClaimant']; $percentageClaimant = mysql_real_escape_string($_GET['percentageClaimant']); $addressClaimant = mysql_real_escape_string($_GET['addressClaimant']); $ZIPClaimant = $_GET['ZIPClaimant']; $countryClaimant = $_GET['countryClaimant']; foreach ($nameClaimant as $valueClaimant) { $insClaim = "INSERT INTO cR_Claimants SET memberID ='".$memberID."', ParentSubmission='".$refNumb."', Name ='".mysql_real_escape_string($valueClaimant)."', DOB='".$DOBClaimant."', Company='".$companyClaimant."', Email='".$emailClaimant."', Address='".$addressClaimant."', ZIPcode ='".$ZIPClaimant."', Country='".$countryClaimant."', MainPhone='".$mainPhoneClaimant."', OtherPhone='".$alternatePhoneClaimant."', MobilePhone='".$mobilePhoneClaimant."', OwnershipPercentage='".$percentageClaimant."'"; $resultinsClaim=mysql_query($insClaim) or die("Error insert Claimants: ".mysql_error()); } } ``` The foreach inserts in the database wrong stuff. It shows `Array` instead of the right value. I would like to insert the info in the database consequentially with my foreach. So for Claimant1 will insert its relative info for Claimant2 will insert its relative info and so on. It is not working. What am I doing wrong? I know it is a little boring, but please help me! Lets play with it. You are All great Thank you I have attached what is doing in the database to let you see You will see that is also creating empty strings in the database. Why is that taking also empty values? Please help me. ![database_issue](https://i.stack.imgur.com/WBNqm.png)
php Foreach Loop issue
CC BY-SA 3.0
null
2011-06-04T16:13:10.510
2011-06-04T16:32:48.013
null
null
735,997
[ "php", "foreach" ]
6,237,953
1
6,239,383
null
1
295
Quick question involving javascript canvas... I have a set points (connected with a line) I want to graph on a 400x300 canvas element. I will constantly be adding more points. I need the line to stretch to fill the entire canvas (leaving no unnecessary space). Example: ![enter image description here](https://i.stack.imgur.com/WbnSG.png) into this: ![enter image description here](https://i.stack.imgur.com/CEZpF.png) Thanks! C.Ruhl
Stretching a Graph to Fill the Canvas Element in JavaScript
CC BY-SA 3.0
null
2011-06-04T16:30:36.660
2011-06-05T17:43:27.940
null
null
751,444
[ "javascript", "math", "canvas", "graphing" ]
6,238,083
1
null
null
2
1,726
I'm really need your help, I'm desperate. I'm trying to build an OCR application and I'm facing some problems that I can't solve alone. for now I'm cutting the plate form the image and doing some filtering to reduce the noise. for example, this is the plate after cutting it from the image and after filtering: ![enter image description here](https://i.stack.imgur.com/FdJcF.jpg) now because that the plate is in angle and because that there is still noise (like above the numbers 9 and 3), the identification process(using corr2) is giving me the wrong numbers. eg: ![enter image description here](https://i.stack.imgur.com/HwK7l.jpg) as you see the only problem is in the numbers 9 and 3(at the left side) where the noise is disturbing. I thought to stretch the image so that each number will fit all the square (without the black lines at the top), but I can't find any method to do this that it will work for every image. this is the results from the corr2 function, I marked in red the results of the numbers 9 and 3. ![enter image description here](https://i.stack.imgur.com/dP1Zf.jpg) please give me an idea or working solution... any help will be greatly appreciated.
help with OCR application - Matlab
CC BY-SA 3.0
null
2011-06-04T16:54:18.637
2011-06-07T00:06:29.743
2011-06-05T08:54:04.903
556,011
556,011
[ "matlab", "image-processing", "ocr" ]
6,238,138
1
6,238,167
null
0
457
In MAMP error pages show up like this ![enter image description here](https://i.stack.imgur.com/oHmAC.png) In Zend Server CE my error pages show up like this making it difficult to read: ![enter image description here](https://i.stack.imgur.com/tVol7.png)
Why do Zend Server CE error pages show up in plain text? Is there a fix?
CC BY-SA 3.0
null
2011-06-04T17:01:57.657
2011-06-04T17:18:13.547
null
null
439,688
[ "apache", "apache2", "zend-server-ce", "php" ]
6,238,259
1
null
null
6
765
I am working on drawing custom buttons/textfields with `NSDrawNinePartImage`. I slice up an image into nine parts in code and draw it into a rect with `NSDrawNinePartImage`. Unfortunately I am getting some gaps in the drawing pattern. I thought it had something to do with my slicing code, but I saved them out as images from where I slice them, and they all look good (I even put them together and they looked good). Some of the cases where I use it to work just fine though despite some using the same images. I am pretty confident that it comes down to the actual drawing. Do you know of any `NSGraphicsContext` or other settings that would affect it or something else that may be causing this? With gaps ![With gaps](https://i.stack.imgur.com/0vCVW.png) Without gaps ![Without gaps](https://i.stack.imgur.com/XYH3r.png)
NSDrawNinePartImage gaps
CC BY-SA 3.0
0
2011-06-04T17:22:39.350
2013-10-14T19:59:10.617
2012-12-21T05:25:20.047
425,756
425,756
[ "cocoa", "drawing", "appkit" ]
6,238,395
1
6,239,759
null
0
5,010
I got most of my lighting working the way I want, but I seem to be completely missing any ambient lighting. That is, the away-from-the-sun sides of things are completely black (I was hoping for 50% ambient), whereas the toward-the-sun sides seem lit as I'd expect. Here's my lighting setup code (edited from original, see note below): ``` - (void) setupLighting { const float amb = 2.0; const float LightAmbient[][4] = { { amb, amb, amb, 1.0f }, { amb, amb, amb, 1.0f } }; const float LightDiffuse[] [4] = { { 1.0f, 1.0f, 1.0f, 1.0f }, { 1.0f, 1.0f, 1.0f, 1.0f } }; const float LightPosition[][4] = { { 1.0f, 4.0f, 2.0f, 0.0f }, { 0.0f, 10.0f, 0.0f, 1.0f } }; glLightfv(GL_LIGHT0, GL_AMBIENT, LightAmbient[0]); glLightfv(GL_LIGHT0, GL_DIFFUSE, LightDiffuse[0]); glLightfv(GL_LIGHT0, GL_POSITION, LightPosition[0]); glLightfv(GL_LIGHT1, GL_AMBIENT, LightAmbient[1]); // etc., snip -- no LIGHT1 for this round glColorMaterial (GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE); glEnable(GL_COLOR); //glEnable(GL_COLOR_MATERIAL); glEnable(GL_LIGHT0); //glEnable(GL_LIGHT1); glEnable(GL_LIGHTING); } ``` (NOTE: LIGHT1 commented out for now -- I'm just trying to get LIGHT0 to do what I want.) Not sure if it matters, but I'm drawing unit-aligned, texture-mapped unit cubes (a la MineCraft) using glDrawArrays(). All my normals seem correct; if I leave lighting off, everything draws correctly (just flat-lit.) Any hints? Thanks! (Added screenshot.) ![Here's a screenshot of the problem](https://i.stack.imgur.com/IzPII.png) Per comments, I bumped ambient values up to 2.0, and now it looks like what I'd expect for about 50% ambient. That seems whacky -- I thought lighting values were pinned at [0, 1]...? What fundamental concept about ambient light am I not grokking?
Why doesn't my open gl ambient lighting work?
CC BY-SA 3.0
0
2011-06-04T17:44:48.713
2011-06-05T03:04:04.473
2011-06-04T18:40:10.227
34,820
34,820
[ "opengl", "lighting", "ambient" ]
6,238,398
1
6,238,483
null
1
481
I'm programming a preferences panel with a UITableView which looks like this: ![enter image description here](https://i.stack.imgur.com/pBFMD.png) The first section consists in simple rows and the second section in rows with a UISwitch as a subview. When I change to landscape and start scrolling, the tableview behaves in a strange way: ![enter image description here](https://i.stack.imgur.com/t5B4V.png) This is my code: ``` - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } // Configure the cell if (indexPath.section == 0) { cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; if (indexPath.row == 0) { cell.textLabel.text = @"Help"; }else if (indexPath.row == 1){ cell.textLabel.text = @"About us"; } else if(indexPath.row == 2){ cell.textLabel.text = @"Send to a friend"; } }else if(indexPath.section == 1){ cell.accessoryType = UITableViewCellAccessoryNone; cell.selectionStyle = UITableViewCellSelectionStyleNone; if (indexPath.row == 0) { cell.textLabel.adjustsFontSizeToFitWidth = NO; cell.textLabel.text = @"Show favs at launch"; [cell addSubview:favoritesSwitch]; }else if (indexPath.row == 1){ cell.textLabel.text = @"Open with Safari"; [cell addSubview:browserSwitch]; } else if(indexPath.row == 2){ cell.textLabel.text = @"Remember query"; [cell addSubview:lastQuerySwitch]; } else if(indexPath.row == 3){ cell.textLabel.text = @"Automatic keyboard"; [cell addSubview:keyboardSwitch]; } } return cell; } ``` Thank you in advance :)
UITableView strange behavior
CC BY-SA 3.0
null
2011-06-04T17:45:34.563
2011-06-05T21:54:56.603
null
null
709,975
[ "iphone", "xcode", "ios", "uitableview", "landscape" ]
6,238,946
1
6,239,292
null
17
14,304
I'm working on an application where I list the installed applications with the package manager. I can get the package name of the item clicked, but I'd like to then launch the details screen based on the package. So for instance if Dolphin Browser were selected in the list, you would then see the following image. How can I do this? ![enter image description here](https://i.stack.imgur.com/XxRzt.jpg) [Gingerbread](http://en.wikipedia.org/wiki/Android_version_history#Gingerbread) ``` final int apiLevel = Build.VERSION.SDK_INT; Intent intent = new Intent(); if (apiLevel >= 9) { //TODO get working on gb //Toast.makeText(SDMove.this, "Gingerbread Not Currently Supported", Toast.LENGTH_LONG).show(); startActivity(new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.parse("package:" + pli.pkg.packageName))); } else { final String appPkgName = (apiLevel == 8 ? "pkg" : "com.android.settings.ApplicationPkgName"); intent.setAction(Intent.ACTION_VIEW); intent.setClassName("com.android.settings", "com.android.settings.InstalledAppDetails"); intent.putExtra(appPkgName, pli.pkg.packageName); startActivity(intent); } ```
Android launch applications detail page
CC BY-SA 3.0
0
2011-06-04T19:37:59.347
2021-08-19T16:23:39.783
2021-08-19T16:23:39.783
372,239
607,432
[ "java", "android", "android-intent" ]
6,239,196
1
6,239,954
null
0
1,756
How would I go about implementing a shadow like the one you see under the title bar? I know this can be done (see for example the app "Andlytics", where this effect shows on the bottom as well). ![](https://i.stack.imgur.com/mE9oJ.jpg) My best guess is that it's a banner image used as the background for the layout. But maybe there is a better way?
Duplicating title bar shadow
CC BY-SA 3.0
null
2011-06-04T20:28:38.810
2015-04-01T20:39:59.353
2011-06-05T00:10:10.410
642,161
407,133
[ "android" ]
6,239,205
1
6,239,760
null
0
2,186
I have the following Model design. Template contains a list of Categories. Categories contains a List of Items. Thus there is 3 layer hierarchy. Because the UI design requires that all 3 levels be created on 1 page, I have had to write some of my own code to get this working. It looks as follows: ![Page Design](https://i.stack.imgur.com/YfOAQ.jpg) I can get it to submit back to the Create Action Method and the FormCollection looks as follows. ![FormValues for Create](https://i.stack.imgur.com/kMip0.jpg) The problem I am having is that the UpdateModel works for the Template and Category level but the Items are not populated for the Categories. The Html looks as follows. As you can see, I have used the Category[guid_value].Items[guid_value] syntax for id. Shouldn't it figure out the binding automagically based on that? ![enter image description here](https://i.stack.imgur.com/8tJfZ.jpg)
ASP.NET MVC UpdateModel binding with a Hierarchy of Collections
CC BY-SA 3.0
null
2011-06-04T20:30:13.770
2011-06-04T22:26:46.383
null
null
64,015
[ "c#", "html", "asp.net-mvc-3", "binding" ]
6,239,530
1
6,239,700
null
3
1,024
Hi I'm new to android world.Iam working on an application that supports multiple screen sizes i did as explained here [http://developer.android.com/guide/practices/screens_support.html#screen-independence](http://developer.android.com/guide/practices/screens_support.html#screen-independence) . I didn't create different xmls for each screen size. But when I tested it on android 3 emulator it appears in small part of the screen. ![enter image description here](https://i.stack.imgur.com/ppcbK.jpg) So I think that the size specified for my application on the emulator is small so my widgets are not filling the whole screen as I want. Can I control that size of my application on the emulator?
supporting multiple screen sizes in android
CC BY-SA 3.0
null
2011-06-04T21:31:54.720
2011-06-04T22:52:31.137
2011-06-04T22:20:56.960
69,802
760,538
[ "android", "screen-size" ]
6,239,592
1
6,239,633
null
3
761
I'm using `UIActionSheet` in a landscape mode application in `iPad`. Some of my button's texts don't fit the width and they're cropped from the end. In `iPhone` this is handled and my action sheet buttons fit into the frame even if they are long. I didn't understand why this is different in iPad. Do you guys have any ideas about how I can accomplish something as `adjustsFontSizeToFitWidth` method does to `UILabel`s? Here's how I create and display my action sheet: ``` UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil]; for (NSString *bank in self.getBanksResponse.banks) { [actionSheet addButtonWithTitle:bank]; } [actionSheet showFromRect:self.bankButton.frame inView:self.view animated:YES]; [actionSheet release]; ``` Here's the screenshot of my action sheet: ![enter image description here](https://i.stack.imgur.com/d4PdB.png) Thx in advance...
How to widen UIActionSheet to fit the text in iPad?
CC BY-SA 3.0
null
2011-06-04T21:45:26.083
2011-06-04T21:53:01.970
null
null
106,303
[ "objective-c", "ipad", "uiactionsheet" ]
6,239,726
1
null
null
3
216
![enter image description here](https://i.stack.imgur.com/BdhY5.jpg) The above image represents an article's page views over time. I'm looking for a decent, not to complex either physics or statistical calculation that would be able to give me (based on the history of the page views) what the current trending of the page views is for the past n days (which is represented by the blue box). So basically, in the past 5 days is this link trending unusually higher than it usually does and if so by what degree/magnitude? Ideally the accepted answer would provide an algorithm class that applies to this problem as well as some example of that using the data provided from this chart above. thanks!
How can I calculate the trending nature of a link?
CC BY-SA 3.0
null
2011-06-04T22:16:52.243
2012-04-30T01:38:42.237
2012-04-30T01:38:42.237
13,793
252,253
[ "algorithm", "statistics", "physics" ]
6,239,729
1
6,240,052
null
21
4,971
I want to convert a numeric value to a string, displaying culture-specific digits. For example, the Dari language used in Afghanistan (culture name "prs-AF") uses [Eastern-Arabic numerals](http://en.wikipedia.org/wiki/Eastern_Arabic_numerals) instead of the [Arabic numerals](http://en.wikipedia.org/wiki/Arabic_numerals) used in most Western cultures (`0,1,2,3,4,5,6,7,8,9`). When examining the CultureInfo class built into the Framework, it lists the correct native digits (screenshot taken from output in LinqPad): ![linqpad output](https://i.stack.imgur.com/LMvPT.png) ``` CultureInfo.CreateSpecificCulture("prs-AF").NumberFormat.NativeDigits ``` However, when trying to convert a number to a string to display in that culture, I am not getting the native digits: ![linqpad output](https://i.stack.imgur.com/7zu33.png) ``` var number = 123.5; var culture = CultureInfo.CreateSpecificCulture("prs-AF"); Thread.CurrentThread.CurrentUICulture = culture; Thread.CurrentThread.CurrentCulture = culture; var text = number.ToString(culture); Console.WriteLine(text); ``` Can anyone tell me how to display the native digits?
How can I display culture-specific native digits instead of Arabic numerals?
CC BY-SA 3.0
0
2011-06-04T22:17:38.173
2011-06-05T04:10:15.377
null
null
56,864
[ "c#", "localization", "formatting", "cultureinfo" ]
6,239,769
1
6,240,095
null
23
25,440
I am learning `pygame` and want a graphic for a button with the three states: normal, hover, and pressed. I have an image like this one ... ![Three button states, stacked vertically](https://i.stack.imgur.com/ogtzS.png) ... and I want to get a new `Surface` using a portion of it. I'm loading the image with this code: ``` buttonStates = pygame.image.load(os.path.join('image','button.png')) ``` How can I make a new surface using just a portion of that graphic?
How can I crop an image with Pygame?
CC BY-SA 3.0
0
2011-06-04T22:28:07.407
2022-09-26T11:07:11.123
2015-06-29T23:02:58.870
1,014,938
708,874
[ "python", "image", "pygame", "crop", "surface" ]
6,239,822
1
6,240,025
null
1
149
When I search in Google and moving the mouse over links I see the link of the current page like in this picture : ![enter image description here](https://i.stack.imgur.com/8IcgX.png) But when I open this link and stop page loading to see the URL I find this [http://www.google.com/url?sa=t&source=web&cd=8&ved=0CFsQFjAH&url=http%3A%2F%2Fblog.stackoverflow.com%2F&rct=j&q=http%3A%2F%2Fstackoverflow.com%2F&ei=gbHqTaa-BcTGtAaRwcjnCg&usg=AFQjCNG7KphjK6RuC5cj-6U5jeuvipt5dg&cad=rja](http://www.google.com/url?sa=t&source=web&cd=8&ved=0CFsQFjAH&url=http%3A%2F%2Fblog.stackoverflow.com%2F&rct=j&q=http%3A%2F%2Fstackoverflow.com%2F&ei=gbHqTaa-BcTGtAaRwcjnCg&usg=AFQjCNG7KphjK6RuC5cj-6U5jeuvipt5dg&cad=rja) It's used by Google to sotre data about visitors of this link or when a user copy the link he'll get just the right URL . The same thing with Facebook for external links ( l.php ) This option help user to see the whole address. I like to use it in my website so how can I do ??
Leave page for links like Google and Facebook
CC BY-SA 3.0
0
2011-06-04T22:39:49.493
2011-06-04T23:33:09.587
null
null
604,156
[ "hyperlink" ]
6,239,820
1
6,240,245
null
7
1,008
Apparently, the [EASEUS Partition Master](http://www.partition-tool.com/personal.htm) program can display the Windows GUI starts (i.e., it runs at the same time CheckDisk runs at boot). What I : 1. This might require not-very-well-documented functions. That's fine with me. 2. I already know how to compile native NT executables, so feel free to omit that from responses. Questions: 1. How can you display graphics before everything has started up? (i.e. What functions/libraries do you use?) 2. How does it display formatted and aligned text on the screen? I know NtDisplayString is capable of writing text, but it can't draw things in a formatted manner, as you can see below. What function(s) do you use to replicate the behavior below? ![Screenshot](https://i.stack.imgur.com/FtEjG.png)
How do you get Graphics in Native NT Text-Mode?
CC BY-SA 3.0
0
2011-06-04T22:38:51.287
2011-06-05T00:29:59.970
null
null
541,686
[ "winapi", "graphics", "nt", "nt-native-api", "native-executable" ]
6,240,113
1
6,240,394
null
202
35,618
My kids have this fun game called [Spot It!](http://www.blueorangegames.com/spotit-tg.php) The game constraints (as best I can describe) are: - - - - The principle of the game is: flip over 2 cards and whoever first picks the matching picture gets a point. Here's a picture for clarification: ![spot it](https://i.stack.imgur.com/Lv4I1.jpg) (Example: you can see from the bottom 2 cards above that the matching picture is the green dinosaur. Between the bottom-right and middle-right picture, it's a clown's head.) I'm trying to understand the following: 1. What are the minimum number of different pictures required to meet these criteria and how would you determine this? 2. Using pseudocode (or Ruby), how would you generate 55 game cards from an array of N pictures (where N is the minimum number from question 1)? Pictures do occur more than twice per deck (contrary to what some have surmised). See this picture of 3 cards, each with a lightning bolt:![3 cards](https://i.stack.imgur.com/9Pk2v.jpg)
What are the mathematical/computational principles behind this game?
CC BY-SA 3.0
0
2011-06-04T23:54:53.423
2022-07-18T00:01:17.773
2011-06-05T00:32:12.187
120,928
120,928
[ "algorithm", "math", "pseudocode" ]
6,240,171
1
6,240,182
null
3
7,754
How can I write a directory chooser as like that: ![enter image description here](https://i.stack.imgur.com/ouYni.jpg) or: ![enter image description here](https://i.stack.imgur.com/9KLb5.jpg) at Java? I am developing a desktop application and I use Swing at my application. I want to list just directories.
How can I write a Java directory chooser?
CC BY-SA 3.0
null
2011-06-05T00:11:04.323
2012-07-07T08:26:37.883
2012-07-07T08:26:37.883
453,596
453,596
[ "java", "directory" ]
6,240,236
1
6,240,314
null
1
140
![Index resource takes up half of page load time](https://i.stack.imgur.com/nMvwu.jpg) My index resource takes up half my sites load time. Google got it down to just about 30-50 ms, how would I go about achieving this? Also, how can I parallelize the downloading of my images. They all wait for the previous one to load before starting to load, any way to fix this? Thanks! ~ Jackson
Help reduce site load-time. How can I cut down this resource?
CC BY-SA 3.0
null
2011-06-05T00:26:43.077
2011-06-05T01:27:43.637
null
null
743,561
[ "optimization", "resources", "load", "indexing" ]
6,240,243
1
null
null
5
7,249
I'm just starting to get more into CSS, and initial experiments have been really good! I'm finding my feed with popup boxes and CSS styling etc! However, I want to push the boundaries of what I know a bit ... I'm trying to achieve a styled DIV (no problems there) that is rectangular, but has an arrow pointing to an icon on the nav bar, see image below, that includes the box border, and where the DIV itself can vary in height (although the arrow stays the same height/width at all times). ![Example of what i'm trying to achieve](https://i.stack.imgur.com/NCfa6.png) Can anyone point me in the right direction - or am I trying to do more than is possible!? Thanks, in advance.
Creating rectangular DIVs with arrows
CC BY-SA 3.0
0
2011-06-05T00:28:43.703
2014-03-19T07:17:53.553
2014-03-19T07:17:53.553
610,979
683,699
[ "css", "graphics" ]
6,240,397
1
null
null
0
138
I have a login page presented as a modal view controller and when the UITextField become the first responder under portrait mode the view shifts to the left. I wonder why is this? ![enter image description here](https://i.stack.imgur.com/HUxFW.png) ![enter image description here](https://i.stack.imgur.com/kgY9r.png) The code is very simple: ``` LoginViewController* lvc = [[LoginViewController alloc] init]; lvc.delegate = self; [self.parentViewController presentModalViewController:lvc animated:YES]; [lvc release]; ``` This is inside a UIViewController called OptionsViewController which is presented as a modalViewController as well. So basically I am presenting a modalViewController from a modalViewController
presentModalView full screen view shifts to the left when keyboard is shown
CC BY-SA 3.0
null
2011-06-05T01:11:13.677
2011-06-05T01:41:45.460
2011-06-05T01:18:13.863
721,937
721,937
[ "iphone", "objective-c", "modalviewcontroller" ]
6,240,547
1
6,259,324
null
0
366
I have this problem with one of my UILabels, I would like to have the text that it displays begin being drawn at the top left of the label rather than the middle left. Current screen: ![Screenshot](https://i.stack.imgur.com/64VNz.png) As you can see the word "Description" in the label appears in the centre and to the left of the label. I would like it to start at the top-left instead. How do I implement this either programatically or in IB? Thanks, Jack
Changing text layout in a UILabel - Specifically where it starts from
CC BY-SA 3.0
null
2011-06-05T01:54:12.367
2011-06-06T23:52:43.557
null
null
733,332
[ "iphone", "ios", "text", "interface-builder", "uilabel" ]
6,240,727
1
6,240,744
null
0
563
I'm trying to register my tumblr website with Facebook in accordance with this tutorial [http://forum.developers.facebook.net/viewtopic.php?id=62825](http://forum.developers.facebook.net/viewtopic.php?id=62825). But when I enter my website like this, I get a validation error. Why is this not a valid domain name? Note, I am using my own domain name with Tumblr ``` Validation failed. Site Domain: http://www.blahblah.com/ is not a valid domain. ``` And I also got this error message when I tested a like button on the site ``` The app ID specified within the "fb:app_id" meta tag is not allowed on this domain. You must setup the Connect Base Domains for your app to be a prefix of http://blahblah.com/post/6196969104/. ``` ![enter image description here](https://i.stack.imgur.com/uWIA0.png)
Facebook Developer
CC BY-SA 3.0
null
2011-06-05T02:55:09.960
2011-06-05T03:23:39.943
2011-06-05T03:07:07.290
577,455
577,455
[ "facebook", "facebook-graph-api", "facebook-c#-sdk" ]
6,240,837
1
6,313,872
null
2
684
I am doing a school project in C# apps and I decided to create a ticketing system. I want to impress my teacher (^^) so I decided to add a database for my app. I have a month to do this so i think I can learn it since I don't have any prior experience with databases. Could you tell me how to do it? Below is my app, I want to send the info in the `TextBox` to a database ![enter image description here](https://i.stack.imgur.com/X0Isc.png) I already followed the instructions in MSDN which basically tells you how to add a data source in your app. I added northwind dataset to my app, but I don't know what to do with it and how will it be useful with my app...
database for c# form
CC BY-SA 3.0
null
2011-06-05T03:30:57.070
2011-06-11T03:28:18.063
2011-06-11T02:42:00.490
556,595
782,252
[ "c#", "database", "forms" ]
6,241,062
1
null
null
4
2,477
I'm having issues with Django Grappelli. It seems to be loading the CSS just fine, but the styling seems... off. Perhaps some pictures would clarify what I mean: ![http://imgur.com/eRlaX](https://i.stack.imgur.com/0zoU8.png) ![http://imgur.com/T11Xt](https://i.stack.imgur.com/BARFs.png)
Django Grappelli Error
CC BY-SA 3.0
null
2011-06-05T04:46:30.907
2022-10-18T02:19:10.310
2011-12-03T23:43:44.707
84,042
784,477
[ "django", "django-grappelli" ]
6,241,273
1
6,241,507
null
0
1,971
I want to reset ObjectOutPutStream to update the new object state. But why it doesn't effect. The below code outputs "BEFORE" instead of "AFTER"? What's wrong with my code? ``` package test; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; public class Serialization { public static void main(String[] strs) { String filename = "E:\\myObject.data"; FileOutputStream fos = null; ObjectOutputStream out = null; MyObject myObject = new MyObject(); try { myObject.setValue("BEFORE"); fos = new FileOutputStream(filename); out = new ObjectOutputStream(fos); out.writeObject(myObject); out.reset(); myObject.setValue("AFTER"); out.writeObject(myObject); out.close(); } catch (IOException ex) { ex.printStackTrace(); } try { FileInputStream fis = null; ObjectInputStream in = null; fis = new FileInputStream(filename); in = new ObjectInputStream(fis); myObject = (MyObject) in.readObject(); System.out.println(myObject.getValue()); in.close(); } catch (IOException ex) { ex.printStackTrace(); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } } public static class MyObject implements Serializable { private static final long serialVersionUID = 5222199410120362372L; private String value; public void setValue(String value) { this.value = value; } public String getValue() { return value; } } } ``` ![enter image description here](https://i.stack.imgur.com/Gp366.png)
Reset ObjectOutPutStream to update new object state?
CC BY-SA 3.0
null
2011-06-05T05:59:05.703
2011-06-05T07:16:29.220
null
null
658,741
[ "java", "reset", "objectoutputstream" ]
6,241,344
1
6,241,354
null
0
322
I want to set page backgroudImage using jQuery. I wrote this code but it is not work. What is the problem? Image is exist ![Image](https://i.stack.imgur.com/r35t2.jpg) ``` var Page = $(this); $(function () { SetBackgroundImage(); }); function SetBackgroundImage() { //Todo read ImagePath from server var ImageUrl; ImageUrl ="../Images/BackgroudImage.jpg"; try { Page.css('background-image', 'url(' + ImageUrl + ')'); } catch (e) { //LogError alert(e.Description); } } ```
Set HTML Page background image using jQuery
CC BY-SA 4.0
null
2011-06-05T06:20:06.313
2019-03-03T07:00:05.737
2019-03-03T07:00:05.737
1,033,581
369,161
[ "jquery" ]
6,241,383
1
6,241,729
null
2
629
So I'm trying to write a Python implementation of the A* algorithm. My algorithm finds the path to the target without trouble, but when I get the program to visualize the closed and open lists, I notice that the closed list, whenever the obstacles are a little complicated, will balloon into a large, perfect diamond shape. In other words, my algorithm is adding nodes to the closed list that are significantly further from the target than any of the neighbors of the "expected" closed list should be. To illustrate, when a point in the closed list is (2, 1) away from the target, but a wall is blocking the way, the algorithm will add both the node at (2, 2) away from the target (to try and get over the wall) and the algorithm at (3, 1) away from the target... for no good reason, since it's clearly further. I'm not sure what I'm doing wrong. This distance calculation is meant to use the "Manhattan method" (imperfect for my purposes, but it shouldn't be causing such problems), but other methods continue to offer the same problem (or indeed worse problems). ``` def distance(self, tile1, tile2): self.xDist = abs(tile1.col * TILE_SIZE - tile2.col * TILE_SIZE) self.yDist = abs(tile1.row * TILE_SIZE - tile2.row * TILE_SIZE) self.totalDist = self.straightCost * (self.xDist + self.yDist) return self.totalDist ``` The code for filling the closed list looks like this. Here, .score[2](https://i.stack.imgur.com/gFhQa.jpg) is the H value, calculated using the distance method shown above. ``` while self.endTile not in self.openList: self.smallestScore = MAX_DIST * 50 self.bestTile = None for tile in self.openList: if tile.score[2] <= self.smallestScore: self.bestTile = tile self.smallestScore = tile.score[2] self.examine(self.bestTile) ``` The "examine" function adds the examined tile to the closed list and its viable neighbors to the open list, and seems to be working fine. The algorithm appears to be admitting all tiles with an H score of X (where X varies depending on the complexity of the maze the target is set in). Slowing it down to a node-by-node visualization basically reveals that it is filling in an area of size X, and finds the path when the entrance into the maze is hit by the fill. I really have no clue what I'm doing wrong, and I've been trying to puzzle this out for two days now. EDIT: in the interest of solving the problem, here is a fuller extract of code. This is the examine() function: ``` def examine(self, tile): #Add the tile to the closed list, color it in, remove it from open list. self.closedList.append(tile) tile.color = CLOSED pygame.draw.rect(windowSurface, tile.color, tile.rect) pygame.display.update(tile.rect) self.openList.remove(tile) #Search all neighbors. for a, b in ((tile.col + 1, tile.row), (tile.col - 1, tile.row), (tile.col + 1, tile.row + 1), (tile.col + 1, tile.row - 1), (tile.col - 1, tile.row + 1), (tile.col - 1, tile.row - 1), (tile.col, tile.row + 1), (tile.col, tile.row - 1)): #Ignore if out of range. if a not in range(GRID_WIDTH) or b not in range(GRID_HEIGHT): pass #If the neighbor is pathable, add it to the open list. elif self.tileMap[b][a].pathable and self.tileMap[b][a] not in self.openList and self.tileMap[b][a] not in self.closedList: self.where = abs((a - tile.col)) + abs((b - tile.row)) if self.where == 0 or self.where == 2: self.G = tile.score[1] + self.diagCost self.H = self.distance(self.endTile, self.tileMap[b][a]) self.F = self.G + self.H elif self.where == 1: self.G = tile.score[1] + self.straightCost self.H = self.distance(self.endTile, self.tileMap[b][a]) self.F = self.G + self.H #Append to list and modify variables. self.tileMap[b][a].score = (self.F, self.G, self.H) self.tileMap[b][a].parent = tile self.tileMap[b][a].color = OPEN pygame.draw.rect(windowSurface, self.tileMap[b][a].color, self.tileMap[b][a].rect) pygame.display.update(self.tileMap[b][a].rect) self.openList.append(self.tileMap[b][a]) #If it's already in one of the lists, check to see if this isn't a better way to get to it. elif self.tileMap[b][a] in self.openList or self.tileMap[b][a] in self.closedList: self.where = abs((a - tile.col)) + abs((b - tile.row)) if self.where == 0 or self.where == 2: if tile.score[1] + self.diagCost < self.tileMap[b][a].score[1]: self.tileMap[b][a].score = (self.tileMap[b][a].score[0], tile.score[1] + self.diagCost, self.tileMap[b][a].score[2]) self.tileMap[b][a].parent = tile print "parent changed!" elif self.where == 1: if tile.score[1] + self.straightCost < self.tileMap[b][a].score[1]: self.tileMap[b][a].score = (self.tileMap[b][a].score[0], tile.score[1] + self.straightCost, self.tileMap[b][a].score[2]) self.tileMap[b][a].parent = tile print "parent changed!" ``` And this is a newer version of the iteration that slows down so I can watch it progress. It is meant to find the node with the lowest score[0] (score is a tuple of F, G, H scores). ``` def path(self): self.openList.append(self.startTile) self.startTile.score = (self.distance(self.startTile, self.endTile), 0, self.distance(self.startTile, self.endTile)) self.examine(self.openList[0]) self.countDown = 0 while self.endTile not in self.openList: if self.countDown <= 0: self.countDown = 5000 self.smallestScore = MAX_DIST * 50 self.bestTile = self.startTile for tile in self.openList: if tile.score[0] <= self.smallestScore: self.bestTile = tile self.smallestScore = tile.score[0] self.examine(self.bestTile) else: self.countDown -= timePassed ``` The following is an image illustrating the excess search area, using `self.totalDist = self.diagCost * math.sqrt(pow(self.xDist, 2) + pow(self.yDist, 2))` ![excess search area](https://i.stack.imgur.com/T6lfU.jpg) Alternatively, removing the TILE_SIZE constant from the equation gets me this equally inefficient-looking search area: ![enter image description here](https://i.stack.imgur.com/gFhQa.jpg) It seems to me that it shouldn't be searching all that extra area - just the area immediately surrounding the obstacles.
Python A* algorithm not searching appropriately
CC BY-SA 3.0
0
2011-06-05T06:34:36.467
2011-06-05T10:40:40.827
2011-06-05T10:40:40.827
779,199
779,199
[ "python", "pygame", "a-star" ]
6,241,598
1
6,241,666
null
2
730
On a web page that I am creating, I want to fill a rectangular area (let us say, the top half of the web page visible in a typical browser window) with about a hundred small rectangles: 1. Each rectangle (let us call this a cell) has its own colour, some text written inside it, and a border which distinguishes it from its neighbours. 2. The colour, shape and size of each cell, and the text which appears inside it is part of the input for making the web page : these depend on the user who is currently logged in, and changes periodically with time. Given the data for all the hundred cells, how do I draw (and redraw) them on the web page? What technology should I use? HTML Tables/JavaScript/JQuery UI/HTML5 Canvas/ ... ? My background: I am reasonably comfortable with programming in general, but am not used to any of the newer technologies used for creating web pages, apart from basic html, some php, and JavaScript played by the ear. I will learn whatever is needed to get this done well. Edit: In response to hamlin11's question: The cells do not have any relationship to one another in general, except that they are guaranteed to fill the rectangular area. Here is an (imperfect) example of what they might look like, without the colours: ![An example of the layout of cells, without the colours.](https://i.stack.imgur.com/yzePS.png)
How do I implement a dynamically changing grid on a web page?
CC BY-SA 3.0
null
2011-06-05T04:59:21.027
2011-12-22T16:26:20.670
2011-06-05T08:19:46.903
409,431
409,431
[ "javascript", "jquery", "html" ]
6,241,627
1
6,241,746
null
42
20,820
I understand that a user can own a process and each process has an address space (which contains valid memory locations, this process can reference). I know that a process can call a system call and pass parameters to it, just like any other library function. This seems to suggest that all system calls are in a process address space by sharing memory, etc. But perhaps, this is only an illusion created by the fact that in high level programming language, system calls look like any other function, when a process calls it. But, now let me take a step deeper and analyze more closely on what happens under the hood. How does compiler compile a system call? It perhaps pushes the system call name and parameters supplied by the process in a stack and then put the assembly instruction say "TRAP" or something -- basically the assembly instruction to call a software interrupt. This TRAP assembly instruction is executed by hardware by first toggling the mode bit from user to kernel and then setting the code pointer to say beginning of interrupt service routines. From this point on, the ISR executes in kernel mode, which picks up the parameters from the stack (this is possible, because kernel has access to any memory location, even the ones owned by user processes) and executes the system call and in the end relinquishes the CPU, which again toggles the mode bit and the user process starts from where it left off. Is my understanding correct? Attached is rough diagram of my understanding: ![enter image description here](https://i.stack.imgur.com/50kTR.png)
How do system calls work?
CC BY-SA 3.0
0
2011-06-05T07:51:09.733
2016-06-13T20:34:43.483
2014-12-16T05:40:44.153
680,727
381,088
[ "compiler-construction", "process", "operating-system", "interrupt", "system-calls" ]
6,241,751
1
6,242,870
null
4
1,775
I would like to recreate this effect (using jquery) because I think its the coolest thing ever. [http://m.madebycanvas.com/things/backflip.html](http://m.madebycanvas.com/things/backflip.html) (its by Matthew Farag) ![Flip animation](https://i.stack.imgur.com/j2RYv.gif) ...but I have no idea where to start. Does anyone know how or have any ideas? The author uses scripty2 and the prototype framework and scriptaculous, I believe. Ideally I could also use a plugin that uses hardware accelerated css transformations with a fallback to jquery's own in unsupported browsers. Please explain how you would do it conceptually if you can. I'm thinking to animate the button larger somehow to the width of the container it will flip to, then shrink the height anchored in the center to a line and then do the opposite to the panel that will appear.
How to use jquery to animate a back flip out of a button?
CC BY-SA 3.0
0
2011-06-05T08:22:50.873
2011-07-04T20:34:06.033
2011-07-04T20:34:06.033
153,097
153,097
[ "jquery", "jquery-ui", "flip", "jquery-effects" ]
6,241,960
1
null
null
2
321
This is my first time using Susy. I really like what I'm seeing in the docs / tutorials, but I've encountered some unexpected results with some of my first layout attempts. Version info: ``` >gem install compass-susy-plugin Successfully installed sass-3.1.2 Successfully installed chunky_png-1.2.0 Successfully installed fssm-0.2.7 Successfully installed compass-0.11.1 Successfully installed compass-susy-plugin-0.9 >ruby --version ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-darwin10.5.0] ``` The image below shows the result I'm getting using the [tutorial](http://susy.oddbird.net/tutorial/) html and screen.scss verbatim: ![why_is_the_h1_off_the_grid_somewhat](https://i.stack.imgur.com/lLOMp.png) As you can see, inspecting the h1 element shows it sitting just off the grid. Is this normal?
Susy: positioning of element in root context
CC BY-SA 3.0
null
2011-06-05T09:08:46.510
2012-08-24T21:32:01.637
2012-08-24T21:32:01.637
1,930,386
749,950
[ "compass-sass", "sass", "susy-compass" ]
6,242,136
1
null
null
2
3,250
I'm using Less Framework 4 for two websites I'm designing. In both designs I want to apply a 5 pixel border both on top and bottom of the document. The problem: because of the styles applied to , I'm applying the border-bottom and border-top to the object, so the bottom border never sticks to the bottom of the page like it would happen in a usual sticky footer situation. Here are the screenshots for the two cases: ![My Redesign](https://i.stack.imgur.com/Ujopi.png) [](https://i.stack.imgur.com/HQq2r.png) Here's the (LESS) CSS I'm using for html and body: pastie.org/private/us5x1vhjnwzq6zsiycnu2g ``` html { border-top: solid @black 10px; border-bottom: solid @black 10px; background: url('img/bg.png') repeat; } body { width: @8col; margin: 0px auto; padding: 100px 48px 84px; background: @white; color: rgb(60,60,60); -webkit-text-size-adjust: 100%; /* Stops Mobile Safari from auto-adjusting font-sizes */ font: 13px/20px 'OftenRegular'; -webkit-tap-highlight-color: @green; } ``` I've tried using `height: 100%` both for the `body` and `html` objects, but here's how it looks live: [http://prikonline.be/prikactie/](http://prikonline.be/prikactie/) How should I stick the border to the bottom of the page?
How to code a sticky footer using the html object, in HTML and CSS?
CC BY-SA 4.0
0
2011-06-05T09:50:59.410
2019-08-11T20:34:43.253
2019-08-11T20:34:43.253
4,751,173
618,063
[ "html", "css", "web", "sticky-footer" ]
6,242,344
1
null
null
0
360
Here is a screenshot from Evernote. It appears to have (but i might be wrong) a custom UINavigationBar as well as a custom UITabBar. ![evernote sceenshot](https://i.stack.imgur.com/V9HXV.jpg) A quick glance at the apps on my phone shows i could use a screenshot of Instagram, Path, DailyBooth, ... [From the docs:-](http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/NavigationControllers/NavigationControllers.html) > Because managing the navigation bar is the responsibility of the navigation controller, direct modification of the navigation bar itself is considered off limits for the most part. Does Apple regard this kind of thing as grounds for AppStore refusal?
Hacking UINavigationBar / Apple approval
CC BY-SA 3.0
0
2011-06-05T10:31:13.870
2011-06-05T10:48:01.357
null
null
311,745
[ "cocoa-touch", "ios" ]
6,242,448
1
6,242,528
null
4
515
I want to program a daemon-manager that takes care that all daemons are running, like so (simplified pseudocode): ``` void watchMe(filename) { while (true) { system(filename); //freezes as long as filename runs //oh, filename must be crashed. Nevermind, will be restarted } } int main() { _beginThread(watchMe, "foo.exe"); _beginThread(watchMe, "bar.exe"); } ``` This part is already working - but now I am facing the problem that when an observed application - say foo.exe - crashes, the corresponding system-call freezes until I confirm this beautiful message box: ![error msg](https://i.stack.imgur.com/kltXz.jpg) This makes the daemon useless. What I think might be a solution is to make the main() of the observed programs (which I control) "uncrashable" so they are shutting down gracefully without showing this ugly message box. Like so: ``` try { char *p = NULL; *p = 123; //nice null pointer exception } catch (...) { cout << "Caught Exception. Terminating gracefully" << endl; return 0; } ``` But this doesn't work as it still produces this error message: ![error msg](https://i.stack.imgur.com/pH682.jpg) ("Untreated exception ... Write access violation ...") I've tried SetUnhandledExceptionFilter and all other stuff, but without effect. Any help would be highly appreciated. Greets
Make main() "uncrashable"
CC BY-SA 3.0
null
2011-06-05T10:51:07.160
2011-06-05T13:19:07.863
null
null
623,400
[ "c++", "exception" ]
6,242,457
1
null
null
0
1,646
![**I want CSS menu code to display menu with image horizontally**](https://i.stack.imgur.com/xUPBW.jpg) ![enter image description here](https://i.stack.imgur.com/SOSsS.jpg) i tried to ask same question on this post but the result i get shows the menu in vertical how do i display it horizontal. if i set the display property block then it sets menu vertically? please share code if possible [i asked same question her you will get code](https://stackoverflow.com/questions/6242079/how-to-align-text-under-image-in-css-menu) Please Share CSS and HTML code that will give me expected result;
how to display css Horizontal menu?
CC BY-SA 3.0
null
2011-06-05T10:53:41.050
2011-06-05T11:08:46.307
2017-05-23T12:13:39.697
-1
578,083
[ "html", "css" ]
6,242,478
1
null
null
26
2,403
I'm currently migrating a web application from a database-based internationalization approach (each word having an entry in the translation table, and the actual translation) to one based on [Zend_Translate](http://framework.zend.com/manual/en/zend.translate.html) and CSV files. I need to provide a end-user friendly way to update those translations quickly and easily. Ideally, to minimize the risk of breaking stuff, users would not edit the CSV files directly, but be shown a nice form with fields. Do you know a standalone, PHP-based, end-user compatible translation frontend that supports one of the adapters `Zend_Translate` has to offer - ideally gettext or csv? Something like Python's/Django's [Rosetta](http://code.google.com/p/django-rosetta/) but in PHP? Rosetta does exactly what I need: ![enter image description here](https://i.stack.imgur.com/VxNm2.png) but I would very much like to stay with PHP here for server setup reasons. [SimplePO](http://code.google.com/p/simplepo/) looks like it goes in the right direction, but is too simple - it doesn't seem to be able to handle multiple languages and catalogs, and plurals.
PHP translation frontend similar to Rosetta?
CC BY-SA 3.0
0
2011-06-05T10:57:50.560
2013-05-17T22:53:53.413
2011-06-06T16:41:44.190
187,606
187,606
[ "php", "zend-framework", "internationalization", "translation", "gettext" ]
6,242,502
1
6,247,680
null
6
7,647
I need to create a plot like in this image: ![model that i want to replicate](https://i.stack.imgur.com/ub6rC.png) I wrote this code: ``` close all x = [NaN 1 3 7 9 23 8]; y = [NaN 2 6 7 8 2 1]; z = [NaN 1 4 5 5 4 1]; for n = 1:length(z)-1 x1 = x(n); x2 = x(n+1); y1 = y(n); y2 = y(n+1); z1 = z(n); z2 = z(n+1); p = patch([x1 x2 x2 x1], [y1 y2 y2 y1], [0 0 z2 z1], [0 1 1]); set(p, 'LineStyle', 'none'); plot3([x1 x2], [y1 y2], [z1 z2], 'b-', 'linewidth', 3); hold on end view(3); light ``` And I get this: ![Model generated by this code](https://i.stack.imgur.com/66ohv.jpg) This is okay, but every patch face has a solid color, where I would like to have a color gradient based on the Z value, like in the first image where lowest z values are azure and highest z values are white (with a gradient from lowest to highest). How can I modify my script to get this effect?
How can I fill patch objects using a colormap instead of a solid color?
CC BY-SA 3.0
null
2011-06-05T11:02:51.547
2017-05-17T05:54:09.653
2017-05-17T05:54:09.653
52,738
700,209
[ "matlab", "plot", "colormap" ]
6,242,623
1
6,243,816
null
0
740
So I look onto [OpenGL ES shader specs](http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf) but do not see such... For example - I created simple "pinch to zoon" and "rotate to turn around" and "move to move center" HYDRA pixel bender filter. it can be executed in flash. It is based on default pixel bender twirl example and [this](http://www.rphelan.com/2008/10/17/zoom-blur-pixel-bender-filter/): ``` <languageVersion: 1.0;> kernel zoomandrotate < namespace : "Pixel Bender Samples"; vendor : "Kabumbus"; version : 3; description : "rotate and zoom an image around"; > { // define PI for the degrees to radians calculation const float PI = 3.14159265; // An input parameter to specify the center of the twirl effect. // As above, we're using metadata to indicate the minimum, // maximum, and default values, so that the tools can set the values // in the correctly in the UI for the filter. parameter float2 center < minValue:float2(0.0, 0.0); maxValue:float2(2048.0, 2048.0); defaultValue:float2(256.0, 256.0); >; // An input parameter to specify the angle that we would like to twirl. // For this parameter, we're using metadata to indicate the minimum, // maximum, and default values, so that the tools can set the values // in the correctly in the UI for the filter. parameter float twirlAngle < minValue:float(0.0); maxValue:float(360.0); defaultValue:float(90.0); >; parameter float zoomAmount < minValue:float(0.01); maxValue:float(10.0); defaultValue:float(1); >; // An input parameter that indicates how we want to vary the twirling // within the radius. We've added support to modulate by one of two // functions, a gaussian or a sinc function. Since Flash does not support // bool parameters, we instead are using this as an int with two possible // values. Setting this parameter to be 1 will // cause the gaussian function to be used, unchecking it will cause // the sinc function to be used. parameter int gaussOrSinc < minValue:int(0); maxValue:int(1); defaultValue:int(0); >; input image4 oImage; output float4 outputColor; // evaluatePixel(): The function of the filter that actually does the // processing of the image. This function is called once // for each pixel of the output image. void evaluatePixel() { // convert the angle to radians float twirlAngleRadians = radians(twirlAngle); // calculate where we are relative to the center of the twirl float2 relativePos = outCoord() - center; // calculate the absolute distance from the center normalized // by the twirl radius. float distFromCenter = length( relativePos ); distFromCenter = 1.0; // modulate the angle based on either a gaussian or a sync. float adjustedRadians; // precalculate either the gaussian or the sinc weight float sincWeight = sin( distFromCenter ) * twirlAngleRadians / ( distFromCenter ); float gaussWeight = exp( -1.0 * distFromCenter * distFromCenter ) * twirlAngleRadians; // protect the algorithm from a 1 / 0 error adjustedRadians = (distFromCenter == 0.0) ? twirlAngleRadians : sincWeight; // switch between a gaussian falloff or a sinc fallof adjustedRadians = (gaussOrSinc == 1) ? adjustedRadians : gaussWeight; // rotate the pixel sample location. float cosAngle = cos( adjustedRadians ); float sinAngle = sin( adjustedRadians ); float2x2 rotationMat = float2x2( cosAngle, sinAngle, -sinAngle, cosAngle ); relativePos = rotationMat * relativePos; float scale = zoomAmount; // sample and set as the output color. since relativePos // is related to the center location, we need to add it back in. // We use linear sampling to smooth out some of the pixelation. outputColor = sampleLinear( oImage, relativePos/scale + center ); } } ``` So now I want to port it into OpenGL ES shader. math and parameters are convertable into OpenGL ES shader language, but what to do with sampleLinear? what is analog for it in openGL ES shader languge? So I had created something similar to my HYDRA filter... compatable with webGL and OpenGL ES shaders... ``` #ifdef GL_ES precision highp float; #endif uniform vec2 resolution; uniform float time; uniform sampler2D tex0; void main(void) { vec2 p = -1.0 + 2.0 * gl_FragCoord.xy / resolution.xy; // a rotozoom vec2 cst = vec2( cos(.5*time), sin(.5*time) ); mat2 rot = 0.5*cst.x*mat2(cst.x,-cst.y,cst.y,cst.x); vec3 col = texture2D(tex0,0.5*rot*p+sin(0.1*time)).xyz; gl_FragColor = vec4(col,1.0); } ``` To see how it works get modern browser, navigate to [shadertoy](http://www.iquilezles.org/apps/shadertoy/) provide it with one texture ( `http://www.iquilezles.org/apps/shadertoy/presets/tex4.jpg` for example), paste my code into editable text aeria and hit ![enter image description here](https://i.stack.imgur.com/zAiS5.jpg)... Have fun. So.. now I have another problem... I want to have one image and black around it not copies of that same image... Any one knows how to do that?
What is OpenGL ES 2 Shader language analog for HYDRA (pixel bender) sampleLinear?
CC BY-SA 3.0
null
2011-06-05T11:30:33.547
2011-06-05T15:23:38.953
2011-06-05T11:57:56.807
434,051
434,051
[ "opengl-es", "shader", "pixel-shader", "pixel-bender", "hydra" ]
6,242,962
1
6,242,994
null
-1
949
I'm getting an incorrect decrement of the reference count for the filemanager object. ``` -(void) checkDb{ BOOL success; // Create a FileManager object, we will use this to check the status of the database and to copy it over if required NSFileManager *fileManager = [NSFileManager defaultManager]; // Check if the database has already been created in the users filesystem success = [fileManager fileExistsAtPath:dbPath]; if (success) { //we found the file, we need to check version sqlite3 *db; //NSLog(@"Current Databasepath: %@",dbPath); // Open the current db (found in the user's filessytem) if(sqlite3_open([dbPath UTF8String], &db) == SQLITE_OK) { const char *sql = "select dbversion from settings"; sqlite3_stmt *rs; if(sqlite3_prepare_v2(db, sql, -1, &rs, NULL) == SQLITE_OK) { if (sqlite3_step(rs) == SQLITE_ROW) { //not eof int curDbVersion=sqlite3_column_int(rs,0); if (curDbVersion>=minDbVersion){ //good dbversion, no need to copy from resources return; } } } sqlite3_finalize(rs); } sqlite3_close(db); } //we reached this section which means: //either database was not found, or invalid db version //so, we need to copy it from the resources directory (or maybe download it from internet?) // Get the path to the database in the application package NSString *dbPathFromApp = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:dbName]; // Copy the database from the package to the users filesystem [fileManager copyItemAtPath:dbPathFromApp toPath:dbPath error:nil]; [fileManager release]; ``` } The program is running perfectly, but when I analyze it, I'm getting a warning. Here's a screenshot of the warning that I'm getting: ![Original: grab.by/ahSi](https://i.stack.imgur.com/ZETf4.png) Any hints of what might have I missed?
Incorrect decrement of the reference count
CC BY-SA 3.0
null
2011-06-05T12:42:48.003
2011-08-02T16:29:31.613
2011-08-02T16:29:31.613
63,550
784,703
[ "xcode", "ios", "debugging", "memory-leaks" ]
6,243,350
1
6,243,422
null
14
53,528
How do I align the text in a RichTextBox? ![RTB](https://i.stack.imgur.com/WRgdQ.jpg) Basically, the RTB contains: "--testing" "--TESTING" "TESTING--" "testing--" Which all have the same number of characters, but have different alignments. How can I align them properly? Im fairly new to C# and confused since it aligned properly in Java's TextArea. Thank you!
How to 'align' text in RichTextBox C#?
CC BY-SA 3.0
0
2011-06-05T13:54:23.040
2020-12-06T03:15:56.227
null
null
488,792
[ "c#", "richtextbox", "alignment" ]
6,243,411
1
6,243,542
null
3
2,823
today I have a (simple) rendering problem for you. My current project gets datas from a file to generate a SVG file. Drawing things as polygon is pretty easy thanks to the SVG format, but I have a single problem: some of my polygons are in AND out of the page (meaning that some parts of them are displayed while the rest is not shown due to the fact they are out of the display limit). In order to optimize the final SVG file I need to reduce my polygon to a simpler form. Consider the grey rectangle as my page. Consider the green polygon as the thing I actually draw. First picture shows you the thing that I actually have while the second picture shows you the final result I want to have. ![Polygon and page as I have them now](https://i.stack.imgur.com/o2ugm.jpg) ![Polygon and page as I need to have them](https://i.stack.imgur.com/azV5B.jpg) First I thought to reduce my polygon in simple triangles in order to only draw points in the display limits. But I think a simpler solution exists... if you have it do not hesitate to share it with me :) EDIT: I have this tricky case to handle as well : ![enter image description here](https://i.stack.imgur.com/c8ClY.jpg)![enter image description here](https://i.stack.imgur.com/tpP5D.jpg) Thank you.
clipping polygon against rectangle
CC BY-SA 3.0
null
2011-06-05T14:07:56.780
2011-06-05T15:54:35.633
2011-06-05T15:54:35.633
768,469
399,110
[ "math", "svg", "polygon", "computational-geometry", "raster" ]
6,243,406
1
6,243,433
null
0
6,108
I am trying to make my jQuery form validator work. I spent already 5 hours making it work, researching and stuff, but until now I can't. My code is as follows: ``` <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> <link rel="stylesheet" type="text/css" href="style.css" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js" type="text/javascript"></script> <link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css"/> <script> $(document).ready(function(){ $("#formID").validationEngine(); }); </script> </head> <body> <div id="headerBar" ><h1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The Book of Joy!</h1></div> <div id="content" align="center"> <div id="contentText" align="center">Be a part of our team of IT experts. Apply now!</div> <div id="leftContent" align=center></div> <div id="rightContent" align=left> <b>Signup now!</b> <hr> <form id="formID" method = "post" action = "AddApplicantServlet"> <fieldset> <legend id="legendid">Applicant Registration Form</legend> <table> <tr><td>First Name: </td><td><input type = "text" name = fName class="validate[required,custom[onlyLetterSp]]"> </td></tr> <tr><td>Middle Name: </td><td><input type = "text" name = mName class="validate[required,custom[onlyLetterSp]]"> </td></tr> <tr><td>Last Name: </td><td><input type = "text" name = lName class="validate[required,custom[onlyLetterSp]]"> </td></tr> <tr><td>Age: </td><td><input type = "text" name = age class="validate[required,custom[onlyNumberSp]],maxSize[2]"> </td></tr> <tr><td>Gender: </td><td><select name = gender><option value='m'>Male</option><option value='f'>Female</option> </select> </td></tr> <tr><td>Email Address: </td><td><input type = "text" name = email class="validate[required,custom[email]]"> </td></tr> <tr><td>Contact No: </td><td><input type = "text" name = contactNumber class="validate[required]"></td></tr> <tr><td>City of Residence: </td><td><input type = "text" name = city class="validate[required]"> </td></tr> <tr><td>School: </td><td><input type = "text" name = school class="validate[required]"> </td></tr> <tr><td>Course: </td><td><input type = "text" name = course class="validate[required]"> </td></tr> <tr><td>Year Graduated: </td><td><input type = "text" name = yearGraduated class="validate[required,custom[onlyNumberSp]],maxSize[4]"></td></tr> <tr><td>Previous Work Experience: </td><td><input type = "text" name = yearWorkExp class="validate[required,custom[onlyNumberSp]],maxSize[2]"> </td></tr> <tr><td>Sourcing Channel: </td><td><select name = sourceChannel> <option value='Jobstreet'>Jobstreet</option> <option value='Direct'>Direct</option> <option value='Referral'>Referral</option> <option value='Board Exam'>Board Exam</option> <option value='Oath Taking'>Oath Taking</option> <option value='GradList'>GradList</option> </select></td></tr> <tr><td> <input type = "submit" value = SUBMIT></td></tr> </table> </fieldset> </form> <hr> </div> </div> ``` Why is it not working and how can I solve it? EDIT: I used chromebug and it cannot find my js... Did I put it on the correct path? Here are my files: ![enter image description here](https://i.stack.imgur.com/w2kqJ.png) This is my chromebug and i don't know what it means.. :(: ![enter image description here](https://i.stack.imgur.com/SeZOc.png)
JQuery Form Validator plugin not working
CC BY-SA 3.0
null
2011-06-05T14:07:00.257
2017-02-19T21:47:04.703
2017-02-19T21:47:04.703
13,302
525,965
[ "jquery", "html" ]
6,243,508
1
6,244,288
null
15
11,357
I have a screen with 4 seek bars ( As shown in the image below) . If the user moves B,C or D I calculate the average of the three and setProgress of A to the average. That was the easy part . What I would like to do is animate the progress bar A such that it does not jump in one shot (for eg from 25-75 ). What are the recommended ways to animate A? I got a simple animation up but I am calling a TimerTask every 50ms to increment or decrement A by a unit value till I reach the required position. But its not very efficient. Note: I have a custom Seekbar object using which I have created seekBar's A,B,C & D. Sorry I cant really share the code but will be happy to clarify anything. ![enter image description here](https://i.stack.imgur.com/DFapG.png)
Animate seekbar progress
CC BY-SA 3.0
0
2011-06-05T14:28:18.303
2018-03-13T17:08:18.230
null
null
304,673
[ "android", "animation", "seekbar" ]
6,243,535
1
13,761,142
null
1
8,237
First I need to make some color scribbles (the picture below is taken from M. Yang article's on Still Image Colorization) on an monochrome input image which is loaded into a PictureBox control. ![Enter image description here](https://i.stack.imgur.com/L0BCR.png) I'm trying to use this to get the effect: ``` private void PictureBoxOnMouseDown(Object sender, MouseEventArgs e) { if((e.Button & MouseButtons.Left) == MouseButtons.Left) { this.MouseInitialPosition = e.Location; } } private void PictureBoxOnMouseMove(Object sender, MouseEventArgs e) { if((e.Button & MouseButtons.Left) == MouseButtons.Left) { this.MouseLastPosition = e.Location; } this._PictureBox.Invalidate(); } private void PictureBoxOnPaint(Object sender, PaintEventArgs e) { using(var pen = new Pen(Color.Red, 3.0F)) { e.Graphics.DrawLine(pen, this.MouseInitialPosition, this.MouseLastPosition); } } ``` But that's giving me not quite I've been waiting for: - I can't put several lines. Lines are not stored;- I'm overwriting line with line; Second. I need to get all pixels from an image I've been drawing onto and filter them in some way (i.e. extract special ones). How do I store lines/scribbles onto image and then read the image efficiently?
Drawing lines in a PictureBox
CC BY-SA 3.0
null
2011-06-05T14:32:23.047
2016-07-20T20:53:07.940
2016-07-20T20:50:18.393
63,550
532,675
[ "c#", "graphics", "drawing", "gdi+", "picturebox" ]
6,243,611
1
24,675,230
null
7
21,021
i have small problem with autocomplete option in combobox. Everything is working correct, except that i want to work it diffrent :) When I start typing in combobox, autusuggest working the way i like : ![Combo](https://i.stack.imgur.com/l0uL6.png) But when i first open combobox, and then start typing i get something like that: ![enter image description here](https://i.stack.imgur.com/rjj5A.png) What's more i can't pick item from autosuggest combobox, only from this list under. AutocompleteMode is SuggestAppend I'd like to have autosuggest like on the first picture, and in situations like picture 2, this first combobox list should be closed somehow..
Combobox and autocomplete in C#
CC BY-SA 3.0
0
2011-06-05T14:46:14.947
2016-03-28T07:40:21.227
2011-06-05T15:02:10.937
684,570
684,570
[ "c#", "winforms", "autocomplete", "combobox" ]