Id
int64
1.68k
75.6M
PostTypeId
int64
1
2
AcceptedAnswerId
int64
1.7k
75.6M
ParentId
int64
1.68k
75.6M
Score
int64
-60
3.16k
ViewCount
int64
8
2.68M
Body
stringlengths
1
41.1k
Title
stringlengths
14
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
1
CreationDate
stringlengths
23
23
LastActivityDate
stringlengths
23
23
LastEditDate
stringlengths
23
23
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
1
21.3M
Tags
list
5,001,684
1
5,002,920
null
1
198
I have a table storing information on auctions. The fields are `AuctionID, Location, StartDateTime, EndDateTime, Status` etc. I need a query to display auctions for an entire week (excluding weekends) as shown in the figure. I am using VS 2008 gridview and fetching data from SQL Server 2005. ![Software Genius Inc.](https://i.stack.imgur.com/CVy3o.jpg) The grid shows auctions for the specific date according to locations column wise. For ex. There are five auctions on Location 11, 12,13,14,15 with different times on Mon 14th Feb. Can anybody solve my problem. Thanks for sharing your time.
Help me to solve this query
CC BY-SA 2.5
0
2011-02-15T09:15:31.163
2011-02-15T11:15:40.280
2011-02-15T09:42:27.713
13,302
123,514
[ "c#", "asp.net", "sql-server-2005" ]
5,001,783
1
null
null
3
2,768
I have implemented a `UserControl` with a text `Label`. I want to adjust the control height when I resize the control width, to make the whole text visible all the time, like in the picture: ![sample](https://i.stack.imgur.com/J4zqW.png) I have customized the WinForms `Label` to calculate the `TextBounds` of the Label (the needed rectangle for the text) and I raise an event called `TextBoundsChanged` that indicates that the text rectangle size has changed (Note that this event is raised always while the label is being resized). This works: I receive the event, then, I update my control height, but the height of the control really doesn't change!! I suspect that the `TextBoundsChanged` event is raised when the `UserControl` is being resized. The `UserControl` is being resized also, so I'm afraid that . Am I right? Someone know how to workaround this issue? Thanks in advance. --- > : The user control not only show text. This is only a simplified sample. So, my user control needs to vertically grow when I reduce the width, in order to show the whole text in the label. the label is not a custom winforms label, because it renders HTML content. Also, I'm using .NET1, so the word wrap property is not available for me
C#: Cannot update control height while resizing
CC BY-SA 2.5
null
2011-02-15T09:23:32.470
2011-02-15T09:53:50.587
2011-02-15T09:53:50.587
402,081
402,081
[ "c#", ".net", "winforms", "user-controls", "resize" ]
5,001,986
1
5,005,004
null
1
597
i am trying to detect a screen touch on my current application such that when the user touches a part of the screen my app basically retrieves a text file from the SD card and display's the text in the file onto a textview is it possible for me to append a customize vibration pattern to the text upon touch For example, "HELLO" is retrieved from the text file and display via textview ![enter image description here](https://i.stack.imgur.com/RRt5e.png) when i touch on the individual characters, a preset vibration is used i am using this to achieve the vibrations with all the various patterns set. ``` vibrator.vibrate(pattern101, -1); ```
setting custom vibration profile on screen touch
CC BY-SA 3.0
0
2011-02-15T09:44:00.200
2015-01-17T18:49:01.433
2015-01-17T18:49:01.433
3,879,847
578,198
[ "android" ]
5,002,090
1
5,003,262
null
0
457
Well, i am new in this flash thing and in the learning stage. on the stage are four buttons. they will behave like map. now what i want to do is, that i want to use xml. when i click on button, it should display some text, like title, description, address etc below the map and the these details should come from an external xml file. i am pretty confused over here. can anybody suggest what i should do? Thanks in advance.... ![enter image description here](https://i.stack.imgur.com/OO6Y8.jpg)
XML in flash that should fetch data from an external xml file
CC BY-SA 2.5
null
2011-02-15T09:54:03.893
2011-06-22T20:04:54.350
2011-06-22T20:04:54.350
573,432
490,932
[ "xml", "flash", "actionscript-3", "actionscript", "as3crypto" ]
5,002,139
1
5,273,259
null
15
5,118
So I have this page with a bunch of jQuery functions. I have no breakpoints at all but Firebug always breaks/jumps to a JS function like there is a breakpoint but there isn't!!! ![enter image description here](https://i.stack.imgur.com/OszQm.png) Its also breaks some JS in the page (not everything). I mean, I hit 'play' or 'F8' a couple of times to continue/stop debugging but then some JS functions does not work anymore. Everything works fine when Firebug is turned off. I'm using Firefox 3.6.13 with Firebug 1.6.2. Any idea why its happening and how to fix it??
Firebug debug jumps/breaks on non-existing breakpoint!
CC BY-SA 2.5
0
2011-02-15T09:59:32.813
2018-04-25T16:31:31.907
null
null
63,651
[ "debugging", "firefox", "firebug", "breakpoints" ]
5,002,501
1
5,033,563
null
18
5,104
The following issue has been plaguing me for days now, but I've only just been able to distill it down to its simplest form. Consider the following XAML: ``` <Window x:Class="VSMTest.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Window.Resources> <Style TargetType="CheckBox"> <Setter Property="Margin" Value="3"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="CheckBox"> <Grid x:Name="Root"> <Grid.Background> <SolidColorBrush x:Name="brush" Color="White"/> </Grid.Background> <VisualStateManager.VisualStateGroups> <VisualStateGroup Name="CheckStates"> <VisualStateGroup.Transitions> <VisualTransition To="Checked" GeneratedDuration="00:00:03"> <Storyboard Name="CheckingStoryboard"> <ColorAnimationUsingKeyFrames Storyboard.TargetName="brush" Storyboard.TargetProperty="Color"> <DiscreteColorKeyFrame KeyTime="0" Value="LightGreen"/> </ColorAnimationUsingKeyFrames> </Storyboard> </VisualTransition> <VisualTransition To="Unchecked" GeneratedDuration="00:00:03"> <Storyboard Name="UncheckingStoryboard"> <ColorAnimationUsingKeyFrames Storyboard.TargetName="brush" Storyboard.TargetProperty="Color"> <DiscreteColorKeyFrame KeyTime="0" Value="LightSalmon"/> </ColorAnimationUsingKeyFrames> </Storyboard> </VisualTransition> </VisualStateGroup.Transitions> <VisualState Name="Checked"> <Storyboard Name="CheckedStoryboard" Duration="0"> <ColorAnimationUsingKeyFrames Storyboard.TargetName="brush" Storyboard.TargetProperty="Color"> <DiscreteColorKeyFrame KeyTime="0" Value="Green"/> </ColorAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState Name="Unchecked"> <Storyboard Name="UncheckedStoryboard" Duration="0"> <ColorAnimationUsingKeyFrames Storyboard.TargetName="brush" Storyboard.TargetProperty="Color"> <DiscreteColorKeyFrame KeyTime="0" Value="Red"/> </ColorAnimationUsingKeyFrames> </Storyboard> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> <ContentPresenter/> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> </Window.Resources> <StackPanel> <CheckBox x:Name="cb1">Check Box 1</CheckBox> <CheckBox x:Name="cb2">Check Box 2</CheckBox> <CheckBox x:Name="cb3">Check Box 3</CheckBox> </StackPanel> </Window> ``` It simply re-templates the `CheckBox` control so that its background is dependent upon its state: - - - - So, when you check one of the check boxes, you'd expect it to turn light green for a short period, and then turn green. Similarly, when unchecking, you'd expect it to turn light red for a short period, and then turn red. Play with the program long enough (I can get it in around 30 seconds) and you'll find that the transition animation sometimes trumps that in the visual state. That is, the check box will continue to appear light green when selected, or light red when unselected. Here's a screenshot illustrating what I mean, taken well after the 3 seconds the transition is configured to take: ![enter image description here](https://i.stack.imgur.com/i2zT2.png) When this occurs, it's because the control didn't successfully transition to the target state. It purports to be in the correct state. I verified this by checking the following in the debugger (for the specific case documented by the above screenshot): ``` var vsgs = VisualStateManager.GetVisualStateGroups(VisualTreeHelper.GetChild(this.cb2, 0) as FrameworkElement); var vsg = vsgs[0]; // this is correctly reported as "Unselected" var currentState = vsg.CurrentState.Name; ``` If I enable tracing for animations, I get the following output when the transition completes successfully: ``` System.Windows.Media.Animation Start: 1 : Storyboard has begun; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='44177654'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; StoryboardName='UncheckedStoryboard'; TargetElement='System.Windows.Controls.Grid'; TargetElement.HashCode='41837403'; TargetElement.Type='System.Windows.Controls.Grid'; NameScope='<null>' System.Windows.Media.Animation Stop: 1 : System.Windows.Media.Animation Start: 1 : Storyboard has begun; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='6148812'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; StoryboardName='UncheckedStoryboard'; TargetElement='System.Windows.Controls.Grid'; TargetElement.HashCode='8261103'; TargetElement.Type='System.Windows.Controls.Grid'; NameScope='<null>' System.Windows.Media.Animation Stop: 1 : System.Windows.Media.Animation Start: 1 : Storyboard has begun; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='36205315'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; StoryboardName='UncheckedStoryboard'; TargetElement='System.Windows.Controls.Grid'; TargetElement.HashCode='18626439'; TargetElement.Type='System.Windows.Controls.Grid'; NameScope='<null>' System.Windows.Media.Animation Stop: 1 : System.Windows.Media.Animation Start: 3 : Storyboard has been removed; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='44177654'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; StoryboardName='UncheckedStoryboard'; TargetElement='System.Windows.Controls.Grid'; TargetElement.HashCode='41837403'; TargetElement.Type='System.Windows.Controls.Grid' System.Windows.Media.Animation Stop: 3 : System.Windows.Media.Animation Start: 1 : Storyboard has begun; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='36893403'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; StoryboardName='CheckingStoryboard'; TargetElement='System.Windows.Controls.Grid'; TargetElement.HashCode='41837403'; TargetElement.Type='System.Windows.Controls.Grid'; NameScope='<null>' System.Windows.Media.Animation Stop: 1 : System.Windows.Media.Animation Start: 1 : Storyboard has begun; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='49590434'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; StoryboardName='<null>'; TargetElement='System.Windows.Controls.Grid'; TargetElement.HashCode='41837403'; TargetElement.Type='System.Windows.Controls.Grid'; NameScope='<null>' System.Windows.Media.Animation Stop: 1 : System.Windows.Media.Animation Start: 3 : Storyboard has been removed; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='36893403'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; StoryboardName='CheckingStoryboard'; TargetElement='System.Windows.Controls.Grid'; TargetElement.HashCode='41837403'; TargetElement.Type='System.Windows.Controls.Grid' System.Windows.Media.Animation Stop: 3 : System.Windows.Media.Animation Start: 3 : Storyboard has been removed; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='49590434'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; StoryboardName='<null>'; TargetElement='System.Windows.Controls.Grid'; TargetElement.HashCode='41837403'; TargetElement.Type='System.Windows.Controls.Grid' System.Windows.Media.Animation Stop: 3 : System.Windows.Media.Animation Start: 1 : Storyboard has begun; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='16977025'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; StoryboardName='CheckedStoryboard'; TargetElement='System.Windows.Controls.Grid'; TargetElement.HashCode='41837403'; TargetElement.Type='System.Windows.Controls.Grid'; NameScope='<null>' System.Windows.Media.Animation Stop: 1 : System.Windows.Media.Animation Start: 3 : Storyboard has been removed; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='16977025'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; StoryboardName='CheckedStoryboard'; TargetElement='System.Windows.Controls.Grid'; TargetElement.HashCode='41837403'; TargetElement.Type='System.Windows.Controls.Grid' System.Windows.Media.Animation Stop: 3 : System.Windows.Media.Animation Start: 1 : Storyboard has begun; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='16977025'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; StoryboardName='CheckedStoryboard'; TargetElement='System.Windows.Controls.Grid'; TargetElement.HashCode='41837403'; TargetElement.Type='System.Windows.Controls.Grid'; NameScope='<null>' System.Windows.Media.Animation Stop: 1 : ``` And I get the following output when the transition fails to complete successfully: ``` System.Windows.Media.Animation Start: 1 : Storyboard has begun; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='44177654'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; StoryboardName='UncheckedStoryboard'; TargetElement='System.Windows.Controls.Grid'; TargetElement.HashCode='41837403'; TargetElement.Type='System.Windows.Controls.Grid'; NameScope='<null>' System.Windows.Media.Animation Stop: 1 : System.Windows.Media.Animation Start: 1 : Storyboard has begun; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='6148812'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; StoryboardName='UncheckedStoryboard'; TargetElement='System.Windows.Controls.Grid'; TargetElement.HashCode='8261103'; TargetElement.Type='System.Windows.Controls.Grid'; NameScope='<null>' System.Windows.Media.Animation Stop: 1 : System.Windows.Media.Animation Start: 1 : Storyboard has begun; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='36205315'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; StoryboardName='UncheckedStoryboard'; TargetElement='System.Windows.Controls.Grid'; TargetElement.HashCode='18626439'; TargetElement.Type='System.Windows.Controls.Grid'; NameScope='<null>' System.Windows.Media.Animation Stop: 1 : System.Windows.Media.Animation Start: 3 : Storyboard has been removed; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='44177654'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; StoryboardName='UncheckedStoryboard'; TargetElement='System.Windows.Controls.Grid'; TargetElement.HashCode='41837403'; TargetElement.Type='System.Windows.Controls.Grid' System.Windows.Media.Animation Stop: 3 : System.Windows.Media.Animation Start: 1 : Storyboard has begun; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='36893403'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; StoryboardName='CheckingStoryboard'; TargetElement='System.Windows.Controls.Grid'; TargetElement.HashCode='41837403'; TargetElement.Type='System.Windows.Controls.Grid'; NameScope='<null>' System.Windows.Media.Animation Stop: 1 : System.Windows.Media.Animation Start: 1 : Storyboard has begun; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='49590434'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; StoryboardName='<null>'; TargetElement='System.Windows.Controls.Grid'; TargetElement.HashCode='41837403'; TargetElement.Type='System.Windows.Controls.Grid'; NameScope='<null>' System.Windows.Media.Animation Stop: 1 : ``` The first 12 lines are exactly the same as when the transition succeeds, but the final 10 lines are completely missing! I've read through all the VSM documentation I could find and have not been able to come up with an explanation for this erratic behavior.
VisualStateManager not working as advertised
CC BY-SA 2.5
0
2011-02-15T10:29:08.433
2017-02-21T17:18:21.530
2011-02-15T11:31:06.790
5,380
5,380
[ "wpf", "silverlight", "animation", "transitions" ]
5,002,821
1
5,003,121
null
2
3,344
in my splitviewcontroller iPad app I show a custom popover (which loads the rootviewController). How to show not only the table view, but also a navigationbar on top of it (to show the table title "Categories"). Here is my app: ![enter image description here](https://i.stack.imgur.com/w579K.jpg) My code to show the popover: ``` - (IBAction)showPopover:(UIButton *)sender { if([self.popoverController isPopoverVisible]) { [self.popoverController dismissPopoverAnimated:YES]; return; } // Build a custom popover view TemplatesAppDelegate *delegate = (TemplatesAppDelegate*)[[UIApplication sharedApplication] delegate]; // Create a popover controller self.popoverController = [[[UIPopoverController alloc] initWithContentViewController:delegate.rootViewController] autorelease]; // Present the popover view non-modal at the pressed button's position [self.popoverController presentPopoverFromRect:sender.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES]; } ```
Navigation Bar in UIPopover
CC BY-SA 2.5
0
2011-02-15T11:01:06.953
2015-12-08T07:35:41.147
null
null
76,371
[ "cocoa-touch", "ipad", "uitableview", "uisplitviewcontroller", "uipopovercontroller" ]
5,002,905
1
null
null
1
1,486
I have table `category` with columns ``` id, parent_id, title, ordering (ordered according to same level of hierarchy by parent_id) ``` Look at this image: ![This is my table data's hierarchy level, the number beside the cat name is value of ordering and the level of hierarchy is according to parent_id value starting 0-4](https://i.stack.imgur.com/hWh0f.gif) I need a query which will give following output: ``` 1. cat A 2. cat C 3. cat D 4. cat B 5. cat E 6. cat F 7. cat H 8. cat K 9. cat I 10. cat J 11. cat G ```
mysql query for ordering multilevel category data
CC BY-SA 3.0
0
2011-02-15T11:13:39.627
2016-04-28T06:22:36.897
2016-04-28T06:22:36.897
13,302
602,618
[ "mysql" ]
5,002,952
1
5,003,686
null
5
3,458
Below is a screenshot of the POST request (using Firebug Net panel) I am sending to my ASP.NET MVC2 controller. ![post request snapshot](https://i.stack.imgur.com/SLJ3r.png) This is the controller / action method that receives the POST request: ``` public ActionResult Search(int[] skill, int[] discipline, int[] education, int[] marketsector){ ... } ``` The parameters POSTed seem to me to be in the correct form, however the action method receives four null arguments. Could you please tell me what should the method signature look like on the server side? Or a better way of posting these four integer arrays to my MVC2 controller?
Posting int arrays to MVC controller - what would be the correct method signature?
CC BY-SA 2.5
null
2011-02-15T11:19:05.760
2011-02-15T12:33:22.853
null
null
81,520
[ "asp.net", "asp.net-mvc-2", "http", "post", "controller" ]
5,002,996
1
5,019,457
null
3
8,281
When i writing: "System.W...", the intellisence isn't show me "System.Web" why? ![enter image description here](https://i.stack.imgur.com/QJdjA.jpg)
How to reference System.Web namespace?
CC BY-SA 2.5
null
2011-02-15T11:23:22.300
2019-04-26T11:06:24.573
2011-02-15T11:33:30.297
366,904
273,455
[ ".net", "asp.net", "visual-studio", "visual-studio-2010", "system.web" ]
5,003,094
1
5,471,487
null
18
14,175
I'm trying to create a Matplotlib animation of my paw data, where you can see the pressure distribution on [the entire pressure plate over time](https://i.stack.imgur.com/ct8ub.gif) (256x64 sensors for 250 frames). I found a [working example on Matplotlib's own site](http://matplotlib.sourceforge.net/examples/animation/dynamic_image_wxagg2.html) and managed to get it working on my own data. However the 'animation' is awfully slow and I have no idea how to speed it up. Here's an example of a gif Joe Kington [made in another answer](https://stackoverflow.com/questions/4087919/how-can-i-improve-my-paw-detection/4092160#4092160), which is about the speed with which it gets displayed. Considering the measurements are done at 125 Hz, this makes the measurements look awfully slow. If it ran at 30-60 fps, it could be run in 4 or 8 seconds rather than the current 20+. ![enter image description here](https://i.stack.imgur.com/AByKS.gif) ![enter image description here](https://i.stack.imgur.com/0IJuB.gif) I don't mind using whatever tool I need to get the job done, as long as there's some good documentation to figure out how to do it. So my question is: [I've implemented Ignacio's suggestion](http://pastebin.com/6iiuAQJY) to put in t.Start(1), however it only runs 'decently' when the Figure is this large: ![enter image description here](https://i.stack.imgur.com/YjBVb.png) ``` class PlotFigure(Frame): """ This class draws a window and updates it with data from DataCollect """ def __init__(self): Frame.__init__(self, None, -1, "Test embedded wxFigure") #Varying the size of Figure has a big influence on the speed self.fig = Figure((3,3), 75) self.canvas = FigureCanvasWxAgg(self, -1, self.fig) EVT_TIMER(self, TIMER_ID, self.onTimer) def init_plot_data(self): self.datagen = DataCollect(array3d) self.axes = self.fig.add_subplot(111) self.axes.imshow(self.datagen.next().T) def onTimer(self, evt): self.data = self.datagen.next() self.axes.imshow(self.datagen.next().T) self.canvas.draw() ``` When I resize the window during the animation, it immediately slows down to a crawl. Which makes me suspect the delay isn't the only cause of the slow down. In case you're curious, [here's a link to one of the ASCII files.](http://dl.dropbox.com/u/5207386/rolloff)
How can I speed up an animation?
CC BY-SA 2.5
0
2011-02-15T11:32:45.310
2014-11-17T21:05:12.173
2017-05-23T11:53:20.223
-1
77,595
[ "python", "animation" ]
5,003,585
1
5,013,995
null
0
3,134
i have a problem with `overflow:hidden` and the body tag. Here is a little exmaple (dont work) ``` <body style="border: 1px solid #ff0000; width:100%; height:200px; overflow:hidden;"> <div style="width:50px; height:50px; border: 1px solid #0000ff; position:absolute; top-10px;"></div> </body> ``` [http://jsfiddle.net/5hGSp/13/](http://jsfiddle.net/5hGSp/13/) (works) ``` <div style="border: 1px solid #ff0000; width:100%; height:200px; overflow:hidden;"> <div style="width:50px; height:50px; border: 1px solid #0000ff; position:absolute; top-10px;"></div> </div> ``` [http://jsfiddle.net/5hGSp/12/](http://jsfiddle.net/5hGSp/12/) When you click (middle mousekey) into the red area -> the mouse-software start the scrollfunction. ![enter image description here](https://i.stack.imgur.com/3hs4j.png) ... but only in the "body version" ! Hope someone can help me. in advance! Peter Sry, it is very hard to me to explain it in english. But i try it again. 1) Copy the code into an .*html file. 2) Open the file and click (middle mousekey) into the body tag (red area). 3) Did the mousescroll function start? ...did you see an scroll icon (for example from the logitech software?) 4a) if not, everything works fine 4b) you see the icon? You know how to disable? -> write a comment pls ``` <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Unbenanntes Dokument</title> <style type="text/css"> body { border: 1px solid #ff0000; width:100%; height:200px; overflow:hidden; } </style> </head> <body> <div style="width:50px; height:50px; border: 1px solid #0000ff; position:absolute; top:-10px;"></div> </body> </html> ```
Different between body { overflow hidden; } and #div { overflow hidden; }
CC BY-SA 2.5
null
2011-02-15T12:23:08.787
2012-01-03T20:26:26.893
2012-01-03T20:26:26.893
861,565
2,136,202
[ "jquery", "html", "css", "overflow" ]
5,003,616
1
null
null
16
8,541
I have my app running on my iPad. but it is performing very badly -- I am getting below 15fps. can anyone help me to optimise? It is basically a wheel (derived from UIView) containing 12 buttons (derived from UIControl). ![image of control](https://i.stack.imgur.com/OCHwc.png) As the user spins it, the buttons dynamically expand and contract (e.g. the one at the 12 o'clock position should always be the biggest) So my wheel contains a: ``` - (void) displayLinkIsCallingBack: (CADisplayLink *) dispLink { : // using CATransaction like this goes from 14fps to 19fps [CATransaction begin]; [CATransaction setDisableActions: YES]; // NEG, as coord system is flipped/fucked self.transform = CGAffineTransformMakeRotation(-thetaWheel); [CATransaction commit]; if (BLA) [self rotateNotch: direction]; } ``` … which calculates from recent touch input the new rotation for the wheel. There is already one performance issue here which I am pursuing on a separate thread: [iOS Core-Animation: Performance issues with CATransaction / Interpolating transform matrices](https://stackoverflow.com/questions/5003394/ios-core-animation-performance-issues-with-catransaction-interpolating-transfo) This routine also checks whether the wheel has completed another 1/12 rotation, and if so instructs all 12 buttons to resize: ``` // Wheel.m - (void) rotateNotch: (int) direction { for (int i=0; i < [self buttonCount] ; i++) { CustomButton * b = (CustomButton *) [self.buttons objectAtIndex: i]; // Note that b.btnSize is a dynamic property which will calculate // the desired button size based on the button index and the wheels rotation. [b resize: b.btnSize]; } } ``` Now for the actual resizing code, in button.m: ``` // Button.m - (void) scaleFrom: (float) s_old to: (float) s_new time: (float) t { CABasicAnimation * scaleAnimation = [CABasicAnimation animationWithKeyPath: @"transform.scale"]; [scaleAnimation setDuration: t ]; [scaleAnimation setFromValue: (id) [NSNumber numberWithDouble: s_old] ]; [scaleAnimation setToValue: (id) [NSNumber numberWithDouble: s_new] ]; [scaleAnimation setTimingFunction: [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseOut] ]; [scaleAnimation setFillMode: kCAFillModeForwards]; scaleAnimation.removedOnCompletion = NO; [self.contentsLayer addAnimation: scaleAnimation forKey: @"transform.scale"]; if (self.displayShadow && self.shadowLayer) [self.shadowLayer addAnimation: scaleAnimation forKey: @"transform.scale"]; size = s_new; } // - - - - (void) resize: (float) newSize { [self scaleFrom: size to: newSize time: 1.]; } ``` I wonder if the problem is related to the overhead of multiple transform.scale operations queueing up -- each button resize takes a full second to complete, and if I am spinning the wheel fast I might spin a couple of revolutions per second; that means that each button is getting resized 24 times per second. ** creating the button's layer ** The final piece of the puzzle I guess is to have a look at the button's contentsLayer. but I have tried ``` contentsLayer.setRasterize = YES; ``` which should effectively be storing it as a bitmap. so with the setting the code is in effect dynamically resizing 12 bitmaps. I can't believe this is taxing the device beyond its limits. however, core animation instrument tells me otherwise; while I am rotating the wheel (by dragging my finger in circles), it is reporting ~15fps. This is no good: I eventually need to put a text layer inside each button and this is going to drag performance down further (...unless I am using the .setRasterize setting above, in which case it should be the same). There must be something I'm doing wrong! but what? EDIT: here is the code responsible for generating the button content layer (ie the shape with the shadow): ``` - (CALayer *) makeContentsLayer { CAShapeLayer * shapeOutline = [CAShapeLayer layer]; shapeOutline.path = self.pOutline; CALayer * contents = [CALayer layer]; // get the smallest rectangle centred on (0,0) that completely contains the button CGRect R = CGRectIntegral(CGPathGetPathBoundingBox(self.pOutline)); float xMax = MAX(abs(R.origin.x), abs(R.origin.x+R.size.width)); float yMax = MAX(abs(R.origin.y), abs(R.origin.y+R.size.height)); CGRect S = CGRectMake(-xMax, -yMax, 2*xMax, 2*yMax); contents.bounds = S; contents.shouldRasterize = YES; // try NO also switch (technique) { case kMethodMask: // clip contents layer by outline (outline centered on (0, 0)) contents.backgroundColor = self.clr; contents.mask = shapeOutline; break; case kMethodComposite: shapeOutline.fillColor = self.clr; [contents addSublayer: shapeOutline]; self.shapeLayer = shapeOutline; break; default: break; } if (NO) [self markPosition: CGPointZero onLayer: contents ]; //[self refreshTextLayer]; //[contents addSublayer: self.shapeLayerForText]; return contents; } ``` as you can see, I'm trying every possible approach, I am trying two methods for making the shape, and separately I am toggling .shouldRasterize ** compromising the UI design to get tolerable frame rate ** EDIT: Now I have tried disabling the dynamic resizing behaviour until the wheel settles into a new position, and setting wheel.setRasterize = YES. so it is effectively spinning a single prerendered UIView (which is admittedly taking up most of the screen) underneath the finger (which it happily does @~60fps), until the wheel comes to rest, at which point it performs this laggy resizing animation (@<20fps). while this gives a tolerable result, it seems nuts that I am having to sacrifice my UI design in such a way. I feel sure I must be doing something wrong. EDIT: I have just tried as an experiment to resize buttons manually; ie put a display link callback in each button, and dynamically calculate the expected size of this given frame, explicitly disable animations with CATransaction the same as I did with the wheel, set the new transformation matrix (scale transform generated from the expected size). added to this I have set the buttons content layer shouldRasterize = YES. so it should be simply scaling 12 bitmaps each frame onto a single UIView which is itself rotating. amazingly this is dead slow, it is even bringing the simulator to a halt. It is definitely 10 times slower than doing it automatically using core animation's animation feature.
iOS / Core-Animation: Performance tuning
CC BY-SA 2.5
0
2011-02-15T12:26:28.213
2020-11-11T11:22:08.803
2020-06-20T09:12:55.060
-1
435,129
[ "performance", "ios", "optimization", "core-animation" ]
5,003,667
1
null
null
2
4,164
![IE9 rendered image](https://i.stack.imgur.com/E9b2t.png) The above image is the HTML for filtering some data in my website. I have 2 labels and 2 selections in this text align center line. All elements are displayed as inline. Everything is perfectly work on IE9 RC and Chrome 9. But it does not work on IE7 and IE8 because text in all labels is display at the bottom of line like the following image. ![IE7 rendered image](https://i.stack.imgur.com/40FFG.png) Do you have any CSS for this problem? You can edit my jsFiddle for trying to solve this question. [http://www.jsfiddle.net/AaDkd/](http://www.jsfiddle.net/AaDkd/) I try to set line-height of all related element with the height of current line. But it does not work on IE7. ![enter image description here](https://i.stack.imgur.com/QBZJp.png) Source code: [http://jsfiddle.net/AaDkd/1/](http://jsfiddle.net/AaDkd/1/) Demo: [http://fiddle.jshell.net/AaDkd/1/show/](http://fiddle.jshell.net/AaDkd/1/show/) ![enter image description here](https://i.stack.imgur.com/6XEjv.png) As you see, I remove all styles of controls but the vertical-center of text in selection and label do not exactly equal when I use IE7. This occurs because default height of selection (that impossible to adjust in IE7) and height of label or span do not equal. Source code: [http://jsfiddle.net/AaDkd/5/](http://jsfiddle.net/AaDkd/5/) Demo: [http://fiddle.jshell.net/AaDkd/5/show/](http://fiddle.jshell.net/AaDkd/5/show/) PS. Don't forget that text-align of this line is center.
How to set vertical align of inline object like label or span is in line that set text align equals center for IE7-8?
CC BY-SA 2.5
0
2011-02-15T12:31:40.293
2011-02-16T11:15:23.347
2011-02-16T04:20:42.400
null
null
[ "css", "internet-explorer-8", "internet-explorer-7" ]
5,004,012
1
null
null
0
1,223
I am using Slider Extender for the very first time and i am not able to figure out why am i facing this problem, the problem is mentioned below : I kept the slider extender, Script Manager and 2 text boxes(one for TargetControl and one for BoundControl), i have given all required values (i.e. Maximum, minimum, steps etc.) now the slider should load on page load. Although the slider is loading on page load but the Bar of the slider is coming out of position. The same thing when i did with Orientation as Horizontal it worked properly but for Vertical orientation it is giving the above problem. Please look into it.Thanks in advance ![enter image description here](https://i.stack.imgur.com/C0fJm.jpg)
Slider Extender Control in Ajax asp.net
CC BY-SA 2.5
null
2011-02-15T13:07:44.257
2011-03-23T10:42:00.483
null
null
523,927
[ "asp.net", "ajaxcontroltoolkit" ]
5,004,244
1
5,005,377
null
0
1,390
I getting problem in PopUp position in safari. I used "" for Confirmation box in my web application It work good in all browsers except safari browser. check image what I exactly getting issue.. ![enter image description here](https://i.stack.imgur.com/c6ysw.jpg)
How to fix Jquery modal popup in Safari Browser?
CC BY-SA 2.5
null
2011-02-15T13:29:51.337
2011-02-15T15:10:15.920
null
null
568,085
[ "jquery", "asp.net", "jquery-plugins", "popup", "javascript-framework" ]
5,004,569
1
5,004,843
null
0
594
hello i got the same problem as [php :: new line in textarea?](https://stackoverflow.com/questions/3911261/php-new-line-in-textarea) ![enter image description here](https://i.stack.imgur.com/nZuc3.png) but it seems its not answered well in the above link. `the var_dump($post['content']);` shows me or something like ``` <pre dir="ltr" class="xdebug-var-dump"><small>string</small> <font color="#cc0000">'Duis libero sapien, cursus id tempus a, sollicitudin at urna. Maecenas elementum molestie massa quis pharetra. Donec eu libero ipsum. Aenean laoreet, tellus at pretium porta, nisl massa sodales massa, non laoreet sapien velit a neque. Praesent eleifend urna et diam sollicitudin eget pretium quam viverra. Sed rutrum enim quis lectus volutpat eleifend. Nam in augue at diam tempus feugiat ac eu orci. Morbi pellentesque consequat lacinia. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesqu'...</font> <i>(length=634)</i></pre> ``` or ![enter image description here](https://i.stack.imgur.com/egEue.png) heres how i out put it. ``` <textarea name="content" cols="100" rows="50"><?php echo $post['content']; ?></textarea> ``` ![enter image description here](https://i.stack.imgur.com/RuXYb.png) thanks for looking in. Adam Ramadhan i am very sorry for the problem. the problem is yes im compressing each output from the views, heres the function ``` public function compressor( $buffer ) { $search = array( '/(\s)+/s', // shorten multiple whitespace sequences <- THE MAIN PROBLEM '/<!--(.|\s)*?-->/', //strip html comments '/\>[^\S ]+/s', //strip whitespaces after tags, except space '/[^\S ]+\</s', //strip whitespaces before tags, except space ); $replace = array( '\\1', '', '>', '<' ); $buffer = preg_replace($search, $replace, $buffer); return $buffer; } ``` heres how i output my views ``` protected function view($view, $data = NULL) { require_once 'libraries/core.views.php'; $views = new Views; if ( config('compress') ) { /* See @ref #1 we are useing compressor just becouse ob_gzhandler dont support UTF-8 at the header, see http://php.net/manual/en/function.ob-start.php#91963 */ ob_start(array($this,'compressor')); # ob_start("ob_gzhandler"); } #renders the data into view vars if (isset($data)) { foreach ( $data as $name => $val ) { $$name = $val; } } #require 'libraries/language/'. config('language') .'.php'; $path = "application". DS ."views". DS . $view .".php"; require $path; return TRUE; if ( config('compress') ) { while (ob_get_level() > 0) { ob_end_flush(); } } } ``` again sorry, and thanks !
Can't see newline when echoing in textarea
CC BY-SA 2.5
0
2011-02-15T13:59:42.097
2011-02-15T14:40:54.663
2017-05-23T11:48:24.847
-1
320,486
[ "php", "html", "textarea" ]
5,004,602
1
5,004,679
null
0
1,122
I have designed a layout and i find some gaps in the stacking of divs over each other. can some one help me [http://uniquedl.com/3closets/about.html](http://uniquedl.com/3closets/about.html) ![enter image description here](https://i.stack.imgur.com/xFUKF.png) and ![enter image description here](https://i.stack.imgur.com/SzzoU.png)
CSS problem - gaps between divs
CC BY-SA 2.5
null
2011-02-15T14:02:49.487
2012-06-04T05:08:50.967
null
null
155,196
[ "html", "css", "layout" ]
5,004,633
1
5,004,695
null
467
206,171
I want to create a `.htaccess` file manually and discovered it seems impossible through the Windows UI. I get a message. There has to be a way to create files with `.` as a prefix in Windows. Can this be done manually? ![Enter image description here](https://i.stack.imgur.com/R0tlR.jpg)
How do I manually create a file with a . (dot) prefix in Windows? For example, .htaccess
CC BY-SA 4.0
0
2011-02-15T14:06:26.173
2022-09-28T07:03:10.920
2019-08-04T22:20:57.997
63,550
564,083
[ "windows", ".htaccess", "windows-xp", "filenames" ]
5,004,761
1
5,004,816
null
1
3,444
I made an application which download lots of data and I want to add some animation why it is loading and freeze the screen. I have already find function which work but it only freeze button function: ``` [super setEditing:(BOOL)editing animated:(BOOL)animated]; self.navigationItem.rightBarButtonItem.enabled = !editing; ``` I' ve seen some application which already use this kind of animation.the image should look like this: ![enter image description here](https://i.stack.imgur.com/vT8DJ.gif)
Objective-C: How can I freeze the screen and add loading animation?
CC BY-SA 4.0
null
2011-02-15T14:18:47.220
2019-01-28T08:12:34.023
2019-01-28T08:12:34.023
1,033,581
573,925
[ "iphone", "ios", "loading", "freeze" ]
5,004,875
1
5,004,989
null
1
2,816
I followed [this tutorial](http://www.stealthcopter.com/blog/2010/08/making-prettier-buttons-in-android-xml-rolloverselection-focus-effects-9patch-images-and-transparency/) to make some nicer buttons for Android, I also took the example 9-patch button from that site. It is this one: ![enter image description here](https://i.stack.imgur.com/wtiVz.png) But as you can see in the following image, my buttons are not displayed correctly. ![enter image description here](https://i.stack.imgur.com/qDU0K.png) Here is the code of the "4 x 4" button: ``` <Button android:id="@+id/btn4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClick="starteSpiel" android:text=" 4 x 4 " android:background="@drawable/button" /> ``` And here is my button.xml: ``` <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/button_normal" /> <item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/button_normal" /> <item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/button_normal" /> <item android:drawable="@drawable/button_normal" /> ``` Where is the error? The buttons should look like the ones in the [tutorial](http://www.stealthcopter.com/blog/2010/08/making-prettier-buttons-in-android-xml-rolloverselection-focus-effects-9patch-images-and-transparency/).
9-patch buttons not displayed correctly
CC BY-SA 2.5
null
2011-02-15T14:28:55.923
2012-01-20T17:22:35.167
null
null
453,895
[ "android", "button" ]
5,004,889
1
5,005,848
null
0
2,181
I'm really really stuck the following problem. I used FrameLayout inside LinearLayout and then through code i added linearlayout to this FrameLayout but it produce an extra space. I have given the screen shot below. ![enter image description here](https://i.stack.imgur.com/VOs0y.png) I part marked as white is the problem. i need to remove this. My FrameLayout ``` <TabHost android:cacheColorHint="#00000000" android:id="@android:id/tabhost" android:layout_width="wrap_content" android:layout_height="wrap_content"> <TabWidget android:id="@android:id/tabs" android:cacheColorHint="#00000000" android:visibility="gone" android:layout_width="100dp" android:layout_height="10dp"> </TabWidget> <FrameLayout tyle="@style/tabhost" android:cacheColorHint="#00000000" android:id="@android:id/tabcontent" android:layout_width="wrap_content" android:layout_height="fill_parent" /> </TabHost> ``` This is the linearLayout i added this FrameLayout ``` <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#FFFFFF"/> ``` Thank you
extra line in tab host
CC BY-SA 2.5
null
2011-02-15T14:29:57.650
2011-02-19T05:39:07.290
2011-02-19T05:39:07.290
609,646
609,646
[ "android" ]
5,004,947
1
11,550,855
null
3
1,024
Say I have two Entities: ![Entities](https://i.stack.imgur.com/ecrrF.png) Each Message belongs to a single MessageThread. How do I get all the message threads and the corresponding last message on that thread? Normally, in SQL, I'd do it as: select __ from message group by thread having timeStamp=max(timeStamp) For one, I don't think Core Data allows the @max in its predicates. Any ideas?
Core Data Problem - select group by/having max
CC BY-SA 2.5
null
2011-02-15T14:36:16.080
2014-03-31T19:07:54.157
null
null
319,688
[ "iphone", "cocoa", "core-data" ]
5,005,093
1
5,005,367
null
0
261
Hy! I have two pictures on the view and a button at the buttom. But the Problem is that the last picture is drawn at the button and not under the first on. So the button at the buttom is unvisible. ![Screenshot](https://i.stack.imgur.com/XMzF7.png) XML: ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width="fill_parent" android:orientation="vertical"> <TextView android:layout_height="wrap_content" android:id="@+id/mainscreen" android:layout_width="fill_parent" android:text="Selected Channel" android:gravity="center"></TextView> <ImageView android:id="@+id/ImageView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></ImageView> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/mainscreen_state"></TextView> <ImageView android:layout_width="wrap_content" android:layout_centerHorizontal="true" android:layout_height="wrap_content" android:id="@+id/ImageAd" android:layout_gravity="center"></ImageView> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="fill_parent" android:layout_width="fill_parent"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:id="@+id/mainscreen_btchange" android:text="Change State"></Button> </RelativeLayout> </LinearLayout> ```
How to choose the right picture size
CC BY-SA 2.5
null
2011-02-15T14:49:18.007
2011-02-15T15:09:45.403
2011-02-15T14:58:28.577
547,995
547,995
[ "android" ]
5,005,192
1
null
null
1
404
I am creating an alert dialog with Android with this code: ``` AlertDialog ad = new AlertDialog.Builder(self) .setTitle("Invalid Input") .setMessage("The number you entered is not a real number.") .setNeutralButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which){} } ).show(); ``` I also have an application theme that looks like this: ``` <style name="CustomTheme" parent="@android:style/Theme.NoTitleBar"> <item name="android:layout_width">fill_parent</item> <item name="android:layout_height">wrap_content</item> <item name="android:textColor">#222222</item> <item name="android:background">#DDDDDD</item> </style> ``` As you can see, I'm not theming the dialog or changing it's colors, but it shows up very strangely. It looks like this: ![Android Alert Dialog](https://i.stack.imgur.com/dX5PR.png) Does anyone know how to make it appear more normal?
Android Alert Dialog coloring is off
CC BY-SA 2.5
null
2011-02-15T14:56:53.577
2014-06-18T19:06:08.687
null
null
12,243
[ "java", "android", "android-alertdialog" ]
5,005,773
1
5,005,933
null
0
354
Hy! I have two pictures on the view and a button at the buttom. ![Screenshot](https://i.stack.imgur.com/XMzF7.png) XML: ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width="fill_parent" android:orientation="vertical"> <TextView android:layout_height="wrap_content" android:id="@+id/mainscreen" android:layout_width="fill_parent" android:text="Selected Channel" android:gravity="center" android:layout_alignParentTop="true"></TextView> <ImageView android:id="@+id/ImageView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></ImageView> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/mainscreen_state" android:layout_above="@+id/mainscreen_btchange"></TextView> <ImageView android:layout_width="wrap_content" android:layout_centerHorizontal="true" android:layout_height="wrap_content" android:id="@+id/ImageAd" android:layout_gravity="center" android:layout_below="@+id/mainscreen"></ImageView> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="fill_parent" android:layout_width="fill_parent"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:id="@+id/mainscreen_btchange" android:text="Change State"></Button> </RelativeLayout> </LinearLayout> ``` My Question: How to shrink the pictures that all elements of the layout are shown?
How to resize the pictures right?
CC BY-SA 2.5
null
2011-02-15T15:39:42.800
2011-02-15T17:56:19.273
2011-02-15T17:56:19.273
547,995
547,995
[ "android" ]
5,005,833
1
5,112,555
null
1
747
I use the "real" IIS 7.5 server in the development phase. The site points to the web project folder which contains `WebProjectDir\App_Data\database.mdf`. The site runs under `ApplicationPoolIdentity` as follows: ![enter image description here](https://i.stack.imgur.com/RJDGR.png) When I run the application I get the following errors: ``` Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed. Source Error: Line 14: public ActionResult Index() Line 15: { Line 16: return View(db.Genres.ToList()); Line 17: } Line 18: Source File: G:\MvcMusicStore\Controllers\StoreController.cs Line: 16 ``` I can remove these errors by setting the application to run under `NetworkService`. However, I want to use `ApplicationPoolIdentiy` if it is possible with any adjustment. How to do this?
Is it possible to make the ApplicationPoolIdentity attach a database with User Instance = true?
CC BY-SA 2.5
null
2011-02-15T15:44:27.367
2011-02-25T01:16:12.457
null
null
596,314
[ "asp.net", "asp.net-mvc", "iis", "asp.net-mvc-3", "iis-7.5" ]
5,005,943
1
5,005,984
null
0
283
I'm making a simple global get configuration. try to make a index.php ``` function config( $string ){ require 'configuration.php'; return $config[$string]; } echo config('hello'); echo config('hello'); ``` and a configuration.php ``` $config['hello'] = TRUE; ``` and yes as we can see it outputs 1. but when we see the source, it will give us something like ![enter image description here](https://i.stack.imgur.com/H73PP.png) sorry for the stupid question, but I just cant stop asking. Thanks for looking in.
newline on source code?
CC BY-SA 2.5
null
2011-02-15T15:54:02.707
2011-02-15T16:06:32.653
2011-02-15T15:59:46.263
229,044
320,486
[ "php" ]
5,006,068
1
null
null
2
4,492
I have attached an image of my function so far. I highlighted the portion that obviously isn't going to work. I am trying to find out the powerbuilder code that will provide the same functionality as that select statement. ![picture](https://i.stack.imgur.com/gcAdl.jpg) [This question is a followup from this](https://stackoverflow.com/questions/4996380/doing-a-database-lookup-in-formatting-expression)
Database select within a Powerbuilder function
CC BY-SA 2.5
null
2011-02-15T16:03:21.203
2011-02-15T16:21:33.327
2017-05-23T12:24:45.570
-1
608,550
[ "powerbuilder" ]
5,006,094
1
5,019,048
null
6
1,603
Using [WebImage](http://msdn.microsoft.com/en-us/library/system.web.helpers.webimage(v=vs.99).aspx) from the MVC3/WebMatrix release. Loading the following image from a file path: ![Sample Image](https://i.stack.imgur.com/CUJHZ.png) - or - ![enter image description here](https://i.stack.imgur.com/7iORI.png) Running the following code against it: ``` return new WebImage(path) .Resize(120, 265) .GetBytes("Png"); ``` Results in an image with the transparency stripped out and black used in place: ![Blacked out transparency](https://i.stack.imgur.com/a1S4e.png) The same happens with RotateRight(), RotateLeft() and FlipHorizantal() However if I don't call the .Resize() method: ``` return new WebImage(path) .GetBytes("Png"); ``` The image is returned without an issue.
Why does WebImage.Resize strip out PNG transparency
CC BY-SA 2.5
0
2011-02-15T16:05:09.553
2011-03-14T04:15:28.567
2011-02-16T15:58:06.247
74,302
74,302
[ "c#", "image-processing", "asp.net-mvc-3" ]
5,006,334
1
5,006,932
null
2
1,041
I have two CALayers each showing an image. The first (left) layer in the view hierarchy is on top of the second one. The problem is that after I apply a rotation around the y-axis, the right layer is all of a sudden drawn above the layer that's supposed to be on top. I tried using different zPosition values. Nothing. My other guess was that maybe the animation of the right layer finishes the animation for the left layer and hence it is drawn on top. To test this, I applied the transformation for the right layer first, but still the same result. Oh, I also tried CA transactions without any luck. Here a screenshot: ![the problem](https://i.stack.imgur.com/5INHF.jpg) What is the correct way to animate a number of CALayers while keeping their order? Thanks, Mark. EDIT: Here is the code for the transformation. I tried disabling the animation, but got the same result. ``` [CATransaction begin]; [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions]; CATransform3D rotationAndPerspectiveTransform = CATransform3DIdentity; rotationAndPerspectiveTransform.m34 = 1.0 / 400; rotationAndPerspectiveTransform = CATransform3DRotate(rotationAndPerspectiveTransform, DegreesToRadians(70), 0, 1, 0); for(CALayer *layer in [self.layer sublayers]) { // transform the two layers layer.transform = rotationAndPerspectiveTransform; } [CATransaction commit]; ```
CALayer overlaps top layer after transformation
CC BY-SA 2.5
0
2011-02-15T16:24:18.060
2011-02-15T21:47:35.160
2011-02-15T21:47:35.160
458,669
458,669
[ "cocoa", "core-animation", "calayer", "transformation" ]
5,006,422
1
5,006,511
null
0
51
I have a FormPanel that looks like this: ``` var simple_form_left = new Ext.FormPanel({ frame:true, labelWidth: 90, labelAlign: 'right', title: 'Customer Information', bodyStyle:'padding:5px 5px 0', width: 290, height: 600, autoScroll: true, itemCls: 'form_row', defaults: {width: 160}, defaultType: 'displayfield', items: [{ ... ``` now I want to put this button in as a value of one of the rows: ``` var button = new Ext.Button({ text: "Click this", handler: function() { alert('pressed'); } }); ``` however when I add it as a value: ![enter image description here](https://i.stack.imgur.com/4cDHw.png) it just shows it as an object: ![enter image description here](https://i.stack.imgur.com/IEYZU.png) I can add it as a full field row like this: ``` }, { fieldLabel: 'Item 15', name: 'item15', value: 'test' }, button, { fieldLabel: 'Item 17', name: 'item17', value: 'test' }, { ``` but that is not what I want since it needs to have a label: ![enter image description here](https://i.stack.imgur.com/4gB3e.png) # Addendum: Thanks @Tommi, here's the code that I got to work with your solution: ![enter image description here](https://i.stack.imgur.com/yqyUd.png) ![enter image description here](https://i.stack.imgur.com/MisLh.png)
How can I make a button be the value in a Ext.FormPanel field row?
CC BY-SA 2.5
null
2011-02-15T16:29:53.760
2011-02-16T08:30:28.380
2011-02-16T08:30:28.380
4,639
4,639
[ "javascript", "extjs" ]
5,006,524
1
5,006,560
null
1
143
I have an image: ![use only a piece](https://i.stack.imgur.com/oPB2M.png) I want to use it on the background of a `div` with `width: 100%` and set `repeat-x`. But I want to use only the black part, I don't want to use other images, I want to fix the image on a small piece. Is it possible?
Is it possible to use only a piece of the image in a full background?
CC BY-SA 2.5
null
2011-02-15T16:37:40.330
2011-02-15T16:47:37.953
null
null
340,760
[ "html", "css", "background" ]
5,006,733
1
null
null
0
1,233
Have a hover menu inside a table cell (td) and have the td set to `position:relative`, the menu set to `position:absolute`, and as you see the menu renders behind the border and text below: ![](https://i.stack.imgur.com/YIDVt.png)
Hover menu inside a tablecell, having z-index issues
CC BY-SA 3.0
null
2011-02-15T16:53:59.327
2017-11-15T17:31:43.360
2017-11-15T17:31:43.360
4,370,109
329,871
[ "css", "z-index", "css-tables" ]
5,007,243
1
5,007,718
null
0
874
I want use buttons on my application like this (see picture). This isn't usual buttons, it have standard picture, caption and description. Could anyone help me with it? (Post some code or something else) ![enter image description here](https://i.stack.imgur.com/LPJg9.jpg)
How make stylistic buttons windows 7?
CC BY-SA 2.5
0
2011-02-15T17:38:27.880
2011-02-15T19:21:09.923
2011-02-15T17:42:23.487
23,199
618,289
[ "windows-7", "button", "aero" ]
5,007,403
1
5,007,517
null
3
400
I have an XML file as follows: ![XML file](https://i.stack.imgur.com/kxiuN.png) I uploaded the XML file : [http://dl.dropbox.com/u/10773282/2011/result.xml](http://dl.dropbox.com/u/10773282/2011/result.xml) . It's a machine generated XML, so you might need some XML viewer/editor. I use this C# code to get the elements in `CoverageDSPriv/Module/*`. ``` using System; using System.Xml; using System.Xml.Linq; namespace HIR { class Dummy { static void Main(String[] argv) { XDocument doc = XDocument.Load("result.xml"); var coveragePriv = doc.Descendants("CoverageDSPriv"); //.First(); var cons = coveragePriv.Elements("Module"); foreach (var con in cons) { var id = con.Value; Console.WriteLine(id); } } } } ``` Running the code, I get this result. ``` hello.exe6144008016161810hello.exehello.exehello.exe81061hello.exehello.exe!17main_main40030170170010180180011190190012200200013hello.exe!107testfunctiontestfunction(int)40131505001460600158080216120120017140140018AA ``` I expect to get ``` hello.exe 61440 ... ``` However, I get just one line of long string. - - `cons.Count`- Q3 : If I need to get nested value of `<CoverageDSPriv><Module><ModuleNmae>` I use this code : var coveragePriv = doc.Descendants("CoverageDSPriv"); //.First(); var cons = coveragePriv.Elements("Module").Elements("ModuleName"); I can live with this, but if the elements are deeply nested, I might be wanting to have direct way to get the elements. Are there any other ways to do that? ## ADDED ``` var cons = coveragePriv.Elements("Module").Elements(); ``` solves this issue, but for the `NamespaceTable`, it again prints out all the elements in one line. ``` hello.exe 61440 0 8 0 1 6 1 61810hello.exehello.exehello.exe81061hello.exehello.exe!17main_main40030170170010180180011190190012200200013hello.exe!107testfunctiontestfunction(int)40131505001460600158080216120120017140140018 ``` Or, Linq to XML can be a better solution, as [this post](https://stackoverflow.com/questions/5008423/pythons-xml-etree-getiterator-equivalent-to-c).
Parsing XML with C#
CC BY-SA 3.0
0
2011-02-15T17:51:58.753
2017-08-27T03:33:28.503
2017-08-27T03:33:28.503
1,033,581
260,127
[ "c#", "xml", "linq-to-xml" ]
5,007,754
1
null
null
0
2,298
I am converting an old asp project to a new .NET project. Now, all vb code are inside aspx files, and we are on the process of moving all vb script from aspx files to .vb files. My problem is, I can't debug the vb script inside most of the aspx files. All my friends don't have this problem. I think the problem is with vb text editor. I am using Visual Studio 2008. Is there anyway, I can make visual studio understand that aspx files have vb script inside them. can't debug the code ![enter image description here](https://i.stack.imgur.com/yr1lY.png) can debug the code ![enter image description here](https://i.stack.imgur.com/VKMPb.png)
Debugging VB code in aspx files
CC BY-SA 2.5
null
2011-02-15T18:22:18.357
2011-11-22T20:08:52.593
2011-11-22T20:08:52.593
3,043
397,058
[ "asp.net", "vb.net", "visual-studio-2008" ]
5,008,051
1
5,009,125
null
1
870
Is there any way to tell MigLayout to ignore a component's height? Here's a test example: ![enter image description here](https://i.stack.imgur.com/neZHa.png) I have an oversized component (the "big" button in the upper right) in the first row, and a JPanel which has a more-or-less triangular shape that spans the whole 2nd row. I would like to have MigLayout ignore the height of the "big" button when choosing a size for the first row, because I know it's ok for it to overlap with my 2nd-row component. How can I do this? ``` import java.awt.Dimension; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; import net.miginfocom.swing.MigLayout; public class IgnoreComponentHeight { public static void main(String[] args) { JFrame jf = new JFrame("ignore component height test"); JPanel p = new JPanel(); p.setLayout(new MigLayout("","[] [] [] []", "")); p.add(new JButton("one"), ""); p.add(new JButton("two"), ""); p.add(new JButton("three"), ""); JButton big = new JButton("big"); big.setPreferredSize(new Dimension(40,80)); p.add(big, "wrap"); JPanel tripanel = new JPanel(); tripanel.setLayout(new MigLayout("","[] [] [] []", "")); int k = 0; for (int i = 0; i < 4; ++i) { for (int j = 0; j <= i; ++j) { tripanel.add(new JButton("tri"+k), j == i ? "wrap" : ""); ++k; } } p.add(tripanel, "span,wrap"); jf.setContentPane(p); jf.pack(); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); jf.setVisible(true); } } ```
miglayout: how to ignore a component height
CC BY-SA 2.5
null
2011-02-15T18:44:49.280
2011-02-15T20:27:58.743
null
null
44,330
[ "java", "swing", "miglayout" ]
5,008,123
1
null
null
0
937
I want to design own custom backstage view tab that has desing like standard tab FileNew. How can I (and can I at all) use such tab elements like scrollable button set or large borderless button with text at bottom of one. ![Sample](https://i.stack.imgur.com/PqT3M.png)
Custom Backstage View Tab like standard tab FileNew
CC BY-SA 2.5
null
2011-02-15T18:52:03.733
2013-08-05T17:26:44.400
2013-08-05T17:26:44.400
1,065,525
301,257
[ "ms-office", "office-2007", "office-2010" ]
5,008,363
1
null
null
2
928
I am using jCarousel. The problem is only in Chrome and Safari; the text gets wrapped/mangled. I've done a lot of debugging and couldn't find cause of this issue. Can any one please help me with this issue [See it at this URL.](http://www.allposters.com/gallery.asp?startat=/getthumb.asp&txtSearch=flower&CID=27D3FFF2C92A48699EAC56D838836932) Thanks in advance! ![enter image description here](https://i.stack.imgur.com/OxuKG.jpg)
jCarousel text wrap issue on Chrome and Safari
CC BY-SA 2.5
null
2011-02-15T19:11:13.387
2011-02-16T00:01:06.273
2011-02-15T19:16:30.337
23,199
414,027
[ "jquery", "css", "jcarousel" ]
5,008,404
1
5,008,483
null
11
5,376
I have a label. As the content I want to set the infinity symbol. How can I achieve that? ![](https://i.stack.imgur.com/X4m9C.gif)
WPF: how to set infinity symbol as content for a label?
CC BY-SA 2.5
0
2011-02-15T19:14:47.280
2011-02-15T19:26:20.470
2011-02-15T19:26:20.470
559,144
329,637
[ "c#", "wpf" ]
5,008,423
1
5,008,508
null
1
1,565
I have this XML file : [http://dl.dropbox.com/u/10773282/2011/perf.xml](http://dl.dropbox.com/u/10773282/2011/perf.xml) ![enter image description here](https://i.stack.imgur.com/rB5u2.png) It has two Class elements as is marked. I need to get two nodes with C#. With Python, I can easily get them with etree.ElementTree as follows. ``` from xml.etree import ElementTree as et from xml.etree.ElementTree import Element tree = et.parse("perf.xml") tss = tree.getiterator('Class') for elem in tss: tss_name = elem.find('ClassKeyName') print tss_name.text >> helloclass.exe >> helloclass.exeFpga::TestMe ``` ![enter image description here](https://i.stack.imgur.com/d2309.png) How can I do the same thing with C#? ## SOLVED ``` using System; using System.Xml; using System.Xml.Linq; using System.Linq; namespace HIR { class Dummy { static void Main(String[] argv) { XDocument doc = XDocument.Load("perf.xml"); var res = from p in doc.Root.Elements("Module").Elements("NamespaceTable").Elements("Class").Elements("ClassKeyName") select p.Value; foreach (var val in res) { Console.WriteLine(val.ToString()); } } } } >> helloclass.exe >> helloclass.exeFpga::TestMe ``` Or ``` foreach (var elem in elems) { var res = elem.Elements("ClassKeyName").ToList(); Console.WriteLine(res[0].Value); } ```
Python's xml.etree getiterator equivalent to C#
CC BY-SA 2.5
null
2011-02-15T19:16:27.980
2011-10-22T15:52:54.743
2011-02-15T21:14:20.030
260,127
260,127
[ "c#", "python", "xml" ]
5,008,584
1
5,009,168
null
0
4,050
In WPF I have a ListView that is bound to a table in a Dataset. If I use (Commented out in full code view: ``` <ListView.View> <GridView> <GridViewColumn> ``` I get the rows displayed and I can see multiple rows and scroll through the rest. If I try ``` <ListView.ItemTemplate> <DataTemplate> <Grid> <Grid.ColumnDefinitions> 'Put a bunch of controls here bound to various columns in my data table ``` I can only see one row/record at one time. Am I missing a setting on one of the controls or is the ListView.ItemTemplate only going to show one record at a time. I'm looking for something in WPF that is more like a Repeater control where I can have different controls for each record in a particular layout. Full xaml: ``` <Window x:Class="GridTest" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="GridTest" Height="661" Width="750"> <ListView Margin="4,1,8,1" Name="ListView_Transactions" ItemsSource="{Binding}"> <!--<ListView.View> <GridView AllowsColumnReorder="true" ColumnHeaderToolTip="Transactions"> <GridViewColumn DisplayMemberBinding="{Binding Path=TransactionHeaderID}" /> </GridView> </ListView.View>--> <ListView.ItemTemplate> <DataTemplate> <Grid MaxHeight="600"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" SharedSizeGroup="Key" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Label Content="{Binding Amount}" Height="25" Name="Label_Amount" VerticalAlignment="Top" Width="134" Margin="50,201,526,0" /> <Label Content="{Binding ActivityCategory}" Height="24" HorizontalAlignment="Left" Name="Label_ActivityCategory" VerticalAlignment="Top" Width="161" Margin="208,201,0,0" /> <TextBox Height="23" HorizontalAlignment="Left" Name="TextBox_Customer" VerticalAlignment="Top" Width="163" Margin="440,201,0,0" /> <Button Content="Breakout" Height="20" Name="Button_Breakout" Width="90" BorderThickness="0" ClickMode="Press" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="50,244,0,223"> </Button> <Label Content="{Binding ShortDescription}" Height="27" HorizontalAlignment="Left" Name="Label_ShortDescription" VerticalAlignment="Top" Width="480" Margin="50,270,0,0" /> <TextBlock Height="65" HorizontalAlignment="Left" Name="TextBlock_LogDescription" Text="{Binding LongDescription}" VerticalAlignment="Top" Width="480" Margin="50,303,0,0" /> </Grid> </DataTemplate> </ListView.ItemTemplate> </ListView> </Window> ``` ![View of result, text does render normally, but smudged for security purposes](https://i.stack.imgur.com/K91rf.png) ``` <ScrollViewer ScrollViewer.VerticalScrollBarVisibility="Auto"> <ItemsControl Name="ItemsC" ItemsSource="{Binding}"> <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel HorizontalAlignment="Left"> <DockPanel > <Label Content="{Binding Amount}" Height="25" DockPanel.Dock="Left" Name="Label_Amount" Width="100" /> <Label Content="{Binding ActivityCategory}" DockPanel.Dock="Left" Height="24" Name="Label_ActivityCategory" Width="100" /> <TextBox Height="25" DockPanel.Dock="Left" Name="TextBox_Customer" Width="123" /> </DockPanel> <StackPanel HorizontalAlignment="Left"> <Button Content="Breakout" Height="25" Name="Button_Breakout" Width="90" HorizontalAlignment="Left" VerticalAlignment="Center" /> <Label Content="{Binding ShortDescription}" Name="Label_ShortDescription" Width="550" /> <TextBlock Height="200" Name="TextBlock_LogDescription" Text="{Binding LongDescription}" Width="550" /> </StackPanel> </StackPanel> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> </ScrollViewer> ```
WPF Listview display multiple rows with a template
CC BY-SA 2.5
0
2011-02-15T19:31:17.943
2011-02-15T21:45:25.900
2011-02-15T21:45:25.900
61,339
61,339
[ ".net", "wpf-controls" ]
5,008,750
1
5,008,809
null
0
385
In SQL server 2008, I have below table. ![enter image description here](https://i.stack.imgur.com/RVZfW.png) Thanks ``` create table test1 ([Number] int, Item varchar(10)) insert into test1 values (20 , 'Item 1'),(30 , 'Item 2'),(60 , 'Item 3'),(23 , 'Item 4'),(10 , 'Item 5'),(76 , 'Item 6'),(44 , 'Item 7'),(99 , 'Item 8'),(10 , 'Item 9'),(22 , 'Item 10'),(77 , 'Item 11'),(10 , 'Item 12') ```
T-SQL select starting from value condition
CC BY-SA 2.5
null
2011-02-15T19:48:55.167
2011-02-15T19:56:14.333
2011-02-15T19:50:26.907
410,636
219,628
[ "tsql", "select", "conditional-statements" ]
5,008,791
1
6,479,701
null
6
798
I'm trying to create a VSIX installer for a WPF control. Its supposedly easy, but the "easy" version assumes that you create the WPF control in the . The thing is, I've got my UserControl nestled deep within one of my DLLs, and I don't believe pulling it out is the best design. I'd like to leave it in there, but I can't seem to do this AND have the control added to the toolbox. One option would be to move the code I need to install it to the toolbox into the control's assembly, but that would add a dependency to . The assembly is both used by someone with Visual Studio installed, and a remote server running within a service where VS isn't installed, so that's a no-go. Another option I tried was to "trick" the toolbox installer VSIX by applying the RegistrationAttribute to which would register the types defined in the other assembly. Thought it would work, but weird stuff happened. ![all kinds of weirdness in the toolbox](https://i.stack.imgur.com/5veRg.png) Instead of getting two controls, I get a bunch of Border controls (the standard WPF border) in oddly named tabs, some of which echo some of my namespaces.
WPF toolbox installer for a type defined in a different assembly
CC BY-SA 2.5
0
2011-02-15T19:54:04.143
2011-06-25T18:21:39.840
2011-04-02T13:31:53.543
546,730
null
[ "wpf", "visual-studio", "user-controls", "installation", "toolbox" ]
5,008,804
1
5,009,006
null
180
322,379
I need a function which would generate a random integer in a given range (including boundary values). I don't have unreasonable quality/randomness requirements; I have four requirements: - - - - I currently have the following C++ code: ``` output = min + (rand() * (int)(max - min) / RAND_MAX) ``` The problem is that it is not really uniform - is returned only when rand() = RAND_MAX (for Visual C++ it is 1/32727). This is a major issue for small ranges like <-1, 1>, where the last value is almost never returned. So I grabbed pen and paper and came up with following formula (which builds on the (int)(n + 0.5) integer rounding trick): ![Enter image description here](https://i.stack.imgur.com/2c4JZ.png) But it still doesn't give me a uniform distribution. Repeated runs with 10000 samples give me ratio of 37:50:13 for values values -1, 0. 1. Is there a better formula? (Or even whole pseudo-random number generator function?)
Generating a random integer from a range
CC BY-SA 4.0
0
2011-02-15T19:55:33.797
2022-08-07T13:28:27.403
2022-08-07T12:47:33.820
63,550
38,256
[ "c++", "random" ]
5,008,873
1
5,008,891
null
1
1,191
I want to draw the following arrow type: ![enter image description here](https://i.stack.imgur.com/qBNZD.gif) How can I do that? I have already a similar arrow: ``` private void InternalDrawArrowGeometry(StreamGeometryContext context) { double theta = Math.Atan2(Y1 - Y2, X1 - X2); double sint = Math.Sin(theta); double cost = Math.Cos(theta); Point pt1 = new Point(X1, this.Y1); Point pt2 = new Point(X2, this.Y2); Point pt3 = new Point( X2 + (HeadWidth * cost - HeadHeight * sint), Y2 + (HeadWidth * sint + HeadHeight * cost)); Point pt4 = new Point( X2 + (HeadWidth * cost + HeadHeight * sint), Y2 - (HeadHeight * cost - HeadWidth * sint)); context.BeginFigure(pt1, true, false); context.LineTo(pt2, true, true); context.LineTo(pt3, true, true); context.LineTo(pt4, true, true); context.LineTo(pt2, true, true); } ``` How can I change so that this isn't an arrow but a circle?
WPF: How to draw UML interface relationship arrow?
CC BY-SA 2.5
0
2011-02-15T20:03:20.503
2011-02-15T21:08:35.870
2011-02-15T21:08:35.870
null
null
[ "c#", ".net", "wpf" ]
5,009,110
1
5,009,207
null
1
3,609
How do you usually create views with button in top-left corner to create something like view presented at the picture? Do I have to simply place button with image over the corner? Or there are some best pratices? :) Just wondering. ![View with close button in the corner](https://i.stack.imgur.com/xLy43.png)
How to create view with close button above the corner?
CC BY-SA 2.5
0
2011-02-15T20:26:28.950
2012-12-14T09:08:16.220
2011-02-15T20:59:43.820
null
83,938
[ "objective-c", "cocoa-touch", "ios" ]
5,009,157
1
5,009,217
null
2
2,274
I use this method to bind a Line to the center of two ScatterViewItems: ``` private void BindLineToScatterViewItems(Shape line, ScatterViewItem origin, ScatterViewItem destination) { // Bind line.(X1,Y1) to origin.ActualCenter BindingOperations.SetBinding(line, Line.X1Property, new Binding { Source = origin, Path = new PropertyPath("ActualCenter.X") }); BindingOperations.SetBinding(line, Line.Y1Property, new Binding { Source = origin, Path = new PropertyPath("ActualCenter.Y") }); // Bind line.(X2,Y2) to destination.ActualCenter BindingOperations.SetBinding(line, Line.X2Property, new Binding { Source = destination, Path = new PropertyPath("ActualCenter.X") }); BindingOperations.SetBinding(line, Line.Y2Property, new Binding { Source = destination, Path = new PropertyPath("ActualCenter.Y") }); } ``` But now I'd like to bind it from the bottom from one ScatterViewItem to the top of the another ScatterViewItem: ![enter image description here](https://i.stack.imgur.com/UrxTe.jpg) How can I achieve that?
WPF: how to bind lines to UI elements?
CC BY-SA 2.5
0
2011-02-15T20:31:10.067
2012-11-26T12:46:30.640
null
null
null
[ "c#", ".net", "wpf", "pixelsense" ]
5,009,349
1
5,009,444
null
0
87
possibly it's a stupid question, but I would like to know if it is possible to somehow work on an old program which was made with MacApp® 2.0.1. When I open this file in e.g. XCode, I got much text. Some parts of this text are readable, some parts are just signs like: ![enter image description here](https://i.stack.imgur.com/btcxl.png) This old program runs on an Mac OS 9 (i think). Is it perhaps possible to open it with a version of pascal? or is MacApp® still available somewhere? It would be cool at least to see what's behind the unreadable sign. Thank you in advance!
Work on very old, compiled MacApp® program
CC BY-SA 2.5
null
2011-02-15T20:51:07.657
2013-09-23T05:36:21.473
2013-09-23T05:36:21.473
821,057
445,262
[ "xcode" ]
5,009,465
1
5,022,708
null
0
689
Is it possible to use Blackberry's native loading icon(progress bar) from code?![enter image description here](https://i.stack.imgur.com/rK4dK.png) I want to display a progressbar like above when I call a webservice. This progress bar appears when installing an app onto a BlackBerry device.
blackberry field like the OS animated busy clock
CC BY-SA 2.5
null
2011-02-15T21:02:50.803
2011-02-16T22:06:01.567
2011-02-16T02:25:12.537
75,204
413,770
[ "blackberry" ]
5,009,460
1
null
null
1
773
![enter image description here](https://i.stack.imgur.com/cME25.jpg) Above is an image of the rendered css when I changed the bg color of .speech_bubble_content to red. The bubble isn't displaying properly. I am using the following code to retrieve data from a database and bind it to a repeater. I am also using css to display a speech bubble around what I want to display. I noticed that data is displayed when I place a label outisde of the div - and nothing is retrieved when the label is inside the div - in this case creation date is displayed, but story is omitted. Why is this happening? Thanks for your help. I believe this is caused by css. ``` <asp:Repeater ID="Repeater1" runat="server"> <ItemTemplate> <div class="speech_bubble"> <b class="sb1"></b><b class="sb2"></b><b class="sb3"></b><b class="sb4"></b><b class="sb5"></b><b class="sb6"></b><b class="sb7"></b> <div class="speech_bubble_content"> <p> <asp:Label ID="story" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "Story") %>'></asp:Label> </p> </div> <b class="sb7"></b><b class="sb6"></b><b class="sb5"></b><b class="sb4"></b><b class="sb3"></b><b class="sb2"></b><b class="sb1"></b> <em></em><span></span> </div> <asp:Label ID="user" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "CompanyRole") %>'></asp:Label>&nbsp;<asp:Label ID="date" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "CreationDate") %>'></asp:Label> </ItemTemplate> </asp:Repeater> ``` Here's the CSS: ``` .speech_bubble{ background: transparent; margin:10px 0; } .speech_bubble_content{ display:block; background:#fff; border:3px solid #ddd; border-width:0 3px; } .speech_bubble p{ padding:0.5em 0; color:#000; margin:0 15px; } .sb1, .sb2, .sb3, .sb4, .sb5, .sb6, .sb7{ display:block; overflow:hidden; font-size:0; } .sb1, .sb2, .sb3, .sb4, .sb5, .sb6{ height:1px; } .sb4, .sb5, .sb6, .sb7{ background:#fff; border-left:1px solid #ddd; border-right:1px solid #ddd; } .sb1 {margin:0 8px; background:#ddd;} .sb2 {margin:0 6px; background:#ddd;} .sb3 {margin:0 4px; background:#ddd;} .sb4 {margin:0 3px; background:#fff; border-width:0 5px;} .sb5 {margin:0 2px; background:#fff; border-width:0 4px;} .sb6 {margin:0 2px; background:#fff; border-width:0 3px;} .sb7 {margin:0 1px; background:#fff; border-width:0 3px; height:2px;} .speech_bubble em{ display:block; width:0; height:0; overflow:hidden; border-top:12px solid #ddd; border-left:12px dotted transparent; border-right:12px dotted transparent; margin-left:50px; } .speech_bubble span{ display:block; width:0; height:0; overflow:hidden; border-top:10px solid #fff; border-left:10px dotted transparent; border-right:10px dotted transparent; margin-left:52px; margin-top:-15px; } ```
Speech bubble inside repeater
CC BY-SA 2.5
null
2011-02-15T21:02:27.640
2011-02-15T23:03:35.540
2011-02-15T21:49:13.340
586,724
588,302
[ "c#", "asp.net", "css" ]
5,009,425
1
9,768,037
null
2
6,015
I am trying desperately to get a maven maven-glassfish-plugin working to start my domain and deploy a war so I can test. I wanted to use maven-glassfish-plugin because as far as I can find, maven-embedded-glassfish-plugin does not support setting a keyfile so I can test login authentication through selenium ${project.build.outputDirectory}/keyfile But I cannot get maven-glassfish-plugin to run, and I cannot get maven-embedded-glassfish-plugin to actually allow programmatic setting of users and authentication. My Maven items: ``` <properties> <glassfish.home>C:/usr/bin/glassfish-3.1-b42-02_11_2011/</glassfish.home> <glassfish.domain.name>domain1</glassfish.domain.name> <glassfish.domain.host>localhost</glassfish.domain.host> <!-- Glassfish --> <glassfish.version>3.2-SNAPSHOT</glassfish.version> <glassfish.plugin.version>2.1</glassfish.plugin.version> <glassfish.domain.name>domain1</glassfish.domain.name> <glassfish.domain.host>localhost</glassfish.domain.host> <glassfish.adminUser>admin</glassfish.adminUser> <glassfish.adminPassword>adminadmin</glassfish.adminPassword> <glassfish.passwordFile>${project.build.testOutputDirectory}/passwd.local.file</glassfish.passwordFile>--> ... <plugin> <groupId>org.glassfish.maven.plugin</groupId> <artifactId>maven-glassfish-plugin</artifactId> <version>${glassfish.plugin.version}</version> <configuration> <glassfishDirectory>${glassfish.home}</glassfishDirectory> <user>${glassfish.adminUser}</user> <!--<adminPassword></adminPassword>--> <passwordFile>${glassfish.passwordFile}</passwordFile> <autoCreate>true</autoCreate> <debug>true</debug> <echo>true</echo> <terse>false</terse> <domain> <name>${glassfish.domain.name}</name> <host>${glassfish.domain.host}</host> <adminPort>4848</adminPort> <httpPort>8080</httpPort> <httpsPort>8443</httpsPort> </domain> <components> <component> <name>${project.artifactId}</name> <artifact>${project.build.directory}/${project.build.finalName}.war</artifact> </component> </components> </configuration> </plugin> ``` But I still cannot get this to start the admin without forcing the admin login. I started blogging about this, but really with there was a solution === Details === I went through much different iteration with this plugin, and really did not have complete success. One issue that keeps plaguing this plugin in my testing, is when the plugin defines no username and password, or adds the default admin username and password like: ``` <user>${glassfish.adminUser}</user> <adminPassword>${glassfish.adminPassword}</adminPassword> ``` The domain will not start based on a missing “Master Password” and also a warning about deprecated syntax. ``` [DEBUG] [C:\usr\bin\glassfish-3.1-b42-02_11_2011\bin\asadmin.bat, start-domain, --echo=true, --terse=false, --interactive=false, --user, admin, --passwordfile, C:\DOCUME~1\MKN UTS~1\LOCALS~1\Temp\mgfp2524993691695672772.tmp, --debug=true, --domaindir, C:\usr\bin\glassfish-3.1-b42-02_11_2011\domains, domain1] [INFO] Deprecated syntax, instead use: [INFO] asadmin --echo --terse=false --interactive=false --user admin --passwordfile C:\DOCUME~1\MKNUTS~1\LOCALS~1\Temp\mgfp2524993691695672772.tmp start-domain [options] ... [INFO] asadmin --host localhost --port 4848 --user admin --passwordfile C:\DOCUME~1\MKNUTS~1\LOCALS~1\Temp\mgfp2524993691695672772.tmp --interactive=false --echo=true --terse=false start-domain --verbose=false --upgrade=false --debug=true --domaindir "C:\\usr\\bin\\glassfish-3.1-b42-02_11_2011\\domains" domain1 [INFO] Command start-domain failed. [ERROR] The Master Password is required to start the domain. No console, no prompting possible. You should either create the domain with --savemasterpassword=true or provide a password file with the --passwordfile option. [ERROR] Unable to start domain "domain1". [ERROR] For more detail on what might be causing the problem try running maven with the --debug option [ERROR] or setting the maven-glassfish-plugin "echo" property to "true". ``` Another option was to use a passwordFile for the startup ``` <passwordFile>${glassfish.passwordFile}</passwordFile> … <glassfish.passwordFile>${project.build.testOutputDirectory}/passwd.local.file</glassfish.passwordFile> ``` When I attempt to start the domain ``` mvn org.glassfish.maven.plugin:maven-glassfish-plugin:start-domain -e –X ``` The domain successfully starts as per the logs: ``` asadmin --host localhost --port 4848 --user admin --passwordfile C:\DOCUME~1\MKNUTS~1\LOCALS~1\Temp\mgfp2524993691695672772.tmp --interactive=false --echo=true --terse=false start-domain --verbose=false --upgrade=false --debug=true --domaindir "C:\\usr\\bin\\glassfish-3.1-b42-02_11_2011\\domains" domain1 ``` The domain successfully starts as per the logs: ``` [DEBUG] [C:\usr\bin\glassfish-3.1-b42-02_11_2011\bin\asadmin.bat, start-domain, --echo=true, --terse=false, --interactive=false, --user, MKnuts6173c, --passwordfile, C:\usr\SY NCH\PACKT\3166\Chapters_Code\ch03\target\test-classes/passwd.local.file, --debug=true, --domaindir, C:\usr\bin\glassfish-3.1-b42-02_11_2011\domains, domain1] [INFO] Deprecated syntax, instead use: [INFO] asadmin --echo --terse=false --interactive=false --user MKnuts6173c –passwordfile C:\usr\SYNCH\PACKT\3166\Chapters_Code\ch03\target\test-classes/passwd.local.file start-domain [options] ... [INFO] asadmin --host localhost --port 4848 --user MKnuts6173c --passwordfile C:\usr\SYNCH\PACKT\3166\Chapters_Code\ch03\target\test-classes/passwd.local.file --interactive=false --echo=true --terse=false start-domain --verbose=false --upgrade=false --debug=true --domaindir "C:\\usr\\bin\\glassfish-3.1-b42-02_11_2011\\domains" domain1 [INFO] Attempting to start domain1.... Please look at the server log for more details..... ``` Even though this seemed to complete successfully, there was a fundamental issue I could not solve. When this method to start domain1 in GF, there is not a default admin login, thus you are prompted for an admin login: ![image 3166_ch02_07](https://i.stack.imgur.com/r9tAd.png) The admin screen does not get a user to login with as confirmed in the logs: ``` [#|2011-02-15T15:15:21.047-0500|INFO|glassfish3.1|javax.enterprise.system.tools.admin.com.sun.enterprise.container.common|_ThreadID=100;_ThreadName=Thread-1;|User [] from host localhost does not have administration access|#] ``` When attempting to actually login, admin user does not have administration permission as found in the logs: ``` [#|2011-02-15T15:23:22.535-0500|INFO|glassfish3.1|javax.enterprise.system.tools.admin.com.sun.enterprise.container.common|_ThreadID=118;_ThreadName=Thread-1;|User [admin] from host localhost does not have administration access|#] ``` ![image 3166_ch02_08](https://i.stack.imgur.com/O8fhX.png) My application is also not actually deployed when this happens. So I rally have access to nothing. I also tried to remove the passwordFile, and use nothing, or use just the user, or even the user and adminPassword, but still no luck My contents of my passwordFile: ``` AS_ADMIN_MASTERPASSWORD=changeit AS_ADMIN_PASSWORD=adminadmin AS_ADMIN_USERPASSWORD=xxx ``` When I run this same command on outside of maven ``` C:\usr\bin\glassfish-3.1-b42-02_11_2011\bin\asadmin.bat --host localhost --port 4848 --user MKnuts6173c --passwordfile C:\usr\SYNCH\PACKT\3166\Chapters_Code\ch03\target\test-classes/passwd.local.file --interactive=false --echo=true --terse=false start-domain --verbose=false --upgrade=false --debug=true --domaindir "C:\\usr\\bin\\glassfish-3.1-b42-02_11_2011\\domains" domain1 ``` I get the same issues where I cannot seem to get into my control panel, but the server logs are being populated now.
Desperately need help with Glassfish 3.1 deployment and issues running in Maven
CC BY-SA 2.5
0
2011-02-15T20:59:10.360
2013-02-28T14:04:22.703
2011-02-15T21:05:09.467
318,852
318,852
[ "security", "jakarta-ee", "selenium", "maven", "glassfish" ]
5,010,332
1
5,010,735
null
0
94
In interface builder when i use an NSTableCellPopup it has a simplified appearance (shown on the right), but when build and populated with data the popup bezel is shown, is there a way to keep the simple bezel-less appearance until the user clicks on the control? ![enter image description here](https://i.stack.imgur.com/yPF59.png)
How do I use NSTableCellPopup without showing a bezel?
CC BY-SA 2.5
null
2011-02-15T22:34:29.540
2011-02-15T23:48:04.137
null
null
582,312
[ "cocoa", "interface-builder", "nstableview" ]
5,010,471
1
null
null
1
598
![enter image description here](https://i.stack.imgur.com/68aR6.png) How do I remove that yellow box? It stays in the same spot regardless of where I move the cursor. If I am not using an external monitor, that yellow box took up half of my screen :( Thanks! PS: I am asking here because there does not seem to be a good forum to ask the official webkit/safari crowd or I just miss it but it is not webkit.org
how do i remove this yellow box while debugging javascript using web inspector in safari
CC BY-SA 2.5
null
2011-02-15T22:50:31.137
2011-12-14T14:59:43.520
null
null
384,964
[ "javascript", "safari", "webkit", "web-inspector" ]
5,010,567
1
5,010,589
null
21
9,836
The problem is that when I place a breakpoint and debug/run, the breakpoint moves by itself. Before/whilst coding: ![enter image description here](https://i.stack.imgur.com/6sDbe.png) After clicking run/breakpoint hit: ![enter image description here](https://i.stack.imgur.com/s8tw7.png) Breakpoints typically work ok for me, but it seems that they sometimes randomly play up. I first had this ages ago with a VB project, and in the end, I bypassed the problem by removing the breakpoint and adding it somewhere else where it was still useful. Whilst I could probably do the same again, and this is only the second time it has happened (that I remember), I don't really want to have to and would like to know what is actually wrong. I have read through many similar questions here, but I cannot see an exact match and the answers do not help. I have tried - building, rebuilding, closing/reopening and cleaning. I only provided a picture of the bit of code where it occurs, if you need anything else, please let me know.
Visual Studio is missing/moving my breakpoints
CC BY-SA 2.5
0
2011-02-15T23:01:44.183
2019-10-16T14:35:46.610
null
null
1,205,001
[ "c#", "visual-studio", "debugging", "breakpoints" ]
5,010,709
1
5,011,053
null
1
60
I am developing a profile-based web application where each user is assigned there own url through their username & iis rewrite mod's magic. A typical user's profile url would be [http://www.mymark.com/mike](http://www.mymark.com/mike) Each user is also created a blog in a multi-user wordpress installation. The wordpress url would look like this: [http://www.mymark.com/blog/mike](http://www.mymark.com/blog/mike) I am trying to use the rewrite module to create more canonical urls for the user ([http://www.mymark.com/mike/blog](http://www.mymark.com/mike/blog)), and have tried several regex variations that I have created through [RegExr](http://gskinner.com/RegExr/)(a regex generation tool) and come up with this as the pattern to match `(www.|)mymark.com/([^/]+)/blog` but haven't had any success so far. What am I doing wrong here? Here is a screen shot of my re-write rule: ![enter image description here](https://i.stack.imgur.com/aHPbG.png)
Regexing it up with IIS re-write module
CC BY-SA 2.5
null
2011-02-15T23:21:58.847
2011-02-16T00:13:55.403
null
null
602,554
[ "asp.net", "regex", "iis", "url-rewriting" ]
5,010,868
1
null
null
0
134
i face a very strange problem (at least for me) ,i got the html layout of a web page from the designer and it is exactly the same HTML of the photoshop design..when i add the HTML tags to my ASP.Net website and add the `<form runat="server"> </form>` tag after the body tag..some of the divs in the footer appear differently.. here is a screenshot of how the footer should be ![enter image description here](https://i.stack.imgur.com/iSldM.jpg) and here is how it appears now ![enter image description here](https://i.stack.imgur.com/9wSgP.jpg) Any ideas??
When i add the form tag the output changes
CC BY-SA 2.5
null
2011-02-15T23:46:12.207
2011-02-15T23:49:55.407
null
null
401,507
[ "asp.net", "html", "layout" ]
5,010,989
1
null
null
0
197
One of the things I like about Google Chrome is that the tabs are placed in the top bar so that precious viewing space is conserved. I was wondering if wxPython facilitated the placing of widgets in the native OS's top bar. Similar to how Chrome places tabs in the native OS's topbar. The program I'm currently writing is intended for netbooks and laptops, so space is at a premium. Chrome in Windows 7: ![enter image description here](https://i.stack.imgur.com/8sVdI.png)
wxPython Altering Native Window Styles
CC BY-SA 2.5
null
2011-02-16T00:03:06.347
2011-02-16T00:51:14.653
2011-02-16T00:09:09.793
433,417
433,417
[ "python", "wxpython", "native", "nativewindow" ]
5,011,033
1
5,011,076
null
4
1,891
Why is it that client validation is getting triggered saying that my Default Theme field is required even if I didn't specify a [Required] attribute in my model? ![enter image description here](https://i.stack.imgur.com/9vj0N.png) Model : ``` public class Site { public int SiteId { get; set; } [Required(ErrorMessage = "*")] [LocalizedDisplayName("Title")] public string Title { get; set; } [Required(ErrorMessage = "*")] [LocalizedDisplayName("RootDirectory")] public string RootDirectory { get; set; } [LocalizedDisplayName("DefaultTheme")] public int DefaultThemeId { get; set; } // <-- No required attribute here [Required(ErrorMessage = "*")] [LocalizedDisplayName("ThemesDirectory")] public string ThemesDirectory { get; set; } public virtual Theme DefaultTheme { get; set; } // <-- No required attribute here } ``` View : ``` @Html.DropDownListFor(x => x.DefaultThemeId, new SelectList(ViewBag.Themes, "ThemeId", "Name"), string.Empty) ``` I am using Entity Framework 4 with ADO.NET Entity Data Model and mapping the entities to POCOs in my model.
Unobtrusive validation problem with DropDownListFor in ASP.NET MVC 3
CC BY-SA 2.5
null
2011-02-16T00:11:28.167
2011-02-16T00:17:00.930
null
null
463,192
[ "asp.net", "asp.net-mvc", "entity-framework-4", "asp.net-mvc-3", "unobtrusive-validation" ]
5,011,633
1
null
null
3
435
``` - (void)btnInboxPressed { for (int j = 0; j < 100000; j++) { [[UIButton alloc] init]; } } ``` Why would this not show up as a memory leak in Instruments? If I alloc NSMutableString in the same fashion, Instruments flags a memory leak. ![enter image description here](https://i.stack.imgur.com/pHk7l.png)
How to detect leaks of UIKit objects?
CC BY-SA 2.5
null
2011-02-16T01:36:05.163
2011-02-16T03:50:27.793
2011-02-16T03:33:40.227
594,989
594,989
[ "iphone", "objective-c", "ios" ]
5,011,656
1
5,015,060
null
5
11,492
I want to draw the following red polygon: ![enter image description here](https://i.stack.imgur.com/Z7tJE.jpg) The problem is if I use somethign like this: ``` Polygon poly = new Polygon(); poly.StrokeThickness = 2; poly.Stroke = Brushes.Black; PointCollection points = new PointCollection(); for (int i = 0; i < this.NumberOfMetrics; i++) { points.Add(new Point(MAX_VALUE - this.Metrics[n, i] * Math.Cos(DegreeToRadian(i * (360 / (this.NumberOfMetrics)))), MAX_Y_GUI - this.Metrics[n, i] * Math.Sin(DegreeToRadian(i * (360 / (this.NumberOfMetrics)))))); } poly.Points = points; ``` Then the polygon is always "filled" and in the example above the red and green polygon is drawn. I already tried to add the 4 "inner" points to the PointCollection, but then nothing is drawn. So how can I achieve that? I tried the solution proposed by David: ``` for (int n = 0; n < this.NumberOfRevisions; n++) { Path path = new Path(); CombinedGeometry geometry = new CombinedGeometry(); geometry.GeometryCombineMode = GeometryCombineMode.Union; Polygon poly = new Polygon(); PointCollection points = new PointCollection(); for (int i = 0; i < this.NumberOfMetrics; i++) { points.Add(new Point(MAX_VALUE - this.Metrics[n, i] * Math.Cos(DegreeToRadian(i * (360 / (this.NumberOfMetrics)))), MAX_Y_GUI - this.Metrics[n, i] * Math.Sin(DegreeToRadian(i * (360 / (this.NumberOfMetrics)))))); } poly.Points = points; geometry.Geometry1 = poly.RenderedGeometry; geometry.Geometry2 = poly.RenderedGeometry; path.Data = geometry; polygons.Add(poly); paths.Add(path); } ``` This is just a test but I thougth so I should get the same result as before, but it isn't drawn anything. Is there something wrong with my code?
WPF: How to draw this polygon?
CC BY-SA 2.5
0
2011-02-16T01:40:37.253
2011-02-16T13:14:43.897
2011-02-16T11:50:03.563
null
null
[ "c#", ".net", "wpf" ]
5,011,731
1
5,019,129
null
0
88
In windows there is an icon and title in the upper left hand corner of the native boarder. I was wondering if it was possible to remove the icon and title, yet keep the icon and title that is displayed in the task bar using wxPython. ![enter image description here](https://i.stack.imgur.com/7yAAh.png)
Manipulating Native Windows Boarders with wxPython
CC BY-SA 2.5
null
2011-02-16T01:54:29.867
2011-02-16T16:29:15.127
null
null
433,417
[ "python", "windows-7", "wxpython" ]
5,011,873
1
5,013,595
null
3
326
I'm considering using Haskell to develop for a little commercial project. The program must be internationalized (to Simplified Chinese, to be specific), and my customer requests that it should be delivered in a one-click Windows Installer form. So basically these are the two problems I'm facing now: 1. I18n of Haskell programs: the method described in Internationalization of Haskell programs did work (partially) if I change the command of executing the program from LOCALE=zh_CN.UTF-8 ./Main to LANG=zh_CN.UTF-8 ./Main (I'm working on Ubuntu 10.10), however, the Chinese output is garbled, and I've no idea why is that. 2. Distribution on Windows: I'm used to work under Linux and build & package my Haskell programs using Cabal, but what is the most natural way to create a one-click Windows Installer from a cabalized Haskell package? Is the package bamse the right way to go? ------ Details for the first problem ------ What I did was: ``` $ hgettext -k __ -o messages.pot Main.hs $ msginit --input=messages.pot --locale=zh_CN.UTF-8 (Edit the zh_CN.po file, adding Chinese translation) $ mkdir -p zh_CN/LC_MESSAGES $ msgfmt --output-file=zh_CN/LC_MESSAGES/hello.mo zh_CN.po $ ghc --make Main.hs $ LANG=zh_CN.UTF-8 ./Main ``` And the output was like: ![terminal output](https://i.stack.imgur.com/Cepxz.png) This indicates gettext is actually working, but for some reason the generated zh_CN.mo file is broken (my guess). I'm pretty sure my zh_CN.po file is encoded in UTF-8. Plus, aside from using `System.IO.putStrLn`, I also tried `System.IO.UTF8.putStrLn` to output the string, which didn't work either.
How to do i18n and create Windows Installer of Haskell programs?
CC BY-SA 2.5
0
2011-02-16T02:21:15.363
2011-02-16T07:22:25.197
2011-02-16T06:42:17.010
489,571
489,571
[ "haskell", "internationalization", "software-distribution" ]
5,011,980
1
null
null
0
589
I have a child view controller that needs to be always shown in landscape mode regardless of which mode the parent view is in. I'm adding it onto the parent's view stack with ``` [[self navigationController] pushViewController:controller animated:NO]; ``` I am trying to force the view to rotate and be displayed as if the device is held in Landscape orientation even though it's still held in Portrait orientation. The only problem is that no matter what size and coordinates I set the view frame to, I see a 20 pixel gap on the right side of the screen where the StatusBar used to be during Portrait Mode. What can I adjust to ensure that this gap is gone? Here's how I'm doing the transformation (as recommended [by this SO article](https://stackoverflow.com/questions/2922919/transitioning-to-landscape-rotation-within-a-uinavigationcontroller)) ``` - (void)changeOrientationToLandscape { UIApplication *myApp = [UIApplication sharedApplication]; CGAffineTransform landscapeTransform = CGAffineTransformMakeRotation( degreesToRadian(90) ); landscapeTransform = CGAffineTransformTranslate(landscapeTransform, +90.0, +90.0 ); [self.view setTransform:landscapeTransform]; // Change the status bar orientation so it's shown as if we're in landscape myApp.statusBarOrientation = UIInterfaceOrientationLandscapeLeft; // Manually force view frame - this doesn't seem to fix the 20 pixel gap self.view.frame = CGRectMake(0, 0, 480, 320); } ``` The only time I see the view taking up the entire screen and without the 20 pixel gap is if I hide the status bar all together, something I cannot do for this app. Here's how the screen looks (it's held in Portrait orientation with the home button on the bottom). Notice how the status bar ends doesn't have the same purple background - I was hoping I could shift the view over so the white gap is no longer present. I also printed out the view and navigationController's view frames and they both report x and y location at 0,0. The navigation view frame's reported dimension is 320x480 while view's frame is 480x320. ![View shifted with 20 pixel gap at top](https://i.stack.imgur.com/0JBYx.jpg)
Rotating view leaves 20 pixel gap on one side
CC BY-SA 2.5
null
2011-02-16T02:40:35.993
2011-02-16T21:06:48.007
2017-05-23T12:13:29.270
-1
566,281
[ "iphone" ]
5,012,273
1
5,012,360
null
3
3,639
Here the relevant part of my model: ![enter image description here](https://i.stack.imgur.com/YNrY6.png) And here the code from my model class: ``` /// <summary> /// Retrieves a list of vans for binding with the BeachReach Snapshot /// grid. Note: This method uses a POCO class that does not participate /// in management by the entity context. See the DisplayVan class for more info /// </summary> /// <param name="setVanIDs"> /// You may limit which vans will be returned by passing a hash /// set of their van IDs here /// </param> /// <returns>List of type DisplayVan - Unmanaged</returns> public static List<DisplayVan> GetVansForSnapshot(HashSet<int> setVanIDs = null) { using (BeachReachDataEntities objContext = new BeachReachDataEntities()) { var qryVans = from v in objContext.vans .Include("school") .Include("location") select new DisplayVan { vanID = v.vanID, vanName = v.vanName, phone = v.phone, capacity = (int)v.capacity, schoolName = v.school.schoolName, lastLocationName = v.location.locationName, statusNote = v.statusNote, isOffline = (v.isOffline == 1) ? true : false, isPrayerRoom = (v.isPrayerRoom == 1) ? true : false, isNotReady = (v.isNotReady == 1) ? true : false, creationDate = v.creationDate, modifiedDate = v.modifiedDate, vanAssignments = (from va in objContext.vanAssignments from pr in objContext.pickupRequests where va.vanID == v.vanID where pr.pickupRequestID == va.pickupRequestID select va) }; if (setVanIDs != null && setVanIDs.Count > 0) return qryVans.Where(v => setVanIDs.Contains(v.vanID)).ToList<DisplayVan>(); else return qryVans.ToList<DisplayVan>(); } } // -------------------------------------------------------- ``` I have also tried: ``` var qryVans = from v in objContext.vans .Include("school") .Include("location") .Include("vanAssignments") .Include("vanAssignments.pickupRequest") select new DisplayVan { vanID = v.vanID, vanName = v.vanName, phone = v.phone, capacity = (int)v.capacity, schoolName = v.school.schoolName, lastLocationName = v.location.locationName, statusNote = v.statusNote, isOffline = (v.isOffline == 1) ? true : false, isPrayerRoom = (v.isPrayerRoom == 1) ? true : false, isNotReady = (v.isNotReady == 1) ? true : false, creationDate = v.creationDate, modifiedDate = v.modifiedDate, vanAssignments = v.vanAssignments }; ``` Ignore the is**** properties. I'm using a MySQL database which doesn't support `boolean` types. The query must project onto `DisplayVan` instead of the `van` entity because I have some computed properties that I'm binding to the datagrid. The problem is when I try to access the `pickupRequest` navigation property of the `vanAssignment` entity. No matter what I do, the `pickupRequest` property is `null`. Note, I do have lazy loading off. How can I load the vanAssignment's pickupRequest relation via my query above? One last note: the `vanAssignments` property is a List of type `vanAssignment`. Thanks for any insight you can lend to this issue. One additional question. So taking from your example, I wanted to go to vanAssignment.person.firstName. I tried this: ``` var qryVans = (from v in objContext.vans select new { DisplayVan = new DisplayVan { vanID = v.vanID, vanName = v.vanName, phone = v.phone, capacity = (int)v.capacity, schoolName = v.school.schoolName, lastLocationName = v.location.locationName, statusNote = v.statusNote, isOffline = (v.isOffline == 1) ? true : false, isPrayerRoom = (v.isPrayerRoom == 1) ? true : false, isNotReady = (v.isNotReady == 1) ? true : false, creationDate = v.creationDate, modifiedDate = v.modifiedDate, vanAssignments = v.vanAssignments }, PickupRequests = v.vanAssignments.Select(va => va.pickupRequest), People = v.vanAssignments.Select(va => va.pickupRequest.person) }).ToList().Select(e => e.DisplayVan); ``` When I try to access that property, I get the following error: ![enter image description here](https://i.stack.imgur.com/kA3Hw.png)
LINQ to Entities: Loading One-To-Many Navigation Properties in Strong Typed Projections
CC BY-SA 2.5
null
2011-02-16T03:34:35.403
2011-02-16T04:22:42.227
2011-02-16T04:13:52.360
277,757
277,757
[ "c#", ".net", "entity-framework" ]
5,012,664
1
5,012,712
null
4
10,097
I have a FindFile routine in my program which will list files, but if the "Containing Text" field is filled in, then it should only list files containing that text. ![enter image description here](https://i.stack.imgur.com/knzy0.gif) If the "Containing Text" field is entered, then I search each file found for the text. My current method of doing that is: ``` var FileContents: TStringlist; begin FileContents.LoadFromFile(Filepath); if Pos(TextToFind, FileContents.Text) = 0 then Found := false else Found := true; ``` The above code is simple, and it generally works okay. But it has two problems: 1. It fails for very large files (e.g. 300 MB) 2. I feel it could be faster. It isn't bad, but why wait 10 minutes searching through 1000 files, if there might be a simple way to speed it up a bit? I need this to work for Delphi 2009 and to search text files that may or may not be Unicode. It only needs to work for text files. So how can I speed this search up and also make it work for very large files? --- Bonus: I would also want to allow an "ignore case" option. That's a tougher one to make efficient. Any ideas? --- Solution: Well, mghie pointed out my earlier question [How Can I Efficiently Read The First Few Lines of Many Files in Delphi](https://stackoverflow.com/questions/4845380/how-can-i-efficiently-read-the-first-few-lines-of-many-files-in-delphi), and as I answered, it was different and didn't provide the solution. But he got me thinking that I had done this before and I had. I built a block reading routine for large files that breaks it into 32 MB blocks. I use that to read the input file of my program which can be huge. The routine works fine and fast. So step one is to do the same for these files I am looking through. So now the question was how to efficiently search within those blocks. Well I did have a previous question on that topic: [Is There An Efficient Whole Word Search Function in Delphi?](https://stackoverflow.com/questions/1678572/is-there-an-efficient-whole-word-search-function-in-delphi) and RRUZ pointed out the SearchBuf routine to me. That solves the "bonus" as well, because SearchBuf has options which include Whole Word Search (the answer to that question) and MatchCase/noMatchCase (the answer to the bonus). So I'm off and running. Thanks once again SO community.
Fast Search to see if a String Exists in Large Files with Delphi
CC BY-SA 2.5
0
2011-02-16T05:00:12.050
2013-04-10T15:23:34.670
2017-05-23T12:13:29.403
-1
30,176
[ "delphi", "optimization", "search", "large-files" ]
5,012,644
1
5,012,705
null
1
1,358
I have created a UITableView with 4 Sections and 3 Rows so totally 12 Rows. But ``` - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath ``` The above method only gets called for 9 times instead of 12 times. Why this happening? My 4th section is not getting constructed but my 1st section gets duplicated as 4th section. Please refer my code below ``` @interface MainViewController : UITableViewController<UITextFieldDelegate,UITableViewDelegate,UITableViewDataSource> { } @end // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { CGRect frameRect = CGRectMake(0,0,320,460); UITableView *tableView = [[UITableView alloc] initWithFrame:frameRect style:UITableViewStyleGrouped]; tableView.delegate = self; tableView.dataSource = self; tableView.backgroundColor = [UIColor purpleColor]; tableView.scrollEnabled = YES; self.view = tableView; [tableView release]; [super viewDidLoad]; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { // Return the number of rows in the section. return 3; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // Return the number of sections. return 4; } // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSLog(@"CELL IS NIL %i", indexPath.section); static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; if (indexPath.section == 0) { if(indexPath.row == 0) { cell.text = @"Tmail"; UITextField *aField = [[UITextField alloc]initWithFrame:CGRectMake(100,10,200,40)]; aField.placeholder = @"Mandatory"; aField.delegate = self; aField.textColor = [UIColor blackColor]; [cell addSubview:aField]; [aField release]; } else if ( indexPath.row == 1 ) { cell.text = @"English"; UITextField *aField = [[UITextField alloc]initWithFrame:CGRectMake(100,10,200,40)]; aField.placeholder = @"Mandatory"; aField.delegate = self; aField.textColor = [UIColor blackColor]; [cell addSubview:aField]; [aField release]; } else { cell.text = @"Hindi"; UITextField *aField = [[UITextField alloc]initWithFrame:CGRectMake(100,10,200,40)]; aField.placeholder = @"Mandatory"; aField.delegate = self; aField.textColor = [UIColor blackColor]; [cell addSubview:aField]; [aField release]; } } else if (indexPath.section == 1) { if(indexPath.row == 0) { cell.text = @"Street"; UITextField *aField = [[UITextField alloc]initWithFrame:CGRectMake(100,10,200,40)]; aField.placeholder = @"Mandatory"; aField.delegate = self; aField.textColor = [UIColor blackColor]; [cell addSubview:aField]; [aField release]; } else if ( indexPath.row == 1 ) { cell.text = @"City"; UITextField *aField = [[UITextField alloc]initWithFrame:CGRectMake(100,10,200,40)]; aField.placeholder = @"Mandatory"; aField.delegate = self; aField.textColor = [UIColor blackColor]; [cell addSubview:aField]; [aField release]; } else { cell.text = @"State"; UITextField *aField = [[UITextField alloc]initWithFrame:CGRectMake(100,10,200,40)]; aField.placeholder = @"Mandatory"; aField.delegate = self; aField.textColor = [UIColor blackColor]; [cell addSubview:aField]; [aField release]; } } else if (indexPath.section == 2) { if(indexPath.row == 0) { cell.text = @"Salem"; UITextField *aField = [[UITextField alloc]initWithFrame:CGRectMake(100,10,200,40)]; aField.placeholder = @"Mandatory"; aField.delegate = self; aField.textColor = [UIColor blackColor]; [cell addSubview:aField]; [aField release]; } else if ( indexPath.row == 1 ) { cell.text = @"Samalpatti"; UITextField *aField = [[UITextField alloc]initWithFrame:CGRectMake(100,10,200,40)]; aField.placeholder = @"Mandatory"; aField.delegate = self; aField.textColor = [UIColor blackColor]; [cell addSubview:aField]; [aField release]; } else { cell.text = @"Chennai"; UITextField *aField = [[UITextField alloc]initWithFrame:CGRectMake(100,10,200,40)]; aField.placeholder = @"Mandatory"; aField.delegate = self; aField.textColor = [UIColor blackColor]; [cell addSubview:aField]; [aField release]; } } else if (indexPath.section == 3) { if(indexPath.row == 0) { cell.text = @"NOKIA"; UITextField *aField = [[UITextField alloc]initWithFrame:CGRectMake(100,10,200,40)]; aField.placeholder = @"Mandatory"; aField.delegate = self; aField.textColor = [UIColor blackColor]; [cell addSubview:aField]; [aField release]; } else if ( indexPath.row == 1) { cell.text = @"SAMSUNG"; UITextField *aField = [[UITextField alloc]initWithFrame:CGRectMake(100,10,200,40)]; aField.placeholder = @"Mandatory"; aField.delegate = self; aField.textColor = [UIColor blackColor]; [cell addSubview:aField]; [aField release]; } else { cell.text = @"SONY"; UITextField *aField = [[UITextField alloc]initWithFrame:CGRectMake(100,10,200,40)]; aField.placeholder = @"Mandatory"; aField.delegate = self; aField.textColor = [UIColor blackColor]; [cell addSubview:aField]; [aField release]; } } } return cell; } ``` ![enter image description here](https://i.stack.imgur.com/EpZ0y.png)
UITableView: `tableView:cellForRowAtIndexPath:` not called for all rows
CC BY-SA 3.0
null
2011-02-16T04:56:08.250
2018-03-12T04:26:57.570
2018-03-12T04:26:57.570
1,033,581
352,627
[ "ios", "iphone", "uitableview", "iphone-sdk-3.0" ]
5,013,064
1
5,013,980
null
1
897
``` <DataGrid Name="grid" HorizontalAlignment="Left" VerticalAlignment="Top" IsReadOnly="False" HeadersVisibility="None" AutoGenerateColumns="True" AutoGeneratingColumn="c_dataGrid_AutoGeneratingColumn"> public static DataView GetBindable2DArray<T>(this T[,] array) { DataTable dataTable = new DataTable(); for (int i = 0; i < array.GetLength(1); i++) { dataTable.Columns.Add(i.ToString(), typeof(Ref<T>)); } for (int i = 0; i < array.GetLength(0); i++) { DataRow dataRow = dataTable.NewRow(); dataTable.Rows.Add(dataRow); } DataView dataView = new DataView(dataTable); for (int i = 0; i < array.GetLength(0); i++) { for (int j = 0; j < array.GetLength(1); j++) { int a = i; int b = j; Ref<T> refT = new Ref<T>(() => array[a, b], z => { array[a, b] = z; }); dataView[i][j] = refT; } } return dataView; } public class Ref<T> { private readonly Func<T> getter; private readonly Action<T> setter; public Ref(Func<T> getter, Action<T> setter) { this.getter = getter; this.setter = setter; } public T Value { get { return getter(); } set { setter(value); } } } ``` Thats my code. And i got this DataGrid: ![enter image description here](https://i.stack.imgur.com/wqDfX.jpg) But Here is extra row and column. How to show only my grid 5x5 without empty row?
DataGrid additional column and row
CC BY-SA 3.0
null
2011-02-16T06:08:40.217
2012-03-06T09:21:54.107
2012-03-06T09:21:54.107
45,382
619,114
[ "c#", ".net", "wpf", "wpfdatagrid" ]
5,013,179
1
5,013,277
null
0
52
Before the image finishes loading, it shows the URL of the image. This looks really bad, esp when the user has a slower connection Example: see the second image, which is still loading: ![example](https://i.stack.imgur.com/BOMwQ.png)
Preventing image URL from showing when page is still waiting for remote image
CC BY-SA 2.5
null
2011-02-16T06:26:58.143
2011-02-16T06:53:24.250
null
null
180,663
[ "javascript", "html", "user-interface" ]
5,013,578
1
5,014,178
null
1
3,514
I have an Asp.Net MVC 3 application with a database "Consultants", accessed by EF. Now, the Consultant table in the db has a one-to-many relationship to several other tables for CV type information (work experience, etc). So a user should be able to fill in their name etc once, but should be able to add a number of "work experiences", and so on. But these foreign key tables are complex objects in the model, and when creating the Create View I only get the simple properties as editor fields. How do I go about designing the View or Views so that the complex objects can be filled in as well? I picture a View in my mind where the simple properties are simple fields, and then some sort of control where you can click "add work experience", and as many as needed would be added. But how would I do that and still utilize the model binding? In fact, I don't know how to go about it at all. (BTW, Program and Language stand for things like software experience in general, and natural language competence, not programming languages, in case you're wondering about the relationships there). Any ideas greatly appreciated! Here's the Create View created by the add View command by default: ``` @{ ViewBag.Title = "Create"; } <h2>Create</h2> <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script> @using (Html.BeginForm()) { @Html.ValidationSummary(true) <fieldset> <legend>Consultant</legend> <div class="editor-label"> @Html.LabelFor(model => model.FirstName) </div> <div class="editor-field"> @Html.EditorFor(model => model.FirstName) @Html.ValidationMessageFor(model => model.FirstName) </div> <div class="editor-label"> @Html.LabelFor(model => model.LastName) </div> <div class="editor-field"> @Html.EditorFor(model => model.LastName) @Html.ValidationMessageFor(model => model.LastName) </div> <div class="editor-label"> @Html.LabelFor(model => model.UserName) </div> <div class="editor-field"> @Html.EditorFor(model => model.UserName) @Html.ValidationMessageFor(model => model.UserName) </div> <div class="editor-label"> @Html.LabelFor(model => model.Description) </div> <div class="editor-field"> @Html.EditorFor(model => model.Description) @Html.ValidationMessageFor(model => model.Description) </div> <p> <input type="submit" value="Create" /> </p> </fieldset> } <div> @Html.ActionLink("Back to List", "Index") </div> ``` And here's the EF database diagram: ![Consultants EF diagram](https://i.stack.imgur.com/bXs37.jpg) Update: According to suggestion, I tried Steven Sanderson's blog solution, but I can't get it to work properly. I added this in the main view: ``` <div id="editorRows"> @foreach (var item in Model.Programs) { Html.RenderPartial("ProgramEditorRow", item); } </div> <input type="button" value="Add program" id="addItem" /> ``` I also added the javascript: ``` <script type="text/javascript"> var url = '@Url.Action("BlankEditorRow", "Consultant")'; $(document).ready(function () { $("#addItem").click(function () { $.ajax({ url: url, cache: false, success: function (html) { alert(html); $("#editorRows").append(html); } }); return false; }); }); </script> ``` A partial view: ``` @model Consultants.Models.Program @using Consultants.Helpers <div class="editorRow"> @*@using (Html.BeginCollectionItem("programs")) {*@ @Html.TextBoxFor(model => model.Name) @*}*@ </div> ``` And action methods in the controller: ``` public ActionResult Create() { Consultant consultant = new Consultant(); return View(consultant); } public ActionResult BlankEditorRow() { return PartialView("ProgramEditorRow", new Program()); } ``` Note that I commented out the Html.BeginCollectionItem part in the partial view, because I can't get that to work. It only gives me the hidden field Steven Sanderson talks about, but not the actual textbox. So I tried commenting that part out and just had a textbox. Well, that gets me the textbox, but I can't get to that info in the post method. I use the Consultant object as return parameter, but the Programs property contains no Program. Perhaps this has to do with the fact that I cannot get the BeginCollectionItem helper to work, but in any case I don't understand how to do that, or how to get to the Program supposedly added in the view. With a simple object I would add the new object in the post method by something like _repository.AddToConsultants(consultant), and when I save to EF it gets its id. But how do I do the same thing with the program object and save it to the database via EF?
Create Views for object properties in model in MVC 3 application?
CC BY-SA 2.5
null
2011-02-16T07:19:11.247
2011-02-16T15:43:26.877
2011-02-16T15:43:26.877
178,946
178,946
[ "asp.net", "entity-framework-4", "asp.net-mvc-3" ]
5,014,317
1
5,014,366
null
20
7,801
So I an into an error at runtime with my asp.net mvc3 app, when I checked the code I see that it has a red line on it, the says but . The error shows up only at runtime? I'm using and I was hoping it would help me dodge problems like this!? Is this by design or am I doing something wrong here? ![enter image description here](https://i.stack.imgur.com/Dcghb.jpg) The code above should NOT compile because there is no such method there! It fails at runtime : ![enter image description here](https://i.stack.imgur.com/eF7oV.jpg) This kinda of thing happens a lot, not just for un defined methods, but even variables, etc.
razor syntax with errors compiles when it should not compile
CC BY-SA 2.5
0
2011-02-16T08:50:54.580
2016-09-13T11:36:59.013
null
null
368,070
[ "asp.net-mvc", "asp.net-mvc-3", "compiler-errors", "razor", "t4mvc" ]
5,014,350
1
9,548,125
null
10
6,193
I have started the development of a SMB server for an old Z80 based machine. This machine runs a very simple, MS-DOS like operating system (no multitask, no concept of users, FAT filesystem only, no unicode, 8.3 filenames only) and has limited memory, therefore my first idea is to implement just the SMB core protocol. I will use TCP transport. As for now, I have just a very short testing code that just replies to the SMB_COM_NEGOTIATE command, indicating that the core protocol ("PC NETWORK PROGRAM 1.0") is the desired dialect. In order to test it, I try to connect from a Windows 7 machine, by opening a explorer window and typing `"\\<server IP>"` in the address bar. I have verified with Wireshark that the server receives the negotiate command and sends an (apparently) correct response. as soon as the Windows client receives the response, it shows a generic "Can't access resource" error message (with error code 0x80004005) and then nothing happens (no further SMB messages are sent). I was expecting to receive SMB_COM_TREE_CONNECT or a similar command. I was thinking that maybe Windows 7 does not support the core protocol (it is very old and it lacks any security feature whatsoever), but then, why does it list the core dialect name in the negotiate request? Maybe I am missing some step? Must the server send any additional packet after the negotiate response? The client OS is Windows 7 Ultimate 64 bits, and here are the Wireshark dumps of both the request and the response in case anyone can spot anything wrong in the process: The request: ![SMB dialect negotiate request](https://i.stack.imgur.com/LWuQu.png) The response: ![SMB dialect negotiate response](https://i.stack.imgur.com/tG8M8.png) If I select the NT LM 0.12 dialect instead of the core dialect, I receive a SESSION_SETUP_AND_REQUESTX command from the client. So apparently it seems that indeed, the core protocol is not supported by Windows 7. Anyway, any extra information will be appreciated.
Does Windows 7 actually support the SMB core protocol?
CC BY-SA 2.5
0
2011-02-16T08:54:12.943
2015-01-16T15:28:32.400
2011-02-16T10:24:31.650
4,574
4,574
[ "windows-7", "smb" ]
5,014,470
1
5,014,849
null
-1
1,703
![enter image description here](https://i.stack.imgur.com/P3whx.jpg) This is what i get when i try to run my program .. I am also getting: ``` java.lang.UnsupportedClassVersionError: Bad version number in .class file ```
Could not find the main class
CC BY-SA 2.5
null
2011-02-16T09:07:22.293
2011-02-16T20:44:54.850
2011-02-16T20:44:54.850
2,424
410,693
[ "java", "oracle", "jdbc" ]
5,014,737
1
5,014,768
null
2
742
How can I delete this horizontal line? ![enter image description here](https://i.stack.imgur.com/wB843.jpg)
Horizontal line between items in ExpandebleListView
CC BY-SA 2.5
0
2011-02-16T09:36:52.397
2011-02-16T09:39:00.177
null
null
338,581
[ "android", "android-layout", "expandablelistview" ]
5,014,828
1
5,017,753
null
3
5,068
I want to know that is this possible to create neon affect in android as shown in image below ![enter image description here](https://i.stack.imgur.com/BZJhg.jpg) I want to draw text using this affect in different colors is it possible
Android Neon Tubing
CC BY-SA 2.5
0
2011-02-16T09:44:19.190
2013-01-15T19:10:54.040
2011-09-20T15:56:46.900
573,432
517,247
[ "android" ]
5,014,860
1
5,014,941
null
3
6,459
I would like to the icon in the column "Data": ![enter image description here](https://i.stack.imgur.com/73mix.png) I've got on my column: ![enter image description here](https://i.stack.imgur.com/36tVT.png) And in the icon renderer function, I'm horizontally centering it with : ![enter image description here](https://i.stack.imgur.com/xP3wH.png) Yet it is still left-aligned.
How to center an image in a column in an ExtJS GridPanel?
CC BY-SA 2.5
null
2011-02-16T09:47:40.420
2016-02-18T19:30:13.560
null
null
4,639
[ "javascript", "css", "extjs" ]
5,014,897
1
5,015,023
null
0
529
I have 2 controls: dataGridView and Label. I load some files into datagrid and I show names of files in Label. Now i am dynamically changing maximum width of Label according to size of window but what can I do if I want to work with maximum height. I mean is there anyway how can I resize datagrid below Label if Label overfloating datagrid (some feature that say that these 2 controls can´t "overfloating" - i am sorry, I don´t know better english word for this). Or is there a way how can I add 3 dots at end of label and rest of content in label is show when I get mouse over it? ![Image shows "overfloating" label above datagridview](https://i.stack.imgur.com/dNstv.png) Thank you
Dynamic resizing of DataGrid according to other control
CC BY-SA 2.5
null
2011-02-16T09:50:22.460
2011-02-16T10:11:12.170
null
null
367,593
[ "c#", "winforms", "resize" ]
5,014,921
1
5,016,345
null
-1
439
I have this [http://pastebin.com/4NYvuaB0](http://pastebin.com/4NYvuaB0) view with the following result: ![enter image description here](https://i.stack.imgur.com/EvZ8t.png) The first foreach iteracts with projects the second iterates over Hitos (One project has one or more Hitos) the third iterates over Tareas (One Hito has zero, one or more tareas) It's working ok, but it takes about 120 seconds to render the view, which is too much! Does someone have an idea of how to make it faster? Thanks in advance.
How can I make a triple foreach faster?
CC BY-SA 3.0
null
2011-02-16T09:52:50.730
2011-05-26T16:28:15.120
2011-05-26T16:28:15.120
78,022
501,893
[ "php", "model-view-controller", "cakephp", "view" ]
5,015,139
1
null
null
0
2,732
I am trying to learn about the encryption of DB at application level using [this tutorial](http://mobileorchard.com/tutorial-iphone-sqlite-encryption-with-sqlcipher/). But I am getting an error that says > sqlcipher/sqlite3.c:11033:25: error: openssl/evp.h: No such file or directory sqlcipher/sqlite3.c:11034:26: error: openssl/rand.h: No such file or directory sqlite3.c:11035:26: error: openssl/hmac.h: No such file or directory and due these there are around 93 more errors in the build process. I have strictly followed the [tutorial](http://mobileorchard.com/tutorial-iphone-sqlite-encryption-with-sqlcipher/) but I am not able to get rid of those errors. I have added the path of the source code as instructed in the tutorials but still the problem persists. The screenshot could be seen here ![enter image description here](https://i.stack.imgur.com/enKzP.png)
iPhone SQLite encryption with SQLCipher facing errors
CC BY-SA 4.0
0
2011-02-16T10:17:18.833
2019-12-01T18:02:22.220
2019-12-01T18:02:22.220
472,495
582,584
[ "ios4", "sqlite", "sqlcipher" ]
5,015,384
1
null
null
4
2,101
In my ASP.NET application I am logging any application errors that occur and one that ocassionally comes up is: ``` A potentially dangerous Request.Form value was detected from the client (ctl00$MainContent$ddl_Months="<a"). ``` I understand that this is to do with the `<` - however the `DropDownList` does not contain this. ![enter image description here](https://i.stack.imgur.com/DSr39.png) ``` <select name="ctl00$MainContent$ddl_Months" onchange="javascript:setTimeout(&#39;__doPostBack(\&#39;ctl00$MainContent$ddl_Months\&#39;,\&#39;\&#39;)&#39;, 0)" id="ctl00_MainContent_ddl_Months"> <option selected="selected" value="201011">201011</option> <option value="201010">201010</option> <option value="200906">200906</option> <option value="200905">200905</option> <option value="200904">200904</option> </select> ``` Markup ``` <asp:DropDownList ID="ddl_Months" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddl_Months_SelectedIndexChanged" /> ``` Code behind ``` DataTable tblMonths = GlobFunctions.GetData("GetBureauReportsMonths", GlobVar.conStrX, new SqlParameter[1] { new SqlParameter("@BureauNumber", BureauCode) }); List<string> months = new List<string>(); for (int i = 0; i < tblMonths.Rows.Count; i++) { months.Add(Server.HtmlEncode(tblMonths.Rows[i][0].ToString())); } ddl_Months.DataSource = months; ddl_Months.DataBind(); ``` I am unable to replicate this error and was wondering what options are available to me to solve this issue?
ASP.NET Potentially Dangerous Request
CC BY-SA 2.5
null
2011-02-16T10:40:51.417
2012-02-02T07:14:56.747
2011-02-16T11:52:57.903
50,913
50,913
[ "asp.net" ]
5,015,406
1
5,015,497
null
1
1,252
I'm having trouble with getting unordered lists aligned how I want them to. Here's an image of what I'm looking to achieve. How can I get it to look like the version on the right? ![enter image description here](https://i.stack.imgur.com/ZIb81.png) I will have between 1 and 6 unordered lists depending on the page, so I need a generic solution. Here's a stripped down version of the css and html I'm using: CSS: ``` body { margin: 50px auto; width: 500px; } ul { float:left; margin: 0 20px 20px 0; padding: 0; width: 200px; } li { background: #ddd; list-style: none; margin: 1px 0; padding: 5px } li.title { background: #333; color: #fff; } ``` HTML: ``` <ul> <li class="title">Title A</li> <li>1A</li> </ul> <ul> <li class="title">Title B</li> <li>1B</li> <li>2B</li> <li>3B</li> </ul> <ul> <li class="title">Title C</li> <li>1C</li> <li>2C</li> </ul> ```
css alignment question
CC BY-SA 2.5
0
2011-02-16T10:42:56.563
2012-05-03T12:10:15.797
2011-02-16T10:48:48.877
287,047
357,008
[ "css", "alignment", "styling" ]
5,015,453
1
null
null
5
5,006
In an I have a column in which when the content of a cell is a certain value, a should be displayed. I define the column which will contain the button like this, which calls a : ``` { header: 'Payment Type', width: 120, sortable: true, renderer: renderPaymentType, dataIndex: 'paymentType' }] ``` in the rendering function, I return either text or the itself: ``` function renderPaymentType(val) { if(val!='creditInform') { return val; } else { return new Ext.Button({ text: val, width: 50, handler: function() { alert('pressed'); } }); } } ``` This basically works, except that the button is displayed as the text : ![enter image description here](https://i.stack.imgur.com/euMoX.png) # Addendum adding `.getEl()`: ``` function renderPaymentType(val) { if(val!='creditInform') { return val; } else { return new Ext.Button({ text: val, width: 50, handler: function() { alert('pressed'); } }).getEl(); } } ``` produces a : ![enter image description here](https://i.stack.imgur.com/hb5gH.png) adding `.getEl().parentNode.innerHTML`: ``` function renderPaymentType(val) { if(val!='creditInform') { return val; } else { return new Ext.Button({ text: val, width: 50, handler: function() { alert('pressed'); } }).getEl().parentNode.innerHTML; } } ``` causes some kind of rendering problem with the rest of the code altough in Firebug I strangely don't get any errors: ![enter image description here](https://i.stack.imgur.com/idclf.png)
Why is the button in my ExtJS grid appearing as "[object Object]"?
CC BY-SA 2.5
0
2011-02-16T10:47:26.810
2012-12-02T08:23:23.513
2011-02-16T11:19:01.073
4,639
4,639
[ "javascript", "extjs", "grid" ]
5,015,558
1
5,015,645
null
0
1,043
I'm trying to use this chart generator from [http://htmldrive.net/items/show/792/Rare-Accessible-charts-using-jQuery-and-HTML5.html](http://htmldrive.net/items/show/792/Rare-Accessible-charts-using-jQuery-and-HTML5.html) Here's the code which loads data from mysql database: The query works, but I guess my interpretation of the example provided in the site was wrong. I get an output if I do it this way(predefined data): ``` <tr> <th scope="row">Profit</th> <td>5</td> <td>5</td> </tr> ``` But when I do it this way I get a blank output: ``` ?> <table> <caption> Reports</caption> <thead> <tr> <td></td> <?php while($row=mysql_fetch_assoc($query)){ ?> <th scope="col"><?php echo $row['Cust_Name']; ?></th> <?php } ?> </tr> </thead> <tbody> <tr> <th scope="row">Subtotal</th> <?php while($row=mysql_fetch_assoc($query)){ ?> <td><?php echo $row['TOTAL_PUR']; ?></td> <?php } ?> </tr> <tr> <th scope="row">Profit</th> <?php while($row=mysql_fetch_assoc($query)){ ?> <td><?php echo $row['TOTALPROFIT']; ?></td> <?php } ?> </tr> </tbody> </table> ``` Here's what I'm getting: ![enter image description here](https://i.stack.imgur.com/bHyMa.png)
plot mysql data into chart
CC BY-SA 2.5
null
2011-02-16T10:59:00.623
2011-02-16T11:07:14.800
null
null
472,034
[ "php", "mysql", "charts" ]
5,015,699
1
5,015,730
null
1
1,730
I've done this on android using custom layouts for menus. How do I create a multiline dropdown Picker where each line item has additional string as footer? Like this: ![enter image description here](https://i.stack.imgur.com/9NZyC.jpg)
iPhone UI: Dropdown Picker with footer for each Item
CC BY-SA 2.5
0
2011-02-16T11:13:09.030
2011-02-16T11:23:39.710
null
null
389,161
[ "iphone", "ios" ]
5,015,685
1
5,016,258
null
3
7,083
I am very new to Ruby on Rails. I installed ruby on rails on my Windows 7 using the installer in [http://railsinstaller.org/](http://railsinstaller.org/). I could create a project once and thereafter I was not (I dont know what did I do in between :-( ). The complete errors messages are :- :- ``` c:\Sites>rails new Tickets_Test E:/Ashish/Ruby192/lib/ruby/1.9.1/rubygems.rb:762:in `report_activate_error': Cou ld not find RubyGem rails (>= 0) (Gem::LoadError) from E:/Ashish/Ruby192/lib/ruby/1.9.1/rubygems.rb:219:in `activate' from E:/Ashish/Ruby192/lib/ruby/1.9.1/rubygems.rb:1065:in `gem' from E:/Ashish/RailsInstaller/Ruby1.8.7/bin/rails:18:in `<main>' ``` :- ``` c:\Sites>rails --version E:/Ashish/Ruby192/lib/ruby/1.9.1/rubygems.rb:762:in `report_activate_error': Cou ld not find RubyGem rails (>= 0) (Gem::LoadError) from E:/Ashish/Ruby192/lib/ruby/1.9.1/rubygems.rb:219:in `activate' from E:/Ashish/Ruby192/lib/ruby/1.9.1/rubygems.rb:1065:in `gem' from E:/Ashish/RailsInstaller/Ruby1.8.7/bin/rails:18:in `<main>' ``` Any idea why the above is happening? Appearently there are two command prompts :- Ruby command prompt :- ![Ruby](https://i.stack.imgur.com/R0qx3.png) and Ruby for rails command prompt (The problem is resolved using this command prompt):- ![Ruby on rails](https://i.stack.imgur.com/A4IPh.png) I was using ruby command prompt. Sounds like a stupid question, however, I am not sure how there are "two" command prompts?
Ruby on rails :- Could not find RubyGem rails (>= 0) (Gem::LoadError)
CC BY-SA 2.5
0
2011-02-16T11:11:22.327
2012-10-28T02:57:30.273
2011-02-16T12:14:06.493
123,527
255,562
[ "ruby-on-rails", "ruby", "ruby-on-rails-3" ]
5,015,980
1
5,043,287
null
0
237
I've added the following image to help illustrate the problem better: ![image of window](https://i.stack.imgur.com/ihPgh.png) Hi, I'm looking for the best starting point to alter the data stored my core data model directly - speaking as someone who's new to the area. From my reading I'm pretty confident I shouldn't touch my `NSArrayController`, which was my natural instinct, and that I should always tackle the model. This makes sense but because I've used bindings and core data, xcode has generated everything for me and I don't have a sense of building up a class from scratch myself. For my initial task, I have a 'jobs' entity and `NSArrayController`. It has a jobTotalHours attribute that's a string in the 00:00:00 format and has a corresponding 'Hours' column for each job in an `NSTableView`. Separate to this, I have a stopwatch button that's linked to a text field next to it, displaying time as a 00:00:00 string. I have a class working that starts and stops a timer counting and displays it in increments of hours, minutes and seconds. What I need to do is to make the timer add time onto the jobTotalHours attribute for the current job highlighted in the `NSTableView`. The separate textfield has now been bound to display the time of the current highlighted hours column so that part's taken care of. In other words, the timer was originally adding time to a test variable and displaying it in an autonomous text field for testing reasons. Now I need it to add time onto whatever job is highlighted in a table view and I need to access the model programmatically without being sure of what step to take first. Thanks in advance for any advice. I'll include the timer class below if it's any use. I'm pretty sure it's rough and bad but it works: ``` #import <Cocoa/Cocoa.h> BOOL timerStarted; int timerCount; int timerSeconds; int timerMinutes; int timerHours; NSString *timerString; NSString *timerFieldSeconds; NSString *timerFieldMinutes; NSString *timerFieldHours; @interface timerController : NSObject <NSApplicationDelegate> { NSWindow *window; NSTimer *timerNoOne; IBOutlet NSCell *timerOneOutputLabel; IBOutlet id timerClockField; } -(IBAction)toggleTimerClock:(id)sender; @property (assign) IBOutlet NSWindow *window; @end ``` ``` #import "timerController.h" @implementation timerController -(IBAction)toggleTimerClock:(id)sender { if (timerStarted==FALSE) { timerStarted = TRUE; } else { timerStarted = FALSE; } } @synthesize window; - (void) awakeFromNib { // clear timer [timerClockField setStringValue:@"00:00:00"]; // initialize timer to count each second timerNoOne = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(updateTimerNoOne:) userInfo:nil repeats:YES]; } - (void) updateTimerNoOne:(NSTimer *) timer { if (timerStarted==FALSE) { // do nothing. Timer is switched off. } else { timerCount = timerCount + 1; timerSeconds = fmod(timerCount, 60); timerMinutes = floor(timerCount / 60); timerHours = floor(timerCount / 3600); if (timerSeconds < 10) { // add a leading 0 for formatting reasons. timerFieldSeconds = [NSString stringWithFormat:@"0%d",timerSeconds]; } else { timerFieldSeconds = [NSString stringWithFormat:@"%d",timerSeconds]; } if (timerMinutes < 10) { timerFieldMinutes = [NSString stringWithFormat:@"0%d",timerMinutes]; } else { timerFieldMinutes = [NSString stringWithFormat:@"%d",timerMinutes]; } if (timerHours < 10) { timerFieldHours = [NSString stringWithFormat:@"0%d",timerHours]; } else { timerFieldHours = [NSString stringWithFormat:@"%d",timerHours]; } NSString *timerString = [NSString stringWithFormat:@"%@:%@:%@",timerFieldHours,timerFieldMinutes,timerFieldSeconds]; //[timerClockField setStringValue:timerString]; } } @end ``` From reading some more, I'm wondering if it's a better approach for me to update the string in the textcell itself on each second of timer change and then only commit changes to the model on the timer finishing (e.g. the clock was stopped). Previously I was thinking of saving the model's jobTotalHours string second by second as this was directly altering the model and avoiding controllers, which I thought was the advised route to take. I had a subclass set up for `NSTableView` and `NSArrayController`. I was able to use them to detect selection changes to the rows in the table and print them out to the console. The subclass was called: ``` @interface modelUtilController : NSObject ``` Which performed the above tasks fine. I now wanted an outlet to the `NSManagedObject` so that I could directly manipulate assets in it while keeping outlets to the `NSTableView` to detect changed in row selection. I read that the subclass should be ``` @interface modelUtilController : NSManagedObject ``` which I changed it to and included an outlet to the data model. This crashes the original detection for changes in row selection, so I'm doing something wrong now. Perhaps I have to separate the subclass into 2? Ok I think I've solved this after 3 days at it. As far as I can see it's working but I haven't put it fully to work yet. Basically I created a separate function that I call from my timer once every second: ``` void amendTotalHours(id anObject) ``` This function uses my jobs `NSArrayController` and then finds the current value in the hours column using: ``` NSArray *selectedObjectsArray = [anObject selectedObjects]; NSManagedObjectModel *firstSelectedObject = [selectedObjectsArray objectAtIndex:0]; NSString *readCurrentTime = [firstSelectedObject valueForKey:@"jobTotalHours"]; ``` I then convert the string of time formatted into 00:00:00 to an integer of the total seconds. I add one onto this for each call from the timer and then convert the seconds back into a string in the 00:00:00 format. Finally, I send this back to the NSArrayController using: ``` [firstSelectedObject setValue:[NSString stringWithFormat:@"%@", timeValue] forKey:@"jobTotalHours"]; ``` And cry a (maybe temporary) sigh of relief.
Advice on dynamically altering default core data model content
CC BY-SA 2.5
null
2011-02-16T11:43:22.860
2011-02-18T15:41:39.043
2011-02-18T15:36:54.797
613,305
613,305
[ "objective-c", "xcode", "core-data", "nsmanagedobject" ]
5,016,062
1
null
null
1
227
A book "ASP.NET MVC 1.0 Test Driven Development" contains pictures like ![enter image description here](https://i.stack.imgur.com/fplkq.jpg) and ![enter image description here](https://i.stack.imgur.com/9mOy8.jpg) Unfortunately Emad Ibrahim (the book's author) doesn't know what software was used, he told the publisher did it for him. Maybe you know what it is. I believe it isn't [Balsamiq Mockups](http://balsamiq.com/). Many thanks!
What software was used to make these prototypes and diagrams?
CC BY-SA 2.5
null
2011-02-16T11:51:54.080
2012-02-13T14:05:42.983
null
null
11,256
[ "prototyping" ]
5,016,484
1
5,016,823
null
3
7,596
I want to programmatically open a RTF file in Microsoft Word using C#. But I don't want to get the "Convert File" dialog while doing that. How do I do that? I've tried this piece of code, but it still shows Word's "Convert File" dialog. ``` object missing = Missing.Value; string fileName = @"C:\RtfFile.rtf"; //object encoding = WdSaveFormat.wdFormatRTF; object encoding = Microsoft.Office.Core.MsoEncoding.msoEncodingUTF8; object noEncodingDialog = true; // http://msdn.microsoft.com/en-us/library/bb216319(office.12).aspx word.Documents.Open(ref fullFilePath, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref encoding, ref missing, ref missing, ref missing, ref noEncodingDialog, ref missing); ``` ![enter image description here](https://i.stack.imgur.com/VxjUr.png) Actually, there are two sub-questions. On one hand, I am not sure which encoding to use. I've tried both options shown in the code snippet and checked [Wikipedia for RTF character encoding](http://en.wikipedia.org/wiki/Rich_Text_Format#Character_encoding). On the other hand, `object noEncodingDialog = true` doesn't seem to work since the "Convert File" dialog keeps popping up (probably because the encoding is set wrongly). Any ideas? - - - Just in case you want to try it out. Add reference to "Microsoft Word 11.0 Object Library" from the "COM" tab. ``` using System; using System.Reflection; using System.Runtime.InteropServices; using Microsoft.Office.Interop.Word; namespace WordAutomationDemo { public class Program { static void Main(string[] args) { new Program(); Console.ReadKey(); } public Program() { object wordObject = null; try { wordObject = Marshal.GetActiveObject("Word.Application"); } catch (Exception) { // Do nothing. } Application word = null; bool wordInstanceCreated = false; if (wordObject != null) { word = (Application)wordObject; } else { wordInstanceCreated = true; word = new Application(); } word.Visible = true; object missing = Missing.Value; object fullFilePath = @"C:\RtfFile.rtf"; //object encoding = WdSaveFormat.wdFormatRTF; // http://msdn.microsoft.com/en-us/library/microsoft.office.tools.word.document.saveas(v=vs.80).aspx object encoding = Microsoft.Office.Core.MsoEncoding.msoEncodingUTF8; object noEncodingDialog = true; // http://msdn.microsoft.com/en-us/library/bb216319(office.12).aspx word.Documents.Open(ref fullFilePath, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref encoding, ref missing, ref missing, ref missing, ref noEncodingDialog, ref missing); //if (wordInstanceCreated) //{ // word.Quit(); //} } } } ```
How to open a RTF file with C# without showing the Microsoft Word "Convert File" dialog?
CC BY-SA 2.5
null
2011-02-16T12:37:04.913
2015-02-25T00:41:15.413
2015-02-25T00:41:15.413
3,204,551
33,311
[ "c#", "ms-word", "rtf", "word-automation" ]
5,016,639
1
null
null
2
1,788
When running a ASP.NET 3.5 project in Visual Studio 2010's Casini, I receive the following error: > This type of page is not served.Description: The type of page you have requested is not served because it has been explicitly forbidden. The extension '.aspx' may be incorrect. Please review the URL below and make sure that it is spelled correctly.Requested URL: /default.aspxVersion Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4955 This is a project running in visual studio 2010 in windows 7 64 bit on .NET 3.5 The same error occurs in IIS, although IIS is configured to handle .aspx: ![IIS settings](https://i.stack.imgur.com/RzeZm.png) I also executed aspnet_regiis /i from the 2.0.50727 .net folder: > C:\Windows\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis -iFinished installing ASP.NET (2.0.50727).
Cassini: ASPX file: This type of page is not served
CC BY-SA 2.5
null
2011-02-16T12:51:45.653
2011-04-04T15:44:47.767
2020-06-20T09:12:55.060
-1
106,866
[ "asp.net", ".net-3.5" ]
5,016,719
1
5,048,617
null
7
1,810
I would like to use `tikzDevice` to include annotated `ggplot2` graphs in a `Latex` document. `tikzAnnotate` help has an example of how to use it with base graphics, but how to use it with a grid-based plotting package like `ggplot2`? The challenge seems to be the positioning of the tikz node. `playwith` package has a function `convertToDevicePixels` ([http://code.google.com/p/playwith/source/browse/trunk/R/gridwork.R](http://convertToDevicePixels)) that seems to be similar to grconvertX/grconvertY, but I am unable to get this to work either. Would appreciate any pointers on how to proceed. ``` library(tikzDevice) library(ggplot2) options(tikzLatexPackages = c(getOption('tikzLatexPackages'), "\\usetikzlibrary{shapes.arrows}")) tikz(standAlone=TRUE) print(plot(15:20, 5:10)) #print(qplot(15:20, 5:10)) x <- grconvertX(17,,'device') y <- grconvertY(7,,'device') #px <- playwith::convertToDevicePixels(17, 7) #x <- px$x #y <- px$y tikzAnnotate(paste('\\node[single arrow,anchor=tip,draw,fill=green] at (', x,',',y,') {Look over here!};')) dev.off() ``` ![resulting image](https://i.stack.imgur.com/GBcO2.png)
Annotate ggplot2 graphs using tikzAnnotate in tikzDevice
CC BY-SA 2.5
0
2011-02-16T13:00:23.663
2011-05-09T06:56:34.323
null
null
168,168
[ "r", "ggplot2" ]
5,017,120
1
null
null
3
5,321
I have a table with a varbinary(max) column, i am trying to assign to that column a zero-lengh binary buffer, but instead of getting a zero-length value in the table, i am getting an 8000 bytes long value filled with zeros: ![8000 long zero buffer](https://i.stack.imgur.com/Nx736.gif) * the dataSize column in the shown query was added using DATALENGHT(data) ("SELECT _index, , data FROM....") and shows the actual size on the table of the value Where does the 8000 bytes long empty buffer come from? is this some kind of default behavior?
Assigning an empty binary value to a varbinary(MAX) column creates a column 8000 bytes long
CC BY-SA 3.0
null
2011-02-16T13:37:51.480
2014-07-17T22:43:30.360
2014-07-17T22:43:30.360
41,956
225,121
[ "sql", "tsql", "varbinary", "varbinarymax" ]
5,017,353
1
null
null
1
3,005
I have a problem while taking video , after 8 or 12 second it shows an error "Size limit reached" , i use `MediaStore.Video.EXTRA_SIZE_LIMIT=9999999999l` and `MediaStore.EXTRA_DURATION_LIMIT=90` in intent extra. Whether it is device problem or have a problem in manifest or code need to be changed ah? ![This is the error i got](https://i.stack.imgur.com/i3zVd.png) Thanks in advance.
SIZE LIMIT reached error in android?
CC BY-SA 2.5
null
2011-02-16T14:00:56.653
2011-02-16T14:13:38.053
2011-02-16T14:11:37.443
180,538
483,901
[ "android", "video" ]
5,017,381
1
5,022,396
null
2
801
I've used resharper for a while now and i notice that it sometimes adds advise to your code such as this: ![enter image description here](https://i.stack.imgur.com/rJ2iy.png) I'm writing a visual studio add-in where i'd like to do the same thing. Could anyone point me in the right direction?
Resharper like syntax highlighting
CC BY-SA 2.5
0
2011-02-16T14:03:16.777
2011-02-16T21:34:18.790
2011-02-16T14:17:22.993
39,106
619,768
[ "c#", "resharper" ]
5,017,445
1
5,017,589
null
5
14,233
I need some guidance to make an advanced search script for a website I'm working on. I already know how to search the database for simple queries. The problem I'm encountering right now is how to search, when using multiple select boxes. For example: ![enter image description here](https://i.stack.imgur.com/XYzzh.jpg) This is just a simple form with different search options. The question is: The visitor can choose to search on a country or city, both or even with all three options. How do I catch that in the PHP script? Do I have to check if for example a city has been chosen, and fire a query based on that? But if I do that I would have to make different queries based on each select option. In pseudo-code it would be something like this: (I imagine) if country and city and something else is not null, launch a query to search in all three tables in the database. Is there a simple way to accomplish this? Thanks in advance.
PHP/MYSQL advanced search script. How?
CC BY-SA 2.5
0
2011-02-16T14:10:43.383
2013-03-08T18:49:12.417
null
null
483,262
[ "php", "mysql" ]
5,017,462
1
null
null
0
261
In our wpf windows application, we are using sql server ce to store the data while inserting, deleting. For some times, it is working fine but after sometimes, its giving access violation exception. Here is the stack trace for that: ![enter image description here](https://i.stack.imgur.com/WSESs.png) Kindly Suggest? How to resolve this as application is getting closed? at System.Data.SqlServerCe.NativeMethods.SafeRelease(IntPtr& ppUnknown) at System.Data.SqlServerCe.SqlCeDataReader.ReleaseNativeInterfaces() at System.Data.SqlServerCe.SqlCeDataReader.Dispose(Boolean disposing) at System.Data.SqlServerCe.SqlCeDataReader.Close() at System.Data.Common.DbDataReader.Dispose(Boolean disposing) at System.Data.Common.DbDataReader.Dispose() at System.Data.Common.Internal.Materialization.Shaper`1.Finally() at System.Data.Common.Internal.Materialization.Shaper`1.SimpleEnumerator.Dispose() at System.Data.Common.Internal.Materialization.Shaper`1.SimpleEnumerator.MoveNext() at ParentalHealthServiceBL.DataAccess.HealthMonitorDAO.GetUserCOPDReadings(Int32 userID, String datearameter) in d:\projectParentalHealth\trunk\src\ParentalHealth\ParentalHealthServiceBL\DataAccess\HealthMonitorDAO.cs:line 1355 at ParentalHealthClient.DataAccess.HealthMonitorDAO.GetUserCOPDReadings(Int32 userID, String strFilter) in d:\projectParentalHealth\trunk\src\ParentalHealth\ParentalHealthClient\DataAccess\HealthMonitorDAO.cs:line 46 Thanks!
AccessViolation Exception in sqlserver compact edition
CC BY-SA 2.5
null
2011-02-16T14:12:55.943
2011-02-16T14:18:44.600
null
null
465,576
[ "wpf", "mvvm", "sql-server-ce" ]
5,017,543
1
5,017,579
null
3
194
Below is a small screenshot from within RubyMine 3.1. I am just starting to learn Ruby. The code here is from the Presenter-First MVP C# code generator over at [atomicobject.com](http://www.atomicobject.com/pages/Presenter+First). I am using this project along with a book to learn Ruby. The [documentation](http://www.ruby-doc.org/core/) for `puts` shows that it expects at least one parameter. Yet this code appears "somewhat legal" for two reasons: 1. The code appears to work fine when I step thru it via the debugger. 2. Searching online, and even here at SO, shows that puts w/o arguments creates a newline. However, is it bad practice to do this (hence the RubyMine warning)? The code I am looking at is from 2006. I'm running it with Ruby 1.9.2 if that matters any. ![enter image description here](https://i.stack.imgur.com/rOirA.png)
Is calling puts without arguments bad practice?
CC BY-SA 2.5
0
2011-02-16T14:20:31.773
2011-02-16T14:32:39.430
2017-05-23T12:24:45.570
-1
452,274
[ "ruby", "rubymine" ]
5,017,920
1
5,069,889
null
6
9,301
I installed the 32bit JDK and the service starts fine now. No idea why though. The machine it was failing on was 64bit... So installing the 32bit JDK will allow the service to install, but solr will not run. There is a StackOverflowException and NullPointer Excpetions in the logs. I am trying to run Jetty as a service on Windows 7 64bit. I have it running on a very similar machine just fine, but on the second I am getting errors I have not been able to resolve. The service installs fine, however when you try to start it you get the message in the console: The Jetty6-Service service was launched, but failed to start. ![enter image description here](https://i.stack.imgur.com/sGLip.png) This is the related contents in the jetty-service.log: ``` STATUS | wrapper | 2011/02/16 12:50:07 | Starting the Jetty6-Service service... STATUS | wrapper | 2011/02/16 12:50:07 | --> Wrapper Started as Service DEBUG | wrapper | 2011/02/16 12:50:07 | Using tick timer. DEBUG | wrapperp | 2011/02/16 12:50:07 | server listening on port 32000. STATUS | wrapper | 2011/02/16 12:50:07 | Launching a JVM... DEBUG | wrapper | 2011/02/16 12:50:07 | command: "java" -Djetty.home=../ -Djetty.logs=../logs -Dsolr.solr.home=C:/solr/ -Xms5m -Xmx64m -Djava.library.path="../lib/win32/" -classpath "../lib/win32/jetty-win32-service-java-6.1.26.jar;../lib/win32/wrapper.jar;../lib/jetty-6.1.3.jar;../lib/jetty-util-6.1.3.jar;../lib/servlet-api-2.5-6.1.3.jar;../start.jar" -Dwrapper.key="c5CIhIjsO0gmMcTE" -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.debug="TRUE" -Dwrapper.pid=4708 -Dwrapper.version="3.2.3" -Dwrapper.native_library="wrapper" -Dwrapper.service="TRUE" -Dwrapper.cpu.timeout="10" -Dwrapper.jvmid=1 org.mortbay.jetty.win32service.JettyServiceWrapperListener ../etc/jetty.xml FATAL | wrapper | 2011/02/16 12:50:07 | Unable to execute Java command. The system cannot find the file specified. (0x2) FATAL | wrapper | 2011/02/16 12:50:07 | "java" -Djetty.home=../ -Djetty.logs=../logs -Dsolr.solr.home=C:/solr/ -Xms5m -Xmx64m -Djava.library.path="../lib/win32/" -classpath "../lib/win32/jetty-win32-service-java-6.1.26.jar;../lib/win32/wrapper.jar;../lib/jetty-6.1.3.jar;../lib/jetty-util-6.1.3.jar;../lib/servlet-api-2.5-6.1.3.jar;../start.jar" -Dwrapper.key="c5CIhIjsO0gmMcTE" -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.debug="TRUE" -Dwrapper.pid=4708 -Dwrapper.version="3.2.3" -Dwrapper.native_library="wrapper" -Dwrapper.service="TRUE" -Dwrapper.cpu.timeout="10" -Dwrapper.jvmid=1 org.mortbay.jetty.win32service.JettyServiceWrapperListener ../etc/jetty.xml FATAL | wrapper | 2011/02/16 12:50:07 | Critical error: wait for JVM process failed ERROR | wrapper | 2011/02/16 12:50:09 | The Jetty6-Service service was launched, but failed to start. ``` The one difference that I know of between the two machines is that the one that is not working had Tomcat installed at one point which it no longer does. I have tried the following: 1. Uninstalled all copies of the Java JDK and JRE 2. Reinstalled the latest Java JDK - jdk1.6.0_24 which installs the associated JRE 3. Tried setting JAVA_HOME to C:\Program Files\Java\jdk1.6.0_24 4. Googled all error messages 5. I can run java -version in the console without error In case someone is looking for more information on running Jetty as a service, check out: 1. http://docs.codehaus.org/display/JETTY/Win32Wrapper 2. http://technologyenablingbusiness.blogspot.com/2010/12/solr-on-jetty-as-windows-service.html
Error Starting Jetty-Service (Solr)
CC BY-SA 2.5
null
2011-02-16T14:52:19.790
2012-09-23T15:54:40.273
2011-02-18T15:01:45.550
201,172
201,172
[ "java", "windows", "solr", "jetty" ]
5,017,971
1
5,018,267
null
0
1,045
I am testing my application (Windows 7, WinForms, Infragistics controls, C#, .Net 3.5). I have two monitors and my application saves and restores forms' position on the first or second monitors. So I physically switched off second monitor and disabled it at Screen Resolution on the windows display settings form. I need to know it is possible for my application to restore windows positions (for those windows that were saved on the second monitor) to the first one. I switched off second monitor and press Detect to apply hardware changes. ![enter image description here](https://i.stack.imgur.com/o1dIZ.jpg) Then Windows switched OFF the first monitor for a few seconds to apply new settings. When the first monitor screen came back, my application became unresponsive. My application was launched in debug mode, so I tried to navigate via stack and threads (Visual Studio 2008), paused application, started and did not find any thing that help me to understand why my application is not responsive. Could somebody help my how to detect the source of issue.
How to debug and detect hang issue
CC BY-SA 2.5
null
2011-02-16T14:55:41.023
2011-02-16T15:21:49.033
2011-02-16T15:06:31.923
214,071
183,600
[ "winforms", "visual-studio-2008", "debugging", "multiple-monitors", "freeze" ]
5,017,967
1
null
null
3
3,436
I'm facing a nasty issue when developing a WPF/WinForms interop application. I've been trying to resolve this issue for three days, but I'm unable to make any headway. I doubt I can provide enough information to get a resolution, but I'm looking for anyone who could explain The component I am using is AxMapControl (ESRI ArcGIS Engine 9.3.1 SP2), which as far as I know is COM-wrapped native code, exposed as a WinForms control. The component is embedded in our WPF (.NET 3.5) client software using WPF WinFormsHost proxy. Periodically the application crashes hard with an `AccessViolationException`. This always happens in reaction to user's mouse click on the map control, but there doesn't seem to be any rhyme or reason on what specific input. Stack trace is always the same: > System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at System.Windows.Forms.NativeWindow.DefWndProc(Message& m) at System.Windows.Forms.Control.DefWndProc(Message& m) at System.Windows.Forms.AxHost.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) Because the exception seems to be thrown outside any call stack initiated by my code, I can't figure out how to catch the exception and handle it programmatically. This issue happends in debug mode, as well as in release builds. It does however not occur on all computers, but I have been able to replicate this issue on Windows 7 and XP, as well as .NET framework 3.5 and 4.0. Inspecting what the process is up to at the time of a crash, the anomaly seems to be that there seem to be multiple `CreateFileMapping` operations on GAC-deployed DLLs which fail with the result `FILE LOCKED WITH ONLY READERS`. ![ProcMon screenshot](https://i.stack.imgur.com/8bPDm.png) This view has been filtered to show only results of that type, but it seems this happens exactly twice to each DLL. Does this mean something? Now, it's obvious I am clueless as to what is happening, and how to resolve this issue. If you have a clue, could you be kind and explain to me what type of issue I am dealing with? Any idea how I could debug this issue?
AccessViolationException from System.Windows.Forms, using WinFormsHost in WPF
CC BY-SA 2.5
null
2011-02-16T14:55:34.040
2011-03-31T13:24:22.570
null
null
4,333
[ "c#", "wpf", "interop", "access-violation", "esri" ]