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
sequence |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2,589,851 | 1 | 2,589,957 | null | 10 | 19,391 | How can one implement the fisheye lens effect illustrated in that image:

One can use Google's logo for a try:

BTW, what's the term for it?
| How can I implement a fisheye lens effect (barrel transformation) in MATLAB? | CC BY-SA 3.0 | 0 | 2010-04-07T03:37:57.103 | 2017-07-08T03:41:00.983 | 2017-02-08T14:23:27.200 | -1 | 198,729 | [
"matlab",
"image-processing",
"geometry"
] |
2,589,948 | 1 | 2,593,883 | null | 6 | 6,011 | When hosting WPF user controls within a WinForms MDI app there is a drawing issue when you have multiple forms that overlap each other that causes very distinct visual artifacts. These artifacts are mostly visible after dragging one child form over another one that also hosts WPF content or by allowing the edges of the child form to be clipped by the main MDI parent when dragging it around. After the drag and drop of the child form is completed the artifacts stay around generally but I've found that setting focus to a different application's window and then refocusing back on to my application window that it is redrawn and all is good again until the child forms are moved once again. Please see the image below which demonstrates the problem.

Those at Microsoft insist that the WinForms MDI is already a sufficient solution for MDI and doesn't need reinventing in WPF although I find it hard to believe they tried creating a WPF app this way because of the obvious shortcomings.
A few extra notes that I left out is that if I create these Forms without setting the MdiParent they are created as regular forms and this issue doesn't happen. This issue seems unique to the WinForms MDI scenario. Also I've currently running on Windows 7 Enterprise and I'm aware the results may be quite different on Windows XP but I haven't been able to test this.
I've found a few other related resources on this issue that I thought I should share.
- [elementHost repaint problem in MDI application](http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/6f88715b-b9ca-4d4f-974b-97b334d26347/)- [elementHost repaint problem in MDI application on Tech Archive](http://www.tech-archive.net/Archive/DotNet/microsoft.public.dotnet.framework.windowsforms/2008-12/msg00117.html)
| How to avoid visual artifacts when hosting WPF user controls within a WinForms MDI app? | CC BY-SA 3.0 | 0 | 2010-04-07T04:10:42.410 | 2015-08-25T15:20:47.967 | 2017-02-08T14:23:27.563 | -1 | 83,658 | [
"wpf",
"mdi",
"winforms-interop",
"visual-artifacts"
] |
2,590,470 | 1 | 2,651,851 | null | 6 | 2,007 | I have a CATiledLayer into which I render content in the following method
```
- (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx
```
I used the QuartzDemo code to draw a pattern. This works very well until I apply a rotation transform to the layer's parentLayer (a UIView):

rotated:

These zigzag artefacts become worse when I start drawing lines and texts into the CATiledLayer.
I applied the transform as follows (I also tried using an affine transform on the view itself):
```
self.containerView.layer.transform = CATransform3DMakeRotation(angleRadians, 0.0f, 0.0f, 1.0f);
```
I transform the containerView rather than the layer itself, as I have several layers in that view that I would like to rotate at the same time without changing the relative positions.
I did not have problems when rotating UIImageViews in the past.
Is there a way that I can rotate the CATiledLayer without these problems?
Any help would be greatly appreciated.
Yours,
Felix
| How do I remove those rotation artefacts from my CATiledLayer? | CC BY-SA 2.5 | 0 | 2010-04-07T06:39:06.740 | 2011-01-17T12:39:17.760 | null | null | 195,186 | [
"iphone",
"cocoa-touch",
"quartz-graphics",
"catiledlayer"
] |
2,591,479 | 1 | 2,597,709 | null | 2 | 4,296 | I have a `datagrid` with some `TextColumn` and one `DataGridCheckBoxColumn`. I bind it with a `itemsource` that contains a boolean and I can see that my `checkboxes` or checked or not by the boolean everything is OK at this point.
But the checkboxs cells are in ReadOnly even if I assign `IsReadOnly = False`. I can't find the right and clean way to enable the editing.
I dont need data validation but juste to be able to edit and check those checkboxes.

| How to edit boolean in a DataGridCheckBoxColumn in Silverlight 3 | CC BY-SA 3.0 | null | 2010-04-07T10:05:54.413 | 2012-10-24T08:49:47.557 | 2012-10-24T08:49:47.557 | 569,101 | 60,561 | [
".net",
"silverlight",
"datagrid",
"checkbox",
"silverlight-3.0"
] |
2,591,694 | 1 | 2,592,032 | null | 2 | 919 | I am rendering textured quads from an orthographic perspective and would like to simulate 'depth' by modifying UVs and the vertex positions of the quads four points (top left, top right, bottom left, bottom right).
I've found if I make the top left and bottom right corners y position be the same I don't get a linear 'skew' but rather a warped one where the texture covering the top triangle (which makes up the quad) seems to get squashed while the bottom triangles texture looks normal.
I can change UVs, any of the four points on the quad (but only in 2D space, it's orthographic projection anyway so 3D space won't matter much). So basically I'm trying to simulate perspective on a two dimensional quad in orthographic projection, any ideas? Is it even mathematically possible/feasible?
ideally what I'd like is a situation where I can set an x/y rotation as well as a virtual z 'position' (which simulates z depth) through a function and see it internally calclate the positions/uvs to create the 3D effect. It seems like this should all be mathematical where a set of 2D transforms can be applied to each corner of the quad to simulate depth, I just don't know how to make it happen. I'd guess it requires trigonometry or something, I'm trying to crunch the math but not making much progress.
here's what I mean:

Top left is just the card, center is the card with a y rotation of X degrees and right most is a card with an x and y rotation of different degrees.
| Simulating 3D 'cards' with just orthographic rendering | CC BY-SA 2.5 | null | 2010-04-07T10:42:39.437 | 2010-04-07T15:23:33.220 | 2010-04-07T11:08:39.460 | 14,637 | 79,891 | [
"graphics",
"rendering",
"perspective",
"orthographic"
] |
2,591,755 | 1 | null | null | 71 | 226,357 | I need to send email with html format. I have only linux command line and command "mail".
Currently have used:
```
echo "To: [email protected]" > /var/www/report.csv
echo "Subject: Subject" >> /var/www/report.csv
echo "Content-Type: text/html; charset=\"us-ascii\"" >> /var/www/report.csv
echo "<html>" >> /var/www/report.csv
mysql -u ***** -p***** -H -e "select * from users LIMIT 20" dev >> /var/www/report.csv
echo "</html>" >> /var/www/report.csv
mail -s "Built notification" [email protected] < /var/www/report.csv
```
But in my mail-agent i get only plain/text.

| How to send HTML email using linux command line | CC BY-SA 3.0 | 0 | 2010-04-07T10:53:46.327 | 2023-02-08T14:18:45.560 | 2017-05-19T02:34:58.680 | 6,862,601 | 283,217 | [
"html",
"linux",
"email",
"send"
] |
2,593,042 | 1 | 2,619,309 | null | 2 | 1,447 | I am using the theme DarkExpression from [WPF Futures](http://wpf.codeplex.com/wikipage?title=WPF%20Themes&referringTitle=Home).
It does not seem to work well with datatemplates.
Here is how it looks like without datatemplates:

Code:
```
<ListView Name="playlistListView" ItemsSource="{Binding PlaylistList}" Margin="0" SelectionChanged="DatabindedPlaylistListView_SelectionChanged" Background="{x:Null}" Opacity="0.98">
<ListView.View>
<GridView>
<GridViewColumn Width="Auto" DisplayMemberBinding="{Binding Name}">
<GridViewColumnHeader HorizontalContentAlignment="Left" Content="Playlist" Tag="Playlist"/>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
```
Here is how it looks like trying to use datatemplates while using the theme:

Code:
```
<ListView Name="playlistListView" ItemsSource="{Binding PlaylistList}" Margin="0" SelectionChanged="DatabindedPlaylistListView_SelectionChanged" Background="{x:Null}" Opacity="0.98">
<ListView.ItemTemplate>
<DataTemplate>
<Grid>
<UserControls:SongDataTemplate Margin="4" />
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
```
Here is how it looks like trying to use datatemplates while overriding the theme:

Code:
```
<UserControl.Resources>
<Style x:Key="ListViewItemStretch" TargetType="{x:Type ListViewItem}">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Background" Value="Transparent" />
</Style>
</UserControl.Resources>
<Grid x:Name="LayoutRoot">
<ListView Name="playlistListView" ItemContainerStyle="{StaticResource ListViewItemStretch}" ItemsSource="{Binding PlaylistList}" Margin="0" SelectionChanged="DatabindedPlaylistListView_SelectionChanged" Background="{x:Null}" Opacity="0.98">
<ListView.ItemTemplate>
<DataTemplate>
<Grid>
<UserControls:SongDataTemplate Margin="4" />
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
```
I want to keep the theme style but I also want to use datatemplates to define how a playlist should look like. Any suggestions?
In scenario 2 and 3 I had to remove
```
<ListView.View>
<GridView>
<GridViewColumn Width="Auto" DisplayMemberBinding="{Binding Name}">
<GridViewColumnHeader HorizontalContentAlignment="Left" Content="Playlist" Tag="Playlist"/>
</GridViewColumn>
</GridView>
</ListView.View>
```
Before the datatemplate would be used.
The solution given below, works if the type is changed to ListBox and I am using a TextBox instead. I can't however make it work with a ListView.
| Datatemplates while using theme does not work - WPF | CC BY-SA 3.0 | null | 2010-04-07T14:00:37.320 | 2014-12-12T13:05:55.697 | 2014-12-12T13:05:55.697 | 2,681,948 | 87,840 | [
"c#",
"wpf",
"themes",
"datatemplate"
] |
2,595,393 | 1 | 2,595,424 | null | 1 | 1,478 | This is the 3rd part to this topic. [Part 1](https://stackoverflow.com/questions/2594359), [Part 2.](https://stackoverflow.com/questions/2593768/).
I was successfully able to print my monochrome bitmap to my printer, however there is a large black stripe along the right of the image when the item prints.
Here is the original

(Scanned in)What the printer printed

Code to generate binary blob
```
Rectangle rect = new Rectangle(0, 0, Bitmap.Width, Bitmap.Height);
System.Drawing.Imaging.BitmapData bmpData = null;
byte[] bitVaues = null;
int stride = 0;
try
{
bmpData = Bitmap.LockBits(rect, System.Drawing.Imaging.ImageLockMode.ReadOnly, Bitmap.PixelFormat);
IntPtr ptr = bmpData.Scan0;
stride = bmpData.Stride;
int bytes = bmpData.Stride * Bitmap.Height;
bitVaues = new byte[bytes];
System.Runtime.InteropServices.Marshal.Copy(ptr, bitVaues, 0, bytes);
}
finally
{
if (bmpData != null)
Bitmap.UnlockBits(bmpData);
}
string str = String.Format("GW{0},{1},{2},{3},", X, Y, stride, Bitmap.Height);
byte[] ascii = Encoding.ASCII.GetBytes(str);
byte[] buffer = new byte[ascii.Length + bitVaues.Length + 1];
Buffer.BlockCopy(ascii, 0, buffer, 0, ascii.Length);
Buffer.BlockCopy(bitVaues, 0, buffer, ascii.Length, bitVaues.Length);
buffer[buffer.Length - 1] = (byte)'\n';
return buffer;
```
My initial theory is the BMP format is adding that line as a end of line marker and is not viable when rendered. I am thinking I may have to reparse the file after I have the binary array and take out the 00 00 00 at the end of every line. But I am posting here in case anyone thinks of a better way.
| Large black line appears when printing bmp files using the EPL2 print language | CC BY-SA 3.0 | null | 2010-04-07T19:44:23.340 | 2012-11-09T15:28:10.930 | 2017-05-23T12:30:46.800 | -1 | 80,274 | [
"c#",
"printing",
"bitmap"
] |
2,595,496 | 1 | null | null | 2 | 739 | I have exhausted many options to implement the below design (link to page) in the ssrs parameter bar. Have learned painfully that it is not easy to customize design... Would someone perhaps have an ingenious hack? I really appreciate if someone can me implement the below design (image on another site) into ssrs.

| A specific SSRS hack - a customized design for the parameter bar | CC BY-SA 3.0 | null | 2010-04-07T20:01:34.160 | 2013-12-20T05:36:31.930 | 2013-12-20T05:36:31.930 | 168,868 | 311,351 | [
"reporting-services"
] |
2,598,827 | 1 | 2,598,913 | null | 4 | 9,906 | I'm trying to create a pretty simple WPF interface, and from what I know this should be mostly possible using pure XAML.
I have a pretty basic understanding of WPF so far, however I have a decent grasp on XAML.
I know or can work out how to put content in these panels. This isn't the topic of this question.
I don't know how to animate this interface.
I'm not very proficient at binding, however again, that's not the topic of this question.
The topic of this question is what would be the best way to animate panels 1-4 (images below) so that they may be dragged (via touch) into view. The number of panels here may be static for the purpose of this question.
The panels (1-4) can be stack panels, grids or whatever; their content isnt important. What is important is the container that would contain all 4 panels. The complication in this animation is the other two containers here (Item One/TODO), as they're in the way of a smooth animation.
If it makes this question simpler, the touch features can be ignored for now, and a simple button push can slide the containers across.
One

Two

| WPF touch and slide/drag animation | CC BY-SA 2.5 | 0 | 2010-04-08T09:39:25.157 | 2010-04-20T10:00:00.607 | 2017-02-08T14:23:30.437 | -1 | 169,713 | [
"c#",
"wpf",
"animation"
] |
2,598,994 | 1 | null | null | 1 | 318 | Good day!
Strange square appears on mouse hover on text boxes, buttons, etc (something like hint) in a silverlight navigation application - how can I remove it?
A print screen

[http://i34.photobucket.com/albums/d126/durick/bug.jpg](http://i34.photobucket.com/albums/d126/durick/bug.jpg)
I've colored the square at a picture. It appears when the mouse hover.
---
an example .xaml page:
```
<Code:BasePage x:Class="CAP.Views.Main"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
xmlns:Code="clr-namespace:CAP.Code"
d:DesignWidth="640" d:DesignHeight="480"
Title="Личный кабинет клиентов ООО АУРИТ">
<Grid x:Name="LayoutRoot">
<Grid.RowDefinitions>
<RowDefinition Height="103*" />
<RowDefinition Height="377*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120*" />
<ColumnDefinition Width="520*" />
</Grid.ColumnDefinitions>
<Image Height="85" HorizontalAlignment="Left" Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="84" Margin="12,0,0,0" ImageFailed="image1_ImageFailed" Source="/CAP;component/Images/My-Computer.png" />
<TextBlock Grid.Column="1" Height="Auto" TextWrapping="Wrap" HorizontalAlignment="Left" Margin="0,12,0,0" Name="textBlock1" Text="Good day!" VerticalAlignment="Top" FontFamily="Verdana" FontSize="16" Width="345" FontWeight="Bold" />
<TextBlock Grid.Column="1" Grid.Row="1" TextWrapping="Wrap" Height="299" HorizontalAlignment="Left" Name="textBlock2" VerticalAlignment="Top" FontFamily="Verdana" FontSize="14" Width="441" >
<Run Text="Some text "/><LineBreak/><LineBreak/><Run Text="and so on"/>
<LineBreak/>
</TextBlock>
</Grid>
```
.cs:
```
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;
using CAP.Code;
namespace CAP.Views
{
public partial class Main : BasePage
{
public Main() : base()
{
InitializeComponent();
MapBuilder.AddToMap(new SiteMapUnit() { Caption = "Главная", RelativeUrl = "Main" },true);
((App)Application.Current).Mainpage.tvMainMenu.SelectedItems.Clear();
}
// Executes when the user navigates to this page.
protected override void OnNavigatedTo(NavigationEventArgs e)
{
}
private void image1_ImageFailed(object sender, ExceptionRoutedEventArgs e)
{
}
protected override string[] NeededPermission()
{
return new string[0];
}
}
}
```
MainPage.xaml
```
<UserControl
x:Class="CAP.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Code="clr-namespace:CAP.Code"
xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
xmlns:uriMapper="clr-namespace:System.Windows.Navigation;assembly=System.Windows.Controls.Navigation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
mc:Ignorable="d" Margin="0,0,0,0" Width="auto" Height="auto" xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input">
<ScrollViewer Width="auto" Height="auto" BorderBrush="White" BorderThickness="0" Margin="0,0,0,0" x:Name="sV" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" >
<ScrollViewer.Content>
<Grid Width="auto" Height="auto" x:Name="LayoutRoot" Style="{StaticResource LayoutRootGridStyle}" Margin="0,0,0,0">
<StackPanel Width="auto" Height="auto" Orientation="Vertical" Margin="250,0,0,50">
<Border x:Name="ContentBorder2" Margin="0,0,0,0" >
<!--<navigation:Frame Margin="0,0,0,0" Width="auto" Height="auto" x:Name="AnotherFrame" VerticalAlignment="Top" Style="{StaticResource ContentFrameStyle}" Source="/Views/Menu.xaml" NavigationFailed="ContentFrame_NavigationFailed" JournalOwnership="OwnsJournal" Loaded="AnotherFrame_Loaded">
</navigation:Frame>-->
<StackPanel Orientation="Vertical" Height="82" Width="Auto" HorizontalAlignment="Right" Margin="0,0,0,0" DataContext="{Binding}">
<TextBlock HorizontalAlignment="Right" Foreground="White" x:Name="ApplicationNameTextBlock4" Style="{StaticResource ApplicationNameStyle}" FontSize="20"
Text="Личный кабинет" Margin="20,16,20,0"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Image x:Name="imDoor" Visibility="Collapsed" MouseEnter="imDoor_MouseEnter" MouseLeave="imDoor_MouseLeave" Height="24" Stretch="Fill" Width="25" Margin="10,0,10,0" Source="/CAP;component/Images/sm_white_doors.png" MouseLeftButtonDown="bTest_Click" />
<TextBlock x:Name="bLogout" MouseEnter="bLogout_MouseEnter" MouseLeave="bLogout_MouseLeave" TextDecorations="Underline" Margin="0,6,20,4" Height="23" Text="Выйти" HorizontalAlignment="Right" Visibility="Collapsed" MouseLeftButtonDown="bTest_Click" FontFamily="Verdana" FontSize="13" FontWeight="Normal" Foreground="#FF1C1C92" />
</StackPanel>
</StackPanel>
</Border>
<Border x:Name="bSiteMap" Margin="0,0,0,0" >
<StackPanel x:Name="spSiteMap" Orientation="Horizontal" Height="20" Width="Auto" HorizontalAlignment="Left" Margin="0,0,0,0" DataContext="{Binding}">
<!-- <TextBlock Visibility="Visible" TextDecorations="Underline" Height="23" HorizontalAlignment="Left" x:Name="ar" Text="1" VerticalAlignment="Top" Foreground="Blue" FontFamily="Verdana" FontSize="13" />
<TextBlock Visibility="Visible" Height="23" HorizontalAlignment="Left" x:Name="Map" Text="->" VerticalAlignment="Top" Foreground="Blue" FontFamily="Verdana" FontSize="13" />
<TextBlock Visibility="Visible" TextDecorations="Underline" Height="23" HorizontalAlignment="Left" x:Name="ar1" Text="2" VerticalAlignment="Top" Foreground="Blue" FontFamily="Verdana" FontSize="13" />
<TextBlock Visibility="Visible" Height="23" HorizontalAlignment="Left" x:Name="Map1" Text="->" VerticalAlignment="Top" Foreground="Blue" FontFamily="Verdana" FontSize="13" />
<TextBlock Visibility="Visible" TextDecorations="Underline" Height="23" HorizontalAlignment="Left" x:Name="ar2" Text="3" VerticalAlignment="Top" Foreground="Blue" FontFamily="Verdana" FontSize="13" />-->
</StackPanel>
</Border>
<Border Width="auto" Height="auto" x:Name="ContentBorder" Margin="0,0,0,0" >
<navigation:Frame x:Name="ContentFrame" Style="{StaticResource ContentFrameStyle}"
Source="Main" Navigated="ContentFrame_Navigated" NavigationFailed="ContentFrame_NavigationFailed" ToolTipService.ToolTip=" " Margin="0,0,0,0">
<navigation:Frame.UriMapper>
<uriMapper:UriMapper>
<!--Client-->
<uriMapper:UriMapping Uri="RegistrateClient" MappedUri="/Views/Client/RegistrateClient.xaml"/>
<!--So on-->
</uriMapper:UriMapper>
</navigation:Frame.UriMapper>
</navigation:Frame>
</Border>
</StackPanel>
<Grid x:Name="NavigationGrid" Style="{StaticResource NavigationGridStyle}" Margin="0,0,0,0" Background="{x:Null}" >
<StackPanel Orientation="Vertical" Height="Auto" Width="250" HorizontalAlignment="Center" Margin="0,0,0,50" DataContext="{Binding}">
<Image Width="150" Height="90" HorizontalAlignment="Center" VerticalAlignment="Top" Source="/CAP;component/Images/logo__au.png" Margin="0,20,0,70"/>
<Border x:Name="BrandingBorder" MinHeight="222" Width="250" Style="{StaticResource BrandingBorderStyle3}" HorizontalAlignment="Center" Opacity="60" Margin="0,0,0,0">
<Border.Background>
<ImageBrush ImageSource="/CAP;component/Images/papka.png"/>
</Border.Background>
<Grid Width="250" x:Name="LichniyCabinet" Margin="0,10,0,0" HorizontalAlignment="Center" Height="211">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="19*" />
<ColumnDefinition Width="62*" />
<ColumnDefinition Width="151*" />
<ColumnDefinition Width="18*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="13" />
<RowDefinition Height="24" />
<RowDefinition Height="35" />
<RowDefinition Height="35" />
<RowDefinition Height="43" />
<RowDefinition Height="28" />
<RowDefinition Height="32*" />
</Grid.RowDefinitions>
<TextBlock Visibility="Visible" Grid.Row="2" Height="23" HorizontalAlignment="Left" x:Name="tLogin" Text="Логин" VerticalAlignment="Top" FontFamily="Verdana" FontSize="13" Foreground="White" Margin="1,0,0,0" Grid.Column="1" />
<TextBlock Visibility="Visible" FontFamily="Verdana" FontSize="13" Foreground="White" Height="23" HorizontalAlignment="Left" x:Name="tPassw" Text="Пароль" VerticalAlignment="Top" Grid.Row="3" Grid.Column="1" />
<TextBox Visibility="Visible" Grid.Column="2" Grid.Row="2" Height="24" HorizontalAlignment="Left" x:Name="logLogin" VerticalAlignment="Top" Width="150" />
<PasswordBox Visibility="Visible" Code:DefaultButtonService.DefaultButton="{Binding ElementName=bLogin}" PasswordChar="*" Height="24" HorizontalAlignment="Left" x:Name="logPassword" VerticalAlignment="Top" Width="150" Grid.Column="2" Grid.Row="3" />
<Button x:Name="bLogin" MouseEnter="bLogin_MouseEnter" MouseLeave="bLogin_MouseLeave" Visibility="Visible" Content="Войти" Grid.Column="2" Grid.Row="4" Click="Button_Click" Height="23" HorizontalAlignment="Left" Margin="81,0,0,0" VerticalAlignment="Top" Width="70" />
<TextBlock MouseLeftButtonDown="ForgotPassword_MouseLeftButtonDown" MouseEnter="ForgotPassword_MouseEnter" MouseLeave="ForgotPassword_MouseLeave" Visibility="Visible" TextDecorations="Underline" Grid.ColumnSpan="2" Grid.Row="4" Height="23" HorizontalAlignment="Left" x:Name="ForgotPassword" Text="Забыли пароль?" VerticalAlignment="Top" Foreground="White" FontFamily="Verdana" FontSize="13" Grid.Column="1" />
<TextBlock MouseEnter="tbRegistration_MouseEnter" MouseLeave="tbRegistration_MouseLeave" MouseLeftButtonDown="tbRegistration_MouseLeftButtonDown" Grid.Column="2" Grid.Row="6" Height="23" x:Name="tbRegistration" TextDecorations="Underline" Text="Регистрация" VerticalAlignment="Top" FontFamily="Verdana" FontSize="13" TextAlignment="Center" HorizontalAlignment="Center" Foreground="#FF1C1C92" FontWeight="Normal" Margin="0,0,57,0" />
<TextBlock Cursor="Arrow" Height="23" HorizontalAlignment="Left" Margin="11,-3,0,0" Text="Личный кабинет" VerticalAlignment="Top" Grid.ColumnSpan="3" Grid.RowSpan="2" FontFamily="Verdana" FontSize="13" FontWeight="Bold" Foreground="White" />
<Image Visibility="Collapsed" Height="70" x:Name="imUser" Stretch="Fill" Width="70" Grid.ColumnSpan="2" Margin="11,0,0,0" Grid.Row="2" Grid.RowSpan="2" Source="/CAP;component/Images/user2.png" />
<TextBlock x:Name="tbHello" Grid.Column="2" Visibility="Collapsed" Grid.Row="2" Height="auto" TextWrapping="Wrap" HorizontalAlignment="Left" Margin="6,0,0,0" Text="" VerticalAlignment="Top" FontFamily="Verdana" FontSize="13" Foreground="White" Width="145" />
</Grid>
</Border>
<Border x:Name="MenuBorder" Margin="0,0,0,50" Width="250" Visibility="Collapsed">
<StackPanel x:Name="spMenu" Width="240" HorizontalAlignment="Left">
<telerikNavigation:RadTreeView x:Name="tvMainMenu"
Width="240"
Selected="TreeView1_Selected"
SelectedValuePath="Text"
telerik:Theming.Theme="Windows7"
FontFamily="Verdana"
FontSize="12"/>
</StackPanel>
</Border>
</StackPanel>
</Grid>
<Border x:Name="FooterBorder" VerticalAlignment="Bottom" Width="auto" Height="76">
<Border.Background>
<ImageBrush ImageSource="/CAP;component/Images/footer2.png" />
</Border.Background>
<TextBlock x:Name="tbFooter" Height="24" Width="auto" Margin="0,20,0,0" TextAlignment="Center" HorizontalAlignment="Stretch" VerticalAlignment="Center" Foreground="White" FontFamily="Verdana" FontSize="11">
</TextBlock>
</Border>
</Grid>
</ScrollViewer.Content>
</ScrollViewer>
</UserControl>
```
MainPage.xaml.cs
```
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Navigation;
using CAP.Code;
using CAP.Registrator;
using System.Windows.Input;
using System.ComponentModel.DataAnnotations;
using System.Windows.Browser;
using Telerik.Windows.Controls;
using System.Net;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace CAP
{
public partial class MainPage
{
public App Appvars = Application.Current as App;
private readonly RegistratorClient registrator;
public SiteMapBuilder builder;
public MainPage()
{
InitializeComponent();
sV.SetIsMouseWheelScrollingEnabled(true);
builder = new SiteMapBuilder(spSiteMap);
try
{
//working with service
}
catch
{
this.ContentFrame.Navigate(new Uri(String.Format("ErrorPage"), UriKind.RelativeOrAbsolute));
}
}
/// Recursive method to update the correct scrollviewer (if exists)
private ScrollViewer CheckParent(FrameworkElement element)
{
ScrollViewer _result = element as ScrollViewer;
if (element != null && _result == null)
{
FrameworkElement _temp = element.Parent as FrameworkElement;
_result = CheckParent(_temp);
}
return _result;
}
// If an error occurs during navigation, show an error window
private void ContentFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
{
e.Handled = true;
ChildWindow errorWin = new ErrorWindow(e.Uri);
errorWin.Show();
}
}
```
}
---
here it is a screen shot

[http://i34.photobucket.com/albums/d126/durick/1-1.gif](http://i34.photobucket.com/albums/d126/durick/1-1.gif)
| Some squares like hints in Silverlight application - how to remove them? | CC BY-SA 3.0 | null | 2010-04-08T10:13:00.960 | 2012-01-16T13:44:54.687 | 2012-01-16T13:44:54.687 | 201,078 | 339,966 | [
"silverlight",
"silverlight-4.0"
] |
2,599,326 | 1 | 2,600,292 | null | 7 | 4,082 | So I have an image like this:

I want to get something like this (I haven't drawn all lines I want but I hope you can get my idea):

I want to use SURF ( (Speeded Up Robust Features) is a robust image descriptor, first presented by in 2006 ) or something that is based on sums of 2D Haar wavelet responses and makes an efficient use of integral images for finding all straight lines on image. I want to get relative to picture pixel coords start and end points of lines.
So on this picture to find all lines between tiles and those 2 black lines on top.
Is there any such Code Example (with lines search capability) to start from?
I love C and C++ but any other readable code will probably work for me=)
| How to use Haar wavelet to detect LINES on an image? | CC BY-SA 3.0 | 0 | 2010-04-08T11:13:33.623 | 2017-08-08T00:00:25.763 | 2017-08-08T00:00:25.763 | 527,702 | 434,051 | [
"algorithm",
"image-processing",
"haar-wavelet",
"straight-line-detection"
] |
2,600,255 | 1 | null | null | 14 | 1,592 | I am trying to retrieve the monitor ID's as shown in the Windows display properties (#1, 2... etc), but I can't seem to find a way. I have tried using as well as . They both return something like "\.\DISPLAY1". However, this number doesn't always match the number shown by Windows, especially when 2 video cards are being used to drive 3 or more monitors. Is there an API call I am missing to retrieve this information, or is there a way to get it from the registry or somewhere else? Thanks!
I have tried these methods:
EnumDisplayMonitors, EnumDisplayDevices: Neither of these return monitors that aren't active, and neither one returns the correct IDs.
"select * from Win32_DesktopMonitor" doesn't return all the monitors, and there is no ID.
I have found the monitors in various locations, none of the places I found have the info I am looking for.
Any help is much appreciated. :)
These are the monitor numbers I am looking for:

| How can I retrieve monitor information? | CC BY-SA 2.5 | 0 | 2010-04-08T13:37:35.747 | 2010-04-10T00:29:45.733 | 2017-02-08T14:23:30.777 | -1 | 343 | [
".net",
"c++",
"windows",
"winapi",
"monitors"
] |
2,603,050 | 1 | 2,866,589 | null | 14 | 3,712 | I have a UISearchBar and UISearchDisplayController, everything works great but my scope selector displays beside the text field instead of below it. I know that this is the expected action when the device is in landscape, but since I have the UISearchBar in the master view of a UISplitViewController it ends up looking like this:

Is there any way to force the scope bar to display below the text field in all interface orientations (I know that this works nicely in Mail.app on the iPad, so its possibly, but who knows if Apple decided to hide the option to do so)
| Force scope bar below UISearchBar | CC BY-SA 3.0 | 0 | 2010-04-08T20:04:16.703 | 2013-11-18T15:58:04.920 | 2011-10-16T19:02:12.610 | 540,162 | 312,188 | [
"iphone",
"cocoa-touch",
"scope",
"uisearchbar",
"uisearchdisplaycontroller"
] |
2,603,748 | 1 | 2,604,661 | null | 5 | 7,626 | we are trying to implement an application using the Service Layer Pattern cause our application needs to connect to other multiple applications too, and googling on the web, we found this link of a demonstrative graphic for the "right" way of apply the pattern:
[martinfowler.com - Service Layer Pattern](http://martinfowler.com/eaaCatalog/serviceLayer.html)
But now we have a question: what if our system needs to implement some business logic, only for our application (like some maintenance data for the system itself) that we don't need to share with other systems. Based on this graphic:

As it seems, it will be unnecesary to implement a service layer just for that; it will be more practical to avoid the service layer, and just go from User Interface to the Business Layer (for example). What should be the right way in this case to implement the Service Layer Pattern? What do you suggest us for a scenario like the one I told you?
Thanks in advance.
| Service Layer Pattern - Could we avoid the service layer on a specific case? | CC BY-SA 2.5 | 0 | 2010-04-08T22:00:18.100 | 2010-04-09T01:58:21.100 | 2017-02-08T14:23:31.800 | -1 | 219,408 | [
"design-patterns"
] |
2,606,554 | 1 | null | null | 1 | 1,149 | Is it possible to use `Maven deploy:deploy-file` or similar to deploy your `main src jar snapshot` and the `test src jar snapshot` to `Archiva` so that it `results in a single entry?`
Currently I have an `Ant` project which has jars I want publishing to Archiva and here is how I am doing it:
```
<!--Main Src Jar-->
<exec executable="${maven.bin}" dir="../lib">
<arg value="deploy:deploy-file" />
<arg value="-DgroupId=com.xxx.gt" />
<arg value="-DartifactId=${ant.project.name}" />
<arg value="-Dversion=${manifest.implementation.version}-SNAPSHOT" />
<arg value="-Dpackaging=jar" />
<arg value="-Dfile=../lib/${ant.project.name}-${manifest.implementation.version}-SNAPSHOT.jar" />
<arg value="-Durl=http://archiva.xxx.com/archiva/repository/snapshots" />
<arg value="-DrepositoryId=snapshots" />
</exec>
<!--Test Src Jar-->
<exec executable="${maven.bin}" dir="../lib">
<arg value="deploy:deploy-file" />
<arg value="-DgroupId=com.xxx.gt" />
<arg value="-DartifactId=${ant.project.name}" />
<arg value="-Dversion=${manifest.implementation.version}-SNAPSHOT" />
<arg value="-Dpackaging=jar" />
<arg value="-Dfile=../lib/${ant.project.name}-${manifest.implementation.version}-SNAPSHOT-tests.jar" />
<arg value="-Durl=http://archiva.xxx.com/archiva/repository/snapshots" />
<arg value="-DrepositoryId=snapshots" />
<arg value="-Dclassifier=tests" />
</exec>
```
The above Ant script will result in `two` snapshots on `Archiva`, 1 with the `main src jar` and the other with the `test src jar`.
Using mvn deploy on a typical Maven project will group the artifacts together.
Has a sanpshot entry per deploy:deploy-file command

Has a single sanpshot entry grouping src and tests jars.

[Here's my earlier post](https://stackoverflow.com/questions/2606106/maven-deploydeploy-file-not-found-due-to-version-timestamp-appended-to-jar) which will help explain how I got to this point.
If anyone knows how to solve this I'd appreciate it.
Thank You
| Deploying non Maven based module src and tests jar to Archiva in a single transaction | CC BY-SA 2.5 | null | 2010-04-09T10:15:11.940 | 2013-10-12T20:26:14.297 | 2017-05-23T12:33:39.607 | -1 | 124,982 | [
"maven",
"archiva"
] |
2,607,787 | 1 | 2,607,819 | null | 3 | 1,822 | [This reddit](http://www.reddit.com/r/programming/comments/bogcj/1_1_3_moscow_state_university_setun_computer_from/) thread says `6 trits ~ 9.5 bits`.

| How is 6 trits equal to 9.5 bits? | CC BY-SA 2.5 | null | 2010-04-09T13:27:09.267 | 2018-02-20T10:46:24.717 | 2012-03-17T05:31:32.260 | 240,633 | 113,124 | [
"bit",
"cpu-architecture",
"ternary-representation"
] |
2,608,907 | 1 | 2,608,985 | null | 5 | 2,290 |
## Update
I don't think I was clear enough when I originally posted this quesion.
Take a look at these screenshots.

([Link to bigger screenshot here](https://dl.dropbox.com/u/674358/INotifyPropertyChanged1.jpg))
Notice the portions I've boxed in red. The class displayed here implement `INotifyPropertyChanged`, but the VB compiler seems to think that the `PropertyChanged` event as declared does not match the signature of `INotifyPropertyChanged.PropertyChanged`.

([Link to bigger screenshot here](https://dl.dropbox.com/u/674358/INotifyPropertyChanged2.jpg))
Here I've selected the offending line of code. Between this and the next screenshot I literally just the back into the file (i.e., I hit + followed by + ).

([Link to bigger screenshot here](https://dl.dropbox.com/u/674358/INotifyPropertyChanged3.jpg))
Now behold! After cutting and pasting the line back in, the error goes away.
---
## Original question
I have this happen sometimes, particularly with the `INotifyPropertyChanged` interface in my experience but I have no idea if the problem is limited to that single interface (which would seem bizarre) or not.
Let's say I have some code set up like this. There's an interface with a single event. A class implements that interface. It includes the event.
```
Public Interface INotifyPropertyChanged
Event PropertyChanged As PropertyChangedEventHandler
End Interface
Public Class Person
Implements INotifyPropertyChanged
Public Event PropertyChanged _
(ByVal sender As Object, ByVal e As PropertyChangedEventArgs) _
Implements INotifyPropertyChanged.PropertyChanged
' more code below '
End Class
```
Every now and then, when I build my project, the compiler will suddenly start acting like the above code is broken. It will report that the `Person` class does not implement `INotifyPropertyChanged` because it doesn't have a `PropertyChanged` event; or it will say the `PropertyChanged` event can't implement `INotifyPropertyChanged.PropertyChanged` because their signatures don't match.
This is weird enough as it is, but here's the weirdest part: `Event PropertyChanged` The project builds.
Does anybody have any clue what could be going on here?
| Why would the VB.NET compiler think an interface isn't implemented when it is? | CC BY-SA 2.5 | 0 | 2010-04-09T15:57:53.250 | 2010-07-08T14:56:26.473 | 2020-06-20T09:12:55.060 | -1 | 105,570 | [
"vb.net",
"compiler-construction",
"interface",
"compiler-errors",
"inotifypropertychanged"
] |
2,608,987 | 1 | 2,609,044 | null | 1 | 488 | I started noticing strange behavior when navigating the main toolbar of my Winforms application, and I don't know how to fix it. When I initially open the dropdown of the File menu, it looks like this:

I begin to scroll down each item with the arrow keys, and everything is fine until I reach "Exit". As soon as I hit the down arrow key from "Log Off", or if I hit the up arrow key from "Open", the menu rearranges itself to look like this:

I'm puzzled by this behavior. The menu still works, and from this point, if I start scrolling up, I can get the arrangement back to normal:

A few observations:
- - - [Visible](http://msdn.microsoft.com/en-us/library/system.windows.forms.toolstripitem.visible.aspx)
Can anyone help me understand what is going on, and how to fix it?
| How to fix weird scrolling/alignment behavior when using keyboard in MenuStrip? | CC BY-SA 2.5 | 0 | 2010-04-09T16:08:02.217 | 2010-04-09T16:29:44.677 | 2017-02-08T14:23:36.547 | -1 | 139 | [
"c#",
".net",
"winforms",
"user-interface"
] |
2,609,802 | 1 | 2,623,357 | null | 4 | 4,047 | This is driving me nuts. I've looked at all the [relevant MSDN tutorials](http://msdn.microsoft.com/en-us/library/dd207034.aspx) but they talk about 'data field drop zones' and how a 'Add Calculated Series' menu option should be there but , and no screenshot is provided to show what a 'data field drop zone' is. This is the menu I get when I "right-click on a field in the data field drop zone":

The frustrating thing is I know I've seen this calculated series stuff before, but I can't find it again, it's not in the 'Series Properties' dialog that I can see, and I can't find a tutorial showing how to find this feature. I'm guessing you can only have a calculated series on certain chart types, or I don't have some flag turned on or something, but I didn't see that mentioned anywhere.
Can you tell me how I can add a line showing the median of my data to a chart in Report Builder 2.0? I think I can do this by adding a 'Moving Average' via a 'Calculated Series', but I can't find how to add that.
on a different chart, the 'Add Calculated Series' menu option was available. It was a stacked column chart and the series I right-clicked on was an expression that used `RunningValue`.
| How to add moving average to Report Builder 2.0 chart | CC BY-SA 2.5 | null | 2010-04-09T18:14:24.537 | 2012-01-19T11:46:22.810 | 2010-04-12T15:46:34.073 | 38,743 | 38,743 | [
"reporting-services",
"reportbuilder"
] |
2,609,899 | 1 | 2,609,974 | null | 3 | 923 | Suppose I want to change the `orange node` in the following tree.
So, the only other change I'll need to make is in the `left pointer` of the `green node`.
The `blue node` will remain the same.

Because according to [this article](http://blog.ezyang.com/2010/04/you-could-have-invented-zippers/) (that explains [zippers](http://en.wikipedia.org/wiki/Zipper_(data_structure))), even the blue node needs to be changed.
Similarly, in this picture (recolored) from the [same article](http://blog.ezyang.com/2010/04/you-could-have-invented-zippers/), `x`

| Effects of changing a node in a binary tree | CC BY-SA 2.5 | 0 | 2010-04-09T18:29:41.303 | 2010-04-09T19:52:32.813 | 2010-04-09T19:52:32.813 | 113,124 | 113,124 | [
"algorithm",
"data-structures",
"tree",
"binary-tree",
"zipper"
] |
2,610,007 | 1 | null | null | 2 | 448 | I'm using Three20's TTTableViewController to display a sectioned table view. The datasource is a TTSectionedDataSource containing TTTableControlItems. The controls are all left aligned. I'd like to make them right aligned. Is there any way to do this without creating a custom cell?

| How do I right align controls in a TTTableControlItem? | CC BY-SA 2.5 | 0 | 2010-04-09T18:46:47.910 | 2010-10-31T14:22:01.947 | null | null | 144,776 | [
"iphone",
"three20"
] |
2,611,083 | 1 | 2,611,467 | null | 13 | 25,647 | I'm trying to accomplish the following using CSS:
```
<table border="1" width="300px">
<tr>
<td rowspan="2">This row should equal the height (no fixed-height allowed) of the 2 rows sitting to the right.</td>
<td>Here is some sample text. And some additional sample text.</td>
</tr>
<tr>
<td>Here is some sample text. And some additional sample text.</td>
</tr>
</table>
```

The examples I've seen for accomplishing this utilize fixed heights or allow the content to wrap around the left column. Is there an elegant way to accomplish this using CSS?
| CSS Equivalent of Table Rowspan with Fluid Height | CC BY-SA 2.5 | 0 | 2010-04-09T21:33:26.857 | 2013-05-03T10:31:13.950 | 2010-04-09T21:41:03.343 | 12,689 | 12,689 | [
"css",
"html-table",
"css-tables"
] |
2,612,174 | 1 | 2,612,212 | null | 0 | 505 | I have an [editor](http://github.com/iaefai/Simple-Edit) that I am making, and I need a way of editing the document's title. I was considering touching the title of the navigation item and have a custom view appear.
I did this in an initial version of the application with a button bar item (and target/action), but I cannot seem to find a way to do it with the managed navigation bar.
The alternative I was considering was putting another bar at the bottom with an item to do just that, but it doesn't seem like the best design if I don't need to do it, as it takes away from viewing space.

| How do I support the touch of the navigation bar label? | CC BY-SA 2.5 | null | 2010-04-10T03:50:18.410 | 2010-04-10T18:15:46.627 | 2010-04-10T18:15:46.627 | 30,461 | 302,253 | [
"iphone",
"cocoa-touch",
"uikit",
"uinavigationcontroller",
"uinavigationbar"
] |
2,612,194 | 1 | 2,612,570 | null | 3 | 4,435 | This is yet another questions springed from [this one](https://stackoverflow.com/questions/2605202/how-to-automate-the-padding-for-arbitary-images-using-matlab),
How do I programatically get the background color of an image?
Example:

For the above image,the background color is white.
| How to retrieve the background color of an arbitary image using MATLAB? | CC BY-SA 2.5 | 0 | 2010-04-10T03:57:37.893 | 2010-04-11T09:19:54.967 | 2017-05-23T11:53:27.663 | -1 | 198,729 | [
"matlab",
"image-processing"
] |
2,614,591 | 1 | null | null | 7 | 2,023 | Using Google Maps API v3, I was able to create multiple `google.maps.Circle` objects on my map. However, I now need to "connect" them somehow. I have the following map with multiple circles:

I now need to get it to look something like this:
[](https://i.stack.imgur.com/mbsCN.gif)
[pcwp.com](http://www.pcwp.com/images2009/ui-2.gif)
I've looked all over the Internet for solutions, but to no avail. Any ideas?
| Multiple circles -> One Polygon? | CC BY-SA 4.0 | 0 | 2010-04-10T19:12:00.127 | 2019-07-22T11:15:15.397 | 2019-07-22T11:14:32.137 | 4,751,173 | 40,644 | [
"javascript",
"google-maps",
"google-maps-api-3",
"bezier",
"geometry"
] |
2,614,936 | 1 | null | null | 18 | 71,110 | I've been racking my brain (android newbie here, so not hard to do) for awhile trying to figure out how to accomplish this:

using a RelativeLayout or something other than AbsoluteLayout which is what this was created with. I'm coming from a Windows programming background where the device adjusts the 'absolute' positioning for you and GUI layout was a non-issue.
The first layout works great in the emulator, but doesn't format for my Nexus One or any other screen that differs from the emulator size. I expected this because it's absolutely positioned, but haven't found a solution that will format correctly for different screen sizes. My goal is to have the layout work for different screen sizes and in portrait / landscape.
Here's the Code that I'm currently using: [main.xml]
```
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<Button
android:id="@+id/Button01"
android:layout_width="188px"
android:layout_height="100px"
android:text="A"
android:layout_y="50px" android:layout_x="65px" android:textSize="48sp"/>
<Button
android:id="@+id/Button02"
android:layout_width="188px"
android:layout_height="100px"
android:text="B"
android:layout_y="175px" android:layout_x="65px" android:textSize="48sp"/>
<Button
android:id="@+id/Button03"
android:layout_width="188px"
android:layout_height="100px"
android:text="C"
android:layout_y="300px" android:layout_x="65px" android:textSize="48sp"/>
</AbsoluteLayout>
```
Using tidbits from other questions here, I came up with this, it’s closer, but not there yet.
```
<?xml version="1.0" encoding="utf-8"?>
<TableLayout
android:gravity="center"
android:id="@+id/widget49"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<Button
android:id="@+id/Button01"
android:layout_width="0dip"
android:layout_weight="1"
android:text="A"
android:textSize="48sp"/>
<Button
android:id="@+id/Button02"
android:layout_width="0dip"
android:layout_weight="1"
android:text="B"
android:textSize="48sp"/>
<Button
android:id="@+id/Button03"
android:layout_width="0dip"
android:layout_weight="1"
android:text="C"
android:textSize="48sp"/>
</TableLayout>
```
Here’s a picture of the TableLayout:

Any help / guidance would be greatly appreciated.
| How to center buttons on screen horizontally and vertically plus equidistant apart? | CC BY-SA 3.0 | 0 | 2010-04-10T20:54:14.013 | 2017-11-03T19:55:20.983 | 2011-04-25T03:50:50.013 | 139,010 | 297,856 | [
"android",
"user-interface",
"layout"
] |
2,614,968 | 1 | 2,617,070 | null | 1 | 1,243 | I am trying out Silverlight's Isolated Storage feature.
Currently running Silverlight thru ASP.NET page.
I have written some code to request an additional storage but I am not being prompted to add more.
```
private void requestButton_Click(object sender, RoutedEventArgs e)
{
using (IsolatedStorageFile store =
IsolatedStorageFile.GetUserStoreForApplication())
{
if (store.AvailableFreeSpace >= 1000*1024) return;
long usedSpace = store.Quota - store.AvailableFreeSpace;
if (store.IncreaseQuotaTo(usedSpace + 1000*1024))
statusTextBlock.Text =
string.Format("Quota has been increased to {0}", store.Quota);
else
statusTextBlock.Text =
"You have denied quota increase... you Inglorious Basterd...";
}
}
```
Silverlight's `Application Storage` tab doeslist the localhost ASP.NET page hosting Silverlight as shown below.

According to the screenshot, `http://localhost:54389` has 1.0MB of available storage area.
`localhost`
What are the required steps for Silverlight to prompt users to increase quota?
| Silverlight doesn't prompt to increase quota | CC BY-SA 2.5 | null | 2010-04-10T21:02:56.870 | 2010-04-11T13:03:48.067 | 2017-02-08T14:23:38.957 | -1 | 4,035 | [
"silverlight",
"localhost",
"isolatedstorage",
"quota"
] |
2,615,781 | 1 | 2,615,845 | null | 2 | 12,029 | Like this:

the "open project" item's color is grey.
| how to open project with Java EE Eclipse? | CC BY-SA 2.5 | 0 | 2010-04-11T01:58:01.627 | 2019-07-22T13:09:40.077 | 2017-02-08T14:23:39.637 | -1 | 292,084 | [
"java",
"eclipse"
] |
2,617,762 | 1 | 2,626,360 | null | 10 | 3,242 | I don't like this ugly FileChooser layout in Linux.

This layout is used by any other program and is MUCH more beautiful.

Is this layout available in Java? If so, how?
| Alternative to JFileChooser on Linux? | CC BY-SA 3.0 | 0 | 2010-04-11T16:36:51.187 | 2014-01-05T17:07:10.780 | 2013-08-10T02:24:51.213 | 707,111 | 155,137 | [
"java",
"linux",
"swing",
"jfilechooser"
] |
2,617,979 | 1 | null | null | 2 | 1,367 | I want to take any Text sting and form from it text formed by particles in actionscript 3 (In flash \ flex) I see I need some lib for this. but all libs Ive seen do not have such functionalyty by default...
So I want to get something like this

So Is there any sych lib? or way of doing it with some lib?
It should be Free and Opensource (any license like GPL, LGPL etc will be ok).
| How to create Particles structure from text in AS3? | CC BY-SA 2.5 | null | 2010-04-11T17:36:48.597 | 2010-04-11T18:17:03.977 | 2017-02-08T14:23:40.923 | -1 | 434,051 | [
"apache-flex",
"flash",
"actionscript-3",
"text",
"particles"
] |
2,618,861 | 1 | 2,619,054 | null | 2 | 3,875 | I'm writing an an application in C# that will record audio files (*.wav) and automatically tag and name them. Wave files are RIFF files (like AVI) which can contain meta data chunks in addition to the waveform data chunks. So now I'm trying to figure out how to read and write the RIFF meta data to and from recorded wave files.
I'm using NAudio for recording the files, and asked on [their forums](http://naudio.codeplex.com/Thread/View.aspx?ThreadId=208116) as [well on SO](https://stackoverflow.com/questions/2543335/reading-writing-wav-riff-tags) for way to read and write RIFF tags. While I received a number of good answers, none of the solutions allowed for reading writing RIFF chunks as easily as I would like.
But more importantly I have very little experience dealing with files at a byte level, and think this could be a good opportunity to learn. So now I want to try writing my own class(es) that can read in a RIFF file and allow meta data to be read, and written from the file.
I've used streams in C#, but always with the entire stream at once. So now I'm little lost that I have to consider a file byte by byte. Specifically how would I go about removing or inserting bytes to and from the middle of a file? I've tried reading a file through a FileStream into a byte array (byte[]) as shown in the code below.
```
System.IO.FileStream waveFileStream = System.IO.File.OpenRead(@"C:\sound.wav");
byte[] waveBytes = new byte[waveFileStream.Length];
waveFileStream.Read(waveBytes, 0, waveBytes.Length);
```
And I could see through the Visual Studio debugger that the first four byte are the RIFF header of the file.

But arrays are a pain to deal with when performing actions that change their size like inserting or removing values. So I was thinking I could then to the byte[] into a List like this.
```
List<byte> list = waveBytes.ToList<byte>();
```
Which would make any manipulation of the file byte by byte a whole lot easier, but I'm worried I might be missing something like a class in the System.IO name-space that would make all this even easier. Am I on the right track, or is there a better way to do this? I should also mention that I'm not hugely concerned with performance, and would prefer not to deal with pointers or unsafe code blocks like [this guy](http://www.codeproject.com/KB/files/riffparser.aspx).
If it helps at all here is [a good article](http://www.sonicspot.com/guide/wavefiles.html#wavefileheader) on the RIFF/WAV file format.
| Need help manipulating WAV (RIFF) Files at a byte level | CC BY-SA 2.5 | 0 | 2010-04-11T21:58:28.143 | 2010-04-11T23:04:54.083 | 2017-05-23T12:01:15.100 | -1 | 88,427 | [
"c#",
"file-io",
"filestream",
"wav",
"riff"
] |
2,623,462 | 1 | 2,623,496 | null | 4 | 4,707 | >
[Do I need to disable NSLog before release Application?](https://stackoverflow.com/questions/2025471/do-i-need-to-disable-nslog-before-release-application)
I wonder if someone could help me setup a number of NSLog statements so they print to console when executing in "Debug Mode" but don't print in "Release Mode". I understand I need to add something like `DEBUG = 1` to the debug config in Xcode but I can't find where. Also how do I utilise this in my code?
```
NSLog(@"Print Always");
if(DEBUG) NSLog(@"Print only in debug");
```
Is there a simple way of doing this?
I tried following [this](http://iPhoneIncubator.com/blog/debugging/how-to-create-conditional-log-statements-in-xcode) but the keys now seem to be only listed under "All Settings", and are presenting as nice names. The one I should be using is GCC_PREPROCESSOR_DEFINITIONS, so I needed to find "Preprocessor Macros", select edit and add `DEBUG=1`

When you come to use this its simply a case of adding (see below) or some marco to remove the messy #ifdef / #endif tags.
```
NSLog(@"You always see me?");
#ifdef DEBUG
NSLog(@"Only in DEBUG");
#endif
```
| Suppressing NSLog statements for release? | CC BY-SA 2.5 | 0 | 2010-04-12T16:04:48.600 | 2010-04-12T21:17:00.233 | 2017-05-23T11:53:27.663 | -1 | 164,216 | [
"iphone",
"objective-c",
"cocoa",
"xcode"
] |
2,627,674 | 1 | 2,628,959 | null | 0 | 160 | Suppose, I have saved some permissions in the database by using this code:
```
RoleRepository roleRep = new RoleRepository();
Role role = new Role();
role.PermissionItems = Permission.GetList();
roleRep .SaveOrUpdate(role);
```
Now, I need this code to delete the PermissionItem(s) associated with a Role when `role.PermissionItems == null`.
Here is the code:
```
RoleRepository roleRep = new RoleRepository();
Role role = roleRep.Get(roleId);
role.PermissionItems = null;
roleRep .SaveOrUpdate(role);
```
But this is not happening.
What should be the correct way to cope with this situation?
What/how should I change, hbm-file or persistance code?

## Role.cs
```
public class Role
{
public virtual string RoleName { get; set; }
public virtual bool IsActive { get; set; }
public virtual IList<Permission> PermissionItems { get; set; }
}
```
## Role.hbm.xml
```
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="POCO" namespace="POCO">
<class name="Role" table="Role">
<id name="ID" column="ID">
<generator class="native" />
</id>
<property name="RoleName" column="RoleName" />
<property name="IsActive" column="IsActive" type="System.Boolean" />
<bag name="PermissionItems" table="Permission" cascade="all" inverse="true">
<key column="RoleID"/>
<one-to-many class="Permission" />
</bag>
</class>
</hibernate-mapping>
```
## Permission.cs
```
public class Permission
{
public virtual string MenuItemKey { get; set; }
public virtual int RoleID { get; set; }
public virtual Role Role { get; set; }
}
```
## Permission.hbm.xml
```
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="POCO" namespace="POCO">
<class name="Permission" table="Permission">
<id name="ID" column="ID">
<generator class="native"/>
</id>
<property name="MenuItemKey" column="MenuItemKey" />
<property name="RoleID" column="RoleID" />
<many-to-one name="Role" column="RoleID" not-null="true" cascade="all">
</many-to-one>
</class>
</hibernate-mapping>
```
## Repository.cs
```
......
public void SaveOrUpdate(T obj)
{
try
{
if (!_session.Transaction.IsActive)
{
_session.BeginTransaction();
_session.SaveOrUpdate(obj);
_session.Transaction.Commit();
_session.Flush();
}
else
{
throw new Exception(CustomErrorMessage.TransactionAlreayInProgress);
}
}
catch (Exception ex)
{
_session.Transaction.Rollback();
_session.Clear();
throw ex;
}
}
......
```
## RoleRepository.cs
```
public class RoleRepository : Repository<Role>, IRoleRepository
{
}
```
| NHibernate child deletion problem | CC BY-SA 2.5 | null | 2010-04-13T07:17:55.663 | 2010-04-13T11:04:55.960 | 2017-02-08T14:22:13.117 | -1 | 159,072 | [
"c#",
"nhibernate"
] |
2,629,691 | 1 | 2,630,124 | null | 0 | 3,855 | I am trying to layout a Button to the left of a TextView that is centered on the screen. My layout looks like this:
```
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="foo"
android:id="@+id/center"
/>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Left button"
android:layout_toLeftOf="@id/center" />
</RelativeLayout>
```
Unfortunately, the button just does not appear. I get the following result: 
As you see, the button doesn't show up. It works if I use layout_toRightOf, then the button appears to the right of the TextView, just as expected.
Any ideas what I am doing wrong here?
| Button laid out using layout_toLeftOf in a RelativeLayout does not show up | CC BY-SA 2.5 | null | 2010-04-13T13:03:25.710 | 2011-01-13T21:01:23.857 | 2011-01-13T21:01:23.857 | 147,463 | 112,308 | [
"java",
"android",
"layout"
] |
2,630,082 | 1 | 2,630,164 | null | 8 | 23,106 | I looked at previous post based on this but they do not relate. I am receiving the following error.
```
1>c:\users\numerical25\desktop\intro todirectx\introtodirectx\chapter 4\init direct3d\init direct3d.cpp(9) : fatal error C1083: Cannot open include file: 'd3dApp.h': No such file or directory
```
But clearly from the image shown below, its there

In oppose to other people who are having issues finding the header on the physical drive. the compiler can not find my header from within the solution explorer.
| fatal error C1083: Cannot open include file | CC BY-SA 2.5 | 0 | 2010-04-13T13:59:13.610 | 2011-03-10T21:49:26.320 | 2017-02-08T14:23:46.373 | -1 | 201,934 | [
"visual-c++",
"include",
"projects-and-solutions"
] |
2,630,492 | 1 | 2,640,535 | null | 10 | 7,122 | I’m in the situation that I have to design and implement a rather big system from the bottom. I’m having some (a lot actually) questions about the architecture that I would like your comments and thoughts on.
I don’t hope that I’ve written too much here, but I wanted to give you all an idea of what the system is.
The applications will be built on Microsoft .NET Framework 4, with a MS SQL Server 2008 database. There will be a few applications that have to access this database, such as:
- - - - -
Now my big problem is what .NET parts I should use for such a system. For the “backend” I’ve considered using Windows Communication Foundation:

Would WCF be a good choice?
The intranet application will be an application that has to edit lots of records in the database. It has to be easy to navigate using the keyboard (fast to work with). Has a feature such as “find customer, find that, lookup this, choose this and update that”. What would be the best choice to develop this application in? Would it be WPF or good old Windows Forms? I don’t need all of the fancy graphics features in WPF, like 3D, but the application has to look nice (maybe something like the new Visual Studio/Office tools).
And the same question goes for the web pages. They have much the same work to do, but not as many features as the intranet application, and not the same amount of data (much less).
That is my questions for now. I’m hoping to get a discussion going that will open my eyes to some of these technologies, helping me decide architecture to go with.
I would like to say thanks in advance, and let you all know that any thoughts will be much appreciated.
---
It seems like many agree that we should use WCF. When introducing an ORM mapper in the data layer, and a service layer using WCF, there must be a performance hit? Do you have any comments on this?
Another question that keeps popping up is how we handle authentication and roles. The intranet application has “master” access (no limitations). However, when a customer retrieves information from the web application about their users, what is returned depends on what their “service level” is and a few other parameters related to the customer. What is the best way to handle this? Are there any patterns/ best practices?
| Choosing the right .NET architecture. WCF? WPF/Forms, ASP.NET (MVC)? | CC BY-SA 2.5 | 0 | 2010-04-13T14:48:44.507 | 2010-04-14T19:51:27.763 | 2010-04-14T07:53:13.707 | 109,896 | 109,896 | [
".net",
"wpf",
"wcf",
"architecture"
] |
2,631,130 | 1 | 2,631,357 | null | 4 | 11,009 | I'm currently following a tutorial in a book, and it instructs to create a Java Web App with the Visual JavaServer Faces framework. The screenshot in the book shows both the JavaServer Faces framework the extra Visual JavaServer Faces framework. I can't seem to find the plugin / download in the netbeans plugin page, or when I google it. Has this feature been removed?
Also [this tutorial](http://web.archive.org/web/20100405081325/http://netbeans.org/kb/docs/web/helloweb.html) shows this screenshot:

Have both the frameworks been integrated into one? If so, how can I access this design screen?
Thanks
| Where is Visual Web Editor for JavaServer Faces on Netbeans | CC BY-SA 3.0 | 0 | 2010-04-13T16:04:08.743 | 2016-08-26T13:27:18.670 | 2015-06-01T22:14:22.273 | 157,882 | 304,554 | [
"java",
"jsf",
"netbeans",
"visual-editor"
] |
2,631,305 | 1 | 2,631,353 | null | 30 | 3,053 | As far as I remember, Visual Studio (both 2008 and 2010) used to have an option to break either on thrown exceptions or on unhandled exceptions. Now when I bring up the Exceptions dialog (Ctr+Alt+E), it just offers to break when an exception is thrown:

I've tried resizing to the columns in that dialog, but that did not help. Is this a bug, or am I missing something?
| Visual Studio: What happened to the "Break when an exception is unhandled" option? | CC BY-SA 3.0 | 0 | 2010-04-13T16:29:50.377 | 2014-08-08T15:16:37.540 | 2014-08-08T15:16:37.540 | 394,157 | 59,301 | [
"visual-studio",
"visual-studio-2008",
"debugging",
"exception",
"visual-studio-2010"
] |
2,632,436 | 1 | 2,632,453 | null | 4 | 5,249 | I am attempting to create a popover similar to this in an iPad app.

Does anybody know if there is a built in way to do this? Is it a UISegmentedControl inside of a UIPopoverController?
| Buttons inside of a Pop Over Controller on the iPad | CC BY-SA 2.5 | 0 | 2010-04-13T19:07:09.093 | 2010-04-14T02:37:46.077 | 2017-02-08T14:23:46.720 | -1 | 107,183 | [
"iphone",
"cocoa-touch",
"uikit",
"ipad"
] |
2,633,109 | 1 | 2,642,024 | null | 5 | 7,634 | How do I extract the parent container of a ListBoxItem?
In the following example I can go till the ListBoxItem, higher than that I get Nothing:
```
<ListBox Name="lbAddress">
<ListBox.ItemTemplate>
<DataTemplate>
<Button Click="Button_Click"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
```
---
```
Private Sub Button_Click(sender As Button, e As RoutedEventArgs)
Dim lbAddress = GetAncestor(Of ListBox) 'Result: Nothing
End Sub
```
---
```
Public Shared Function GetAncestor(Of T)(reference As DependencyObject) As T
Dim parent = GetParent(reference)
While parent IsNot Nothing AndAlso Not parent.GetType.Equals(GetType(T))
parent = GetAncestor(Of T)(parent)
End While
If parent IsNot Nothing Then _
Return If(parent.GetType Is GetType(T), parent, Nothing)
Return Nothing
End Sub
Public Function GetParent(reference As DependencyObject) As DependencyObject
Dim parent As DependencyObject = Nothing
If TypeOf reference Is FrameworkElement Then
parent = DirectCast(reference, FrameworkElement).Parent
ElseIf TypeOf reference Is FrameworkContentElement Then
parent = DirectCast(reference, FrameworkContentElement).Parent
End If
Return If(parent, VisualTreeHelper.GetParent(reference))
End Function
```
## Update
This is what happens (note that the 'parent' variable remains null):

| ListBoxItem.Parent returns nothing, unable to get it thru VisualTreeHelper.GetParent either | CC BY-SA 2.5 | null | 2010-04-13T20:53:02.880 | 2013-05-14T14:45:45.123 | 2017-02-08T14:23:47.400 | -1 | 75,500 | [
"wpf",
"xaml",
"listbox",
"listboxitem",
"visual-tree"
] |
2,636,130 | 1 | null | null | 3 | 502 | For a customer we where developing a big application that where open to all users if you will, meaning, all users could see each others data.
Now suddenly the customer is saying that they want only users belonging to the same organization to be able to view each others data.
So we came up with this data model:

So now the question is: How is it best to separate the data?
This is the only alternative I see:
-
But I feel an extra join (We have around 20 tables that needs extra join) is quite costly.
I hope there are some other best practices or solutions we can consider.
PS: This is a Web application developed using Java/JSF/Seam (but I don't know if that is relevant)
I want to clarify something. My consurn is not security but performance. We have added the foreign key to organization to all relevant tables that has shared data, and we are using user's logged in organization to filter the data.
All I want to know is if this is a good architectural solution (inner join) or if we should do something else (ie: Load all shared data, and filter in memory instead of sql join).
| What are the best practices to separate data from users | CC BY-SA 2.5 | 0 | 2010-04-14T09:07:51.840 | 2013-04-10T19:44:18.700 | 2017-02-08T14:23:48.787 | -1 | 37,298 | [
"java",
"sql",
"architecture"
] |
2,636,183 | 1 | 2,636,251 | null | 12 | 13,634 | I have to develop a customized tab control and decided to create it with WPF/XAML, because I planned to learn it anyway. It should look like this when it's finished:

I made good progress so far, but there are two issues left:
1. Only the first/last tab item should have a rounded upper-left/bottom-left corner. Is it possible to modify the style of these items, similar to the way I did with the selected tab item?
2. The selected tab item should not have a border on its right side. I tried to accomplish this with z-index and overlapping, but the results were rather disappointing. Is there any other way to do this?

XAML:
```
<Window x:Class="MyProject.TestWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="TestWindow" Height="350" Width="500" Margin="5" Background="LightGray">
<Window.Resources>
<LinearGradientBrush x:Key="SelectedBorderBrush" StartPoint="0,0" EndPoint="1,0">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="Gray" Offset="0.965"/>
<GradientStop Color="WhiteSmoke" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<Style TargetType="{x:Type TabControl}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabControl}">
<DockPanel>
<Border
Panel.ZIndex="50"
Margin="0,100,-1,0"
Background="#FFAAAAAA"
BorderBrush="Gray"
CornerRadius="7,0,0,7"
BorderThickness="1">
<TabPanel
Margin="0,0,0,0"
IsItemsHost="True" />
</Border>
<Border
Background="WhiteSmoke"
BorderBrush="Gray"
BorderThickness="1"
CornerRadius="7,7,7,0" >
<ContentPresenter
ContentSource="SelectedContent" />
</Border>
</DockPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type TabItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
<Grid>
<Border Name="Border"
Background="#FFAAAAAA"
CornerRadius="7,0,0,0"
BorderBrush="Gray"
BorderThickness="0,0,0,1"
Panel.ZIndex="50"
Margin="0,0,0,0"
>
<ContentPresenter x:Name="ContentSite"
VerticalAlignment="Center"
HorizontalAlignment="Left"
ContentSource="Header"
Margin="10,10,10,10"/>
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Panel.ZIndex" Value="100" />
<Setter Property="Margin" Value="0,0,-2,0" />
<Setter TargetName="Border"
Property="BorderBrush"
Value="{StaticResource SelectedBorderBrush}"/>
<Setter TargetName="Border"
Property="Background"
Value="WhiteSmoke" />
<Setter TargetName="Border"
Property="CornerRadius"
Value="0,0,0,0" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid>
<TabControl Name="_menuTabControl" TabStripPlacement="Left" Margin="5">
<TabItem Name="_tabItem1" Header="First Tab Item" ></TabItem>
<TabItem Name="_tabItem2" Header="Second Tab Item" >
<Grid />
</TabItem>
<TabItem Name="_tabItem3" Header="Third Tab Item" >
<Grid />
</TabItem>
</TabControl>
</Grid>
```
Edit: Thanks to Vlad, I could fix the second problem with a gradient border brush. See updates XAML for the solution.
Edit: Vlad fixed the first problem.
| WPF Customized TabControl | CC BY-SA 2.5 | 0 | 2010-04-14T09:15:55.063 | 2013-03-12T13:51:55.020 | 2010-04-14T13:07:03.337 | 11,387 | 11,387 | [
"wpf",
"xaml",
"tabcontrol",
"customization"
] |
2,637,287 | 1 | 2,637,328 | null | 3 | 383 | So there is this nice picture in the [hash maps article](http://en.wikipedia.org/wiki/Hash_map#Choosing_a_good_hash_function) on Wikipedia:

Everything clear so far, except for the in the middle.
- `1``John Smith``2``Lisa Smith`
| How does the hash part in hash maps work? | CC BY-SA 2.5 | 0 | 2010-04-14T12:28:31.793 | 2010-04-14T12:40:15.850 | 2017-02-08T14:23:49.800 | -1 | 306,136 | [
"hash",
"hashmap"
] |
2,638,163 | 1 | null | null | 2 | 327 | As stated in the title my web application builds successfully, although every time I run it in debug mode I get the following .Net error:

If I hit refresh then the application gets no more errors until I next start it up again, any ideas?
Here is my global.asax file:
```
<%@ Application Language="C#" Inherits="MyCompany.Web.MyApp.Shell.CustomWebClientApplication" %>
<script runat="server">
void Session_End(Object Sender, EventArgs e)
{
FormsAuthentication.SignOut();
}
protected void Session_Start(Object sender, EventArgs e)
{
if (Session.IsNewSession)
{
Response.Redirect(System.Web.Configuration.WebConfigurationManager.AppSettings["HomePage"]);
}
}
protected void Application_Error(Object sender, EventArgs e)
{
System.Exception oops = Server.GetLastError();
//Injection attack error handling
if (oops.GetBaseException() is System.Web.HttpRequestValidationException)
{
Response.Redirect("ErrorPage.aspx");
}
}
</script>
```
| My Visual Studio 2008 web application keeps throwing a .Net error when I first run it, but refreshing fixes it | CC BY-SA 2.5 | null | 2010-04-14T14:26:11.633 | 2010-04-14T21:35:39.197 | 2010-04-14T14:49:23.063 | 162,782 | 162,782 | [
"c#",
".net",
"asp.net"
] |
2,638,586 | 1 | 2,638,609 | null | 3 | 578 | My google search skills have failed me, and I am not a database expert by any means! I have a very simple database schema that looks like this:
[database schema http://bit.ly/adeUVL](http://bit.ly/adeUVL)
properties_id in the CANDY table is a foreign key to id in the EXPENSIVE_PROPERTIES table. The properties_id is only set the candy is expensive. If it is expensive, then the corresponding values in the EXPENSIVE_PROPERTIES table will get filled in.
When I want to get a list of the candies, I basically want to do this:
- -
In the past, I have done two queries, but this is silly since I should be able to create a view that aggregates all of the properties into one table, and just leaves the other fields blank if there isn't a corresponding id in the EXPENSIVE_PROPERTIES table.
Can anyone tell me how to create this view in SQLite? I assume it's possible, but couldn't figure it out [from the docs](http://www.sqlite.org/lang_createview.html):

The IF NOT EXISTS elements don't seem to have anything to do with the existence of a particular field value.
The question has been answered, but one thing I find weird is that in some cases I see duplicate entries. I'm using SQLite Administrator, and when I execute the CREATE VIEW statement and look in the results tab, I get unique entries. If I just do a SELECT statement, I get duplicate rows. If I create the view, and then do a SELECT * FROM myview; I also see duplicate rows. Can anyone shed some light on this? Should I create a new question?
Never mind, I found my mistake -- I had two tables after FROM, which causes the duplication.
| Creating a database view with boolean logic | CC BY-SA 2.5 | 0 | 2010-04-14T15:14:21.177 | 2010-04-14T16:04:29.283 | 2017-02-08T14:23:50.137 | -1 | 214,071 | [
"database",
"sqlite",
"view",
"boolean"
] |
2,639,281 | 1 | null | null | 40 | 4,102 | Usual rules for the code golf. Here is an implementation in python as an example
```
from PIL import Image
im = Image.new("RGB", (300,300))
for i in xrange(300):
print "i = ",i
for j in xrange(300):
x0 = float( 4.0*float(i-150)/300.0 -1.0)
y0 = float( 4.0*float(j-150)/300.0 +0.0)
x=0.0
y=0.0
iteration = 0
max_iteration = 1000
while (x*x + y*y <= 4.0 and iteration < max_iteration):
xtemp = x*x - y*y + x0
y = 2.0*x*y+y0
x = xtemp
iteration += 1
if iteration == max_iteration:
value = 255
else:
value = iteration*10 % 255
print value
im.putpixel( (i,j), (value, value, value))
im.save("image.png", "PNG")
```
The result should look like this

Use of an image library is allowed. Alternatively, you can use ASCII art. This code does the same
```
for i in xrange(40):
line = []
for j in xrange(80):
x0 = float( 4.0*float(i-20)/40.0 -1.0)
y0 = float( 4.0*float(j-40)/80.0 +0.0)
x=0.0
y=0.0
iteration = 0
max_iteration = 1000
while (x*x + y*y <= 4.0 and iteration < max_iteration):
xtemp = x*x - y*y + x0
y = 2.0*x*y+y0
x = xtemp
iteration += 1
if iteration == max_iteration:
line.append(" ")
else:
line.append("*")
print "".join(line)
```
The result
```
********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************
**************************************** ***************************************
**************************************** ***************************************
**************************************** ***************************************
**************************************** ***************************************
**************************************** ***************************************
**************************************** ***************************************
**************************************** ***************************************
*************************************** **************************************
************************************* ************************************
************************************ ***********************************
*********************************** **********************************
************************************ ***********************************
************************************* ************************************
*********************************** **********************************
******************************** *******************************
**************************** ***************************
***************************** ****************************
**************************** ***************************
************************ * * ***********************
*********************** * * **********************
******************** ******* ******* *******************
**************************** ***************************
****************************** *****************************
***************************** * * * ****************************
********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************
```
:
Rules for the ASCII art:
- - - -
Rules for the graphic:
- - -
| Code golf: the Mandelbrot set | CC BY-SA 2.5 | 0 | 2010-04-14T16:45:25.797 | 2015-04-03T16:40:06.157 | 2012-04-29T13:44:29.513 | 995,926 | 78,374 | [
"code-golf",
"rosetta-stone",
"fractals",
"mandelbrot"
] |
2,640,041 | 1 | 2,651,340 | null | 3 | 665 | When upgrading/installing a Clickonce application (Winforms, .NET SP1) the window in the taskbar looks like this:

The actual dialog of the download/install shows the app icon. How do I get it to show something other than this silly icon in the taskbar ?
| Clickonce installation/upgrade shows no icon in the taskbar | CC BY-SA 2.5 | 0 | 2010-04-14T18:35:43.520 | 2010-05-30T02:27:59.313 | null | null | 157,404 | [
".net",
"clickonce"
] |
2,640,721 | 1 | null | null | 0 | 1,024 | I've got a basic layout going in 960.gs. One line of text is absolutely positioned, starting within an inner DIV and exiting only the right side of the page.
Here's a screenshot:

The issue is that as the text appears as a series of unbroken words, if the width of the text box doesn't extend beyond the end of the page, it breaks some distance from the edge.
1. overflow: hidden; doesn't do the trick because I need to set the width wider than the page.
2. float won't work because the text can't escape the width of the inner DIV.
3. I can't set it outside the inner DIV and just position it there as the same problem will still exist.
The code is basically as simple as:
```
<wrapper (containing) DIV>
<text stripe DIV>
<p></p>
</text stripe DIV>
</ wrapper DIV>
```
I know I've done something like this before and I can't for the life of me remember what I ended up doing.
Thanks.
| CSS Width Greater then Page Width without Horizontal Scroll (overflow:hidden not an option) | CC BY-SA 2.5 | null | 2010-04-14T20:18:10.223 | 2010-04-14T23:29:51.777 | null | null | 251,158 | [
"css"
] |
2,641,526 | 1 | 2,692,975 | null | 0 | 695 | Why I'm getting these "file not found exception" errors in the IntelliTrace? The footer.ascx control is located in the "Shared" folder.
Does this mean each of my will throw 6 exceptions?

| Visual Studio 2010 IntelliTrace: Why I'm getting the file not find exception in the Asp.Net MVC | CC BY-SA 2.5 | null | 2010-04-14T22:34:14.103 | 2010-04-22T17:17:46.250 | 2017-02-08T14:23:50.863 | -1 | 52,463 | [
"model-view-controller"
] |
2,641,964 | 1 | null | null | 9 | 3,778 | I want to generate a maze that looks like this:

That is, it consists of paths in one direction that are then connected. I have looked for an algorithm to generate mazes like this without success.
Specifically, I want a maze like this:
[](https://i.stack.imgur.com/xd6ri.jpg)
because it doesn't "run" in only one direction.
Also, it would be nice if the solution of this maze required the player to "backtrack" -- i.e. not just move upwards all the time.
| Algorithm to generate a segment maze | CC BY-SA 3.0 | 0 | 2010-04-15T00:29:31.013 | 2017-08-13T09:31:17.223 | 2017-08-13T09:31:17.223 | 4,220,785 | 72,631 | [
"algorithm",
"language-agnostic",
"maze"
] |
2,642,932 | 1 | 2,643,032 | null | 2 | 2,222 | I am developing a console application. I need to emulate the way how the command line utility behaves when the F7 button is pressed, like shown below:

Is it possible in C# 2008? If not, is there any workaround available?
Any help much appreciated.
| Console Application to emulate command line | CC BY-SA 2.5 | null | 2010-04-15T05:27:16.003 | 2010-04-15T05:59:18.787 | 2017-02-08T14:23:51.877 | -1 | 120,329 | [
"c#",
"command-line"
] |
2,643,866 | 1 | null | null | 7 | 767 | I have just changed the colour scheme of my Visual Studio 2008 environment to have a dark backround with light text.
This is so much easier on the eyes.
The only problem is lines that are on the call stack... Those lines that are referred to in this thread here [in visual studio some lines of code have light grey background while debugging](https://stackoverflow.com/questions/1192680/in-visual-studio-some-lines-of-code-have-light-grey-background-while-debugging)
These lines have a bright grey background, which against my light text means I cannot read the text at all. I have been through every single colour in Tools -> Options -> Fonts and Colours and cannot find one that matches.
How can I change the background for lines on the current call stack?
Ok this is seriously doing my head in now!
I have tried with several different styles from here : [Studio Styles](http://studiostyles.info/). They all have the same problem.
I have just fired up VS2005 and I am getting the same problem.
Here is a screen shot of what is going on :

What is going on!??
| Changing the background colour of lines in the stack | CC BY-SA 2.5 | 0 | 2010-04-15T08:49:59.843 | 2011-12-21T23:34:38.427 | 2017-05-23T10:29:31.030 | -1 | 145,645 | [
"c#",
"visual-studio",
"visual-studio-2008",
"development-environment"
] |
2,644,653 | 1 | 2,644,687 | null | 0 | 152 | I have to design a database to handle forms.
Basically, a form needs to go through (exactly) 7 people, one by one. Each person can either agree or decline a form.
If one declines, the chain stops and the following people don't even get notified that there a form.
Right now I have thought of those 3 tables: FORM, PERSON, and RESPONSE inbetween. However, my first solution sounds too heavy because each form could have up to 7 responses.

Here we are with the table inbetween. That means that each successful form has 7 rows in the table RESPONSE.

Here we have the responding information directly inside the form. It looks ugly but at least keeps everything as singular as possible. On the bad side I can't track the response dates, but I don't think it is crucial for that matter.
What is your opinion on this? I feel like both of them are wrong and I don't know how to fix that.
If that matters, I'll be using Oracle 9.
| Database design problem: intermediate table between 2 tables may end up with too many results | CC BY-SA 2.5 | null | 2010-04-15T11:02:56.660 | 2010-04-15T11:09:42.950 | 2017-02-08T14:23:52.883 | -1 | 223,753 | [
"database-design",
"oracle9i"
] |
2,647,051 | 1 | 2,647,792 | null | 1 | 11,872 | I am using the tutorial on [this MSDN link](http://msdn.microsoft.com/en-us/library/aa366551(v=VS.85).aspx) to implement a way of transferring data from one process to another. Although I was advised in an [earlier question](https://stackoverflow.com/questions/2641354/using-createfilemapping-between-two-programs-c) to use the Pipe methods, due to certain constraints I have no choice but to use the CreateFileMapping method.
Now, i've succesfully managed to make two seperate window form projects within the same solution and by editing some properties both of the forms load at the same time.
Furthermore I have managed to implement the code given in the MSDN sample into the first (Producer) and second (Consumer) program without any compilation errors.
The problem I am having now is when I run the first program and try to create the handle to the mapped file, I am given an error saying it was unsuccesful and I do not understand why this is happening.
I have added both the Producer and Consumer code files to demonstrate what I am trying to do.
:
```
#include <windows.h>
#include <stdio.h>
#include <conio.h>
//File header definitions
#define IDM_FILE_ROLLDICE 1
#define IDM_FILE_QUIT 2
#define BUF_SIZE 256
TCHAR szName[]=TEXT("Global\\MyFileMappingObject");
TCHAR szMsg[]=TEXT("Message from first process!");
void AddMenus(HWND);
LRESULT CALLBACK WindowFunc(HWND, UINT, WPARAM, LPARAM);
////Standard windows stuff - omitted to save space.
//////////////////////
// WINDOWS FUNCTION //
//////////////////////
LRESULT CALLBACK WindowFunc(HWND hMainWindow, UINT message,
WPARAM wParam, LPARAM lParam)
{
WCHAR buffer[256];
LPCTSTR pBuf;
struct DiceData storage;
HANDLE hMapFile;
switch(message)
{
case WM_CREATE:
{
// Create Menus
AddMenus(hMainWindow);
}
break;
case WM_COMMAND:
// Intercept menu choices
switch(LOWORD(wParam))
{
case IDM_FILE_ROLLDICE:
{
//Roll dice and store results in variable
//storage = RollDice();
////Copy results to buffer
//swprintf(buffer,255,L"Dice 1: %d, Dice 2: %d",storage.dice1,storage.dice2);
////Show via message box
//MessageBox(hMainWindow,buffer,L"Dice Result",MB_OK);
hMapFile = CreateFileMapping(
(HANDLE)0xFFFFFFFF, // use paging file
NULL, // default security
PAGE_READWRITE, // read/write access
0, // maximum object size (high-order DWORD)
BUF_SIZE, // maximum object size (low-order DWORD)
szName); // name of mapping object
if (hMapFile == NULL)
{
MessageBox(hMainWindow,L"Could not create file mapping object",L"Error",NULL);
return 1;
}
pBuf = (LPTSTR) MapViewOfFile(hMapFile, // handle to map object
FILE_MAP_ALL_ACCESS, // read/write permission
0,
0,
BUF_SIZE);
if (pBuf == NULL)
{
MessageBox(hMainWindow,L"Could not map view of file",L"Error",NULL);
CloseHandle(hMapFile);
return 1;
}
CopyMemory((PVOID)pBuf, szMsg, (_tcslen(szMsg) * sizeof(TCHAR)));
_getch();
UnmapViewOfFile(pBuf);
CloseHandle(hMapFile);
}
break;
case IDM_FILE_QUIT:
SendMessage(hMainWindow, WM_CLOSE, 0, 0);
break;
}
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
}
return DefWindowProc(hMainWindow, message, wParam, lParam);
}
//
//Setup menus
//
```
:
```
#include <windows.h>
#include <stdio.h>
#include <conio.h>
//File header definitions
#define IDM_FILE_QUIT 1
#define IDM_FILE_POLL 2
#define BUF_SIZE 256
TCHAR szName[]=TEXT("Global\\MyFileMappingObject");
//Prototypes
void AddMenus(HWND);
LRESULT CALLBACK WindowFunc(HWND, UINT, WPARAM, LPARAM);
//More standard windows creation, again omitted.
//////////////////////
// WINDOWS FUNCTION //
//////////////////////
LRESULT CALLBACK WindowFunc(HWND hMainWindow, UINT message,
WPARAM wParam, LPARAM lParam)
{
HANDLE hMapFile;
LPCTSTR pBuf;
switch(message)
{
case WM_CREATE:
{
// Create Menus
AddMenus(hMainWindow);
break;
}
case WM_COMMAND:
{
// Intercept menu choices
switch(LOWORD(wParam))
{
case IDM_FILE_POLL:
{
hMapFile = OpenFileMapping(
FILE_MAP_ALL_ACCESS, // read/write access
FALSE, // do not inherit the name
szName); // name of mapping object
if (hMapFile == NULL)
{
MessageBox(hMainWindow,L"Could not open file mapping object",L"Error",NULL);
return 1;
}
pBuf = (LPTSTR) MapViewOfFile(hMapFile, // handle to map object
FILE_MAP_ALL_ACCESS, // read/write permission
0,
0,
BUF_SIZE);
if (pBuf == NULL)
{
MessageBox(hMainWindow,L"Could not map view of file",L"Error",NULL);
CloseHandle(hMapFile);
return 1;
}
MessageBox(NULL, pBuf, TEXT("Process2"), MB_OK);
UnmapViewOfFile(pBuf);
CloseHandle(hMapFile);
break;
}
case IDM_FILE_QUIT:
SendMessage(hMainWindow, WM_CLOSE, 0, 0);
break;
}
break;
}
case WM_DESTROY:
{
PostQuitMessage(0);
break;
}
}
return DefWindowProc(hMainWindow, message, wParam, lParam);
}
//
//Setup menus
//
```
It's by no means tidy and final but it's just a start, thanks for any help.


| Error using CreateFileMapping - C | CC BY-SA 2.5 | 0 | 2010-04-15T16:16:00.950 | 2015-12-01T10:15:33.950 | 2017-05-23T11:53:27.663 | -1 | 218,159 | [
"c",
"winapi"
] |
2,647,570 | 1 | 2,648,439 | null | 3 | 367 | Our application allows administrators to add “User Properties” in order for them to be able to tailor the system to match their own HR systems. For example, if your company has departments, you can define “Departments” in the Properties table and then add values that correspond to “Departments” such as “Jewelry”, “Electronics” etc… You are then able to assign a department to users.
Here is the schema:
[mindgravy.net](http://www.mindgravy.net/wp-content/uploads/2010/04/image.png)
In this schema, a User can have only one UserPropertyValue per Property, but doesn’t have to have a value for the property.
I am trying to build a query that will be used in SSRS 2005 and also have it use the PropertyValues as the filter for users. My query looks like this:
```
SELECT UserLogin, FirstName, LastName
FROM Users U
LEFT OUTER JOIN UserPropertyValues UPV
ON U.ID = UPV.UserID
WHERE UPV.PropertyValueID IN (1, 5)
```
When I run this, if the user has ANY of the property values, they are returned. What I would like to have is where this query will return users that have values BY PROPERTY.
So if PropertyValueID = 1 is of Department (Jewelry), and PropertyValueID = 5 is of EmploymentType (Full Time), I want to return all users that are in Department Jewelry that are EmployeeType of Full Time, can this be done?
---
Here's a full data example:
- - -
My query should only return User A using the above query
### UPDATE:
I should state that this query is used as a dataset in SSRS, so the parameter passed to the query will be @PropertyIDs and it is defined as a multi-value parameter in SSRS.
`WHERE UPV.PropertyValueID IN (@PropertyIDs)`
| Where clause on joined table used for user defined key/value pairs | CC BY-SA 4.0 | null | 2010-04-15T17:27:47.963 | 2019-07-23T05:08:23.913 | 2019-07-23T05:08:23.913 | 4,751,173 | 3,256 | [
"sql-server-2005",
"tsql",
"reporting-services"
] |
2,648,079 | 1 | null | null | 1 | 440 | I'm currently struggling with implementing text floating in TLF. It does not support it natively, and the only solution I've found so far is to use linked containers and then combine controllers using flowComposer for single textFlow.
However, I need to implement Dropped Initial letter feature in my column layout. Initial is just a first big letter in paragraph, floated by the rest of the text. It looks like this -

The issue here is that for that big letter, the resulting TLF textFlow sprite is bigger than the actual letter. It's because of the baselines (small q vs big A for example). But I don't want these extra gaps. After textFlow is rendered, I would like to learn how big the resulting letter exactly is (in pixels) so that I can crop/shift baseline, etc.
ContainerController.getContentBounds().height or
ContainerController.compositionHeight
gives me height of whole sprite with gaps added, not the letter.
Is there some kind of measure method for this?
Can this be solved differently?
| Getting rendered font dimensions in Adobe Text Layout Framework | CC BY-SA 2.5 | 0 | 2010-04-15T18:45:37.207 | 2013-09-22T00:57:48.877 | 2017-02-08T14:23:54.947 | -1 | 57,157 | [
"apache-flex",
"flash",
"tlf"
] |
2,648,838 | 1 | 2,648,919 | null | 2 | 5,913 | We are building a new SharePoint 2007 web site to replace our intranet website for the company I work for, and a common debate keeps coming up. Specifically, should we be using multiple document libraries (ex. 1 for each department), or one document library with multiple folders within (ex. 1 library with 1 folder for each department).
I know the benefits of using one document library and using custom views to organize the documents by utilizing custom columns (like department, purpose, location, etc).
Also, authorization can be set at either the document library or the folder level, so that does not seem to benefit either choice.
It would also seem that a single document could appear in multiple views in the same document library, but the document would have to be copied to other document libraries if that strategy is used.
The current plan is to use one document library for all organization documents, and then put a bunch of folders within, that symbolize the organization's structure. This would make it easy for a user to upload a document to their own organizational folder (with privileges assigned to that folder before hand). Then, when adding the document, they would choose custom column fields to identify the document and "tag" it, that will enable the custom views to filter the document into multiple views (like departmental, purpose, etc).
I don't think views are applicable for linking multiple document libraries to show their contents.
Anyway, the main question is:
Is there any benefit of using multiple document libraries vs. 1 document library with multiple folders?
Here is a diagram, explaining what I want to do:

Thanks!
| SharePoint 2007 Document Libraries vs. Folders | CC BY-SA 2.5 | null | 2010-04-15T20:43:10.760 | 2012-01-27T17:53:21.443 | 2010-04-15T20:56:00.440 | 173,723 | 173,723 | [
"sharepoint-2007",
"wss-3.0",
"sharepointdocumentlibrary"
] |
2,649,544 | 1 | 2,649,560 | null | 59 | 24,057 | I want to build a Python function that calculates,

and would like to name my summation function Σ. In a similar fashion, would like to use Π for product, and so on. I was wondering if there was a way to name a python function in this fashion?
```
def Σ (..):
..
..
```
That is, does Python support unicode identifiers, and if so, could someone provide an example for it?
Thanks!
---
Original motivation for this was a piece of Clojure code I saw today that looks like,
```
(defn entropy [X]
(* -1 (Σ [i X] (* (p i) (log (p i))))))
```
where Σ is a macro defined as,
```
(defmacro Σ
... )
```
and I thought that was pretty cool.
---
BTW, to address a couple of comments about readability - with a lot of stats/ML code for instance, being able to compose operations with symbols would be really helpful. (Especially for really complex integrals et al)
```
φ(z) = ∫(N(x|0,1,1), -∞, z)
```
vs
```
Phi(z) = integral(N(x|0,1,1), -inf, z)
```
or even just the lambda character for lambda()!
| Unicode identifiers in Python? | CC BY-SA 2.5 | 0 | 2010-04-15T22:52:31.857 | 2022-04-13T23:50:47.527 | 2017-02-08T14:23:56.320 | -1 | 98,975 | [
"python",
"unicode",
"identifier"
] |
2,649,781 | 1 | null | null | 21 | 21,458 |
OK here's my problem, I'm generating a graph of a python module, including all the files with their functions/methods/classes.
I want to arrange it so, that nodes gather in circles around their parent nodes, currently everything is on one gargantuan horizontal row, which makes the thing >50k pixels wide and also let's the svg converter fail(only renders about the half of the graph).
I went through the [docs](http://www.graphviz.org/doc/info/attrs.html) but couldn't find anything that seems to do the trick.
So the question is:
Is there a simple way to do this or do I have to layout the whole thing by myself? :/
Thanks to Andrews comment I've got the right layout, the only problem now is that it's a bit to "compact"... so the question now is, how to fix this?

| Graphviz DOT arrange Nodes in circles, layout too "compact" | CC BY-SA 3.0 | 0 | 2010-04-16T00:00:30.847 | 2018-07-20T02:31:42.010 | 2017-02-08T14:23:56.653 | -1 | 170,224 | [
"layout",
"graph",
"graphviz",
"dot"
] |
2,650,626 | 1 | null | null | 0 | 89 | I need to replicate the following in ASP.NET WebForms using a GridView.

But I am not sure where to start. Basically I need 3 columns. The checkbox (which sometimes needs to be disabled), and 2 standard text columns.
I've gone through the tutorial and I can see how to basically dump text data into a GridView, but not clear on how to implement checkboxes, particularly ones that needs to be disabled once in a while.
And I have to replicate the style of the screenshot (e.g. border on the bottom). Having trouble with that as well.
How do I swing something like that?
| How to replicate this screenshot in WebForms? | CC BY-SA 2.5 | null | 2010-04-16T04:33:10.660 | 2010-04-16T04:36:04.743 | null | null | 9,382 | [
"c#",
"asp.net",
"gridview",
"checkbox",
"coding-style"
] |
2,652,777 | 1 | 2,652,859 | null | 6 | 33,787 | I want to create a html table with a 1pt black outer border and the same border around every td.
Should look like this (only the borders, of course)

I use
```
<table border="1" style="border-collapse:collapse; border-color:Black; border-style:solid; border-width:1pt">
```
As a result I get a black outer, but grey inner borders.
| Table with black outer, but grey inner border | CC BY-SA 3.0 | 0 | 2010-04-16T12:12:33.450 | 2017-05-28T13:42:59.523 | 2017-05-28T13:42:59.523 | 4,370,109 | 182,542 | [
"html",
"css",
"html-table",
"border"
] |
2,653,694 | 1 | null | null | 6 | 2,197 | I'm interested making an implementation of the [14-15 puzzle](http://en.wikipedia.org/wiki/Fifteen_puzzle):

I'm creating an array with the values 0 - 15 in increasing order:
S = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }
Now, what I want to do is shuffle them to create a new instance of the puzzle. However, I know that if I create a board with an "odd permutation" than it is unsolvable.
Wikipedia says I need to create the puzzle with an even permutation. I believe this means that I simply have to do ensure I do an even number of swaps?
How would I modify Fisher-Yates so I ensure I end up with an even permutation at the end? If I do a swap for every element in the array that would be 16 swaps which I believe would be an even permutation. However, do I need to be concerned about swapping with itself? Is there any other way to ensure I have a valid puzzle?
| How can I ensure that when I shuffle my puzzle I still end up with an even permutation? | CC BY-SA 2.5 | 0 | 2010-04-16T14:31:03.030 | 2020-02-27T17:35:03.067 | 2017-02-08T14:23:57.673 | -1 | 88,470 | [
"puzzle",
"permutation",
"shuffle"
] |
2,653,812 | 1 | null | null | 10 | 3,178 | I am using Dundas Maps and attempting to draw a map of the world where countries are grouped into regions that are specific to a business implementation.
I have shape data (points and segments) for each country in the world. I can combine countries into regions by adding all points and segments for countries within a region to a new region shape.
```
foreach(var region in GetAllRegions()){
var regionShape = new Shape { Name = region.Name };
foreach(var country in GetCountriesInRegion(region.Id)){
var countryShape = GetCountryShape(country.Id);
regionShape.AddSegments(countryShape.ShapeData.Points, countryShape.ShapeData.Segments);
}
map.Shapes.Add(regionShape);
}
```
The problem is that the country border lines still show up within a region and I want to remove them so that only regional borders show up.
Dundas polygons must start and end at the same point. This is the case for all the country shapes. Now I need an algorithm that can:
- - -
Below is where I have gotten to so far with the map. You can see that the country borders still need to be removed. For example, the border between Mongolia and China should be discarded whereas the border between Mongolia and Russia should be retained.
The reason I need to retain a regional border is that the region colors will be significant in conveying information but adjacent regions may be the same color. The regions can change to include or exclude countries and this is why the regional shaping must be dynamic.
I now know that I what I am looking for is a UNION of polygons. David Lean [explains how to do it](http://blogs.msdn.com/davidlean/archive/2008/10/25/sql-2008-spatial-samples-part-n-2-on-n-geometric-set-theory-methods.aspx) using the spatial functions in SQL Server 2008 which might be an option but my efforts have come to a halt because the resulting polygon union is so complex that SQL truncates it at 43,680 characters. I'm now trying to either find a workaround for that or find a way of doing the union in code.

| Grouping geographical shapes | CC BY-SA 2.5 | 0 | 2010-04-16T14:46:14.167 | 2010-04-24T02:31:51.480 | 2017-02-08T14:23:58.013 | -1 | 68,115 | [
"c#",
"algorithm",
"geometry",
"geography",
"dundas"
] |
2,655,155 | 1 | 2,655,270 | null | 1 | 650 | I have a function that takes longitude and latitude and converts it to x and y to be plotted. The conversion to X and Y is working fine and that is not what I have the problem with.
I want to ensure that two points are not plotted in the same place. In one set of results there are about 30 on top of each other (because they have the same latitude and longitude), this number could be a lot larger.
At the moment I am trying to achieve this by moving points to the left, right, top or bottom of the point to make a square. Once a square made up of points has been drawn, then moving to the next row on and drawing another square of points around the previous square.
The code is Javascript but it is very generic so I guess it's slightly irrelevant.
My code is as follows:
```
var prevLong, prevLat, rand = 1, line = 1, spread = 8, i = 0;
function plot_points(long, lat){
// CODE HERE TO CONVERT long and lat into x and y
// System to not overlap the points
if((prevLat == lat) && (prevLong == long)) {
if(rand==1) {
x += spread*line;
} else if(rand==2) {
x -= spread*line;
} else if(rand==3) {
y += spread*line;
} else if(rand==4) {
y -= spread*line;
} else if(rand==5) {
x += spread*line;
y += spread*line;
} else if(rand==6) {
x -= spread*line;
y -= spread*line;
} else if(rand==7) {
x += spread*line;
y -= spread*line;
} else if(rand==8) {
x -= spread*line;
y += spread*line;
// x = double
} else if(rand==9) {
x += spread*line;
y += spread;
} else if(rand==10) {
x += spread;
y += spread*line;
} else if(rand==11) {
x -= spread*line;
y -= spread;
} else if(rand==12) {
x -= spread;
y -= spread*line;
} else if(rand==13) {
x += spread*line;
y -= spread;
} else if(rand==14) {
x += spread;
y -= spread*line;
} else if(rand==15) {
x += spread*line;
y -= spread;
} else if(rand==16) {
x += spread;
y -= spread*line;
} else if(rand==17) {
x -= spread*line;
y += spread;
} else if(rand==18) {
x -= spread;
y += spread*line;
} else if(rand==19) {
x -= spread*line;
y += spread;
} else if(rand==20) {
x -= spread;
y += spread*line;
}
if(rand == 20) {rand = 1; line++; } else { rand++; }
i++
} else {
line = 1;
i = 0;
}
prevLat = latitude;
prevLong = longitude;
return [x,y];
}
```
This is the output: 
It isn't working correctly and I don't even know if I am approaching the problem in a correct way at all.
Has anyone had to do this before? What method would you suggest?
| Plotting points so that they do not overlap if they have the same co-ordinates | CC BY-SA 2.5 | 0 | 2010-04-16T18:01:45.730 | 2010-04-20T07:13:47.280 | null | null | 239,241 | [
"javascript",
"plot",
"overlap",
"points"
] |
2,656,601 | 1 | 2,657,402 | null | 3 | 1,007 | I have a simple raytracer that only works back up to the first intersection. The scene looks OK with two different light sources, but when both lights are in the scene, there are dark shadows where the lit area from one ends, even if in the middle of a lit area from the other light source (particularly noticeable on the green ball). The transition from the 'area lit by both light sources' to the 'area lit by just one light source' seems to be slightly darker than the 'area lit by just one light source'.

The code where I'm adding the lighting effects is:
```
// trace lights
for ( int l=0; l<primitives.count; l++) {
Primitive* p = [primitives objectAtIndex:l];
if (p.light)
{
Sphere * lightSource = (Sphere *)p;
// calculate diffuse shading
Vector3 *light = [[Vector3 alloc] init];
light.x = lightSource.centre.x - intersectionPoint.x;
light.y = lightSource.centre.y - intersectionPoint.y;
light.z = lightSource.centre.z - intersectionPoint.z;
[light normalize];
Vector3 * normal = [[primitiveThatWasHit getNormalAt:intersectionPoint] retain];
if (primitiveThatWasHit.material.diffuse > 0)
{
float illumination = DOT(normal, light);
if (illumination > 0)
{
float diff = illumination * primitiveThatWasHit.material.diffuse;
// add diffuse component to ray color
colour.red += diff * primitiveThatWasHit.material.colour.red * lightSource.material.colour.red;
colour.blue += diff * primitiveThatWasHit.material.colour.blue * lightSource.material.colour.blue;
colour.green += diff * primitiveThatWasHit.material.colour.green * lightSource.material.colour.green;
}
}
[normal release];
[light release];
}
}
```
How can I make it look right?
| Why do my raytraced spheres have dark lines when lit with multiple light sources? | CC BY-SA 2.5 | 0 | 2010-04-16T23:27:09.237 | 2010-04-17T10:12:16.593 | null | null | 41,742 | [
"objective-c",
"raytracing"
] |
2,658,066 | 1 | 2,658,082 | null | 1 | 139 | If we keep tag name within selectors.
For example:
```
#divMainContentBody { … }
.spanImportant { … }
```
This minimizes the need to switch between your stylesheet and your markup, since the ID and class already tells you what element type it is referring to.
---

I found this advise in [this book](http://oreilly.com/catalog/9780596522315/) also [http://answers.oreilly.com/topic/647-how-to-write-efficient-css-selectors/](http://answers.oreilly.com/topic/647-how-to-write-efficient-css-selectors/)
> Don’t qualify ID selectors```
Because there is only one element in the page with a given ID, there’s
```
no need to add additional qualifiers.
For example, DIV #toc is unnecessary
and should be simplified to #toc.Don’t qualify class selectors```
Instead of qualifying class selectors for specific tags, extend
```
the class name to be specific to the
use case. For example, change LI
.chapter to .li-chapter, or better
yet, .list-chapter.
| is it good idea to remember html tags in css classes and Ids? | CC BY-SA 2.5 | null | 2010-04-17T10:42:10.150 | 2010-04-17T11:08:39.677 | 2017-02-08T14:23:59.047 | -1 | 84,201 | [
"css",
"xhtml",
"semantic-markup"
] |
2,658,717 | 1 | 2,658,947 | null | 7 | 1,180 | Greetings,
I'm working on a game project that uses a 3D variant of hexagonal tile maps. Tiles are actually cubes, not hexes, but are laid out just like hexes (because a square can be turned to a cube to extrapolate from 2D to 3D, but there is no 3D version of a hex). Rather than a verbose description, here goes an example of a 4x4x4 map:

I have a struct type to represent tiles, and maps are represented as a 3D array of tiles (wrapped in a `Map` class to add some utility methods, but that's not very relevant).
Each tile is supposed to represent a cubic space, and they are all the same size. Also, the offset between adjacent "rows" is half the size of a tile.
That's enough context; my question is:
`A``B``A``B`
That would later be used for a variety of purposes, such as determining Line-of-sight, charge path legality, and so on.
BTW, this may be useful: my maps use the (0,0,0) as a reference position. The 'jagging' of the map can be defined as offsetting each tile `((y+z) mod 2) * tileSize/2.0` to the right from the position it'd have on a "sane" cartesian system. For the non-jagged rows, that yields 0; for rows where `(y+z) mod 2` is 1, it yields 0.5 tiles.
I'm working on C#4 targeting the .Net Framework 4.0; but I don't really need specific code, just the algorithm to solve the weird geometric/mathematical problem. I have been trying for several days to solve this at no avail; and trying to draw the whole thing on paper to "visualize" it didn't help either :( .
Thanks in advance for any answer
| Raytracing (LoS) on 3D hex-like tile maps | CC BY-SA 2.5 | 0 | 2010-04-17T14:41:50.260 | 2010-04-18T19:19:54.187 | 2017-02-08T14:24:00.087 | -1 | 236,810 | [
"algorithm",
"language-agnostic",
"geometry",
"raytracing",
"hexagonal-tiles"
] |
2,659,511 | 1 | 2,659,773 | null | 0 | 80 | This is a follow on from my [previous question](https://stackoverflow.com/questions/2647051/error-using-createfilemapping-c) although this is about something else.
I've been having a problem where for some reason my message that I pass from one process to another only displays the first letter, in this case "M".
My application based on a [MSDN sample](http://msdn.microsoft.com/en-us/library/aa366551(v=VS.85).aspx) so to make sure I hadn't missed something I create a separate solution, added the MSDN sample (without any changes for my needs) and unsurprisingly it works fine.
Now for the weird bit, when I run the MSDN sample running (as in debugging) and have my own application running, the text prints out fine without any problems. The second I run my on its own without the original MSDN sample being open it fails to work and only shows an "M".
I've looked in the debugger and don't seem to notice anything suspicious (it's a slightly dated picture, I've fixed the data type inconsistency).

Can anyone provide a solution as to this? I've never encountered anything like this before.
To look at my source code it's easier to just look at the link I posted at the top of the question, there's no point in me posting it twice.
Thank you for any help.
After further investigation it almost seems that my own application is somehow reading the other applications memory by accident. If I "poll" for the message without even sending it via the producer window, it still gets the message which must mean it's reading it from the other (MSDN) process, this would also explain why it only works properly when I run the MSDN sample first.
I still don't understand why this happens, how to stop it and how to fix it, this is possibly the strangest thing I've come across.
****Solution:****
Although it does not fix the problem of both applications affecting each other I have managed to fix the text problem. I did not add the necessary #include to both files, adding this fixed it without any warnings.
It's always the little things.
| Applications result affected by another running application | CC BY-SA 2.5 | null | 2010-04-17T18:36:56.650 | 2010-04-18T01:10:20.933 | 2017-05-23T12:24:21.783 | -1 | 218,159 | [
"c",
"winapi",
"visual-studio-express"
] |
2,659,505 | 1 | 4,337,266 | null | 10 | 9,626 | How do you change the font face and font size used by the [Windows Ribbon Framwork](https://learn.microsoft.com/en-us/windows/win32/windowsribbon/-uiplat-windowsribbon-entry)'s UIRibbon?
The font used by the ribbon does not match the font the user has chosen as their Windows preferences - which is the preference my application uses. This means that as the font in Windows gets bigger, the ribbon gets smaller.
Notice how the ribbon gets smaller in each screenshot:
## Segoe UI 9pt (Windows default)

## Segoe UI 12pt (what i use)

## Segoe UI 16pt (what customer's use)

You can see by the time we get to 16pt, the text on the ribbon is quite hard to read.
## Background
The user can configure Windows to use their preferred , e.g.:
- - -
and their preferred , e.g.:
- - - - -
but the by default uses a font that is the user's preference.
Moved picture up top to catch squirrels attracted by shiny things.
Added another colorful picture, to get a bump.
Editing to get a bump
Adding another different picture to get a bump
---
The ribbon does allow customizing the of the ribbon.
The following code fragment is used to set the `UI_PKEY_GlobalBackgroundColor` of the ribbon. In this case i use a color that is the user's currently select Aero color scheme:
```
IUIFramework framework;
...
TColor glass = Dwm.GetColorizationColor();
VarCast(v, ColorToUIHSB(glass), UI_PKEY_GlobalBackgroundColor.pid);
IPropertyStore ps = framework as IPropertyStore;
ps.SetValue(UI_PKEY_GlobalBackgroundColor, PROPVARIANT(v));
ps.Commit;
```
And now the ribbon is now colored to match the color scheme of Windows:
[](https://i.stack.imgur.com/H2EoH.png)
But i can't find the option to change the font face/size.
While the ribbon honor the user's DPI settings, that isn't question.
---
## It works in Outlook 2010
It might be helpful to note that Outlook 2010's ribbon does honor the user's (menu) font preferences. You can get the user's menu font by calling `[SystemParametersInfo][6]`:
```
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0));
ncm.lfMenuFont <---
```
## 9pt Outlook 2010

## 12pt Outlook 2010

## 12pt Outlook 2010

Notice the ribbon increases in size with the font size? (Which, in these resized screenshots, means that the ribbon does not get perceptually smaller.)
There are two possibilities:
- -
## Windows 7 Paint doesn't work
It's also useful to note that Windows Paint in Windows 7 does honor the user's font preferences. This leads me to believe that it (mspaint) does use the Windows Ribbon Framework, and that the Windows Ribbon Framework doesn't support setting a font size. If if you've actually tried to be helpful, and read all the way down to here, you'll realize this is the correct answer: it's not possible. So if you want a free 300 rep, you add that as an answer.
[Cross-posted to Microsoft](https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/2c6def3a-9a42-4da1-8fda-046885dd0782/windows-ribbon-framework-how-to-change-font-face-and-size?forum=windowsribbondevelopment)
Windows Ribbon Framework, change font size, UIRibbon, font face, ribbon ui, scenic ui, scenic ribbon, fluent ribbon, fluent ui, change font windows ribbon, uiribbon.h
Microsoft has a number of Ribbon implementations:
- [Windows Ribbon Framework](https://learn.microsoft.com/en-us/windows/win32/windowsribbon/-uiplat-windowsribbon-entry)- [CMFCRibbonBar for MFC](https://learn.microsoft.com/en-us/cpp/mfc/reference/cmfcribbonbar-class?view=vs-2019)- [Ribbon (WPF)](https://learn.microsoft.com/en-us/previous-versions/ff799534(v=vs.110))- [ribbon.codeplex.com](https://archive.codeplex.com/?p=ribbon)
---
## MS Paint doesn't honor menu font preference
Here's a screenshot showing my configured Windows 7 setting of 12pt, with msPaint visible, and Outlook 2010 visible for comparison.

---
## Sample Code
```
type
TfrmRibbonTest = class(TForm, IUIApplication)
...
private
Fframework: IUIFramework;
{IUIApplication}
function OnViewChanged(viewId: SYSUINT; typeID: UI_VIEWTYPE; const view: IUnknown; verb: UI_VIEWVERB; uReasonCode: SYSINT): HResult; stdcall;
function OnCreateUICommand(commandId: SYSUINT; typeID: UI_COMMANDTYPE; out commandHandler: IUICommandHandler): HResult; stdcall;
function OnDestroyUICommand(commandId: SYSUINT; typeID: UI_COMMANDTYPE; const commandHandler: IUICommandHandler): HResult; stdcall;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
hr: HRESULT;
begin
Fframework := CreateComObject(CLASS_UIRibbonFramework) as IUIFramework;
hr := Fframework.Initialize(Self.Handle, Self); //we implement IUIApplication
OleCheck(hr);
hr := Fframework.LoadUI(hInstance, 'APPLICATION_RIBBON');
OleCheck(hr);
end;
function TfrmRibbonTest.OnCreateUICommand(commandId: SYSUINT; typeID: UI_COMMANDTYPE; out commandHandler: IUICommandHandler): HResult;
begin
Result := S_OK;
end;
function TfrmRibbonTest.OnDestroyUICommand(commandId: SYSUINT; typeID: UI_COMMANDTYPE;
const commandHandler: IUICommandHandler): HResult;
begin
Result := S_OK;
end;
function TfrmRibbonTest.OnViewChanged(viewId: SYSUINT; typeID: UI_VIEWTYPE; const view: IUnknown; verb: UI_VIEWVERB; uReasonCode: SYSINT): HResult;
begin
Result := S_OK;
end;
```
## Windows Ribbon Framework 14pt != 14pt
Here is a screenshot with Windows font configured for 14pt (on a 96dpi machine). Outlook 2010 is 14pt, Photoshop CS3 is 14pt. The Ribbon is...less.

## See also
- [http://i.stack.imgur.com/VseEN.png](https://i.stack.imgur.com/VseEN.png)- [http://i42.tinypic.com/15x0pj5.jpg](http://i42.tinypic.com/15x0pj5.jpg)
| Windows Ribbon Framework: How to change font face and size? | CC BY-SA 4.0 | 0 | 2010-04-17T18:33:41.237 | 2019-07-23T11:12:14.667 | 2019-07-23T11:12:14.667 | 4,751,173 | 12,597 | [
"delphi",
"winapi",
"ribbon",
"user-preferences",
"windows-ribbon-framework"
] |
2,660,044 | 1 | 2,662,794 | null | 15 | 48,292 | I have the following formula in LaTeX, based on [Fisher's Exact Test](https://en.wikipedia.org/wiki/Fisher%27s_exact_test). (: requires the use of the `amsmath` package for `\binom`.)
```
\begin{equation}
P(i,j) = \sum_{x=|N(V_i) \cap V_j|}^{\min\{|V_j|, |N(V_i)|}
\frac{ \binom{|V_j|}{x} \binom{|V - V_j|}{|N(V_i)| - x}}
{\binom{|V|}{|N(V_i)|}}
\end{equation}
```
This renders the fraction portion with very small, difficult to read text:

I would like my text more readable, as in the following example:
[](https://i.stack.imgur.com/YWpzM.png)
[plosone.org](http://www.plosone.org/article/fetchObject.action?uri=info:doi/10.1371/journal.pone.0005313.e002&representation=PNG)
What trickery can I use to get LaTeX to render my equation similarly?
| Typesetting LaTeX fraction terms to be larger in an equation | CC BY-SA 4.0 | 0 | 2010-04-17T20:56:35.960 | 2021-10-22T15:13:12.800 | 2021-04-15T14:18:30.220 | 4,751,173 | 38,140 | [
"latex",
"formula",
"equation",
"mathematical-typesetting"
] |
2,660,895 | 1 | 2,660,911 | null | 0 | 587 | Tricky to explain with words so I'll use a picture.

```
A: row 0, column 0
B: row 0, column 1
C: row 1, column 0, span 2
```
| Tkinter layout question | CC BY-SA 2.5 | null | 2010-04-18T02:35:05.640 | 2010-04-18T02:42:02.823 | null | null | 309,377 | [
"python",
"tkinter"
] |
2,661,270 | 1 | 2,661,487 | null | 2 | 2,614 | I have a `CListCtrl` control that has 2 columns and any number of rows. I want the user to be able to click(or maybe double-click) a "cell" and be able edit the text therein.

What I mean is that I want to be able to click and edit any of the places where it says "TEST" by clicking on the text to make it editable.
How should I go about this? I suppose I should use a mouse click event but how would I make the cell editable?
| How do I edit a cell in an MFC Listbox? | CC BY-SA 3.0 | null | 2010-04-18T05:50:24.550 | 2016-10-12T12:55:21.650 | 2016-10-12T12:55:21.650 | 4,653,485 | 319,547 | [
"windows",
"mfc",
"listbox",
"visual-c++"
] |
2,662,782 | 1 | 2,662,809 | null | 2 | 1,674 | I've just started using google charts and want to use it in a small project I'm workin on but I've bumped into a problem. The thing is I want the charts rather big at a static size and look good but I'm generating the charts dynamically with php. Now the problem is that I can't get it to scale properly in width but height is perfectly fine.
Here's an example chart I've generated:

Parameters:
cht=bvo&chs=400x400
chd=t:1,4,1
chxr=2,0,4,1
chds=0,4
chco=4d89f9
chxt=x,x,y,y
chxl=0:|3|7|26|1:|Correct+answers|3:|People
You see how the chart fills the 400px of height but not the width. I've searched and look through the api but I can't get it right.
| How do I make a google charts larger by scale | CC BY-SA 2.5 | null | 2010-04-18T15:39:32.973 | 2010-04-24T21:03:01.327 | 2017-02-08T14:24:02.130 | -1 | 274,752 | [
"html",
"image",
"api",
"google-visualization"
] |
2,663,115 | 1 | 2,663,147 | null | 469 | 212,255 | Say you have a linked list structure in Java. It's made up of Nodes:
```
class Node {
Node next;
// some user data
}
```
and each Node points to the next node, except for the last Node, which has null for next. Say there is a possibility that the list can contain a loop - i.e. the final Node, instead of having a null, has a reference to one of the nodes in the list which came before it.
What's the best way of writing
```
boolean hasLoop(Node first)
```
which would return `true` if the given Node is the first of a list with a loop, and `false` otherwise? How could you write so that it takes a constant amount of space and a reasonable amount of time?
Here's a picture of what a list with a loop looks like:

| How to detect a loop in a linked list? | CC BY-SA 3.0 | 0 | 2010-04-18T17:08:53.630 | 2022-12-24T08:05:38.833 | 2013-05-05T16:35:27.050 | 1,824,094 | 75,863 | [
"java",
"algorithm",
"data-structures",
"linked-list"
] |
2,664,554 | 1 | 2,664,560 | null | 0 | 250 | What is the magic that makes components cling to the edges of a form?
I had thought that one must use the resize event of the form and them force each element in the form to resize.
But then I saw some sample code which, even when I am editing the form, the elements seem to adhere to a percentage of the space they take up in the form rather than a set diminsion. In other words, when I am editing the form and resizing it, the panels and the parts inside the form bend their shape such that the edges remain a few pixels from the edges.
But in my own program I have not been able to find where I can duplicate this feature. When I run my program, this

goes to this

| Relative Resizing of Forms in .NET | CC BY-SA 2.5 | null | 2010-04-19T00:19:59.933 | 2010-04-19T00:56:26.220 | 2017-02-08T14:24:04.300 | -1 | 54,760 | [
".net",
"winforms",
"resize"
] |
2,665,364 | 1 | 2,665,403 | null | 0 | 1,764 | I am attempting to display a list of items (the style and controltemplate for these items are defined elsewhere) and i want to be able to add/remove as many as i want to. As i do not have infinite screen realestate I am displaying these in a ListBox control.
This is the screen i have to date:

What is going to happen is this. When i click the New button, i want the item to appear in the outlined area.
So now for the problem:
I want, when i click the New... Button, a new item to appear in the ListBox (outlined). Is it possible to do this using XAML? I am trying to work on seperating the business logic from the interface, so if there were some way to acheive this in XAML i would appreciate it. If not,can i use the custom templated item i have created in C# so that it will appear as the template specifies in the list box instead of like a normal ListBoxItem
Thanks in advance!
| Displaying a list of Items in a WPF form using XAML | CC BY-SA 2.5 | null | 2010-04-19T05:42:23.820 | 2010-04-19T06:06:53.067 | 2017-02-08T14:24:04.637 | -1 | 199,362 | [
".net",
"wpf",
"xaml"
] |
2,666,490 | 1 | null | null | 7 | 1,432 | I'm getting a weird rendering issue with WPF 4 applications in the way they render some of the text as it's stretching it and making it very narrow.
.net 3.5: 
.net 4.0: 
At first I thought it could be a problem with the font, but I'm also seeing the same problem in the Blend 4 beta:

I'm running XP SP3, Visual Studio 2010 Professional and everything's as up to date as it can be. I'm not noticing any such problems with Silverlight 4 apps I have built on the same machine... Anyone else seen this or know why it's happening?
| WPF 4.0 Font Rendering Issue | CC BY-SA 2.5 | null | 2010-04-19T10:07:45.987 | 2010-05-29T12:29:58.343 | 2017-02-08T14:24:05.990 | -1 | 128,837 | [
"wpf",
"fonts"
] |
2,668,790 | 1 | null | null | 4 | 3,107 | Looking for a means of displaying transient, non-modal dialogs in a Swing application. In other words, I'd like to pop up a semi-transparent box with some text in it that can be immediately dismissed, or will fade away in a set amount of time. Is there a library to do this? I don't want to reinvent the wheel if it already exists.
[Growl](http://growl.info/) screenshot:

[Android Toast](https://developer.android.com/reference/android/widget/Toast.html) screenshot:
[](https://i.stack.imgur.com/70oP1.jpg)
[devx.com](http://assets.devx.com/articlefigs/40842_4.jpg)
| Equivalent to Android's Toast or Mac OSX Growl in Java Swing? | CC BY-SA 4.0 | 0 | 2010-04-19T15:43:45.937 | 2019-07-23T15:11:53.717 | 2019-07-23T15:11:53.717 | 4,751,173 | 155,392 | [
"java",
"user-interface",
"swing",
"toast",
"growl"
] |
2,669,080 | 1 | 2,669,183 | null | 3 | 3,591 | Greetings, Overflowers!
I am writing an application in PHP that will allow for editing various blocks of content via a button that loads a CKEditor Instance inside a jQuery-UI Modal Dialog box.
I've got the button working to launch the Dialog, as shown in these screenshots:


The example shows the 'Main Content' content inside the Dialog ready to edit. The way I'm doing this presently is a hack simply for demo purposes - I have duplicate content hard-coded into the hidden #dialog div.
What I'd like to be able to do is have it so that when the 'Edit Main Content' button is pushed, all content (HTML, Styling, Etc) gets passed by jQuery into the CKEditor instance for edit, and when a 'Save/Submit' button is pressed inside the dialog, the changes are saved via Ajax as well as passed back into the page being edited.
I'm not too concerned about the Ajax bit at this point, as I'll be needing to use the WordPress Ajax API, which is outside the scope of this question.
The main thing, though, is to pass data from the 'Main_Content' div -into- the #dialog when the 'Edit Main Content' button is clicked, and then pass the edited data from the #dialog window back into the 'Main_Content' div after a 'Save Changes' button is pressed.
Any help will be greatly appreciated! I'm totally stuck.
Thanks!
~PF
| Passing Data in and out of CKEditor / jQuery-UI Modal Dialog | CC BY-SA 2.5 | null | 2010-04-19T16:24:08.493 | 2010-04-19T16:42:11.590 | null | null | 231,651 | [
"php",
"jquery",
"ajax",
"ckeditor",
"jquery-ui-dialog"
] |
2,669,952 | 1 | 16,492,691 | null | 9 | 10,987 | I was browsing around and found this blog post:
[http://erikej.blogspot.com/2010/04/version-3-of-exportsqlce-now-available.html](http://erikej.blogspot.com/2010/04/version-3-of-exportsqlce-now-available.html)
(It is for a great add in if you user SQL Server CE.)
On that post I saw an screen shot of SSMS with images in the results.

How is this done? I have images in my database (PNG files that are serialized via memory stream), but I just see numbers when I select the image column.
| See images in SSMS? | CC BY-SA 2.5 | 0 | 2010-04-19T18:50:29.130 | 2013-09-04T12:08:29.723 | 2017-02-08T14:24:07.343 | -1 | 16,241 | [
"add-in",
"ssms",
"sql-server-2008"
] |
2,670,571 | 1 | null | null | 0 | 4,145 | I'm attempting to use the mysql insert statement below to add information to a database table. When I execute the script, however, the insert statement is run twice.
Here's the URL mysite.com/save.php?Body=p220,c180
Thanks in advance.
```
<?php
//tipping fees application
require('base.inc.php');
require('functions.inc.php');
// connect to the database & save this message there
try {
$dbh = new PDO("mysql:host=$dbhost;dbname=$dbname", $dbuser, $dbpass);
//$number = formatPhone($_REQUEST['From']);
//if($number != 'xxx-xxx-xxxx'){die('SMS from unknown number');} // kill this if from anyone but mike
$message = $_REQUEST['Body'];
//$Sid = $_REQUEST['SmsSid'];
$now = time();
echo $message;
$message = explode(",",$message);
echo '<pre>';
print_r($message);
echo 'message count = '.count($message);
echo '</pre>';
$i = 0;
$j = count($message);
while($i<$j){
$quantity =$message[$i];
$material = substr($quantity, 0, 1);
$amount = substr($quantity, 1);
switch ($material) {
case 'p':
$m = "paper";
break;
case 'c':
$m = "containers";
break;
default:
$m = "other";
}
$count = $dbh->exec("INSERT INTO tippingtotals(sid,time,material,weight) VALUES('$i+$j','$now','$m','$amount')");
echo $count;
echo '<br />';
$i++;
}
//close the database connection
$dbh = null;
}
catch(PDOException $e)
{
echo $e->getMessage();
}
?>
```
Like most of you, I thought it was because I was starting $i=0 so I added the $i+$j in the insert statement so I could see how items were being inserted into the table. Here's what running the script returns:

I'm certain there's an error in my logic. I just can't seem to figure out what it is.
I ran LiveHTTPHeaders as suggested below and this is what turned up...
```
http://localhost/mysite/save.php?Body=p180,c220
GET /mysite/save.php?Body=p180,c220 HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
HTTP/1.1 200 OK
Date: Mon, 19 Apr 2010 22:17:31 GMT
Server: Apache/2.0.63 (Unix) PHP/5.2.11 DAV/2
X-Powered-By: PHP/5.2.11
Content-Length: 93
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html
----------------------------------------------------------
```
Turns out that the error is only happening when I load save.php in Chrome.
| Why is this MySQL INSERT INTO running twice? | CC BY-SA 3.0 | 0 | 2010-04-19T20:23:15.047 | 2011-08-15T21:01:21.973 | 2011-08-15T21:01:21.973 | 95 | 306,869 | [
"php",
"mysql"
] |
2,671,670 | 1 | 2,869,267 | null | 1 | 1,381 | I've set the width of large files in Wordpress' Media settings, but how can I tell Wordpress to apply the setting to all the images I've already inserted in posts? It's limiting them to a previous setting of 500px wide.

| How can I tell Wordpress to reset all posted image sizes to the largest set width? | CC BY-SA 3.0 | null | 2010-04-19T23:52:20.523 | 2011-10-16T19:03:26.883 | 2011-10-16T19:03:26.883 | 540,162 | 320,851 | [
"wordpress",
"image",
"size",
"image-manipulation"
] |
2,671,966 | 1 | 2,800,841 | null | 37 | 41,358 | If you are running Windows with a higher DPI setting you will notice that most application icons on the desktop look terrible. Even some high profile application icons such as Google Chrome look terrible while Firefox, Skype and MS Office icons look sharp:

(example)
I suspect that most icons look blurry because a lower resolution icon is scaled up rather than using a higher resolution icon.
I want to give my application a high quality icon and can't seem to convince Windows to use the higher resolution icon. I have created a multi-resolution icon with the icon editor [IcoFX](http://icofx.ro/). The icon is provided in (all in 32 bit including alpha channel) yet Windows seems to use the 48x48 version of the icon on the desktop and scale it up which looks terrible. (I am using Windows 7 - 64 bit - the icon is placed by means of setting up a shortcut in the msi (created via Visual Studio 2008 Setup Project) and pointing it to the .ico file that contains the multi-resolution icon)
I have tried removing the 128x128 icon but to no avail. Interestingly in Windows Explorer the icon looks great even when using the Extra Large Icon setting.
EDIT: I tested removing the 128x128 option, then both the 48x48 and 128x128 option and tried Axialis IconWorkshop to create the icon - nothing worked.
EDIT: After much trial and error I think When setting the icon for the link in the editor it only gives me one option (index 0) which seems to be the 48x48 icon. I have tried manually adjusting the IconIndex in the .vdproj but had no luck.
| How to create a high quality icon for my Windows application? | CC BY-SA 3.0 | 0 | 2010-04-20T01:23:59.420 | 2017-06-11T17:47:39.650 | 2017-05-08T18:53:22.357 | 10,779 | 10,779 | [
"windows",
"windows-installer",
"icons",
"highdpi"
] |
2,671,984 | 1 | null | null | 0 | 250 | 
Basically: an (course) has many , which can be either optional or core(mandatory), depending on the award. So for example: the unit 'Advanced Software Engineering' maybe a core unit for the award 'Software Engineering BSc' but only an optional unit for the course 'Web Technology BSc'. I've used flags for that purpose.
A is enrolled on an so I need to get a complete list of core and optional units (bearing in mind that a student chooses 1 out of many possible optional units).
Also, these units have , e.g, a lecture, workshop or seminar, etc. and those events have or instances of events where students enrolled on that particular unit are required to attend, and those attendances are stored in a separate table to form a register.
So I need a hierarchy of expanding the tables something like this I guess:
-
Any help with this would be appreciated... It's blowing my mind and I'm really close to going insane! My tutor didn't spot I'd got it wrong when I showed my original data model to him and it's due in next week! Thank you :D
| Struggling to create correct relationships in MS Access | CC BY-SA 3.0 | null | 2010-04-20T01:30:28.253 | 2011-11-26T07:20:56.383 | 2011-11-26T07:20:56.383 | 234,976 | 320,504 | [
"sql",
"database",
"ms-access"
] |
2,673,714 | 1 | 2,673,788 | null | 2 | 2,652 | I was wondering what the best approach in order to have a UISegmentedControl appears just under the a navigationController just like in the AppStore application:

The content I what to put in the different views are UITableView just like the AppStore app.
What I was thinking so far was:
- -
But what I can't figure out, is how to structure my controller source code files.
Do you have best practice, working examples or at least advices?
| How to put a UISegmentedControl under a NavigationController? | CC BY-SA 3.0 | 0 | 2010-04-20T08:42:48.333 | 2014-07-02T07:13:28.990 | 2012-07-22T10:12:55.627 | 292,166 | 296,319 | [
"iphone",
"uinavigationcontroller",
"uisegmentedcontrol"
] |
2,675,582 | 1 | 2,721,898 | null | 0 | 107 | Not sure how to describe this issue, but I only get it in Firefox and not any other browser.
When clicking around, the page sometimes blows up with the attached pic. Sometimes it has even more characters than that, and you can see things like LAME encoder referenced. Anyone know what the deal is? All site caching is disabled. I am no pro with flash so I don't know what is causing this.
I am using the Boutell XSPF player due to its support of Autoresume, if that helps. I added it to the list of players, and have the flash embed code in a block.
I am achieving this using the Drupal Audio module and submodules supporting it.

| Audio player / Flash issue - displaying content header and characters? | CC BY-SA 2.5 | null | 2010-04-20T13:47:38.020 | 2010-04-27T14:12:29.053 | 2017-02-08T14:24:08.703 | -1 | 295,112 | [
"flash",
"drupal",
"audio-streaming"
] |
2,676,884 | 1 | null | null | 0 | 680 | I have a slider for the user to control the volume of my application. What I'd like to have is a icon or something else similar to "volume display" like in the next picture at the slider summary. Is this possible ? How could this be accomplished ?

| Custom preference screen | CC BY-SA 2.5 | null | 2010-04-20T16:30:40.097 | 2010-04-20T17:27:51.840 | 2017-02-08T14:24:09.383 | -1 | 284,609 | [
"android"
] |
2,677,611 | 1 | 2,677,888 | null | 3 | 151 | I have a dillema where our client relations department has been brought in for advice on UI and I vehemently disagree with it...even though I don't consider myself a designer at all. While I have been vocal about my disagreement about it, I've been asked to point to design standards to prove that what I'm saying is correct and that the guys in Client Relations are flat out wrong.
A mockup is below, I'm trying to argue that the icons of the airplane, boat, and couch (ya, I didn't choose those either) belong in the header of the page (same area as the logo) and not in the content area of the page. Can anybody please help me by pointing me to something that helps prove my point?
Thanks a lot,
Greg Andora

| UI Design Help / Advice | CC BY-SA 2.5 | null | 2010-04-20T18:24:59.540 | 2010-04-22T11:00:21.200 | 2017-02-08T14:24:10.063 | -1 | 190,638 | [
"standards",
"ui-design",
"gui-design"
] |
2,677,698 | 1 | null | null | 30 | 44,818 | Is it possible to style the Android Tabhost to look like that of the iPhone?
If not, is there any open source code that can show how to create Bottom Tabs for Android ?
[](https://i.stack.imgur.com/nV2pc.jpg)
[appshopper.com](http://images.appshopper.com/screenshots/305/690205_2.jpg)

| Android - iphone style tabhost | CC BY-SA 4.0 | 0 | 2010-04-20T18:38:56.930 | 2019-07-23T19:09:56.817 | 2019-07-23T19:09:56.817 | 4,751,173 | 93,141 | [
"android",
"tabs",
"android-tabhost",
"android-style-tabhost"
] |
2,677,845 | 1 | 2,677,923 | null | 1 | 3,779 | For my problem it would be best to find a numeric representation of kazakh national ornaments for generating new ones. But other approaches are also fine.
The ornaments essentially consist of combinations of relatively basic ornaments. Usually the ornaments are symmetrical.
Here are few examples of basic elements:
  
  
(The images are a bit distorted)
And this is an example of a more complex ornament:

How could I encode an ornament's representation in as few numbers as possible? So that I could write a program that would generate an ornament, given some sequence of numbers
Any ideas are appreciated.
As I write this, I have thought that generating images of snowflakes may be somewhat relevant, although it's possibly just a fractal.
| How to model rules for generating geometric patterns? | CC BY-SA 2.5 | null | 2010-04-20T19:01:02.590 | 2022-07-06T17:00:53.213 | 2017-02-08T14:24:12.537 | -1 | 110,572 | [
"image",
"graphics",
"graph",
"representation",
"fractals"
] |
2,679,620 | 1 | 2,681,179 | null | 0 | 730 | I'm trying to create an image with some text on it and I want the image's size to match the size of the rendered text.
When I use `System.Windows.Forms.TextRenderer.MeasureText(...)` to measure the text, I get dimensions that include font padding. When the text is rendered, it seems to use the same padding.
Is there any way to determine the size of a string of text and then render it without any padding?
This is the code I've tried:
```
// Measure the text dimensions
var text = "Hello World";
var fontFamily = new Font("Arial", 30, FontStyle.Regular);
var textColor = new SolidBrush(Color.Black);
Size textSize = TextRenderer.MeasureText(text, fontFamily,
Size.Empty, TextFormatFlags.NoPadding);
// Render the text with the given dimensions
Bitmap bmp = new Bitmap(textSize.Width, textSize.Height);
Graphics g = Graphics.FromImage(bmp);
g.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
g.DrawString(text, fontFamily, textColor, new PointF(0, 0));
bmp.Save("output.png", ImageFormat.Png);
```
This is what currently gets rendered out:
> 
This is what I want to render:
> 
I also looked into `Graphics.MeasureString(...)`, but that can only be used on an existing `Graphics` object. I want to know the size before creating the image. Also, calling `Graphics.MeasureString(...)` returns the same dimensions, so it doesn't help me any.
| How can I get the dimensions of a drawn string without padding? | CC BY-SA 2.5 | null | 2010-04-21T00:38:18.263 | 2010-04-21T07:57:33.430 | 2010-04-21T03:28:28.870 | 392 | 392 | [
".net",
"graphics",
"text",
"drawing",
"c#-2.0"
] |
2,679,698 | 1 | null | null | 10 | 10,756 | So I'm have a hard time figuring out when I should be attaching to an object and when I shouldn't be attaching to an object. First thing's first, here is a small diagram of my (very simplified) object model.

In my DAL I create a new DataContext every time I do a data-related operation. Say, for instance, I want to save a new user. In my business layer I create a new user.
```
var user = new User();
user.FirstName = "Bob";
user.LastName = "Smith";
user.Username = "bob.smith";
user.Password = StringUtilities.EncodePassword("MyPassword123");
user.Organization = someOrganization; // Assume that someOrganization was loaded and it's data context has been garbage collected.
```
Now I want to go this user.
```
var userRepository = new RepositoryFactory.GetRepository<UserRepository>();
userRepository.Save(user);
```
Neato! Here is my save logic:
```
public void Save(User user)
{
if (!DataContext.Users.Contains(user))
{
user.Id = Guid.NewGuid();
user.CreatedDate = DateTime.Now;
user.Disabled = false;
//DataContext.Organizations.Attach(user.Organization);
DataContext.Users.InsertOnSubmit(user);
}
else
{
DataContext.Users.Attach(user);
}
DataContext.SubmitChanges();
// Finished here as well.
user.Detach();
}
```
So, here we are. You'll notice that I comment out the bit where the DataContext attachs to the organization. If I attach to the organization I get the following exception:
>
Hmm, that doesn't work. Let me try it attaching (i.e. comment out that line about attaching to the organization).
>
WHAAAAT? I can only assume this is trying to insert a new organization which is obviously false.
So, what's the deal guys? What should I do? What is the proper approach? It seems like L2S makes this quite a bit harder than it should be...
I just noticed that if I try to look at the pending change set (dataContext.GetChangeSet()) I get the same NotSupportedException I described earlier!! What the hell, L2S?!
| LINQ to SQL: To Attach or Not To Attach | CC BY-SA 2.5 | 0 | 2010-04-21T01:09:50.600 | 2014-04-10T08:47:56.350 | 2010-04-21T01:33:31.163 | 176,645 | 176,645 | [
"c#",
"linq-to-sql"
] |
2,681,544 | 1 | 2,681,566 | null | 0 | 70 | I'm new with jquery and want to ask a question, can jquery make something like this pics?

I don't know what's this was called, so I can't googled it.
Regards, B_S
| Want to ask an advice about jquery | CC BY-SA 3.0 | null | 2010-04-21T09:07:34.327 | 2011-11-28T00:06:28.670 | 2011-11-28T00:06:28.670 | 234,976 | 322,105 | [
"jquery",
"jquery-ui",
"jquery-plugins"
] |
2,682,079 | 1 | 2,682,103 | null | 3 | 2,832 | I'm new to emacs and I want to use [ensime](http://github.com/aemoncannon/ensime) in Windows.
I had a try but it doesn't work. It seems that it doesn't work because there is a *nix format file named "\ensime\bin\server.sh" .
Very appreciate if someone give me some tips.
EDIT:
I follow VonC's suggestion but it doesn't work perfect. I'm sure I have missed something.

I have installed emacs23.1 in dir D:\Dev\emacs-23.1 ,scala-mode in D:\Dev\emacs-23.1\scala-mode and ensime in D:\Dev\emacs-23.1\ensime.
## Here is my .emacs file content:
```
;;禁用工具栏
(tool-bar-mode nil)
;;显示行号
(global-linum-mode t)
;;使用scala mode
(add-to-list 'load-path "D:/Dev/emacs-23.1/scala-mode/")
(require 'scala-mode)
(add-to-list 'auto-mode-alist '("\\.scala$" . scala-mode))
(add-to-list 'load-path "D:/Dev/emacs-23.1/ensime/src/elisp/")
(require 'ensime)
(add-hook 'scala-mode-hook 'ensime-scala-mode-hook)
```
---
## and here is my D:\Dev\emacs-23.1\ensime.ensime file content:
```
(
:server-root "D:/Dev/emacs-23.1/ensime/"
:server-cmd "D:/Dev/emacs-23.1/ensime/bin/server.bat"
:server-host "localhost"
:server-env ()
:project-package "com.ensime"
:source ("src")
:exclude-source ()
:classpath ("lib/jnotify/jnotify-0.93.jar"
"lib/scala/scala-library.jar"
"lib/scala/scala-compiler.jar")
)
```
---
and here is my D:\Dev\emacs-23.1\ensime\bin\server.bat file content:
```
@echo off
set PORT_FILE=%1
set CLASSPATH=D:\Dev\emacs-23.1\ensime\lib\jnotify\jnotify-0.93.jar;D:\Dev\emacs-23.1\ensime\lib\scala\scala-library.jar;D:\Dev\emacs-23.1\ensime\lib\scala\scala-compiler.jar;D:\Dev\emacs-23.1\ensime\dist\ensime.jar
java -classpath %CLASSPATH% -Djava.library.path=D:\Dev\emacs-23.1\ensime\lib\jnotify com.ensime.server.Server %PORT_FILE%
```
[alt text http://www.turboimagehost.com/p/3350328/3769883.PNG.html](http://www.turboimagehost.com/p/3350328/3769883.PNG.html)
| How to make ensime work in windows? | CC BY-SA 2.5 | 0 | 2010-04-21T10:30:25.743 | 2010-09-11T10:09:05.377 | 2017-02-08T14:24:13.550 | -1 | 172,677 | [
"scala",
"ensime"
] |
2,682,144 | 1 | 12,956,923 | null | 38 | 17,178 | R has a useful function `pairs` that provides nice matrix of plots of pairwise connections between variables in a data set. The resulting plot looks similar to the following figure, copied from [this blog post](http://statisticsr.blogspot.com/2009/12/r-pairs-plot.html):

Is there any ready to use function based on python's matplolib? I have searched its [gallery](http://matplotlib.sourceforge.net/gallery.html), but couldn't find anything that resembles what I need. Technically, this should be a simple task, but proper handling of all the possible cases, labels, titles, etc is very tedious.
see below my answer with a quick and dirty approximation.
| matplotlib analog of R's `pairs` | CC BY-SA 2.5 | 0 | 2010-04-21T10:40:18.823 | 2023-02-16T01:36:10.473 | 2017-02-08T14:24:13.900 | -1 | 17,523 | [
"python",
"r",
"matplotlib"
] |
2,682,546 | 1 | 2,682,580 | null | 0 | 137 | I am just putting the finishing touches to an iPhone app that I have written, signed up to the developer program and installed Xcode 3.2.2 (1650) My question is which version of the SDK should I be using to build my application? I was thinking I should be using the latest 3.2 but when I select that I can only access the iPad simulator ...

Should I be using 3.1.3 which runs the iPhone simulator. (NB: I originally developed the app in 3.1.2
cheers gary
| Xcode SDK version for testing & release? | CC BY-SA 2.5 | null | 2010-04-21T11:47:08.227 | 2010-04-21T11:52:13.693 | 2017-02-08T14:24:14.243 | -1 | 164,216 | [
"iphone",
"xcode"
] |
2,682,724 | 1 | 2,683,634 | null | 2 | 845 | I'm using Xcode 2.5 on Mac 10.4.11 PPC. `javac -version` returns 1.5.x yet when I imported my source code and tried to build it in Xcode, I get errors all over because `generics`, `annotations`, and `for-each loops are not supported in -source 1.3`.

I thought I found the setting to change the source version in Xcode in the above but it doesn't work. Any ideas?
| How do I change the build's SDK version in Xcode? | CC BY-SA 2.5 | null | 2010-04-21T12:15:53.107 | 2010-04-21T14:10:53.267 | 2010-04-21T12:24:37.423 | 242,405 | 242,405 | [
"java",
"xcode",
"sdk",
"version"
] |
2,684,578 | 1 | 2,684,608 | null | 1 | 583 | what is the proper code for this?

in div style code. I know how to use float but only 2 divides. But in 4 divides, I don't know.
| CSS div style question | CC BY-SA 2.5 | 0 | 2010-04-21T16:06:43.633 | 2010-04-21T16:36:14.137 | 2017-02-08T14:24:14.927 | -1 | 242,839 | [
"css",
"html"
] |
2,685,707 | 1 | null | null | 4 | 150 | Not sure what I'm doing wrong here. I have this plot:
```
ggplot(data.PE5, aes(ybands,fill=factor(decide))) + geom_bar(position="dodge")
```
which produces:

Then I want to facet by a factor, creating two stacked plots w/ dodged, colored bars
```
ggplot(data.PE5, aes(ybands,fill=factor(decide))) + geom_bar(position="dodge") +
facet_grid(~group_label)
```
However, I lose the factor-based coloring, which I want to keep:

| Trying to keep filled bars in a faceted plot | CC BY-SA 2.5 | null | 2010-04-21T18:52:14.760 | 2010-04-21T20:16:36.383 | 2017-02-08T14:24:16.023 | -1 | 271,844 | [
"r",
"ggplot2"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.