Id
int64
1.68k
75.6M
PostTypeId
int64
1
2
AcceptedAnswerId
int64
1.7k
75.6M
ParentId
int64
1.68k
75.6M
Score
int64
-60
3.16k
ViewCount
int64
8
2.68M
Body
stringlengths
1
41.1k
Title
stringlengths
14
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
1
CreationDate
stringlengths
23
23
LastActivityDate
stringlengths
23
23
LastEditDate
stringlengths
23
23
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
1
21.3M
Tags
list
5,268,135
1
5,268,196
null
2
2,902
I have been trying to figure out a good strategy to perform a bitmap crop using Actionscript3. For example: I have a picture of a car and I want to crop out the car from the image alone and feather the edges so that they do not look jagged. I am a flash noob and have only been using it for a couple of weeks. I've tried a couple of options and here is the last one that I have come up with it: I place red dots on stage that are draggable so that you can outline the object you want to crop and the dots are the bounds for a gradientFill that is used as the bitmap's mask. (I am using a radial gradient ... so the results are far from what I want, since the car is not an oval). (ignore the random yellow dotted oval) ![GradientFill (radial) used as Bitmap mask](https://i.stack.imgur.com/ALzj9.png) ``` package code{ import flash.display.Sprite; import flash.display.Bitmap; import flash.display.BitmapData; import flash.events.Event; import flash.events.MouseEvent; //import flash.display.Graphics; import fl.controls.Button; import code.CropDot; import flash.display.MovieClip; import flash.display.GradientType; import flash.display.SpreadMethod; import flash.geom.Matrix; import flash.display.Shape; //import fl.controls.RadioButton; public class BitmapEdit extends Sprite{ public var maskee:MovieClip; public var bitmap:Bitmap; public var dots:Sprite; public var fill:MovieClip; public var numDots:int; public var circ:Shape = new Shape(); //////////////////// public var mat:Matrix=new Matrix(); public var circRad:Number=50; public var offsetX:int; public var offsetY:int; public function BitmapEdit(bmp:Bitmap){ trace("bitmapedit"); //MASK Stuff //-------------- bitmap = new Bitmap(bmp.bitmapData); maskee = new MovieClip(); maskee.addChild(bitmap); fill = new MovieClip(); this.addChild(maskee); this.addChild(fill); maskee.mask = fill; maskee.cacheAsBitmap = true; fill.cacheAsBitmap = true; // DOTS DOTS DOTS //--------------- dots = new Sprite(); numDots = 12; offsetX = 90; offsetY = 90; cX = dot0.x+offsetX; cY = dot0.y+offsetY; rangeX = [cX,cX]; rangeY = [cY,cY]; for(var i:int=0;i<numDots;i++){ this['dot'+i.toString()].x += offsetX; this['dot'+i.toString()].y += offsetY; //this['dot'+i.toString()].name = 'dot'+i.toString(); dots.addChild(this['dot'+i.toString()]) cX+=dotX; cY+=dotY; if(dotX<=rangeX[0]) rangeX[0]=dotX; else if(dotX>rangeX[1]) rangeX[1]=dotX; if(dotY<=rangeY[0]) rangeY[0]=dotY; else if(dotY>rangeY[1]) rangeY[1]=dotY; } cdot.x = cX; cdot.y = cY; this.addChild(dots); fill.graphics.lineStyle(3,0,1.0,true); this.addEventListener(Event.ENTER_FRAME, enterFrameHandler); } public var cX:Number; public var cY:Number; public var dotX:Number; public var dotY:Number; public var prevdotX:Number; public var prevdotY:Number; public var rangeX:Array; public var rangeY:Array; protected function enterFrameHandler(e:Event){ //draw lines between dots this.setChildIndex(fill,this.numChildren-2); this.setChildIndex(dots,this.numChildren-1); fill.graphics.clear(); //-Draw Fill var fW = rangeX[1]-rangeX[0]; var fH = rangeY[1]-rangeY[0]; mat.createGradientBox(fW, fH, 0, cX-fW/2, cY-fH/2); //fill.graphics.beginFill(0,1); //fill.graphics.beginBitmapFill(bitmap.bitmapData); //mat = new Matrix(); //fill.graphics.beginFill(0,1); fill.graphics.beginGradientFill(GradientType.RADIAL,[0x000000, 0x000000], [1, 0], [123,255], mat, SpreadMethod.PAD, "rgb", 0); fill.graphics.moveTo(dot0.x, dot0.y); cX = dot0.x; cY = dot0.y; prevdotX = dot0.x; prevdotY = dot0.y; rangeX = [cX,cX]; rangeY = [cY,cY]; for(var i:int=1; i<numDots; i++){ dotX = this['dot'+i.toString()].x; dotY = this['dot'+i.toString()].y; fill.graphics.lineTo( dotX, dotY); cX+=dotX; cY+=dotY; if(dotX<=rangeX[0]) rangeX[0]=dotX; else if(dotX>rangeX[1]) rangeX[1]=dotX; if(dotY<=rangeY[0]) rangeY[0]=dotY; else if(dotY>rangeY[1]) rangeY[1]=dotY; } cX/=numDots; cY/=numDots; //trace("ctr:"+cX+","+cY); cdot.x = cX; cdot.y = cY; fill.graphics.lineTo(dot0.x,dot0.y); // */ //EndFill fill.graphics.endFill(); } function toRad(a:Number):Number { return a*Math.PI/180; } } } ``` 1) How can I fade just the edges of this custom-shaped fill outlined by the red dots? 2) I want to save the image out to a file once it's cropped. What strategy would be better for doing this using a BitmapFill or a GradientFill as a Mask (If it's possible with both)? 3) I may be using this strategy to crop faces later on.. anyone know of any good face detection APIs for as3? (also edge detection APIs) Thanks ahead everyone :)
Flash / Actionscript 3 Bitmap crop with feathered edges (blur edges)
CC BY-SA 2.5
0
2011-03-11T01:51:49.710
2011-03-11T02:05:57.413
null
null
645,251
[ "flash", "actionscript-3", "bitmap", "crop" ]
5,268,247
1
5,268,450
null
0
934
First of all, can I just say, I find laying out android UI's to be a frustrating experience? I used to think the XML layouts were simple and clean and awesome but every time I try to make anything with it I spend hours trying to do the simplest things! In this particular instance I'm trying to make a simple horizontal bar that contains an image button of fixed size on the right and to the left of it I want an ImageView that takes up the rest of the available width. I see similar constructs all the time in the UI: the search box that appears at the top of the screen when searching, the text area and send button for composing text/googletalk messages, etc. I've tried both a horizontal linear layout and a relative layout, and I can't get the button to look right in either one. My latest attempt has the following layout code: It looks like this: ![Screnshot](https://i.stack.imgur.com/7Btbp.png) Using the hiearchyviewer indicates that both the imageview and the button have the same height (45px). And it shows the view dimensions and positions to be exactly what I'm looking for. Same height (differing widths of course since the ImageView is much wider). And they butt right up next to each other, centered in the Relative Layout. However the button as drawn on screen is obviously not taking up the full ImageButton view. I'm thinking it's something weird about the android system 9patch drawable used for the ImageButton background. But what do I know? I can't get it to look right no matter what I try.
How can I get an image button's dimensions to make sense in android?
CC BY-SA 2.5
null
2011-03-11T02:14:02.460
2011-03-13T15:30:24.197
null
null
354,271
[ "android", "layout", "position", "imagebutton", "dimensions" ]
5,268,281
1
5,268,494
null
2
14,651
Why I'm getting this error? ![enter image description here](https://i.stack.imgur.com/D4o4Q.jpg) ``` System.InvalidCastException was unhandled by user code Message=Specified cast is not valid. Source=System.Windows.Forms StackTrace: at System.Windows.Forms.UnsafeNativeMethods.IHTMLDocument2.GetLocation() at System.Windows.Forms.WebBrowser.get_Document() at System.Windows.Forms.WebBrowser.get_DocumentStream() at System.Windows.Forms.WebBrowser.get_DocumentText() at SiteBot.MainWindow.backgroundWorker1_DoWork(Object sender, DoWorkEventArgs e) in D:\Documents\Visual Studio 2010\Projects\SiteBot\MainWindow.cs:line 35 at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e) at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument) InnerException: ```
C# System.InvalidCastException
CC BY-SA 2.5
0
2011-03-11T02:18:38.223
2011-03-11T03:12:42.947
2011-03-11T02:46:49.733
465,408
465,408
[ "c#", ".net", "exception" ]
5,268,319
1
5,268,347
null
3
1,061
![enter image description here](https://i.stack.imgur.com/gWQAO.png) Honestly I don't know the effect of increasing or decreasing the number of worker processes. For a single Application Pool, how many Worker Processes should be allowed to run?
For a single Application Pool, how many Worker Processes should be allowed to run?
CC BY-SA 2.5
0
2011-03-11T02:24:01.837
2011-03-11T14:02:41.373
null
null
397,524
[ "asp.net", "iis", "iis-7.5" ]
5,268,330
1
5,389,201
null
4
835
Lots of my files in my Xcode project get "stuck" outside of my project and I'm unable to delete them. This happens occasionally when creating new files (maybe 50% of the time). Here's a screenshot of what happens: ![enter image description here](https://i.stack.imgur.com/LukAE.png) Any ideas? Thanks.
Xcode 4: Files get stuck outside of project, unable to be deleted
CC BY-SA 2.5
0
2011-03-11T02:26:25.080
2011-03-22T09:36:33.940
null
null
215,056
[ "xcode", "xcode4" ]
5,268,362
1
5,292,411
null
1
2,944
I am having problem inserting a parameter into the top left hand corner of my jasper report cross tab. I need some "text" at the top left hand corner (seems strange), and although i am quite sure this is not easy or even legal, i would like to check if anyone has attempted something a similar feat. ![Parameter not found](https://i.stack.imgur.com/sz1Ea.png)
Jasper Report Cross Tab Adding Parameter
CC BY-SA 2.5
null
2011-03-11T02:34:07.083
2019-01-31T08:42:01.877
2011-03-13T21:12:05.710
59,087
321,862
[ "jasper-reports", "ireport" ]
5,268,454
1
5,268,490
null
15
11,110
I have been trying to do a proper 301 redirect and have failed to do so. No matter what i try, its always a 302 redirect. Returns a 302: ``` http_redirect("urlgoeshere", '', false, HTTP_REDIRECT_PERM) ``` Returns a 302: ``` header("HTTP/1.1 301 Moved Permanently"); header("Location: urlgoeshere"); ``` Can anyone explain why these are coming back as 302's and not 301's? Server OS is linux, running PHP/5.2.14. Try it yourself. I will give you guys a URL to try. I am testing using YSlow and Googlebot. Should be 301: [http://www.fantasysp.com/player/mlb/Albert_Pujols/1486349](http://www.fantasysp.com/player/mlb/Albert_Pujols/1486349) ![Firebug shows a 302 Code](https://i.stack.imgur.com/dRzbZ.png)
PHP 301 Redirect, Impossible?
CC BY-SA 2.5
0
2011-03-11T02:51:55.470
2011-03-11T03:50:49.860
2011-03-11T03:50:49.860
309,535
309,535
[ "php", "http-status-code-301" ]
5,268,467
1
5,302,659
null
2
2,019
I am trying to make a NSScrollView with clipped corners, similar to the Twitter app: ![enter image description here](https://i.stack.imgur.com/UvcTH.png) I have a `NSScrollView` subclass which I added the following code: ``` - (void)drawRect:(NSRect)dirtyRect { NSBezierPath *pcath = [NSBezierPath bezierPathWithRoundedRect:[self bounds] xRadius:kDefaultCornerRadius yRadius:kDefaultCornerRadius]; [path setClip]; [super drawRect:dirtyRect]; } ``` I expected the content of the `NSScrollView` to have rounded corners, but it is not respecting the clipped path. How can I do this? I know how to make a custom `NSScroller`, I know how to make it transparent overlay. All I am asking is how to make the `NSSCrollView` clip its corners, including everything it contains. The `NSScrollView` is inside a `NSView` which has a background that could change, meaning a view overlay to fake the rounded corners is not an option.
How can I get NSScrollView to respect a clipping path
CC BY-SA 2.5
0
2011-03-11T02:54:15.193
2012-04-03T08:45:12.753
2011-03-14T18:14:57.613
69,634
69,634
[ "cocoa", "subclass", "rounded-corners", "nsscrollview", "nsbezierpath" ]
5,268,595
1
null
null
0
745
hours ago I post a question on organizing portrait and landscape mode in iPhone and now I think I know how to do it using willRotateToInterfaceOrientation:duration. The first screen is 'Map View' with one button that leads to 'Setting View'. The Map View does not support rotate but for the Setting View I made separate view for portrait and landscape and they swap accordingly when rotated. ![enter image description here](https://i.stack.imgur.com/CBBJr.png), ![enter image description here](https://i.stack.imgur.com/FFuFG.png), ![enter image description here](https://i.stack.imgur.com/WUUDD.png) As you can see when Setting button pressed SettingView is added on the view stack as usual. So basically I use three view controllers; Setting, SettingLandscape and SettingPortrait. I still found problem in rotating view in iPhone when I use navigationViewController. It used to working fine without rotation.- when I'm not using multiple view for rotation-. This is root view controller. ``` - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; ``` } ``` -(IBAction) buttonPressed{ Setting *settingViewController = [[Setting alloc] initWithNibName:@"Setting" bundle:[NSBundle mainBundle]]; UINavigationController *navController1 = [[UINavigationController alloc] initWithRootViewController: settingViewController]; [self.navigationController presentModalViewController:navController1 animated:YES]; [settingViewController release]; [navController1 release]; ``` } This view controller does nothing but swap views when rotate and shows appropriate view between portrait and landscape. In Setting.m, I swap view as follow; ``` - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { if (toInterfaceOrientation==UIInterfaceOrientationLandscapeRight) { NSLog(@"to Right"); SettingLandscape *setting_landscape = [[SettingLandscape alloc] initWithNibName:@"SettingLandscape" bundle:[NSBundle mainBundle]]; self.view = setting_landscape.view; [setting_landscape release]; } if (toInterfaceOrientation==UIInterfaceOrientationLandscapeLeft) { NSLog(@"to Left"); SettingLandscape *setting_landscape = [[SettingLandscape alloc] initWithNibName:@"SettingLandscape" bundle:[NSBundle mainBundle]]; self.view = setting_landscape.view; [setting_landscape release]; } if (toInterfaceOrientation==UIInterfaceOrientationPortrait) { NSLog(@"to Portrait"); SettingPortrait *settingportrait = [[SettingPortrait alloc] initWithNibName:@"SettingPortrait" bundle:[NSBundle mainBundle]]; self.view = settingportrait.view; [settingportrait release]; } if (toInterfaceOrientation==UIInterfaceOrientationPortraitUpsideDown) { NSLog(@"to PortraitUpsideDown"); SettingPortrait *settingportrait = [[SettingPortrait alloc] initWithNibName:@"SettingPortrait" bundle:[NSBundle mainBundle]]; self.view = settingportrait.view; [settingportrait release]; } ``` } In viewWillAppear, Setting view controller also has ; ``` self.title = @"Shell "; self.navigationController.navigationBarHidden = NO; self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStylePlain target:self action:@selector(Done)] autorelease]; ``` and Done is ``` - (void) Done{ [self dismissModalViewControllerAnimated:YES]; ``` } This view stacked on when the view is rotated. This view controller has it's navigation bar. ``` - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; self.title = @"Setting Landscape"; ``` } ``` - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; ``` } in viewDidLoad; ``` - (void)viewDidLoad { [super viewDidLoad]; NSLog(@"landscape:viewDidLoad"); //self.title = @"SettingLandscape";//not working!! //self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"Done1" style:UIBarButtonItemStylePlain target:self action:@selector(Done)] autorelease]; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; stringflag4MapType = [[NSString alloc] initWithString:@"blah"]; stringflag4MapType = [defaults stringForKey:@"flag4MapType"]; if (![stringflag4MapType isEqualToString:@"Hybrid"] && ![stringflag4MapType isEqualToString:@"Standard"] && ![stringflag4MapType isEqualToString:@"Satellite"]) { segmentedControl4MapType.selectedSegmentIndex = 0; }else if ([self.stringflag4MapType isEqualToString:@"Standard"]) { segmentedControl4MapType.selectedSegmentIndex = 0; }else if ([self.stringflag4MapType isEqualToString:@"Satellite"]) { segmentedControl4MapType.selectedSegmentIndex = 1; }else if ([self.stringflag4MapType isEqualToString:@"Hybrid"]) { segmentedControl4MapType.selectedSegmentIndex = 2; } ``` and following call does not get invoked. strange. doesn't matter rotation works anyway. ``` - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { if (toInterfaceOrientation==UIInterfaceOrientationPortrait) { NSLog(@"to Portrait");// does not print out. SettingPortrait *settingportrait = [[SettingPortrait alloc] initWithNibName:@"SettingPortrait" bundle:[NSBundle mainBundle]]; self.view = settingportrait.view; [settingportrait release]; } if (toInterfaceOrientation==UIInterfaceOrientationPortraitUpsideDown) { NSLog(@"to PortraitUpsideDown"); SettingPortrait *settingportrait = [[SettingPortrait alloc] initWithNibName:@"SettingPortrait" bundle:[NSBundle mainBundle]]; self.view = settingportrait.view; [settingportrait release]; } ``` } ok now, as you can see from those snap shots there are two navigation bar and each has its bar button, Done and Item. The Done button came from Setting and the Item button from SettingPortrait or SettingLandscape. All button's selector is same, that leads back to map view. The button Done works fine, but the button Item crashes. I need a button on navigation bar after rotation that acts like back button . I guess once I did 'self.view = settingportrait.view;' the problem starts. You can download the whole code at [https://github.com/downloads/bicbac/rotation-test/rotate-1.zip](https://github.com/downloads/bicbac/rotation-test/rotate-1.zip)
iPhone rotating view in navigationViewController mode
CC BY-SA 2.5
0
2011-03-11T03:19:17.620
2011-05-09T07:13:32.643
2011-03-11T04:20:44.370
420,002
420,002
[ "iphone", "uinavigationcontroller", "rotation" ]
5,268,663
1
5,268,718
null
1
572
I want to get this bold part from this string: ``` some other code src='/pages/captcha?t=c&s=**51afb384edfc&h=513cc6f5349b**' `</td><td><input type=text name=captchaenter id=captchaenter size=3` ``` This is my regex that is not working: ``` Regex("src=\\'/pages/captcha\\?t=c&s=([\\d\\w&=]+)\\'", RegexOptions.IgnoreCase) ``` In tool for regex testing it's working. How can this be fixed? ![enter image description here](https://i.stack.imgur.com/3Q0cI.jpg)
searching a hash in a string with regex
CC BY-SA 2.5
null
2011-03-11T03:32:17.890
2011-03-11T04:20:24.143
2011-03-11T04:20:24.143
23,199
465,408
[ "c#", ".net", "regex" ]
5,268,730
1
5,268,795
null
0
4,600
I use CSS to make a unordered list `ul` to be displayed horizontally like this ``` <div id="header"> <ul> <li class="header-li">....</li> <li class="header-li" style="width: 200px; display: inline-block;"> ... </li> </ul> </div> ``` here is my css ``` #header { height: 30px; width: 985px; padding: 0px 10px 0px; vertical-align: middle; display: inline-block; font-size: 14px; overflow: hidden; } #header ul{ margin: 0; padding: 0; list-style-type: none; list-style-image: none; } .header-li{ display: inline; padding-right: 20px; } ``` `display:inline` is help display my list horizontally, this work on FF, Safari and Chrome but does not work on IE8. Help please here is some screen shot show the different between Firefox look and IE look ![FireFox, Chrome and Safari Look](https://i.stack.imgur.com/lEISI.png)![IE Look](https://i.stack.imgur.com/OnGmh.jpg)
CSS: display:inline does not seems to work on IE
CC BY-SA 2.5
0
2011-03-11T03:48:53.667
2011-03-11T04:00:02.817
null
null
240,337
[ "html", "css", "html-lists" ]
5,268,757
1
5,268,846
null
91
30,806
I need to quit Cocoa App when I click the red button on upper left. ![enter image description here](https://i.stack.imgur.com/hueHQ.png) I found [this](http://forums.macrumors.com/archive/index.php/t-105229.html) page saying > So what you need to do first is have the window you want to close be connected to an IBOutlet in the nib. For this example i connected the window to an outlet named "mainWindow". How can I do this? I found Windows in xib file, but how can I connect it to an IBOutlet in the nib? Or, is there any way to quit the cocoa app clicking red button? ## EDIT I should have put the code in the `automatically generated delegate file`.
How to quit cocoa app when windows close?
CC BY-SA 3.0
0
2011-03-11T03:52:38.527
2012-09-12T03:07:37.963
2012-09-12T03:07:37.963
456,434
260,127
[ "objective-c", "cocoa" ]
5,269,049
1
5,269,127
null
1
136
I often see something like the bottom picture in iphone apps and was wondering if there is a standard way to achieve that. To be clear, it is a view that covers half the screen, usually with buttons to choose different options. When I ask for standard way, I meant UITableView, UIAlertView, UIScrollView, etc... ![iphone screenshot](https://i.stack.imgur.com/1nfQP.png)
How do I present alternative options in an iPhone UI?
CC BY-SA 3.0
0
2011-03-11T04:46:59.153
2012-06-20T05:06:30.620
2012-06-20T05:06:30.620
3
384,964
[ "iphone", "uiview" ]
5,269,064
1
5,269,154
null
7
5,141
![enter image description here](https://i.stack.imgur.com/a8LX4.png) Based on the above coordinates in the above image, I'd like to be able to calculate which "square" as highlighted in red, the selected cell belongs to. I'm solving a sudoku puzzle, and I have access to the width of each square, as well as the row/column at which the cell are located. I'm having trouble calculating the "number" of the square that the cell belongs to (they start at 1, and increase from left-to-right, top-to-bottom), so that the numbers of the squares above are: 1|2 3|4 How could I go about calculating this? Any suggestions would be appreciated. Either a Java-specific method, or just an algorithm would be fine :)
Sudoku - Find Current Square Based on Row,Column
CC BY-SA 2.5
null
2011-03-11T04:49:50.577
2016-09-14T06:14:33.253
2011-03-11T04:58:14.357
139,010
654,750
[ "java", "sudoku" ]
5,269,116
1
5,269,355
null
10
7,200
I've created the main window in my application to have these settings: ``` [self setLevel:kCGDesktopWindowLevel + 1]; [self setCollectionBehavior: (NSWindowCollectionBehaviorCanJoinAllSpaces | NSWindowCollectionBehaviorStationary | NSWindowCollectionBehaviorIgnoresCycle)]; ``` It's a very custom window that sort of floats above the desktop. In addition, it's a menu-bar application (`LSUIElement`). Alright, so I need to display an alert if something isn't right. Here's how I'm doing it: ``` NSAlert *alert = [NSAlert alertWithMessageText:@"" defaultButton:@"" alternateButton:@"" otherButton:@"" informativeTextWithFormat:@""]; [alert runModal]; ``` Of course I have filled in the buttons and other text. Here's my problem: When my application is not currently the key application, and this alert pops up, it's not a key window. Like this: ![enter image description here](https://i.stack.imgur.com/xLvCK.jpg) See how the window isn't selected? Is there any way around this without changing my whole app window level? Thanks!
Make a NSAlert the topmost window?
CC BY-SA 2.5
0
2011-03-11T04:57:53.020
2018-08-06T13:51:41.580
null
null
456,851
[ "objective-c", "cocoa", "macos", "nsalert" ]
5,269,172
1
5,269,303
null
0
103
Hi I upgrded from django 0.96 to 1.2 and know no other difference between "before" and "after" html options won't display anymore. I know this info is coming a little short, but maybe you can know what happened? Before: ![enter image description here](https://i.stack.imgur.com/75UQY.png) After ![enter image description here](https://i.stack.imgur.com/oEwH5.png) Some code that seems exactly the same except that djagno dsipatcher was upgraded, is: ``` <div id="searchmain">{% include "form.html" %}</div> ``` And form.html ``` {% load i18n %} <form action="/li" id="cse-search-box"><div><input value='{{q}}' type="text" id="searchtext" name="q" size="31" /> <input type="hidden" value='{{t}}' name="t" /> {% include "../market/categories.html" %} {% ifequal logo "montao" %} <select name="l" id="search_area" class="search_area"><option value=''>{% trans "Entire" %}</option> <!-- <option id='heading2'>{% trans "name" %}</option> --> <option id='heading2'>São Paulo</option> <option id='heading2'>Rio de Janeiro</option> <option id='heading2'>Espírito Santo</option> <option id='heading2'>Minas Gerais</option> <option id='heading2'>Paraná</option> <option id='heading2'>Santa Catarina</option> <option id='heading2'>Rio Grande do Sul</option> <option id='heading2'>Bahia</option> <option id='heading2'>Pernambuco</option> <option id='heading2'>Ceará</option> <option id='heading2'>Rio Grande do Norte</option> <option id='heading2'>Amazonas</option> <option id='heading2'>Distrito Federal</option> <option id='heading2'>Pará</option> <option id='heading2'>Maranhão</option> <option id='heading2'>Goiás</option> <option id='heading2'>Paraíba</option> <option id='heading2'>Alagoas</option> <option id='heading2'>Piauí</option> <option id='heading2'>Mato Grosso</option> <option id='heading2'>Mato Grosso do Sul</option> <option id='heading2'>Sergipe</option> <option id='heading2'>Rondônia</option> <option id='heading2'>Tocantins</option> <option id='heading2'>Acre</option> <option id='heading2'>Amapá</option> <option id='heading2'>Roraima</option> </select> {% endifequal %} <!-- <input type="hidden" id="lat" name="lat" size="35" maxlength="50" value="{{plat}}" /> <input type="hidden" id="lon" name="lon" size="35" maxlength="50" value="{{plon}}" /> --> <input type="submit" id="searchbutton" value="{% trans "Go" %}" /> </div></form> ``` Updated to this and still same problem: ``` {% load i18n %} <form action="/li" id="cse-search-box"><div><input value='{{q}}' type="text" id="searchtext" name="q" size="31" /> <input type="hidden" value='{{t}}' name="t" /> {% include "../market/categories.html" %} {% ifequal logo "montao" %} <select name="l" id="search_area" class="search_area"><option value=''>{% trans "Entire" %}</option> <!-- <option >{% trans "name" %}</option> --> <option >São Paulo</option> <option >Rio de Janeiro</option> <option >Espírito Santo</option> <option >Minas Gerais</option> <option >Paraná</option> <option >Santa Catarina</option> <option >Rio Grande do Sul</option> <option >Bahia</option> <option >Pernambuco</option> <option >Ceará</option> <option >Rio Grande do Norte</option> <option >Amazonas</option> <option >Distrito Federal</option> <option >Pará</option> <option >Maranhão</option> <option >Goiás</option> <option >Paraíba</option> <option >Alagoas</option> <option >Piauí</option> <option >Mato Grosso</option> <option >Mato Grosso do Sul</option> <option >Sergipe</option> <option >Rondônia</option> <option >Tocantins</option> <option >Acre</option> <option >Amapá</option> <option >Roraima</option> </select> {% endifequal %} <!-- <input type="hidden" id="lat" name="lat" size="35" maxlength="50" value="{{plat}}" /> <input type="hidden" id="lon" name="lon" size="35" maxlength="50" value="{{plon}}" /> --> <input type="submit" id="searchbutton" value="{% trans "Go" %}" /> </div></form> ``` I'll try whatever you can propose! Thanks. BTW Here is the expected output that I could paste in with no dynamics: ``` <div id="searchmain"> <form action="/li" id="cse-search-box"><div><input value='' type="text" id="searchtext" name="q" size="31" /> <input type="hidden" value='' name="t" /> <select name="cg" id="cat" class="search_category"> <option value='' >All</option> <option value='' style='background-color:#dcdcc3' id='cat1' >-- VEHICLES --</option> <option value='2' id='cat2' >Cars</option> <option value='3' id='cat3' >Motorcycles</option> <option value='4' id='cat4' >Accessories &amp; Parts</option> <!--<option value='5' id='cat5' >Other vehicles</option>--> <option value='' style='background-color:#dcdcc3' id='cat6' >-- PROPERTIES --</option> <option value='7' id='cat7' >Apartments</option> <option value='8' id='cat8' >Houses</option> <option value='9' id='cat9' >Commercial properties</option> <option value='10' id='cat10' >Land</option> <option value='' style='background-color:#dcdcc3' id='cat11' >-- ELECTRONICS --</option> <option value='12' id='cat12' >Mobile phones &amp; Gadgets</option> <option value='13' id='cat13' >TV/Audio/Video/Cameras</option> <option value='14' id='cat14' >Computers</option> <option value='' style='background-color:#dcdcc3' id='cat15' >-- HOME &amp; PERSONAL ITEMS --</option> <option value='16' id='cat16' >Home &amp; Garden</option> <option value='17' id='cat17' >Clothes/Watches/Accessories</option> <option value='18' id='cat18' >For Children</option> <option value='' style='background-color:#dcdcc3' id='cat19' >-- LEISURE/SPORTS/HOBBIES --</option> <option value='20' id='cat20' >Sports &amp; Outdoors</option> <option value='21' id='cat21' >Hobby &amp; Collectables</option> <option value='22' id='cat22' >Music/Movies/Books</option> <option value='23' id='cat23' >Pets</option> <option value='' style='background-color:#dcdcc3' id='cat24' >-- BUSINESS TO BUSINESS --</option> <option value='25' id='cat25' >Professional/Office equipment</option> <option value='26' id='cat26' >Business for sale</option> <option value='' style='background-color:#dcdcc3' id='cat27' >-- JOBS &amp; SERVICES --</option> <option value='28' id='cat28' >Jobs</option> <option value='29' id='cat29' >Services</option> <option value='30' id='cat30' >Events &amp; Catering</option> <option value='' style='background-color:#dcdcc3' >--</option> <option value='31' id='cat31' >Others</option> </select> <!-- <input type="hidden" id="lat" name="lat" size="35" maxlength="50" value="" /> <input type="hidden" id="lon" name="lon" size="35" maxlength="50" value="" /> --> <input type="submit" id="searchbutton" value="Go" /> </div></form> </div> ```
How to recreate lost html options
CC BY-SA 2.5
null
2011-03-11T05:06:13.533
2011-03-11T05:49:16.243
2011-03-11T05:49:16.243
108,207
108,207
[ "html", "django", "google-app-engine" ]
5,269,260
1
5,269,315
null
2
880
I am using applet viewer for my Web Application. Before loading the applet viewer, is it possible to remove the java loading image. Please check the attachment. Thanks - Haan![I want to remove this image ](https://i.stack.imgur.com/9szmc.jpg)
Remove Java Loading image while loading Applet
CC BY-SA 2.5
0
2011-03-11T05:21:36.210
2011-03-11T05:30:14.120
2011-03-11T05:28:24.993
18,157
549,481
[ "java" ]
5,269,274
1
5,269,334
null
0
167
It's a normal .xml:![enter image description here](https://i.stack.imgur.com/hV12i.jpg) and it's a android .xml:![enter image description here](https://i.stack.imgur.com/xk39u.jpg) In normal .xml, eclipse adds a redundant highlight on my "color" tag. I don't like this, but can't find where the configure is.
Why does my Eclipse different highlight rules to .xml and android's .xml?
CC BY-SA 2.5
null
2011-03-11T05:23:41.563
2011-03-11T05:32:58.597
null
null
590,083
[ "android", "eclipse" ]
5,270,051
1
5,270,103
null
2
1,381
When i resample a jpg in order to draw border around the image, the quality of image is horribly decreases and extremely low quality jpeg is gotten. ![enter image description here](https://i.stack.imgur.com/SRCoS.png) Here is my code:
PHP image resampling issue
CC BY-SA 2.5
0
2011-03-11T07:15:43.487
2011-09-09T11:49:46.433
2011-09-09T11:49:46.433
213,269
562,417
[ "php", "gd" ]
5,270,089
1
5,270,713
null
5
21,454
I am interested in showing list of 12 months like in similar way to datepicker's month selection control. But i don't like to show the date picker to show the dates of that month too... only month view is ok so that i can select month from the list. my desired output: ![enter image description here](https://i.stack.imgur.com/Lt8N4.jpg)
How can i show month selection calendar in my app
CC BY-SA 2.5
null
2011-03-11T07:19:43.300
2014-06-27T15:58:22.027
2011-03-11T08:41:24.430
366,904
178,301
[ "vb.net", "winforms", "controls", "datepicker", "monthcalendar" ]
5,271,102
1
null
null
13
13,454
This my current layout: ``` <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/scrollview" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#F5F5DC" > <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <RadioGroup android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" > <RadioButton android:id="@+id/radio_red" android:layout_width="wrap_content" android:layout_height="wrap_content" android:drawableLeft="@drawable/flag_dk" android:textColor="#000000" android:layout_gravity="center_horizontal" android:drawablePadding="10dip" android:text="Danish" /> <RadioButton android:id="@+id/radio_blue" android:layout_width="wrap_content" android:layout_height="wrap_content" android:drawableLeft="@drawable/flag_en" android:layout_gravity="center_horizontal" android:layout_marginTop="5dip" android:drawablePadding="10dip" android:textColor="#000000" android:text="English" /> </RadioGroup> </LinearLayout> </ScrollView> ``` I get this: ![enter image description here](https://i.stack.imgur.com/1P2YD.png) I would like to have some space (margin) between radiobutton an the flag (it's drawable). Is it even possible?
How to add margin between radiobutton ant it's drawable?
CC BY-SA 2.5
0
2011-03-11T09:24:43.847
2016-05-17T14:42:16.133
2012-04-28T09:54:58.723
932,225
324,417
[ "android", "radio-button", "drawable", "margin" ]
5,271,443
1
17,587,987
null
2
4,516
Whenever anyone talks about branching and merging in Subversion, a standard diagram tends to get used: ![enter image description here](https://i.stack.imgur.com/n4IS9.jpg) Are there any Windows-based tools that will re-create a diagram similar to this that I can use to show the branches in my repository, and their merge/reintegration-merge histories? I had hoped to use the [TortoiseSVN revision graph](http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-revgraph.html) feature to do this, but even with log caching turned on this is very slow and it doesn't seem to show merges anyway, so is only half fit-for-purpose.
Visualising Subversion branching/merging history
CC BY-SA 2.5
0
2011-03-11T09:58:54.690
2013-07-11T13:24:23.003
2011-03-11T10:04:37.417
39,709
39,709
[ "svn", "tortoisesvn" ]
5,271,481
1
5,271,558
null
0
5,654
The image below (at the very bottom) is the file structure for the site I'm building, where I can't connect the CSS file properly. In directory Public/Admin/ there is a file login.php. From login.php, I use the following function call... to get the header for the login.php page. The function it calls in the (Includes/functions.php file) is this ``` function include_layout_template($template=""){ include(SITE_ROOT.DS.'public'.DS.'layouts'.DS.$template); } ``` which gets the admin_header.php file from the LAYOUT directory. I know the admin_header.php is loading properly into the login.php file using this function call because the html of the admin_header.php file is appearing when i load login.php. However, the admin_header.php file also has the link to the main.css file in the StyleSheets directory ``` <link href="../stylesheets/main.css" media="al" rel="stylesheet" type="text/css"/> ``` Although, as mentioned, admin_header.php is being incorporated into public/Admin/login.php, the stylesheet is not working. Looking at the directory structure below, is there something wrong with my link to the stylesheet? ![Picture of file structure](https://i.stack.imgur.com/9Ink8.png)
PHP CSS external file not working
CC BY-SA 2.5
null
2011-03-11T10:02:09.460
2020-06-10T13:49:14.033
null
null
577,455
[ "php", "css" ]
5,271,775
1
5,271,926
null
2
830
I have a .dll library for c# that loves to pop out a 'Welcome' screen when it starts. This screen appears as an application in the task manager. ![](https://i.stack.imgur.com/2pjzV.jpg) Is there some way to automatically detect this application/form being launched and close it? Thanks! :)
how to detect a new application being launched from C#?
CC BY-SA 2.5
null
2011-03-11T10:32:32.503
2011-03-11T10:46:46.180
null
null
651,418
[ "c#" ]
5,271,785
1
5,275,235
null
0
137
![screenshot of compilation errors](https://i.stack.imgur.com/9bsS4.png) When I attempt to use OpenFeint with cocos2d, I get compilation errors like those shown in the screenshot. How can I fix these errors?
How do I fix compilation errors when integrating OpenFeint with cocos2d?
CC BY-SA 2.5
null
2011-03-11T10:33:36.260
2011-03-11T17:35:19.487
2011-03-11T17:35:19.487
357,641
2,075,384
[ "iphone", "cocos2d-iphone" ]
5,271,788
1
5,272,689
null
0
3,969
i want to automate a user going into the "Find Records" / multi search UI and preset a filter in jqgrid to Specific field contains "abc" Second field does not equal "123" is this possible in jqgrid? i can set the toolbar filter by just adding item to the query string (Field1="test") so, in my asp.net-mvc controller action, i would do something like this: ``` string name = "Joe"; return Redirect("/Project?Owner=" + name); ``` but i now want to replicate the support for the advanced search so i can do - Multiple Fields- Different operator (equals, does not equal)i would like it to work so if the user did click on the Filter button that it would be prepopualated with these filter just like as if they would have done this initial filter manually like this: ![enter image description here](https://i.stack.imgur.com/QuOPE.png) I see [this question](https://stackoverflow.com/questions/2928371/how-to-filter-the-jqgrid-data-not-using-the-built-in-search-filter-box/2928819#2928819) but i want to be able to do this from the server side. Is there anyway to set postdata from the serverside of any asp.net mvc app??
in jqgrid, is there a way to programatically set multi search filter criteria (from the server side of an asp.net-mvc app)
CC BY-SA 2.5
null
2011-03-11T10:33:59.383
2011-03-11T12:06:31.320
2020-06-20T09:12:55.060
-1
4,653
[ "c#", "jquery", "asp.net-mvc", "jqgrid" ]
5,271,802
1
5,298,357
null
0
2,377
Im trying to integrate Linkedin network in my iphone app.I searched sample codes and i found one sample code in github [https://github.com/ResultsDirect/LinkedIn-iPhone](https://github.com/ResultsDirect/LinkedIn-iPhone) I downloaded the sample code and provided consumer and secret keys.It works good.When im trying to do this in my app,its not working.So many errors saying rdEngine.h--no such directory or file.But i imported linkedin library xcode to my app.How to import frameworks and liraries to my app?What i have to do to integrate linkedin in iphone?I want to update status of a linkedin of a user from iphone directly and i want to display the latest status of a linkedin in iphone .Please suggest me any possible ways to do this...Also tell me what are the steps i need to follow to do this.Thank you in advance.. ![enter image description here](https://i.stack.imgur.com/5YfdR.png) ![enter image description here](https://i.stack.imgur.com/MPqJi.png)
Linkedin Integration in iphone
CC BY-SA 2.5
0
2011-03-11T10:35:24.790
2013-03-29T06:35:46.897
2020-06-20T09:12:55.060
-1
525,206
[ "iphone", "ios4", "ios-simulator" ]
5,272,585
1
5,274,946
null
0
752
Working on N2 CMS I'm adding my own content type `Product`. I derive my Product class from `ContentPageBase` and I can add it in the content tree. When I edit an item however, the fields seem to be inverted (`Title` and `Text`). For all example items (e.g. `News`) `Title` always shows up at the top. `ContainerName``Title``Text``News` # Editing news item ![Editing news item](https://i.stack.imgur.com/ZaKji.png) # Editing product ![Editing product item](https://i.stack.imgur.com/oMa4c.png) # Product.cs (custom) ``` using N2; using N2.Web; using N2.Details; using N2.Integrity; namespace N2.Templates.Mvc.Models.Pages { /// <summary> /// This class represents the data transfer object that encapsulates /// the information used by the template. /// </summary> [PageDefinition("Product")] [WithEditableTitle, WithEditableName] [RestrictParents(typeof(ProductSection),typeof(ProductCategory))] public class Product : ContentPageBase { } } ``` # News.cs (default) ``` using System.Web.UI.WebControls; using N2.Definitions; using N2.Details; using N2.Integrity; using N2.Templates.Mvc.Services; using N2.Web.Mvc; using N2.Persistence; namespace N2.Templates.Mvc.Models.Pages { [PageDefinition("News", Description = "A news page.", SortOrder = 155, IconUrl = "~/Content/Img/newspaper.png")] [RestrictParents(typeof (NewsContainer))] public class News : ContentPageBase, ISyndicatable { public News() { Visible = false; Syndicate = true; } [EditableTextBox("Introduction", 90, ContainerName = Tabs.Content, TextMode = TextBoxMode.MultiLine, Rows = 4, Columns = 80)] public virtual string Introduction { get { return (string) (GetDetail("Introduction") ?? string.Empty); } set { SetDetail("Introduction", value, string.Empty); } } string ISyndicatable.Summary { get { return Introduction; } } [Persistable(PersistAs = PropertyPersistenceLocation.Detail)] public virtual bool Syndicate { get; set; } } } ```
Field placement when editing items in N2 cms?
CC BY-SA 2.5
null
2011-03-11T11:55:16.193
2011-03-11T15:36:44.860
null
null
45,311
[ "asp.net-mvc", "n2", "n2cms" ]
5,272,735
1
5,285,515
null
8
461
I have a method which returns a System.Action ``` private Action ExtractFile() { return delegate { MessageBox.Show("Test"); }; } ``` ReSharper, for some reason, tends to show me a correction that the return type of the method should be mapped to `System.Action<T>` or one of its variants. It seems that it won't recognize the non-generic version! VS complies and doesn't complain about this! When I mouse over the red curly line, the tooltip shown says > Incorrect number of type parameters. Candidates are: void System.Action(T) void System.Action(T1, T2) ... Any ideas?![See the return type highlighted by ReSharper](https://i.stack.imgur.com/7fVs4.png)
ReSharper always asks to change System.Action to System.Action<T>
CC BY-SA 2.5
null
2011-03-11T12:12:50.890
2011-03-14T17:14:07.877
2011-03-14T17:14:07.877
111,575
309,358
[ "c#", "resharper" ]
5,272,850
1
5,273,385
null
8
25,912
i see how in this code, you can preset postdata filters by have this in your javascript. ``` postData: { filters:'{"groupOp":"AND","rules":['+ '{"field":"invdate","op":"gt","data":"2007-09-06"},'+ '{"field":"invdate","op":"lt","data":"2007-10-04"},'+ '{"field":"name","op":"bw","data":"test"}]}' } ``` is there any API that allows you to build this up. Something like: ``` jqgrid("#grid").addPostDataFilters("AND"); jqgrid("#grid").addFilteritem("field", "cn", "value"); jqgrid("#grid").addFilteritem("field1", "eq", "value2"); ``` to help generate to top postdata filter code ?? i tried this but it doesn't seem to work: ``` .jqGrid("setGridParam", { editurl: "/Project/UpdateMe", ondblClickRow: function (rowid) { editProject(rowid); // window.location.href="/Project/Detail/"+rowid; } }); var grid = $("#grid"); var f = { groupOp: "AND", rules: [] }; f.rules.push({ field: "Name", op: "cn", data: "volat" }); grid.p.search = f.rules.length > 0; $.extend(grid.p.postData, { filters: JSON.stringify(f) }); ``` ## Update: I have this working now (thanks to Oleg) but ifor some reason the Find button somethng comes up with blank (even thought i do have an advanced filter set) i have added a picture ![enter image description here](https://i.stack.imgur.com/9yZ3s.png)
is there an api in jqgrid to add advanced filters to post data?
CC BY-SA 2.5
0
2011-03-11T12:25:24.527
2012-06-22T19:11:48.760
2011-03-11T23:40:41.017
315,935
4,653
[ "jquery", "jqgrid" ]
5,273,003
1
null
null
6
22,473
I am creating a custom button. I want to set the position of text on button. - ![enter image description here](https://i.stack.imgur.com/VMIBt.png) ![enter image description here](https://i.stack.imgur.com/sn0gb.png) - ![enter image description here](https://i.stack.imgur.com/nZ0LR.png) ![enter image description here](https://i.stack.imgur.com/nfCzU.png) But i am unable to set the exact position of the text on this background button image. Please share your suggestion to solve this issue.
Alignment of text on button
CC BY-SA 2.5
null
2011-03-11T12:41:46.057
2015-01-21T14:00:29.290
2011-03-11T12:55:54.807
457,982
534,709
[ "android", "button", "alignment" ]
5,272,974
1
null
null
0
306
I am a complete Fluent Newbie and while I have found a lot on the 'net about Many-to-many joins, I havent found much in my current scenario. Note: Ok, this may be rubbish design and I may be better off making seperate tables, insults about the design are appreciated :) I have a table like so: ![Database](https://i.stack.imgur.com/JkNYd.png) And classes such: ``` [Serializable] public class Transaction : Entity { [DomainSignatureAttribute] public virtual long TransactionId { get; protected internal set; } public virtual long AccountId { get; set; } protected internal virtual short TransactionTypeId { get; set; } protected internal virtual short TransactionStatusId { get; set; } public virtual DateTime DateCreated { get; set; } public virtual DateTime DateEffective { get; set; } public virtual Decimal Amount { get; set; } public virtual IList<TransactionLink> ChildTransactions { get; set; } public virtual IList<TransactionLink> ParentTransactions { get; set; } public Transaction() { ChildTransactions = new List<TransactionLink>(); ParentTransactions = new List<TransactionLink>(); } /// <summary> /// Use this to add a payment to a charge to pay it off, or to add a refund on a payment to un-pay it /// </summary> /// <param name="inTransaction"></param> /// <param name="inAmount"></param> public virtual void AddChildTransaction(Transaction inTransaction, Decimal inAmount) { TransactionLink link = new TransactionLink() { TransactionParent = this, TransactionChild = inTransaction, Amount = inAmount }; if (!ChildTransactions.Contains(link)) ChildTransactions.Add(link); if (!inTransaction.ParentTransactions.Contains(link)) inTransaction.ParentTransactions.Add(link); } /// <summary> /// You probably shouldnt be using this. /// </summary> /// <param name="inTransaction"></param> /// <param name="inAmount"></param> public virtual void AddParentTransaction(Transaction inTransaction, Decimal inAmount) { TransactionLink link = new TransactionLink() { TransactionChild = this, TransactionParent = inTransaction, Amount = inAmount }; if (!inTransaction.ChildTransactions.Contains(link)) inTransaction.ChildTransactions.Add(link); if (!ParentTransactions.Contains(link)) ParentTransactions.Add(link); } } ``` And ``` [Serializable] public class TransactionLink : Entity { public virtual Int64 TransactionIdParent { get; protected internal set; } public virtual Transaction TransactionParent { get; set; } public virtual Int64 TransactionIdChild { get; set; } public virtual Transaction TransactionChild { get; protected internal set; } public virtual DateTime LastModifiedOn { get; set; } public virtual Decimal Amount { get; set; } #region Override comparison - as this is a composite key we need to custom roll our comparison operators #endregion } ``` Maps: ``` public TransactionMap() { Id(x => x.TransactionId); Map(x => x.AccountId); Map(x => x.TransactionTypeId); Map(x => x.TransactionStatusId); Map(x => x.DateCreated); Map(x => x.DateEffective); Map(x => x.Amount); HasMany(x => x.ParentTransactions).Cascade.None().KeyColumn("TransactionIdParent").LazyLoad(); HasMany(x => x.ChildTransactions).Cascade.All().KeyColumn("TransactionIdChild").LazyLoad(); } ``` and ``` public TransactionLinkMap() { CompositeId() .KeyProperty(x => x.TransactionIdParent, "TransactionIdParent") .KeyProperty(x => x.TransactionIdChild, "TransactionIdChild"); References(x => x.TransactionParent).Column("TransactionIdParent").Cascade.SaveUpdate().LazyLoad(); References(x => x.TransactionChild).Column("TransactionIdChild").Cascade.All().LazyLoad(); Version(x => x.LastModifiedOn); Map(x => x.Amount); } ``` I am tweaking things around and getting all kinds of errors from nHibernate - someone please tell me what is the best way to go about this??
Issue with self-many to many join in Fluent NHibernate
CC BY-SA 2.5
null
2011-03-11T12:39:38.840
2011-03-11T14:20:13.777
null
null
315,335
[ "c#", "fluent-nhibernate" ]
5,273,196
1
5,273,234
null
0
796
i have created listview as follows... ``` lv = (ListView) findViewById(R.id.listview); lv.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_checked, mDisplay)); ``` my question is that i need to make the listview searchable such that if the user enters an alphabet the listview must scroll to that item starting with that alphabet (i dont want it to be filtered) with all the list items visible ... for example if the user press "f" i want the list to scroll to the 1st item with "f" as follows ![enter image description here](https://i.stack.imgur.com/Vzq5b.png) i DONT want it to be as follows: ![enter image description here](https://i.stack.imgur.com/LcVs9.png) i am sorry if the question is not understandable because i dont know how to put it ask me if u need more details... thanks :)
android searching the list view?
CC BY-SA 2.5
null
2011-03-11T13:00:52.057
2011-03-11T13:24:32.230
null
null
601,142
[ "java", "android", "listview", "filter", "adapter" ]
5,273,290
1
5,273,317
null
0
743
Hi All I wont to ask one more question !!! I search through internet and cant find answer on my question maybe somebody here can help me to find answer for my question. In my iPhone application i want settings bar and I want to insert in my settings "" when user change "" setting the iPhone screen brightness must be changed !!! Who can tell me how can I do this !!! ![enter image description here](https://i.stack.imgur.com/brcaB.png)
How to change brightness of iphone from application
CC BY-SA 2.5
null
2011-03-11T13:10:18.097
2012-01-29T12:49:20.507
2012-01-29T12:49:20.507
508,666
612,606
[ "iphone", "screen", "light" ]
5,273,337
1
5,273,814
null
0
7,517
We can parse this test XML file with this XSL file fine: Test XML: ``` <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="newrows.xsl" type="text/xsl"?> <Workbook> <Worksheet> <Table> <Row> <Cell></Cell> <Cell>(info...)</Cell> <Cell></Cell> </Row> <Row> <Cell>first name</Cell> <Cell>last name</Cell> <Cell>age</Cell> </Row> <Row> <Cell>Jim</Cell> <Cell>Smith</Cell> <Cell>34</Cell> </Row> <Row> <Cell>Roy</Cell> <Cell>Rogers</Cell> <Cell>22</Cell> </Row> <Row> <Cell>(info...)</Cell> <Cell></Cell> <Cell>(info...)</Cell> </Row> <Row> <Cell>Sally</Cell> <Cell>Cloud</Cell> <Cell>26</Cell> </Row> <Row> <Cell>John</Cell> <Cell>Randall</Cell> <Cell>44</Cell> </Row> </Table> </Worksheet> </Workbook> ``` XSL: ``` <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" indent="yes"/> <xsl:param name="range-1-begin" select="1"/> <xsl:param name="range-1-end" select="3"/> <xsl:param name="range-2-begin" select="5"/> <xsl:param name="range-2-end" select="6"/> <xsl:template match="Table"> <test> <xsl:for-each select="Row"> <xsl:if test="(position() &gt;= $range-1-begin and position() &lt;= $range-1-end) or (position() &gt;= $range-2-begin and position() &lt;= $range-2-end)"> <Row> <xsl:for-each select="Cell"> <xsl:if test="position() = 1 or position() = 3"> <Cell> <xsl:value-of select="."/> </Cell> </xsl:if> </xsl:for-each> </Row> </xsl:if> </xsl:for-each> </test> </xsl:template> </xsl:stylesheet> ``` However, when we try to parse , it exports the . We can even type in `kksljflskdjf` instead of `Table` and it outputs the content of every XML element. Excel XML (exceprts): ``` <?xml version="1.0"?> <?xml-stylesheet href="blackbox.xsl" type="text/xsl"?> <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40"> <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"> <Author>MM</Author> <LastAuthor>xx</LastAuthor> ... <Worksheet ss:Name="OFFSET Individual"> <Names> <NamedRange ss:Name="_FilterDatabase" ss:RefersTo="='OFFSET Individual'!R3C2:R3C12" ss:Hidden="1"/> <NamedRange ss:Name="Print_Area" ss:RefersTo="='OFFSET Individual'!R4C2:R435C15"/> <NamedRange ss:Name="Muster" ss:RefersTo="='OFFSET Individual'!C1:C9"/> <NamedRange ss:Name="PAP" ss:RefersTo="='OFFSET Individual'!C2"/> </Names> <Table ss:ExpandedColumnCount="31" ss:ExpandedRowCount="443" x:FullColumns="1" x:FullRows="1" ss:StyleID="s90" ss:DefaultColumnWidth="59" ss:DefaultRowHeight="15"> <Column ss:StyleID="s416" ss:Hidden="1" ss:AutoFitWidth="0" ss:Width="61"/> <Column ss:StyleID="s91" ss:AutoFitWidth="0" ss:Width="287"/> <Column ss:StyleID="s547" ss:AutoFitWidth="0" ss:Width="216"/> <Column ss:StyleID="s91" ss:AutoFitWidth="0" ss:Width="87"/> <Column ss:StyleID="s92" ss:AutoFitWidth="0" ss:Width="202"/> <Column ss:StyleID="s90" ss:AutoFitWidth="0" ss:Width="87"/> <Column ss:StyleID="s101" ss:AutoFitWidth="0" ss:Width="284"/> <Column ss:StyleID="s132" ss:Hidden="1" ss:AutoFitWidth="0" ss:Width="52"/> <Column ss:StyleID="s137" ss:Hidden="1" ss:AutoFitWidth="0" ss:Width="47"/> <Column ss:StyleID="s90" ss:Hidden="1" ss:AutoFitWidth="0" ss:Width="42"/> <Column ss:StyleID="s90" ss:Hidden="1" ss:AutoFitWidth="0" ss:Width="39"/> <Column ss:StyleID="s90" ss:Hidden="1" ss:AutoFitWidth="0" ss:Width="37"/> <Column ss:StyleID="s113" ss:AutoFitWidth="0" ss:Width="47"/> <Column ss:StyleID="s87" ss:Hidden="1" ss:AutoFitWidth="0" ss:Width="275"/> <Column ss:StyleID="s458" ss:AutoFitWidth="0" ss:Width="89"/> <Column ss:StyleID="s179" ss:AutoFitWidth="0" ss:Span="1"/> <Column ss:Index="18" ss:StyleID="s168" ss:Hidden="1" ss:AutoFitWidth="0"/> <Column ss:StyleID="s90" ss:Hidden="1" ss:AutoFitWidth="0"/> <Column ss:StyleID="s377" ss:AutoFitWidth="0" ss:Width="202" ss:Span="2"/> <Column ss:Index="23" ss:StyleID="s377" ss:AutoFitWidth="0" ss:Width="203"/> <Row ss:AutoFitHeight="0" ss:Height="23"> <Cell ss:Index="2" ss:StyleID="s142"> <Data ss:Type="String">Paper Overview</Data> <NamedCell ss:Name="PAP"/> <NamedCell ss:Name="Muster"/> </Cell> </Row> <Row ss:AutoFitHeight="0"> <Cell ss:Index="2" ss:StyleID="s141"> <Data ss:Type="String">Stand: 10.03.2011; 13:00 Uhr</Data> <NamedCell ss:Name="PAP"/> <NamedCell ss:Name="Muster"/> </Cell> </Row> ... ``` Here is an example of the resulting "XML" file: ![enter image description here](https://i.stack.imgur.com/UpIuS.png) # Addendum This is the full solution which now works, thanks @Dimitre! ``` <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:y="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40" exclude-result-prefixes="y o x ss html" > <xsl:strip-space elements="*"/> <xsl:output method="xml" indent="yes"/> <xsl:param name="range-1-begin" select="1"/> <xsl:param name="range-1-end" select="3"/> <xsl:param name="range-2-begin" select="5"/> <xsl:param name="range-2-end" select="6"/> <xsl:template match="text()"/> <xsl:template match="y:Table"> <test> <xsl:for-each select="y:Row"> <xsl:if test="(position() &gt;= $range-1-begin and position() &lt;= $range-1-end) or (position() &gt;= $range-2-begin and position() &lt;= $range-2-end)"> <Row> <xsl:for-each select="y:Cell"> <xsl:if test="position() = 1 or position() = 3"> <Cell> <xsl:value-of select="."/> </Cell> </xsl:if> </xsl:for-each> </Row> </xsl:if> </xsl:for-each> </test> </xsl:template> </xsl:stylesheet> ```
How can I parse this Excel XML export file with this XSLT file?
CC BY-SA 2.5
null
2011-03-11T13:16:16.833
2011-03-11T15:13:01.293
2011-03-11T15:13:01.293
4,639
4,639
[ "xml", "excel", "xslt" ]
5,273,620
1
5,273,702
null
2
700
Here's teh codez: ``` <!DOCTYPE html> <html> <head> <title>Test</title> <style type="text/css"> html, body { margin: 0px; padding: 0px; } #pageContainer { min-width: 100%; float: left; background-color: red; } #leftColumn { float: left; background-color: lime; } #rightColumn { position: relative; } </style> </head> <body> <div id="pageContainer"> <div id="leftColumn">Left column</div> <div id="rightColumn">Right column</div> </div> </body> </html> ``` On IE8/Opera/FF everything looks fine. If I take IE8 and turn on IE7 mode (standards compliant), suddenly a horizontal scrollbar appears. Suspiciously it is just as big as the left column. Any ideas?! ![Example](https://i.stack.imgur.com/Qj34O.png)
Weird layout behavior in IE7 (scrollbar appearing where it shouldn't)
CC BY-SA 2.5
null
2011-03-11T13:39:56.003
2011-03-11T13:48:03.447
2011-03-11T13:47:19.170
41,360
41,360
[ "html", "css", "internet-explorer-7" ]
5,273,667
1
5,273,694
null
1
2,858
Is there anybody who knows, what is for, and how it works, the "Call Hierarchy" window in Visual Studio (2010)? ![enter image description here](https://i.stack.imgur.com/dEkm5.jpg) ![enter image description here](https://i.stack.imgur.com/cPmpG.jpg)
View Call Hierarchy in Visual Studio
CC BY-SA 2.5
0
2011-03-11T13:45:14.880
2019-08-09T11:14:31.593
2011-03-11T14:06:35.643
185,593
185,593
[ "visual-studio", "visual-studio-2010" ]
5,273,659
1
5,276,500
null
1
903
I want to use a ContentTemplate property with my window. First I tried it with standard Window class: ``` <Window.ContentTemplate> <DataTemplate> <DockPanel LastChildFill="true"> <TextBlock DockPanel.Dock="Top">Hello world</TextBlock> <ContentPresenter Content="{Binding}" /> </DockPanel> </DataTemplate> </Window.ContentTemplate> <Button>TestButton</Button> ``` This works the way I want: ![enter image description here](https://i.stack.imgur.com/59k4t.jpg) Now try to do the same thing with DXWindow (I'm using DevExpress 10.2.4 version): ``` <dx:DXWindow.ContentTemplate> <DataTemplate> <DockPanel LastChildFill="true"> <TextBlock DockPanel.Dock="Top">Hello world</TextBlock> <ContentPresenter Content="{Binding}" /> </DockPanel> </DataTemplate> </dx:DXWindow.ContentTemplate> <Button>TestButton</Button> ``` But this does not work, looks like this property is ignored ![enter image description here](https://i.stack.imgur.com/BE2xs.png) Is it possible to fix this behavior? Thank you.
ContentTemplate does not work with DXWindow?
CC BY-SA 2.5
null
2011-03-11T13:44:16.903
2011-03-11T17:50:37.187
null
null
581,730
[ "wpf", "devexpress" ]
5,273,676
1
5,500,730
null
5
4,240
I am having some problems with Internet Explorer. I have a `Window` with one `Fieldset` containing a few `Components` - all ExtJS elements. The window is resizable and I the scrollbars to appear when the user resizes the window to a size smaller than the size required to show its contents. This works fine in FireFox 3.6.x, but when using IE7 or IE8 I get the following result: ![Corrupted layout in Internet Explorer](https://i.stack.imgur.com/U1FZL.jpg) The code used to generate the above result is: ``` <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Online example</title> <link rel="stylesheet" type="text/css" href="http://dev.sencha.com/deploy/dev/resources/css/ext-all.css" /> <script type="text/javascript" src="http://dev.sencha.com/deploy/dev/adapter/ext/ext-base.js"></script> <script type="text/javascript" src="http://dev.sencha.com/deploy/dev/ext-all.js"></script> </head> <body> <script type="text/javascript"> Ext.onReady(function(){ MyWindow = Ext.extend(Ext.Window, { resizable: true, closable: true, width: 400, closeAction: 'hide', title: 'Window', autoScroll: true, layout: 'fit', initComponent: function () { var config = { items: [ { xtype: 'fieldset', title: 'Fieldset', layout: 'form', items: [ { xtype: 'numberfield', fieldLabel: 'Label' }, { xtype: 'checkbox', fieldLabel: 'Label', checked: true }, { xtype: 'checkbox', fieldLabel: 'Label', checked: true }, { xtype: 'checkbox', fieldLabel: 'Label', checked: true } ] } ] } Ext.apply(this, config); // Config object has already been applied to 'this' so properties can // be overriden here or new properties (e.g. items, tools, buttons) // can be added, eg: // Call parent (required) MyWindow.superclass.initComponent.apply(this, arguments); } }); AWindow = new MyWindow(); AWindow.show(); }); </script> </body> </html> ``` I know that this question is very similar to a [previous question](https://stackoverflow.com/questions/4923435/extjs-ie7-rendering-problems-with-simple-window) of mine, but I hope this time I'm more clear in what I am asking for. - And it relates to both IE7 and IE8.
ExtJS & Internet Explorer: Layout corruption with scrollbars
CC BY-SA 2.5
0
2011-03-11T13:45:51.733
2011-03-31T13:35:45.997
2017-05-23T10:32:36.133
-1
62,361
[ "javascript", "internet-explorer", "layout", "extjs", "corruption" ]
5,273,732
1
5,278,160
null
1
826
So lets say my calculation is this ``` Let ( [ $result[1] ="1"; $result[2] ="!"; $result[3] = "3"; $result[4] = "4"; $result[5] = "5"; $result[6] = "6"; $result[7] = "7"; $result[8] = "8"; $result[9] = "-"; $result[10] = "10"; $result[11] = "11"; $result[12] = "12"; $result[13] = "13"; $result[14] = "14"; $result[15] = "15"; $result[16] = "!"; ]; $result[1] & $result[2] & $result[3] & $result[4] & $result[5] & $result[6] & $result[7] & $result[8] & $result[9] & $result[10] & $result[11] & $result[12] & $result[13] & $result[14] & $result[15] & $result[16] ) ``` this is pretty straight forward I make and array and then I want to it to return the array as a string is there and easier way to concatenate the the values of the result array ? ** Sample custom functions *** trying to use @chuck 's code not sure what I'm doing wrong I could figure out how to upload a file so here are some mimages ![enter image description here](https://i.stack.imgur.com/DslYI.png) ![enter image description here](https://i.stack.imgur.com/sBpnW.png) ![enter image description here](https://i.stack.imgur.com/2AaF4.png)
filemaker implode array
CC BY-SA 2.5
null
2011-03-11T13:50:36.893
2011-03-14T01:44:45.677
2011-03-14T01:44:45.677
234,670
234,670
[ "filemaker" ]
5,273,782
1
5,274,043
null
0
3,229
I am creating custom UITableViewCell before starting to create it i read many articles about it and I start to create my own CustomTableViewCell. In my custom TableViewCell I have 4 filds: 1. UILabel* cellTitle 2. UILabel* cellDateTime 3. UIView* cellMainImage 4. UIImageView* arraow image Here is how is my TableViewCell appear: ![enter image description here](https://i.stack.imgur.com/HLAjI.png) And here is the code: of CustomTableViewCell.h ``` #import <UIKit/UIKit.h> #define TAGS_TITLE_SIZE 20.0f #define TITLE_LABEL_TAG 1 #define DATA_TIME_LABEL_TAG 5 #define ARROW_IMAGE_TAG 6 #define MAIN_IMAGE_TAG 7 // Enumeration for initiakization TableView Cells typedef enum { NONE_TABLE_CELL = 0, NEWS_FEED_TABLE_CELL = 1, TAGS_TABLE_CELL = 2 }TableTypeEnumeration; // Class for Custom Table View Cell. @interface CustomTableViewCell : UITableViewCell { // Title of the cell. UILabel* cellTitle; UILabel* cellDataTime; UIView* cellMainImage; UIImageView* cellArrowImage; } // Set the title of the cell. - (void) SetCellTitle: (NSString*) _cellTitle; - (void) SetCellDateTime: (NSString*) _cellDataTime; - (void) ReleaseCellMainImage; - (void) InitCellTitleLable; - (void) InitCellDateTimeLabel; - (void) InitCellMainImage; // Init With Style (With additional parametr TableTypeEnumeration) - (id)initWithStyle: (UITableViewCellStyle)style reuseIdentifier: (NSString *)reuseIdentifier tableType:(TableTypeEnumeration)tabletypeEnum; @end ``` And here is the code of: CustomTableViewCell.m ``` #import "CustomTableViewCell.h" @implementation CustomTableViewCell - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { return [self initWithStyle:style reuseIdentifier:reuseIdentifier tableType:NONE_TABLE_CELL]; } - (id)initWithStyle: (UITableViewCellStyle)style reuseIdentifier: (NSString *)reuseIdentifier tableType:(TableTypeEnumeration)tabletypeEnum { // Get Self. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { // Switch table View Cells switch(tabletypeEnum) { case NEWS_FEED_TABLE_CELL: { // Create Cell Title Text cellTitle = [[UILabel alloc] initWithFrame:CGRectMake(75.0f, 2.5f, 180.0f, 33.0f)]; cellTitle.tag = TITLE_LABEL_TAG; cellTitle.font = [UIFont boldSystemFontOfSize: 13.0f]; cellTitle.lineBreakMode = UILineBreakModeWordWrap; cellTitle.numberOfLines = 0; cellTitle.textAlignment = UITextAlignmentLeft; cellTitle.textColor = [UIColor blackColor]; [self.contentView addSubview:cellTitle]; [cellTitle release]; // Create Cell Description Text. cellDataTime = [[UILabel alloc] initWithFrame:CGRectMake(135.0f, 38.0f, 100.0f, 15.0f)]; cellDataTime.tag = DATA_TIME_LABEL_TAG; cellDataTime.font = [UIFont italicSystemFontOfSize: 12.0f]; cellDataTime.textAlignment = UITextAlignmentLeft; cellDataTime.textColor = [UIColor blackColor]; cellDataTime.lineBreakMode = UILineBreakModeWordWrap; [self.contentView addSubview:cellDataTime]; [cellDataTime release]; // Create Cell Arrow Image. cellArrowImage = [[UIImageView alloc] initWithFrame:CGRectMake(260.0f, 7.0f, 40.0f, 49.0f)]; cellArrowImage.tag = ARROW_IMAGE_TAG; cellArrowImage.backgroundColor = [UIColor whiteColor]; cellArrowImage.image = [UIImage imageNamed:@"Grey Arrow.png"];; [self.contentView addSubview:cellArrowImage]; [cellArrowImage release]; // Create Cell Main Image. cellMainImage = [[[UIView alloc] initWithFrame:CGRectMake(2.0f, 2.5f, 55.0f, 50.0f)] autorelease]; cellMainImage.tag = MAIN_IMAGE_TAG; [self.contentView addSubview:cellMainImage]; break; } case TAGS_TABLE_CELL: { // Create and initialize Title of Custom Cell. cellTitle = [[UILabel alloc] initWithFrame:CGRectMake(10, (44 - TAGS_TITLE_SIZE)/2, 260, 21)]; cellTitle.backgroundColor = [UIColor clearColor]; cellTitle.opaque = NO; cellTitle.textColor = [UIColor blackColor]; cellTitle.highlightedTextColor = [UIColor whiteColor]; cellTitle.font = [UIFont boldSystemFontOfSize:TAGS_TITLE_SIZE]; cellTitle.textAlignment = UITextAlignmentLeft; [self.contentView addSubview:cellTitle]; [cellTitle release]; break; } default: break; } } return self; } - (void) ReleaseCellMainImage { [cellMainImage release]; } - (void) InitCellTitleLable { cellTitle = (UILabel *)[self.contentView viewWithTag:TITLE_LABEL_TAG]; } - (void) InitCellDateTimeLabel { cellDataTime = (UILabel *)[self.contentView viewWithTag:DATA_TIME_LABEL_TAG]; } - (void) InitCellMainImage { //UIView* oldImage = [self.contentView viewWithTag:MAIN_IMAGE_TAG]; //[oldImage removeFromSuperview]; } - (void) SetCellTitle: (NSString*) _cellTitle { cellTitle.text = _cellTitle; } - (void) SetCellDateTime: (NSString*) _cellDataTime { cellDataTime.text = _cellDataTime; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; } - (void)dealloc { // Call base delloc [super dealloc]; } @end ``` Now when I use my CustomTableViewCell in the code of the program the memory of my iphone always go up !!! Every time when I open tableView the memory grows for 2mb and when I open and close tableView for 10times it become more then 30mb !!! Whot can I do ??? How I can get the event when user for example press on my image in custom cell ???
Custom tableViewCell example with images and lables
CC BY-SA 2.5
0
2011-03-11T13:55:05.597
2011-03-11T14:19:54.517
null
null
612,606
[ "iphone", "image", "label", "cell" ]
5,274,089
1
5,311,111
null
7
9,397
I am trying to display an Android activity with: - - - - The layout I have written fulfills these criteria, except that the dialog always fills the full screen (see vertical screenshot at the bottom). This is my layout: ``` <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content"> <TextView android:id="@+id/header" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:layout_marginTop="10dp" android:layout_marginBottom="10dp" android:gravity="center_vertical" android:textSize="18dip" android:textColor="#ffffff" android:text="Sample Layout" /> <LinearLayout android:id="@+id/controls" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" style="@android:style/ButtonBar"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="Yes" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="No" /> </LinearLayout> <ScrollView android:id="@+id/test" android:layout_below="@id/header" android:layout_above="@id/controls" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="5dp" android:layout_marginLeft="5dp" android:layout_marginRight="5dp"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer dui odio, convallis vitae suscipit eu, tincidunt non mi. Vestibulum faucibus pretium purus vel adipiscing. Morbi mattis molestie risus vitae vehicula. [...]" /> </ScrollView> </RelativeLayout> ``` In addition, the activity is styled with `@android:style/Theme.Dialog` and `android:windowNoTitle`. I'm not sure I understand why this layout expands to fill the whole screen. None of the views have a layout height set to `fill_parent`; the parent layout isn't set to `fill_parent` either. Does anyone know if what I want to do is possible, and if yes how to do it? ## My current layout in horizontal mode ![Layout in horizontal mode.](https://i.stack.imgur.com/FC0iS.jpg) ## My current layout in vertical mode ![Layout in vertical mode.](https://i.stack.imgur.com/PLD21.jpg)
Android bottom button bar & scroll view with dialog theme
CC BY-SA 2.5
0
2011-03-11T14:24:23.150
2011-03-15T11:34:48.707
null
null
249,893
[ "android", "dialog", "scrollview", "buttonbar" ]
5,274,126
1
null
null
1
2,418
I am getting the follow error when I try to connect to a Oracle system DSN through Crystal Reports. I can connect fine from the ODBC. I also read online that this could be because the path variable is not set to the oracle bin directory.. but I checked and it is in fact there. Any ideas? ![enter image description here](https://i.stack.imgur.com/tNGXb.png)
Cannot connect to oracle system DSN with crystal reports
CC BY-SA 2.5
null
2011-03-11T14:27:26.220
2011-07-02T21:16:00.107
null
null
327,575
[ "oracle", "crystal-reports", "odbc" ]
5,275,294
1
5,275,318
null
8
8,546
I have started a website with a redbackground and i want a little bit of white at the top. i have this code: CSS: ``` body { background-color: #ff4d4d; } #header { background-color: #ffffff; height: 20px; } ``` HTML: ``` <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Fat Oblongs</title> <link href="css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" /> </head> <body> <div id="header"></div> </body> </html> ``` Which produces: ![](https://i.stack.imgur.com/qIpe0.png)
Css div wont go to the top or all the way to the sides
CC BY-SA 2.5
null
2011-03-11T16:03:41.050
2016-09-24T05:04:26.077
null
null
383,691
[ "html", "css" ]
5,275,367
1
null
null
5
5,204
I have to create library that render static, simple shapes with some 3d effects such as rotation and bevels. Shapes can contains text or image on it. Something similar to this: ![enter image description here](https://i.stack.imgur.com/9XlkK.png) I think that with GDI+ it will be hard to implement so is there any CLS compliant library that will help me with rendering? P.S. I can not use WPF.
Very simple 2d and 3d graphics library
CC BY-SA 2.5
0
2011-03-11T16:09:51.413
2011-03-21T10:44:02.323
2011-03-14T14:00:39.823
238,123
238,123
[ "c#", ".net", "graphics", "3d" ]
5,275,619
1
5,276,363
null
3
1,713
I'm playing around with drawing my own custom controls using the uxTheme library in Windows, and I can't work out why my control doesn't look like the regular Windows control that (supposedly) uses the same theme I'm using: ![A Windows ComboBox and my control that uses the ComboBox theme](https://i.stack.imgur.com/plrTn.png) The above image shows a standard Windows ComboBox (top) and my custom control drawn using the ComboBox theme (bottom). What I can't work out is why the border from my control is a different shape and colour to the standard control. In my class constructor I open the theme data: ``` mComboTheme = OpenThemeData( hwnd, L"COMBOBOX" ); ``` And then in the handler for WM_PAINT I'm just drawing two parts of the ComboBox components: ``` case WM_PAINT: { PAINTSTRUCT ps; HDC hdc; RECT client; if( GetUpdateRect( hwnd, &ps.rcPaint, false )) { hdc = BeginPaint( hwnd, &ps ); GetClientRect( hwnd, &client ); if( IsThemeBackgroundPartiallyTransparent( mComboTheme, CP_BACKGROUND, CBXS_HOT )) { DrawThemeParentBackground( hwnd, hdc, &ps.rcPaint ); } DrawThemeBackground( mComboTheme, hdc, CP_BACKGROUND, CBXS_HOT, &client, &ps.rcPaint ); client.left = client.right - 20; DrawThemeBackground( mComboTheme, hdc, CP_DROPDOWNBUTTONRIGHT, CBXSR_HOT, &client, ps.rcPaint ); EndPaint( *this, &ps ); } break; } ``` Any suggestions as to why these two controls don't look the same would be greatly appreciated. Thanks, James
Problem with drawing custom Windows controls
CC BY-SA 2.5
0
2011-03-11T16:34:32.167
2011-03-11T17:37:59.170
2011-03-11T16:36:33.593
21,234
null
[ "windows", "winapi", "themes", "custom-controls", "gdi" ]
5,275,729
1
null
null
3
2,739
I have a UserControl that can be dragged around my form. I get a first chance exception when the control is accidentally dragged away from my form and into the desktop (as an example): ``` A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in System.Windows.Forms.dll Additional information: Invalid FORMATETC structure (Exception from HRESULT: 0x80040064 (DV_E_FORMATETC)) ``` When I start the drag/drop process, I pass in an object of type Control. It is not Serializable nor do I want it to be. Is there a way I can work around this or is there handling for dragging an object outside the host form? Callstack: ``` > System.Windows.Forms.dll!System.Windows.Forms.DataObject.GetDataIntoOleStructs(ref System.Runtime.InteropServices.ComTypes.FORMATETC formatetc, ref System.Runtime.InteropServices.ComTypes.STGMEDIUM medium) + 0x175 bytes System.Windows.Forms.dll!System.Windows.Forms.DataObject.System.Runtime.InteropServices.ComTypes.IDataObject.GetDataHere(ref System.Runtime.InteropServices.ComTypes.FORMATETC formatetc, ref System.Runtime.InteropServices.ComTypes.STGMEDIUM medium) + 0x70 bytes System.Windows.Forms.dll!System.Windows.Forms.DataObject.System.Runtime.InteropServices.ComTypes.IDataObject.GetData(ref System.Runtime.InteropServices.ComTypes.FORMATETC formatetc, out System.Runtime.InteropServices.ComTypes.STGMEDIUM medium) + 0x152 bytes [Native to Managed Transition] ``` Here is another stack, but VS2010 hung so I couldn't copy and paste it. ![Screenshot](https://i.stack.imgur.com/nSymG.png)
C# DoDragDrop on Non-Serializable object
CC BY-SA 2.5
0
2011-03-11T16:43:19.417
2011-03-11T18:40:38.783
2011-03-11T18:40:38.783
318,811
318,811
[ "c#", "winforms", "exception", "drag-and-drop" ]
5,275,924
1
5,275,959
null
52
50,558
I generally use Subclipse, but there's some wonkiness in my code right now and I want to do some sanity checks from the command line. Thanks to Subclipse, I can usually see the branches I'm using in Eclipse's Package Explorer window. ![screenshot of branch information in Eclipse](https://i.stack.imgur.com/AXfEd.png) Resources I tried before Stack Overflow include [the SVN book](http://svnbook.red-bean.com/en/1.5/svn.branchmerge.whatis.html), [this list of commands](https://www.forge.funambol.org/scdocs/ddUsingSVN_command-line) and [this other list of commands](http://www.yolinux.com/TUTORIALS/Subversion.html). I didn't find anything that would let me passively look at branch information (as opposed to making some sort of active branch modification, which is not what I want).
What SVN command can I use to see the branch I'm currently using?
CC BY-SA 2.5
0
2011-03-11T17:00:47.747
2020-02-18T16:03:47.620
null
null
122,607
[ "svn" ]
5,276,237
1
5,276,515
null
2
2,561
I'm trying to replicate a dotplot of batches/cases/treatments with lines crossing the factors in ggplot. That is something like this plot from Douglas Bates' linear models course which shows 6 groups on the y axis with a continuous response on the x axis with the mean for each group joined by a line: ![Dotplot from Bates](https://i.stack.imgur.com/dfEwp.png) Using the sleepstudy dataset bundled with the lme4 package as an example, I have: ``` library(ggplot2) p <- ggplot(sleepstudy, aes(x=Reaction, y=reorder(Subject, Reaction))) p <- p + geom_point() print(p) ``` Which gives the basic dotplot, with subjects on the y axis in order of increasing reaction time. I then create a data frame with mean reaction times for each subject: ``` mean_rxn <- function(df) mean(df$Reaction, na.rm=T) sleepsummary <- ddply(sleepstudy, .(Subject), mean_rxn) ``` I am able to plot points at the mean for each subject: ``` p.points <- p + geom_point(data=sleepsummary, aes(x=V1, y=reorder(Subject, V1), size=10)) print(p.points) ``` But I can't get lines to cross the factors. That is, changing from geom_point to geom_line displays nothing ``` # does nothing p.line <- p + geom_line(data=sleepsummary, aes(x=V1, y=reorder(Subject, V1))) print(p.line) ``` Anyone have any ideas? Ultimately, my goal is to plot some model results on top of the raw data in this fashion, so methods that calculate means "on the fly" in the plotting of the original data frame are less useful because I need to get my data points from a more complex model fit. Thanks for any help! Ryan
Add line crossing factors in dotplot (ggplot)
CC BY-SA 2.5
0
2011-03-11T17:28:03.507
2023-01-15T14:26:12.883
2023-01-15T14:26:12.883
66,526
66,526
[ "r", "ggplot2" ]
5,276,416
1
5,276,662
null
0
310
I have a css display issue with jquery ui tabs, where after you go over a certain number of tabs, the last tab drops down to the next line, as if the tab before it was set to clear:right. i cant figure out what css is causing this. [the issue can be seen here](http://baystatehomesforsale.com/pages/contact) edit: i should mention that i see this issue in FF and Chrome. havent tried in IE yet also here is a screenshot of what i see: ![blarg](https://i.stack.imgur.com/Tfu7O.png) this seems to depend on resolution. it happens to me in 1280x1024 and smaller
jquery ui tabs display issue
CC BY-SA 2.5
null
2011-03-11T17:42:07.313
2011-03-11T18:07:02.670
2011-03-11T18:07:02.670
26,188
26,188
[ "css" ]
5,276,433
1
5,343,421
null
5
1,014
I'm trying to create a view that is backed by a Core Animation layer. However, when I enable the layer, my labels start to look slightly jagged. I've attached a demonstration of difference: ![Excluding Core Animation Layer](https://i.stack.imgur.com/FvqoR.png) ![Including Core Animation Layer](https://i.stack.imgur.com/KZbcb.png) I know it is subtle, but it is driving me crazy (especially for smaller fonts). Any way I can get the Core Animation layer labels to be anti-aliased?
Core Animation and Anti Aliased Fonts on the Mac
CC BY-SA 2.5
0
2011-03-11T17:43:26.387
2013-10-15T10:08:30.550
2011-03-17T14:17:13.003
259,900
259,900
[ "cocoa", "xcode", "macos", "interface-builder", "core-animation" ]
5,276,538
1
5,293,306
null
2
1,066
Check out the following pic. This happens when you expand a folder in Mac OS X from its shortcut on the dock. I'd like to do something very similar in SL. And in case it's difficult to understand - the dock is on the right, with the folder-speech-bubble expanding up & out to the left. The folder contents would be icons out of frame in the upper-left. ![Mac OS X dock folder expansion](https://i.stack.imgur.com/AiTIT.png) The best I've come up with is including a xaml Path that makes up the "leader" portion of the bubble and placing it directly over the border of a canvas. It looks like the following. ![Silverlight speech bubble](https://i.stack.imgur.com/9L07Z.png) The Path, being a separate element, doesn't "integrate" well with the Grid and causes two issues. If you look closely you'll see that there is a slight transparency and the Grid's border is subtly bleeding through. Something else that will crop up, if I use a border thickness > 1, is the line-end caps between the Path border and the Grid border won't be connected, they'll simply overlap looking chunky and unpolished. What I need is a solution that allows me to slide the leader up & down the speech bubble (depending upon its context) and adapts to the issues explained above. I'd be happy with ideas, examples, and down right full implementations.
How to implement a speech bubble custom border in SL with a movable leader
CC BY-SA 2.5
0
2011-03-11T17:55:10.547
2012-01-26T15:46:03.567
null
null
1,886
[ "silverlight", "layout", "custom-controls" ]
5,276,701
1
5,299,244
null
7
3,130
I want to implement a rather complex CurveEditor that has to support the usual requirements like: - - - - - ![sample illustration of the CurveEditorComponent](https://i.stack.imgur.com/qwsF1.png) I don't want to manipulate actual WPF curves but an existing model with key/value/tangents sets and sample the precise shape of the curve from our implementation. I already gathered some experience on implementing custom UserControls and Templates. But I want to make sure, I don't miss any apparent solution. I planned to have this general XAML-tree: - - - - - - - - - - - - - - - - I know, this is quite a complex question and I am not asking for an actual implementation. I am interested in the following questions: 1. Can you recommend any tutorials or books that might help me (I already got Illustrated WPF, WPF Control Development Unleashed, and a couple of other) 2. Should minor elements like the Tangents be individual UserControls? 3. What container is best suited for hosting the individual "Curves", "EditPoints" and "Tangents". Right now, I use Canvas and Canvas.SetLeft/SetTop to position the children, but that feels "strange". 4. Should I use "Shapes" like Path or DrawingVisual-Classes to implement actual representation. Path is straight forward, but I am concerned about performance with hundreds of CurvePoints. 5. Should I use Transforms to rotate the tangents or is just fine to do some triangulation math in the code behind files? 6. Does the structure roughly make sense, or do you suggest a completely different approach?
Strategy for implementing a complex curve editor with XAML/WPF
CC BY-SA 2.5
0
2011-03-11T18:12:07.863
2011-07-27T17:52:48.490
2011-03-11T18:24:56.467
452,274
406,602
[ "wpf", "user-interface", "xaml", "architecture", "user-controls" ]
5,277,761
1
5,278,826
null
2
3,784
For some reason, I'm only able to pass strings containing numbers to my web service when using jquery ajax. This hasn't been an issue so far because I was always just passing IDs to my wcf service. But I'm trying to do something more complex now but I can't figure it out. In my interface: ``` [OperationContract] [WebInvoke(ResponseFormat = WebMessageFormat.Json)] DataTableOutput GetDataTableOutput(string json); ``` My webservice: ``` public DataTableOutput GetDataTableOutput(string json) { DataTableOutput x = new DataTableOutput(); x.iTotalDisplayRecords = 9; x.iTotalRecords = 50; x.sColumns = "1"; x.sEcho = "1"; x.aaData = null; return x; } ``` Javascript/Jquery: ``` var x = "1"; $.ajax({ type: "POST", async: false, url: "Services/Service1.svc/GetDataTableOutput", contentType: "application/json; charset=utf-8", data: x, dataType: "json", success: function (msg) { }, error: function (XMLHttpRequest, textStatus, errorThrown) { //alert(XMLHttpRequest.status); //alert(XMLHttpRequest.responseText); } }); ``` The above code WORKS perfectly. But when I change x to "t" or even to "{'test':'test'}" I get a Error 400 Bad Request error in Firebug. Thanks, John EDIT: Making some progress! data: JSON.stringify("{'test':'test'}"), Sends the string to my function! EDIT2: ``` var jsonAOData = JSON.stringify(aoData); $.ajax({ type: "POST", async: false, url: sSource, contentType: "application/json; charset=utf-8", data: "{'Input':" + jsonAOData + "}", dataType: "json", success: function (msg) { }, error: function (XMLHttpRequest, textStatus, errorThrown) { //alert(XMLHttpRequest.status); //alert(XMLHttpRequest.responseText); } }); ``` ![enter image description here](https://i.stack.imgur.com/LLjUT.jpg) EDIT3: I modified the code block I put in EDIT2 up above. Swapping the " and ' did the trick! ``` $.ajax({ type: "POST", async: false, url: sSource, contentType: "application/json; charset=utf-8", data: '{"Input":' + jsonAOData + '}', dataType: "json", success: function (msg) { }, error: function (XMLHttpRequest, textStatus, errorThrown) { //alert(XMLHttpRequest.status); //alert(XMLHttpRequest.responseText); } }); ``` However, I have a new problem: ``` public DataTableOutput GetDataTableOutput(DataTableInputOverview Input) { ``` The input here is completely null. The values I passed from jsonAOData didn't get assigned to the DataTableInputOverview Input variable. :(
Sending string to wcf service using jquery ajax. why can i only send strings of numbers?
CC BY-SA 2.5
null
2011-03-11T20:05:01.867
2013-05-17T08:47:51.907
2011-03-11T23:44:36.683
387,285
387,285
[ "javascript", "jquery", "ajax", "web-services", "wcf" ]
5,278,016
1
5,304,268
null
-2
3,856
HI I am using Matlab . How can I find internal contours in a binary image. Can anybody tell me a simple way or provide me code example. This is related to my assignment. Thank you!! ![enter image description here](https://i.stack.imgur.com/bOCZv.jpg)
Matlab Find Internal Contours in a binary Image?
CC BY-SA 2.5
0
2011-03-11T20:34:39.510
2011-03-14T20:44:14.127
2011-03-11T20:46:44.720
14,946
528,459
[ "algorithm", "matlab" ]
5,277,935
1
5,277,983
null
4
3,702
Even after a very high score of Google PageSpeed() & Yahoo! YSlow() the PHP generated thumbnails don't seem to be coming passively from an old cache: they seem to be generated every time again...and again... freshly baked consuming lots of waisted time. This question will focus only & specifically on that generates the thumbs: Just have a look at these tiny puny little thumbnails measuring only 3 ~ 5 kb each! > Waterfall in detail: [http://www.webpagetest.org/result/110328_AM_8T00/1/details/](http://www.webpagetest.org/result/110328_AM_8T00/1/details/) Any & all suggestons are +1 help to me and warmly welcome, for I have grown quite desperate on this issue for the last months. Thanx a Thousand! Using or not Modrewrite does not influence speed: both are same. I use these rewrite conditions: `RewriteCond %{REQUEST_URI} ^/IMG-.*$` & `RewriteCond %{REQUEST_FILENAME} !-f` Both the [original default URL](http://aster.nu/imgcpu?src=aster_pfl/ad_swimming_pool_glassdeco.jpg&w=187&h=187&c=p) as well as the [beautified rewritten URL](http://aster.nu/IMG-aster_pfl/ad_swimming_pool_glassdeco_w187_h187_cp.jpg) produce the same delays!! So let us not point the fault to the lightning fast Apache: ![enter image description here](https://i.stack.imgur.com/ZJ7Qp.png) --- Warning by webpagetest.org: FAILED - (No max-age or expires): [http://aster.nu/imgcpu?src=aster_bg/124.jpg&w=1400&h=100&c=p](http://aster.nu/imgcpu?src=aster_bg/124.jpg&w=1400&h=100&c=p) --- After each refresh, you will see either of these [two warnings appear on random at REDbot.org](http://redbot.org/?uri=http://aster.nu/imgcpu?src=aster_bg/124.jpg&w=1400&h=100&c=p%20) ![enter image description here](https://i.stack.imgur.com/J7sua.png) ![enter image description here](https://i.stack.imgur.com/0kDOd.png) --- # Relevant Portions of The Code: ``` // Script is directly called if(isset($_GET['src']) && (isset($_GET['w']) || isset($_GET['h']) || isset($_GET['m']) || isset($_GET['f']) || isset($_GET['q']))){ $ImageProcessor = new ImageProcessor(true); $ImageProcessor->Load($_GET['src'], true); $ImageProcessor->EnableCache("/var/www/vhosts/blabla.org/httpdocs/tmp/", 345600); $ImageProcessor->Parse($quality); } /* Images processing class * - create image thumbnails on the fly * - Can be used with direct url imgcpu.php?src= * - Cache images for efficiency */ class ImageProcessor { private $_image_path; # Origninal image path protected $_image_name; # Image name string private $_image_type; # Image type int protected $_mime; # Image mime type string private $_direct_call = false; # Is it a direct url call? boolean private $_image_resource; # Image resource var Resource private $_cache_folder; # Cache folder strig private $_cache_ttl; # Cache time to live int private $_cache = false; # Cache on boolean private $_cache_skip = false; # Cache skip var boolean private function cleanUrl($image){ # Cleanup url $cimage = str_replace("\\", "/", $image); return $cimage; } /** Get image resource * @access private, @param string $image, @param string $extension, @return resource */ private function GetImageResource($image, $extension){ switch($extension){ case "jpg": @ini_set('gd.jpeg_ignore_warning', 1); $resource = imagecreatefromjpeg($image); break; } return $resource; } /* Save image to cache folder * @access private, @return void */ private function cacheImage($name, $content){ # Write content file $path = $this->_cache_folder . $name; $fh = fopen($path, 'w') or die("can't open file"); fwrite($fh, $content); fclose($fh); # Delete expired images foreach (glob($this->_cache_folder . "*") as $filename) { if(filemtime($filename) < (time() - $this->_cache_ttl)){ unlink( $filename ); } } } /* Get an image from cache * @access public, @param string $name, @return void */ private function cachedImage($name){ $file = $this->_cache_folder . $name; $fh = fopen($file, 'r'); $content = fread($fh, filesize($file)); fclose($fh); return $content; } /* Get name of the cache file * @access private, @return string */ private function generateCacheName(){ $get = implode("-", $_GET); return md5($this->_resize_mode . $this->_image_path . $this->_old_width . $this->_old_height . $this->_new_width . $this->_new_height . $get) . "." . $this->_extension; } /* Check if a cache file is expired * @access private, @return bool */ private function cacheExpired(){ $path = $this->_cache_folder . $this->generateCacheName(); if(file_exists($path)){ $filetime = filemtime($path); return $filetime < (time() - $this->_cache_ttl); }else{ return true; } } /* Lazy load the image resource needed for the caching to work * @return void */ private function lazyLoad(){ if(empty($this->_image_resource)){ if($this->_cache && !$this->cacheExpired()){ $this->_cache_skip = true; return; } $resource = $this->GetImageResource($this->_image_path, $this->_extension); $this->_image_resource = $resource; } } /* Constructor * @access public, @param bool $direct_call, @return void */ public function __construct($direct_call=false){ # Check if GD extension is loaded if (!extension_loaded('gd') && !extension_loaded('gd2')) { $this->showError("GD is not loaded"); } $this->_direct_call = $direct_call; } /* Resize * @param int $width, @param int $height, @param define $mode * @param bool $auto_orientation houd rekening met orientatie wanneer er een resize gebeurt */ public function Resize($width=100, $height=100, $mode=RESIZE_STRETCH, $auto_orientation=false){ // Validate resize mode $valid_modes = array("f", "p"); } // .... omitted ..... // Set news size vars because these are used for the // cache name generation // .... omitted ..... $this->_old_width = $width; $this->_old_height = $height; // Lazy load for the directurl cache to work $this->lazyLoad(); if($this->_cache_skip) return true; // Create canvas for the new image $new_image = imagecreatetruecolor($width, $height); imagecopyresampled($new_image, $this->_image_resource, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); // .... omitted ..... $this->_image_resource = $new_image; } /* Create image resource from path or url * @access public, @param string $location, @param bool $lazy_load, @return */ public function Load($image,$lazy_load=false){ // Cleanup image url $image = $this->cleanUrl($image); // Check if it is a valid image if(isset($mimes[$extension]) && ((!strstr($image, "http://") && file_exists($image)) || strstr($image, "http://")) ){ // Urlencode if http if(strstr($image, "http://")){ $image = str_replace(array('http%3A%2F%2F', '%2F'), array('http://', '/'), urlencode($image)); } $image = str_replace("+", "%20", $image); $this->_extension = $extension; $this->_mime = $mimes[$extension]; $this->_image_path = $image; $parts = explode("/", $image); $this->_image_name = str_replace("." . $this->_extension, "", end($parts)); // Get image size list($width, $height, $type) = getimagesize($image); $this->_old_width = $width; $this->_old_height = $height; $this->_image_type = $type; }else{ $this->showError("Wrong image type or file does not exists."); } if(!$lazy_load){ $resource = $this->GetImageResource($image, $extension); $this->_image_resource = $resource; } } /* Save image to computer * @access public, @param string $destination, @return void */ public function Save($destination, $quality=60){ if($this->_extension == "png" || $this->_extension == "gif"){ imagesavealpha($this->_image_resource, true); } switch ($this->_extension) { case "jpg": imagejpeg($this->_image_resource,$destination, $quality); break; case "gif": imagegif($this->_image_resource,$destination); break; default: $this->showError('Failed to save image!'); break; } } /* Print image to screen * @access public, @return void */ public function Parse($quality=60){ $name = $this->generateCacheName(); $content = ""; if(!$this->_cache || ($this->_cache && $this->cacheExpired())){ ob_start(); header ("Content-type: " . $this->_mime); if($this->_extension == "png" || $this->_extension == "gif"){ imagesavealpha($this->_image_resource, true); } switch ($this->_extension) { case "jpg": imagejpeg($this->_image_resource, "", $quality); break; case "gif": imagegif($this->_image_resource); break; default: $this->showError('Failed to save image!'); break; } $content = ob_get_contents(); ob_end_clean(); }else{ if (isset ($_SERVER['HTTP_IF_MODIFIED_SINCE'])) { if (strtotime ($_SERVER['HTTP_IF_MODIFIED_SINCE']) < strtotime('now')) { header ('HTTP/1.1 304 Not Modified'); die (); } } // change the modified headers $gmdate_expires = gmdate ('D, d M Y H:i:s', strtotime ('now +10 days')) . ' GMT'; $gmdate_modified = gmdate ('D, d M Y H:i:s') . ' GMT'; header ("Content-type: " . $this->_mime); header ('Accept-Ranges: bytes'); header ('Last-Modified: ' . $gmdate_modified); header ('Cache-Control: max-age=864000, must-revalidate'); header ('Expires: ' . $gmdate_expires); echo $this->cachedImage($name); exit(); } // Save image content if(!empty($content) && $this->_cache){ $this->cacheImage($name, $content); } // Destroy image $this->Destroy(); echo $content; exit(); } /* Destroy resources * @access public, @return void */ public function Destroy(){ imagedestroy($this->_image_resource); } /* Get image resources * @access public, @return resource */ public function GetResource(){ return $this->_image_resource; } /* Set image resources * @access public, @param resource $image, @return resource */ public function SetResource($image){ $this->_image_resource = $image; } /* Enable caching * @access public, @param string $folder, @param int $ttl, * @return void */ public function EnableCache($folder="/var/www/vhosts/blabla.org/httpdocs/tmp/", $ttl=345600){ if(!is_dir($folder)){ $this->showError("Directory '" . $folder . "' does'nt exist"); }else{ $this->_cache = true; $this->_cache_folder = $folder; $this->_cache_ttl = $ttl; } return false; } } ``` > The original author granted me permission for placing parts of code in here for solving this issue. ---
PHP Thumbnail Image Generator Caching: How to set If-Last-Modified/Max-Age/Last-Modified HEADERS correctly in PHP?
CC BY-SA 3.0
0
2011-03-11T20:25:24.510
2012-12-22T04:06:45.263
2012-12-22T04:06:45.263
367,456
509,670
[ "php", ".htaccess", "caching", "image-processing" ]
5,278,458
1
5,278,485
null
3
970
I have an AJAX heavy website. There's hundreds of buttons that momentarily put up an animated loading GIF when the server is processing a request. ![ajax loading animated gif](https://i.stack.imgur.com/5W1cE.gif) I noticed that my site is sluggish after using it for several minutes. The animated GIFs play at lower framerate. They sometimes even stop animating. Hover effects on buttons have a noticeable lag. Is it possible that these hundred animated GIFs are still locking up the CPU even while they're hidden (`style="display: none"`)? At most, only a few GIFs are visible at any point in time.
Do hidden animated GIFs still use the CPU?
CC BY-SA 2.5
null
2011-03-11T21:15:03.800
2011-03-11T21:23:45.663
null
null
459,987
[ "dom", "browser", "cpu", "animated-gif" ]
5,278,658
1
5,278,872
null
2
7,979
I'm having trouble in doing a javascript that will do the following: Increase/decrease number inside textbox when image clicked. setting a limit for that textbox (not below zero, not above x) please know i have many text boxes in the same page, so how can this issue be fixed? ![Image for illustration](https://i.stack.imgur.com/Qm4YZ.jpg)
Increase/decrease textfield value with javascript
CC BY-SA 2.5
null
2011-03-11T21:37:21.413
2011-03-11T22:05:22.527
2011-03-11T21:42:42.283
546,661
341,405
[ "javascript", "image", "textfield" ]
5,278,693
1
5,279,146
null
1
262
I want to know if it is possible to create another column in a table that has data that I wish to populate in this new column? The new column is Flag2. Here is the table: ![enter image description here](https://i.stack.imgur.com/r3X7j.png) what I want to do is, where item id is 30, I want the ITEM ID to only display 30 once and, populate the QC Unsupportted in Flag2? How do I do this? I can only think of doing an inner join but this is not working. This is what I have done in trying to do so: ``` SELECT A.ITEMID, A.FLAG1, A.FLAG2 FROM #FLAGS as A INNER JOIN #FLAGS as B ON A.ITEMID = B.ITEMID GROUP BY a.ITEMID, a.FLAG1, A.FLAG2 ORDER BY ITEMID ```
SQL Column Populating
CC BY-SA 2.5
null
2011-03-11T21:41:08.383
2011-03-14T13:55:55.267
2011-03-11T21:42:17.980
13,302
2,012,590
[ "sql-server-2008-r2" ]
5,278,829
1
null
null
7
27,459
I'm having trouble getting some basic JNDI configuration going in Glassfish. I have what I think ought to be a simple task: at run time, determine if a particular property is set to true or not. I think this is a good application of JNDI, but can't seem to get the path correct between the app server and my servlet code. Here's how I have configured the property in Glassfish: ![enter image description here](https://i.stack.imgur.com/mMnhQ.png) In my servlet code, I'm trying to look up the value with: ``` Boolean enabled = (Boolean) ctx.lookup("java:global/arizona/quartz_enabled"); ``` In addition to this path, I've also tried the following without success: - - - My app is named "arizona", but deployed to the root context, if that matters. I'm sure it's just a simple matter of figuring out the proper namespace to reach the property, but I feel like I'm just shooting in the dark trying to find it. Is there a simple way to browse the JNDI tree in Glassfish?
JNDI configuration/lookup in Glassfish
CC BY-SA 2.5
0
2011-03-11T21:56:59.170
2016-01-28T13:00:57.203
null
null
93,995
[ "jakarta-ee", "jndi" ]
5,279,307
1
5,279,848
null
1
672
This is a weird bug that I can't figure out because I have tested it on my PC in IE7 and IE8 on XP and it's working just fine. But the main navigation is broken in XP on this site: [http://tupelomainstreet.com/play](http://tupelomainstreet.com/play) I've attached screenshots of my client's screen and environment. If anyone has any black magic for IE, that would be amazing. I'm at a loss. ![client's screen](https://i.stack.imgur.com/mees3.png) ![client's environment](https://i.stack.imgur.com/wCOgU.png)
Suckerfish dropdown not working in IE 8
CC BY-SA 2.5
null
2011-03-11T23:02:58.113
2011-03-12T00:25:13.623
null
null
168,286
[ "css", "internet-explorer", "drop-down-menu", "suckerfish" ]
5,279,481
1
5,279,543
null
3
7,449
I am creating an Entity Data Model for a document. I want to store the body of the document as a BLOB--document bodies will be larger than the varbinary max. As I understand things, what I need to do is create a property of type `Image` to store the document body. Here's my problem: The types listed in the Properties pane do not include an `Image` type: ![enter image description here](https://i.stack.imgur.com/1bNrV.png) Does EF4 recognize an `Image` type? If so, how do I create an entity property of type `Image`? Thanks for your help.
Entity Framework 4: Image type?
CC BY-SA 2.5
0
2011-03-11T23:24:54.087
2011-03-11T23:36:09.153
null
null
93,781
[ "entity-framework-4" ]
5,279,498
1
5,280,070
null
2
298
I have a view that is bound to an object called "Requisition" On this view we are only modifying is child records. My question is: How do I save just the new changes? Should I take the requisitionForm (incomplete) and merge it with requisition (complete) ? thanks! ![enter image description here](https://i.stack.imgur.com/2XHbJ.png)
How MVC Update Model works with incomplete objects?
CC BY-SA 2.5
null
2011-03-11T23:27:24.850
2011-03-12T01:02:17.380
null
null
87,302
[ "asp.net-mvc", "asp.net-mvc-2" ]
5,279,889
1
null
null
0
1,013
Below is a document tree of the folders on my website. In my html form the action attribute holds this value: delete_post.php. When I changed the action to /do/delete_post/index.php it wouldn't work. How could I change this: do/delete_post/index.php or something else to make it work? ![](https://i.stack.imgur.com/M4tgX.png) The index.php file is shown below: ``` <?php session_start(); if (!isset($_SESSION['user']) || empty($_POST['id'])) { header( "Location: /" ); die(); } require_once( dirname(__FILE__) . '/includes/db.php') $stmt2 = $db->prepare('DELETE FROM posts WHERE id = ?'); if (!$stmt2->execute(array($_POST['id']))) { print_r($stmt2->errorInfo()); die(); } header( "Location: /" ); ?> ``` When I make an ajax request using jquery in php with the following page the index.php fails to delete the post.
I moved my PHP file to a subfolder and it's not working anymore
CC BY-SA 2.5
null
2011-03-12T00:32:13.817
2011-03-12T01:08:22.893
2011-03-12T01:08:22.893
552,067
552,067
[ "php", "jquery", "ajax", "action", "subdirectory" ]
5,279,947
1
5,279,977
null
1
2,076
I'm very confused about this error message, I'm completely unaware of any missing controllers yet this is the error it's spitting out ![enter image description here](https://i.stack.imgur.com/nmAAk.jpg) There's a little more that's cut off but I really hope that helps, this is a really frustrating error.
Rake db:migrate missing :controller
CC BY-SA 2.5
null
2011-03-12T00:42:55.667
2011-03-12T00:46:50.813
null
null
185,292
[ "mysql", "debugging", "ruby-on-rails-3", "migration", "rake" ]
5,280,061
1
5,280,111
null
0
777
I'm usung now Eclipse to develop a Java application. My problem is when I pass from interface I1 to interface I2. I want to hide I1 and show I2 when I click a button in I2. I tried to use this instruction in NetBeans: ``` I2 interface = new I2(); this.setVisible(false); interface.setVisible(true); ``` But trying this in Eclipse ann error occur, Eclipse ask me to create a mrthod 'setVisible' .. Now I use eclipse ... ![enter image description here](https://i.stack.imgur.com/P15JS.png) Why ?? and what can I do?? Thanks in advance. Best regards, Ali
this.Visible() won't work on Ecipse contrary Netbeans
CC BY-SA 2.5
0
2011-03-12T01:00:18.487
2012-05-08T21:37:50.953
2012-05-08T21:37:50.953
610,351
604,156
[ "eclipse", "netbeans", "this", "visibility" ]
5,280,371
1
5,308,224
null
1
1,887
I'm doing an inadvisable thing here, and I know it, but I have a webview nested in a horizontalscrollview. (I needed more scrolling control than webview provides.) The layout looks like this: ``` <?xml version="1.0" encoding="utf-8"?> <HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/webRel" android:layout_below="@+id/titlebar" android:layout_width="fill_parent" android:layout_height="fill_parent" > <WebView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/webZ" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </HorizontalScrollView> ``` And the results are as follows: ![My webview.](https://i.stack.imgur.com/viQCD.png) The webview isn't filling up the horizontalscrollview. The horizontalscrollview is filing the view, so I guess I could say the webview isn't filling the view even though I have both set to fill_parent. I would really, really like it if someone would help me figure out how to have the webview fill up the horizontalscrollview widthwise... because then I measure the height and use that measurement to paginate the text (which is then displayed in chunks widthwise which is why I chose horizontalscrollview.) :D (Alternatively, suggestions for a cleaner way to have smooth horizontal scrolling in a webview would also be helpful.)
Contents stretching to fill HorizontalScrollView
CC BY-SA 2.5
null
2011-03-12T03:35:41.573
2011-03-15T06:25:38.203
null
null
597,849
[ "android", "webview", "horizontalscrollview" ]
5,280,415
1
5,280,453
null
0
316
With the top-feature-faq and the mid-feature-faq there is excessive width between the 2 divs. Here is the CSS for that: In this example the top-feature-faq has position:relative ``` #top-feature-faq { height:330px; width: 800px; margin: 12px 0 0 17px; background: red; position: relative; overflow:hidden; text-align: left; } #mid-feature-faq { margin:350px 0 0 17px; width:800px; height:318px; background-color:Olive; position:relative; overflow:hidden; clear: both; } <div id="top-feature-faq"> <div style="clear: both;"> </div> </div> <<div id="mid-feature-faq"> <div style="clear: both;"> </div> </div> ``` ![enter image description here](https://i.stack.imgur.com/R5U4Q.gif)
CSS Horizontal Space Issue between 2 Divs
CC BY-SA 4.0
null
2011-03-12T03:47:32.553
2018-09-23T18:49:19.260
2018-09-23T18:49:19.260
1,033,581
598,931
[ "css" ]
5,280,428
1
5,364,604
null
1
5,171
I have User and Album models with HABTM relationship ``` class Album < ActiveRecord::Base has_and_belongs_to_many :users class User < ActiveRecord::Base has_and_belongs_to_many(:albums) ``` I'd like to find all the albums that are stored in the database but not associated with a particular user. So far my code is like this: `Album.all(:order => "albums.created_at DESC", :include => "users", :limit => limit, :conditions => ["users.id != ? AND users.id IS NOT NULL", current_user.id])` but for some reason this is not working. It's returning albums that are associated with current_user. here take a look at this ouptput from the console. Check the users id i first fetch. Then i fetch albums which should not have the users id I then find one of the listed albums and ask it to return the associated users one of those associated users is the one from above and shouldnt be there. ![enter image description here](https://i.stack.imgur.com/87PHy.png) Can anyone help with the above?
Rails HABTM query where condition is based on association attribute
CC BY-SA 2.5
0
2011-03-12T03:52:06.917
2011-03-19T20:10:45.787
2011-03-14T08:59:53.990
189,090
189,090
[ "ruby-on-rails", "activerecord", "has-and-belongs-to-many" ]
5,280,479
1
5,280,682
null
27
37,729
I am writing GPS coordinates to my JPEG image, and the coordinates are correct (as demonstrated by my logcat output) but it appears that it's being corrupted somehow. Reading the exif data results in either null values or, in the case of my GPS: `512.976698 degrees, 512.976698 degrees`. Can anyone shed some light on this problem? writing it: ``` try { ExifInterface exif = new ExifInterface(filename); exif.setAttribute(ExifInterface.TAG_GPS_LATITUDE, latitude); exif.setAttribute(ExifInterface.TAG_GPS_LONGITUDE, longitude); exif.saveAttributes(); Log.e("LATITUDE: ", latitude); Log.e("LONGITUDE: ", longitude); } catch (IOException e) { e.printStackTrace(); } ``` and reading it: ``` try { ExifInterface exif = new ExifInterface("/sdcard/globetrotter/mytags/"+ TAGS[position]); Log.e("LATITUDE EXTRACTED", exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE)); Log.e("LONGITUDE EXTRACTED", exif.getAttribute(ExifInterface.TAG_GPS_LONGITUDE)); } catch (IOException e) { e.printStackTrace(); } ``` It goes in (for example) `37.715183`, `-117.260489` and comes out `33619970/65540, 14811136/3368550`, `33619970/65540, 14811136/3368550`. Am I doing it wrong? EDIT: So, the problem is I am not encoding it in the properly defined format, which is something like you see here: ![enter image description here](https://i.stack.imgur.com/Vxnkn.png) Can anyone explain what this format is? Obviously the first number is 22/1 = 22 degrees, but I can't figure out how to compute the decimal there.
How to save GPS coordinates in exif data on Android?
CC BY-SA 2.5
0
2011-03-12T04:04:14.530
2022-06-28T17:19:07.473
2011-03-12T04:56:04.227
387,064
387,064
[ "android", "gps", "exif", "geotagging" ]
5,280,557
1
null
null
0
361
I'm creating an app that shows a list of items one by one on the screen. Each item will have a name and phone number, and will be displayed in a view called `person view`. My project is similar to the iPod music player view: ![enter image description here](https://i.stack.imgur.com/SnSNt.jpg) However, instead of showing the album image, I want to show my `person view`. Could someone explain me how to achieve the navigation when the user hits `|<<` or `>>|`? Also, how can I build a similar view? Any code snippet/blueprint would be quite helpful. Thanks!
How to create a view similar to iPod player?
CC BY-SA 2.5
null
2011-03-12T04:26:32.800
2011-03-12T14:31:03.273
2011-03-12T05:57:16.843
456,851
488,156
[ "iphone", "objective-c", "cocoa-touch", "ios" ]
5,280,650
1
null
null
0
7,768
I have attached a diagram I got it from here only...My question is: How do I convert that to a table form and how do I add relationships between tables according to the diagram? Any samples will be a great help! ![ER-Model](https://i.stack.imgur.com/MUug2.png)
How do I create tables and relations using an ER-diagram?
CC BY-SA 2.5
null
2011-03-12T04:55:06.333
2013-11-02T21:26:32.647
2011-03-13T17:29:34.543
368,003
604,941
[ "mysql", "database", "database-design" ]
5,281,174
1
null
null
1
548
I want to implement a candlestick graph using core-plot. I have a little problem with yAxis. I'd like to display the yAxix on the right like this examples: ![example 1](https://i.stack.imgur.com/gWec0.gif) [http://www.schaefferresearch.com/images/schaeffersu/tutorials/charts/candlestick.gif](http://www.schaefferresearch.com/images/schaeffersu/tutorials/charts/candlestick.gif) ![example 2](https://i.stack.imgur.com/qYHDG.gif) [http://www.mafiaforex.com/wp-content/uploads/2010/07/candlestick.gif](http://www.mafiaforex.com/wp-content/uploads/2010/07/candlestick.gif) How?! Looking at the examples I tried to change yAxis.orthogonalCoordinateDecimal with no result. Thank you for your help! Bye G.
How to display y Axis on the right side on Graph
CC BY-SA 3.0
null
2011-03-12T07:09:38.267
2012-07-31T22:11:50.987
2011-12-01T04:10:16.613
234,976
656,384
[ "macos", "core-plot" ]
5,281,261
1
5,284,527
null
42
65,589
I'm working on procedurally generating patches of dirt using randomized fractals for a video game. I've already generated a height map using the midpoint displacement algorithm and saved it to a texture. I have some ideas for how to turn that into a texture of normals, but some feedback would be much appreciated. My height texture is currently a 257 x 257 gray-scale image (height values are scaled for visibility purposes): ![enter image description here](https://i.stack.imgur.com/bPuyw.png) My thinking is that each pixel of the image represents a lattice coordinate in a 256 x 256 grid (hence, why there are 257 x 257 heights). That would mean that the normal at coordinate (i, j) is determined by the heights at (i, j), (i, j + 1), (i + 1, j), and (i + 1, j + 1) (call those A, B, C, and D, respectively). So given the 3D coordinates of A, B, C, and D, would it make sense to: 1. split the four into two triangles: ABC and BCD 2. calculate the normals of those two faces via cross product 3. split into two triangles: ACD and ABD 4. calculate the normals of those two faces 5. average the four normals ...or is there a much easier method that I'm missing?
Generating a normal map from a height map?
CC BY-SA 3.0
0
2011-03-12T07:26:05.183
2021-02-19T23:33:42.233
2012-10-09T15:31:44.013
44,729
563,658
[ "c++", "opengl", "graphics" ]
5,281,672
1
5,282,083
null
7
7,477
I want to use a random number generator that creates random numbers in a gaussian range where I can define the median by myself. I already asked a similar question here and now I'm using this code: ``` class RandomGaussian { private static Random random = new Random(); private static bool haveNextNextGaussian; private static double nextNextGaussian; public static double gaussianInRange(double from, double mean, double to) { if (!(from < mean && mean < to)) throw new ArgumentOutOfRangeException(); int p = Convert.ToInt32(random.NextDouble() * 100); double retval; if (p < (mean * Math.Abs(from - to))) { double interval1 = (NextGaussian() * (mean - from)); retval = from + (float)(interval1); } else { double interval2 = (NextGaussian() * (to - mean)); retval = mean + (float)(interval2); } while (retval < from || retval > to) { if (retval < from) retval = (from - retval) + from; if (retval > to) retval = to - (retval - to); } return retval; } private static double NextGaussian() { if (haveNextNextGaussian) { haveNextNextGaussian = false; return nextNextGaussian; } else { double v1, v2, s; do { v1 = 2 * random.NextDouble() - 1; v2 = 2 * random.NextDouble() - 1; s = v1 * v1 + v2 * v2; } while (s >= 1 || s == 0); double multiplier = Math.Sqrt(-2 * Math.Log(s) / s); nextNextGaussian = v2 * multiplier; haveNextNextGaussian = true; return v1 * multiplier; } } } ``` Then to verify the results I plotted them with gaussianInRange(0, 0.5, 1) for n=100000000 ![enter image description here](https://i.stack.imgur.com/1G8xa.jpg) As one can see the median is really at 0.5 but there isn't really a curve visible. So what I'm doing wrong? ## EDIT What i want is something like this where I can set the highest probability by myself by passing a value. ![enter image description here](https://i.stack.imgur.com/I0kTP.gif)
Generate a random number in a Gaussian Range?
CC BY-SA 2.5
0
2011-03-12T09:21:31.147
2011-03-12T17:24:19.043
2011-03-12T11:12:37.520
null
null
[ "c#", ".net", "algorithm", "random", "gaussian" ]
5,281,759
1
5,281,804
null
22
119,024
So I have a simple little macro/sub defined when a command button is clicked. The problem is it gives me: > My code is: ``` Dim rng As Range rng = Sheet8.Range("A12") '<< ERROR here rng.Value2 = "1" ``` ![enter image description here](https://i.stack.imgur.com/bV6KW.jpg) Thanks!
simple vba code gives me run time error 91 object variable or with block not set
CC BY-SA 2.5
null
2011-03-12T09:44:14.737
2021-01-05T15:14:16.920
2020-06-20T09:12:55.060
-1
368,070
[ "vba", "excel", "excel-2007" ]
5,282,342
1
null
null
7
9,482
I have a function which is in the form of probability distribution function as below: ![formula](https://i.stack.imgur.com/OOjaE.gif) Although I discover some lib providing function to obtain the result as the above formula would do; but I am learning to implement it so I would like to do it my self if possible. Below is what I can think of when implementing the function Is this is the right way to implement pdf? Or what parts do I miss? I appreciate any help.
Implement probability distribution function in Java problem
CC BY-SA 2.5
0
2011-03-12T11:58:34.210
2011-12-13T16:24:00.830
2011-03-12T13:13:13.803
35,070
656,545
[ "java", "math", "probability" ]
5,282,721
1
5,283,111
null
1
3,320
[http://code.google.com/p/apps-for-android/](http://code.google.com/p/apps-for-android/) I have eclipse setup with Subversive plugin, I can download the codes down to my eclipse with the SVN method URL, but I just couldnt find a way to compile this code successfully! Can any kind soul give this noob a step by step guide on how to get apps-for-android locally, compile, and run it on my test phone? Edit: Basically, in Eclipse with Subversive plugin, I create a new project by File->New->Other->SVN->Project from SVN then I use this URL, [http://apps-for-android.googlecode.com/svn](http://apps-for-android.googlecode.com/svn) Then on this screen, I dont know what I should select, so I chosed: Checkout as a project with the name specified ![enter image description here](https://i.stack.imgur.com/C4OAX.jpg) Then the codes got downloaded to my workspace, with the SVN metadatas. In my Eclipse, I can see that a new project has been created, but its not an android project. I tried to use Android Tools to convert it to an Android project, but of course it did not work. I also try to simply create a new project with the downloaded codes, and I was never able to compile it because Eclipse says there is an error with the project, but I cannot find the error at all. I thought this is supposed to be very simple, but I have spent one afternoon on this, so thus looking if anyone has done this before to advise me... Thanks.
How to compile & test "apps-for-android"?
CC BY-SA 2.5
null
2011-03-12T13:19:58.733
2011-05-07T18:18:10.710
2011-03-12T13:47:08.663
389,615
389,615
[ "android", "eclipse", "svn", "google-code" ]
5,282,758
1
5,282,841
null
9
20,609
I know how I can horizontally center the entire page with CSS. But is there a way to vertically center the page? Something like this... --- ![Example](https://i.stack.imgur.com/XHReI.jpg) ---
Centering page content vertically
CC BY-SA 2.5
0
2011-03-12T13:27:36.677
2011-03-12T21:38:39.143
null
null
217,649
[ "html", "css" ]
5,282,842
1
5,291,696
null
1
499
I am trying to scroll to the beginning of my UITextView after the user is done editing. This works fine: ``` [textView scrollRangeToVisible:NSMakeRange(0, 0)]; ``` However, I get a different result if the user scrolls to the very top; if the user scrolls to the top, the UITextView has a nice padding. If I do it programatically, it doesn't. I attached a screenshot to clarify this. How would I achieve the same thing programatically, i.e. that there won't be a difference if the user scrolls to the top of the app? Would I need to do something with scrollRectToVisible? [textView scrollRectToVisible:CGRectMake(0, 0, 0, 0) animated:YES]; did not work, though... but perhaps I'm sending the wrong parameters. ![enter image description here](https://i.stack.imgur.com/FV736.png)
scrollRangeToVisible scrolls differently than in-app scroll to-top
CC BY-SA 2.5
null
2011-03-12T13:40:51.753
2021-09-27T07:03:16.220
null
null
648,371
[ "iphone", "objective-c", "cocoa-touch", "uitextview" ]
5,282,919
1
5,283,552
null
6
12,198
I have control in SL4. I want data validation on button click. Big problem is normally SL4 give validation using binding property. like example given shown in this example [http://weblogs.asp.net/dwahlin/archive/2010/08/15/validating-data-in-silverlight-4-applications-idataerrorinfo.aspx](http://weblogs.asp.net/dwahlin/archive/2010/08/15/validating-data-in-silverlight-4-applications-idataerrorinfo.aspx) ``` <TextBox Text="{Binding Name,Mode=TwoWay,ValidatesOnDataErrors=true}" Height="23" Width="120" HorizontalAlignment="Left" VerticalAlignment="Top" /> ``` BUT I WANT TO SHOW ERROR MESSAGE LIKE THIS .... ![enter image description here](https://i.stack.imgur.com/WvATl.png) using my own code like on button click i check (textbox1.text == null ) then set this style of error to textbox1
Data Validation in Silverlight 4
CC BY-SA 2.5
0
2011-03-12T13:56:38.397
2012-10-03T11:02:20.200
null
null
389,200
[ "silverlight", "validation", "silverlight-4.0" ]
5,283,070
1
5,284,375
null
0
7,625
i have a website with jqgrid and I want to use both: - - I am using toolbarfilter setup using: ``` $("#grid").jqGrid('filterToolbar', { stringResult: true, searchOnEnter: true }) ``` So, this way, users have 2 ways of filtering. My issues are: 1. Toolbar Text does get removed after advanced filter (and is not factored into search request) If i have a toolbar search and hit enter. works great. If i then use click on the advance multi search and enter some criteria, it will "overwrite" the filter criteria BUT it leaves the text in the toolbar filter bar so when you see the results it confusing as the result set doesn't match with what you see in the toolbar filter text. 2. Going back and forth doesn't respect each other I set up initial advance multiple filter set, it works great. I then enter some text in the toolbar filter and hit enter, it sends ONLY that filter form the toolbar to the server (thus overwriting the existing filters set from the advance filter - which are now gone). If i go back to the advanced filter, it lists the old filter that i initially sent (not the latest filter that was generated from the toolbar filter). Is there anyway toolbarfilter and advancedfilter can work together and always build up a cumulative filter from both UI inputs, instead of overwriting each others in the request to the server. So basically in both use cases above it seems like you are not supposed to use both forms of filtering together as they don't seem to play nice together. ## Update: this image is in response to Oleg's first answer: ![enter image description here](https://i.stack.imgur.com/Kh5dd.png)
in jqgrid, why dont toolbarfilter and Multiple Search filter get along (when using stringResult:true)
CC BY-SA 2.5
null
2011-03-12T14:26:03.773
2011-03-25T09:18:17.690
2011-03-12T18:29:28.117
4,653
4,653
[ "jquery", "user-interface", "filter", "jqgrid" ]
5,283,376
1
5,300,482
null
0
8,224
I have two tables that are supposed to be related. ![enter image description here](https://i.stack.imgur.com/q5LBk.png) Tables and Coloums Specification Primary key table ProductCategory ProductCategoryID Foreign key table SubProductCategory2 ProductCategoryID In the controller I have the following methods when creating sub category... ``` public ActionResult Create() { ViewBag.ProductCategory = db.ProductCategories.OrderBy(p => p.ProductCategoryID).ToList(); ViewBag.SubProductCategory2 = db.SubProductCategory2.OrderBy(a => a.ProductCategoryID).ToList(); var PC2 = new SubProductCategory2(); return View(PC2); } public ActionResult Create(SubProductCategory2 Createsubcat2, FormCollection values) { if (ModelState.IsValid) { db.AddToSubProductCategory2(Createsubcat2); db.SaveChanges(); //error pointing here and the full error message I am getting is... /*error: System.Data.SqlClient.SqlException: * The INSERT statement conflicted with the FOREIGN KEY constraint * "FK_SubProductCategory2_ProductCategory". The conflict occurred in * database "MyHouseDB", table "dbo.ProductCategory", column * 'ProductCategoryID'. The statement has been terminated.*/ return RedirectToAction("/"); } ViewBag.ProductCategory = db.ProductCategories.OrderBy(p => p.ProductCategoryID).ToList(); ViewBag.SubProductCategory2 = db.SubProductCategory2.OrderBy(a => a.ProductCategoryID).ToList(); return View(Createsubcat2); } ViewBag.ProductCategory = db.ProductCategories.OrderBy(p => p.ProductCategoryID).ToList(); ViewBag.SubProductCategory2 = db.SubProductCategory2.OrderBy(a => a.ProductCategoryID).ToList(); return View(Createsubcat2); ``` in the views I have the following code... ``` <div class="editor-label"> @Html.LabelForModel() </div> <div class="editor-field"> @Html.DropDownList("CategoryName", new SelectList((System.Collections.IEnumerable)ViewData["ProductCategory"], "ProductCategoryID", "CategoryName")) @Html.ValidationMessageFor(model => model.ProductCategory.CategoryName) ``` Could some tell me how to solve the The INSERT statement conflicted with the FOREIGN KEY constraint error message. Correct me if I'm wrong, have I created the relationship between two tables incorrectly or the problem else where? Thanks in advance.
MVC: The INSERT statement conflicted with the FOREIGN KEY constraint
CC BY-SA 2.5
null
2011-03-12T15:23:01.233
2011-03-14T15:41:55.357
2011-03-14T15:41:55.357
109,941
364,712
[ "database", "asp.net-mvc-2", "foreign-keys" ]
5,283,414
1
5,283,488
null
10
14,397
![enter image description here](https://i.stack.imgur.com/8acWm.jpg) How do I fix this? I already tried removing the R.java and cleaning the project via eclipse, but it doesn't help. FYI I am trying to get PhotoStream from here: [http://code.google.com/p/apps-for-android/](http://code.google.com/p/apps-for-android/), but so far it has been very difficult to get things work.
Type R is already defined error
CC BY-SA 2.5
0
2011-03-12T15:28:21.433
2014-03-19T13:08:18.727
2011-03-12T16:27:52.473
5,555
389,615
[ "android", "eclipse" ]
5,283,632
1
5,283,663
null
4
4,306
The navigation menu at the top of the [http://www.playframework.org](http://www.playframework.org) site features a small arrow pointing upward for the currently selected section (Home, Learn, Download,...). I tried to get behind the implementation they used, but I can't wrap my head around it - the resource does not show up in Chrome's Resources window, and an inspection of the elements did not show any signs of a background image, nor a JS interceptor (although I might have missed that). What in hellhound's name is going on there? :) ![Screenshot](https://i.stack.imgur.com/hNnWU.png)
Arrow in nav menus in CSS/JS (e.g. playframework.org)
CC BY-SA 2.5
0
2011-03-12T16:04:06.957
2012-02-16T19:40:21.900
2011-06-09T21:00:49.720
468,793
458,603
[ "javascript", "html", "css", "navigation" ]
5,283,779
1
5,285,132
null
7
2,757
I'm facing a weird problem with jQuery UI Position function. There is a parent div, bigger then screen's height and another small div inside it. My function tell to the small div be positioned in the bottom of it parent. When the bottom is visible, everything is ok, but when the bottom is not visible because of the window size, the position function doesnt work. Follow a draw to make easy understanding... ![enter image description here](https://i.stack.imgur.com/CwXAA.png) And the function Im using is. ``` $("#_GREEN_div").position({ of: $("#_RED_div"), my: "left bottom", at: "left bottom" }); ``` JSFiddle - [jsfiddle.net/Steve_Wellens/5Zdac](http://jsfiddle.net/Steve_Wellens/5Zdac) (thanks Steve, great tool)
jQuery UI position function problem when the parent div is not visible on the screen
CC BY-SA 2.5
0
2011-03-12T16:30:09.867
2011-03-12T20:05:08.280
2011-03-12T19:53:53.623
506,967
506,967
[ "jquery", "jquery-ui", "position" ]
5,283,845
1
5,286,849
null
2
3,714
I'm having one, admittedly very minor issue with a contact form I've set up in WordPress using jQuery, jQuery form and PHP Mail to send a form-generated email. To replace my current contact form which performs a pHp validation from within the contact form page and then sends using PHP Mail, I've designed the following simple html 5 form (which can be seen on this page: [http://edge.donaldjenkins.net/contact](http://edge.donaldjenkins.net/contact)): ``` <form id="contact" method="post" action=""> <fieldset> <label for="name">Name</label> <input type="text" name="name" placeholder="Your Name" title="Enter your name" class="required"> <label for="email">E-mail</label> <input type="email" name="email" placeholder="[email protected]" title="Enter your e-mail address" class="required email"> <label for="phone">Phone</label> <input type="tel" name="phone" placeholder="ex. (555) 555-5555"> <label for="website">Website</label> <input type="url" name="url" placeholder="http://"> <label for="message">Question/Message</label> <textarea name="message"></textarea> <label for="checking" class="hidden">If you want to submit this form, do not enter anything in this field</label><input type="text" name="checking" class="hidden"> <input type="submit" name="submit" class="button" id="submit" value="Send Message" /> </fieldset> ``` I then use the jQuery validate [jquery.validate.js] and form [jquery.form.js] plugins to perform a client-end validation: ``` <script src="js/jquery.validate.js"></script> <script src="js/jquery.form.js"></script> <script> $(function(){ $('#contact').validate({ submitHandler: function(form) { $(form).ajaxSubmit({ url: 'send-message.php', success: function() { $('#contact').hide(); $('#instructions').hide(); $('#status').show(); $('#popular-posts').show(); $('#status').append("<p>Thanks! Your request has been sent. One will try to get back to you as soon as possible.</p>") } }); } }); }); </script> ``` After the validation, the above script uses jQuery.form's [ajaxSubmit function](http://www.malsup.com/jquery/form/#options-object) to submit the date to a server PHP page, send-message.php (the reason being that javascript can't send email). I use this PHP file to carry out a second, server-side validation of the data (though this is probably redundant, since because the setup relies on javascript to pass the data on to the server, one can safely assume that no one will be able to use the form without javascript enabled). It also performs a honeypot captcha check on data in a hidden input field added in the form. The email is then sent: ``` <?php //invoke wp_load in order to use WordPress wp_mail plugin function instead of mail for better authentification of the sent email require_once("/path/to/wp-load.php"); //Check to see if the honeypot captcha field was filled in if(trim($_POST['checking']) !== '') { $captchaError = true; $errors .= "\n Error: Captcha field filled in"; } else { //Check to make sure that the name field is not empty if(trim($_POST['name']) === '') { $errors .= "\n Error: Name field empty"; $hasError = true; } else { $name = strip_tags($_POST['name']); } //Check to make sure sure that a valid email address is submitted if(trim($_POST['email']) === '') { $emailError = 'You forgot to enter your email address.'; $hasError = true; } else if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", trim($_POST['email']))) { $errors .= "\n Error: Message field empty"; $hasError = true; } else { $email = strip_tags($_POST['email']); } //Check to make sure comments were entered if(trim($_POST['message']) === '') { $errors .= "\n Error: Message field empty"; $hasError = true; } else { $phone = strip_tags($_POST['phone']); $url = strip_tags($_POST['url']); if(function_exists('stripslashes')) { $message = stripslashes(trim($_POST['message'])); } else { $message = strip_tags($_POST['message']); } } //If there is no error, send the email if(!isset($hasError)) { // Send Message $emailTo = '[email protected]'; $subject = 'Contact Form Submission from '.$name; $body = "Name: $name \n\nEmail: $email \n\nPhone: $phone \n\nWebsite: $url \n\nMessage: $message"; $headers = 'From: My Site <'.$emailTo.'>' . "\r\n" . 'Reply-To: ' . $email; wp_mail($emailTo, $subject, $body, $headers); $alert = 'Thanks! Your request has been sent. One will try to get back to you as soon as possible.'; } else { $alert = $errors; } } ?> ``` The server keeps track of whether errors were found or whether the email was successfully sent in variable $alert. After the pHp function completes, the script hides the form from the contact page and displays a previously hidden html element to which it appends an alert message. The issue I can't solve is making javascript change the wording of that alert message to reflect whether the email was or not successfully sent, because I don't know how to pass the requisite pHp variable ($alert) containing a list of the error messages in the server PHP process to the script for insertion in the Contact Form page. Of course, again, this is a very theoretical concern, since for the reasons stated above, it's unlikely that an error-prone message would even have reached the PHP stage in the first place. I've tried inserting the following code at the end of the PHP file, to no avail: ``` <script type="text/javascript"> alert = <?php echo $alert; ?>; </script> ``` The latter attempt doesn't generate any errors in Firebug, but the variable value doesn't get passed on. Any ideas or thoughts welcome. : I added this workflow chart to clarify the setup for this issue: ![enter image description here](https://i.stack.imgur.com/o49R4.png)
Passing a variable from PHP to javascript and on to an html form
CC BY-SA 2.5
0
2011-03-12T16:41:26.600
2011-03-13T14:20:53.027
2011-03-12T23:01:02.490
265,324
265,324
[ "php", "javascript", "jquery", "email", "forms" ]
5,284,302
1
6,767,035
null
0
360
So this is a strange one which has caused me a lot of head scratching. There seems to be a layout bug on a site I made a while back that only happens occasionally on Chrome for OS X. (See the image below). I have tried Chrome on Ubuntu and Windows 7, and I can´t reproduce the error there. As well as Firefox, Safari, etc. The site is available here: [designstudier.no](http://designstudier.no/) I am really at a loss as what the problem may be. I´m running the same version of Chrome on OSX, Ubuntu and Windows 7, and this has been happening for the last few Chrome versions. There weird part is that it only happens occasionally. I would appreciate any input, thank you. [Full res image](https://i.stack.imgur.com/nkTlS.jpg) ![Error](https://i.stack.imgur.com/nkTlS.jpg)
CSS layout error only happens randomly in Chrome on OS X
CC BY-SA 2.5
null
2011-03-12T17:52:51.130
2011-07-20T18:58:09.607
null
null
281,043
[ "css", "layout", "google-chrome" ]
5,284,479
1
null
null
1
721
I'm working in objective-c and I'm allocating a dynamic array of floats, but the size depends on the size of another array. So my allocations goes something like this: ``` float myFloats[[myArray count]]; ``` All is working fine except when I do an analyze build in xcode. When using an element of the array a get a message like "The right operand is garbage value" I've tried initializing going through all the elements and setting them to zero, but the analyze compiler does not take it into account. Any one knows how to do it properly? ``` NSRect actualSuperFrame = [self frame]; //Here I initialize the float array. float clicksFromMiddle[[self.plannerViewArray count]]; NSRect actualPlannerFrame[[self.plannerViewArray count]]; PlannerView *plannerView; for(int i = 0; i < [self.plannerViewArray count];i++){ plannerView = [self.plannerViewArray objectAtIndex:i]; actualPlannerFrame[i] = [plannerView frame]; //Below is where the values are set. if (plannerView.isLeftPage) { clicksFromMiddle[i] = (actualSuperFrame.origin.x + (actualSuperFrame.size.width/2.0))-NSMaxX(actualPlannerFrame[i]); } else{ clicksFromMiddle[i] = (actualPlannerFrame[i].origin.x-(actualSuperFrame.origin.x + (actualSuperFrame.size.width/2.0))); } } [super setFrame:frameRect]; NSRect modifiedPlannerFrame[[self.plannerViewArray count]]; for(int i = 0; i < [self.plannerViewArray count];i++){ plannerView = [self.plannerViewArray objectAtIndex:i]; modifiedPlannerFrame[i] = [plannerView frame]; if(plannerView.isLeftPage){ //This next line is where I get the message, right operand of "-" is garbage value float newMaxX = (frameRect.origin.x +(frameRect.size.width/2.0))-clicksFromMiddle[i]; float newWidth = newMaxX-modifiedPlannerFrame[i].origin.x; [plannerView setFrame:NSMakeRect(modifiedPlannerFrame[i].origin.x, modifiedPlannerFrame[i].origin.y,newWidth , modifiedPlannerFrame[i].size.height)]; } ``` ![enter image description here](https://i.stack.imgur.com/ihU8S.jpg)
How to initialize a dynamic c style array
CC BY-SA 2.5
null
2011-03-12T18:19:56.940
2011-03-13T19:08:14.887
2011-03-13T19:08:14.887
433,950
433,950
[ "arrays", "cocoa", "xcode" ]
5,284,493
1
5,284,675
null
2
6,275
From the accelerometer, is it possible to get the angle of elevation? For those of you who don't know, the angle of elevation is: ![angle of elevation](https://i.stack.imgur.com/1uIxT.gif) Is this possible with the accelerometer measurements?
Get angle of elevation?
CC BY-SA 2.5
0
2011-03-12T18:23:18.423
2011-03-16T03:09:56.573
2011-03-12T18:35:28.977
416,564
200,477
[ "java", "android", "math", "accelerometer" ]
5,284,516
1
5,284,707
null
18
10,289
I want to draw text just like the following style -- the image is always on the top right corner, and the text is around the image. ![enter image description here](https://i.stack.imgur.com/Y5ANM.png) Could anyone tell me how to implement this on iOS? Do I need to use Core Text? Thanks in advance!
How Can I Draw Image with Text Wrapping on iOS?
CC BY-SA 2.5
0
2011-03-12T18:28:31.887
2016-05-13T07:41:52.787
null
null
212,912
[ "objective-c", "ios", "uitableview", "nsstring", "core-text" ]
5,284,586
1
5,284,644
null
1
2,089
I want to import data from database directly into the solr index. I found [this tutorial very helpful](http://wiki.apache.org/solr/DIHQuickStart). However I have a problem to get this to work. I first set up a requestHandler like this ``` <requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler"> <lst name="defaults"> <str name="config">data-config.xml</str> </lst> </requestHandler> ``` data-config.xml: ``` <dataConfig> <dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/admin_pproject" user="root" password=""/> <document> <entity name="id" query="select id from admin_pproject"> </entity> </document> </dataConfig> ``` When I run full import I get several errors: ![enter image description here](https://i.stack.imgur.com/PxJf4.png) Any ideas?
Index a DB table directly into Solr
CC BY-SA 2.5
0
2011-03-12T18:41:16.403
2011-03-13T11:16:21.910
2011-03-13T11:16:21.910
401,025
401,025
[ "solr" ]
5,284,643
1
5,284,919
null
8
1,538
I've been working on a simple frequency detection setup on the iphone. Analyzing in the frequency domain using FFT results has been somewhat unreliable in the presence of harmonics. I was hoping to use Cepstrum results to help decide what fundamental frequency is playing. I am working with AudioQueues in the AudioToolbox framework, and do the Fourier transforms using the Accelerate framework. My process has been exactly what is listed on Wikipedia's Cepstrum article for the Real Power Cepstrum, specifically: signal → FT → abs() → square → log → FT → abs() → square → power cepstrum. The problem I have is that the Cepstrum results are extremely noisy. I have to drop the first and last 20 values as they are astronomical compared to the other values. Even after "cleaning" the data, there is still a huge amount of variation - far more than I would expect given the first graph. See the pictures below for the visualizations of the frequency domain and the quefrency domain. ![FFT](https://i.stack.imgur.com/C2ExC.png) [FFT](https://i.stack.imgur.com/jaKLu.png) ![Cepstrum](https://i.stack.imgur.com/sw3Ot.png) [Cepstrum](https://i.stack.imgur.com/Woteg.png) When I see such a clear winner in the frequency domain as on that graph, I expect to see a similarly clear result in the quefrency domain. I played A440 and would expect bin 82 or so to have the highest magnitude. The third peak on the graph represents bin 79, which is close enough. As I said, the first 20 or so bins are so astronomical in magnitude as to be unusuable, and I had to delete them from the data set in order to see anything. Another odd quality of the cepstrum data is that the even bins seem to be much higher than the odd bins. Here are the frequency bins from 77-86: ``` 77: 151150.0313 78: 22385.92773 79: 298753.1875 80: 56532.72656 81: 114177.4766 82: 31222.88281 83: 4620.785156 84: 13382.5332 85: 83.668259 86: 1205.023193 ``` My question is how to clean up the frequency domain so that my Cepstrum domain results are not so wild. Alternately, help me better understand how to interpret these results if they are as one would expect in a Cepstrum analysis. I can post examples of the code I'm using, but it mostly uses vDSP calls and I don't know how helpful that would be.
Cleaning up noisy Cepstrum results
CC BY-SA 2.5
0
2011-03-12T18:50:30.860
2014-11-24T20:19:27.160
2011-03-12T20:29:51.873
19,679
602,162
[ "iphone", "signal-processing", "fft", "pitch", "frequency-analysis" ]
5,285,161
1
5,285,231
null
1
11,541
I am currently trying to develop a website where I need to have 2 CSS containers side by side at the same level. I.e. they both need to have top: 0px; However, whey they both have relative the first container is pushed down to where the second container content finishes. How can I get these two containers to sit side by side both needing to be relative. I have been trying to figure it out for ages and google searches don't seem to provide with much help. I am using HTML5 and CSS3 in order to build the website. Thanks for any help you can offer. Below is the HTML Code ``` <div id="feedContainer"> Latest Tech News<br />< The quick brown<br/> fox jumped over the lazy<br /><br />dogs back </div> <div id="bodyIndex"> Hi I am a body<br />and i am a new line<br/>r />and i am a <strong>another new line</strong><br />I'm another<br /><br />woo!!<br /><br /> <font size="+24">I am a large font<br /><br />Please don't move<br />the feed container </font> </div> ``` Below is the CSS Code ``` #bodyIndex { position: relative; margin-left: 120px; padding-left: 15px; padding-top: 5px; width: 660px; /*padding-bottom: 70px;*/ /*height: 100%;*/ /*top: 80px; */ /*background-color: #c8c8c8;*/ background-color: #fff6d1; /*clear: both;*/ clear:none; padding-bottom: 60px; min-height: 100%; height: auto; } #feedContainer { position:relative; /* top: 0px;*/ top: 0px; bottom: 0; width: 180px; padding-left: 5px; left: 800px; font-size: larger; font-weight: bold; color: black; border-left:thin solid #e0e0e0; clear: none; } ``` ![Screenshot of CSS containers](https://i.stack.imgur.com/7IENk.png) In the image above where it says 'I am a body' and 'Latest Tech News' should be lined. The only way I can get them to line up is if I set one of them to absolute but I need both containers to be relative
Two Relative CSS containers next to each other
CC BY-SA 2.5
null
2011-03-12T20:10:01.333
2011-04-14T18:07:03.340
2011-03-12T20:22:10.817
499,448
499,448
[ "html", "css" ]
5,285,286
1
5,285,381
null
2
359
I used the following image as the background throughout [my site](https://skitch.com/keruilin/rwcsq/winthetrophy-the-new-way-to-bet-sports-free-sports-betting-free-nfl-betting). ![enter image description here](https://i.stack.imgur.com/9Stjj.png) How can you use CSS3 and gradients to produce a similar visual element?
How to create this gradient background in CSS3?
CC BY-SA 3.0
null
2011-03-12T20:28:24.010
2013-06-11T12:48:55.060
2011-08-15T10:10:24.913
468,793
251,257
[ "css", "gradient", "background-color" ]
5,285,306
1
5,285,478
null
11
1,069
I am aware that by default Java does not have the so-called `eval` (what I pronounce as "evil") method. This sounds like a bad thing—knowing you do not have something which so many others do. But even worse seems being notified that you have it. My question is: What is solid reasoning behind it? I mean, Google'ing this just returns a massive amount of old data and bogus reasons—even if there is an answer that I'm looking for, I can't filter it from people who are just throwing generic tag-words around. I'm not interested in answers that are telling me how to get around that; I can do that myself: ### Using Bean Scripting Framework (BSF) File `sample.py` (in `py` folder) contents: ``` def factorial(n): return reduce(lambda x, y:x * y, range(1, n + 1)) ``` And Java code: ``` ScriptEngine engine = new ScriptEngineManager().getEngineByName("jython"); engine.eval(new FileReader("py" + java.io.File.separator + "sample.py")); System.out.println(engine.eval("factorial(932)")); ``` ### Using designed bridges like JLink ![example](https://i.stack.imgur.com/kEied.gif) This is equivalent to: ``` String expr = "N[Integrate[E^(2 y^5)/(2 x^3), {x, 4, 7}, {y, 2, 3}]]"; System.out.println(MM.Eval(expr)); //Output: 1.5187560850359461*^206 + 4.2210685420287355*^190*I ``` ### Other methods - - - - - - - - `Runtime.getRuntime().exec`
Why do people say that Java can't have an expression evaluator?
CC BY-SA 2.5
0
2011-03-12T20:30:42.573
2011-03-13T23:00:54.010
2011-03-12T21:34:31.983
31,615
97,754
[ "algorithm", "language-agnostic", "reflection", "java" ]
5,285,637
1
5,285,695
null
1
1,678
I'm constructing a dynamic query to select dropped domain names from my database. At the moment there are a dozen rows but I'm going to get data soon which will have records of up to 500,000 rows. The schema is just one table containing 4 columns: ``` CREATE TABLE `DroppedDomains` ( `domainID` int(11) NOT NULL AUTO_INCREMENT, `DomainName` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `DropDate` date DEFAULT NULL, `TLD` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`domainID`) ) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ``` I did not create the schema, this is the live database schema. Here's sample data: ![enter image description here](https://i.stack.imgur.com/omWao.png) I've constructed probably the most complex type of query below. The criteria is as follows: SELECT any number of domains which > 1. Start with the word 'starts' 2. End with the word 'ends' 3. Contain the word 'containsThis' anywhere in the domain name 4. Contain the word 'ContainsThisToo' anywhere in the domain name 5. Include at least one digit 6. The domain name must be at least 49 characters. Multibytes need to count as one character( I used CHAR_LENGTH ). 7. The domain name must be at least under 65 characters. 8. The TLD must be 'org' 9. The DropDate needs to be later than 2009-11-01 Here's my query so far: ``` SELECT * FROM DroppedDomains WHERE 1=1 AND DomainName LIKE 'starts%ends' AND DomainName LIKE '%containsThis%' AND DomainName LIKE '%containsThisToo%' AND DomainName LIKE '%-%' AND DomainName REGEXP '[0-9]' AND CHAR_LENGTH(DomainName) > 49 AND CHAR_LENGTH(DomainName) < 65 AND TLD = 'org' AND DropDate > '2009-11-01' ``` Here are my questions 1. Would it extremely benefit the performance considering I'll have half a million rows, if I made the TLD column its own table and just make the TLD column a foreign key to that? There will only be 5 TLDs ( com, net, org, info, biz ). I realize there are more TLDs in the real world, but this application will only have 5. The user cannot specify their own TLD. 2. I know that REGEXP and 500,000 rows is probably a recipe for disaster. Is there anyway I can avoid the REGEXP? 3. Are there any other optimizations to the query I can do? Like merge LIKEs or use other functions such as maybe INSTR? And should I implement any specific sort of caching mechanism?
Can my query with multiple LIKE statements and REGEXP be more efficient?
CC BY-SA 2.5
null
2011-03-12T21:32:11.370
2011-03-13T02:40:40.913
null
null
145,190
[ "mysql", "sql", "mysql5" ]
5,285,776
1
5,312,242
null
4
5,763
I am trying to access some text that is located in a DIV. I need to check to see if the page holds the text so I can return a true or false. The code I am using is below: ``` cancel = browser.text.include?("Current Cancelled") if cancel == true puts "Line item cancelled" else puts "****Line item not cancelled****" end ``` But it returns false every time. Here is a code snippet of what I am looking into: ![enter image description here](https://i.stack.imgur.com/XDpLY.png)
How do I check for text inside a <div>?
CC BY-SA 2.5
null
2011-03-12T21:56:30.013
2011-03-15T16:24:47.040
null
null
571,722
[ "ruby", "watir", "firewatir" ]
5,285,984
1
5,286,003
null
1
426
I'm currently building my first database in MySQL with an interface written in PHP and am using the 'learn-by-doing' approach. The figure below illustrates my database. Table names are at the top, and the attribute names are as they appear in the real database. I am attempting to query the values of each of these attributes using the code seen below the table. I think there is something wrong with my `mysql_query()` function since I am able to observe the expected behaviour when my form is successfully submitted, but no search results are returned. Can anyone see where I'm going wrong here? ![enter image description here](https://i.stack.imgur.com/xApKM.png) ``` <form name = "search" action = "<?=$PHP_SELF?>" method = "get"> Search for <input type = "text" name = "find" /> in <select name = "field"> <option value = "Title">Title</option> <option value = "Description">Description</option> <option value = "City">Location</option> <option value = "Company_name">Employer</option> </select> <input type = "submit" name = "search" value = "Search" /> </form> $query = "SELECT Title, Descrition, Company_name, City, Date_posted, Application_deadline FROM job, employer, address WHERE Title = $find OR Company_name = $find OR Date_posted = $find OR Application_deadline = $find AND job.employer_id_job = employer.employer_id AND job.address_id_job = address.address_id"; ```
mysql_query arguments in PHP
CC BY-SA 2.5
null
2011-03-12T22:39:15.737
2011-03-13T00:35:34.830
2011-03-13T00:35:34.830
null
null
[ "php", "mysql" ]
5,286,147
1
5,286,360
null
1
2,226
I created a blank NavBar project and only touched a couple lines or so on one of the view controllers. I tested it fine in the 4.3 iPad and iPhone emulator but can't make it work for 4.2 at all. I get an error saying: > The selected run destination is not valid for this action. This is what I have on my project settings: ![Screenshot of my project settings](https://i.stack.imgur.com/VXTyD.png) Usually in XCode 3 that was all I needed to change but I guess I'm missing some setting in XCode 4. What could this be?
Can't make Xcode 4 run a barely empty project using SDK 4.2 (runs fine in 4.3)
CC BY-SA 2.5
0
2011-03-12T23:00:10.367
2011-04-21T15:07:14.023
null
null
255,260
[ "iphone", "ios", "ios-4.2", "xcode4", "ios4" ]