Id
int64
1.68k
75.6M
PostTypeId
int64
1
2
AcceptedAnswerId
int64
1.7k
75.6M
ParentId
int64
1.68k
75.6M
Score
int64
-60
3.16k
ViewCount
int64
8
2.68M
Body
stringlengths
1
41.1k
Title
stringlengths
14
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
1
CreationDate
stringlengths
23
23
LastActivityDate
stringlengths
23
23
LastEditDate
stringlengths
23
23
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
1
21.3M
Tags
list
4,986,284
1
null
null
0
129
If I have coordinates of all points of the red lines in fig below, then how can I write a code in matlab to draw such lines like plot below using those coordinates? I mean because one line comes from the upper axis, is it possible for example to put coordinates in a matrix, then plot it? For the case when all lines come from the left axis, I can plot them using a matrix. ![enter image description here](https://i.stack.imgur.com/AspPq.png) ``` clc; clear; format long e s=0; lmin=0.8; lmax=2.5; bmin=1.0; bmax=1.5; lam=linspace(lmin,lmax,100); for n=1:length(lam) increm*emphasized text*ent=0.0001; tolerence=1e-14; xstart=bmax-increment; x=xstart; dx=increment; m=0; while x > bmin while dx/x >= tolerence if sign(fTE(lam(n),x,s))*sign(fTE(lam(n),x-dx,s))<0 dx=dx/2; else x=x-dx; end end if abs(fTE(lam(n),x,s)) < 1e-2 m=m+1; if n>1 && m==1 && (x-max(r(1,:))) > 1e-4 b=zeros(1,n-1); r=[b;r]; end r(m,n)=x; end dx=increment; x=0.999*x; end end switch s case 0 figure hold on,plot(lam,r(1,:),'b') text(1.6,1.98,'TE(0)','FontSize',10), hold on,plot(lam,r(2,:),'c') text(1.8,1.89,'TE(2)','FontSize',10), xlim([lmin,lmax]);ylim([bmin,bmax]), xlabel('\lambda(\mum)'),ylabel('\beta-bar') case 1 figure hold on,plot(lam,r(1,:),'m') %text(1.4,1.9,'TE(1)','FontSize',10), hold on,plot(lam,r(2,:),'r') %text(1.37,1.54,'TE(3)','FontSize',10), xlim([lmin,lmax]);ylim([bmin,bmax]), xlabel('\lambda(\mum)'),ylabel('\beta-bar') end ``` ``` function y=fTE(lambda,betab,s) n1=2; n2=1.5; n3=1; z0=120*pi; d1=1; d2=1; d3=1; a=1; k0=2*pi/lambda; ub= sqrt(n1^2-betab^2); vb= sqrt(n2^2-betab^2); w= sqrt(betab^2-n3^2); Ub=k0*ub*d1; Vb=k0*vb*d2; W=k0*w*d3; z1=z0/ub; z1b=z1/z0; a0b=tan(Vb)/(w*ub)+tan(Ub)/(vb*w)-tanh(W)/(vb*ub)-tan(Vb)*tanh(W)*tan(Ub)/w^2; b0b=tan(Vb)*tan(Ub)/(vb^2*w)-tan(Vb)*tanh(W)/(vb^2*ub)+tanh(W)*tan(Ub)/(vb*w^2)- tan(Vb)*tan(Ub)/(w*ub^2)-tan(Vb)*tanh(W)/(w^2*ub)+tanh(W)*tan(Ub)/(vb*ub^2); c0b=tan(Ub)/(vb*w*ub^2)+tanh(W)/(vb*w^2*ub)+tan(Vb)*tanh(W)*tan(Ub)/(vb^2*ub^2)+tan(Vb)/(vb^2*w*ub); U0= k0*ub*a; m=s; y=(a0b*z1b^2+c0b)+(a0b*z1b^2-c0b)... *cos(2*U0+m*pi)-b0b*z1b*sin(2*U0+m*pi); end ```
find a way to plot
CC BY-SA 2.5
null
2011-02-13T19:19:16.847
2011-02-13T21:15:01.093
2011-02-13T21:15:01.093
403,390
230,565
[ "matlab" ]
4,986,255
1
5,003,718
null
1
4,476
I sort and group listbox items, I use CollectioView on this purpose. From view model class I bind collection on ListBox ItemSource property, here is it. ``` public BindableCollection<UserInfo> Friends { get { return _friends; } set { _friends = value; NotifyOfPropertyChange(() => Friends); } } ``` ListBox items is type of UserInfo. When I initialize ListBox I sort and group items with this method. ``` private ICollectionView _currentView; //... private void SortContactList() { _currentView = CollectionViewSource.GetDefaultView(Friends); _currentView.GroupDescriptions.Add(new PropertyGroupDescription("TextStatus")); _currentView.SortDescriptions.Add(new SortDescription("TextStatus", ListSortDirection.Ascending)); _currentView.SortDescriptions.Add(new SortDescription("Nick", ListSortDirection.Ascending)); } ``` TextStatus and Nick are properties of userInfo class. I use in Listbox GroupStyle. Here ist it: ``` <Style x:Key="MessengerView_ToogleBtn" TargetType="{x:Type ToggleButton}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ToggleButton}"> <Image x:Name="img" Source="/images/icons/Collapse.png" /> <ControlTemplate.Triggers> <Trigger Property="IsChecked" Value="False"> <Setter TargetName="img" Property="Source" Value="/images/icons/Expand.png" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> <GroupStyle> <GroupStyle.ContainerStyle> <Style TargetType="{x:Type GroupItem}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type GroupItem}"> <ControlTemplate.Triggers> <DataTrigger Binding="{Binding Path=IsBottomLevel}" Value="True"> <Setter TargetName="gridTemplate" Property="Grid.Background" Value="White" /> </DataTrigger> </ControlTemplate.Triggers> <Grid> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition /> </Grid.RowDefinitions> <Grid Background="Black" x:Name="gridTemplate" Height="26" VerticalAlignment="Center"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="100" /> <ColumnDefinition Width="45" /> </Grid.ColumnDefinitions> <ToggleButton x:Name="btnShowHide" IsChecked="True" Style="{StaticResource MessengerView_ToogleBtn}"/> <TextBlock Style="{StaticResource MessengerView_LbGroupHeader_TextBlock}" Text="{Binding Path=Name}" Grid.Column="1"/> <TextBlock TextAlignment="Left" Style="{StaticResource MessengerView_LbGroupHeader_TextBlock}" Grid.Column="2" Text="{Binding Path=ItemCount}"/> </Grid> <ItemsPresenter Visibility="{Binding ElementName=btnShowHide, Path=IsChecked, Converter={StaticResource booleanToVisibilityConverter}}" Margin="3,3,3,3" Grid.Row="1" /> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> </GroupStyle.ContainerStyle> </GroupStyle> ``` If I run app, it look on this picture. 1. ![enter image description here](https://i.stack.imgur.com/0TDQR.jpg) I edit source property of ListBox, (add,remove, update), after edited listbox I call Refresh method on CollectionView. ``` _currentView.Refresh(); ``` Problem is that GroupItem is collapse and I call Refresh method on all GroupItem are expanded. For example. GroupItem 1 is collapse. GroupItem 2 is exapnded. GroupItem 3 is collapse. Before call Refresh ListBox look like on this picture: ![enter image description here](https://i.stack.imgur.com/8iYVm.jpg) I call Refresh method on CollectionView and all GroupItems are expanded. I would like to keep the original state, how can I achive this? After called Refresh Lisbox look like on first picture on the top.
Sort and Group ListItems in a WPF ListBox- GroupItem collapse and expand
CC BY-SA 3.0
0
2011-02-13T19:12:33.980
2017-04-29T10:49:44.813
2017-04-29T10:49:44.813
1,905,949
null
[ "wpf", "sorting", "listbox", "groupstyle" ]
4,986,374
1
4,986,694
null
1
432
I am installing SharePoint on windows 7 as a standalone using ServerFarm So i m using a standalone server so i do not have a domain account. When i m using command shell to create database it is giving me following error ![enter image description here](https://i.stack.imgur.com/DZA5F.png) I also off windows firewall but no solution if you have any solution please help me Regards
Standalone SharePoint 2010 Installation on Windows7
CC BY-SA 2.5
null
2011-02-13T19:34:40.470
2011-02-13T20:32:27.410
null
null
415,086
[ "windows-7", "sharepoint-2010", "installation" ]
4,986,384
1
null
null
1
446
Is there a way to define stroke of a single polygon so that it would look like multiple glued polygons? See this image: ![Adjanced lines](https://i.stack.imgur.com/mmE10.png)
SVG stroke as glued lines
CC BY-SA 2.5
0
2011-02-13T19:36:28.283
2015-07-07T06:13:31.663
2011-02-27T15:40:42.443
405,017
289,827
[ "svg", "polygon", "stroke" ]
4,986,570
1
5,045,392
null
0
832
I have the following Rails form_for definition. As you can see in the screen shot, it is not rendering the "Sign In" text for the Submit input. I have also included the resulting HTML. ``` <h2>Sign in</h2> <%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :dojoType => "dijit.form.Form") do |f| %> <p><%= f.label :login %><br /> <%= f.text_field :login, {:dojoType => "dijit.form.TextBox"} %></p> <p><%= f.label :password %><br /> <%= f.password_field :password, {:dojoType => "dijit.form.TextBox"} %></p> <% if devise_mapping.rememberable? -%> <p><%= f.check_box :remember_me, {:dojoType => "dijit.form.CheckBox"} %> <%= f.label :remember_me %></p> <% end -%> <p><%= f.submit "Sign in", {:dojoType => "dijit.form.Button"} %></p> <% end %> <%= render :partial => "devise/shared/links" %> ``` ![enter image description here](https://i.stack.imgur.com/WGSe4.jpg) HTML ``` <span class="dijit dijitReset dijitInline dijitButton" dir="ltr" widgetid="user_submit"><span class="dijitReset dijitInline dijitButtonNode" dojoattachevent="ondijitclick:_onButtonClick"> <span class="dijitReset dijitStretch dijitButtonContents" dojoattachpoint="titleNode,focusNode" wairole="button" waistate="labelledby-user_submit_label" role="button" aria-labelledby="user_submit_label" id="user_submit" tabindex="0" style="-webkit-user-select: none; "> <span class="dijitReset dijitInline dijitIcon" dojoattachpoint="iconNode"></span><span class="dijitReset dijitToggleButtonIconChar">●</span> <span class="dijitReset dijitInline dijitButtonText" id="user_submit_label" dojoattachpoint="containerNode"></span> </span> </span> <input name="commit" type="submit" value="Sign In" class="dijitOffScreen" dojoattachpoint="valueNode"> </span> ```
Dojo Digit Theme rendering form_for submit input without text
CC BY-SA 2.5
null
2011-02-13T20:12:48.913
2011-02-19T19:44:56.603
2011-02-15T19:40:25.973
166,233
166,233
[ "ruby-on-rails", "ruby", "ruby-on-rails-3", "dojo", "dijit.form" ]
4,986,622
1
null
null
0
616
I am working on a project using the three 20 library. As part of this project I have to load and display the images in TTThumbsViewController. The code to download images and setup a Photo object does get executed but the images are never displayed.![Please refer to attached image.](https://i.stack.imgur.com/oNn2x.png) ``` However, if I use the same datasource for TTPhotoViewController everything works just fine. I am using 1.0.3 version of the Three20 library. The code of setting up the datasource is @interface FeedPhotoSource : TTModel <TTPhotoSource> { NSString* _title; NSMutableArray* _photosToBeLoaded; NSMutableArray * _loadedPhotosArray; } @property(retain) NSNumber * ownderId; - (id)initWithTitle:(NSString*)title photos:(NSArray*)photos ownerId:(NSNumber*)ownerId; @end /////////////////////////////////////////////////////////////////////////////////////////////////// @interface FeedPhoto : NSObject <TTPhoto> { id<TTPhotoSource> _photoSource; NSString* _thumbURL; NSString* _smallURL; NSString* _URL; CGSize _size; NSInteger _index; NSString* _caption; } - (id)initWithURL:(NSString*)URL smallURL:(NSString*)smallURL size:(CGSize)size; - (id)initWithURL:(NSString*)URL smallURL:(NSString*)smallURL size:(CGSize)size caption:(NSString*)caption; @property(retain, nonatomic) NSString* thumbURL; @property(retain, nonatomic) NSString* smallURL; @property(retain, nonatomic) NSString* URL; @end ``` And the implementation is ``` #import "FeedPhotoSource.h" #import "FacebookGetPhotosRequest.h" #import "FeedDataRecord.h" @implementation FeedPhotoSource @synthesize title = _title; @synthesize ownderId; /////////////////////////////////////////////////////////////////////////////////////////////////// // NSObject - (id)initWithTitle:(NSString*)title photos:(NSArray*)photos ownerId:(NSNumber*)ownerId { if (self = [super init]) { _title = [title copy]; _photos = photos?[photos mutableCopy] : [[NSMutableArray alloc] init]; self.ownderId = ownerId; _loadedPhotosArray = [[NSMutableArray alloc] initWithCapacity:4]; _request = nil; } return self; } - (id)init { return [self initWithTitle:nil photos:nil ownerId:nil]; } - (void)dealloc { TT_RELEASE_SAFELY(ownderId); TT_RELEASE_SAFELY(_photos); TT_RELEASE_SAFELY(_title); TT_RELEASE_SAFELY(_loadedPhotosArray); TT_RELEASE_SAFELY(_request); [super dealloc]; } /** * Indicates that the data has been loaded. * * Default implementation returns YES. */ - (BOOL)isLoaded { int count = [_loadedPhotosArray count] ; return (count != 0); } /** * Indicates that the data is in the process of loading. * * Default implementation returns NO. */ - (BOOL)isLoading { if (self.isLoaded) { return NO; } return (_request != nil); } - (BOOL)shouldLoadMore { return NO; } /////////////////////////////////////////////////////////////////////////////////////////////////// // TTModel - (void)load:(TTURLRequestCachePolicy)cachePolicy more:(BOOL)more { if (_request != nil) { TT_RELEASE_SAFELY(_request); } NSMutableArray * _photosArray = [NSMutableArray array]; for(MediaObjectLoadStatus * mediaObjectEntry in _photos) { [_photosArray addObject:mediaObjectEntry.photoId]; FeedPhoto * photo = [[[FeedPhoto alloc] initWithURL:mediaObjectEntry.mediaPath smallURL:mediaObjectEntry.mediaPath size:CGSizeMake(320, 480)] autorelease]; photo.pid = mediaObjectEntry.photoId; [_feedPhotoArray addObject:photo]; } _request = [[MyRequest alloc] initWithPhotoIds:_photosArray andOwner:ownderId]; _request.delegate = self; [_request fetchPhotos]; } /** * Cancels a load that is in progress. * * Default implementation does nothing. */ - (void)cancel { if (_request != nil) { [_request cancelPreviousRequest]; TT_RELEASE_SAFELY(_request); } [self didCancelLoad]; } -(void) Request: (myRequest*)request CompletedSuccessfullyWithResult:(id) result { NSMutableArray * resultObj = result; //Extract and update photosObject [self didFinishLoad]; } -(void) Request: (myRequest*)request CompletedWithFailure:(NSError *) error { [self didFailLoadWithError:error]; } /////////////////////////////////////////////////////////////////////////////////////////////////// // TTPhotoSource - (NSInteger)numberOfPhotos { return _photos.count; } - (NSInteger)maxPhotoIndex { return _photos.count - 1; } - (id<TTPhoto>)photoAtIndex:(NSInteger)photoIndex { if (photoIndex < _feedPhotoArray.count) { id photo = [_feedPhotoArray objectAtIndex:photoIndex]; if (photo == [NSNull null]) { return nil; } else { return photo; } } return nil; } @end /////////////////////////////////////////////////////////////////////////////////////////////////// @implementation FeedPhoto @synthesize photoSource = _photoSource, size = _size, index = _index, caption = _caption; @synthesize thumbURL = _thumbURL; @synthesize smallURL = _smallURL; @synthesize URL = _URL; /////////////////////////////////////////////////////////////////////////////////////////////////// // NSObject - (id)initWithURL:(NSString*)URL smallURL:(NSString*)smallURL size:(CGSize)size { return [self initWithURL:URL smallURL:smallURL size:size caption:nil]; } - (id)initWithURL:(NSString*)URL smallURL:(NSString*)smallURL size:(CGSize)size caption:(NSString*)caption { if (self = [super init]) { _photoSource = nil; _URL = [URL copy]; _smallURL = [smallURL copy]; _thumbURL = [smallURL copy]; _size = size; _caption = [caption copy]; _index = NSIntegerMax; } return self; } - (void)dealloc { TT_RELEASE_SAFELY(_URL); TT_RELEASE_SAFELY(_smallURL); TT_RELEASE_SAFELY(_thumbURL); TT_RELEASE_SAFELY(_caption); [super dealloc]; } /////////////////////////////////////////////////////////////////////////////////////////////////// // TTPhoto - (NSString*)URLForVersion:(TTPhotoVersion)version { if (version == TTPhotoVersionLarge) { return _URL; } else if (version == TTPhotoVersionMedium) { return _URL; } else if (version == TTPhotoVersionSmall) { return _smallURL; } else if (version == TTPhotoVersionThumbnail) { return _thumbURL; } else { return nil; } } @end ```
TTThumbsViewController not displaying images
CC BY-SA 2.5
null
2011-02-13T20:21:17.583
2011-08-21T06:26:31.673
null
null
210,504
[ "iphone", "ios4", "three20" ]
4,987,052
1
4,987,262
null
1
91
Help a CSS newbie out here. What I'm trying to do is very simple. ![enter image description here](https://i.stack.imgur.com/KEXfJ.png) As I said in the image, I want the text to be in the same line. I tried everything i could think of. Here is the index.php: [http://pastebin.com/9LVVFgUZ](http://pastebin.com/9LVVFgUZ) Here is the style.css: [http://pastebin.com/v8Eius2A](http://pastebin.com/v8Eius2A) Thanks.
Aligning lines in CSS
CC BY-SA 2.5
0
2011-02-13T21:35:49.033
2011-02-13T22:14:51.340
2011-02-13T21:40:20.383
425,275
475,721
[ "css", "alignment" ]
4,987,049
1
4,987,085
null
4
2,092
I have a HABTM association between user and role. User can be an admin (role_id = 1) or a user (role_id = 2) for roles. In the join table, roles_users, I have some redundant records. For ex: ![enter image description here](https://i.stack.imgur.com/4r5lB.png) I want to remove the duplicate records such as 1:1, 2:4. Two questions: 1. Where's the best place to execute the sql script that removes the dups -- migration? script? 2. What is the sql query to remove the dups?
Deleting duplicate records in join table
CC BY-SA 2.5
0
2011-02-13T21:35:21.127
2014-11-06T20:52:48.733
null
null
251,257
[ "mysql", "ruby-on-rails", "has-and-belongs-to-many", "duplicates" ]
4,987,174
1
4,995,481
null
1
272
I'm currently developing a little BlackBerry App and after setting up Eclipse (Plugin v1.3, SDK6.0) I noticed that I don't have any code completion! Is there any configuration necessary to make this work? Coding without code completion is kind of annoying ;) Here a screenshot of an example where i would need a code completion: ![enter image description here](https://i.stack.imgur.com/QMFcE.jpg)
BlackBerry Java CodeCompletion is missing
CC BY-SA 2.5
null
2011-02-13T21:57:18.313
2011-02-14T17:51:43.860
2011-02-14T17:47:22.420
579,071
579,071
[ "java", "blackberry", "blackberry-eclipse-plugin" ]
4,987,354
1
5,024,294
null
3
4,711
I'm trying to run a test in Google Chrome 9.0.597.98 beta using Selenium Grid. I'm firing the test off from C# using the default *googlechrome target that ships with Selenium Grid. When I try to open a site, I'm greeted with a error. I've found a post from someone who suggests that the solution is to drop security on Chrome a bit by passing in some parameters. [This post](http://groups.google.com/group/selenium-users/msg/360750753ca98b69?pli=1) suggest using something like this: `DefaultSelenium selenium = new DefaultSelenium(location, port, browser, targetPath);` `BrowserConfigurationOptions bco = new BrowserConfigurationOptions();` `selenium.start(bco.setCommandLineFlags("--disable-web-security"));` For some reason I don't see the `BrowserConfigurationOptions` anywhere. better way of doing this? ![enter image description here](https://i.stack.imgur.com/FLTAI.png)
"Cannot call method 'indexOf' of undefined" when using Google Chrome (*googlechrome) as Selenium RC target
CC BY-SA 2.5
0
2011-02-13T22:30:38.507
2011-12-06T19:16:55.310
2011-02-14T16:31:49.337
403,661
403,661
[ "google-chrome", "selenium", "selenium-rc", "selenium-grid" ]
4,987,594
1
4,987,638
null
0
253
![Screen Shot of what im not trying to do](https://i.stack.imgur.com/WUhBp.png) My code for above view is: ``` -(void)viewWillAppear:(BOOL)animated{ float yh = 0; while (yh<200) { //UIView CGRect myFrame = CGRectMake(0, yh, 320, 30); UIView *myFirstView = [[UIView alloc] initWithFrame:myFrame]; myFirstView.backgroundColor = [UIColor orangeColor]; //IUILabel in UIView CGRect mylblFrame = CGRectMake(5, yh, 60, 15); UILabel *lblsize = [[UILabel alloc] initWithFrame:mylblFrame]; lblsize.text = @"Hello"; [myFirstView addSubview:lblsize]; CGRect mylbl_hi = CGRectMake(80, yh, 60, 15); UILabel *lbl_hi = [[UILabel alloc] initWithFrame:mylbl_hi]; lbl_hi.text = @"Hii"; [myFirstView addSubview:lbl_hi]; [self.view addSubview:myFirstView]; [lbl_hi release]; [lblsize release]; [myFirstView release]; yh=yh+40; } [super viewWillAppear:YES]; } ``` I can't understand reason of it being like this...i wanted labels to be attached with my subviews of orange color...this may be odd day for me to understand what's wrong with my code...if any of you can tell me where i ma doing wrong would be great to me. This is my first time creating view programmatically..so please excuse me if all this is silly question
Dynamically creating subviews of similar type
CC BY-SA 2.5
null
2011-02-13T23:21:01.487
2011-02-13T23:32:21.707
null
null
459,000
[ "iphone", "uiview" ]
4,987,700
1
4,990,061
null
1
364
I want to select number 4 or 5 links i have tried using this expression: ``` //div/b[contains(text(),'Sida:')]/following-siblings::a[4] ``` but it didnt work The code for this part of my HTML is: ``` <div><b>Sida: </b> <a>1</a> « <a>3</a> <a>4</a> <a>5</a> » <a>814</a></div> ``` Here is how its looks ![Link picture](https://i.stack.imgur.com/rFmug.jpg) [http://i.stack.imgur.com/rFmug.jpg](https://i.stack.imgur.com/rFmug.jpg)  1   2   3   4 »  814  or  1  «  3   4   5  »  814  there are a long html page without any id or class name - so i need autopager in firefox to find the correct link `<a>` and automatically auto inert next page i just need the expression to pinpoint the number 4 or 5 - but these number are changing when page number are changing check the web page [l-like.it](http://l-like.it/?r=1)
How can I select links without id or class attributes using XPath?
CC BY-SA 2.5
null
2011-02-13T23:45:14.007
2011-02-14T14:54:46.950
2011-02-14T14:54:46.950
null
615,541
[ "html", "select", "xpath", "find" ]
4,988,144
1
4,988,163
null
6
4,716
I am kinda stuck about this problem. How can I get the month calendar saturday values when i selected a specific date. For example: i selected February 14 on the month calendar. After selecting it there will be a prompt which contains Saturday "February 19, 2011" or i selected February 24, The prompt will display "February 26 2011". ![enter image description here](https://i.stack.imgur.com/RJHkr.jpg)
Get saturday date value from a selected week using a month calendar
CC BY-SA 2.5
0
2011-02-14T01:33:18.263
2013-01-18T07:09:13.577
null
null
586,811
[ "c#", "winforms", "monthcalendar" ]
4,988,135
1
4,988,200
null
8
2,036
I saw Scott Guthrie's post about helper methods via [his blog](http://weblogs.asp.net/scottgu/archive/2010/07/02/introducing-razor.aspx). Specifically this: ![](https://weblogs.asp.net/blogs/scottgu/image_5F279E5C.png) I see the bunch of RC version of MVC 3 posts about the lack of helper methods... I see the syntactical support for it (`@helper`) gets highlighted, but I have this in `/Views/Helpers/SomeHelper.cshtml` (defined as a partial view): ``` @helper SomeHelper(string text) { if (text != null) { <text> @text </text> } else { <text> Unknown </text> } } ``` I use it this way: ``` <div> Helper with Text: @SomeHelper("This is not null text.") </div> ``` But I get SomeHelper is not defined.... so where did I mess this up? Is there something I need to do to register these views as helpers? Thanks.
Declarative Helper Methods in Razor RTM
CC BY-SA 2.5
0
2011-02-14T01:31:13.707
2011-07-29T17:01:20.500
2017-02-08T14:31:31.657
-1
231,716
[ ".net", "asp.net", "razor", "asp.net-mvc-3" ]
4,988,255
1
5,003,277
null
0
473
I have rendered a very rough model of a molecule that consists of 7 helices and would like to ask if there is anyway possible to allow the helices themselves to tilt (rotate) in certain ways so as to interact with one another. For clarity, I insert an image of my program output (although for an orthographic projection, so it appears as the projection of a 3D helix onto a 2D plane). ![enter image description here](https://i.stack.imgur.com/bfaXs.jpg) I have included the code for rending a single helix (all others are the same). Would it be useful to store the geometry of my objects in vertex arrays instead of rendering them each time separately for the 7 different colors? (Each helix consists of 36,000 vertices and I am concerned that the arrays might get large enough to cause serious performance issues?) I understand the matrix stack is the data structure for performing multiple consecutive individual transformations on particular objects, but I not sure how exactly to specify so that an entire one of my helices can tilt? (glRotatef does not actually tilt the helices for some reason) ``` /*HELIX RENDERING*/ glLoadIdentity(); glMatrixMode(GL_MODELVIEW); glPushMatrix(); glTranslatef(0.0, 100.0, -5.0); //Move Position glRotatef(90.0, 0.0, 0.0, 0.0); glBegin(GL_LINE_STRIP); for(theta = 0.0; theta <= 360.0; theta += 0.01) { x = r*(cosf(theta)); y = r*(sinf(theta)); z = c*theta; glVertex3f(x,y,z); glColor3f(1.0, 1.0, 0.0); } glEnd(); glPopMatrix(); ```
Defining and Manipulating a 3D Object with Specific Rotations
CC BY-SA 2.5
null
2011-02-14T02:07:15.337
2011-02-15T11:50:53.387
null
null
610,084
[ "opengl" ]
4,988,271
1
4,988,683
null
15
1,079
Given rectangles r[ ] inside of larger rectangle R, is there an optimal speedy algorithm for determining the minimum number of rectangles that fill in the "[negative space](https://i.stack.imgur.com/rnboe.png)" between r[ ]? For example, given these three blue rectangles inside of the purple rectangle: ![three blue rectangles inside of a purple rectangle](https://i.stack.imgur.com/rnboe.png) How could I quickly determine a list of rectangles like these in green below (which may not be the optimal configuration, hence my post): ![green rectangles in between the blue rectangles](https://i.stack.imgur.com/6ORMH.png)
optimal negative space between rectangles algorithm?
CC BY-SA 2.5
0
2011-02-14T02:11:11.667
2011-02-14T23:54:12.867
2011-02-14T02:17:34.157
62,255
62,255
[ "algorithm", "language-agnostic", "geometry" ]
4,988,417
1
4,988,490
null
4
11,963
Everytime I try to navigate to a JS file on Firefox I get a save-as dialog. I would like to just be able to view the source in the actual browser and not have to download and open the file in another editor. Is there any way I can force Firefox to view the files? EDIT here's a snapshot: ![snapshot](https://i.stack.imgur.com/UfXb4.jpg)
View js files in firefox
CC BY-SA 3.0
0
2011-02-14T02:44:22.353
2018-11-14T16:43:42.640
2011-06-23T01:09:21.983
13,295
465,546
[ "javascript", "firefox", "save-as" ]
4,988,437
1
4,988,754
null
1
4,785
I have a code in java. ``` package interfaces; import javax.swing.JPanel; public class TabbedPaneDemo extends JPanel { public TabbedPaneDemo() { JTabbedPane pane = new JTabbedPane(); JPanel dashboardPanel = new JPanel(); dashboardPanel.add(new JLabel("Dashboard")); // Add Dashboard Tab pane.addTab("Dashboard", dashboardPanel); JPanel transactionPanel = new JPanel(); transactionPanel.add(new JLabel("Transactions")); // Add Transactions Tab pane.addTab("Transactions", transactionPanel); JPanel accountPanel = new JPanel(); accountPanel.add(new JLabel("Account")); // Add Account Tab pane.addTab("Account", accountPanel); this.setLayout(new BorderLayout()); this.setPreferredSize(new Dimension(400, 200)); this.add(pane, BorderLayout.CENTER); } public static void main(String[] args) { JPanel panel = new TabbedPaneDemo(); panel.setOpaque(true); // panel.setBounds(12, 12, 45, 98); JFrame frame = new JFrame("JTabbedPane Demo"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setContentPane(panel); frame.pack(); frame.setVisible(true); }} ``` and the output it's ! ![enter image description here](https://i.stack.imgur.com/9gVld.png) I want to change in this code to be like this. ![enter image description here](https://i.stack.imgur.com/sf6Ph.png) I want to use an absolute layout (null). I want to add menu, buttons and labels with these tabs ... How can I do??
Add JTabbedPane with buttons, labels ... in a frame with an absolute layout
CC BY-SA 4.0
0
2011-02-14T02:49:40.317
2021-04-10T17:36:33.687
2021-04-10T17:36:33.687
604,156
604,156
[ "java", "swing", "layout", "jtabbedpane", "null-layout-manager" ]
4,988,570
1
4,988,590
null
7
4,036
I have a layout with 3 button at the top in a row and then a ListView followed by a button below the listView. This is my layout.xml file ``` <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content"> <Button android:id="@+id/btn_top10" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="TOP 10"/> <Button android:id="@+id/btn_top100" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="TOP 100" android:layout_toRightOf="@id/btn_top10"/> <Button android:id="@+id/btn_showAll" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Show All" android:layout_toRightOf="@id/btn_top100"/> <ListView android:id="@+id/LV_Device" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/btn_top10" android:layout_above="@id/LV_Device"/> <Button android:id="@+id/btn_clearResult" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Clear Results" android:layout_below="@id/LV_Device"/> </RelativeLayout> ``` This will give a result like this ![enter image description here](https://i.stack.imgur.com/fCV5W.png) If i add some values to the ListView then its ok, the button below will be show ![enter image description here](https://i.stack.imgur.com/yA2XV.png) But if the listview becomes larger than the screen size then the button below that will not be visible even after scrolling to the bottom of the listView ![enter image description here](https://i.stack.imgur.com/5WM5I.png) How to solve this issue?? I don't want button to be fixed at the bottom of the screen. I want the button to be show at the end of the ListView only
Missing Button Placed after ListView
CC BY-SA 2.5
0
2011-02-14T03:21:44.647
2012-09-11T12:57:45.443
null
null
466,474
[ "android", "listview", "android-layout" ]
4,988,658
1
4,988,725
null
0
875
I have a model as follows: ``` namespace Q01.Models { public enum Sex { Male, Female } public class Person { public string Name { get; set; } public Sex? Sex { get; set; } } } ``` A utilities class to obtain a `SelectList` object to populate a `DropDownListFor` is defined as follows: ``` using System; using System.Linq; using System.Web.Mvc; namespace Q01.Utilities { public static class Utilities { public static SelectList EnumToSelectList<TEnum>(this TEnum? obj) where TEnum: struct { var values = from TEnum x in Enum.GetValues(typeof(TEnum)) select new { Value = x, Text = x }; return new SelectList(values, "Value", "Text"); } } } ``` I create a templated helper named `Sex.cshtml` for the type of `Sex` as follows: ``` @using Q01.Utilities @using Q01.Models @model Sex? @Html.DropDownListFor(x => x, Model.EnumToSelectList(), "--Select--") ``` In `HomeController`, I create an instance of `Person` and pass it to the view as follows: ``` using System.Web.Mvc; using Q01.Models; namespace Q01.Controllers { public class HomeController : Controller { public ActionResult Create() { Person p = new Person(); p.Sex = Sex.Female; return View(p); } } } ``` And the corresponding view is declared as follows: ``` @using Q01.Utilities @model Q01.Models.Person @using (Html.BeginForm()) { <div>Using Sex.cshtml: @Html.EditorFor(x => x.Sex)</div> <div>Not using Sex.cshtml: @Html.DropDownListFor(x => x.Sex, Model.Sex.EnumToSelectList(), "--Select--")</div> } ``` The screenshot of the output is shown as follows: ![enter image description here](https://i.stack.imgur.com/OmNbD.png) The question is: why the `Sex.cshtml` does not reflect the model? It should select `Female` rather than "--Select--".
My templated helper using a DropDownListFor does NOT reflect the model of enum. Why?
CC BY-SA 2.5
0
2011-02-14T03:45:04.713
2011-02-14T04:00:01.120
null
null
596,314
[ "asp.net-mvc", "asp.net-mvc-3" ]
4,989,418
1
4,991,186
null
1
268
I wanted to write a LINQ query based on the SQL below. Basically this strategy seems really confusing - why start from MerchantGroupMerchant and do 2 'from' statements? Is there a simpler way to write this LINQ query? ``` var listOfCampaignsMerchantIsInvolvedIn = (from merchantgroupactivity in uow.MerchantGroupActivities from merchantgroupmerchant in uow.MerchantGroupMerchants where merchantgroupmerchant.MerchantU.Id == merchantUIDGuid select new { merchantgroupactivity.ActivityU.CampaignU.Id }).Distinct(); ``` Here is the table structure: ![enter image description here](https://i.stack.imgur.com/kliE8.png) and the SQL: ``` SELECT DISTINCT Campaign.ID FROM Campaign INNER JOIN Activity ON ( Campaign.CampaignUID = Activity.CampaignUID ) INNER JOIN MerchantGroupActivity ON ( Activity.ActivityUID = MerchantGroupActivity.ActivityUID ) INNER JOIN MerchantGroup ON ( MerchantGroup.MerchantGroupUID = MerchantGroupActivity.MerchantGroupUID ) INNER JOIN MerchantGroupMerchant ON ( MerchantGroupMerchant.MerchantGroupUID = MerchantGroup.MerchantGroupUID ) INNER JOIN Merchant ON ( Merchant.MerchantUID = MerchantGroupMerchant.MerchantUID ) WHERE Merchant.ID = 'M1' ```
Writing a LINQ query to traverse many tables
CC BY-SA 2.5
null
2011-02-14T06:27:39.860
2011-02-14T10:41:30.693
2011-02-14T10:41:30.693
26,086
26,086
[ "linq", "linq-to-sql" ]
4,989,530
1
4,989,606
null
0
377
I want to restrict the user if they select the language which is already selected by displaying alert msg using JQuery. Is there any event which fires before the change event. ![enter image description here](https://i.stack.imgur.com/2cWlm.png)
JQuery help needed: Which event fires in combobox before the change event
CC BY-SA 2.5
null
2011-02-14T06:46:05.417
2011-06-14T16:48:13.807
2011-02-14T06:53:11.650
503,125
503,125
[ "jquery", "asp.net", "combobox", "drop-down-menu" ]
4,989,660
1
4,989,965
null
4
7,111
I am trying to use mercurial in eclipse. I downloaded mercurial eclipse plugin for this. But, despite I had reinstalled it many times, it gives the same error, I put the screenshot below. ![Mercurial for Eclipse error message](https://i.stack.imgur.com/Y6JZq.png) ``` Checking encoding (cp1254)... Checking extensions... Checking templates... Checking patch... Checking commit editor... Can't find editor 'notepad' in PATH (specify a commit editor in your configuration file) Checking username... 1 problems detected, please check your install!. Command line: hg -y debuginstall ``` I do not know how to handle this. Any help will be appreciated very much, thank you.
Mercurial Eclipse Error
CC BY-SA 2.5
0
2011-02-14T07:12:22.100
2015-10-21T21:33:20.333
2011-02-14T08:06:39.297
6,309
568,086
[ "eclipse", "mercurial" ]
4,989,668
1
5,108,916
null
16
6,848
It took me quite some time but I finally managed to make it work for my project. To create the "logic" tests I followed [Apple guidelines on creating logic tests](https://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/iphone_development/135-Unit_Testing_Applications/unit_testing_applications.html%23//apple_ref/doc/uid/TP40007959-CH20-SW9). This works fine once you understand that the logic tests are run during build. To be able to debug those tests it is required to create a custom executable that will call those tests. The article by [Sean Miceli on the Grokking Cocoa blog](http://www.grokkingcocoa.com/how_to_debug_iphone_unit_te.html) provides all the information to do this. Following it however did not yield immediate success and needed some tweaking. I will go over the main steps presented in Sean's tutorial providing some "for dummies" outline which took me some time to figure out: 1. Setup a target that contains the unit tests but DOES NOT run them 2. Setup the otest executable to run the tests 3. Setup the otest environment variables so that otest can find your unit tests The following was performed with ## Note for XCode 4 In XCode 4 it is possible to debug your unit tests DIRECTLY. Just write your test, add it to your target as one of the tests and set a breakpoint in it. That's all. More will come. ## Step 1 - Setting up the target 1. Duplicate your unit tests target located under your project Targets. This will also create a duplicate of your unit tests product (.octest file). In the figure below "LogicTest" is the original target. 2. Rename both the unit tests target and the unit tests product (.octest file) to the same name. In the figure below "LogicTestsDebug" is the duplicate target. 3. Delete the RunScript phase of the new target The name of both can be anything but I would avoid spaces. ![enter image description here](https://i.stack.imgur.com/CRUT2.png) ## Step 2 - Setting up otest The most important point here is to get the correct otest, i.e. the one for your current iOS and not the default Mac version. This is well described in Sean's tutorial. Here are a few more details which helped me setting things right: 1. Go Project->New Custom Executable. This will pop open a window prompting you to enter an Executable Name and an Executable Path. 2. Type anything you wish for the name. 3. Copy paste the path to your iOS otest executable. In my case this was /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/Developer/usr/bin/otest 4. Press enter. This will bring you to the configuration page of your executable. 5. The only thing to change at this point is to select "Path Type: Relative to current SDK". Do not type in the path, this was done at step 3. ## Step 3 - Setting up the otest arguments and environment variables The otest arguments are straightforward to setup... But this proved to be my biggest problem. I initially had named my logic test target "LogicTests Debug". With this name and "LogicTests Debug.octest" (with quotes) as argument to otest I kept having otest terminating with exit code 1 and NEVER stopping into my code... : no space in your target name! The arguments to otest are: 1. -SenTest Self (or All or a test name - type man otest in terminal to get the list) 2. {LogicTestsDebug}.octest - Where {LogicTestsDebug} needs to be replaced by your logic test bundle name. Here is the list of environment variables for copy/pasting: - - - - - - - Note that I also tried the DYLD_FORCE_FLAT_NAMESPACE but this simply made otest crash. ![enter image description here](https://i.stack.imgur.com/9vUFc.png) ## Step 4 - Running your otest executable To run your otest executable and start debugging your tests you need to: 1. Set your active target to your unit test target (LogicTestsDebug in my case) 2. Set your active executable to your otest executable You can build and run your executable and debug your tests with breakpoints. As a side note if you are having problems running your otest executable it can be related to: 1. Faulty path. I had lots of problem initially because I was pointing to the mac otest. I kept crashing on launch with termination code 6. 2. Faulty arguments. Until I removed the space from bundle (.octest) name I kept having otest crash with exit code 1. 3. Wrong path in environment variables. Sean tutorial has lots of follow-up questions giving some insight on what other people tried. The set I have now seems to work so I suggest you start with this. You may get some message in the console which might lead you to think something is wrong with your environment variables. You may notice a message regarding CFPreferences. This message is not preventing the tests from running properly so don't focus on it f you have problems running otest. ![enter image description here](https://i.stack.imgur.com/VfGPE.png) Last once everything is working you will be able to stop at breakpoints in your tests. ![enter image description here](https://i.stack.imgur.com/hntDM.png) ## One last thing... I've read on many blogs that the main limitation of the integrated XCode SenTestKit is that tests cannot be run while building the application. Well as it turns out this is in fact quite easy to manage. You simply need to add your Logic tests bundle as a dependency to your application project. This will make sure your logic tests bundle is built, i.e. all tests are run, before your application is built. To do this you can drag and drop your logic test bundle onto your application target. ![enter image description here](https://i.stack.imgur.com/GxY92.png)
How to run and debug unit tests for an iPhone application
CC BY-SA 3.0
0
2011-02-14T07:13:48.717
2014-10-13T08:31:17.707
2014-10-13T08:31:17.707
235,206
235,206
[ "iphone", "xcode", "ios", "unit-testing", "ocunit" ]
4,989,976
1
null
null
1
5,635
This is my query ``` SELECT currency_code, SUM( CASE WHEN TYPE = 'buy' THEN to_amount END ) AS BUY, SUM( CASE WHEN TYPE = 'sell' THEN to_amount END ) AS SELL, SUM( CASE WHEN TYPE = 'sell' THEN rate END ) AS SELL_RATE, SUM( CASE WHEN TYPE = 'buy' THEN rate END ) AS BUY_RATE FROM tb_currency LEFT JOIN tb_bill ON tb_currency.CURRENCY_ID = tb_bill.CURRENCY_ID AND tb_bill.TYPE IN ( 'buy', 'sell' ) ``` The output is ![enter image description here](https://i.stack.imgur.com/ThqI5.jpg) Right now i want to divide the value in the field with the value in the field. I tried with several query before and got error message 'Unknown column type BUY'. How to solve this?
how to divide using mysql query
CC BY-SA 2.5
null
2011-02-14T08:08:02.150
2013-06-23T07:01:23.887
null
null
417,899
[ "mysql" ]
4,989,970
1
null
null
7
4,388
I've defined a simple grammar in [Irony](http://irony.codeplex.com/), and generated a nice compact AST. ![](https://i.stack.imgur.com/fyFmr.png) Now I'm trying to figure out how to evaluate it. Problem is, I can't find any tutorials on how to do this. I've defined just 2 AST nodes: ``` class TagListNode : AstNode { public override void Init(ParsingContext context, ParseTreeNode treeNode) { base.Init(context, treeNode); AsString = "TagList"; foreach (var node in treeNode.ChildNodes) AddChild(null, node); } public override void EvaluateNode(Irony.Interpreter.EvaluationContext context, AstMode mode) { foreach (var node in ChildNodes) node.EvaluateNode(context, AstMode.Read); } } class TagBlockNode : AstNode { public AstNode Content; public override void Init(ParsingContext context,ParseTreeNode treeNode) { base.Init(context, treeNode); AsString = treeNode.ChildNodes[0].FindTokenAndGetText(); Content = AddChild(null, treeNode.ChildNodes[1]); } public override void EvaluateNode(EvaluationContext context, AstMode mode) { context.Write(string.Format("<{0}>", AsString)); Content.EvaluateNode(context, AstMode.Read); context.Write(string.Format("</{0}>", AsString)); } } ``` This will generate the following output: ``` <html><head><title></title></head><body><h1></h1><p></p><p></p></body></html>3.14159265358979 ``` Whereas the output I want is: ``` <html> <head> <title>page title</title> </head> <body> <h1>header</h1> <p>paragraph 1</p> <p>3.14159265358979</p> </body> </html> ``` I don't think I'm supposed to be using `Context.Write()`. The samples show pushing stuff onto `context.Data` and popping them off... but I'm not quite sure how that works. I'm guessing `pi` gets tacked on at the end because it's automatically pushed onto `context.Data` and then one element is popped off at the end?? I'm not really sure. Some pointers or a link to a tutorial would be nice. Also, how am I supposed to handle the different node types? Each "Tag" can have 4 different types of content: another tag, a string literal, a variable, or a number. Should I be writing things like `if(node is StringLiteral) ....` in the `EvaluateNode` method or what? --- I've found [this one](http://www.codeproject.com/KB/recipes/YourFirstDSL.aspx) but they just loop over the AST and don't take advantage of `EvaluateNode`. And then [this one](http://intellect.dk/post/Writing-a-calculator-in-C-using-Irony.aspx) which a single value in the data stack...but doesn't really explain how this gets outputted or anything. --- `EvaluateNode``Irony.Ast.AstNode` --- Okay, I've traced that tidbit at the end to this line: ``` if (EvaluationContext.HasLastResult) EvaluationContext.Write(EvaluationContext.LastResult + Environment.NewLine); ``` Which is included in the default evaluation routine....perhaps it works well for a calculator app, but not so much in mine. Trying to figure out how to bypass the script interpreter now, but then I don't know how to set the globals.
Irony: Tutorial on evaluating AST nodes?
CC BY-SA 2.5
0
2011-02-14T08:06:19.237
2011-02-14T18:20:10.930
2011-02-14T18:20:10.930
65,387
65,387
[ "c#", "irony" ]
4,990,057
1
4,990,166
null
6
11,009
I would like to put text and clickable icons in the headers in my panels, like this: ![enter image description here](https://i.stack.imgur.com/Kk6rv.png) I've found some [old hacks from 2008 to do this](http://www.sencha.com/forum/showthread.php?41156-Buttons-on-panel-header&p=194506), but can imagine that the newer versions of ExtJS allow you to put text and icons in panel headers in a more straightforward way. # Addendum thanks @Stefan that worked, here's my solution: ![enter image description here](https://i.stack.imgur.com/CU5Wt.png) ``` var grid_shopping_cart = new Ext.grid.GridPanel({ headerCfg: { tag: 'div', cls: 'x-panel-header', children: [ { tag: 'div', cls: 'panel_header_main', 'html': 'Shopping Cart' }, { tag: 'div', cls: 'panel_header_icon1', 'html': '<img src="images/icon_plus.png" />' }, { tag: 'div', cls: 'panel_header_extra', 'html': 'Order Number: 2837428347' } ] }, width: 600, height: 390, ... listeners: { 'afterrender' : function(p) { p.header.on('click', function(e, h) { alert('you clicked the plus'); }, p, { delegate: '.panel_header_icon1', stopEvent: true }); }, ... ``` ``` div.panel_header_main { text-align: left; float: left; } div.panel_header_extra { text-align: left; float: right; margin-right: 10px; } div.panel_header_icon1 { text-align: right; float: right; margin-left: 3px; cursor: hand; cursor: pointer; } div.panel_header_icon2 { text-align: right; float: right; margin-left: 3px; cursor: hand; cursor: pointer; } ```
How to put text and clickable icons in a Ext.Panel header?
CC BY-SA 2.5
0
2011-02-14T08:21:29.843
2012-12-17T17:47:43.643
2011-02-14T09:47:11.813
4,639
4,639
[ "javascript", "extjs" ]
4,990,325
1
5,020,033
null
0
388
Somewhat obscure problem. Only occures in Internet Explorer. Perhaps someone familiar with this type of issue? As visible in the screenshot, the Context menu appears under the h:panelgrid on the right. ![A Picture Example of the problem](https://i.stack.imgur.com/b5HqT.png) I tried to add style="z-index:1500;". Didn't help...
rich:contextmenu appears under another component in Internet Explorer.
CC BY-SA 3.0
null
2011-02-14T09:01:43.050
2014-05-08T19:46:22.767
2014-05-08T19:46:22.767
1,566,164
128,076
[ "jsf", "richfaces" ]
4,990,529
1
null
null
20
27,640
I'm trying to get my app to blend in as much as possible with the "standard" with the rest of my android device. It's a stand-alone app, not integrated with the OS or anything, I just want it to look familiar. The area I'm interested in is the "settings" screen. If I look at Android's standard settings screen, it's well spaced, perfect font size, with neat pin stripes between the menu items. How do I do that? Is that a ListView? Is it done with a regular LinearLayout? I would love to be able to replicate the look & feel in my app. Can anybody assist? ![enter image description here](https://i.stack.imgur.com/MFLho.png) And it's not just the Adroid OS. it's most of the "professional" apps out there: ![enter image description here](https://i.stack.imgur.com/TZfNW.png) Many thanks
Android: A good looking (standard) settings menu
CC BY-SA 2.5
0
2011-02-14T09:25:01.273
2014-06-05T05:03:59.300
2011-02-14T11:15:13.347
181,098
181,098
[ "android", "user-interface" ]
4,990,578
1
4,997,619
null
0
281
I am developing one facebook application, which i hav to use in my project to fetch images from user's account, ![enter image description here](https://i.stack.imgur.com/FUw2K.jpg) Now everything is working fine, i am able to login, this window comes for the first time to asking for permission (allow), but it's only asking for "Access my basic information" I want to ask u , how to make it access "Access my photos and videos", coz when the application will ask for this second permission, then only i'll b able to fetch the images from someone's account in to my flex application If any one for you has devloped the same application , so please mail me the project archive, coz ma project is about to deliver, and this thing is stopping it Thanx in advance Ankur
facebook permissions for images in flex application
CC BY-SA 2.5
null
2011-02-14T09:30:51.043
2011-02-14T21:43:11.260
null
null
340,116
[ "flash", "apache-flex", "actionscript-3", "flex3", "flex4" ]
4,991,167
1
5,037,355
null
23
3,425
When testing performance of various web pages on my web application I noticed that there are some gaps in net tab (waterfall chart) in firebug. In some cases these may take up half of the time for the whole request. What usually causes these gaps and how can they be removed? ![enter image description here](https://i.stack.imgur.com/1BDAR.png)
Gaps in FireBug waterfall chart
CC BY-SA 2.5
0
2011-02-14T10:40:00.110
2017-02-27T20:57:43.170
null
null
221,291
[ "firebug" ]
4,991,204
1
null
null
0
2,206
I installed IE9, but it is impossible to turn off ClearType. So I removed IE9, and now in my IE8 I can't turn off ClearType, because checkbox is always disable: ![enter image description here](https://i.stack.imgur.com/S7Vx4.jpg) Please help, what can I do?
IE 8/9 ClearType problem
CC BY-SA 2.5
null
2011-02-14T10:44:12.973
2011-03-18T13:03:42.083
null
null
206,330
[ "internet-explorer", "internet-explorer-8", "cleartype" ]
4,991,260
1
8,065,852
null
41
6,344
How do I hide the annoying yellow box that appears under html fields when I hover over elements in the Chrome "Developer Tools" elements panel - it's driving me nuts as I can't see the bottom of my labels etc... ![See example image](https://i.stack.imgur.com/HnIV8.jpg)
Chrome "Developer Tools" element - hide annoying yellow dimensions box
CC BY-SA 2.5
0
2011-02-14T10:50:32.317
2015-10-17T16:44:50.060
2011-02-14T10:51:54.693
15,410
491,950
[ "google-chrome", "google-chrome-devtools" ]
4,991,318
1
null
null
3
14,774
I have this job in Talend that is supposed to retrieve a field and loop through it. My big problem is that the code is looping through the XML fields but it's returning null. Here is a sample of the XML: ``` <?xml version="1.0" encoding="ISO-8859-1"?> <empresas> <empresa> <imoveis> <imovel> [-- some fields -- ] <fotos> <nome id="" order="">photo1</nome> <nome id="" order=""></nome> <nome id="" order=""></nome> <nome id="" order=""></nome> </fotos> </imovel> [ -- other entries here -- ] </imoveis> </empresa> </empresas> ``` Now using the tExtractXMLField component I am trying to get the "fotos" element. Here is what I have in the component: ![enter image description here](https://i.stack.imgur.com/0jZsr.png) I have tried to change the XPath query and the XPath loop query but the result is either I don't loop through the field or I get the null in the value field in the tMap. Here is an image of the job: ![enter image description here](https://i.stack.imgur.com/zTceh.png) You can see that I have retrieved 4 items from the XML but what I get is null in the "nome" field. There must be something wrong with the XPath but I can't seem to find the problem :( Hope someone can help me out. Thanks Notes: I am using talendv4.1.2 on ubuntu 10.10 64bit
Talend tExtractXMLField
CC BY-SA 3.0
null
2011-02-14T10:56:18.303
2016-01-03T08:18:24.767
2011-09-30T07:43:14.633
505,893
8,715
[ "java", "xml", "xpath", "talend" ]
4,991,460
1
4,999,587
null
0
494
I am making some custom tabs in asp.net. I am also using jquery, however I am overriding the default tab look. I ran into a small problem where a div() I placed after an unordered list appears further down after the information related to a tab. Please look at the diagram below : ![enter image description here](https://i.stack.imgur.com/u91K9.jpg) In the I have my left curve section of the menu and then in I have a repeating 1 pixel picture and finally at I have the right curve section of my menu BUT it appears way , towards the left side of the button. Any ideas to make the picture in the Actual appear in the position. Thanks Here is my code: html ``` <div id="tabs"> <div id="left-side"> </div> <ul class="tab-menu"> <li><a href="<%= Url.Action("GetHomeTab", "Home") %>" class="a"><b> <div id="home" class="menu"> </div> </b></a></li> <li><a href="<%= Url.Action("GetProductTab", "Home") %>" class="a"><b> <div id="dates-and-location" class="menu"> </div> </b></a></li> <li><a href="<%= Url.Action("GetContactUsTab", "Home") %>" class="a"><b> <div id="tariff" class="menu"> </div> </b></a></li> <li><a href="<%= Url.Action("GetHomeTab", "Home") %>" class="a"><b> <div id="customer-information" class="menu"> </div> </b></a></li> <li><a href="<%= Url.Action("GetContactUsTab", "Home") %>" class="a"><b> <div id="rates-and-charges" class="menu"> </div> </b></a></li> <li><a href="<%= Url.Action("GetProductTab", "Home") %>" class="a"><b> <div id="payments-and-vouchers" class="menu"> </div> </b></a></li> <li><a href="<%= Url.Action("GetProductTab", "Home") %>" class="a"><b> <div id="delivery-and-collection" class="menu"> </div> </b></a></li> <li><a href="<%= Url.Action("GetContactUsTab", "Home") %>" class="a"><b> <div id="general" class="menu"> </div> </b></a></li> <li><a href="<%= Url.Action("GetProductTab", "Home") %>" class="a"><b> <div id="equipment-and-other-drivers" class="menu"> </div> </b></a></li> <li><a href="<%= Url.Action("GetProductTab", "Home") %>" class="a"><b> <div id="vehicle-information" class="menu"> </div> </b></a></li> <li><a href="<%= Url.Action("GetContactUsTab", "Home") %>" class="a"><b> <div id="customer-preferences" class="menu"> </div> </b></a></li> <li><a href="<%= Url.Action("GetProductTab", "Home") %>" class="a"><b> <div id="customer-statistics" class="menu"> </div> </b></a></li> </ul> <div id="right-side"> </div> </div> ``` --- related css for the #right-side ``` #tabs #right-side { background-image: url('../Content/images/right_side.png'); background-repeat: no-repeat; background-position: right 8px; height: 50px; width: 7px; float: left; } ```
My div goes further down the tab menus in asp.net mvc2 application
CC BY-SA 2.5
null
2011-02-14T11:11:02.950
2011-02-15T03:17:11.537
null
null
350,648
[ "jquery", "html", "css", "asp.net-mvc-2" ]
4,991,618
1
4,991,803
null
0
328
Hey, I am working on [my new site](http://flowdev.co.uk/). There is not much there yet but I have noticed in Chrome that on the first view of the page, so before refreshing, the social networking div drops down as if it has `clear: both` applied to it. As soon as you refresh it is fine. It only seems to happen in Chrome too? Can anyone think of a reason why? Any suggestions or ideas will be much appreciated. Thanks. Here it is before refreshing. ![enter image description here](https://i.stack.imgur.com/TmoTM.png) And here it is after refreshing looking how it should. It only happens in Chrome for me. ![enter image description here](https://i.stack.imgur.com/XB7PY.png)
DIV dropping down occasionally?
CC BY-SA 2.5
null
2011-02-14T11:27:45.560
2011-02-14T11:50:59.583
2011-02-14T11:41:04.817
455,137
455,137
[ "css", "html" ]
4,991,711
1
4,991,784
null
2
352
I have database with 3 tables as follows: ![enter image description here](https://i.stack.imgur.com/VAswt.png) From within Visual Web Developer 2010 Express, I create an EF model using Entity Data Model Wizard. I select the 3 tables. Unfortunately, the resulting EF model does not contain the junction table, i.e., `QuestionsTags` table. The following figure shows the EF model diagram. ![enter image description here](https://i.stack.imgur.com/9NvvL.png) My question: Why cannot the Entity Data Model Wizard work for many-many related tables?
Why cannot the Entity Data Model Wizard work for many-many related tables?
CC BY-SA 2.5
null
2011-02-14T11:40:35.910
2011-02-14T11:58:08.287
null
null
596,314
[ "entity-framework", "entity-framework-4" ]
4,991,890
1
4,993,379
null
2
1,704
I would like to put in my map on site something similar like on this [site](http://www.apartmentfinder.com/Georgia/Atlanta-Apartments) ![enter image description here](https://i.stack.imgur.com/4PUCH.jpg) When choose Personalize Your Search, I need to get gps of circle center and zoom and radius. How could I achieve this? All help is appreciated.
Put movable circle over google map and get center position and radius
CC BY-SA 2.5
null
2011-02-14T11:59:22.570
2011-11-11T20:59:55.293
2011-02-14T12:04:26.800
45,664
486,578
[ "javascript", "jquery", "google-maps" ]
4,991,962
1
4,992,008
null
2
1,299
I using below codes to print in java: ``` String NAME="ABC"; int FONT_SIZE=100; BufferedImage image = new BufferedImage(400, 300, BufferedImage.TYPE_INT_RGB); Graphics g = image.getGraphics(); g.setColor(new Color(255,255,255)); g.fillRect(0, 0, image.getWidth(), image.getHeight()); g.setColor(new Color(0,0,0)); g.setFont(new Font("arial", Font.PLAIN ,FONT_SIZE)); g.drawString(NAME,FONT_SIZE,FONT_SIZE); g.dispose(); //write to file ByteArrayOutputStream out = new ByteArrayOutputStream(); ImageIO.write(image, "PNG", out); byte[] byteArray = out.toByteArray(); bytesToFile(byteArray,"D:/temp/pic/text/text.jpg"); ``` I get result image: ![enter image description here](https://i.stack.imgur.com/KETGG.png) how can I get this "feather effect" in java? (or any others java library) thanks for help :)
how can I get "feather effect" using java 2D?
CC BY-SA 2.5
null
2011-02-14T12:06:21.307
2011-02-14T13:31:30.450
null
null
165,589
[ "java", "java-2d" ]
4,991,968
1
4,992,657
null
1
693
I have a FormPanel that looks like this: ![enter image description here](https://i.stack.imgur.com/L9VNp.png) I now want to display the same form but so that the data is merely instead of editable, i.e. instead of in textboxes, the data is simply displayed as text. I can change the defaultType from to but then the data isn't displayed at all. ``` var simple_form = new Ext.FormPanel({ labelWidth: 75, frame:true, title: 'Customer Information', bodyStyle:'padding:5px 5px 0', width: 600, height: 600, autoScroll: true, defaults: {width: 230}, defaultType: 'textfield', items: [{ fieldLabel: 'Item 1', name: 'item1', allowBlank:false, value: 'test' },{ fieldLabel: 'Item 2', name: 'item2', value: 'test' },{ fieldLabel: 'Item 3', name: 'item3', value: 'test' }, { fieldLabel: 'Item 4', name: 'item4', value: 'test' ... ```
How can I make the data in a FormPanel display as text instead of in input boxes?
CC BY-SA 2.5
null
2011-02-14T12:07:18.107
2011-02-14T13:25:10.687
null
null
4,639
[ "javascript", "extjs" ]
4,992,009
1
4,998,455
null
2
979
I have made an Android app that writes your current location to your wall. When I look at other Facebook-apps I can see a small link just beneath the post that says "Get [app name]". I mean something like this: ![enter image description here](https://i.stack.imgur.com/IODvM.png) How can I add such a link to my posts?
Add "Get [app name]" beneath Facebook wall-post with a link to a site
CC BY-SA 2.5
0
2011-02-14T12:12:44.393
2011-02-14T23:16:26.973
null
null
517,460
[ "java", "android", "facebook" ]
4,991,974
1
15,353,821
null
27
27,111
Does anyone want to share the they have found for (AS3) and Flash CS5? I've just done a search and found a few, but would love to hear from people who've actually used any of them. (In order of 'most promising') - [Adobe Scout](https://helpx.adobe.com/air/archived-docs-download.html)- [De MonsterDebugger](https://demonsterdebugger.com)- [Thunderbold AS3 Console](https://code.google.com/archive/p/flash-thunderbolt/wikis/ThunderBoltAS3Console.wiki)- [Arthropod](http://arthropod.stopp.se/stopp-mediamonks.html)- [Luminic Box Flash Inspector](https://web.archive.org/web/20200116210512/http://www.luminicbox.com:80/)- [DPanel](https://web.archive.org/web/20120810064608/http://fatal-exception.co.uk/blog/?p=121)- [Alcon](https://web.archive.org/web/20160328163346/http://osflash.org/projects/alcon)- [Print_R Inspector](http://printrmx.sourceforge.net/)- [Tracer - Better debugging in AS3](https://www.breaktrycatch.com/tracer-better-debugging-in-as3/)`trace()`- [Debugging AS3 with Firebug](http://www.marcosweskamp.com/blog/archives/000117.html)- [Flash CS5 built-in debugger](https://web.archive.org/web/20170724013140/http://help.adobe.com:80/en_US/flash/cs/using/WSD76536C2-C8AA-472a-BE2F-BD0D0855972Aa.html)`trace()`- [Output panel from Senocular](https://web.archive.org/web/20180302103252/http://www.senocular.com:80/flash/actionscript/?file=ActionScript_3.0/com/senocular/utils/Output.as)- [Xray (The AdminTool)](http://osflash.org/) --- ## Screenshots... Adobe Scout: [](https://i.stack.imgur.com/FWgs3.png) [adobe.com](https://web.archive.org/web/20131108064033/http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/flashruntimes/adobe-scout-getting-started/adobe-scout-getting-started-fig04.png) De MonsterDebugger: [](https://i.stack.imgur.com/aB5zA.png) [demonsterdebugger.com](https://web.archive.org/web/20121024153207/http://demonsterdebugger.com/img/content/home/MDB-home02.png) Thunderbird AS3 Console: [](https://i.stack.imgur.com/8DqOa.png) [googlecode.com](http://flash-thunderbolt.googlecode.com/svn/trunk/as3/images/tbConsole_inaction.png) Luminic Box: [http://img1.UploadScreenshot.com/images/main/2/4406392687.jpg](http://img1.UploadScreenshot.com/images/main/2/4406392687.jpg) Senocular: ![](https://i81.photobucket.com/albums/j223/drawkbox/OUTPUT.png) Xray: [](https://i.stack.imgur.com/vw3vj.jpg) [osflash.org](https://web.archive.org/web/20130523012051/http://osflash.org/_media/screenshot_xray.jpg)
Best Tools for Debugging Flash ActionScript 3 (AS3)
CC BY-SA 4.0
0
2011-02-14T12:07:43.527
2021-05-21T14:11:30.890
2021-05-21T14:11:30.890
4,751,173
195,835
[ "actionscript-3", "actionscript", "flash-cs5" ]
4,992,269
1
5,008,558
null
3
382
Dictionary values look ugly in CLR Debugger. Is there a way to make them appear in more friendly way? I want to see just keys and values instead of all these recursively nested properties. ![screenshot](https://i.stack.imgur.com/xeNMQ.png) The best trade-off found so far: ``` new ArrayList(myDictionary).ToArray() ``` ![enter image description here](https://i.stack.imgur.com/Kksiw.png)
Dictionaries look ugly in CLR Debugger (DbgCLR)
CC BY-SA 3.0
null
2011-02-14T12:43:56.467
2014-11-24T21:23:49.740
2014-11-24T21:23:49.740
76,173
76,173
[ ".net", "clr", "debugging", "idictionary" ]
4,992,415
1
6,450,362
null
4
624
I download profile Mono 2.8 from [http://hurlman.com/greghurlman_com/attachments/monoprofile2_8.zip](http://hurlman.com/greghurlman_com/attachments/monoprofile2_8.zip) Add in C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\Profile\Mono Create new Project Winforms (framework 4.0) in Visual Studio 2010. In project change "Target framework" to Mono 2.8 Profiler. end press "Startin debuging". ![enter image description here](https://i.stack.imgur.com/wmQQ8.jpg)
How to get started with the mono profiler 2.8?
CC BY-SA 2.5
null
2011-02-14T13:00:26.980
2011-06-23T06:53:50.783
null
null
450,466
[ ".net", "visual-studio", "mono" ]
4,992,486
1
4,992,551
null
5
5,302
I have upgraded to PHP 5.3 on a development machine (Windows 7 box). php-v shows ``` PHP 5.3.3 (cli) (built: Jul 21 2010 20:36:55) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies ``` However, phpinfo.php shows that the version on the machine is: 5.2.14 as shown ![dump from phpinfo page](https://i.stack.imgur.com/WqB4y.png) The loaded configuration file loads the correct php.ini file for 5.3 The configuration file (php.ini) Path reads: C:\Windows - I don't install PHP on the said path. I have however done a recursive search of PHP folders and files within that file but the search turned up nothing. Applications seem to use the settings reported by the phpinfo and not by php -v or php -m or php -i (or else). Apart from deleting the PHP folder and starting from scratch (which I have done), and ensuring that Apache points to the right PHP dir using PHPINIDir, what could I possibly do to solve this? Thanks.
Problem of different PHP versions reported
CC BY-SA 2.5
null
2011-02-14T13:07:55.530
2012-01-20T16:01:46.463
null
null
323,179
[ "php" ]
4,992,646
1
null
null
1
348
I need to create some custom buttons as shown in the image below ![enter image description here](https://i.stack.imgur.com/NzpJY.png) what is the best approach to follow? thanks Abdul Khaliq
android custom button
CC BY-SA 2.5
null
2011-02-14T13:24:03.190
2011-02-16T16:09:57.540
null
null
100,751
[ "android", "view", "uibutton" ]
4,992,902
1
null
null
0
204
I keep getting errors trying to implement the ZBarSDK. I have previously done so without any problem but now it's making me go nuts :) ![enter image description here](https://i.stack.imgur.com/KHARd.png) Anyone with any clue of what is going on, is welcome to answer.. Thanks in advance, Lewion
ZbarSDK errors (Screenshot included)
CC BY-SA 2.5
null
2011-02-14T13:48:27.220
2011-03-29T07:39:56.203
null
null
372,990
[ "iphone-sdk-3.0", "ios4", "barcode-scanner" ]
4,993,067
1
4,993,196
null
0
81
![css overloading ](https://i.stack.imgur.com/G2tSy.jpg) In this image I want to have #bf0018 as the value of the property colour Can anyone help me ....
CSS style oveloading
CC BY-SA 2.5
null
2011-02-14T14:05:34.220
2011-02-14T14:24:34.110
2011-02-14T14:24:34.110
410,693
410,693
[ "html", "css", "overloading" ]
4,993,144
1
4,993,339
null
4
576
This JavaScript code... ``` var o = {}; console.dir(o); o.foo = "bar"; console.dir(o); ``` ...results in the same interactive tree output shown twice: ![Two objects with foo:"bar" shown](https://i.stack.imgur.com/2XOBH.png) This issue is discussed as a bug [here on Stack Overflow](https://stackoverflow.com/questions/4057440/is-chromes-javascript-console-lazy-about-evaluating-arrays), logged as a [Chromium bug](http://code.google.com/p/chromium/issues/detail?id=45623) and [WebKit](https://bugs.webkit.org/show_bug.cgi?id=35801) (and I imagine elsewhere). I understand the implementation reason that this is the case, but it makes debugging stateful objects hard (without using the interactive debugger). What strategy do you use for logging in such situations, where you need to see the differing states of the object in each log call? `JSON.stringify()`? Is there a console method for serialization that can be used?
JavaScript logging object with mutating state
CC BY-SA 2.5
0
2011-02-14T14:13:23.017
2011-02-14T16:29:43.627
2017-05-23T12:30:36.930
-1
405,017
[ "javascript", "debugging", "console" ]
4,993,246
1
6,273,179
null
0
1,565
trying to making a mobile web aplication ![enter image description here](https://i.stack.imgur.com/szVYL.jpg) I need to fit that white bg in to the bottom using css when it has minimal content... and also the scroll will appear for the rich content
Vertically fit the div in any resolution #Mobile Web Aplication
CC BY-SA 2.5
null
2011-02-14T14:21:43.033
2020-05-19T06:31:41.917
2020-05-19T06:31:41.917
584,192
602,760
[ "css", "xhtml" ]
4,993,345
1
5,000,443
null
4
782
I'm trying to simulate the look of CDs in a shelf. Each CD should be visible from an angle very much like books when you look at a book shelf. I use core animation transformations. The problem is that the result looks like Coverflow, i.e. the elements look different based on their position on the screen. Here a screenshot of what it actually looks like and what I want it to look like: ![what it looks like and what it is supposed to look like](https://i.stack.imgur.com/FQ7F0.jpg) I used CALayers and applied two basic transformations: 1) To rotate: ``` CATransform3DMakeRotation(DegreesToRadians(60), 0, 1, 0); ``` 2) To add the perspective: ``` CATransform3D perspective = CATransform3DIdentity; perspective.m34 = -1.0/400; self.layer.sublayerTransform = perspective; ``` How can I apply the same transformation to all layers and have them all look alike? Is Core Animation the right tool for the job? Thanks, Mark.
Applying the same perspective and rotation to all CALayer elements (unlike Coverflow)
CC BY-SA 2.5
0
2011-02-14T14:30:39.600
2011-11-22T22:15:43.283
null
null
458,669
[ "cocoa", "core-animation", "calayer", "perspective", "catransform3d" ]
4,993,411
1
5,010,635
null
0
2,477
``` Bitmap bmp = (Bitmap)extras.get("data"); ByteArrayOutputStream out = new ByteArrayOutputStream(); bmp.compress(CompressFormat.JPEG, 100, out); byte[] raw = out.toByteArray(); PassToWebservice(raw); //error PassToWebservice(byte[] ba) { SoapObject envelope... envelope.addProperty("base64bytes", ba); ... transport.call(ACTION, envelope); envelope.getResponse() //error: IOException cannot serialize... } ``` When I pass the compressed image to my webservice, I get a runtimeexception that says "cannot serialize [B@47bcb6c8..." Something is not apparent to me, can anyone see why the above (psuedo) code does not work? If it helps, on the webservice server side, the exception seems to be happening when the server writes the passed bytes to a file (using .Net IO.File.WriteAllBytes) ![enter image description here](https://i.stack.imgur.com/GhLk6.png)
Android cannot serialize byte[] recieved from compressed BMP
CC BY-SA 2.5
null
2011-02-14T14:35:56.810
2018-07-20T18:59:25.330
2011-02-14T15:14:53.300
457,577
457,577
[ "android", "web-services", "serialization", "bitmap", "android-ksoap2" ]
4,994,562
1
4,997,843
null
0
1,347
The below checkbox is appearing on top of the checkbox label. Like so - ![enter image description here](https://i.stack.imgur.com/a4SVv.png) The label should be appearing beside the checkbox. Here is the code im using - ``` <s:checkbox label="Visibilty - Everyone" name="checkboxField1" value="aBoolean" fieldValue="true"/> ``` Thanks
<s:checkbox not appearing correctly in jsp
CC BY-SA 2.5
null
2011-02-14T16:26:30.773
2011-02-14T22:07:47.433
null
null
470,184
[ "jsp", "struts2" ]
4,994,641
1
4,994,699
null
3
5,657
Need this: ![enter image description here](https://i.stack.imgur.com/1RxAH.gif) But Getting this: ![enter image description here](https://i.stack.imgur.com/4iDil.gif) Do I need to custom draw rectangle to do the above? Plus I need to show a number inside the panel. Any ideas how to go about this?
Winform: Placing a panel over multiple panels
CC BY-SA 2.5
null
2011-02-14T16:34:55.070
2011-02-14T16:40:30.733
null
null
213,469
[ "c#", "winforms" ]
4,994,653
1
4,995,866
null
16
9,811
I've got a span which goes over a number of lines and has a background colour. I need each of the lines to have a 10px padding at the end. The text will be dynamic so i need a css or js solution rather than just hacking it with nbsp tags (which is how I got the example pictured below) The picture show the difference between what I have and what i want: ![padding difference](https://i.stack.imgur.com/Fz0na.jpg) ``` <h3><span class="heading">THE NEXT GENERATION OF CREATIVE TALENT</span><br/> <span class="subhead">IT'S RIGHT HERE</span></h3> h3 { margin:0; font-size: 42px;} h3 .heading { background-color: #000; color: #00a3d0;} h3 .subhead { background-color: #00a3d0; color: #000;} ``` I can't think of any way to do this with css, I was considering using javascript to find the beginning and end of each line and adding a non-breaking space. Does anyone have any ideas of how to achieve this? Cheers
Add padding at the beginning and end of each line of text
CC BY-SA 2.5
0
2011-02-14T16:36:40.080
2014-09-30T14:44:10.360
2014-09-30T14:44:10.360
3,292,910
103,015
[ "html", "css" ]
4,994,751
1
4,994,870
null
0
3,588
I have 2 stored procedures which I want to compare and identify which of them requires less resources and performs better. The second procedure is a modification of the first procedure and it contains slightly changed sql statements of the first procedure. My goal is to understand the impact of the changes in terms of query cost. In order to do so, I execute each procedure separately with an option "Include actual execution plan" and analyse both execution plans. My problem is that I cannot say which sql query performs better in a simple manner. For example consider the following execution plan of the query of the first stored procedure: ![enter image description here](https://i.stack.imgur.com/ROyxk.png) The plan shows that the query cost is and operator is 100% relative to the query. I have the same numbers for the corresponding query of the second procedure Unfortunately this is not enough to understand which query has the minimal cost. Therefore, my question: is there a way to determine the cost of the whole query. The best would be the table with a query and its particular cost, e.g. CPU cost or I/O cost.
SQL Server 2008: performance cost for a single sql statement
CC BY-SA 2.5
null
2011-02-14T16:46:24.470
2011-02-14T17:09:38.540
null
null
357,555
[ "sql-server", "performance", "sql-server-2008", "sql-execution-plan" ]
4,994,985
1
null
null
11
20,105
I recently re-built my development machine which now uses windows 7. On this new machine, VS 2010 can no longer open sln files directly from SS 2005. These are valid 2010 solutions (orginally created witih VS 2010) that worked fine until I re-built my machine. My co-workers have the same setup and do not have this problem. The message I get is "The selected file is not a valid solution file". I've re-built many times and used many installs of VS and never had a problem opening sln's from SS using VS 05, 08 or 10. I've just never seen this before. My co-workers have not had this problem either I have re-installed SS 2005 as well as the latest SS update but nothing works. VS 2010 can open solutions from the file system just fine, so it must be a SS thing. Any ideas? Edit for contents of Solution file: ``` Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyProject", "MyProjectX\MyProject.csproj", "{8E519F6C-A405-43AB-ADA0-F4829ECBEFE0}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyProject_BL", "MyProject_BLMyProject_BL.csproj", "{595FFFB2-5CC3-40BB-9059-32ACFAA9DEFA}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LinqKit", "LINQKit\LinqKit.csproj", "{AEC98F52-83F5-488D-99EF-8AFFE7C9F6E6}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyProject_DL", "MyProject_DL\MyProject_DL.csproj", "{55506B29-70A8-4556-ADF9-2553B0F18379}" EndProject Global GlobalSection(SourceCodeControl) = preSolution SccNumberOfProjects = 5 SccLocalPath0 = . SccProjectUniqueName1 = MyProject\\MyProject.csproj SccProjectName1 = \u0022$/MyProject.root/MyProject/MyProject\u0022,\u0020 SccLocalPath1 = MyProject SccProjectUniqueName2 = MyProject_BL\\MyProject_BL.csproj SccProjectName2 = \u0022$/MyProject.root/MyProject/MyProject_BL\u0022,\u0020 SccLocalPath2 = MyProject_BL SccProjectUniqueName3 = LINQKit\\LinqKit.csproj SccProjectName3 = \u0022$/MyProject.root/MyProject/LINQKit\u0022,\u0020 SccLocalPath3 = LINQKit SccProjectUniqueName4 = MyProject_DL\\MyProject_DL.csproj SccProjectName4 = \u0022$/MyProject.root/MyProject/MyProject_DL\u0022,\u0020JNAAAAAA SccLocalPath4 = MyProject_DL EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {8E519F6C-A405-43AB-ADA0-F4829ECBEFE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8E519F6C-A405-43AB-ADA0-F4829ECBEFE0}.Debug|Any CPU.Build.0 = Debug|Any CPU {8E519F6C-A405-43AB-ADA0-F4829ECBEFE0}.Release|Any CPU.ActiveCfg = Release|Any CPU {8E519F6C-A405-43AB-ADA0-F4829ECBEFE0}.Release|Any CPU.Build.0 = Release|Any CPU {595FFFB2-5CC3-40BB-9059-32ACFAA9DEFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {595FFFB2-5CC3-40BB-9059-32ACFAA9DEFA}.Debug|Any CPU.Build.0 = Debug|Any CPU {595FFFB2-5CC3-40BB-9059-32ACFAA9DEFA}.Release|Any CPU.ActiveCfg = Release|Any CPU {595FFFB2-5CC3-40BB-9059-32ACFAA9DEFA}.Release|Any CPU.Build.0 = Release|Any CPU {AEC98F52-83F5-488D-99EF-8AFFE7C9F6E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {AEC98F52-83F5-488D-99EF-8AFFE7C9F6E6}.Debug|Any CPU.Build.0 = Debug|Any CPU {AEC98F52-83F5-488D-99EF-8AFFE7C9F6E6}.Release|Any CPU.ActiveCfg = Release|Any CPU {AEC98F52-83F5-488D-99EF-8AFFE7C9F6E6}.Release|Any CPU.Build.0 = Release|Any CPU {55506B29-70A8-4556-ADF9-2553B0F18379}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {55506B29-70A8-4556-ADF9-2553B0F18379}.Debug|Any CPU.Build.0 = Debug|Any CPU {55506B29-70A8-4556-ADF9-2553B0F18379}.Release|Any CPU.ActiveCfg = Release|Any CPU {55506B29-70A8-4556-ADF9-2553B0F18379}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal ``` Actions taken: Step 1: File -> Open Project/Solution ![enter image description here](https://i.stack.imgur.com/gdjBE.png) Step 2: Select SourceSafe on left menu. You can now see ss_IssueTrak database stored in sourcesafe ![enter image description here](https://i.stack.imgur.com/dNk4t.png) Step 3: Navigate to Solution IssueTrakX.sln ![enter image description here](https://i.stack.imgur.com/w2ZlZ.png) Step 4: Click Open or double click IssueTrakX.sln and receive this error ![enter image description here](https://i.stack.imgur.com/P4fgJ.png)
"The selected file is not a valid solution file" error when trying to open source safe database
CC BY-SA 2.5
0
2011-02-14T17:08:47.587
2022-01-19T12:35:48.657
2011-02-14T18:55:21.110
178,411
178,411
[ "visual-studio", "visual-studio-2010", "visual-sourcesafe", "visual-sourcesafe-2005" ]
4,995,431
1
4,998,315
null
1
429
Had a facebook tab called "Sign Up" as a gateway into an iframe canvas page. Nothing shocking. This last round of updates have moved the "tabs" to the left side of fb pages. For some reason, my tab, named "Sign Up" and still named so in the application settings, renamed itself to "Hello" when they updated the new look. I have no idea where this is coming from, but the client is now freaking out and Googling for this answer has been totally fruitless. Does anyone know why this would be happening? I tried resaving the application settings to no avail. There's no code to post. There's some static HTML and CSS. Here's a screenshot of the app page: ![enter image description here](https://i.stack.imgur.com/OowtS.jpg) As you can see it says "Hello" for reasons I cannot figure out. In the application settings I was able to change the icon from the default. As you can see here, the tab name is "Sign Up" ![enter image description here](https://i.stack.imgur.com/543NP.jpg) Nowhere in the settings is there the word "Hello". As stated I was able to add an icon.
Facebook tab renamed itself. Can't change
CC BY-SA 2.5
null
2011-02-14T17:47:20.960
2011-02-14T23:02:03.163
2020-06-20T09:12:55.060
-1
412,568
[ "facebook" ]
4,995,727
1
4,996,989
null
4
21,536
I am new to gnuplot, and am trying to create a stacked histogram for a project. The problem I am running into is, that I am not able to put ticlabels on the x-axis (even if I could, they are not getting formatted in a neat way). My gp file is as follows: Here is a snapshot of my data file: ``` CC P1-X P1-Y P2-X P2-Y 1 0.1097586 0.3262812 1.980848 5.9098402 2 0.1010986 0.2988812 0.9966702 5.8378412 3 0.4017474 0.7559452 4.41813 11.7404132 4 0.1028442 0.2974772 1.418744 6.0554552 5 0.1097316 0.3216112 1.967492 5.8007364 6 0.954794 0.3004874 0.9568386 5.778537 ``` And here is my gp file: ``` set title "GCC compilation option by average execution time as stacked histogram" set terminal jpeg medium set output "histosmalldata.jpeg" set boxwidth 0.9 absolute set style fill solid 1.00 border -1 set key autotitle columnheader set key outside right top vertical Left reverse enhanced autotitles columnhead nobox set key invert samplen 4 spacing 1 width 0 height 0 set style histogram rowstacked title offset character 0, 0, 0 set style data histograms set xtics border in scale 1,0.5 nomirror rotate by -45 offset character 0, 0, 0 set xtics norangelimit set xtics ("O2-ffast-math-finline-functions" 1, "O2-funroll-loops-march=barcelona-ffast-math-finline-functions" 2, "GCCFLAGS_O0" 3, "O2-ftree-vectorize-funroll-loops-march=barcelona" 4, "GCCFLAGS_O2" 5, "O2-ftree-vectorize-funroll-loops-ffast-math" 6) set xtics 1,6 nomirror set ytics 0,100 nomirror set ytics 1 set yrange [0:20] set ylabel "Time" set xlabel "GCC Compiler Options" plot 'smalldata' using 2:xtic(1) ti col, '' using 3 ti col, '' using 4 ti col, '' using 5 ti col ``` This is the image of the graph: ![enter image description here](https://i.stack.imgur.com/DCpwr.png) Now, in the x axis, I am having 1,2,3 - 6 which I don't want, instead, I would want "O2-ffast-math-finline-functions" for 1 and so on in a neat formatted way. I wrote this script after consulting some examples from gnuplot page and do not have a good understanding of some of the verbs, so apart from the solution, any general comments are welcome. Thank you, Sayan
Gnuplot : xtics - place strings at tics
CC BY-SA 2.5
null
2011-02-14T18:16:55.150
2011-02-15T03:10:09.337
2011-02-15T01:33:41.400
356,922
356,922
[ "gnuplot" ]
4,995,762
1
4,996,023
null
5
5,432
I have a very straightforward HTML page that displays content in two columns. To format the columns I'm using `<div>` as the outer container (display: table-row) and two inner `<div>` as the actual columns (display: table-cell). One of these columns has a padding at the top. The markup looks like the following - extra markup and styles omitted for clarity: ``` <style> .row { display: table-row } .cell { display: table-cell; border: 1px solid black; width: 150px } .content { background-color: yellow } </style> <div class="row"> <div class="cell"> <div class="content">Some content; this is not padded.</div> </div> <div class="cell"> <div class="content">More content; padded at the top.</div> </div> </div> ``` --- I'm getting this: ![enter image description here](https://i.stack.imgur.com/R6VLi.png) --- But I expected this: ![enter image description here](https://i.stack.imgur.com/bspiQ.png) --- The behavior is the same whether the `padding-top` is applied to the cell or the content. Am I missing anything? Thanks.
Display: table-cell, contents and padding
CC BY-SA 2.5
0
2011-02-14T18:20:59.453
2011-02-14T19:11:29.093
2011-02-14T19:11:29.093
126,052
126,052
[ "html", "css" ]
4,995,876
1
5,235,256
null
2
1,643
How to animate hide/show columns? ``` $("#button").toggle( function() { $('#data').jqGrid('hideCol',['col1','col2','col3']); // $("bla-bla").animate({ // width: 100 // }, 1000 ); }, function() { $('#data').jqGrid('showCol',['col1','col2','col3']); // $("bla-bla").animate({ // width: 0 // }, 1000 ); } ); ``` ![desired behaviour](https://i.stack.imgur.com/QgFcW.gif) Is it possible? We have many columns. Perhaps there is another way to fit all columns in one screen?
jqGrid. Animate hide/show columns
CC BY-SA 2.5
0
2011-02-14T18:31:34.750
2011-03-08T16:24:24.173
2011-02-25T19:57:45.507
63,550
616,535
[ "javascript", "jqgrid" ]
4,996,287
1
12,246,851
null
4
490
I've implemented a solution which involves Rhino.Security to manage user/roles/permissions. Since I want to check if a user is authorized to access a controller action, I've implemented a custom action filter: ``` public class AuthorizationAttribute : ActionFilterAttribute { CustomPrincipal currentPrincipal = (CustomPrincipal)filterContext.HttpContext.User; var actionName = filterContext.ActionDescriptor.ActionName; var controllerName = filterContext.Controller.GetType().Name; var operation = string.Format("/{0}/{1}", controllerName, actionName); if (!securityService.CheckAuthorizationOnOperation(currentPrincipal.Code, operation)) { filterContext.Controller.TempData["ErrorMessage"] = string.Format("You are not authorized to perform operation: {0}", operation); filterContext.Result = new HttpUnauthorizedResult(); } } ``` calls Rhino.Security to check if the user is allowed to the operation specified: ``` AuthorizationService.IsAllowed(user, operation); ``` Everything works properly but I've noticed that the second-level cache is never hit when the query called by is executed. I've investigated and I've seen that the framework () uses a . These are the 2 procedures called: ``` public Permission[] GetGlobalPermissionsFor(IUser user, string operationName) { string[] operationNames = Strings.GetHierarchicalOperationNames(operationName); DetachedCriteria criteria = DetachedCriteria.For<Permission>() .Add(Expression.Eq("User", user) || Subqueries.PropertyIn("UsersGroup.Id", SecurityCriterions.AllGroups(user).SetProjection(Projections.Id()))) .Add(Expression.IsNull("EntitiesGroup")) .Add(Expression.IsNull("EntitySecurityKey")) .CreateAlias("Operation", "op") .Add(Expression.In("op.Name", operationNames)); return FindResults(criteria); } private Permission[] FindResults(DetachedCriteria criteria) { ICollection<Permission> permissions = criteria.GetExecutableCriteria(session) .AddOrder(Order.Desc("Level")) .AddOrder(Order.Asc("Allow")) .SetCacheable(true) .List<Permission>(); return permissions.ToArray(); } ``` As you can see uses . Everytime I refresh a page my action filter executes the procedures and the query is executed again, ignoring the cache (second-level). Since I use extensively the cache and all the other calls work properly I would like to understand why this one doesn't work as expected. Doing some research I've noticed that the second-level cache is used only if I call the function twice: ``` SecurityService.CheckAuthorizationOnOperation(currentPrincipal.Code, "/Users/Edit"); SecurityService.CheckAuthorizationOnOperation(currentPrincipal.Code, "/Users/Edit"); ``` It seems that the cache for this particular situation only works if I am using the same session (nHibernate). Is there anybody who can try to help me to figure out what's happening? UPDATE: ![enter image description here](https://i.stack.imgur.com/PHndB.png)
Rhino.Security: second-level cache is never hit for DetachedCriteria
CC BY-SA 2.5
0
2011-02-14T19:16:16.540
2012-09-03T11:22:30.763
2011-02-16T00:43:09.323
219,406
219,406
[ "asp.net-mvc", "nhibernate", "second-level-cache", "rhino-security" ]
4,996,352
1
5,000,514
null
0
751
I need to reduce the pool size of an MDB to 5 because it connect to an external resource that is limited in terms of connections. If I have 15 messages in my JMS queue, then only 5 msg are process successfully and the other 10 are waist because of connection error happening in the MDB code. I show this setup in the Jboss JMX-console: ![JMX-console](https://i.stack.imgur.com/SguA4.png) I'm using Jboss 4.2.3. I need to know where I can edit this MaxPoolSize config. I searched everywhere but haven't found it. Thanks
Where to configure the org.jboss.ejb3.mdb.MdbDelegateWrapper
CC BY-SA 2.5
null
2011-02-14T19:25:07.540
2012-01-04T14:32:24.900
2012-01-04T14:32:24.900
838,434
335,953
[ "jboss", "jms", "ejb-3.0", "message-driven-bean", "jboss-mdb" ]
4,996,380
1
4,996,738
null
1
586
Where it says "blob_curr = 1" I need to do a check to see if the object id exists in another table. I have no idea how to do this. This is an application that was written several years ago and I am a co-op student who was asked to make some changes to it so I have very limited knowledge of this environment. This is Powerbuilder 9.0 if that helps. ![image description](https://i.stack.imgur.com/DUfWW.jpg)
Doing a database lookup in formatting expression
CC BY-SA 2.5
null
2011-02-14T19:27:48.107
2011-02-14T20:07:59.363
2020-06-20T09:12:55.060
-1
608,550
[ "powerbuilder", "datawindow" ]
4,996,395
1
4,996,437
null
2
1,050
I have a few tables, each with a binary column with a specific size, (i.e 8 bytes, 16 bytes, 32 bytes, etc.) and a size column indicating the actual data size in that binary column, i want to move all the rows into a varbinary(MAX) table. example: ![binary data example](https://i.stack.imgur.com/MFPAf.gif) I am looking for an SQL query that will transfer the contents of the table into a new table with varbinary(MAX) column, but it will have to crop the data to the specified size. for instance, something similar to this possible: `INSERT INTO newVarBinaryTable (new_id, new_data) select (id, newData = crop(data, size)) FROM oldBinaryTable` Note: My DB is on SQL Server 2008
Cropping a binary column using SQL query
CC BY-SA 2.5
0
2011-02-14T19:29:41.343
2011-02-14T19:43:24.720
null
null
225,121
[ "sql", "sql-server", "sql-server-2008", "binary-data" ]
4,996,390
1
4,996,646
null
1
721
Imagine I've got a FlowDocument like so: ``` <FlowDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" ColumnWidth="400" FontSize="14" FontFamily="Georgia" Name="document"> <Paragraph KeepTogether="True"> <Run>ABC</Run> <Run>DEF</Run> <Run>GHI</Run> </Paragraph> </FlowDocument> ``` And I load it like so: ``` private void Button_Click(object sender, RoutedEventArgs e) { FileStream xamlFile = new FileStream("FlowDocument1.xaml", FileMode.Open); FlowDocument content = XamlReader.Load(xamlFile) as FlowDocument; fdReader.Document = content; } ``` What results is this: ![enter image description here](https://i.stack.imgur.com/8lols.png) While what I'd like to see is something like so: ![enter image description here](https://i.stack.imgur.com/mNuV9.png) but upon examining the FlowDocument in the watch window, I see that it inserts Runs between them that essentially have a space as their content, so rather than there being the 3 Inlines that I expect inside the Paragraph, there are 5. How can I avoid those blank runs being inserted? Note: I can't really group those three runs into a single one, which would be the easy answer, due to the fact that they need to remain separate objects. Ideas? --- : As Aaron correctly answered below, grouping the Runs all on one line fixes this issue. As an aside, this document was being built on the fly from other data (more complex than my example) and written out using an XmlWriter that had the XmlWriterSettings property Indent set to true (because it was easier to see the output rather than it all running together) - setting it to false eliminates those extra Runs when it is read in by the XamlReader.
How can I keep XamlReader.Load(xamlFile) from inserting extra Run elements?
CC BY-SA 2.5
null
2011-02-14T19:29:02.877
2012-01-12T04:34:41.453
2011-02-14T20:26:36.233
7,862
7,862
[ "wpf", "flowdocument", "xamlreader", "flowdocumentreader" ]
4,996,470
1
4,996,992
null
6
12,341
I am trying to display a jpg file from a server into an imageView. When I try to load a smaller image (300x400), there are no problems. But when I try to load a full size picture (2336x3504), the image will not load. The file size of the image is only 2mb. I do not get any errors in logcat and there are no exceptions thrown. It simply won't load the image. I also tried using this: ``` BitmapFactory.Options options=new BitmapFactory.Options(); options.inSampleSize = 8; Bitmap preview_bitmap=BitmapFactory.decodeStream(is,null,options); ``` This doesn't do anything to help load the large files, but it does resize the smaller image (like it is suppose to). I did add the large picture to my resources and tested it as if it was embedded in the app and it worked fine, just won't work on the server. I have been working all day on this and can't seem to figure out how to load these large pictures. Can anyone help me out with this? Thanks for any info. [Here](https://stackoverflow.com/questions/477572/android-strange-out-of-memory-issue/823966#823966) is the link where I found the above code and have been playing with the other examples but still not getting it to work. Here is the code I'm using, to load the image: ``` public static Bitmap getBitmapFromURL(String src) { Bitmap bmImg; URL myFileUrl = null; try { myFileUrl = new URL(src); HttpURLConnection conn= (HttpURLConnection)myFileUrl.openConnection(); conn.setDoInput(true); conn.connect(); InputStream is = conn.getInputStream(); BitmapFactory.Options options=new BitmapFactory.Options(); options.inSampleSize = 16; bmImg = BitmapFactory.decodeStream(is, null, options); return bmImg; } catch (Exception e) { // TODO Auto-generated catch block Log.d("Error", e.toString()); return null; } } ``` Here is the logcat screenshot (couldn't figure out how to copy the text appropriately in eclipse) I cleared the log right before I hit the button to load the image. So all you see is what happens when I hit that button. I erased the company and app names (where you see "com.", assume its "com.mycompany.myapp". ![Logcat Screenshot](https://i.stack.imgur.com/Ntq6f.png)
Load Large Image from server on Android
CC BY-SA 2.5
0
2011-02-14T19:39:37.213
2013-01-17T15:15:45.347
2017-05-23T12:10:15.027
-1
469,194
[ "android", "bitmap", "imageview" ]
4,996,739
1
5,000,639
null
7
14,286
I have a problem with the sequence model seen in the diagram below, specifically where the System object is creating a new Number. In this case, there is no need for a return message since the function SaveInput(n), both in System and Number, is the end of the line for that portion of the program, but unless I include one, the modeller reshaped my diagram into the other one I've uploaded here, and I can't see how to arrange the messages so that my program will work the way I intend without including the return message (the one without a name) from Number to System, since the functions SaveInput() both return a void. How should void-returning functions be handled in sequence diagrams so that they behave correctly? I have opened the message properties and explicitly defined it as returning a void, but that hasn't helped. ![enter image description here](https://i.stack.imgur.com/W6rWL.png) ![enter image description here](https://i.stack.imgur.com/DcfBT.png)
Void-returning functions in UML sequence diagrams
CC BY-SA 2.5
0
2011-02-14T20:07:38.400
2011-02-15T06:43:36.543
null
null
null
[ "oop", "uml", "sequence-diagram" ]
4,996,926
1
4,998,471
null
4
4,459
In my small application I have a DataGrid (see screenshot) that's bound to a list of Measurement objects. A Measurement is just a data container with two properties: Date and CounterGas (float). Each Measurement object represents my gas consumption at a specific date. ![enter image description here](https://i.stack.imgur.com/83MK2.png) The list of measurements is bound to the DataGrid as follows: ``` <DataGrid ItemsSource="{Binding Path=Measurements}" AutoGenerateColumns="False"> <DataGrid.Columns> <DataGridTextColumn Header="Date" Binding="{Binding Path=Date, StringFormat={}{0:dd.MM.yyyy}}" /> <DataGridTextColumn Header="Counter Gas" Binding="{Binding Path=ValueGas, StringFormat={}{0:F3}}" /> </DataGrid.Columns> </DataGrid> ``` Well, and now my question :) I'd like to have another column right next to the column "Counter Gas" which shows the difference between the actual counter value and the last counter value. E.g. this additional column should calculate the difference between the value of of Feb. 13th and Feb. 6th => 199.789 - 187.115 = 15.674 What is the best way to achieve this? I'd like to avoid any calculation in the Measurement class which should just hold the data. I'd rather more like the DataGrid to handle the calculation. So is there a way to add another column that just calculates the difference between to values? Maybe using some kind of converter and extreme binding? ;D P.S.: Maybe someone with a better reputation could embed the screenshot. Thanks :)
DataGrid calculate difference between values in two databound cells
CC BY-SA 2.5
0
2011-02-14T20:32:04.730
2016-10-18T13:06:50.153
2011-02-14T20:49:40.620
20,471
594,832
[ "wpf", "datagrid", "binding" ]
4,997,166
1
5,004,111
null
5
4,284
On my Android 2.2.2 device the gallery looks really nice. What I would love to do in my own app is to press a button and then show a menu that looks like this: ![enter image description here](https://i.stack.imgur.com/Dr7l9.jpg) Is this using any standard Android themes / styles? Does anybody know of an example code to have a menu like this? Edit: I figured out that one could mimic this menu with a Dialog. To simplify things I'm not using a ListView in this example, just a single TextView entry for the dialog: ``` <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/layout_root" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" > <TextView android:id="@+id/text" android:layout_width="wrap_content" android:layout_height="fill_parent" android:textColor="#FFF" android:padding="10dp" /> </LinearLayout> ``` Showing the dialog when I press a button: ``` Dialog dialog = new Dialog(MyActivity.this); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setContentView(R.layout.custom_dialog); TextView text = (TextView) dialog.findViewById(R.id.text); text.setText("Test option 1"); WindowManager.LayoutParams WMLP = dialog.getWindow().getAttributes(); WMLP.gravity = (Gravity.BOTTOM | Gravity.LEFT); WMLP.x = 0; WMLP.y = 0; dialog.getWindow().setAttributes(WMLP); dialog.show(); ``` This creates a dialog that comes close to the menu in the picture. I still have two problems, however: 1) How can I draw this little triangle at the bottom of the dialog, like it is done in the picture above? 2) The button that is supposed to open the dialog is positioned horizontally in the middle of the bottom button bar. So when I press it, the dialog should be displayed right above that button. What I would like to do is this: ``` WMLP.x = middleButton.getLeft() + (middleButton.getWidth() / 2) - dialog.getWindow().getDecorView().getPaddingLeft() - (WMLP.width / 2); ``` The problem is, that WMLP.width is -2. I guess the reason is that the layout width is set to "wrap_content" (which is -2) and the actual width is not known at this moment. So, how can I determine the width of the dialog so that I can position it concentrical over another view? Update: I finally found a great source for a dialog like this: [http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/](http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/) It's exactly what I wanted and I'm using it in my app now.
How to make a fancy transparent menu like the "share menu" in Android gallery?
CC BY-SA 2.5
0
2011-02-14T20:56:32.737
2011-12-19T18:42:09.997
2011-12-19T18:42:09.997
396,458
388,826
[ "android", "coding-style", "menu", "transparent" ]
4,997,253
1
5,222,899
null
1
1,252
I am loading a `UITabBarController` inside a `UINavigationController`. By default the `UITabBar` for the `UITabBarController` places it at the bottom of the view. By using the default option the bar is displayed correctly at the bottom position when the app is initiated on landscape. ![enter image description here](https://i.stack.imgur.com/gcf4s.png) This also makes portrait display correctly at the bottom, (but only when the app is initiated in landscape mode). ![enter image description here](https://i.stack.imgur.com/hnN6s.png) If I start the app on portrait, it appears to shift downwards the height of the status bar on both landscape: ![enter image description here](https://i.stack.imgur.com/4KSpa.png) and portrait: ![enter image description here](https://i.stack.imgur.com/anugl.png) I am trying to have a similar effect as the CNBC app and display the `UITabBar` at the top of the view. After reviewing [Mihai Damian's question](https://stackoverflow.com/questions/2568727/uitabbar-customization) I attempted to customize the UITabBar. I simply added a couple of lines of code: ``` -(void)loadView{ UIView *contentView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; contentView.backgroundColor = [UIColor clearColor]; self.view = contentView; [contentView release]; orderingTabBarController = [[UITabBarController alloc] init]; OrderingSpecialsViewController *specialsViewController = [[OrderingSpecialsViewController alloc] initWithNibName:@"OrderingSpecialsViewController" bundle:nil]; OrderingProductViewTabBarController *productViewTabBarController = [[OrderingProductViewTabBarController alloc] init]; OrderingSummaryViewController *summaryViewController = [[OrderingSummaryViewController alloc] init]; specialsViewController.title = @"SPECIALS"; productViewTabBarController.title = @"PRODUCT"; summaryViewController.title = @"ORDER SUMMARY"; [orderingTabBarController setViewControllers:[NSArray arrayWithObjects:specialsViewController, productViewTabBarController, summaryViewController, nil] animated:YES]; orderingTabBarController.tabBar.frame = CGRectMake(0.0, 110.0, self.view.frame.size.width, 40.0); [specialsViewController release]; [productViewTabBarController release]; [summaryViewController release]; [self.view addSubview:orderingTabBarController.view]; } ``` When I try modifying the frame of the UITabBar, it disappears on landscape mode: ![enter image description here](https://i.stack.imgur.com/lvf9P.png) and appears at different height on portrait when it again initiated in landscape and portrait respectively. Initiated in landscape mode: ![enter image description here](https://i.stack.imgur.com/H4cMl.png) Initiated in portrait mode: ![enter image description here](https://i.stack.imgur.com/fUnn8.png) Has anyone encountered this problem before? If so, how did you go by solving it? Any help here would be greatly appreciated. It just seems to add the 20 pixels of the status bar when the view is loaded on portrait mode, as if it was not finding the status bar even though it is there, hence, it adds 20 pixels on top of the already existing 20 pixels for the status bar.
Why is my UITabBar shifting down 20 pixels when loaded on portrait?
CC BY-SA 2.5
null
2011-02-14T21:04:56.053
2011-03-07T17:25:34.110
2017-05-23T12:07:06.850
-1
117,792
[ "cocoa-touch", "ios", "uinavigationcontroller", "uitabbarcontroller", "uitabbar" ]
4,997,453
1
null
null
0
135
I have the following complex inheritance hierarchy: ``` I1<I3> A1 : C1, I2 C2 : A1, I3 C3 : A2<C2>, I4 A2<C2> : I5, I1<C2> ``` In picture form: ![Inheritance diagram](https://i.stack.imgur.com/mPKQI.jpg) Writing: ``` I1<I3> i = new C3(); ``` ...results in the compilation error "Cannot convert source type... to target type...". Why?
Why does this inheritance hierarchy not permit this assignment?
CC BY-SA 2.5
null
2011-02-14T21:25:27.933
2012-02-14T12:04:12.160
2011-02-14T21:32:54.140
38,522
38,522
[ "inheritance", "c#-4.0", "covariance" ]
4,997,596
1
null
null
28
79,860
I have a WPF `DataGrid` that contains some data. I would like to set the width of the columns such that the content fits in and never gets cropped (instead, a horizontal scroll bar should become visible). Additionally, I want the `DataGrid` to fill the whole place available (I am working with a `DockPanel`). I am using the following code (simplified): ``` <DataGrid ItemsSource="{Binding Table}"> <DataGrid.Columns> <DataGridTextColumn MinWidth="100" Width="Auto" Header="Column 1" Binding="{Binding Property1}" /> <DataGridTextColumn MinWidth="200" Width="Auto" Header="Column 2" Binding="{Binding Property2}" /> </DataGrid.Columns> </DataGrid> ``` This apparently does not work out of the box with `Width="Auto"` as it always looks something like this: ![DataGrid: only the first part of the row is marked as "selected"](https://i.stack.imgur.com/KmMR2.png) This obviously looks ugly. I would like to have the whole row selected, or, which would be much better, the columns to fill the whole width, but as one can see, this does not work. If I use `Width="*"` instead, the content of the columns gets cropped which is even worse for me. I found a [similar question here](https://stackoverflow.com/questions/3404067/wpf-datagrid-column-with-width-but-minwidth-to-fit-contents), and a workaround was posted there. This may work, but I am working with the MVVM pattern, so the and I cannot think about a way of doing it from there, because I cannot access the `ActualWidth` property of the `DataGridColumn`. Also, I would like to do it only in XAML if possible. I would appreciate any help. Thanks! Edit: As I still don't have a clue what to do about it, I start a small bounty. I would be very happy about a suggestion what one could do about my problem. Thanks again! Edit 2: After saus' answer I thought about the options again. The problem is that I need to update the `Width` and the `MinWidth` properties also during the application is running, so not only after loading the window. I already tried to do something like ``` column.Width = new DataGridLength(1, DataGridLengthUnitType.Auto); column.MinWidth = column.ActualWidth; column.Width = new DataGridLength(1, DataGridLengthUnitType.Star); ``` in some event that is fired when the underlying `ItemsSource` of the `DataGrid` is updating. However, this does not work, as the `ActualWidth` property does not seem to change after setting the `Width` on `Auto`. Is there an option to somehow "repaint" it in order to get the `ActualWidth` property updated? Thanks!
How can I set the width of a DataGridColumn to fit contents ("Auto"), but completely fill the available space for the DataGrid in MVVM?
CC BY-SA 2.5
0
2011-02-14T21:40:58.250
2019-01-16T11:00:10.787
2017-05-23T12:25:26.333
-1
594,553
[ "c#", "wpf", "xaml", "mvvm", "datagrid" ]
4,997,731
1
7,095,704
null
15
6,025
I'm trying to upload a logo with a transparent background to the android market. For some reason, my png is getting transformed by the market in a way that removes the transparency. My designer is doing his best to follow the instructions in [https://market.android.com/support/bin/answer.py?answer=1078870](https://market.android.com/support/bin/answer.py?answer=1078870), but neither of us can figure out what's wrong. As far as we can tell, he's doing alpha in the png, but it doesn't look right. Here's the png: ![enter image description here](https://i.stack.imgur.com/LcMua.png) And here's what it looks like in the market: ![enter image description here](https://i.stack.imgur.com/dqJIK.png) This seems to be a widespread problem in the market, although some apps have managed to get it right. What are we doing wrong?
Transparent png on android market for high resolution asset
CC BY-SA 2.5
0
2011-02-14T21:56:21.530
2014-07-22T06:25:54.120
null
null
82,156
[ "android", "png", "alpha", "google-play" ]
4,997,989
1
4,998,491
null
15
27,265
On my website I want the user to have the ability to login/logout from any page. When the user select login button a modal dialog will be present to the user for him to enter in his credentials. Since login will be on every page, I thought I would create a partial view for the login and add it to the layout page. But when I did this I got the following error: There are other ways to work around this that would not using partial views, but I believe this should work. So to test this, I decided to make everything simple with the following code: Created a layout page with the following code ``` @{Html.RenderAction("_Login", "Account");} ``` In the AccountController: ``` public ActionResult _Login() { return PartialView("_Login"); } ``` Partial View _Login ``` <a id="signin">Login</a> ``` But when I run this simple version this I still get this error: Source of error points to "@{Html.RenderAction("_Login", "Account");}" There are some conversations on the web that are similar to my problem, which identifies this as bug with MVC (see links below). But the links pertain to Caching, and I'm not doing any caching. OuputCache Cache Profile does not work for child actions [http://aspnet.codeplex.com/workitem/7923](http://aspnet.codeplex.com/workitem/7923) Asp.Net MVC 3 Partial Page Output Caching Not Honoring Config Settings [Asp.Net MVC 3 Partial Page Output Caching Not Honoring Config Settings](https://stackoverflow.com/questions/4797968/asp-net-mvc-3-partial-page-output-caching-not-honoring-config-settings/4800140#4800140) Caching ChildActions using cache profiles won't work? [Caching ChildActions using cache profiles won't work?](https://stackoverflow.com/questions/4728958/caching-childactions-using-cache-profiles-wont-work/4869434#4869434) I'm not sure if this makes a difference, but I'll go ahead and add it here. I'm using MVC 3 with Razor. --- Update Stack Trace ``` [InvalidOperationException: Duration must be a positive number.] System.Web.Mvc.OutputCacheAttribute.ValidateChildActionConfiguration() +624394 System.Web.Mvc.OutputCacheAttribute.OnActionExecuting(ActionExecutingContext filterContext) +127 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +72 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +784922 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +314 System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +784976 System.Web.Mvc.Controller.ExecuteCore() +159 System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +335 System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +62 System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +20 System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +54 System.Web.Mvc.<>c__DisplayClass4.<Wrap>b__3() +15 System.Web.Mvc.ServerExecuteHttpHandlerWrapper.Wrap(Func`1 func) +41 System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) +1363 [HttpException (0x80004005): Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'.] System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) +2419 System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage) +275 System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) +94 System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter) +838 System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues) +56 ASP._Page_Views_Shared_SiteLayout_cshtml.Execute() in c:\Projects\prj Projects\prj\Source\Presentation\prj.PublicWebSite\Views\Shared\SiteLayout.cshtml:80 System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +280 System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +104 System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +173 System.Web.WebPages.WebPageBase.Write(HelperResult result) +89 System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) +234 System.Web.WebPages.WebPageBase.PopContext() +234 System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +384 System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +33 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +784900 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +784900 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +265 System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +784976 System.Web.Mvc.Controller.ExecuteCore() +159 System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +335 System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +62 System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +20 System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +54 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +453 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +371 ``` --- Update When I Break in Code, it errors at @{Html.RenderAction("_Login", "Account");} with the following exception. The inner exception ``` Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'. at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage) at System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) at System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter) at System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues) at ASP._Page_Views_Shared_SiteLayout_cshtml.Execute() in c:\Projects\prj Projects\prj\Source\Presentation\prj.PublicWebSite\Views\Shared\SiteLayout.cshtml:line 80 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at System.Web.WebPages.WebPageBase.Write(HelperResult result) at System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) at System.Web.WebPages.WebPageBase.PopContext() at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) ``` ![enter image description here](https://i.stack.imgur.com/erXOV.jpg) --- Answer Thanks Darin Dimitrov Come to find out, my AccountController had the following attribute > [System.Web.Mvc.OutputCache(NoStore =true, Duration = 0, VaryByParam = "*")]. I don't believe this should caused a problem, but when I removed the attribute everything worked. BarDev
MVC HTML.RenderAction – Error: Duration must be a positive number
CC BY-SA 3.0
0
2011-02-14T22:24:29.823
2012-12-13T19:27:50.107
2020-06-20T09:12:55.060
-1
92,166
[ "asp.net-mvc", "asp.net-mvc-3", "razor" ]
4,998,198
1
5,000,140
null
4
9,328
My Dojo application uses a few contentpanes to display different bits of information. The main pane has a good amount of scrollable data. I need to be able push a button to jump to certain places. Currently using: ``` dojo.byId(iid).scrollIntoView(); ``` This works perfectly except that it seems to base the calculation on the browser window top rather than the contentpanes' top. Since my contentpane is NOT on the top of the page (There's a 50px high toolbar on top) the DIV that I'm scrolling too is 50px too high. Something like this would work but scrollBy only applies to the window: ``` dojo.byId(iid).scrollIntoView(); //Scroll to div in quesiton dojo.byId(iid).scrollBy(0,50); //scroll down 50px more to account for panes offset from window. ``` Background of complete app: The app uses a few dijit.layout.BorderContainer's for layout. A user can click on the left tree to bring up an event in the right panel. If they click on a "Target", I create all the DOM nodes in the right panel dynamically then attempt to scroll to the clicked on item. The scrolling part works for the top and bottom nodes but is offset for the middle nodes. ![Screen shot of complete app](https://i.stack.imgur.com/jSQkm.jpg) ![Illustration of my issue](https://i.stack.imgur.com/QkNdv.jpg)
Scroll to a certain location using a Dojo ContentPanel
CC BY-SA 2.5
0
2011-02-14T22:48:17.097
2012-11-20T23:00:59.823
2011-02-22T21:02:40.267
612,219
612,219
[ "javascript", "dom", "dojo", "window" ]
4,998,291
1
4,998,334
null
0
24,748
Look at the following image and code: ![enter image description here](https://i.stack.imgur.com/Cb1Ge.png) ``` <!doctype html> <html> <head> <style> body { border: 1px solid red; padding: 20px; overflow: scroll; } </style> </head> <body></body> </html> ``` The `overflow: scroll` inserts scroll bars inside the element, but the `<body>` element doesn't occupy the entire webpage, what is wrong with the scroll bars? Thanks
<body> with overflow:scroll not behaving as expected
CC BY-SA 2.5
null
2011-02-14T22:58:59.230
2011-02-15T01:37:42.307
2011-02-15T01:37:42.307
null
210,304
[ "html", "css" ]
4,998,299
1
5,000,482
null
11
19,885
I cant figure out, how to get with OpenGL ES 2.0 similiar Results to OpenGL ES 1.1. I want to use actually a Sampler2D (to blend my texture with Alpha Channel to the Framebuffer) and also set an Color. The texture should be painted in the color - like in OpenGL ES 1.1 My FragmentShader looks like this: ``` varying lowp vec4 colorVarying; varying mediump vec2 texcoordVarying; uniform sampler2D texture; void main(){ gl_FragColor = texture2D(texture, texcoordVarying) + colorVarying; } ``` But the part "+ colorVarying" destroys my alphachannel with black (because I also add colorVarying, if the AlphaValue is 0) and makes an strange gradient effect... How is the texture & color channel combined in the fixed function pipeline? My Replacement for glColor4f is: ``` void gl2Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a){ const GLfloat pointer[] = {r, g, b, a}; glVertexAttribPointer(ATTRIB_COLOR, 2, GL_FLOAT, 0, 0, pointer); glEnableVertexAttribArray(ATTRIB_COLOR); } ``` And I'm using glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); if this is somehow relevant... For the color 1.0, 0.0, 1.0, 1.0 here is what I get now: ![Now](https://i.stack.imgur.com/p2o7V.png) And I want to get: ![What I want to see](https://i.stack.imgur.com/27mID.png) Some ideas to accomplish this? Any help would be appreciated.
Texture and color together in GLSL?
CC BY-SA 2.5
0
2011-02-14T23:00:33.567
2022-01-15T13:43:38.657
2022-01-15T13:43:38.657
3,501,958
531,840
[ "opengl-es", "opengl-es-2.0", "alpha", "fragment-shader", "blending" ]
4,998,413
1
null
null
1
643
Once again, I'm almost entirely sure this is something dumb that I'm doing, but I've been banging my head against this one for hours & am getting nowhere. I'm trying to restructure the view hierarchy of my app. I need to be able to detect user interface orientation changes globally in order to correctly rotate a "Loading" view displayed when the app is downloading content. (device orientation changes seem to fire at different times, causing the view that needs to respond to these events to rotate sporadically). The app previously added a UINavigationController's view to the main window. I modified the hierarchy to add the view of a UIViewController subclass to the main window, and added the view of the UINavigationController to the subclass's view. The UIViewController subclass manages the display & rotation of the "Loading" subview, and I was expecting the rest of the app to continue behaving normally, as inserting one extra empty view into the hierarchy didn't feel like I was changing too much. My initial problem was the positioning of the UINavigationController - it was 20 pixels too low, resulting in a gap between the status bar and the navigation bar, and cutting off the bottom 20 pixels of the tab bar. I was able to adjust this by setting the frame property of the UINavigationController's view to the bounds property of the UIViewController's view, which corrected the position. However, now I'm stuck with a 20-pixel-high dark "overlay" on top of my navigation bar. If I were to guess, I'd say it was black with 50% opacity. Touch events on this bar don't work (e.g. if I try to tap the "Back" button through the overlay, nothing happens). The fact that the height is equal to that of the status bar hasn't escaped me, but I'm at a total loss as to what could be causing it. ![Ridiculous navigation bar problem](https://i.stack.imgur.com/qo0ep.jpg) I hate feeling this stupid, so if anyone has any insight into this problem, you'd really make my day. Thanks in advance!
Why is there a 20-pixel-high dark overlay over my app's navigation bar?
CC BY-SA 2.5
null
2011-02-14T23:12:03.977
2011-02-15T01:57:37.330
2011-02-15T00:30:53.113
106,435
162,026
[ "iphone", "cocoa-touch", "uiviewcontroller", "uinavigationcontroller", "uinavigationbar" ]
4,998,499
1
8,829,380
null
0
916
If I have a public property for the designer of type Control I see a dropdown of controls that currently exist. However, if I have a Control[] I can only create new controls. Is it possible to somehow be able to choose existing Controls for the Control[] property via Designer? ![http://i55.tinypic.com/2j14xvo.png](https://i.stack.imgur.com/Xhwlv.png) I have the following: ``` [Browsable(true),CategoryAttribute("Text"), DescriptionAttribute("Tooltips for underlined text")] public Control[] TooltipControls ```
WinForms UserControl Designer for Control[] Property
CC BY-SA 2.5
null
2011-02-14T23:24:32.257
2022-03-04T12:42:19.117
null
null
512,991
[ "c#", "winforms", "designer", "windows-forms-designer" ]
4,998,762
1
null
null
26
85,906
I'm trying to display my reports on the browser , but I keep getting this error: ![enter image description here](https://i.stack.imgur.com/sNQEL.jpg) the strange thing about this, is that it only happens when I attempt to generate the reports from the version installed on the server, but not when I do it locally from my pc Have you any idea why this is happening ?
Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser
CC BY-SA 2.5
0
2011-02-15T00:06:45.923
2022-12-15T14:12:02.497
2020-06-20T09:12:55.060
-1
530,911
[ "jasper-reports" ]
4,998,800
1
null
null
2
315
I'm not even sure what to call this UI technique, but consider the following example from IntelliJ IDEA. ## IntelliJ Example Here, the 'field' is the return type of a method, and the 'editing context' is a drop-down of available types. It's 'inline' because this is not a form with labelled fields, it's a 'narrative' (a statement in Java) instead. ![IntelliJ IDEA showing a drop-down to fulfill a field](https://i.stack.imgur.com/ZdBSI.png) ## My Application I'm wanting to try the same kind of thing for a browser application I'm writing. Here, the narrative would be something like: > 'The appointment is sheduled for .' Here, the phrase '1pm today' is the 'phrase rendering' of a date-time field. When the user selects it (via tabbing or clicking on it), a panel should 'pop up' beneath the phrase so that the field can be edited. In this case, the editor might be a calendar widget and a time-spinner widget. ## Rough conceptualisation in GWT terms It'd be nice to have a GWT widget which did something like: - - - - ## The question Does there exist something like this? What is it called? If I made one, what would I call it?
Is there a GWT widget (or arrangment thereof) for 'open an editing context when the user selects an inline field''?
CC BY-SA 2.5
null
2011-02-15T00:12:46.707
2011-03-01T01:09:44.457
null
null
463,052
[ "user-interface", "gwt", "naming" ]
4,999,026
1
4,999,361
null
15
3,652
Using `@RenderSection("SectionName", false)`, why do I need to explicitly set the 2nd parameter to `false` when the Intellisense already states that the default is false? ![is the tool tip wrong?](https://i.stack.imgur.com/Qcb7F.png)
Razor RenderSection throwing error if not defined
CC BY-SA 2.5
0
2011-02-15T01:06:47.377
2011-02-15T05:12:49.157
2011-02-15T04:52:01.903
160,823
160,823
[ "asp.net-mvc-3", "razor" ]
4,999,043
1
4,999,849
null
6
2,219
I am importing a database into Entity Framework and I'm having trouble with a many-to-many relationship that looks like this: ![](https://i.stack.imgur.com/sBDrW.png) My understanding is that if the "join table" (the middle one) contains only two fields (the foreign keys) then EF will automatically remove the middle table and create a many-to-many relationship. Unfortunately I don't have control over the database schema, so does anyone know if there's a way to replicate that behaviour manually? For the record, there is no purpose behind that Id field in Employee_Employee_Type, it's just poorly designed.
Many-to-many relationships in Entity Framework where join table has more than two fields?
CC BY-SA 2.5
0
2011-02-15T01:11:03.427
2011-10-15T17:27:20.883
null
null
13,877
[ "c#", "database", "entity-framework", "ado.net", "entity-framework-4" ]
4,999,585
1
4,999,619
null
1
325
even though php page's header set to UTF-8 i get this error ![error](https://i.stack.imgur.com/4hmAn.png) here is meta tag ``` <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> ``` text is coming from php gettext. how can i solve this ? thanks
international character problem
CC BY-SA 2.5
null
2011-02-15T03:17:04.317
2011-02-15T03:26:20.010
null
null
192,525
[ "php", "utf-8", "gettext" ]
4,999,617
1
4,999,645
null
0
133
Today I faced a problem that there is one memory leak in my iphone application. below is the screenshot. when I double click the leak block, the memory leak detection instrument gives me some assembly code not source code so I could not find out where the memory leaks,I confused me a lot,and last night I didn't sleep well. Could someBody give me some advice to deal with such things? Thank you!!! ![iphone memory leak](https://i.stack.imgur.com/i0mUU.png)
How to deal with the memory leak in iphone application
CC BY-SA 2.5
null
2011-02-15T03:25:25.713
2011-02-15T03:32:24.313
null
null
415,752
[ "iphone", "memory-leaks" ]
4,999,859
1
4,999,864
null
4
805
I have just built my first iPhone app, but its icon appears crossed-out. I do have some warnings when I build the code, but why would they cause the app icon to cross? My app has no errors. Here is what the icon looks like: ![enter image description here](https://i.stack.imgur.com/87SkR.png)
Why is the icon for my iPhone app crossed-out after a build?
CC BY-SA 2.5
null
2011-02-15T04:24:44.803
2011-02-15T06:38:35.110
2011-02-15T06:38:35.110
366,904
496,613
[ "iphone", "xcode", "macos" ]
5,000,024
1
null
null
-1
124
I want to use a TreeView and design a form similar to the following image: ![](https://i.stack.imgur.com/TABZP.jpg) Details: - - What is the best way to design this form?
Help with designing a form
CC BY-SA 2.5
null
2011-02-15T04:56:27.647
2021-09-14T14:19:04.133
2021-09-14T14:19:04.133
2,756,409
617,223
[ "c#", "winforms" ]
5,000,170
1
5,000,348
null
1
162
I have included a video (using html 5) from my hard disk into a html file (called Empty.html). I load this file(Empty.html) into a frame of another html file. But, when i click the play button in the browser(chrome) the video jumps to a new location(leftmost of chrome) within the browser and plays. I am attaching the screenshots below. Can someone please help me resolve this issue ? The code below is the one used by me for inserting the video ``` <video poster="images/vlcsnap-00001.jpg" height="240" width="320" draggable="false" controls="controls"> <source type="video/mp4" src="videos/How nuclear energy works(360p_H.264-AAC).mp4"/> </video> ``` ![Before clicking the play button in the browser](https://i.stack.imgur.com/BTvdR.jpg) ![After clicking the play button in the browser](https://i.stack.imgur.com/qjGkm.jpg)
how to avoid video jumping to a new location in a webpage designed using html 5?
CC BY-SA 2.5
null
2011-02-15T05:22:24.960
2011-02-15T05:53:16.927
null
null
344,348
[ "html", "video", "google-chrome", "html5-video" ]
5,000,324
1
5,011,991
null
0
1,450
I have two vectors of matching lengths. They are readings from two different sensors (one is from a smartphone and the other is from a wiimote) of the same hand movement. I am trying to find the time offset between them to synchronise the readings for further processing. The readings I get are of the format (Time(ms) Value) for accelerations in the X,Y and Z direction. For the synchronization, I plotted the cross-correlation function `xcorr2()` between the two sets. I am getting the same graph (a weird triangle peak and a straight line at the bottom) for Accelerations along the x, y and z directions (which I guess is good) but I don't know how to interpret it. What do the axes in the graph represent? Can anyone explain to me what `xcorr2()` means in a qualitative sense. From the correlation function, how do I determine the offset (i.e. how many seconds is sensor1 behind sensor2)? ![enter image description here](https://i.stack.imgur.com/ATip4.jpg)
MATLAB interpretation of Xcorr2
CC BY-SA 2.5
null
2011-02-15T05:50:15.640
2011-02-23T04:57:33.857
2020-06-20T09:12:55.060
-1
526,223
[ "matlab", "graph", "sensors", "correlation" ]
5,000,367
1
null
null
2
513
I want to programmatically start broadband (PPOE) internet connection. I'm not sure if [InternetDial](http://msdn.microsoft.com/en-us/library/aa384587%28v=VS.85%29.aspx) will work as the documentation clearly says that it initiates a connection to the Internet using a modem. I tried searching for the API function but I couldn't find one. I am trying to create a program that will take a user name and password and then connect to the internet. Similar to this program. ![enter image description here](https://i.stack.imgur.com/vDKmZ.png) Right now I just need the name of API function as I want to implement this program on my own. Thanks.
How do I programatically start an internet connection?
CC BY-SA 2.5
0
2011-02-15T05:57:30.357
2011-02-22T21:23:12.110
2011-02-15T10:04:28.053
92,487
92,487
[ "c", "winapi", "windows-7", "systems-programming" ]
5,000,718
1
5,000,761
null
2
271
When I rotate the simulator from portrait to landscape, the header is not rotating. I want to rotate the header along with the view rotation using UIInterfaceOrientation.![enter image description here](https://i.stack.imgur.com/rInGh.png)
UIInterfaceOrientation rotate along with the Hearder
CC BY-SA 2.5
null
2011-02-15T06:58:58.590
2011-02-15T09:46:39.530
2011-02-15T09:18:34.073
563,645
563,645
[ "iphone", "cocoa-touch", "uiinterfaceorientation" ]
5,000,767
1
5,004,385
null
1
1,496
I'm having a problem with the rotation of images ``` Graphics2D g2 = (Graphics2D) g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON); AffineTransform at = new AffineTransform(); at.setToIdentity(); at.translate(x, y); at.rotate(Math.toRadians(angle)); g2.transform(at); image.paintIcon(c, g2); ``` I use this code to rotate the picture before painting it (image is a class I created to help me handle loading of picture. Unfortunately, I'm having a problem with the edges of the image that become really bad (cf Picture) ![enter image description here](https://i.stack.imgur.com/dGvxZ.png) any ideas how I can improve the quality of the draw ? jason
Java Swing: Graphics2D rotation creating disgusting edges
CC BY-SA 2.5
null
2011-02-15T07:09:10.543
2011-02-15T15:18:19.353
2011-02-15T15:18:19.353
376,340
440,336
[ "java", "swing", "applet", "paint", "java-2d" ]
5,001,002
1
null
null
33
59,611
I have to show progress graphs exactly in following way where percentage would be in center of circular graph ![circular progress indicator](https://i.stack.imgur.com/iouR5.png) How can i do this using javascript/jQuery? Can it be done using Google Chart?
How to create circular progress(pie chart) like indicator
CC BY-SA 2.5
0
2011-02-15T07:42:19.153
2019-09-04T11:43:36.840
2011-04-11T06:56:25.223
194,345
194,345
[ "javascript", "asp.net", "html", "css", "svg" ]
5,001,071
1
5,001,192
null
1
1,114
sorry if my question sounds very amateurish.. Actually I have a set of plots in 2d form Let X=(x1,x2...xn) be a set of similar plots obtained ``` Y=(y1,y2...yn) be a set of plots similar ``` ![enter image description here](https://i.stack.imgur.com/mptyP.jpg) Intuitively i can see that all plots of X 'look similar' But how do i find the similarity between scores between 2 plots and prove that they have a high similarity score..?? I am using the R language... Can somebody help..??Thanks
Finding similarity measure between 2 plots..?
CC BY-SA 2.5
0
2011-02-15T07:52:21.053
2011-02-15T09:11:58.747
2011-02-15T09:11:58.747
429,846
582,695
[ "r", "plot", "similarity" ]
5,001,070
1
5,001,210
null
1
614
Working on my Major project for software design and development and have run into the hurdle that when using pygame.gfxdraw.aacircle to draw big circles, the output goes screwy as seen here ![enter image description here](https://i.stack.imgur.com/jLj2Z.png) the window in the picture is showing a section of a circle with a radius of size 1561 if no-one can suggest a fix or alternate way of drawing aa circles i will probably just use the regular circle function as it doesn't look to bad at sch a large radius.
pygame.gfxdraw.aacircle gows funny for big circles, any alternatives?
CC BY-SA 3.0
null
2011-02-15T07:52:15.407
2014-04-16T21:47:28.850
2014-04-16T21:47:28.850
1,404,505
392,485
[ "python", "pygame", "draw", "antialiasing", "geometry" ]
5,001,092
1
5,001,981
null
22
14,860
I'm currently hosting a django project on Apache + nginx. When I try to upload a large file I get a ![413 request entity too large](https://i.stack.imgur.com/6RJIH.jpg) I also have a django-cms project and when I tried to upload a file which is anything over 5meg I get an error ![code 64 the web server connection was closed](https://i.stack.imgur.com/nPxcw.jpg) Thanks in advance,
413 request entity too large + The web server connection was closed | Error 64
CC BY-SA 2.5
0
2011-02-15T07:54:34.937
2011-02-15T09:43:46.603
null
null
234,543
[ "django", "apache", "nginx", "django-cms" ]
5,001,401
1
5,006,876
null
0
398
I want to internationalize my firefox extension. So I include ``` <!DOCTYPE page SYSTEM "chrome://myextension/locale/overlay.dtd"> ``` which contains e.g. ``` <!ENTITY myLabel "Test"> ``` Now setting ``` <label value="&myLabel;"/> ``` gives me an error at the line above at the position of the bold char < l a b e ![enter image description here](https://i.stack.imgur.com/Ko50m.png) Manifest: ``` content smsflatrate chrome/content/ skin smsflatrate classic/1.0 chrome/skin/ locale smsflatrate en-US chrome/locale/en-US/ overlay chrome://browser/content/browser.xul chrome://smsflatrate/content/ff-overlay.xul style chrome://global/content/customizeToolbar.xul chrome://smsflatrate/skin/overlay.css ``` Any idea what's wrong?
How to internationalize firefox extension
CC BY-SA 2.5
0
2011-02-15T08:41:32.903
2011-02-15T17:05:09.307
2011-02-15T15:48:21.190
401,025
401,025
[ "firefox", "internationalization", "firefox-addon" ]
5,001,439
1
5,001,718
null
0
4,309
I have following page to get printed which has horizontal scrolling. I need to print content within the horizontal scroll bar area. ![content to be printed](https://i.stack.imgur.com/9OZML.png) When this page is printed, I get an output which does not contain all the fields in the horizontal scroll bar area. ![enter image description here](https://i.stack.imgur.com/Blcqj.png) Not all the content within the scroll bar is printed. The method I am using is Print CSS. ``` @media print { .noprint { display: none; overflow: visible; } } ```
Print the entire content of a scrollable table
CC BY-SA 2.5
null
2011-02-15T08:47:22.970
2011-02-15T10:23:22.027
2011-02-15T09:19:54.813
20,578
187,922
[ "jquery", "css", "user-interface", "printing" ]
5,001,523
1
5,011,686
null
2
544
I am using the coreplot for displaying the graph in iPhone. I want to display the label(10,20,30 .. ) properly in the plotArea. Currently, The bar and label are displaying in uneven format. How to solve this ? Code : ``` x.axisLineStyle = nil; x.majorTickLineStyle = nil; x.minorTickLineStyle = nil; x.majorIntervalLength = CPDecimalFromString(@"10"); x.orthogonalCoordinateDecimal = CPDecimalFromString(@"0"); x.title = @"Age Limit"; x.titleLocation = CPDecimalFromFloat(30.0f); x.titleOffset = 35.0f; x.labelRotation = M_PI/2;![enter image description here][1] x.labelOffset = 5.0f; ``` ![enter image description here](https://i.stack.imgur.com/aFfkS.png)
CorePlot - XAxis - iPhone
CC BY-SA 2.5
0
2011-02-15T08:56:52.627
2012-01-05T18:47:37.290
null
null
430,278
[ "iphone", "core-plot" ]