Id
int64
1.68k
75.6M
PostTypeId
int64
1
2
AcceptedAnswerId
int64
1.7k
75.6M
ParentId
int64
1.68k
75.6M
Score
int64
-60
3.16k
ViewCount
int64
8
2.68M
Body
stringlengths
1
41.1k
Title
stringlengths
14
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
1
CreationDate
stringlengths
23
23
LastActivityDate
stringlengths
23
23
LastEditDate
stringlengths
23
23
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
1
21.3M
Tags
list
4,113,612
1
8,767,537
null
2
4,054
I get the infamous "Dialogs must be user-initiated" Security Exception when I try to print some stuff in Silverlight. As you can see, the dialog is as user-initiated as can be: ![Silverlight printing "Dialogs must be user-initiated" Security Exception](https://i.stack.imgur.com/SOmG3.png) [John Papa couldn't help me much out neither](http://johnpapa.net/silverlight/printing-tip-ndash-handling-user-initiated-dialogs-exceptions/), because I don't have any breakpoint set. [Mr MSDN thinks it could also be that I'm just taking too long](http://msdn.microsoft.com/en-us/library/ee671023(VS.95).aspx), but this is a demo application just as simple as can be. Any ideas? I guess it's a Visual Studio quirk, maybe some extensions interfering, as things seems to work when I launch the application outside of it. I first thought maybe the Code Contracts are interfering with their IL weaving, but they are deactivated for this project. Update: This is just a simple Silverlight application that runs locally from the file system. When I do "Start debugging", Visual Studio creates a hosting HTML file containing the Silverlight app in the Debug resp. Release folder of the project, launches the Internet Explorer with that HTML file and attaches the debugger to it. Update 2: I also get the same error when I create a web project to host the Silverlight app and create a virtual directory for it on IIS. I might also want to add that I don't have problems with printing in other Silverlight projects regardless of their hosting scenarios. Update 3: I downloaded FireFox and it works, I don't get the error when I debug with it. So it seems to have to do with my IE8. I uploaded the solution: [http://dl.dropbox.com/u/10401470/Code/Demos/PrintingDemo.zip](http://dl.dropbox.com/u/10401470/Code/Demos/PrintingDemo.zip) I wonder if anyone can reproduce? Anyone got an idea to which team I should file a bug report? Silverlight team? IE team? VS Debugger team?
Another knack on the "Dialogs must be user-initiated" Security Exception in Silverlight printing
CC BY-SA 2.5
null
2010-11-06T15:04:36.900
2012-02-04T06:57:00.397
2010-11-10T22:44:40.057
90,742
90,742
[ "visual-studio", "silverlight", "internet-explorer", "printing", "debugging" ]
4,113,664
1
4,114,519
null
0
7,891
How can I populate data into GridView using LINQ data source. Currently Im doing this manual with code bellow. ![alt text](https://i.stack.imgur.com/3gEvv.png) Here is my code: ``` <asp:GridView ID="gridProcesses" runat="server" AutoGenerateColumns="False" EnableModelValidation="True" Width="400px" DataKeyNames="ID"> <Columns> <asp:BoundField HeaderText="Name" /> <asp:BoundField HeaderText="CPU" /> <asp:BoundField HeaderText="RAM" /> <asp:CommandField ButtonType="Button" SelectText="Kill" ShowSelectButton="True"> <ItemStyle HorizontalAlign="Center" Width="30px" /> </asp:CommandField> </Columns> </asp:GridView> ``` code behind ``` public partial class OsControl : System.Web.UI.UserControl { protected void Page_Load(object sender, EventArgs e) { } private List<string> getTestData() { List<string> tData = new List<string>(); Random rand = new Random(); for (int i = 0; i < 10; i++) { tData.Add("proc" + i + "_" + rand.Next(100) + "_" + rand.Next(100)); } return tData; } protected void btnLoad_Click(object sender, EventArgs e) { DataTable dtProcesses = new DataTable(); dtProcesses.Columns.Add("Name", System.Type.GetType("System.String")); dtProcesses.Columns.Add("CPU", System.Type.GetType("System.Int32")); dtProcesses.Columns.Add("RAM", System.Type.GetType("System.Int32")); dtProcesses.Columns.Add("ID", System.Type.GetType("System.Int32")); int id = 0; foreach (string line in getTestData()) { string[] items = line.Split('_'); DataRow row = dtProcesses.NewRow(); row["Name"] = items[0]; row["CPU"] = int.Parse(items[1]); row["RAM"] = int.Parse(items[1]); row["ID"] = id++; dtProcesses.Rows.Add(row); } gridProcesses.DataSource = dtProcesses; gridProcesses.DataBind(); } }- ```
Asp.net GridView populating data using LINQ DataSource
CC BY-SA 2.5
null
2010-11-06T15:14:31.653
2010-11-06T18:31:58.370
null
null
423,278
[ "asp.net", "linq", "gridview", "datasource" ]
4,113,900
1
4,114,473
null
14
7,400
I need add watermark to the photo by special way. I know how to do it, but I don't know, how to do it the same way as in [this](http://www.photoshopessentials.com/photo-effects/copyright/) article. Here is method to add watermark. How I can change it to get image with watermark such as in article above? ``` public static Bitmap AddWatermark(this Bitmap originalImage, Bitmap watermarkImage, WatermarkLocationEnum location) { int offsetWidth; int offsetHeight; if ((watermarkImage.Width > originalImage.Width) | (watermarkImage.Height > originalImage.Height)) throw new Exception("The watermark must be smaller than the original image."); Bitmap backgroundImage = new Bitmap((Bitmap)originalImage.Clone()); Bitmap image = new Bitmap(backgroundImage.Width, backgroundImage.Height); Graphics graphics = Graphics.FromImage(image); offsetWidth = GetOffsetWidth(image.Width, watermarkImage.Width, location); offsetHeight = GetOffsetHeight(image.Height, watermarkImage.Height, location); watermarkImage.SetResolution(backgroundImage.HorizontalResolution, backgroundImage.VerticalResolution); offsetWidth = Math.Max(offsetWidth - 1, 0); offsetHeight = Math.Max(offsetHeight - 1, 0); graphics.DrawImage(watermarkImage, offsetWidth, offsetHeight); for (int i = offsetWidth; i < (offsetWidth + watermarkImage.Width); i++) { for (int j = offsetHeight; j < (offsetHeight + watermarkImage.Height); j++) { Color pixel = image.GetPixel(i, j); if (pixel.A > 0) { Color color = Color.FromArgb(pixel.A, pixel.R, pixel.G, pixel.B); Color imagePixelColor = backgroundImage.GetPixel(i, j); double alpha = (double)color.A / 255; Color newColor = Color.FromArgb(255, (int)((double)imagePixelColor.R * (1.0 - alpha) + alpha * color.R), (int)((double)imagePixelColor.G * (1.0 - alpha) + alpha * color.G), (int)((double)imagePixelColor.B * (1.0 - alpha) + alpha * color.B)); backgroundImage.SetPixel(i, j, newColor); } } } return backgroundImage; } //............ Image img = Bitmap.FromFile("DSC00766.JPG"); var wtm = (Bitmap)Bitmap.FromFile("Copyright1.jpg"); ((Bitmap)img).AddWatermark(wtm, WatermarkLocationEnum.BottomCenter).Save("new.jpg", System.Drawing.Imaging.ImageFormat.Jpeg); ``` Expected result: ![expect result](https://i.stack.imgur.com/7HsQT.jpg) Current result: ![current result](https://i.stack.imgur.com/52HV8.jpg)
C# - Add watermark to the photo by special way
CC BY-SA 4.0
0
2010-11-06T16:08:00.297
2021-02-23T12:54:00.973
2021-02-23T12:54:00.973
1,783,163
468,345
[ "winforms", "algorithm", "image-processing", "c#-4.0" ]
4,113,916
1
4,114,063
null
4
182
Lately I have been interested in better understanding the optimizations done by compiler back-ends. I thought that using Mathematica to explore this might be helpful because it makes creating, displaying and manipulating syntax trees pretty easy. I thought I would start simple and look at constant propagation. So I wrote a simple function and tried to look at the syntax tree. ``` f2[x_, y_] := Module[{temp1}, temp1 = 5; Return[(x + temp1)*y]; ] FullForm[f2] ``` The result of FullForm[f2], however, was just f2. I know that the right hand side of this expression has to be stored somewhere in Mathematica, so my question is where is it and is it possible to modify it after creating this rule using the SetDelayed operator ":="? In the mean time I have discovered that I can use the Function symbol to achieve what I am aiming for, but I would still like to understand what Mathematica is doing a little better. ``` f1 = Function[{x, y}, Module[{temp1}, temp1 = 5; Return[(x + temp1)*y] ] ] TreeForm[f1] ``` ![alt text](https://i.stack.imgur.com/TnCej.jpg)
Using Mathematica to understand compiler optimization: accessing definitions created using SetDelayed?
CC BY-SA 2.5
0
2010-11-06T16:12:03.283
2010-11-06T16:48:56.920
null
null
343,633
[ "compiler-construction", "wolfram-mathematica" ]
4,114,042
1
null
null
12
6,692
When I click on project properties I can set `Warning level` (`More Warnings`) and `Command Line -> Additional Options` (`-std=c99`). But I want that all my C project have that kind of options by default without manually setting them everytime I create new project. ![screenshot](https://i.stack.imgur.com/cInIC.jpg)
NetBeans settings for GCC
CC BY-SA 3.0
0
2010-11-06T16:44:37.550
2018-06-11T19:38:51.430
2016-05-13T10:36:02.093
null
464,525
[ "c", "gcc", "netbeans", "makefile", "mingw" ]
4,114,303
1
null
null
0
1,165
I'm trying to connect to a SQL Server 2008 R2 Express on my local workstation but keep getting an error. In Netbeans 6.9, in the New Entity Classes from Database wizard, I choose to Create a New Database Connection, Direct URL entry, select the SQL Server 2005 entry, enter the user name and password and the enter the JDBC URL (jdbc:sqlserver://myhost\sqlexpress:1234;databaseName=contoso). That leads to this error: ![alt text](https://i.stack.imgur.com/Gx8aa.jpg) I'm using the sqljdbc4.jar driver from [here](http://www.microsoft.com/downloads/en/details.aspx?FamilyID=%20a737000d-68d0-4531-b65d-da0f2a735707&displaylang=en). What am I doing wrong? However, despite this error, on the Services tab, I can open my the Databases node and see my SQL Server database instance with all the databases listed. I can even issue a query against the contoso database and get results. So the problem seems to be with the Wizard. Any suggestions?
Netbeans 6.9 to SQL Server 2008 R2: "cannot resolve collation conflict..."
CC BY-SA 2.5
null
2010-11-06T17:44:44.293
2010-12-20T00:30:49.993
null
null
492,564
[ "java", "sql-server", "netbeans", "jdbc" ]
4,114,380
1
4,114,395
null
0
197
I'm trying to upload an image using this script: ``` $photoName = $uploadedPhoto["name"]; $photoType = $uploadedPhoto["type"]; $photoSize = $uploadedPhoto["size"]; $photoTemp = $uploadedPhoto["tmp_name"]; $photoError = $uploadedPhoto["error"]; $ext=substr($photoName, strripos($photoName, '.'), strlen($photoName)); if(!strcmp(".jpg",$ext) || !strcmp(".jpeg",$ext)) { $src_img=imagecreatefromjpeg($photoTemp); } if(!strcmp(".png",$ext)) { $src_img=imagecreatefrompng($photoTemp); } list($width,$height)=getimagesize($photoTemp); $dst_img=ImageCreateTrueColor(130, 130); imagecopyresampled($dst_img,$src_img,0,0,0,0, 130, 130,$height,$width); if(!strcmp(".png",$ext)) $imageCreated = imagepng($dst_img, $newImage['dir']."/".$newImage['newName'].$ext); else $imageCreated = imagejpeg($dst_img,$newImage['dir']."/".$newImage['newName'].$ext); imagedestroy($dst_img); imagedestroy($src_img); ``` And I want the image to be size of 130x130 px. Now what I get is an img with a black spaces and even cut a bit.. ![alt text](https://i.stack.imgur.com/sr8xU.jpg) Now how do I make it work the right way?
Image upload makes images with black spaces
CC BY-SA 3.0
null
2010-11-06T18:01:14.670
2011-07-07T09:42:35.313
2011-07-07T09:42:35.313
560,648
134,602
[ "php", "image", "upload" ]
4,114,418
1
4,114,446
null
15
37,242
I've added a `QAction` to my `QToolBar` in my MainWindow in Qt Designer (using the Qt Creator IDE) and given that Action an icon (done by "Choose File" and selecting my .png located in the same directory as my project and source code). The icon shows up fine in the toolbar in Qt Designer, but does not show when the project is running. I've had similar trouble when choosing the title bar icon on windows. I've never used graphics in Qt before, is there something special I need to do? Screenshot: ![](https://i.imgur.com/e4vAz.png)
Qt/C++: Icons not showing up when program is run
CC BY-SA 3.0
0
2010-11-06T18:11:46.120
2021-02-11T10:00:57.500
2015-05-12T13:12:35.463
2,668,136
1,025,963
[ "qt", "icons", "toolbar" ]
4,114,474
1
4,114,758
null
1
692
I have recently ditch Dreamweaver as my IDE for my web projects and I'm currently using Eclipse. My current web project is written in PHP, but I'm not so familiar with Eclipse yet. I downloaded the Eclipse PDT. which has all the PHP developer plugins. And my first questions when I start a project does it mean I'm creating a root folder? and shall I choose PHP project or static web project? I've choosed the PHP project,but I just need to know that I'm not choosing the wrong one. And why is it showing an error(an exclamation mark) when I try to add some javascripts to my index.php file? ``` <script type="text/javascript" src="javascripts/addTools.js"></script> ``` when I hoover over the exclamation mark I get the following info: Multipel annotation found at this line: -starttag of element script -undefined attribute name (src) -undefined attribute name (type) -endtag of element script As far as I know I have used the correct syntax for adding external javascripts to a html. Seems like a bug? I can still run the website but it is just an annoying moment, pls help me anyone? REQUESTED SCREEN DUMP: ![alt text](https://i.stack.imgur.com/spOaT.jpg)
Some beginners eclipse questions
CC BY-SA 2.5
null
2010-11-06T18:25:28.353
2012-06-29T11:07:55.963
2010-11-06T20:14:40.990
449,132
449,132
[ "php", "eclipse", "eclipse-pdt" ]
4,114,385
1
4,115,959
null
0
2,785
just watch this screenshot I made so you see the difference: I have these requirments to be changed in the ComboBox`s PopUp so it looks like the grouped WPF DataGrid, its only about the Popup-area, do not judge the editable area of the ComboBox or that there is no Header... Important are these things, because I could not change them: ComboBox: 1. (Green Line) The alternating Background of the Item must start at the beginning 2. (Red Line) The TextBlocks within the Border must be aligned Center OR Right1. 3. (Blue) The weakly visible horizontal Border must always stretch to the right side or take all space2. to 1.) I have no idea why there is a margin to 2.) HorizontalAlignment of the TextBlock does not work to 3.) I can make the stackpanel in the ItemTemplate of the Combobox a read background then you can see very well the red color has a margin somehow on the right and left side. Have no idea how to remove that. Anyone can help, please? If you want to see the textbox live just download it here: [http://www.sendspace.com/file/6lmbrh](http://www.sendspace.com/file/6lmbrh) Its a 30 kb VS2010 .NET 4.0 project. ![alt text](https://i.stack.imgur.com/vU36e.png) Here is the XAML for the ComboBox: ``` <Window x:Class="TestComboGrouped.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="600" Width="200"> <Window.Resources> <Style x:Key="ComboBoxItemStyle" TargetType="ComboBoxItem"> <Setter Property="Foreground" Value="Red"/> <Style.Triggers> <Trigger Property="ComboBox.AlternationIndex" Value="0"> <Setter Property="Background" Value="White"></Setter> </Trigger> <Trigger Property="ComboBox.AlternationIndex" Value="1"> <Setter Property="Background" > <Setter.Value> <LinearGradientBrush RenderOptions.EdgeMode="Aliased" StartPoint="0.5,0.0" EndPoint="0.5,1.0"> <GradientStop Color="#FFFEFEFF" Offset="0"/> <GradientStop Color="#FFE4F0FC" Offset="1"/> </LinearGradientBrush> </Setter.Value> </Setter> </Trigger> </Style.Triggers> </Style> <Style x:Key="ComboBoxBorderStyle" TargetType="Border"> <Setter Property="UseLayoutRounding" Value="True" /> <Setter Property="BorderBrush" Value="#FFCEDFF6" /> <Setter Property="BorderThickness" Value="1 0 0 1" /> </Style> <Style x:Key="ComboBoxStyle" BasedOn="{StaticResource {x:Type ComboBox}}" TargetType="{x:Type ComboBox}"> <Setter Property="ItemContainerStyle" Value="{StaticResource ComboBoxItemStyle}"/> </Style> <!-- Grouped CollectionView --> <CollectionViewSource Source="{Binding WeeklyDateList,IsAsync=False}" x:Key="WeeklyView"> <CollectionViewSource.GroupDescriptions> <PropertyGroupDescription PropertyName="MonthName"/> </CollectionViewSource.GroupDescriptions> </CollectionViewSource> </Window.Resources> <StackPanel> <ComboBox ItemsSource="{Binding Source={StaticResource ResourceKey=WeeklyView}}" ScrollViewer.HorizontalScrollBarVisibility="Auto" Style="{StaticResource ComboBoxStyle}" AlternationCount="2" MaxDropDownHeight="300" Width="Auto" x:Name="comboBox" > <ComboBox.GroupStyle> <GroupStyle> <GroupStyle.HeaderTemplate> <DataTemplate> <TextBlock Padding="5,0,0,0" Background="White" Foreground="DarkBlue" FontSize="14" FontWeight="DemiBold" Text="{Binding Name}"/> </DataTemplate> </GroupStyle.HeaderTemplate> </GroupStyle> </ComboBox.GroupStyle> <ComboBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <Border Style="{StaticResource ComboBoxBorderStyle}"> <TextBlock Width="100" Foreground="Purple" Text="{Binding WeeklyLessonDate, StringFormat='yyyy-MM-dd'}"/> </Border> <Border Style="{StaticResource ComboBoxBorderStyle}"> <TextBlock Padding="5,0,5,0" Width="40" Text="{Binding WeekNumber}"/> </Border> </StackPanel> </DataTemplate> </ComboBox.ItemTemplate> </ComboBox> </StackPanel> </Window>1.2. ``` : @Meleak thats the updated image it looks very nice thanks to you: ![alt text](https://i.stack.imgur.com/b5Oie.png) I was just about to put my old 2-"ColumnHeader" in that ComboBox`s Popup top area but I could not find anymore my sample... seems due to changing/trying a lot I have overritten that code :/ I know I did it in the controltemplate above the scrollviewer with a stackpanel or a grid with 2 rowdefinitions. But your code looks now totally different to my default combobox controltemplate I have no idea how to merge both code snippets. I think that was the code where I put the 2 "column headers", just search for inside the POPUP ``` <Style x:Key="ComboBoxStyle1" TargetType="{x:Type ComboBox}"> <Setter Property="FocusVisualStyle" Value="{StaticResource ComboBoxFocusVisual}"/> <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/> <Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/> <Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/> <Setter Property="BorderThickness" Value="1"/> <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/> <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/> <Setter Property="Padding" Value="4,3"/> <Setter Property="ScrollViewer.CanContentScroll" Value="true"/> <Setter Property="ScrollViewer.PanningMode" Value="Both"/> <Setter Property="Stylus.IsFlicksEnabled" Value="False"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ComboBox}"> <Grid x:Name="MainGrid" SnapsToDevicePixels="true"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/> </Grid.ColumnDefinitions> <Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom"> <Microsoft_Windows_Themes:SystemDropShadowChrome x:Name="Shdw" Color="Transparent" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=MainGrid}"> <Border x:Name="DropDownBorder" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"> ``` // ``` <ScrollViewer x:Name="DropDownScrollViewer"> <Grid RenderOptions.ClearTypeHint="Enabled"> <Canvas HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0"> <Rectangle x:Name="OpaqueRect" Fill="{Binding Background, ElementName=DropDownBorder}" Height="{Binding ActualHeight, ElementName=DropDownBorder}" Width="{Binding ActualWidth, ElementName=DropDownBorder}"/> </Canvas> <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> </Grid> </ScrollViewer> </Border> </Microsoft_Windows_Themes:SystemDropShadowChrome> </Popup> <ToggleButton BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ComboBoxReadonlyToggleButton}"/> <ContentPresenter ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" Content="{TemplateBinding SelectionBoxItem}" ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsHitTestVisible="false" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> </Grid> <ControlTemplate.Triggers> <Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true"> <Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/> <Setter Property="Color" TargetName="Shdw" Value="#71000000"/> </Trigger> <Trigger Property="HasItems" Value="false"> <Setter Property="Height" TargetName="DropDownBorder" Value="95"/> </Trigger> <Trigger Property="IsEnabled" Value="false"> <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/> <Setter Property="Background" Value="#FFF4F4F4"/> </Trigger> <Trigger Property="IsGrouping" Value="true"> <Setter Property="ScrollViewer.CanContentScroll" Value="false"/> </Trigger> <Trigger Property="ScrollViewer.CanContentScroll" SourceName="DropDownScrollViewer" Value="false"> <Setter Property="Canvas.Top" TargetName="OpaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/> <Setter Property="Canvas.Left" TargetName="OpaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> <Style.Triggers> <Trigger Property="IsEditable" Value="true"> <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorder}"/> <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/> <Setter Property="IsTabStop" Value="false"/> <Setter Property="Padding" Value="3"/> <Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}"/> </Trigger> </Style.Triggers> </Style> ```
WPF: Refine the look of a grouped ComboBox vs. a grouped DataGrid -sample attached -
CC BY-SA 2.5
null
2010-11-06T18:03:23.460
2010-11-07T09:42:52.717
2010-11-07T09:39:05.777
320,460
320,460
[ "wpf", "combobox", "grouping" ]
4,114,552
1
4,114,596
null
43
192,265
![alt text](https://i.stack.imgur.com/0d6FO.jpg) I have a rectangular `div`, like the one above. I want to remove the bottom border (from C to D) in my `div`. How can I do this?. Edit: Here is my CSS: ``` #index-03 { position: absolute; border: .1px solid #900; border-width: .1px; border-style: solid; border-color: #900; left: 0px; top: 102px; width: 900px; height: 27px; } ``` ``` <div id="index-03" style="background-color:limegreen; width:300px; height:75px;"> </div> ```
How to remove the bottom border of a box with CSS
CC BY-SA 4.0
0
2010-11-06T18:37:56.473
2019-04-11T18:15:43.957
2019-04-11T15:39:43.157
5,411,817
492,293
[ "css", "border" ]
4,114,590
1
4,119,460
null
10
2,996
I have a WPF app that draws text on an Aero glass background. The problem is that based on what is displayed my application, the text drawn on the glass background can become hard-to-read to downright-impossible-to-read. As you can see in the following screenshot, the , and text blocks become hard to read if the window my application is dark. ![alt text](https://i.stack.imgur.com/nwL6B.png) Now, Microsoft applications, such as Word, solve this with a kind of blur behind text, as you can see in the next screenshot: ![alt text](https://i.stack.imgur.com/Tg6mw.png) I've heard there is some kind of Win32 API call I can make to get this to work. However, that is just hearsay to me at this point, I have no facts to back that up. --- I've tried a few different WPF-specific things to approximate what Word does: - - `TextBlock` None of those give me usable results, they all look pretty crummy. Does anyone know of any method, WPF or Win32, that I could use to draw text the way Microsoft does on glass (, )?
How to make WPF text on Aero glass background readable?
CC BY-SA 2.5
0
2010-11-06T18:46:39.167
2011-03-29T08:35:37.717
2010-11-07T20:15:10.980
18,505
18,505
[ "wpf", ".net-3.5", "text" ]
4,114,662
1
4,114,707
null
1
656
In my last question ([Qt/C++: Icons not showing up when program is run](https://stackoverflow.com/questions/4114418/qt-c-icons-not-showing-up-when-program-is-run)) I asked how to get an icon to show up on a toolbar and was told I needed a Qt Resource, which I added and that fixed my problem, the icon did show up on the toolbar. Now I'm trying to set the title icon of a window, using the same resource file, and it shows up fine in the Qt preview viewer but blank in the actual program. I am using a MainWindow which has an MDIArea and the children are MainWindows as well; neither the parent MDI nor child MDI windows icons will show properly. On the parent, I see the regular "Windows Application icon" and on the child, the icon is completely blank. ![](https://i.stack.imgur.com/86fn9.png) How can I solve this?
WindowIcon not showing up despite being valid in resource (and used elsewhere)
CC BY-SA 3.0
null
2010-11-06T19:03:18.277
2013-06-17T07:49:23.123
2017-05-23T12:13:39.697
-1
1,025,963
[ "qt", "icons", "titlebar" ]
4,114,714
1
4,118,043
null
1
781
Ive been having some trouble using Plot to graph a complicated composite function. I am trying to plot the `ArgMax` of a composite function `F[]`. `F[]` involves several levels of nested composite functions, many of which involve `Solve[]` and `Min[]` or `Max[]`. I don't have any problems with the way `F[]` performs in my program (with the possible exception of how it renders in Plot), so I wont include the lengthy code that defines `F[]` and its underlying simpler functions, for now. When I try to use `Plot[FindArgMax[F[],{vars}]`, I get a very fast return on my output, which is mostly correct, except for the fact that I get a range with some buggy false values, which appear to be rendered as incorrect vertical segments over a portion of the plot. I have evaluated `F[]` over the range where the bugginess is happening, and have confirmed that the proper values are in line with the smooth curve shown in the second pic below. ![enter image description here](https://i.stack.imgur.com/vnUsQ.gif) `Plot[NArgMax[[F[],{vars}]`, I get a correct plot which does not include the bugginess/false vertical segments, but it takes a considerably longer time. I cant post a second link, but the `NArgMax` plot generates the same picture as above, but smooth and without the holes and vertical segments. Without getting into the specifics of `F[]`, is there a quick and easy way to coax `FindArgMax` into working properly here? Basically, is this a common issue with Plot that has a well known fix, or do I need to devote more time to recoding my definitions of `F[]` and the underlying composite functions if I want to be able to use the fast FindArgMax command in my Plot? Thanks in advance for any help, from a first timer here on the forum. :) EDIT: Sample code from the troublesome portion of my program: G1[x_, y_] := a Log[b x + cc y + d]Gx1[x_, y_] := Derivative[1, 0][G1][x, y]; Gy1[x_, y_] := Derivative[0, 1][G1][x, y];piPP1 = {y, x};c1ycrit0[fy_, mu1_] := Max[0, Flatten[ Solve[Gy1[x, y] == fy mu1 && piPP1[[1](https://i.stack.imgur.com/vnUsQ.gif)] == piPP1[[2]], y, x]][[1](https://i.stack.imgur.com/vnUsQ.gif)][[2]]]c1xcrit1[fx_, fy_, mu1_] := Max[Quiet[ Flatten[ Solve[Gx1[x, Flatten[Solve[piPP1[[1](https://i.stack.imgur.com/vnUsQ.gif)] == piPP1[[2]], y]][[1](https://i.stack.imgur.com/vnUsQ.gif)][[2]]] == mu1 fx, x]][[1](https://i.stack.imgur.com/vnUsQ.gif)][[2]]], Quiet[Flatten[ Solve[Gx1[x, Max[0, Flatten[ Solve[Gy1[x, y] == fy*mu1 && piPP1[[1](https://i.stack.imgur.com/vnUsQ.gif)] == piPP1[[2]], y, x]][[1](https://i.stack.imgur.com/vnUsQ.gif)][[2]]]] == mu1 fx, x]]][[1](https://i.stack.imgur.com/vnUsQ.gif)][[2]]]c1xcrit2[fx_, fy_, mu1_, T1_] := Max[Quiet[ Flatten[Solve[T1 == x fx + fy c1ycrit0[fy, mu1] , x, y]][[1](https://i.stack.imgur.com/vnUsQ.gif)][[2]]], Quiet[Flatten[ Solve[{piPP1[[1](https://i.stack.imgur.com/vnUsQ.gif)] == piPP1[[2]], T1 == x fx + fy piPP1[[2]]}, x, y]][[1](https://i.stack.imgur.com/vnUsQ.gif)][[2]]]]Manipulate[ Quiet[Plot[(fx - xc) Max[0, Min[c1xcrit1[fx, fy, mu1], c1xcrit2[fx, fy, mu1, T1]]], {fx, 0, fxMax}, PlotRange -> {{0, fxMax}, {0, xPTmax}}]], {{mu1, 10, Subscript[Mu, 1]}, 0, 100}, {{xc, 3}, 0, 100}, {{fy, 10}, 0, 100}, {{T1, 100}, 0, 1000}, {{fxMax, 50}, 0, 100}, {{xPTmax, 100}, 0, 400}, ContinuousAction -> None]BRX[fy_, xc_, mu1_, T1_] := Quiet[FindArgMax[(fx - xc) (Min[{c1xcrit1[fx, fy, mu1], c1xcrit2[fx, fy, mu1, T1]}]), {fx, xc}]]BRX1[fy_, xc_, mu1_, T1_] := Quiet[NArgMax[(fx - xc) (Min[{c1xcrit1[fx, fy, mu1], c1xcrit2[fx, fy, mu1, T1]}]), fx]]Manipulate[ xBR = Plot[BRX[fy, xc, mu1, T1], {fy, 0, hmax}, PlotRange -> {{0, hmax}, {0, hmax}}], {{mu1, 10, Subscript[Mu, 1]}, 0, 100}, {{xc, 3}, 0, 10}, {{T1, 100}, 0, 1000}, {{hmax, 40}, 0, 100}, ContinuousAction -> None]Manipulate[ xBR1 = Plot[BRX1[fy, xc, mu1, T1], {fy, 0, hmax}, PlotRange -> {{0, hmax}, {0, hmax}}], {{mu1, 10, Subscript[Mu, 1]}, 0, 100}, {{xc, 3}, 0, 10}, {{T1, 100}, 0, 1000}, {{hmax, 40}, 0, 100}, ContinuousAction -> None] Further edit: Changing the starting point "xc" for solving for "fx" in the BRX[] function drastically changes the result of the plot, which leads me to believe that it might be unlikely that I will be able to usefully use FindArgMax at all. I suppose that the derivatives are all a little too screwy due to all the MINs and MAXs in the underlying functions. Im still hopeful that there is a fix here that will enable to use FindArgMax, but Im a lot less optimistic after trying a few of the things suggested so far. Thanks again to everyone for your help so far! :)
PLOT in Mathematica using NArgMax vs FindArgMax
CC BY-SA 3.0
0
2010-11-06T19:14:41.423
2012-01-02T22:39:23.933
2012-01-02T22:37:56.163
615,464
499,398
[ "plot", "wolfram-mathematica" ]
4,114,782
1
null
null
2
342
I'm having problem with an element in a web page. When I load the page the header is usually on top: ![alt text](https://i.stack.imgur.com/ladGT.png) ... and when I reload the elements goes down to the next box: ![alt text](https://i.stack.imgur.com/cPHK2.png) When I press reload few times it jumps up and down randomly between reloads. This seems to only happen in Chrome (I'm using mac) but in Firefox the element is always on top like in the first example. I don't have much experience with html and css so I'm not sure how to track the error. I'm using Blueprint css and I place the element in css like this: nav { float: right; background: white; padding: 0 0.7em; white-space: nowrap; } The example can bee seen here: [http://foodoit.heroku.com/help](http://foodoit.heroku.com/help) Hope somebody has an idea what is causing this or how I would go about tracking the error. Update: I fixed the rails.js as described below but that did not solve the problem.
Problem with element jumping up and down between reloads (header with float: right;)
CC BY-SA 2.5
0
2010-11-06T19:27:32.790
2010-11-07T08:35:40.800
2010-11-07T08:35:40.800
457,217
457,217
[ "html", "css" ]
4,114,970
1
4,115,027
null
1
446
This query isn't working as I'm expecting it to. Anyone see the problem? I'm trying to get an element by it's name, but it's not returning anything. Here is the specific part of the function I need some help with: ![alt text](https://i.stack.imgur.com/zwpZ0.png) --- The solution was to use an XName instead of a string. Like so: ``` var matchingElements = elements.Where(e => e.Name.Equals(XName.Get(name))); ```
Need some help with a XElement Query
CC BY-SA 2.5
null
2010-11-06T20:17:48.910
2013-03-07T12:52:40.033
2010-11-06T20:52:24.263
402,098
402,098
[ "c#", ".net", "xml", "xelement" ]
4,115,089
1
4,119,145
null
2
851
I recently installed the Windows Phone 7 SDK with an existing Visual Studio Ultimate installation. Now when I attempt to open any XAML file, designer or just XAML, I get the error: ![Visual Studio Error](https://i116.photobucket.com/albums/o10/vcsjones/vserror.png) This is for any XAML file; not just WP7. This happens with a brand new project; not just with my existing ones, so I am pretty sure it isn't any funky code Visual Studio can't handle. Things I've already tried: - - Anyone know with this is; or can suggest other things? Fortunately I was smart enough to image my machine before I installed these tools. I'll roll back to that if I don't get this resolved soon.
Visual Studio: WPF opening a XAML file gives "Value cannot be null"
CC BY-SA 2.5
null
2010-11-06T20:48:03.320
2010-11-07T18:52:49.357
2017-02-08T14:30:52.873
-1
492,405
[ "wpf", "visual-studio-2010", "windows-phone-7", "xaml-designer" ]
4,115,216
1
4,116,749
null
1
720
I'm trying to find out how to make a custom knob control. To explain I have included a mockup![alt text](https://i.stack.imgur.com/f1rvJ.png): I would like the numeric values shown to be databindable (and include ticks to optionally snap to) I think I have to take the slider as a base but it's confusing how to make a custom control properly and databind all the values. Any advice?
WPF: Potmeter custom control
CC BY-SA 2.5
0
2010-11-06T21:18:20.043
2010-11-07T06:39:13.180
null
null
401,480
[ "wpf", "controls" ]
4,115,443
1
4,115,889
null
2
3,050
I need to add an odontogram to my webpage. It looks like this: ![alt text](https://i.stack.imgur.com/uepMr.png) I would like to know if there is already some kind of open source odontogram. I am using spring-mvc so it has to be in java
Odontogram code
CC BY-SA 2.5
0
2010-11-06T22:15:02.820
2019-02-08T19:33:01.223
null
null
119,895
[ "java", "spring-mvc" ]
4,115,742
1
4,115,990
null
1
357
I am trying to make an application that have the looks of ![alt text](https://i.stack.imgur.com/Xcjs4.png) or ![alt text](https://i.stack.imgur.com/5OHIW.png) How can I do it in iphone using objective-C? Is it just a view that has a bunch of images? I was just wondering why only loopt and facebook uses these kind of view, while other such as foursquare, twitter, gowalla, etc.. doesn't use it? Is it because these kinds of views are hard to implement?
how to create an interface like facebook/loopt
CC BY-SA 2.5
null
2010-11-06T23:35:44.717
2010-11-07T03:40:24.527
2010-11-07T03:40:24.527
95,265
95,265
[ "iphone", "objective-c" ]
4,115,771
1
4,115,828
null
0
2,296
I noticed that the text of the Softkeyboard in landscape mode doesn't show the same characters as I see in the EditText field in portrait mode. I use a keylistener for the EditText to only accept special chars: ``` private class MyKeylistener extends NumberKeyListener { public int getInputType() { return InputType.TYPE_CLASS_NUMBER; } @Override protected char[] getAcceptedChars() { return new char[] {'0','1','2','3','4','5','6','7','8','9',',','-'}; } }; ``` When I type in a "," in landscape mode I don't see it in the softkeyboard-text, but it appears in the EditText when I flip the screen to portrait mode. How can I make the softkeyboard-text show all allowed characters? I append a picture to show what I mean, the EditText is "34,37,39": ![alt text](https://i.stack.imgur.com/kD1e9.png)
Softkeyboard-text in landscape mode doesn't show all chars of EditText
CC BY-SA 2.5
0
2010-11-06T23:43:00.230
2012-02-10T11:14:00.277
null
null
474,326
[ "android", "keyboard", "landscape", "flip", "android-softkeyboard" ]
4,115,784
1
4,118,402
null
5
3,359
I've wrote a simple handler: ``` public class ImageHandler : IHttpHandler, IRequiresSessionState { public bool IsReusable { get { return true; } } public void ProcessRequest(HttpContext context) { byte[] imgData = context.Session["Data"] as byte[]; if (imgData != null) { context.Response.CacheControl = "no-cache"; context.Response.Cache.SetCacheability(HttpCacheability.NoCache); context.Response.ContentType = "image/png"; context.Response.BinaryWrite(imgData); context.Response.Flush(); } } } ``` And setup the `web.config`: ``` <system.web> <httpHandlers> <add verb="GET" path="image.png" type="TestWeb.Handlers.ImageHandler, TestWeb" /> </httpHandlers> </system.web> <system.webServer> <handlers> <add name="Image" verb="GET" path="image.png" type="TestWeb.Handlers.ImageHandler, TestWeb" /> </handlers> </system.webServer> ``` - - `don't open a page. Wait for request from an external application` It is not just the breakpoint, no code from the handler executes when I run the website configured on IIS. It only works if I start from VS. ![only from VS](https://i.stack.imgur.com/lmAvN.png)
ASP.NET handler not running on IIS7
CC BY-SA 2.5
0
2010-11-06T23:45:54.227
2010-11-07T15:37:03.173
2010-11-07T14:17:24.993
340,760
340,760
[ "asp.net", "iis-7", ".net-4.0", "module", "asp.net-4.0" ]
4,115,812
1
null
null
1
2,886
Im working on an app that needs a source list like the the ones found in Finder. So far I've gotten Core Data working with an `NSOutlineView` but the group headings don't look very source list like. A real source list group heading looks like ![alt text](https://i.stack.imgur.com/RCvMv.png) and the standered on in an `NSOutlineView` looks like ![alt text](https://i.stack.imgur.com/7K7VL.png). It appears that the only major differences are text color and capital letters. Is it possible to change the color of only the group headings or is there a source list heading "theme" I can use?
NSOutlineView as Source list with core data
CC BY-SA 2.5
0
2010-11-06T23:52:38.593
2015-08-28T03:03:45.313
2015-08-28T03:03:45.313
1,677,912
293,039
[ "cocoa", "nsoutlineview" ]
4,115,897
1
null
null
2
7,078
I'm using TikZ to show Prim's algorithm, like in [this example on texample.net](http://www.texample.net/tikz/examples/prims-algorithm/#c1982). ![screenshot](https://i.stack.imgur.com/4Owbe.png) How can I get TikZ to create bended edges instead of the straight ones here?
How can I get bended edges in a TikZ graph?
CC BY-SA 3.0
null
2010-11-07T00:18:15.863
2012-01-19T10:10:08.613
2011-08-13T15:26:09.930
600,500
499,563
[ "latex", "tikz", "animated" ]
4,116,085
1
4,116,096
null
3
1,131
I have the following HTML: ``` <div id="root"> <div id="left_side">LEFT</div> <div id="center_s">CENTER</div> <div id="right_side">RIGHT</div> </div> ``` ...and CSS: ``` #root { background-color: #eee; } #left_side { float: left; } #center_s { margin-left: auto; margin-right: auto; width: 65px; background-color: #ccc; } #right_side { float: right; } ``` However, I get the following: ![Screenshot](https://i.stack.imgur.com/7yCkx.png) The DIV on the right is on a separate line, which is what I want. How can I make it stay on the same line as the other DIVs? you can see a live demo and play around with the code here: [http://jsfiddle.net/UDb4D/](http://jsfiddle.net/UDb4D/)
How come these DIVs will not display on the same line?
CC BY-SA 2.5
null
2010-11-07T01:29:57.650
2010-11-07T02:49:03.827
null
null
193,619
[ "css", "html", "alignment" ]
4,116,859
1
4,116,897
null
1
169
I want to use the same sort of UI style of Xcode has right above the editor pane, as show below: ## I've browsed through all the Views in Interface Builder and can't figure out what type of view this is. At this point I'm merely referring to the bar itself; not to the controls nested inside the bar, though I will be adding dropdowns in the same way as this. What type of view should I be looking for? TextMate uses one along the bottom of the editor too, which provides similar controls: ![TextMate screenshot](https://i.stack.imgur.com/p0jZi.png)
What type of View is that slim bar above the editor in Xcode?
CC BY-SA 2.5
null
2010-11-07T07:38:09.567
2010-11-07T08:13:04.090
null
null
322,122
[ "cocoa", "xcode", "interface-builder", "nsview" ]
4,116,891
1
4,120,051
null
0
154
while running an application written in windows on linux, i encountered a problem- i can't edit the cpp file of widget. all the other classes are editable. The error message appears on the top of the screen and looks like that: ![alt text](https://i.stack.imgur.com/Aa3xd.png)
error message in qt designer in Linux
CC BY-SA 2.5
null
2010-11-07T07:52:15.927
2015-01-19T10:31:37.430
null
null
487,305
[ "linux", "qt", "cross-platform" ]
4,116,980
1
null
null
0
157
while running my qt application in linux, a tab focus appears on the selected control- like this: ![alt text](https://i.stack.imgur.com/snUyy.png) that doesn't happened in windows. how can i get rid from this visual focus?
how to get rid of visual tab focus
CC BY-SA 2.5
null
2010-11-07T08:25:30.117
2010-11-08T18:51:43.897
null
null
487,305
[ "linux", "qt", "focus" ]
4,117,356
1
4,117,769
null
1
6,909
I'm trying to make a web style button with user control. I need to make User Control's background transparent. How to do this without making controls invisible. Also I'll need transparent Label and PictureBox. Trying to make something like this: ![alt text](https://i.stack.imgur.com/kxpK4.png) ``` this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); this.BackColor = Color.Transparent; ```
Transparent User Control in .net
CC BY-SA 2.5
null
2010-11-07T10:43:48.783
2013-12-24T07:29:22.827
2010-11-07T14:07:20.653
259,881
259,881
[ "c#", ".net", "vb.net", "winforms", "user-controls" ]
4,117,405
1
4,117,724
null
0
603
I'm trying to create a `http://domain.com/NotAuthorized` page. went to `Views\Shared` and added a View called `NotAuthorized` witch originates the file name `NotAuthorized.aspx` ![alt text](https://i.stack.imgur.com/SvFfY.png) in my Routes I wrote ``` routes.MapRoute( "NotAuthorized", // Route name "NotAuthorized.aspx" // Route Url ); ``` but every time I access `http://domain.com/NotAuthorized` I get an error > The resource cannot be found. How can access this without using `View("NotAuthorized")` in the `Controller`, in other words, not passing through any controller.
How to create a simple landing page in MVC2
CC BY-SA 2.5
null
2010-11-07T10:57:10.373
2010-11-07T12:35:25.857
null
null
28,004
[ "asp.net-mvc-2", "routes" ]
4,117,342
1
4,117,699
null
0
2,126
here is my sample project updated from this thread: [WPF: Refine the look of a grouped ComboBox vs. a grouped DataGrid -sample attached -](https://stackoverflow.com/questions/4114385/wpf-refine-the-look-of-a-grouped-combobox-vs-a-grouped-datagrid-sample-attache) [http://www.sendspace.com/file/ru8hju](http://www.sendspace.com/file/ru8hju) (VS2010 .Net 4.0 project) My question is now HOW can I add a "column header" like stackpanel horizontal with 2 TextBlocks ADD to my existing ComboBox ControlTemplate ABOVE the ScrollViewer when I have a custom ComboBoxItem stuff and there is the ItemPresenter in the default ComboBox ControlTemplate. Thats my existing grouped uneditable ComboBox. Over the Scrollviewr (above the December...) I want 2 Textblocks. How can I do that with MY XAML code see at the bottom: ![alt text](https://i.stack.imgur.com/rhP37.png) ``` <Window x:Class="TestComboGrouped.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="600" Width="200"> <Window.Resources> <SolidColorBrush x:Key="SelectedBackgroundBrush" Color="Orange" /> <SolidColorBrush x:Key="DisabledForegroundBrush" Color="#888" /> <Style x:Key="ComboBoxItemStyle" TargetType="ComboBoxItem"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ComboBoxItem"> <Grid HorizontalAlignment="Stretch" Margin="-5,0,0,0" Background="{TemplateBinding Background}"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition Width="45"/> </Grid.ColumnDefinitions> <Border Name="border1" BorderThickness="0,0,1,1" BorderBrush="#FFCEDFF6" Grid.Column="0"> <TextBlock Foreground="Purple" HorizontalAlignment="Right" Margin="0,0,5,0" Text="{Binding WeeklyLessonDate, StringFormat='yyyy-MM-dd'}"/> </Border> <Border Name="border2" BorderThickness="0,0,1,1" BorderBrush="#FFCEDFF6" Grid.Column="1"> <TextBlock HorizontalAlignment="Center" Text="{Binding WeekNumber}"/> </Border> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsHighlighted" Value="true"> <Setter TargetName="border1" Property="Background" Value="{StaticResource SelectedBackgroundBrush}"/> <Setter TargetName="border2" Property="Background" Value="{StaticResource SelectedBackgroundBrush}"/> </Trigger> <Trigger Property="IsEnabled" Value="false"> <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> <Setter Property="Foreground" Value="Red"/> <Style.Triggers> <Trigger Property="ComboBox.AlternationIndex" Value="0"> <Setter Property="Background" Value="White"></Setter> </Trigger> <Trigger Property="ComboBox.AlternationIndex" Value="1"> <Setter Property="Background" > <Setter.Value> <LinearGradientBrush RenderOptions.EdgeMode="Aliased" StartPoint="0.5,0.0" EndPoint="0.5,1.0"> <GradientStop Color="#FFFEFEFF" Offset="0"/> <GradientStop Color="#FFE4F0FC" Offset="1"/> </LinearGradientBrush> </Setter.Value> </Setter> </Trigger> </Style.Triggers> </Style> <!-- Grouped CollectionView --> <CollectionViewSource Source="{Binding WeeklyDateList,IsAsync=False}" x:Key="WeeklyView"> <CollectionViewSource.GroupDescriptions> <PropertyGroupDescription PropertyName="MonthName"/> </CollectionViewSource.GroupDescriptions> </CollectionViewSource> </Window.Resources> <StackPanel> <ComboBox ItemsSource="{Binding Source={StaticResource ResourceKey=WeeklyView}}" ScrollViewer.HorizontalScrollBarVisibility="Auto" ItemContainerStyle="{StaticResource ComboBoxItemStyle}" AlternationCount="2" MaxDropDownHeight="300" Width="Auto" x:Name="comboBox" > <ComboBox.GroupStyle> <GroupStyle> <GroupStyle.HeaderTemplate> <DataTemplate> <TextBlock Padding="5,0,0,0" Background="White" Foreground="DarkBlue" FontSize="14" FontWeight="DemiBold" Text="{Binding Name}"/> </DataTemplate> </GroupStyle.HeaderTemplate> </GroupStyle> </ComboBox.GroupStyle> <!--<ComboBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <Border Style="{StaticResource ComboBoxBorderStyle}"> <TextBlock Width="100" Foreground="Purple" Text="{Binding WeeklyLessonDate, StringFormat='yyyy-MM-dd'}"/> </Border> <Border Style="{StaticResource ComboBoxBorderStyle}"> <TextBlock Padding="5,0,5,0" Width="40" Text="{Binding WeekNumber}"/> </Border> </StackPanel> </DataTemplate> </ComboBox.ItemTemplate>--> </ComboBox> </StackPanel> </Window> ``` : OK very good news, I found my old code again which I thought I lost it somehow :) Below you see the Style for a ComboBox. I have pasted some own xaml there see my comment inside the ControlTemplate below. There is the Column Header of a former ComboBox. What I want now is to merge this Column Header with my above project and its custom ComboBoxItem style. > ``` <Border x:Name="DropDownBorder" BorderBrush="DarkBlue" BorderThickness="2" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"> ``` ``` // ColumnHeader START <StackPanel > <StackPanel Orientation="Horizontal"> <TextBlock HorizontalAlignment="Stretch" Text="lesson day" /> <TextBlock HorizontalAlignment="Stretch" Text="week" /> </StackPanel> // ColumnHeader END <ScrollViewer x:Name="DropDownScrollViewer" Background="Green"> <Grid RenderOptions.ClearTypeHint="Enabled"> <Canvas HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0"> <Rectangle x:Name="OpaqueRect" Fill="{Binding Background, ElementName=DropDownBorder}" Height="{Binding ActualHeight, ElementName=DropDownBorder}" Width="{Binding ActualWidth, ElementName=DropDownBorder}"/> </Canvas> <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> </Grid> </ScrollViewer> </StackPanel> </Border> </Popup> <ToggleButton BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ComboBoxReadonlyToggleButton}"/> <ContentPresenter ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" Content="{TemplateBinding SelectionBoxItem}" ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsHitTestVisible="false" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsEnabled" Value="false"> <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/> <Setter Property="Background" Value="#FFF4F4F4"/> </Trigger> <Trigger Property="IsGrouping" Value="true"> <Setter Property="ScrollViewer.CanContentScroll" Value="false"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> <Style.Triggers> <Trigger Property="IsEditable" Value="true"> <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorder}"/> <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/> <Setter Property="IsTabStop" Value="false"/> <Setter Property="Padding" Value="3"/> <Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}"/> </Trigger> </Style.Triggers> </Style> ``` combobox with column header => [http://img573.imageshack.us/img573/4202/columnheader.png](http://img573.imageshack.us/img573/4202/columnheader.png) ![alt text](https://i.stack.imgur.com/9CRFv.png)Hello, UPDATE 2: This is the code with a column header but trashed POPUP + Scrollbars do not work properly... I could not post the code due to 30000 chars limitation lol so grab it here: [http://www.sendspace.com/file/8puii8](http://www.sendspace.com/file/8puii8)
Put a "column header" over the ScrollViewer of a WPF ComboBox ControlTemplate
CC BY-SA 2.5
0
2010-11-07T10:36:13.777
2010-11-08T21:16:32.487
2017-05-23T12:01:09.963
-1
320,460
[ "wpf", "combobox", "controltemplate", "columnheader" ]
4,117,515
1
4,118,112
null
2
903
I don't undersatnd why I get 8:00AM instead of 00. This also happens if I set it to other hours. ![alt text](https://i.stack.imgur.com/qFOmm.png) Ok, I now tryed to present in a label the value of ``` [dateFormatter stringFromDate:dateTest]; ``` And in a wierd way it presented the time I formatted... But if I check the NSDate object on a breakpoint then it says 08:00:00 and not 00:00:00;
NSDateFormatter giving the wrong Hour (+8 hours)
CC BY-SA 2.5
null
2010-11-07T11:37:48.153
2010-11-07T17:57:22.533
2010-11-07T17:57:22.533
234,965
234,965
[ "iphone", "nsdateformatter" ]
4,117,620
1
4,120,176
null
4
3,277
I'm trying to figure out how to have a DIV column snapping to some fixed-size grid, via CSS. Here's the test page I'm working on: [http://mapofemergence.com/test/MoEv2/](http://mapofemergence.com/test/MoEv2/) What I'm trying to get, is the right div (the green one) someway snapping to the background grid quads: when resizing the browser window, the red quads should distribute in the middle area, while the green column should "fill" the remaining area on the right side of the page, and yet remaining always aligned (on the left) with the grid. Basically, being the grid's quad size, the right green div should have a variable width, equal to or greater than , and anyway minor than (in which case it should set back to a width of , while having one more red quad moving from the lower row to the upper one). here's an image to get a better idea: ![alt text](https://i.stack.imgur.com/4o9hG.jpg) (sorry, my reputation doesn't allow to hyperlink) I'm not really sure this can be done via CSS, but I'm sure that some of you can help finding some solution or workaround. I wouldn't use javascript, if possible. Thanks for your help, s
how to make a DIV snapping to a grid, via CSS?
CC BY-SA 2.5
0
2010-11-07T12:06:34.570
2013-02-03T21:53:09.510
2013-02-03T21:53:09.510
371,753
499,772
[ "css", "grid" ]
4,117,725
1
7,688,764
null
3
841
What Control can I use in WPF to emulate the Word Color Picker? In the WPF Ribbon, I think I have the RibbonGallery + `IsSharedColumnSizeScope` as shown in [Lester's Blog](https://learn.microsoft.com/en-us/archive/blogs/llobo/using-ribbongallery-control). Can I do the same with a normal WPF `ComboBox`? ![alt text](https://i.stack.imgur.com/vkpbr.jpg)
What Control can I use in WPF to emulate the Word Color Picker?
CC BY-SA 4.0
0
2010-11-07T12:35:31.977
2021-11-24T06:46:04.097
2021-11-24T06:46:04.097
4,751,173
292,291
[ "wpf", "combobox" ]
4,117,796
1
4,117,866
null
0
1,764
I have this window: ![alt text](https://i.stack.imgur.com/uCz2H.png) My problem is that when the number is larger than 2 digits, it pushes the red rectangle to the right. and I would like it to act like that: ![alt text](https://i.stack.imgur.com/44bj1.png) The rectangle must not been pushed to the right. This is my XAML: ``` <StackPanel> <Border BorderThickness="1" BorderBrush="Beige"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="30" /> <ColumnDefinition Width="auto" /> <ColumnDefinition Width="auto" /> </Grid.ColumnDefinitions> <StackPanel Orientation="Horizontal" Grid.Column="1"> <TextBlock Text="1" VerticalAlignment="Top" /> <Rectangle Width="20" Height="20" Fill="Red" VerticalAlignment="Top" /> </StackPanel> </Grid> </Border> <Border BorderThickness="1" BorderBrush="Beige"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="30" /> <ColumnDefinition Width="auto" /> <ColumnDefinition Width="auto" /> </Grid.ColumnDefinitions> <StackPanel Orientation="Horizontal" Grid.Column="1" > <TextBlock Text="1123" VerticalAlignment="Top" /> <Rectangle Width="20" Height="20" Fill="Red" VerticalAlignment="Top" /> </StackPanel> </Grid> </Border> </StackPanel> ```
WPF Alignment problems
CC BY-SA 2.5
null
2010-11-07T12:59:07.587
2010-11-07T13:16:32.150
null
null
138,627
[ "wpf", "alignment" ]
4,117,874
1
null
null
10
8,621
I found this question on [StackOverflow](https://stackoverflow.com/questions/106912/how-to-draw-custom-button-in-window-titlebar-with-windows-forms). Basically, the user wanted to draw custom buttons on the titlebar. I tried the code and realised it works in vista/7 only when Aero is disabled. My question is, is there any way to draw custom buttons on the titlebar aero is enabled? Also, is there any way of reading information from the current theme so I can style my buttons to match the already existing ones. --- Here is a screenshot from my computer demonstrating the above concept. I got the additional titlebar buttons after installing DisplayFusion. ![Notepad2 showing additional buttons.](https://i.stack.imgur.com/gt6q9.png) And I know DisplayFusion is a .NET program because it opens in .NET Reflector. The down side is that the program is obfuscated. Not like I wanted to decompile the program or anything; I just want to add a button to my titlebar to do something else (like minimise to the system tray for instance). Below is the screenshot, proving the program is a .NET app. ![.NET Reflector showing DisplayFusion](https://i.stack.imgur.com/immUZ.png)
Draw Custom Buttons on Windows Vista/7 Aero Titlebar
CC BY-SA 2.5
0
2010-11-07T13:18:40.220
2015-11-13T11:50:26.260
2017-05-23T12:13:26.330
-1
117,870
[ "c#", "vb.net", "winapi", "windows-vista", "titlebar" ]
4,117,891
1
4,117,910
null
0
375
I have a WPF application with various controls in it. When I move between controls using TAB, I can see the focus frame box: ![alt text](https://i.stack.imgur.com/1QQdA.png) Is there any way to hide this frame, so it won't be seen? A WPF solution is preferable but a WIN32 method would be acceptable as well.
Removing the focus frame box from controls
CC BY-SA 2.5
null
2010-11-07T13:23:08.533
2010-11-07T13:27:44.393
null
null
386,268
[ "c#", ".net", "wpf", "user-interface" ]
4,117,987
1
4,118,011
null
5
1,544
I'm passing a complex object as a `Model` to the `View` as ![alt text](https://i.stack.imgur.com/th2Ld.png) but when I get the Model back from the View, one particular object comes always `null` while other complex types are normally passed through ![alt text](https://i.stack.imgur.com/LaMe6.png) my View is the default `Edit` Strongly Typed View ![alt text](https://i.stack.imgur.com/lAPUP.png) > ? The Error says > The parameter conversion from type 'System.String' to type 'Julekalender.Database.CalendarInfo' failed because no type converter can convert between these types. I get the same for the other types? it automatically converted? --- I have added 3 fields (as the T4 template does not append this types) but I still get null when `POST`ing The green boxed below is the field ``` <div class="editor-field"> <%: Html.TextBoxFor(model => model.Calendar.Guid)%> </div> ``` ![alt text](https://i.stack.imgur.com/byg1e.png) --- Even renaming the Action to ``` [HttpPost] public ActionResult General2(GeneralInfo model) ``` gives the same error ![alt text](https://i.stack.imgur.com/PLRj1.png)
Passing Complex object from View to Controller: one object is always null
CC BY-SA 2.5
null
2010-11-07T13:46:47.377
2010-11-07T14:11:14.463
2010-11-07T14:11:14.463
28,004
28,004
[ "asp.net-mvc-2", "viewmodel", "parameter-passing" ]
4,118,038
1
4,118,170
null
0
534
Question is: how to write convention that prevents deleting entity reference if it inherits from type `Root`? --- I'm using fluent nhibernate and it's auto mapping feature. Turned on cascading delete by default. Everything was really cool until I finally hit case when I need to actually delete aggregate root that references another one. I got roots `User` and `Application`. `User` registers `Applications`. If it's registered by mistake, there is small time gap in which `User` with role `Admin` can remove it (I'm kind a sure I won't ever need that data). When `User` removes `Application`, because of cascading delete, nhibernate removes `User` itself (what an irony...). --- I'm unsure how to specify SaveUpdate cascading for Application->User association only: ![alt text](https://i.stack.imgur.com/bjv2n.jpg) --- Does the trick: ``` m.References(x=>x.RegisteredBy).Cascade.SaveUpdate(); //RegisteredBy.Type==User ``` Additionally, told fnh where to look for overrides: ``` var m=new AutoPersistenceModel(storeCfg); m.UseOverridesFromAssembly(assembly); ```
Fluent NHibernate cascading delete convention for aggregate roots
CC BY-SA 2.5
null
2010-11-07T14:01:48.520
2010-11-07T15:28:36.873
2010-11-07T15:28:36.873
82,062
82,062
[ "c#", "nhibernate", "fluent-nhibernate", "conventions", "automapping" ]
4,118,398
1
5,671,983
null
1
2,023
I'm new to Fluent and NHibernate and I'm not sure how to map this specific relationship that exists in my database. I have the following ER diagram below that outlines my table structure. ![ER Diagram](https://dl.dropbox.com/u/11595074/GroupRightDiagram.PNG) Below are my current C# entity classes: ``` public class GroupHeader { public virtual Guid Id { get; private set;} public virtual string Name { get; set; } public virtual string Description { get; set; } public virtual IList<RightHeader> Rights { get; set; } public virtual IList<GroupRight> GroupRights { get; set; } public GroupHeader() { GroupRights = new List<GroupRight>(); Rights = new List<RightHeader>(); } public GroupHeader(string name, string description, IList<RightHeader> rights) : this() { Name = name; Description = description; Rights = rights; if (rights != null) foreach (RightHeader right in rights) AddRight(right, 1); } public virtual void AddRight(RightHeader newRight, decimal rightValue) { GroupRight newGroupRight = new GroupRight(this, newRight, rightValue); GroupRights.Add(newGroupRight); } } public class GroupRight { public virtual GroupHeader Group { get; set; } public virtual RightHeader Right { get; set; } public virtual decimal RightValue { get; set; } public GroupRight() { } public GroupRight(GroupHeader group, RightHeader right, decimal rightValue) { Group = group; Right = right; RightValue = rightValue; } } public class RightHeader { public virtual decimal Num { get; private set; } public virtual string Name { get; set; } public virtual string Description { get; set; } public virtual IList<GroupRight> GroupRights { get; set; } public RightHeader() { } public RightHeader(decimal num, string name, string description) { Num = num; Name = name; Description = description; } } ``` These are my fluent mappings: ``` public class GroupHeaderMap : ClassMap<GroupHeader> { public GroupHeaderMap() { Table("GROUP_HEADER"); Id(x => x.Id, "GROUP_ID"); Map(x => x.Name, "GROUP_NAME").Unique(); Map(x => x.Description, "GROUP_DESCRIPTION"); HasMany(x => x.GroupRights) .Table("GROUP_RIGHT_COMPOSITE") .KeyColumns.Add("GROUP_ID") .Cascade.AllDeleteOrphan(); } } public class GroupRightMap : ClassMap<GroupRight> { public GroupRightMap() { Table("GROUP_RIGHT_COMPOSITE"); CompositeId() .KeyReference(x => x.Group, "GROUP_ID") .KeyReference(x => x.Right, "RIGHT_NUM"); Map(x => x.RightValue, "RIGHT_VALUE").Not.Nullable(); } } public class RightHeaderMap : ClassMap<RightHeader> { public RightHeaderMap() { Table("RIGHT_HEADER"); Id(x => x.Num, "RIGHT_NUM"); Map(x => x.Name, "RIGHT_NAME"); Map(x => x.Description, "RIGHT_DESCRIPTION"); HasMany(x => x.GroupRights) .Inverse() .Table("GROUP_RIGHT_COMPOSITE") .KeyColumn("RIGHT_NUM"); } } ``` Whenever I run my unit test that attempts to add a new GroupHeader, GroupRight and RightHeader to my database I get the following error: NHibernate.Exceptions.GenericADOException: could not insert: [Business.Objects.GroupRight#Business.Objects.GroupRight][SQL: INSERT INTO GROUP_RIGHT_COMPOSITE (RIGHT_VALUE, GROUP_ID, RIGHT_NUM) VALUES (?, ?, ?)] ---> System.Data.SqlClient.SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_GROUP_RIGHTS_RIGHTS". The conflict occurred in database "TEST", table "dbo.RIGHT_HEADER", column 'RIGHT_NUM'. The statement has been terminated. I'm pretty sure this happens because the RIGHT_HEADER record that I'm creating is not in the database and it's violating the foreign key constraint but I'm not sure how to map this so that NHibernate will insert the RIGHT_HEADER first before attempting to create the GROUP_RIGHT_COMPOSITE record. The unit test I'm using is as follows: ``` [TestMethod()] public void GroupHeaderAddTest() { RightHeader newRight = new RightHeader(1, "Some Right", "Allows user to do something"); GroupHeader newGroup = new GroupHeader("Administrators", "Administrative group", null, null); newGroup.AddRight(newRight, 1); using (NHibernate.ISession session = SessionOrigin.Current.GetSession()) { using (NHibernate.ITransaction tran = session.BeginTransaction()) { session.SaveOrUpdate(newGroup); tran.Commit(); } GroupHeader foundGroup = session.CreateCriteria<GroupHeader>() .Add(Example.Create(newGroup)) .UniqueResult<GroupHeader>(); Assert.IsNotNull(foundGroup, "Group should not be null"); Assert.AreEqual<GroupHeader>(newGroup, foundGroup); } } ```
Fluent Nhibernate HasMany mapping issue
CC BY-SA 2.5
0
2010-11-07T15:36:19.583
2011-04-15T03:12:01.957
2017-02-08T14:30:49.717
-1
447,341
[ "c#", "fluent-nhibernate" ]
4,118,441
1
null
null
2
1,480
I have an executable called A.exe (say it is cmd.exe). I want to launch it (and also I want multiple instances of it) inside another window (that is I have to create) like, ![alt text](https://i.stack.imgur.com/DPxm8.jpg) How can I create such a window (program) using win32 or MFC ? Or this isn't possible ? Thank you..... regards,
How to load another process' window as a child window?
CC BY-SA 2.5
0
2010-11-07T15:49:16.017
2010-11-07T21:12:20.937
2010-11-07T15:54:27.143
134,804
134,804
[ "c++", "mfc", "winapi" ]
4,118,723
1
4,118,752
null
3
3,101
I'm doing a online "creator" of a nice looking product comparison table using JS, HTML and CSS. Now a example table generated with this tool looks like this: ![alt text](https://i.stack.imgur.com/7Pnqi.jpg) And the style of this table comes from a style part of my HTML, it looks like this: ``` <style> tr.numer1 { background-color: #FFFFFF; } tr.numer2 { background-color: #FFFBD0; } td.custTD { border-bottom: 1px solid #CCCCCC; } span.propertyCust { font-weight: bold; color: #444444; } span.productCust { font-weight: bold; color: #444444; } body { font: 18px Georgia, Serif; } </style> ``` Now, what I would like to acomplish is to add the user ability of online, real-time changing of the CSS styles that I have above. I don't have limited number of properties and limited number of style classes, I don't want to put a color select field and so on. No! Because users will be webdesigners and I would give them opportunity to edit CSS inside a textbox on the table "maker". So basically what I need to acomplish is to dynamically change site style to those written in a textbox. In pseudocode i would write it in this way: ``` document.style = document.getElementById('styleTextarea').innerHTML ``` So: Is it possible and how to to it? How to update a whole site CSS style to styles input in a textarea?
Dynamically change CSS in input text using Javascript
CC BY-SA 2.5
0
2010-11-07T17:04:52.650
2010-11-07T17:11:53.567
2010-11-07T17:10:40.217
13,295
38,940
[ "javascript", "html", "css", "dom" ]
4,118,936
1
4,120,265
null
0
7,066
I am trying Master Detail scenario in ASP.NET MVC 3 (default view engine) . I was able to go through the following code at [http://www.trirand.com/blog/jqgrid/jqgrid.html](http://www.trirand.com/blog/jqgrid/jqgrid.html) and get master detail working. The problem is that when I select any row in details the first row seems to get selected / unselected clicking on link to find selected id's return Have anyone of you experienced the same. if you can point me to working ASP.NET MVC example with JQGrid Master Details , it will be much appreciated. Regards, Mar 1- View Page ``` <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/default.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> Orders Available </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server"> <link href="../../Content/ui.jqgrid.css" rel="stylesheet" type="text/css" /> <link href="../../Scripts/themes/redmond/jquery-ui-1.8.6.custom.css" rel="stylesheet" type="text/css" /> <script src="../../Scripts/jquery.validate.min.js" type="text/javascript"></script> <script src="../../Scripts/js/grid.locale-en.js" type="text/javascript"></script> <script src="../../Scripts/jquery.jqGrid.min.js" type="text/javascript"></script> </asp:Content> <asp:Content ID="Content3" ContentPlaceHolderID="scriptContent" runat="server"> <script type="text/javascript"> jQuery(document).ready(function () { jQuery("#list10").jqGrid({ url: '/order/list/', datatype: "json", mtype: 'post', colNames: ['PurchaseOrder', 'SalesOrder', 'OrderDate', 'Supplier', 'Status', "Details"], colModel: [ { name: 'PurchaseOrder', index: 'PurchaseOrder', width: 100, align: 'left' }, { name: 'SalesOrder', index: 'SalesOrder', width: 100, align: 'left' }, { name: 'OrderDate', index: 'OrderDate', width: 75, align: 'left' }, { name: 'Supplier', index: 'Supplier', width: 150, align: 'left' }, { name: 'Status', index: 'Status', width: 50, align: 'left' }, { name: 'Details', index: 'Details', width: 50, align: 'left' } ], rowNum: 10, rowList: [10, 20, 30], pager: '#pager10', sortname: 'id', viewrecords: true, sortorder: "desc", multiselect: false, caption: "Invoice Header", onSelectRow: function (ids) { if (ids == null) { ids = 0; if (jQuery("#list10_d").jqGrid('getGridParam', 'records') > 0) { jQuery("#list10_d").jqGrid('setGridParam', { url: "/order/detail/id=" + ids, page: 1 }); jQuery("#list10_d").jqGrid('setCaption', "Invoice Detail: " + ids) .trigger('reloadGrid'); } } else { jQuery("#list10_d").jqGrid('setGridParam', { url: "/order/detail/id=" + ids, page: 1 }); jQuery("#list10_d").jqGrid('setCaption', "Invoice Detail: " + ids) .trigger('reloadGrid'); } } }); jQuery("#list10").jqGrid('navGrid', '#pager10', { add: false, edit: false, del: false }); jQuery("#list10_d").jqGrid({ height: 100, url: "/order/detail/", datatype: "json", colNames: ['Stock Number', 'Description', 'Available', 'Required'], colModel: [ { name: 'PartNumber', index: 'StockNumber', width: 100, align: 'left' }, { name: 'Description', index: 'Description', width: 200, align: 'left' }, { name: 'Available', index: 'Available', width: 75, align: 'left' }, { name: 'Required', index: 'Required', width: 75, align: 'left' } ], rowNum: 5, rowList: [5, 10, 20], pager: '#pager10_d', sortname: 'item', viewrecords: true, sortorder: "asc", multiselect: true, caption: "Invoice Detail", beforeSelectRow: function(rowid, e) { return true; } }).navGrid('#pager10_d', { add: false, edit: false, del: false }); jQuery("#ms1").click(function () { var s; s = jQuery("#list10_d").jqGrid('getGridParam', 'selarrrow'); alert(s); }); }); </script> </asp:Content> <asp:Content ID="Content4" ContentPlaceHolderID="mainContent" runat="server"> <div class="orderSelSum"> <h3> Summary</h3> <p> Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32</p> </div> <div id="orderMain"> <table id="list10"> </table> <div id="pager10"> </div> <br /> Invoice Detail <table id="list10_d"> </table> <div id="pager10_d"> </div> <a href="javascript:void(0)" id="ms1">Get Selected id's</a> </div> </asp:Content> ``` 2- JSon result a) For Master Table ``` {"total":10,"page":1,"records":4,"rows":[{"id":"4cf2c07d-1f13-4add-8bf9-3e7bca441a69","cell":["NV32653-A","23434324","03/01/2010","MY Supplier","Ready for Use","\u003ca href=\u0027#\u0027\u003eDetails\u003c/a\u003e"]},{"id":"54f3b266-dd14-4137-ab76-6d4a1fd7fe7c","cell":["NV32653-A","23434324","03/01/2010","MY Supplier","Ready for Use","\u003ca href=\u0027#\u0027\u003eDetails\u003c/a\u003e"]},{"id":"ab63a5ae-1f00-43ed-a50e-d8fb60ff2df2","cell":["NV32653-A","23434324","03/01/2010","MY Supplier","Ready for Use","\u003ca href=\u0027#\u0027\u003eDetails\u003c/a\u003e"]},{"id":"484c0e05-80c6-4259-8a29-ca6be83037e4","cell":["NV32653-A","23434324","03/01/2010","MY Supplier","Ready for Use","\u003ca href=\u0027#\u0027\u003eDetails\u003c/a\u003e"]}]} ``` b) Details ``` {"rows":[{"id":null,"cell":["PART A","Apple ","10","0"]},{"id":null,"cell":["PART B","Orange","12","0"]},{"id":null,"cell":["PART C","Banana","8","0"]},{"id":null,"cell":["PART D","Bread","10","0"]},{"id":null,"cell":["Part E","Jam","9","0"]}]} ``` Some Images ![alt text](https://i.stack.imgur.com/7gCdl.jpg) ![alt text](https://i.stack.imgur.com/55Mv6.jpg) ![alt text](https://i.stack.imgur.com/O7Oxh.jpg) found that details json contains null for ID field. I will correct that soon.
JQGrid Master Detail select/ MultiSelect on details grid not working
CC BY-SA 2.5
null
2010-11-07T17:59:04.710
2010-11-08T01:26:11.210
2010-11-08T01:26:11.210
148,819
148,819
[ "jquery", "asp.net-mvc-2", "jqgrid" ]
4,119,055
1
4,119,079
null
0
1,290
When I'm using the `SpriteBatch.Draw()` method I can get vertical or horizontal scaling. For example: ``` new Vector2(1.0f, 2.0f) ``` it means that my sprite will expand the Y-axis. How can I get it to diagonally expand (for example 45 or 70 degrees)? I have circle sprite and this picture contains shadows and glare, I need to stretch this circle (make ellipse) and rotate it, but I want the shadow does not change its position into ellipse. Rotation and scaling change every frame. This picture from World Of Goo game: ![Picture from World Of Goo game](https://i.stack.imgur.com/yW4fX.png)
XNA sprite scaling
CC BY-SA 3.0
null
2010-11-07T18:31:08.390
2013-06-01T04:40:06.010
2013-06-01T04:40:06.010
104,223
438,084
[ "xna" ]
4,119,199
1
4,119,350
null
0
331
I can't opened existing solution or create new, blank solution in Visual Studio 2010 Ultimate. Few days ago everything worked fine. I have Windows 7 x64. ![Error](https://i.stack.imgur.com/b92SI.png) Any ideas, what should I do?
Cannot create blank or open existing solution in Visual Studio 2010
CC BY-SA 2.5
0
2010-11-07T19:09:07.070
2010-11-07T19:42:09.763
null
null
319,415
[ "visual-studio-2010", "ide" ]
4,120,030
1
4,120,138
null
3
257
# Update #1 So I now have the data in the format shown in the screenshot below. The last thing I need to do is take this data and add a percentile column at the end. The percentile is valuable because it will show how common a given password is in the entire data set. Does anyone have a good idea on a SQL query that will generate that percentile column? ![alt text](https://i.stack.imgur.com/DhHGD.gif) # Original Post I'm doing some analysis on the hacked "RockYou" password set for a research paper at my university. Long story short, RockYou is a service that allows users to create personalized MySpace widgets. The service was hacked, and the hacker released a giant text file of all of the plain text passwords, without any user information, to the public over a torrent. I have imported all of the passwords into MySql, and I now have a giant table with 17004335 password records. I'd like to reform the data so I can quickly get the percentile of any provided password as well as the number of times the password occurs in the data set. Here's what my current password table looks like: ``` password password1 password2 password3 password1 password3 password3 ``` I'd like to turn it into a simplified table that is ordered by occurrences descending. Also, I need some help correctly identifying what percentile any given password is in. Would be in the 100% percentile and be in the 33% percentile? ``` password occurrences percentile password3 3 ? password1 2 ? password2 1 ? ``` I'm going to use this data to make a tool that will allow users to quickly see if a password occurs in the data set. The higher the percentile, the more insecure the password. Obviously, if the password is even in the data set that is a bad thing. =] Any help with SQL queries to get this data reformed would be much appreciated.
Help with MySQL Queries to Analyze Hacked RockYou Password Data
CC BY-SA 2.5
0
2010-11-07T22:23:31.723
2010-11-08T16:48:19.983
2010-11-08T16:48:19.983
102,635
102,635
[ "sql", "mysql", "security", "passwords" ]
4,120,049
1
4,132,601
null
1
2,783
Does anyone know how to calculate the medial axis for two given curves? Medial axis: [http://en.wikipedia.org/wiki/Medial_axis](http://en.wikipedia.org/wiki/Medial_axis) Here is the shape I need to calculate it for: ![alt text](https://i.stack.imgur.com/EXQMr.jpg) I drew in the medial axis myself, the dark black line, but I need to be able to calculate it dynamically. Here is the applet and code of what I have done so far: [http://www.prism.gatech.edu/~jstrauss6/3451/sample/](http://www.prism.gatech.edu/~jstrauss6/3451/sample/) The known variables are: -pt A, B, C, D -radii of red, green, and black circles -pt Q and R (just outside the picture), the black circles.
How to calculate the medial axis?
CC BY-SA 2.5
0
2010-11-07T22:27:30.110
2012-10-12T22:15:31.877
2012-10-12T22:15:31.877
242,848
497,681
[ "geometry", "computational-geometry", "medial-axis" ]
4,120,065
1
4,120,095
null
0
838
PrintDialog.Document don't exist as element in the drop down list from visual studio 2010; Demonstration: ![](https://i.stack.imgur.com/yPbtw.jpg)
PrintDialog.Document don't exist
CC BY-SA 2.5
null
2010-11-07T22:32:10.947
2010-11-07T22:49:20.600
2010-11-07T22:44:59.620
164,901
422,039
[ "c#", ".net", "wpf", "visual-studio" ]
4,120,495
1
4,120,816
null
1
780
when adding a mask to a parent sprite with a dynamic text field, the text loses anti-aliasing. how can i maintain the text's anti-alias while still applying a mask to its parent, and subsequently to itself. the font is embedded, and the text field will be animated so it must also be masked along with its parent. ![alt text](https://i.stack.imgur.com/zG76b.png) ``` package { import flash.display.Sprite; import flash.display.Shape; import flash.text.*; public class Test extends Sprite { public function Test() { //Create Background Canvas var canvas:Sprite = new Sprite(); canvas.graphics.beginFill(0xFF0000) canvas.graphics.drawRect(0, 0, 100, 100); //Create Dynamic Text var field:TextField = new TextField(); field.width = 100; field.autoSize = TextFieldAutoSize.LEFT; field.selectable = false; field.text = "Dynamic\nText"; var format:TextFormat = new TextFormat(); format.font = "Myriad Pro"; format.color = 0xFFFFFF; format.size = 14; field.setTextFormat(format); //Add Dynamic Text To Background Canvas field.x = canvas.width /2 - field.width / 2; field.y = canvas.height / 2 - field.height / 2; canvas.addChild(field); //Create Mask var canvasMask:Shape = new Shape(); canvasMask.graphics.beginFill(0); canvasMask.graphics.drawRoundRect(0, 0, 100, 100, 50); //Add Background Canvas And Mask To Display List // canvas.mask = canvasMask; // addChild(canvasMask); addChild(canvas); } } } ```
ActionScript - Masking Parent of Dynamic Text Removes Anti-Alias?
CC BY-SA 2.5
null
2010-11-08T00:30:37.097
2010-11-08T02:11:40.753
2010-11-08T02:01:11.087
336,929
336,929
[ "actionscript-3", "text", "mask", "antialiasing" ]
4,120,598
1
null
null
0
1,767
I have map in m android app but it doesn't work well. I spent last two hours looking in code line by line but I don't know what is the problem. I done all like in tutorial [http://mobiforge.com/developing/story/using-google-maps-android](http://mobiforge.com/developing/story/using-google-maps-android). I set in manifest uses google maps. Map shows marker, doesn't show map ( instead in background is grid lines), zoom controls disappear after few seconds and not come back. What can be a problem ? ![alt text](https://i.stack.imgur.com/3pcWj.png) This is activity class. ``` package com.roomate.www; import java.util.List; import com.google.android.maps.GeoPoint; import com.google.android.maps.MapActivity; import com.google.android.maps.MapController; import com.google.android.maps.MapView; import com.google.android.maps.MapView.LayoutParams; import com.google.android.maps.Overlay; import android.view.View; import android.widget.LinearLayout; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Point; import android.os.Bundle; import android.util.Log; public class Location extends MapActivity{ MapView mapView; MapController mc; GeoPoint p; class MapOverlay extends com.google.android.maps.Overlay { @Override public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { super.draw(canvas, mapView, shadow); //---translate the GeoPoint to screen pixels--- Point screenPts = new Point(); mapView.getProjection().toPixels(p, screenPts); //---add the marker--- Bitmap bmp = BitmapFactory.decodeResource( getResources(), R.drawable.marker); canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50, null); return true; } } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.map_result); mapView = (MapView) findViewById(R.id.mapView); mapView.setStreetView(true); LinearLayout zoomLayout = (LinearLayout)findViewById(R.id.zoom); View zoomView = mapView.getZoomControls(); zoomLayout.addView(zoomView, new LinearLayout.LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); mapView.displayZoomControls(true); mc = mapView.getController(); String coordinates[] = {"1.352566007", "103.78921587"}; double lat = Double.parseDouble(coordinates[0]); double lng = Double.parseDouble(coordinates[1]); p = new GeoPoint( (int) (lat * 1E6), (int) (lng * 1E6)); mc.animateTo(p); mc.setZoom(17); MapOverlay mapOverlay = new MapOverlay(); List<Overlay> listOfOverlays = mapView.getOverlays(); listOfOverlays.clear(); listOfOverlays.add(mapOverlay); mapView.invalidate(); } @Override protected boolean isRouteDisplayed() { return false; } } ``` This is layout for map. ``` <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" > <LinearLayout android:layout_gravity="left" android:gravity="left" android:layout_width="wrap_content" android:layout_height="wrap_content"> <ImageButton android:id="@+id/imbReturnMap" android:layout_width="wrap_content" android:layout_height="wrap_content" android:fitsSystemWindows="true" android:src="@drawable/close" android:layout_gravity="left"> </ImageButton> </LinearLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="right" android:layout_gravity="right"> <ImageButton android:id="@+id/imbCloseM" android:layout_width="wrap_content" android:layout_height="wrap_content" android:fitsSystemWindows="true" android:src="@drawable/close" android:layout_gravity="right"> </ImageButton> </LinearLayout> </LinearLayout> <RelativeLayout android:id="@+id/mainlayout" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <com.google.android.maps.MapView android:id="@+id/mapView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:apiKey="0WR3Cl0evv0U6G2xH9ZnvEFYbDiSDUu_GRovTUQ" /> <LinearLayout android:id="@+id/zoom" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" /> </RelativeLayout> </LinearLayout> ```
Map shows marker but doesn't show real map in background
CC BY-SA 2.5
null
2010-11-08T01:05:22.260
2013-07-11T15:51:03.657
null
null
486,578
[ "android" ]
4,120,752
1
null
null
1
6,606
in my project in the container form i use buttons to open the child forms , not Strip Menu but the buttons in the container always appears on the child form how to privet the buttons or any other controls form being above the child form i am using Visual Studio 2008 professional edition C# programming language ![alt text](https://i.stack.imgur.com/qFhTk.jpg) as in this Image the button suppose to be in form1 and not to be seen in Form2 (Child) and also the other controls in the Container
how to show a child form in MDI container without the apperance of the controls in the Container Form in the Child Form?
CC BY-SA 2.5
0
2010-11-08T01:50:40.303
2016-03-02T07:27:37.567
2010-11-08T02:04:34.653
1,104,408
1,104,408
[ "c#", ".net-3.5", "mdi", "mdichild", "mdiparent" ]
4,120,839
1
4,120,950
null
7
2,092
I've been trying to do this the whole day. Basically, I have a line and a point. I want the line to curve and pass through that point, but I don't want a smooth curve. I wan't to be able to define the number of steps in my curve, like so (beware crude mspaint drawing): ![curve](https://i.stack.imgur.com/aTtKa.png) And so on. I tried various things, like taking the angle from the center of the initial line and then splitting the line at the point where the angle leads, but I have a problem with the length. I would just take the initial length and divide it by the number of steps I was at, but that wasn't quite right. Anyone knows a way to do that? Thanks.
Iteratively smooth a curve
CC BY-SA 2.5
0
2010-11-08T02:21:00.687
2010-11-08T16:40:22.257
2010-11-08T16:40:22.257
353,410
104,999
[ "c#", "algorithm", "geometry", "curve-fitting" ]
4,120,987
1
null
null
1
2,392
A few questions regarding ListBox here (3 actually) ![alt text](https://i.stack.imgur.com/NVk2u.jpg) From the image, I think the margins are uneven, the left seems like it have more margin. And this is when my margins is already set to ``` <ListBox.ItemTemplate> <DataTemplate> <Rectangle Width="20" Height="20" Margin="1,2,2,2"> <Rectangle.Fill> <SolidColorBrush Color="{Binding}" /> </Rectangle.Fill> </Rectangle> </DataTemplate> </ListBox.ItemTemplate> ``` I don't want that blue background, can I just have a border? I tried the example from [Change WPF DataTemplate for ListBox item if selected](https://stackoverflow.com/questions/146269/change-wpf-datatemplate-for-listbox-item-if-selected) with this code ``` <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem"> <Setter Property="ContentTemplate"> <Setter.Value> <DataTemplate> <Rectangle Width="20" Height="20" Margin="1,2,3,2"> <Rectangle.Fill> <SolidColorBrush Color="{Binding}" /> </Rectangle.Fill> </Rectangle> </DataTemplate> </Setter.Value> </Setter> <Style.Triggers> <Trigger Property="IsSelected" Value="True"> <Setter Property="ContentTemplate"> <Setter.Value> <DataTemplate> <Border BorderBrush="DarkGray" BorderThickness="1"> <Rectangle Width="20" Height="20" Margin="1,2,3,2"> <Rectangle.Fill> <SolidColorBrush Color="{Binding}" /> </Rectangle.Fill> </Rectangle> </Border> </DataTemplate> </Setter.Value> </Setter> </Trigger> </Style.Triggers> </Style> </ListBox.ItemContainerStyle> ``` and got something like ![alt text](https://i.stack.imgur.com/tDbA0.jpg) I am trying to bind the selected color to a property of the view model. If the color in the view model does not exists in the list of colors provided, no color should be selected. Think of this as an alternative way to select color, I have selection of colors via RGB/HSB sliders. I tried ``` <ListBox ItemsSource="{Binding ThemeColors}" SelectedValue="{Binding Color}" SelectionChanged="ListBox_SelectionChanged" ... ``` then in C# ``` private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { var listBox = (ListBox)sender; if (listBox.SelectedValue != null) Color = (Color)listBox.SelectedValue; } ``` But after that, when I try to select colors with the sliders, I get some weird jerking and sometimes the color always snap back to the color selected from the list box. But sometimes it works fine, I am quite confused.
ListBox/Rectangle Margins, Changing Look of Selected Item, Binding for Selected Item
CC BY-SA 2.5
0
2010-11-08T03:16:19.167
2010-11-08T13:42:35.247
2017-05-23T12:07:02.087
-1
292,291
[ "c#", "wpf", "binding", "colors", "listbox" ]
4,121,214
1
null
null
7
4,487
I'm using jQuery and jstree. I would like to have extra columns appear to the right of the node labels so that I can put additional info in them such as dates, text, etc. How can I do this in jstree? --- This is an example of the layout that I'd like to achieve, but with jstree. ![Example](https://i.stack.imgur.com/NQSbO.png)
Is there a way to add extra columns to a jstree?
CC BY-SA 2.5
null
2010-11-08T04:14:25.220
2011-01-28T01:11:40.363
2010-11-08T04:58:33.410
80,282
80,282
[ "jquery", "jstree" ]
4,121,228
1
4,170,986
null
2
700
I am using NHibernate and Repository patterns in my application. But not want to use UnitofWork pattern. There are two types of forms in my app. Collection/Picker forms and Entity forms. ![Dept Collection Form](https://i.stack.imgur.com/yCwlQ.png) ![Dept Entity Form](https://i.stack.imgur.com/zdUJC.png) But the problem occurs when a form is ShowDialog()ged from within another form. Whwn I am doing any database related operation, NHibernate is giving me "a different object with the same identifier value was already associated with the session: XYZ" error. This is caused due to the delayed call of Dispose method by CLR and another part of my problem is in the Session management as far as I guess. How can I change my repository codes to solve my problem? Remember, I don't want to expose separate BeginTransaction(), CommitTransaction() like functions in my Repository. These things should be embedded within every Method {SaveOrUpdate(), Save(), Delete, Load(), etc.} as I have already done. Please tell me how can I get things going with minor changes? I am doing my things like this: A picker form works like this, ``` private void btnPick_Click(object sender, EventArgs e) { CourseCollectionForm f = new CourseCollectionForm(); f.FormViewMode = FormViewMode.MultiplePicker; f.ShowDialog(); int totalCredits = 0; int totalHours = 0; FillDataGridViewWithCourses(f.PickedCourseCollection, ref totalCredits, ref totalHours); FillTotal(totalCredits, totalHours); } ``` A Save works like this, ``` public partial class DepartmentEntityForm : Form { private DepartmentRepository _deptRepository = null; private Department _currentDepartment = null; private FormViewMode _currentMode = FormViewMode.None; public DepartmentEntityForm(Department dept, FormViewMode mode) { InitializeComponent(); _deptRepository = new DepartmentRepository(); _currentDepartment = dept; _currentMode = mode; if(mode == FormViewMode.Edit) { MapObjectToControls(); } } private void SaveButton_Click(object sender, EventArgs e) { Department newDept; if (mode == FormViewMode.AddNew) { newDept = new Department(); } else if(mode == FormViewMode.Edit) { newDept = _currentDepartment; } //............. //............. _deptRepository.SaveOrUpdate(newDept); } } ``` I declare my individual repositories like this: ## FacultyRepository.cs ``` public class FacultyRepository : Repository<Faculty> { } ``` ## DepartmentRepository.cs ``` public class DepartmentRepository : Repository<Department> { } ``` ## Repository.cs ``` public class Repository<T> : IRepository<T> { ISession _session; public Repository() { _session = SessionFactory.GetOpenSession(); } public T Get(object id) { T obj = default(T); try { if (!_session.Transaction.IsActive) { _session.BeginTransaction(); obj = (T)_session.Get<T>(id); _session.Transaction.Commit(); _session.Flush(); } else { throw new Exception(CustomErrorMessage.TransactionAlreadyInProgress); } } catch (Exception ex) { _session.Transaction.Rollback(); _session.Clear(); throw ex; } return obj; } public IEnumerable<T> Get(string fieldName, object fieldValue) { IEnumerable<T> list = null; try { if (!_session.Transaction.IsActive) { _session.BeginTransaction(); list = (IEnumerable<T>)_session.CreateCriteria(typeof(T)) .Add(new NHibernate.Expression.EqExpression(fieldName, fieldValue)) .List<T>(); _session.Transaction.Commit(); _session.Flush(); } else { throw new Exception(CustomErrorMessage.TransactionAlreadyInProgress); } } catch (Exception ex) { _session.Transaction.Rollback(); _session.Clear(); throw ex; } return list; } public IEnumerable<T> Get() { IEnumerable<T> list = null; try { if (!_session.Transaction.IsActive) { _session.BeginTransaction(); list = (IEnumerable<T>)_session.CreateCriteria(typeof(T)).List<T>(); _session.Transaction.Commit(); _session.Flush(); } else { throw new Exception(CustomErrorMessage.TransactionAlreadyInProgress); } } catch (Exception ex) { _session.Transaction.Rollback(); _session.Clear(); throw ex; } return list; } public void SaveOrUpdate(T obj) { try { if (!_session.Transaction.IsActive) { _session.BeginTransaction(); _session.SaveOrUpdateCopy(obj); _session.Transaction.Commit(); _session.Flush(); } else { throw new Exception(CustomErrorMessage.TransactionAlreadyInProgress); } } catch (Exception ex) { _session.Transaction.Rollback(); _session.Clear(); throw ex; } } public void SaveOrUpdate(IEnumerable<T> objs) { try { if (!_session.Transaction.IsActive) { _session.BeginTransaction(); foreach (T obj in objs) { _session.SaveOrUpdate(obj); } _session.Transaction.Commit(); _session.Flush(); } else { throw new Exception(CustomErrorMessage.TransactionAlreadyInProgress); } } catch (Exception ex) { _session.Transaction.Rollback(); _session.Clear(); throw ex; } } public void Delete(T obj) { try { if (!_session.Transaction.IsActive) { _session.BeginTransaction(); _session.Delete(obj); _session.Transaction.Commit(); _session.Flush(); } else { throw new Exception(CustomErrorMessage.TransactionAlreadyInProgress); } } catch (Exception ex) { _session.Transaction.Rollback(); _session.Clear(); throw ex; } } public void Delete(IEnumerable<T> objs) { try { if (!_session.Transaction.IsActive) { _session.BeginTransaction(); foreach (T obj in objs) { _session.Delete(obj); } _session.Transaction.Commit(); _session.Flush(); } else { throw new Exception(CustomErrorMessage.TransactionAlreadyInProgress); } } catch (Exception ex) { _session.Transaction.Rollback(); _session.Clear(); throw ex; } } public void DeleteAll() { try { if (!_session.Transaction.IsActive) { _session.BeginTransaction(); DetachedCriteria criterion = DetachedCriteria.For<T>(); IList<T> list = criterion.GetExecutableCriteria(_session).List<T>(); foreach (T item in list) { _session.Delete(item); } _session.Transaction.Commit(); _session.Flush(); } else { throw new Exception(CustomErrorMessage.TransactionAlreadyInProgress); } } catch (Exception ex) { _session.Transaction.Rollback(); throw ex; } } public void Dispose() { if (_session != null) { _session.Clear(); _session.Close(); _session = null; } } } ``` ## SessionFactory.cs ``` public class SessionFactory { private static ISessionFactory _sessionFactory = null; private SessionFactory(){} static SessionFactory() { if (_sessionFactory == null) { Configuration configuration = new Configuration(); configuration.Configure(); _sessionFactory = configuration.BuildSessionFactory(); } } public static ISession GetOpenSession() { return _sessionFactory.OpenSession(); } } ```
NHibernate Repository pattern problem
CC BY-SA 2.5
0
2010-11-08T04:17:20.090
2010-11-13T04:31:29.557
2010-11-11T04:49:41.067
159,072
159,072
[ "nhibernate", "repository-pattern", "session-management" ]
4,121,854
1
4,122,044
null
39
8,639
I've always thought the to be the ideal to the user. We are used to see it in this context daily because of it's usage on hyperlinks and hence all web buttons.                  ![alt text](https://i.stack.imgur.com/wn2dT.png) However, most desktop applications seem to keep the defeault pointer arrow for buttons.                                  ![](https://i.stack.imgur.com/hqOhb.png) I really feel better when buttons, and other clickable items such as checkboxes and radio buttons use the hand cursor. Somehow, I find it personally pleasing to see this cursor when I hover over clickable items, maybe because it's consistent with how webpages and even many games do it. But as developers, We have to think of the user and sometimes do things not as we like them but as the user likes them. Problem is, I feel so fuzzy about the hand cursor on buttons that . Many design mistakes are caused by such personal decisions.                                       ![enter image description here](https://i.stack.imgur.com/U0cr2.png) Recently I've taken notice of usage of the hand cursor on Photoshop (CS3 on XP), but probably only because I was using it more extensively. Screenshot:                                          ![enter image description here](https://i.stack.imgur.com/eP5op.png) Do note that many of the places where the hand was used are . Do also note that they've even used a custom cursor, which to be honest I'd never do, especially for something trivial as a hand cursor that's so ubiquitous. And it's not even pretty.
Is it wrong to use the hand cursor for clickable items such as buttons?
CC BY-SA 3.0
0
2010-11-08T07:00:55.897
2021-12-22T22:29:45.017
2021-12-22T22:29:45.017
4,294,399
124,119
[ "user-interface", "desktop-application", "user-experience", "mouse-cursor", "design-decisions" ]
4,121,900
1
null
null
1
2,029
I have a prob where my "mark" that comes with TChart hide behind the bar...I added the marks and it draws itself behind the bars. Any way to bring it in front? i hope anyone can help me..thanks ![alt text](https://i.stack.imgur.com/f4yyf.jpg)
Display label in front of bar graph
CC BY-SA 2.5
0
2010-11-08T07:10:12.190
2010-11-16T21:56:40.573
2010-11-09T07:30:49.533
448,173
448,173
[ "delphi" ]
4,122,244
1
4,122,345
null
0
419
I am creating a table in HTML and trying to assign the cells a border. Here is how it appears. ![alt text](https://i.stack.imgur.com/nx0yF.jpg) See that weird border in 2nd row, last cell. That's the problem I am having. ``` <table class="info"> <tbody> <tr> <td>Some text</td> <td>Some text</td> <td>Some text</td> <td>Some text</td> </tr> <tr> <td><span>0</span></td> <td><span>0</span></td> <td><span>0</span></td> <td><span>0</span></td> </tr> <tr> <td>Some text</td> <td>Some text</td> <td>Some text</td> <td>Some text</td> </tr> <tr> <td><span>0</span></td> <td><span>0</span></td> <td><span>0</span></td> <td><span>0</span></td> </tr> <tr> <td>Some text</td> <td>Some text</td> </tr> <tr> <td><span>0</span></td> <td><span>0</span></td> </tr> </tbody> </table> ``` Here's my css.... ``` table.info { width: 100%; text-align: center; } table.info td { background: #fff; border: 2px solid #ccc; text-align: center; } ``` What am I doing wrong over here? UPDATE - I checked the css being inherited and I found this... ``` table { border-collapse:collapse; border-spacing:0; } ```
Table Border in HTML/CSS
CC BY-SA 3.0
null
2010-11-08T08:27:48.477
2017-06-14T12:59:49.487
2017-06-14T12:59:49.487
4,370,109
206,613
[ "html", "html-table", "border" ]
4,122,417
1
null
null
0
1,861
If you hover the mouse over the underlined table headings on [this page](http://rivieravaleting.com/price.html), a tooltip appears ![alt text](https://i.stack.imgur.com/Snd2e.jpg) However, in IE7, the tooltips appear about 300px above their intended position, and on the first table, they don't appear at all. ![alt text](https://i.stack.imgur.com/Q7zCi.jpg) Also, the tooltips are not as nicely styled when shown in IE, e.g. the corners aren't rounded, and the drop shadows aren't shown. I'm not too concerned about the styling, but I would like to get the tooltips displaying in the correct position. I'm using the [YACOP JQuery plugin](http://plugins.jquery.com/project/YACOP) to display the tooltips (I've modified this plugin slightly to remove the fading effects). The CSS styles applied to each tooltip are: ``` .callout { max-width: 400px; padding: 5px; border: 1px solid #7992B0; background-color: #FFE8A4; border-radius: 8px; -webkit-border-radius: 8px; -moz-border-radius: 8px; box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.6); -moz-box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.6); -webkit-box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.6); } ```
tooltips not displayed correctly in IE
CC BY-SA 2.5
null
2010-11-08T09:01:20.090
2010-11-08T09:36:24.920
null
null
2,648
[ "css", "internet-explorer" ]
4,122,995
1
4,145,854
null
-3
517
I want to show related video's in flowplayer at the end of the video. ![alt text](https://i.stack.imgur.com/7ROT5.png)
flowplayer recommend other videos
CC BY-SA 2.5
null
2010-11-08T10:24:27.063
2010-11-10T15:07:42.233
null
null
377,303
[ "flash", "flowplayer" ]
4,123,055
1
4,123,661
null
6
3,245
I'm creating a prototype for a piece of functionality that I will be implementing in an application, specifically I am displaying data from a collection to the console window but unfortunately some of the lines span wider than the default width of the console window. ![alt text](https://i.stack.imgur.com/kbW4Z.jpg) I've done a bit of [digging and found](http://social.msdn.microsoft.com/forums/en-US/csharpgeneral/thread/0b374f73-5604-48ee-a720-53bb5b19467b/) that the only way to increase the width of the window is to dig into the Kernel32.dll and do it manually. As elegant as pInvoke is, does a "shorter" way exist to increase the width e.g. (Console.Width = 300) or is using the Kernel32.dll the only way. Thanks!
How to increase the size of the console window in C#?
CC BY-SA 4.0
null
2010-11-08T10:35:07.417
2018-07-12T13:52:12.027
2018-07-12T13:52:12.027
17,034
218,159
[ "c#", ".net", "console-application" ]
4,123,273
1
null
null
1
1,234
I'm trying to display custom menu items similar to copy-paste menu item, is there any way I can do this? ![Missing Image](https://i.stack.imgur.com/fKCYH.png)
How to display copy-paste like menu on iPhone?
CC BY-SA 2.5
null
2010-11-08T11:09:25.937
2010-11-08T11:38:49.727
null
null
85,606
[ "iphone", "objective-c", "cocoa-touch" ]
4,123,656
1
4,124,241
null
0
84
In my application a try to position 8 small squares around one big one. See image below. ![alt text](https://i.stack.imgur.com/GJh11.jpg) ``` <UserControl <UserControl.Resources> <Style x:Key="ResizerStyle" TargetType="UserControl"> <Setter Property="Width" Value="{Binding Padding.Top, ElementName=border, Mode=Default}"/> <Setter Property="Height" Value="{Binding Padding.Top, ElementName=border, Mode=Default}"/> </Style> <Thickness x:Key="ScalersSize">8</Thickness> </UserControl.Resources> <Grid x:Name="LayoutRoot"> <Border x:Name="border" BorderThickness="1" Panel.ZIndex="-1000" Padding="{DynamicResource ScalersSize}" Background="#00000000"> <Rectangle Fill="#FFC00000"/> </Border> <local:Scaler VerticalAlignment="Top" Cursor="SizeNS" HorizontalAlignment="Center" Style="{StaticResource ResizerStyle}"/> <local:Scaler VerticalAlignment="Top" Cursor="SizeNESW" HorizontalAlignment="Right" Style="{StaticResource ResizerStyle}"/> <local:Scaler VerticalAlignment="Top" HorizontalAlignment="Left" Cursor="SizeNWSE" Style="{StaticResource ResizerStyle}"/> <local:Scaler VerticalAlignment="Bottom" Cursor="SizeNS" Style="{StaticResource ResizerStyle}"/> <local:Scaler VerticalAlignment="Bottom" Cursor="SizeNWSE" Style="{StaticResource ResizerStyle}" HorizontalAlignment="Right"/> <local:Scaler VerticalAlignment="Bottom" Cursor="SizeNESW" Style="{StaticResource ResizerStyle}" HorizontalAlignment="Left"/> <local:Scaler HorizontalAlignment="Right" VerticalAlignment="Center" Cursor="SizeWE" Style="{StaticResource ResizerStyle}"/> <local:Scaler HorizontalAlignment="Left" VerticalAlignment="Center" Cursor="SizeWE" Style="{StaticResource ResizerStyle}"/> </Grid> </UserControl> ``` And the following renders red 62x62 square. But as far as I know 80 - 8 * 2 = 64. So why it is rendered it as 62 by 62 square?
Weird padding behaviour
CC BY-SA 2.5
null
2010-11-08T12:06:24.753
2011-08-13T16:03:17.093
2011-08-13T16:03:17.093
305,637
230,506
[ "wpf", "xaml", "styles" ]
4,123,869
1
4,126,683
null
0
180
We're developing some application and want to display some information on the device homescreen like [Weather Plus application does](http://www.boostmobilephones.org/wp-content/uploads/2010/07/weatherPlusLite.gif). Could you tell me how i can do the same thing? Thank you! ![alt text](https://i.stack.imgur.com/RmU2d.gif)
Putting info on BlackBerry homescreen
CC BY-SA 2.5
null
2010-11-08T12:37:25.180
2010-11-08T18:15:30.217
2010-11-08T14:05:52.937
75,204
500,678
[ "blackberry", "homescreen" ]
4,123,876
1
4,123,902
null
0
591
I implemented and slightly modified the [easy slider](http://cssglobe.com/post/5780/easy-slider-17-numeric-navigation-jquery-slider) jQuery plugin. The problem is that the images dong get fully loaded. Here is an image: ![](https://i.stack.imgur.com/3tRdZ.png) Here is how it should be: ![alt text](https://i.stack.imgur.com/YXa2v.png) It seems to be quite random, but whenever I do a hard refresh, (cmd+shift+r or ctrl+f5) it works everytime. I´m not quite sure where the problem might be. I give you a [live example](http://chaletpuntadeleste.com/), hoping it helps, I would give you the code I used (but most you can see in the example) and I would know what to show you. I hope I´m not being to vague, please ask if you need any clarification. Thanks in advance! Trufa
jQuery - Easy slider plugin images "truncated"
CC BY-SA 2.5
null
2010-11-08T12:38:02.277
2010-11-08T12:40:49.053
null
null
463,065
[ "jquery", "jquery-plugins" ]
4,124,316
1
4,124,586
null
0
139
I have a grid which is dynamically added to the Layout-root which could have X amount of rows and X amount of columns. What I am wanting to do is when the client hovers over a cell in the grid the X and Y axis is highlighted. Example Shown below: ![alt text](https://i.stack.imgur.com/qwSwX.png)
Silverlight Grid Highlight row and column
CC BY-SA 2.5
null
2010-11-08T13:38:26.710
2010-11-08T14:06:24.490
null
null
53,366
[ ".net", "wpf", "silverlight", "silverlight-3.0" ]
4,124,591
1
4,124,980
null
3
2,154
i have a website and i want that users will be able to go to specific parts of the site directly from google. ![view screenshot](https://i.stack.imgur.com/IlYgh.jpg). how do i add it?
How to add site links to google search
CC BY-SA 2.5
null
2010-11-08T14:07:07.337
2016-04-15T10:55:11.053
null
null
474,255
[ "directory" ]
4,125,028
1
4,191,158
null
0
142
How can I (using NHibernate) get all the entities that are joinable with certain entity? For example: Assume that we have the following tables as illustrated in the picture below: ![alt text](https://i.stack.imgur.com/WguFD.png) The joinable tables for Customer would be Contact and CustomerType. Assume that I'm using NHibernate and mapping each table of those to an entity in my model with the same name as the table, now, Is there is a way to get all the joinable tables for the Customer table?
HowTo: Query schema objects using NHibernate?
CC BY-SA 2.5
null
2010-11-08T15:04:12.923
2010-11-16T04:10:55.427
null
null
70,289
[ "sql", "nhibernate" ]
4,125,176
1
null
null
0
384
I am having problem to calculate the % value on the base of subtotal per each row and in the column. As you may see from the snap shot# 1, I am unable to calculate the percentage value basing upon the sub-total value (i.e. from the 1st row). ![alt text](https://i.stack.imgur.com/0oAj5.jpg) And this is how i want to show my output as shown below snapshot.![alt text](https://i.stack.imgur.com/99vYD.jpg)
I am having problem to calculating % on base of subtotal value in Matrix in SSRS Report
CC BY-SA 2.5
null
2010-11-08T15:22:00.850
2010-11-09T16:01:06.347
null
null
318,663
[ "sql-server-2005", "reporting-services", "reporting", "reportingservices-2005", "ssrs-2008" ]
4,125,341
1
4,125,396
null
1
2,008
Say I have attribute "Address", how can I make it's input in the form designer's property box like that of a text box's text input, like so: ![Textbox input image.](https://i.stack.imgur.com/q1mgd.png) ?
Making a custom control's property input like that of a multiline textbox
CC BY-SA 2.5
null
2010-11-08T15:40:43.673
2017-08-08T20:00:04.730
null
null
2,557,997
[ "c#", "custom-controls", "propertygrid" ]
4,125,473
1
4,127,236
null
1
732
I have a listbox representing a SQL WHERE statement and the items inside can be grouped. For example, a user can have the following items in their ListBox ![alt text](https://i.stack.imgur.com/yyq0x.jpg) I would like to show the AND/OR value only if the ListBox item is not the first item in the listbox or a group (like example). I am currently using a MultiConverter on the ListBox's ItemTemplate that accepts the ListBox's ItemSource and the Current Item as parameters, however existing items do not get their AND/OR visibility updated when the user adds a new item, or drags an existing item to a new spot in the listbox. Is there a way to tell the MultiConverter to reevaluate when one of its parameters, the ListBox's ItemSource, changes? I am using MVVM and the ListBox is bound to an ObservableCollection of items. Code as requested by Adam... ``` <ListBox x:Name="WhereList" ItemsSource="{Binding Path=CurrentQuery.WhereList}"> <ListBox.Style> <Style TargetType="{x:Type ListBox}"> <Setter Property="ItemTemplate"> <Setter.Value> <DataTemplate> <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" Margin="{Binding Path=Depth, Converter={StaticResource QueryBuilder_DepthToMarginConverter}}"> <Label Content="{Binding Path=BooleanComparison}" Padding="0"> <Label.Visibility> <MultiBinding Converter="{StaticResource ShouldShowOperatorConverter}"> <Binding ElementName="WhereList" Path="ItemsSource"/> <Binding /> </MultiBinding> </Label.Visibility> </Label> <Label Content="{Binding ConditionText}" Padding="0" HorizontalAlignment="Stretch" /> </StackPanel> </DataTemplate> </Setter.Value> </Setter> </Style> </ListBox.Style> </ListBox> ``` The MultiConverter accepts a list of items, and the current item. It checks to see if the item is the first item in the list, or if the previous item in the list is a GroupStart item. If either of these conditions are true, it returns Visibility.Collapsed, otherwise it returns Visibility.Visible. It works fine for the first load, and changes made to a single item (dragging a new item into the listbox, or dragging an existing item to a new location in the listbox) will correctly update the new item's AND/OR visibility, however it does not change any other item then the one being added/moved. So if you drag a new item to the top of the list, it will correctly hide the AND/OR of the new item, however it will not update the 2nd item (former first item) to show the AND/OR. This really affects the readability of the items in the list and prevents the user from seeing if they are currently linking the item with an AND or an OR which makes a big difference in the results returned. I'm fairly sure it has something to do with the fact I'm using a MultiConverter since my DepthToMarginConverter works fine (for example, grouping items correctly updates the margin of all items within the group).
Re-evaluating a MultiConverter when a parameter changes?
CC BY-SA 2.5
null
2010-11-08T15:55:39.747
2010-11-09T13:29:46.297
2010-11-09T13:29:46.297
302,677
302,677
[ "wpf", "xaml", "observablecollection", "converters" ]
4,125,540
1
4,125,567
null
3
1,211
How can I do a `SELECT` where I get the `DISTINCT` result based on the `FromLinkID` AND `ToLinkID` together? If I have a `List` with the following data, how could I get what I am after in LINQ? ![alt text](https://i.stack.imgur.com/IE8sd.png)
LINQ & SQL query help: Doing a distinct on two columns together?
CC BY-SA 2.5
null
2010-11-08T16:02:59.820
2011-04-04T07:00:28.530
2010-11-08T16:31:33.263
247,184
247,184
[ "sql", "linq" ]
4,125,562
1
4,125,611
null
1
310
I think most of us have seen the following: ![Form](https://i.stack.imgur.com/QK8HI.png) I'm currently tasked with converting an existing winform app into a web application. The current system is like the "Your company's app" and it would be nice if I can trim it down and make it more use friendly, sleek and usable. Can anyone recommend any good books, blogs, tutorials etc and UI design, specifically for web forms. Thanks
HTML form design useful links and reading
CC BY-SA 2.5
null
2010-11-08T16:04:58.070
2010-11-08T16:18:35.983
null
null
267,174
[ "html", "forms", "ui-design" ]
4,125,646
1
4,125,694
null
2
153
Say I have the following tables: - GearType : snowboard/helmet/shoes/whatever- GearModel : which describes the manufacturer, size, and GearType- Gear : represents a physical instance of a gear, belongs to a GearModel and describes its barcode, number of times it has been worn...- Member : a person who may be assigned a Gear for each existing geartype- GearAssignation : has a double PK MemberId/GearTypeId so a Member can be assigned 0..1 gear per geartype, also has FK GearId My question is : Since a Gear cannot be assigned to more than 1 Member at once, how to make up a relation between Gear and GearAssignation of cardinality 1 to 0..1 ? At best I managed to do this using a relation between Gear.Id and GearAssignation.GearId, with an unique key (remember it cannot be the PK because of the double PK MemberId/GearTypeId) on GearId. But I'd love to get rid of that UK because my software development tool doesn't recognize it. As suggested, here is the diagram from SSMS : ![all irrelevant columns have been deleted](https://i.stack.imgur.com/1QXKp.png) Bringing heavy changes to the current model is not a problem at all for me atm. Suggestions ? PS : dunno if it helps, I'm using Microsoft's SQL Server 2008
Stuck on a Database design issue
CC BY-SA 2.5
null
2010-11-08T16:13:39.160
2010-11-08T17:07:03.947
2010-11-08T17:07:03.947
1,875,163
1,875,163
[ "sql", "sql-server-2008", "database-design" ]
4,125,941
1
4,126,558
null
2
9,309
I can't find a library which will produce good looking 3d pie charts for the iphone? I had a look at the core plot wiki and their pie didn't look that good... ![alt text](https://i.stack.imgur.com/booFh.png)
Is there a good iPhone pie chart library which will produce good look 3d pie charts?
CC BY-SA 2.5
null
2010-11-08T16:43:49.240
2019-08-08T01:13:46.340
null
null
450,456
[ "iphone", "objective-c", "xcode" ]
4,126,010
1
4,227,737
null
2
403
I am creating a WPF application in VS2010. I am using multiple grid controls layered on top of one another to perform similar functions to a tab control. The grid controls have an opaque (white) background. The trouble occurs because no matter which grid I have 'in front' in the design window, I can still see all the outlines of all the other controls on the other grids which are 'behind' the top panel. It is extremely visually confusing. This only happens at design time. At run time, things display just fine. How do I turn off the outlines of all those other controls? The screen shot below shows my top grid which only contains 4 text boxes and 4 radio buttons, but shows the outlines from all the other controls on the other grids. ![alt text](https://i.stack.imgur.com/IxXeo.png)
How to remove control outlines in Visual Studio 2010, WPF?
CC BY-SA 2.5
null
2010-11-08T16:51:18.197
2014-01-01T18:18:59.827
2010-11-10T16:13:39.130
107,899
107,899
[ "wpf", "visual-studio-2010" ]
4,126,027
1
null
null
1
564
I have added a custom dialog in the start stage of my VS2008 created msi installer to allow user choose if he/she wants to update the database or not. But if database is NOT installed yet, that dialog doesn't make sense. So I want to search the database frist, if there is no database installed, that dialog should be ignored. How can do that ![alt text](https://i.stack.imgur.com/dAATp.jpg)
how to condition a custom dialog in msi installer?
CC BY-SA 2.5
null
2010-11-08T16:53:18.400
2010-11-09T13:36:35.980
2010-11-08T17:01:43.667
117,039
117,039
[ ".net", "installation", "windows-installer" ]
4,126,146
1
4,126,162
null
1
348
This is my code ( you can edit it ) : ``` SELECT * FROM posts WHERE posts.user_id = 1 OR posts.user_id = 2 ``` How to select the first post of user 1 and 2 ? ![alt text](https://i.stack.imgur.com/wWqMz.jpg)
How to select the first post using mySQL
CC BY-SA 3.0
null
2010-11-08T17:06:29.197
2017-06-14T13:00:05.690
2017-06-14T13:00:05.690
4,370,109
423,903
[ "php", "mysql", "select" ]
4,126,195
1
4,128,561
null
5
2,825
I have set up Eclipse to run as smoothly as possible because I was having a lot of problems with it running out of memory in my last machine. One of the configurations was to have it automatically refresh the workspace every time I save. I don't know if that is the problem but I thought I's mention it. Here's a screenshot of the error: ![](https://i.stack.imgur.com/gw1IT.png) It happens every time I open Eclipse and save anything. I was also having another problem with something to do with my workspace being compliant with Java 1.6 when I need 1.5. But then I switched and the problem went away. This problem then popped up. Does anyone know any solution to this because it is really getting annoying now.
Problem with Eclipse while programming for android - "Refreshing external folders"
CC BY-SA 2.5
null
2010-11-08T17:13:30.950
2011-10-22T06:08:06.567
2010-11-08T22:15:06.367
231,917
348,261
[ "android", "eclipse", "refresh", "save" ]
4,126,359
1
4,126,375
null
0
106
I want to fetch contents of two separate category and insert them in two different boxes. I have written the query like this: ``` $query = mysql_query(sprintf("SELECT * FROM ".DB_PREFIX."_links WHERE cat = %d LIMIT %d" , 4, 3)); ``` But can we write 2 or more query in one query? like :"select * from blah where cat = (3, 4, 5)" EDIT: ![alt text](https://i.stack.imgur.com/pLwQB.png) Thanks in advance
Query With array in mysql
CC BY-SA 2.5
null
2010-11-08T17:33:09.060
2010-11-08T18:12:25.077
2010-11-08T18:05:08.677
361,635
361,635
[ "php", "mysql" ]
4,126,408
1
4,126,478
null
0
147
I am developing an application to work on Mac OSX 10.5 and later and I am using Mac running 10.6.4 with Xcode 3.2.4. The application is very simple which accepts some information from user and stores it in a file. The application working perfectly on OSX 10.6 but on OSX 10.5.8 when I double click on it to open it does not start at all. In project settings I have base SDK set to 10.5, architectures -> standard 32/64 bit Universal, GCC 4.0 and in info.plist file I have set LSMinimumSystemVersion key to '10.5.0' but still application is not running on OSX 10.5.8. What am I doing wrong? Any help would be appreciated. Thank you. Console Log: ![alt text](https://i.stack.imgur.com/oxNNe.png) Is this of any help?
application not working on OSX 10.5
CC BY-SA 2.5
0
2010-11-08T17:39:59.983
2010-11-08T18:13:51.580
2010-11-08T18:06:19.190
415,306
415,306
[ "objective-c", "xcode", "macos" ]
4,126,473
1
null
null
7
404
I have the following undirected graph ``` gr={1->2,1->3,1->6,1->7,2->4,3->4,4->5,5->6,5->7}; ``` which I wish to plot with GraphPlot in a 'diamond' format. I do this as outlined below (Method 1) giving the following: ![alt text](https://i.stack.imgur.com/cJZ7h.gif) The problem is that this representation is deceptive, as there is no edge between vertices 4 & 1, or 1 & 5 (the edge is from 4 to 5). I wish to change the route of edge {4,5} to get something like the following: ![alt text](https://i.stack.imgur.com/xaJRt.gif) I do this by including another edge, {5,4}, and I can now use MultiedgeStyle to 'move' the offending edge, and I then get rid of the added edge by defining an EdgeRenderingFunction, thus not showing the offending line. (Method 2,'Workaround'). This is awkward, to say the least. Is there a better way? (This is my first question!) Method 1 ``` gr={1->2,1->3,1->6,1->7,2->4,3->4,4->5,5->6,5->7}; vcr={1-> {2,0},2-> {1,1},3-> {1,-1},4-> {0,0},5-> {4,0},6-> {3,1},7-> {3,-1}}; GraphPlot[gr,VertexLabeling-> True, DirectedEdges-> False, VertexCoordinateRules-> vcr, ImageSize-> 250] ``` Method 2 (workaround) ``` erf= (If[MemberQ[{{5,4}},#2], { }, {Blue,Line[#1]} ]&); gp[1] = GraphPlot[ Join[{5->4},gr], VertexLabeling->True, DirectedEdges->False, VertexCoordinateRules->vcr, EdgeRenderingFunction->erf, MultiedgeStyle->.8, ImageSize->250 ] ```
Changing the Edge Route in GraphPlot to Avoid Ambiguity
CC BY-SA 2.5
0
2010-11-08T17:50:08.127
2010-11-12T17:36:29.187
2010-11-11T12:12:03.077
353,410
499,167
[ "wolfram-mathematica" ]
4,126,668
1
4,126,893
null
0
311
If I have a model that looks like this: ![alt text](https://i.stack.imgur.com/j91VP.png) and I do a Linq to Entities query like this: ``` var c = MyContext.Contact.Count(); ``` I'll get a SQL query that is as big as all out doors! ``` SELECT [GroupBy1].[A1] AS [C1] FROM ( SELECT COUNT(1) AS [A1] FROM [dbo].[Contacts] AS [Extent1] LEFT OUTER JOIN (SELECT [UnionAll1].[Id] AS [C1] FROM (SELECT [Extent2].[Id] AS [Id] FROM [dbo].[Companies] AS [Extent2] UNION ALL SELECT [Extent3].[Id] AS [Id] FROM [dbo].[Employees] AS [Extent3]) AS [UnionAll1] UNION ALL SELECT [Extent4].[Id] AS [Id] FROM [dbo].[Contractors] AS [Extent4]) AS [UnionAll2] ON [Extent1].[Id] = [UnionAll2].[C1] LEFT OUTER JOIN (SELECT [UnionAll3].[Id] AS [C1] FROM (SELECT [Extent5].[Id] AS [Id] FROM [dbo].[Suppliers] AS [Extent5] UNION ALL SELECT [Extent6].[Id] AS [Id] FROM [dbo].[Customers] AS [Extent6]) AS [UnionAll3] UNION ALL SELECT [Extent7].[Id] AS [Id] FROM [dbo].[People] AS [Extent7]) AS [UnionAll4] ON [Extent1].[Id] = [UnionAll4].[C1] ) AS [GroupBy1] ``` It seems to me that this should be a very simple query that executes over the base type table (Contact in this case) The model that I've included here is a watered down sample of what I'm working with. As you can imagine with a hierarchy 6 levels deep rather than 3 the SQL queries on anything other than the most derived types are very expensive. Is there any way to tweek the query, or the model definition to reduce the unnecessary complexity of this query.
When quering over a base type why does the EF provider generate all those UNION All clauses
CC BY-SA 2.5
null
2010-11-08T18:13:58.937
2021-12-24T06:50:47.973
null
null
81,514
[ "linq", "linq-to-entities" ]
4,126,771
1
4,126,817
null
0
192
I need to add a percentile column to this password data set of 17 million+ records. It is my understanding that the percentile is the total number of passwords with the same or higher occurrences, divided by the total number of passwords. Is this correct? How should I approach this in MySQL? ![alt text](https://i.stack.imgur.com/texex.gif)
Populating Percentile Data Using a MySQL Query (Pic)
CC BY-SA 2.5
null
2010-11-08T18:25:53.220
2010-11-08T18:32:09.130
2010-11-08T18:28:40.663
135,152
102,635
[ "sql", "mysql", "security", "statistics" ]
4,126,982
1
null
null
0
292
I have the following WPF UserControl ![alt text](https://i.stack.imgur.com/o9Ymw.jpg) I want that the blue border be displayed only when the object has its (dependency bool property) property to true. Is that possible? ``` <Canvas> <Image x:Name="Dot"> <Image.Source> <DrawingImage> <DrawingImage.Drawing> <DrawingGroup> <GeometryDrawing> <GeometryDrawing.Pen> <Pen Brush="Blue" Thickness="2" x:Name="BigCircleThickness"/> </GeometryDrawing.Pen> <GeometryDrawing.Geometry> <GeometryGroup> <EllipseGeometry x:Name="BigCircle" Center="0,0" RadiusX="7" RadiusY="7"/> </GeometryGroup> </GeometryDrawing.Geometry> </GeometryDrawing> <GeometryDrawing> <GeometryDrawing.Brush> <SolidColorBrush Color="Blue" /> </GeometryDrawing.Brush> <GeometryDrawing.Geometry> <GeometryGroup> <EllipseGeometry x:Name="SmallCircle" Center="0,0" RadiusX="2" RadiusY="2"/> </GeometryGroup> </GeometryDrawing.Geometry> </GeometryDrawing> </DrawingGroup> </DrawingImage.Drawing> </DrawingImage> </Image.Source> </Image> </Canvas> ``` In other words, I need that when `IsSeleted = false` "BigCircle" dissapear. Is that possible?
Bind a property of the WPF Image
CC BY-SA 3.0
null
2010-11-08T18:54:18.240
2013-01-14T22:16:15.397
2013-01-14T22:16:03.750
305,637
185,593
[ "wpf", "data-binding", "user-controls" ]
4,127,057
1
4,149,110
null
4
4,006
I've recently started trying to use Hibernate, but am doing so in Netbeans. This has left me having to use [this example project](http://netbeans.org/kb/docs/web/hibernate-webapp.html#06) to try and get me up and running. Unfortunately, at the step my HQL queries do not give results and instead fail, with the exception: ``` org.hibernate.exception.SQLGrammarException: could not execute query Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from limit 100' at line 1 ``` It seems that the HQL isn't generating proper MySQL statements but I can't seem to see why, as I've followed the example to the letter thus far. I am attempting to connect to a local MySQL database named 'sakila', with the following details: ``` jdbc:mysql://localhost:3306/sakila ``` which seems to work correctly as I am able to browse the tables from within Netbeans no problem. My hibernate.cfg.xml is as follows: ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/sakila</property> <property name="hibernate.connection.username">root</property> <property name="hibernate.show_sql">true</property> <property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property> <property name="hibernate.current_session_context_class">thread</property> <property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property> <mapping resource="dvdrental/Language.hbm.xml"/> <mapping resource="dvdrental/FilmActor.hbm.xml"/> <mapping resource="dvdrental/FilmCategory.hbm.xml"/> <mapping resource="dvdrental/Category.hbm.xml"/> <mapping resource="dvdrental/Film.hbm.xml"/> <mapping resource="dvdrental/Actor.hbm.xml"/> </session-factory> </hibernate-configuration> ``` When I'm using the HQL Query window, the SQL it seems to generate only ever says 'select from ' which is obviously wrong, but I can't see why this is being caused? The HQL Query tab showing my input ![Image showing HQL Query tab](https://i.stack.imgur.com/Pkuvo.png)
Basic HQL statement always fails
CC BY-SA 2.5
0
2010-11-08T19:04:00.080
2013-06-18T04:52:59.393
2010-11-09T06:57:02.527
70,604
344,016
[ "java", "hibernate", "orm", "hql" ]
4,127,170
1
4,131,143
null
1
1,204
How do I create a transparent numberpad view for a passcode view ? Like this ? ![alt text](https://i.stack.imgur.com/QuVYv.png)
iPhone, how do I create a transparent numberpad like this...?
CC BY-SA 2.5
null
2010-11-08T19:18:23.040
2019-05-24T17:52:41.550
2010-11-08T21:22:08.393
450,456
450,456
[ "iphone", "objective-c", "xcode" ]
4,127,242
1
4,127,285
null
17
5,549
I ran to this problem hard, it seems impossible to render. How can one solve this problem? I want the OpenGL render it like it looks at the right side of this image below: ![alt text](https://i.stack.imgur.com/ImsJl.png)
OpenGL: Rendering two transparent planes intersecting each other: impossible or not?
CC BY-SA 2.5
0
2010-11-08T19:26:09.363
2012-07-12T13:49:00.837
null
null
491,397
[ "opengl", "transparency" ]
4,127,322
1
4,127,451
null
3
1,387
I'm having a bit of an issue uploading files to a database. The table I'm uploading to has the following structure: ``` dbo.Cover CoverID int PK CoverFileContent varbinary(max) CoverMimeType nvarchar(50) CoverFileName nvarchar(50) FileID int FK ``` I can upload the file using my MVC application without any errors, however in the database the file stores in CoverFileContent as "0x0000000000000000......". All the other information relating to the file, e.g. MimeType, FileName, CoverID, etc uploads correctly. I took a wild guess that this wasn't correct so I downloaded the file (created a .net MVC downloader). It seemed to download as the correct type of file, however I when I tried to open it, it told me I could not open it. Here is the original tutorial I was following: [Tutorial](http://www.mikesdotnetting.com/Article/125/ASP.NET-MVC-Uploading-and-Downloading-Files). I have gotten this to work perfectly, however I wanted to use ADO.net so I rewrote is slightly. I didn't make any significant changes however as can be seen from my code so I'm not sure why this is happening. I inserted break points in my application to see if the byte array was actually being populated, which is was but only with zeros. ![alt text](https://i.stack.imgur.com/I3nBi.png) ``` public ActionResult CreateCover(int id) { Cover cover = new Cover(); cover.FileID = id; return View(cover); } // //POST: /File/CreateCover [HttpPost] public ActionResult CreateCover(Cover cover) { cover.CoverMimeType = Request.Files["CoverUpload"].ContentType; Stream fileStream = Request.Files["CoverUpload"].InputStream; cover.CoverFileName = Path.GetFileName(Request.Files["CoverUpload"].FileName); int fileLength = Request.Files["CoverUpload"].ContentLength; cover.CoverFileContent = new byte[fileLength]; fileStream.Read(cover.CoverFileContent, 0, fileLength); cover.FileID = int.Parse(Request.Form["FileID"]); filerepository.AddCoverData(cover); filerepository.Save(); return View(cover); //return View("CreatePdf", "Pdf", new { id = cover.FileID }); } ``` ``` <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<SampleApp.Models.Cover>" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> CreateCover </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <h2>CreateCover</h2> <% using (Html.BeginForm("CreateCover", "Cover", FormMethod.Post, new { enctype = "multipart/form-data" })) { %> <%: Html.HiddenFor(model => model.FileID) %> <asp:Label ID="Label2" runat="server" Text="Please Select your eBook Cover" /><br /> <input type="file" name="CoverUpload" /><br /> <input type="submit" name="submit" id="Submit" value="Upload" /> <% } %> <div> <%: Html.ActionLink("Back to List", "Index") %> </div> </asp:Content> ```
File uploading and saving to database incorrectly
CC BY-SA 2.5
null
2010-11-08T19:35:47.793
2010-11-08T19:51:20.770
2010-11-08T19:41:21.190
23,199
376,083
[ "c#", "sql", "asp.net-mvc", "ado.net", "file-upload" ]
4,127,625
1
4,455,110
null
12
3,128
I've got a serious head-scratcher on my hands here. I'm investigating performance issues with a WPF component in our application. Our .net application is very large, and almost entirely in windows forms. As part of a new initiative we rewrote one of our core components with a rich WPF ui. There is a lot of WinForms<-->WPF interop going on with this thing to glue it together, and I suspect that may be somehow related to what I'm seeing. When I profile the slow operation in ANTS profiler, I see a lot of activity occurring inside the function UnsafeNativeMethods.IntGetMessageW. ANTS reports as much CPU activity going there as it does to all of our business logic and wpf rendering stuff combined. There is no managed code downline of that function that is using the cycles, so whatever IntGetMessageW is doing there is what I'm after. I'm not particularly well-versed in win32 programming, but I know the basics of a message loop in that context. None of what I'm seeing here though is anything we do manually -- at no point in our code are we interacting directly with either the underlying messageloop itself, or any of the more complicated stuff that can be accessed on the WPF dispatcher. Our WPF component in question here is written inheriting from Window (ie. it's not just a control/usercontrol), and we show it using ShowDialog out of our higher level logic that used to call ShowDialog on the old WinForms version of this component. There are some WindowsFormsIntegrationHost controls that we have used inside of the WPF component to preserve compatibility with some of our existing pieces that could not be rewritten in WPF. I've been researching this for days, but have never found a whole lot to go on. I keep finding vaguely related postings that talk about input messages (mouse and keyboard), but I don't know what I can do to verify that; I've already tried butchering the code to remove every mouse/keyboard operation I could. I'm having a hard time getting anywhere primarily because this line of code is completely isolated (not a parent or child of anything I can point out as actually coming from our code), and completely opaque about what it is doing. Here is an image of an ANTS call graph of the ShowDialog function showing the path of calls to get here: ![alt text](https://i.stack.imgur.com/QdCO3.png) I fully realize that this could be something that just has to be done as part of WPF (although other componenets we have written in WPF don't display this behavior), or that this is just a very strange bug in ANTS profiler, but at this point I need to verify it one way or another. If anyone can tell me what is or might be going on here -- or point me to some way I would be able to figure it out myself, I will direct all kinds of good karma your way. UPDATE: In response to some discussion below, here is another view from ANTS -- this one better illustrates the confusion I am having (this is with the ANTS view in "CPU time" mode). I've hastily censored parts of our code, but none of the system related functions: ![alt text](https://i.stack.imgur.com/N3qzt.png) Thanks for looking!
Why would GetMessageW take up massive CPU usage in my WPF application?
CC BY-SA 2.5
0
2010-11-08T20:12:17.827
2010-12-15T21:30:33.027
2010-11-08T22:39:07.620
17,784
17,784
[ ".net", "wpf", "performance", "ants", "getmessage" ]
4,127,676
1
null
null
1
369
I am trying to create a layout like this, that is both horizontally and vertically centered. ![alt text](https://i.stack.imgur.com/RJ164.png) I have figured out a way to do this with jQuery, but there seems to be a slight jerk as the page renders. I was hoping to do this layout with pure css, but I can't seem to figure out how to do it. Here is the fiddle for this layout. Thanks [http://jsfiddle.net/rodmjay/LnRq6/](http://jsfiddle.net/rodmjay/LnRq6/)
Vertical Alignment & Horizontal Alignment Issue
CC BY-SA 3.0
null
2010-11-08T20:18:54.837
2016-08-30T22:08:42.413
2011-04-11T01:18:06.217
405,015
207,282
[ "html", "css" ]
4,127,741
1
4,128,455
null
0
2,028
Hopefully, this is a newbie question with a quick answer... I am attempting to add a simple preferences file in a new Android project (New -> Android XML File), but it doesn't appear to be working correctly. There is no root element to choose from when I select the Preference type layout. If I press Finish, it doesn't do anything. See screenshot below. Thanks, wTs ![alt text](https://i.stack.imgur.com/2baHR.png)
Unable to add Preferences.xml (Android Preferences in XML)
CC BY-SA 2.5
null
2010-11-08T20:25:53.773
2010-11-08T21:55:08.707
null
null
285,417
[ "android", "preferences", "android-preferences", "android-xml" ]
4,127,855
1
4,128,006
null
2
154
![alt text](https://i.stack.imgur.com/x3LDa.jpg) How do I align yellow side by side with red while keeping the 'Skills' text underneath the grey? What i've tried: using float:left with red but that pushes up the skills text aswell. I've tried using relative and absolute but they're confusing to me. Key div id's: `profiletable` (grey), `profileleft`(red), `profileright` (yellow). ``` <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>Starbuzz Coffee</title> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <div id="allcontent"> <div id="header"> </div> <div id="main"> <h1>Jonny</h1> <div id="profiletable"> <div id="profileleft"><?php echo $gravatar ?></div> <div id="profileright"> <strong>Name:</strong> <?php echo $member->getFirstName() . ' ' . $member->getLastName(); ?><br /> <strong>Name:</strong> <?php echo $member->getFirstName() ?><br /> </div> </div> <h1>Skills</h1> <p> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. </p> </div> <div id="sidebar"> <p class="beanheading"> sidebar </p> </div> <div id="footer"> &copy; 2005, Jonny </div> </div> </body> </html> ``` key id's at the very bottom ``` body { background-color: #eeeeee; font-family: Georgia, "Times New Roman", Times, serif; font-size: small; margin: 0px; } #header { background-color: #675c47; margin: 10px; height: 108px; } #main { background: #ffffff; font-size: 105%; padding: 15px; margin: 0px 10px 10px 0px; width: 510px; float: left; } #sidebar { background: #7DCFE7; font-size: 105%; padding: 15px; margin: 0px 0px 10px 540px; } #footer { background-color: #675c47; color: #efe5d0; text-align: center; padding: 15px; margin: 10px; font-size: 90%; clear: left; } h1 { font-size: 120%; color: #954b4b; } .slogan { color: #954b4b; } .beanheading { text-align: center; line-height: 1.8em; } a:link { color: #b76666; text-decoration: none; border-bottom: thin dotted #b76666; } a:visited { color: #675c47; text-decoration: none; border-bottom: thin dotted #675c47; } #allcontent { width: 800px; padding-top: 5px; padding-bottom: 5px; background-color: #675c47; margin-left: auto; margin-right: auto; } #profiletable{ width: 510px; background: #eee; } #profileleft { background: red; font-size: 105%; padding: 0px 10px 10px 0px; margin: 0px 10px 10px 0px; width: 128px; } #profileright { background: yellow; font-size: 105%; padding: 0px 10px 10px 0px; margin: 0px 0px 10px 128px; width: 200px; } ```
Html/css positioning help
CC BY-SA 2.5
null
2010-11-08T20:41:02.673
2010-11-08T21:12:20.117
null
null
363,004
[ "html", "css", "xhtml" ]
4,127,972
1
4,128,128
null
1
648
I have three tables arranged to make a many to many relationship (Contacts, PurchaseOrder, and PO_Contact). The PurchaseOrder table will eventually represent each purchaseorder (only one instance of each). Each Customer can be associated with any number of PurchaseOrders and each Purchase Order may be associated with any number of Contacts. However for each Contact, there can be a Purchase Order that is the Primary PO for that Contact. I am trying to figure out how I can add this to my EntityModel and I am coming up short. Eventually I want to have a collection of PO objects with one depicted as the Primary, but I am not sure how to effect that. Anyone have experience with this? Please find below the database diagram for the affected tables. ![Contact/PO diagram](https://i.stack.imgur.com/y33DH.png) ![Contact/PO EDMX Diagram](https://i.stack.imgur.com/K3xH2.png)
Many-To-Many relationship in EF with a datafield in the Association table
CC BY-SA 4.0
null
2010-11-08T20:54:36.450
2020-08-08T16:49:58.720
2020-08-08T16:49:58.720
472,495
281,348
[ "entity-framework", "many-to-many" ]
4,128,088
1
null
null
1
716
I am trying to debug a small prototype for an iPhone App (iOS Simulator 4.1), compiled as Debug, with all the configuration apparently ok. The application makes use of Cocos2d graphic engine and GDataXMLNode library (for XML reading). There isn’t much stuff going on. But on certain method, if I set a breakpoint, gdb simply “stops”. Here’s the status line of the debugger after it hits he breakpoint: ![alt text](https://i.stack.imgur.com/aVj9Z.png) And here’s the code that has the breakpoint(sshot): ![alt text](https://i.stack.imgur.com/7KNj4.png) : the breakpoint could be anywhere in that function and it’s the same. And this is the calling code (from another object) ``` self.map = [SimulationLoader loadMap]; ``` None of the Editor buttons work when a breakpoint is set inside the “loadMap" (step into, step out, next, continue execution, etc.). I can stop and/or restart the debugging and it works (but goes back to the beginning). The gdb prompt, will let me write, but nothing happens. I cannot view object values or anything debugging related. I cannot resume execution, it won’t do anything. The strange thing is that, if I put a breakpoint or that line (the loadMap), it all works, and I can step out or in, debug it and do all I want to do. What am I missing? A couple of seconds after the “failing” breakpoint is hit (and it “hangs”) the stack window clears. I believe all this happens because the gdb has stopped, but the question is, why does it stop there? What are the restrictions for this? I’m compiling with LLVM GCC 4.2 for what is worth (but could probably change to other if that’s the problem, haven’t tried that because I don’t know much about the differences).
Xcode stops at breakpoints and seems to hang
CC BY-SA 3.0
0
2010-11-08T21:09:17.373
2012-06-24T22:26:09.993
2012-06-24T22:26:09.993
918,414
2,684
[ "iphone", "debugging", "xcode3.2", "ios4" ]
4,128,166
1
4,128,200
null
2
1,049
I have a problem with include pages in PHP. Picture shows what I want to do. I want to include in my index.php page horizontal and vertical menu. But now I can include only one of them. In global.php there are database name, password, and variable which define what language I'm using now. I included with all derictives: include, include_once, require, require_once. Nothing helps. What can you propose me to do? Thanx! ![alt text](https://i.stack.imgur.com/smEre.png) Here is my code: Index.php: ``` <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>KUSS</title> <link href="styles/default.css" rel="stylesheet" type="text/css"> </head> <body> <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="main_border"> <?php include_once ("modules/php/mainMenu.php"); ?> <? include_once ("modules/php/vertMenu.php"); ?><!--Head--> </table> </body> </html> ``` --- global.php ``` <?php // All global variables MUST be defines here //representing current language $gl_Lang = "UKR"; //current horizontal menu click $gl_MaimMenuChoice; //current vertical sub menu click $gl_SubMenuChoice; $gl_dbName = "127.0.0.1"; $gl_UserName = "user1"; $gl_Password = "12345"; $gl_adminDatabase = "admin"; ?> ``` --- makeHoriz.php and makeVert.php identical except one read from db and shows rows and second cols ``` <?php function MakeLeftVMenu($tableName, $levelID, $parentName) { include_once ("modules/php/globals.php"); //connect to db or die) $db = mysql_connect($gl_dbName, $gl_UserName, $gl_Password ) or die ("Unable to connect"); //to prevenr ????? symbols in unicode - utf-8 coding mysql_query("SET NAMES 'UTF8'"); //select database mysql_select_db($gl_adminDatabase, $db); $sql = "SELECT " .$gl_Lang. ", Link FROM ". $tableName." WHERE LevelID = ".$levelID. " AND ParentName = '". $parentName."'"; echo $sql; //execute SQL-query $result = mysql_query($sql, $db); //read data to array $myRow = mysql_fetch_array($result); //print it to screen into the table do { echo "<tr><h3><a href=".trim($myRow['Link']).">". trim($myRow[$gl_Lang]) ."</a></h3></tr>"; }while($myRow = mysql_fetch_array($result)); //close database = very inportant mysql_close($db); } ?> ```
problems with global variables
CC BY-SA 3.0
0
2010-11-08T21:18:26.213
2012-08-13T11:48:38.490
2012-08-13T11:48:38.490
367,456
449,007
[ "php", "include", "global-variables" ]
4,128,634
1
4,128,833
null
0
172
I'm building an editor that works with .CSV files. I have the application importing the file fine, but now I want the user to be able to select a few columns to work with. I display the top 5 columns of the file in an HTML table, and in the table TH tag I'm creating some checkboxes at the top of the table like this: It ends up looking like this: ![table](https://i.stack.imgur.com/Ttp84.jpg) All of this is wrapped up in a form and when it gets submitted the params contain the IDs of the checked checkboxes/columns. "0"=>"0", "3"=>"3" I want to find out which columns have been selected, but to my mind, scraping through the params and trying to work out which columns is a tad messy.... is there a way to get the selected checkboxes back as an array so I can just iterate through them? The number of columns is variable. Changed the checkbox generation to this: and all of the selected columns go into an array called selected_columns. Simple!
Multiple Dynamic Controls - Results as Array?
CC BY-SA 2.5
0
2010-11-08T22:16:00.767
2010-11-08T22:38:51.420
2010-11-08T22:37:14.523
39,655
39,655
[ "ruby-on-rails", "ruby-on-rails-3" ]
4,129,024
1
4,129,089
null
0
513
The url I'm using is this: ``` https://chart.apis.google.com/chart?chxl=0:|2010-08-06|2010-08-02|2010-08-05|2010-08-03|2010-08-04|1:|0|2347.002|3650|2:|min|average|max&chxp=2,10,50.83,90&chxr=0,2347.002,3650&chxt=x,y,r&chs=200x120&cht=bvg&chco=EBB411&chd=t:3455.01,730,2240,1760,3550&chma=|5&chtt=Revenue ``` The image: ![](https://chart.apis.google.com/chart?chxl=0:|2010-08-06|2010-08-02|2010-08-05|2010-08-03|2010-08-04|1:|0|2347.002|3650|2:|min|average|max&chxp=2,10,50.83,90&chxr=0,2347.002,3650&chxt=x,y,r&chs=200x120&cht=bvg&chco=EBB411&chd=t:3455.01,730,2240,1760,3550&chma=|5&chtt=Revenue) The bars shouldn't be filling all the way to the top, but I cannot figure out what I've done wrong.
What's wrong with this Google Chart API Bar graph URL?
CC BY-SA 2.5
null
2010-11-08T23:09:55.327
2010-11-08T23:24:01.943
2017-02-08T14:30:54.893
-1
262,056
[ "google-visualization" ]
4,129,381
1
4,139,643
null
1
1,341
I am looking for any jquery/jquery-ui plugin to convert `select` html element (drop-down list) to a nice looking "carousel". Not image carousel, but something similar to jQuery-ui datepicker component title: ![alt text](https://i.stack.imgur.com/T0BqE.png) With side buttons that allow going through list items. Does anyone know anything similar to this. Thanks.
Dropdown to horizontal carousel jQuery plug-in
CC BY-SA 2.5
0
2010-11-09T00:26:28.637
2018-08-31T16:02:44.163
null
null
136,666
[ "jquery", "jquery-ui", "select", "combobox", "drop-down-menu" ]
4,129,729
1
4,130,010
null
0
1,291
I have problem with this query ``` DECLARE @INPUT INT SET @INPUT = 12345 ; WITH ABCD(SEQ, X, Y) AS ( SELECT 1, @INPUT % 10, @INPUT / 10 UNION ALL SELECT SEQ + 1, Y % 10, Y / 10 FROM ABCD WHERE X > 0 OR Y > 0 ) SELECT * FROM ABCD ORDER BY SEQ ``` this query will produce something like this ![alt text](https://i.stack.imgur.com/yrIsh.jpg) I want to convert this to Oracle 10g (must valid for 10g) Thank you
Convert SQL Server recursive WITH clause to Oracle 10g
CC BY-SA 2.5
null
2010-11-09T01:34:34.900
2010-11-09T03:28:12.857
2010-11-09T02:07:02.230
218,380
218,380
[ "sql-server", "oracle", "oracle10g" ]