Id
int64
1.68k
75.6M
PostTypeId
int64
1
2
AcceptedAnswerId
int64
1.7k
75.6M
ParentId
int64
1.68k
75.6M
Score
int64
-60
3.16k
ViewCount
int64
8
2.68M
Body
stringlengths
1
41.1k
Title
stringlengths
14
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
1
CreationDate
stringlengths
23
23
LastActivityDate
stringlengths
23
23
LastEditDate
stringlengths
23
23
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
1
21.3M
Tags
list
4,703,872
1
4,703,896
null
2
1,526
The related questions that SO offer me only answer simple cases that can be solved with a pull - however, that doesn't work well, as you'll see below. There's a repository I've forked, with just a `master` branch, and I've forked it, and I've worked in both my `master`, and a new branch of my own, `rw-style`. The owner of the forked repository's committed some of my changes but not others; the black dots on the top right below represent commits from both my `master` and `rw-style` branches. ![alt text](https://i.stack.imgur.com/f3hLs.png) I'm aware using the fork queue is not a good idea, so I'm staying away from it. Using `git pull` does work, but it creates a conflict that I would then need to resolve, and it also results in duplicate history for my `master` branch, and that doesn't look particularly pretty. I don't know any other solutions right now, so I'm currently considering just creating a patch from two commits that I haven't yet pushed, deleting my fork, creating it again from the original, and then applying my patches on top of it. Is that the only solution?
Having a fork match the original repo when the original master branch can't be merged in?
CC BY-SA 2.5
null
2011-01-16T04:49:40.020
2011-01-16T04:58:01.977
null
null
77,922
[ "git", "version-control", "github" ]
4,703,913
1
4,704,060
null
2
1,119
I was using Qt with C++ to develop my GUI applications, but I have recently switched to try out C# .NET as it is much easier to do what I need to. I was wondering what controls I need to be using for a few things and if they exist for C# .NET or if I need to do something custom/special. ![example screenshot showing docked tool windows](https://i.stack.imgur.com/FwqFB.jpg) If you look in that screenshot, I want to do something similar to how they have each tool window grouped into its own docking area with the option of closing it or breaking it out of the layout so it can be dragged. I am talking about the tool windows titled "Groups", "Resources", "Tools", etc. I also want to make these tool windows stay in the same place when the main window is resized. Qt has spring like widgets that will let you create a UI that keeps its shape when the window is resized. Does anything like this exist in C# .NET?
C# .NET Controls for docked tool windows?
CC BY-SA 2.5
null
2011-01-16T05:04:22.053
2011-01-16T05:51:08.123
2011-01-16T05:47:58.053
33,225
null
[ "c#", "controls", "widget" ]
4,704,009
1
4,704,052
null
37
30,815
When I create `ListBox` with horizontal items ordering for example like this: ``` <DockPanel> <ListBox> <ListBox.ItemsPanel> <ItemsPanelTemplate> <VirtualizingStackPanel Orientation="Horizontal" /> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBoxItem> <Button Content="Hello" /> </ListBoxItem> <ListBoxItem> <Button Content="Hello" /> </ListBoxItem> </ListBox> </DockPanel> ``` I have small gaps between buttons in the list as indicated by the arrows on following picture: ![Picture showing gaps](https://i.stack.imgur.com/9vO81.jpg) How can I get rid of those gaps please ? I need to have items in `ListBox` just next to each other. I have tried changing `ItemTemplate` of the `ListBox` but it did not help.
Gaps between items in my ListBox
CC BY-SA 2.5
0
2011-01-16T05:40:22.677
2016-12-08T21:17:52.183
2020-06-20T09:12:55.060
-1
311,865
[ ".net", "wpf", "listview", "listbox", "wpf-controls" ]
4,704,876
1
null
null
3
146
while revising for an exam, i came across this simple question asking about rollbacks in processes. i understand how rollbacks occur, but i need some validation on my answer. The question: ![alt text](https://i.stack.imgur.com/iVatR.jpg) ![alt text](https://i.stack.imgur.com/UB49c.jpg) my confusion results from the fact that there is interprocess communication between the processes. does that change anything in terms of where to rollback? my answer would be R13, R23, R32 and R43. any help is greatly appreciated! thanks!
simple process rollback question
CC BY-SA 2.5
null
2011-01-16T10:37:47.410
2011-01-16T15:56:39.143
2011-01-16T15:56:39.143
560,204
560,204
[ "java", "multithreading", "process", "parallel-processing", "rollback" ]
4,704,913
1
5,129,682
null
6
3,076
The wxPython ToolBar look and feel does not match that of the current operating system - it has a gradient similar to the Windows Vista / 7 menubar I.E. a silver gradient. Is there any way to change this so that it blends in with the operating systems look and feel? Note: There is a style flag that can be set when creating the ToolBar and one of those flags is wx.TB_FLAT but this seems to have no affect on the way the ToolBar is rendered. I am running my wxPython program on Windows 7. Edit: Below is a screen shot of what I am seeing. ![alt text](https://i.stack.imgur.com/2c05w.png) Edit: It seems the toolbar is drawn in accordance with the current theme as changing to the Windows Classic theme renders a flat toolbar which matches the window background. The code below shows what I have tried so far. I have created a method called OnPaint which is bound to the toolbars paint event. This has no effect and the toolbar is drawn as in the image above. I know that the code in OnPaint works as the rectangle is rendered if i bind this method to the windows paint event instead of the toolbars. ``` import wx ID_STAT = 1 ID_TOOL = 2 class CheckMenuItem(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title, size=(350, 250)) menubar = wx.MenuBar() file = wx.Menu() view = wx.Menu() self.shst = view.Append(ID_STAT, 'Show statubar', 'Show Statusbar', kind=wx.ITEM_CHECK) self.shtl = view.Append(ID_TOOL, 'Show toolbar', 'Show Toolbar', kind=wx.ITEM_CHECK) view.Check(ID_STAT, True) view.Check(ID_TOOL, True) self.Bind(wx.EVT_MENU, self.ToggleStatusBar, id=ID_STAT) self.Bind(wx.EVT_MENU, self.ToggleToolBar, id=ID_TOOL) menubar.Append(file, '&File') menubar.Append(view, '&View') self.SetMenuBar(menubar) self.toolbar = self.CreateToolBar() self.toolbar.Realize() self.statusbar = self.CreateStatusBar() self.Bind(wx.EVT_PAINT, self.OnPaint, self.toolbar) self.Centre() self.Show(True) def OnPaint(self, e): dc = wx.PaintDC(self) dc.SetBrush(wx.Brush('#c56c00')) dc.DrawRectangle(10, 15, 90, 60) def ToggleStatusBar(self, event): if self.shst.IsChecked(): self.statusbar.Show() else: self.statusbar.Hide() def ToggleToolBar(self, event): if self.shtl.IsChecked(): self.toolbar.Show() else: self.toolbar.Hide() app = wx.App() CheckMenuItem(None, -1, 'Toolbar Test') app.MainLoop() ```
How do I change the look and feel of the wxPython tool bar?
CC BY-SA 2.5
0
2011-01-16T10:53:07.153
2011-02-27T09:22:17.313
2011-02-13T14:40:27.047
577,417
577,417
[ "python", "wxpython" ]
4,705,041
1
4,705,382
null
1
901
We are using base clear case with dynamic views on Linux. In our environment some custom script is responsible, so ct mkview is not working. I need either - provide to Hudson plugin a custom script for creating a view - tell to plugin to reuse existing view, w/o calling to ct mkview I did not find any of these options. Can you help me? Here are my current settings: ![alt text](https://i.stack.imgur.com/S933q.jpg) Thank you
Clearcase plugin with hudson ci server
CC BY-SA 2.5
null
2011-01-16T11:29:12.827
2011-01-18T08:19:54.087
2011-01-17T07:22:39.330
6,309
20,391
[ "hudson", "clearcase", "hudson-plugins" ]
4,705,081
1
null
null
8
9,453
I have a custom ControlTemplate for a WPF TabControl that adds Buttons to the left and right hand side of the TabItem header. At the moment this is not a named part as the button commands are bound in the ControlTemplates XAML and do not need to be exposed outside of the ControlTemplate. This works fine for a button but what if I want to add to the left (or right) hand side of the TabItemHeaders which can be bound outside of the ControlTemplate so that my TabControl becomes more flexible? My idea was to subclass the TabControl and have two named parts in the ControlTemplate and expose these as properties of the new control; and respectively. Each named part is a ContentPresenter and each ContentPresenters Content property is exposed by the properties named above. However, when I tried this I was unable to put content into the left and right content areas. Edit: Just to be clear I have included an image. The red rectangles show where I want to be able to place extra content. ![alt text](https://i.stack.imgur.com/cwK2F.jpg) Update: Below is a screen shot of the progress I have made so far, hopefully this will help explain my problem a bit more. The screen shot shows my custom Tab Control with two blank tabs and three buttons that are currently on the right hand side of the header area. The buttons are currently defined in the custom I.E. there is a within the Grid which contains a that hosts 3 buttons. ![alt text](https://i.stack.imgur.com/zeUK8.png) What I am looking for is a way to allow the consumer of the tab control decide what content goes in the area next to the tabs. E.G. the user should be able to do something like this: ``` <local:CustomTabControl> <local:CustomTabControl.RightContentArea> <!-- This can be changed to ANY content that the user wants --> <StackPanel Orientation="Horizontal"> <Button Content="Test" /> <Button Content="Test" /> <Button Content="Test" /> </StackPanel> </local:CustomTabControl.RightContentArea> <!-- TabItems are added as normal --> <TabItem Header="Tab One" /> <TabItem Header="Tab Two" /> </local:CustomTabControl> ```
How can I add extra content to a WPF TabControl?
CC BY-SA 2.5
0
2011-01-16T11:36:46.403
2017-10-24T05:33:36.210
2011-01-18T21:56:36.800
577,417
577,417
[ "c#", "wpf", "xaml", "wpf-controls" ]
4,705,092
1
4,705,128
null
2
267
i try show layout like image 1 (textView and editText in same line) but my out put shown like image 2 ! i try with this code : ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="5px" > <TextView android:id="@+id/label" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="URL:" android:layout_alignBaseline="@+id/entry" android:layout_alignParentLeft="true"/> /> <EditText android:id="@+id/entry" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_toRightOf="@id/label" android:layout_alignParentTop="true" /> <Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:paddingRight="30px" android:paddingLeft="30px" android:text="Go..." /> </LinearLayout> ``` please help me thanks ![image1](https://i.stack.imgur.com/4Cix7.jpg) ![image2](https://i.stack.imgur.com/khdVd.jpg)
layout problem in android
CC BY-SA 2.5
null
2011-01-16T11:38:43.030
2011-03-07T12:50:01.310
2011-02-23T08:26:54.027
408,780
377,983
[ "android", "xml", "layout", "textview", "android-edittext" ]
4,705,291
1
4,705,425
null
4
747
When I run this test code on my development machine it works as expected. CF9.01 I am in europe using euro date format so 10/09/1957 is 10th Sept 1957. ``` <cfset testDate="10/09/1957"> <cfoutput> Initial string = "#testDate#"<br> LSparsedatetime output = #lsparsedatetime(session.form.patientDOB)#<br> parsedatetime output = #parsedatetime(session.form.patientDOB)# </cfoutput> ``` Output on test machine is > ``` Initial string = "10/09/1957" LSparsedatetime output = {ts '1957-09-10 00:00:00'} parsedatetime output = {ts '1957-10-09 00:00:00'} ``` Same code , output on live server is ``` Initial string = "10/09/1957" LSparsedatetime output = {ts '1957-10-09 00:00:00'} parsedatetime output = {ts '1957-10-09 00:00:00'} ``` Server OS is Windows Web Server 2008 R2. I checked Control panel > date and time setting and it is correctly set to London. Web server is IIS7 but I don't think that would affect anything? IN region and Language, location is set to United Kingdom and in Administrative (change system locale ) it is also correct as English (United Kingdom) Update : as far as CF is concerned it thinks the server is on US locale. Running this ... ``` <cfset testDate="10/09/1957"> <cfoutput> Initial string = "#testDate#"<br> #getLocale()#:<br> LSparsedatetime output = #lsparsedatetime(testDate)#<br> parsedatetime output = #parsedatetime(testDate)#<br> <P> <cfset SetLocale("en_GB") /> en_GB:<br> LSparsedatetime output = #lsparsedatetime(testDate)#<br> parsedatetime output = #parsedatetime(testDate)#<br> </cfoutput> ``` Gives this output ``` Initial string = "10/09/1957" English (US): LSparsedatetime output = {ts '1957-10-09 00:00:00'} parsedatetime output = {ts '1957-10-09 00:00:00'} en_GB: LSparsedatetime output = {ts '1957-09-10 00:00:00'} parsedatetime output = {ts '1957-10-09 00:00:00'} ``` But here's confirmation of the server settings. ![alt text](https://i.stack.imgur.com/xI490.png) ![alt text](https://i.stack.imgur.com/W6rbv.png) Forcing locale with setLocale in the code resolves to correct behaviour.
Problem with LSParseDateTime function on server only despite server locale correctly set
CC BY-SA 2.5
null
2011-01-16T12:20:35.710
2011-01-17T09:36:06.710
2011-01-17T09:36:06.710
83,147
83,147
[ "datetime", "coldfusion", "locale" ]
4,705,447
1
4,705,595
null
0
1,308
Let's say I have multiple select box with options that have different options. On click, I want to values to be transported to a textarea. I'll try to show them in images. ![Preview](https://i.stack.imgur.com/Ae3T4.jpg)
Complex Javascript and HTML question, <select> and <textarea>
CC BY-SA 2.5
0
2011-01-16T12:54:25.863
2011-01-16T13:56:01.353
null
null
445,820
[ "javascript", "html", "textarea", "css-selectors" ]
4,705,914
1
4,706,082
null
0
1,649
I am trying to replicate the effect I see ![](https://imgur.com/6fSHe.jpg) Currently I have [http://jsfiddle.net/GWkk3/](http://jsfiddle.net/GWkk3/) ![](https://imgur.com/N6mFD.jpg) How can I remove the border between the active li and the 2nd level nav?
Need help with CSS Tabs & Border Color
CC BY-SA 2.5
0
2011-01-16T14:36:34.370
2011-01-16T15:08:08.837
null
null
292,291
[ "css" ]
4,706,118
1
null
null
23
63,613
I am developing an application to read the letters and numbers from an image using opencv in c++. I first changed the given colour image and colour template to binary image, then called the method cvMatchTemplate(). This method just highlighted the areas where the template matches.. But not clear.. I just dont want to see the area.. I need to parse the characters(letters & numbers) from the image. I am new to openCV. Does anybody know any other method to get the result?? ![alt text](https://i.stack.imgur.com/oHYXo.jpg) Image is taken from camera. the sample image is shown above. I need to get all the texts from the LED display(130 and Delft Tanthaf). Friends I tried with the sample application of face detection, It detects the faces. the HaarCascade file is provided with the openCV. I just loaded that file and called the method cvHaarDetectObjects(); To detect the letters I created the xml file by using the application letter_recog.cpp provided by openCV. But when I loading this file, it shows some error(OpenCV error: UnSpecified error > in unknown function, file ........\ocv\opencv\src\cxcore\cxpersistence.cpp,line 4720). I searched in web for this error and got the information about lib files used. I did so, but the error still remains. Is the error with my xml file or calling the method to load this xml file((CvHaarClassifierCascade*)cvLoad("builded xml file name",0,0,0);)?? please HELP... Thanks in advance
read numbers and letters from an image using openCV
CC BY-SA 2.5
0
2011-01-16T15:15:53.197
2019-03-07T10:43:17.567
2011-01-19T10:21:25.407
462,695
462,695
[ "opencv" ]
4,706,111
1
4,706,184
null
0
1,360
Im struggling with Observable collections and using it to add pushpins onto a silverlight bing map. Im trying to build up a collection here using Linq. But im getting the error under every "PushPinItems" instance in my code saying: ``` 'observable_collection_test.Map.PushPinItems' is a 'field' but is used like a 'type' c:\users\dan\documents\visual studio 2010\Projects\observable collection test\observable collection test\Map.xaml.cs 26 38 observable collection test ``` Not sure whats going on here, am I declaring/constructing it wrong or something? Im new to Observable collections (and most of c#!) so any help/advice welcome. Many thanks. This seems to be ok now, the above issue, but now its not binding my items to pushpins. I have looked at the "PushPins = pushPinCollection;" method and all 143 items are in there with lat, long and location propertiess with the correct data- as per this breakpoint: ![alt text](https://i.stack.imgur.com/dOnnK.jpg) Maybe there is an issue with my XAML binding? Here is the updated code: ``` namespace observable_collection_test { public partial class Map : PhoneApplicationPage { private ObservableCollection<SItem2> _PushPins; public event PropertyChangedEventHandler PropertyChanged; public Map() { InitializeComponent(); getItems(); } public ObservableCollection<SItem2> PushPins { get { return _PushPins; } private set { _PushPins = value; if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs("PushPins")); } } } private GeoCoordinate _location; public GeoCoordinate Location { get { return _location; } set { if (_location != value) { _location = value; } } } private string _pinSource; public string PinSource { get { return _pinSource; } set { if (_pinSource != value) { _pinSource = value; } } } public void getItems() { var document = XDocument.Load("ListSmall.xml"); if (document.Root == null) return; var xmlns = XNamespace.Get("http://www.blahblah.co.uk/blah"); var events = from ev in document.Descendants("item") select new { Latitude = Convert.ToDouble(ev.Element(xmlns + "Point").Element(xmlns + "lat").Value), Longitude = Convert.ToDouble(ev.Element(xmlns + "Point").Element(xmlns + "long").Value), }; ObservableCollection<SItem2> pushPinCollection = new ObservableCollection<SItem2>(); foreach (var ev in events) { SItem2 PushPin = new SItem2 ( ev.Latitude, ev.Longitude) { }; pushPinCollection.Add(PushPin); } PushPins = pushPinCollection; } ``` other class: ``` namespace observable_collection_test { public class SItem2 { //public DateTimeOffset Date { get; set; } //public string Title //{ get; set; } public double Latitude { get; set; } public double Longitude { get; set; } public GeoCoordinate Location { get; set; } //public Uri Link { get; set; } public SItem2(//string Title, double Latitude, double Longitude) { //this.Date = Date; //this.Title = Title; this.Latitude = Latitude; this.Longitude = Longitude; //this.Location = Location; //this.Link = Link; } } ``` Bit of XAML concerning adding pins to map: ``` <my:Map ZoomBarVisibility="Visible" ZoomLevel="10" CredentialsProvider="AhqTWqHxryix_GnWER5WYH44tFuutXNEPvFm5H_CvsZHQ_U7-drCdRDvcWSNz6aT" Height="508" HorizontalAlignment="Left" Margin="0,22,0,0" Name="map1" VerticalAlignment="Top" Width="456"> <my:MapItemsControl ItemsSource="{Binding PushPins}" > <my:MapItemsControl.ItemTemplate> <DataTemplate> <my:Pushpin Background="Aqua" Location="{Binding Location}" ManipulationCompleted="pin_click"> </my:Pushpin> </DataTemplate> </my:MapItemsControl.ItemTemplate> </my:MapItemsControl> </my:Map> ``` It would also be good to know if I am approaching the pushpin binding to the maps in the right way.
Observable collection issues
CC BY-SA 2.5
null
2011-01-16T15:14:57.453
2011-01-16T18:05:49.967
2011-01-16T18:05:49.967
529,425
529,425
[ "c#", ".net", "silverlight", "windows-phone-7", "observablecollection" ]
4,706,250
1
4,706,274
null
4
12,244
I use a `clear` div in several places in a single HTML file, a la: ``` #clear { clear: both; } ``` usage: ``` <div id="clear"> </div> ``` But W3C's HTML5 validator appears to be complaining that each subsequent use after the initial use is a "duplicate ID": ![le validation errors](https://i.stack.imgur.com/XLpSr.png) Why isn't this valid? How are you supposed to use `clear` divs multiple times on a single page if it isn't technically valid? Note: this is mostly just an informative question, my HTML renders fine on all modern browsers, and given that this is the only error the HTML5 validator can find, I don't reall care, but I'd just like to know why this is considered to be a problem.
W3C validator complaining about duplicate div
CC BY-SA 2.5
null
2011-01-16T15:40:29.677
2013-12-08T08:00:44.567
null
null
18,505
[ "html", "w3c-validation" ]
4,706,550
1
4,706,797
null
0
1,663
I want to place each character on new line. I am using following xml. ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:layout_width="12dip" android:layout_marginLeft="12dip" android:textSize="12dip" android:layout_height="fill_parent" android:text="ABCDEFGHIJKLMNOPQRSTUVWXYZ"/> </LinearLayout> ``` but I am getting output as follow(On some line 2 character are coming) ![alt text](https://i.stack.imgur.com/Ha4o6.png). I know that I can use `\n` but anybody have better option.
Textview placing each character on newline
CC BY-SA 2.5
null
2011-01-16T16:28:58.990
2011-01-16T17:35:30.287
null
null
484,073
[ "android", "textview" ]
4,706,627
1
4,706,666
null
0
1,122
I am making an application that connects to our billing software using its API, and I am running into a few issues getting the layout working properly. ![alt text](https://i.stack.imgur.com/icQ0e.png) I want to make it so that when one of the expanders is minimized, the other window fills the gap, and when it is expanded again the other expander goes back to where it was. Right now when the arrow is clicked on one, there is just an empty gap. I used a DockPanel as the parent which I assumed would automatically do this, but it isn't working. Second question, is there a way to make these areas resizable? I don't want to try and get too frisky with allowing the user to undock the menus (don't even know if that is possible with just straight WPF) but it would be nice if they could change the width/height of them. Also, just a newbie question to C#, but what is the equivalent of a C++ header file? It looks like you just use .cs files, but I am not sure. I want to extract all of my functions that pull the data from the billing software and put them into a different file to clean up the code. Here is my XAML... ``` <Window x:Class="WpfApplication3.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Billing Management" Height="550" Width="754" xmlns:shared="http://schemas.actiprosoftware.com/winfx/xaml/shared" WindowStartupLocation="CenterScreen" WindowStyle="ThreeDBorderWindow"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="22" /> <RowDefinition /> </Grid.RowDefinitions> <Menu Height="22" Name="menu1" Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Top" HorizontalContentAlignment="Left" IsEnabled="True" IsMainMenu="True"> <MenuItem Header="_File"> <MenuItem Header="_Open" /> <MenuItem Header="_Close" /> <Separator/> <MenuItem Header="_Exit" /> </MenuItem> </Menu> <TabControl Name="tabControl1" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" BorderThickness="1" Padding="0" TabStripPlacement="Bottom" UseLayoutRounding="False" FlowDirection="LeftToRight" Grid.Row="1"> <TabItem Header="Main" Name="tabItem1" Margin="0"> <DockPanel Name="dockPanel1" LastChildFill="True"> <ListBox Height="100" Name="listBox3" DockPanel.Dock="Top" /> <ListBox Name="listBox4" Width="200" DockPanel.Dock="Right" /> <DockPanel Height="Auto" Name="dockPanel2" Width="Auto" VerticalAlignment="Stretch" LastChildFill="True"> <shared:AnimatedExpander Header="Staff Online" Width="200" Name="expanderStaffOnline" IsExpanded="True" Height="194" BorderThickness="0" DockPanel.Dock="Top" VerticalContentAlignment="Stretch"> <ListBox Name="listboxStaffOnline" Width="Auto" Height="Auto" Margin="0" VerticalAlignment="Stretch" Loaded="listboxStaffOnline_Loaded" /> </shared:AnimatedExpander> <shared:AnimatedExpander Header="Test Menu 2" Height="Auto" Name="animatedExpander1" BorderThickness="1" Margin="0,0,0,0" IsExpanded="True" VerticalContentAlignment="Stretch"> <ListBox Height="Auto" HorizontalAlignment="Stretch" Name="listBox6" VerticalAlignment="Stretch" Margin="0" BorderThickness="1" /> </shared:AnimatedExpander> </DockPanel> <ListBox Height="100" Name="listboxAdminLogs" DockPanel.Dock="Bottom" Loaded="listboxAdminLogs_Loaded" /> <ListBox Name="listBox5" /> </DockPanel> </TabItem> <TabItem Header="Support" Name="tabItem2" Margin="0"> </TabItem> <TabItem Header="Clients" /> <TabItem Header="Billing" /> <TabItem Header="Orders" /> </TabControl> </Grid> </Window> ```
WPF Issues with Control Layout
CC BY-SA 2.5
null
2011-01-16T16:41:51.453
2011-01-16T16:51:24.173
null
null
null
[ "c#", ".net", "wpf", "controls" ]
4,706,668
1
4,707,734
null
2
307
I have a grass texture: ![alt text](https://i.stack.imgur.com/iJkCc.png) I use it in my 2d-game. I want to animate it by code, without any predefined animations. The grass should interact with wind. So when the wind is stronger, the grass should stoop into need side more. First version of animation I made using sinusoid function, but such animation is a bit ugly, because the base of the grass moves left/right like all another part of picture. And with sinusoid I'm not able to regulate stoop of the image. ![alt text](https://i.stack.imgur.com/hGg0O.png) Any advices?
Some math and animation
CC BY-SA 2.5
0
2011-01-16T16:51:27.683
2011-01-17T09:49:11.030
null
null
87,152
[ "math", "animation" ]
4,707,332
1
4,707,368
null
11
12,812
I have a form where the labels are on the left and the fields on the right. This layout works great when the labels have small amounts of text. I can easily set a `min-width` on the labels to ensure they all have the same distance to the fields. In the first picture below, this works as expected. A problem arises when the label's text becomes too long, it'll either overflow to the next line or push the field on the same line over to the left (as seen in picture 2). This doesn't push the labels so it is left with a "jagged" look. Ideally, it should like to style it as picture 3 with something like the following markup: ``` <fieldset> <label>Name</label><input type="text" /><br /> <label>Username</label><input type="text" /> </fieldset> ``` I [created a jsFiddle](http://jsfiddle.net/rQ99r/3/) to show the issue. ![alt text](https://i.stack.imgur.com/q9IXE.png) Of course, the way to solve this would be to use tables. That just creates tag-hell for something that should be so simple. Note: this does need to support IE6.
How to align all fields as label width grows
CC BY-SA 2.5
0
2011-01-16T18:50:45.627
2017-09-05T13:58:37.770
null
null
200,322
[ "html", "css" ]
4,707,430
1
4,707,479
null
1
334
As per [The Java Programming Language(by Arnold Gosling)](http://books.google.co.in/books?id=6vwJlH1aYCUC&printsec=frontcover&dq=the+java+programming+language&hl=en&ei=Vj4zTdPZKsPXrQeokJ3lCA&sa=X&oi=book_result&ct=result&resnum=1&ved=0CDMQ6AEwAA#v=onepage&q&f=false) (ref pg. 275) if we use `abstract` explicitly before a method declaration in an interface, We can > skip the method method in the implementation class. As per the example: ``` interface Sheet{ public double computeArea(); public abstract double computePerimter(); } class Sphere implements Sheet{ // Some data members and constructors. public double computeArea() { ... } // No implementation of computePerimeter } ``` But when i tried creating an object of the Sphere class, i showed up an error that the computePermeter method hasnt been overloaded(that should has been the case). But as per the context, you could `skip` the method if it has been `explicitly declared` as `abstract`.However there has to be a class implementating that method. Arent the methods in an interface implicitly abstract?? Or am i interpreting it wrongly?? The `explicit abstract` has confused me a bit.. please help.. ![alt text](https://i.stack.imgur.com/8z4LL.png) ![alt text](https://i.stack.imgur.com/Ngsa7.png) ![alt text](https://i.stack.imgur.com/6aiUg.png)
Using keyword abstract in methods in java
CC BY-SA 2.5
null
2011-01-16T19:06:33.860
2011-01-16T19:31:33.783
2011-01-16T19:31:33.783
1,534,386
1,534,386
[ "java" ]
4,707,528
1
4,707,570
null
4
773
It appears that sometime after I installed VS2010 sp1 autocomplete now requires me to push the down arrow to select the object I'm typing. For example the old behaviour was to just type the object name and press enter: ![alt text](https://i.stack.imgur.com/nQOFN.png) The new behavior is to press the down arrow and enter. Screen shot of unselected item below (Possibly caused by VS2010 SP1 ): ![alt text](https://i.stack.imgur.com/OOAP6.png) This is so bothersome, and I checked tools: options but didn't see the correct option. Does anyone know how to fix this ;)
Has VS2010 with SP1 intellisense changed autocomplete defaults?
CC BY-SA 3.0
0
2011-01-16T19:26:23.770
2011-06-24T16:37:11.440
2011-06-24T16:37:11.440
328,397
328,397
[ "visual-studio", "intellisense", "visual-studio-2010" ]
4,707,607
1
4,707,676
null
59
52,048
### Background For my final project at university, I'm developing a vehicle license plate detection application. I consider myself an intermediate programmer, however my mathematics knowledge lacks anything above secondary school, which makes producing the right formulas harder than it probably should be. I've spend a good amount of time looking up academic papers such as: - [Detecting Vehicle License Plates in Images](http://www.scribd.com/doc/266575/Detecting-Vehicle-License-Plates-in-Images)- [Robust License Plate Detection using Image Saliency](http://www.cic.unb.br/%7Emylene/PI_2010_2/ICIP10/pdfs/0003945.pdf)- [Local Enhancement of Car Image for License Plate Detection](http://www.eurasip.org/Proceedings/Eusipco/Eusipco2007/Papers/d3l-b05.pdf) When it comes to the math, I'm lost. Due to this testing various graphic images proved productive, for example: ![alt text](https://i.stack.imgur.com/xPxvv.jpg) to ![alt text](https://i.stack.imgur.com/y71r9.jpg) However this approach only worked to that particular image, and if the techniques were applied to different images, I'm sure a poorer conversion would occur. I've read about a formula called the "bottom hat morphology transform", which does the following: > Basically, the trans- formation keeps all the dark details of the picture, and eliminates everything else (including bigger dark regions and light regions). I can't find much information on this, however the image within the documentation near the end of the report shows its effectiveness. ### Other constraints - - - # Question I need advice on what transformation techniques I should focus on developing, and what algorithms can help me. EDIT: New information present on [Continued - Vehicle License Plate Detection](https://stackoverflow.com/questions/4727119/continued-vehicle-license-plate-detection)
What are good algorithms for vehicle license plate detection?
CC BY-SA 3.0
0
2011-01-16T19:40:20.850
2018-11-27T01:09:28.270
2020-06-20T09:12:55.060
-1
408,757
[ "c#", "image", "computer-vision", "ocr", "object-detection" ]
4,708,092
1
null
null
2
1,216
Im having a real headache binding my items to pushpins on a silverlight bing map. Ive spent all day trying to get my collection sorted and now just cant get the pushpins to show up. The items appear to be there as when you do a breakpoint on the last line as per the image below, all 143 items are there in _PushPins: ![alt text](https://i.stack.imgur.com/Pk7DO.gif) Any help welcome. many thanks. Here is the code: ``` namespace observable_collection_test { public partial class Map : PhoneApplicationPage { public Map() { InitializeComponent(); GetItems(); } private ObservableCollection<SItem2> pushPins; public ObservableCollection<SItem2> PushPins { get { return this.pushPins; } set { this.pushPins = value; this.OnPropertyChanged("PushPins"); } } public event PropertyChangedEventHandler PropertyChanged; public void OnPropertyChanged(string propertyName) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } public void GetItems() { var document = XDocument.Load("ListSmall.xml"); if (document.Root == null) return; var xmlns = XNamespace.Get("http://www.blah"); var events = from ev in document.Descendants("item") select new { Latitude = Convert.ToDouble(ev.Element(xmlns + "Point").Element(xmlns + "lat").Value), Longitude = Convert.ToDouble(ev.Element(xmlns + "Point").Element(xmlns + "long").Value), }; this.PushPins = new ObservableCollection<SItem2>(); foreach (var ev in events) { var pushPin = new SItem2(ev.Latitude, ev.Longitude); //Location = new GeoCoordinate(ev.Latitude, ev.Longitude ) this.PushPins.Add(pushPin); } } ``` Other class: ``` namespace observable_collection_test { public class SItem2 { public double Latitude { get; set; } public double Longitude { get; set; } public SItem2(double Latitude, double Longitude) { this.Latitude = Latitude; this.Longitude = Longitude; } public Location Location { get; set; } } } ``` XAML: ``` <my:Map ZoomBarVisibility="Visible" ZoomLevel="10" CredentialsProvider="xxxxx" Height="508" HorizontalAlignment="Left" Margin="0,22,0,0" Name="map1" VerticalAlignment="Top" Width="456" ScaleVisibility="Visible"> <my:MapItemsControl ItemsSource="{Binding PushPins}" > <my:MapItemsControl.ItemTemplate> <DataTemplate> <my:Pushpin Background="Aqua" Location="{Binding Location}" ManipulationCompleted="pin_click"> </my:Pushpin></DataTemplate> </my:MapItemsControl.ItemTemplate> </my:MapItemsControl> </my:Map> ```
Bing maps binding trouble
CC BY-SA 2.5
null
2011-01-16T21:12:38.037
2011-09-06T16:22:38.200
2011-01-17T21:16:08.210
529,425
529,425
[ "c#", "silverlight", "windows-phone-7", "observablecollection", "bing-maps" ]
4,708,150
1
4,708,249
null
2
7,191
Greetings! I've been fooling around (a bit) with C# and its assemblies. And so i've found such an interesting feature as dynamic loading assemblies and invoking its class members. A bit of google and here i am, writing some kind of 'assembly explorer'. (i've used some portions of code from [here](https://stackoverflow.com/questions/1137781/c-correct-way-to-load-assembly-find-class-and-call-run-method), [here](http://www.codeproject.com/KB/cs/DynLoadClassInvokeMethod.aspx) and [here](http://gsraj.tripod.com/dotnet/reflection.html) and none of 'em gave any of expected results). But i've found a small bug: when i tried to invoke class method from assembly i've loaded, application raised MissingMethod exception. I'm sure DLL i'm loading contains class and method i'm tryin' to invoke (my app ensures me as well as ): ![alt text](https://i.stack.imgur.com/rAcV8.jpg) The main application code seems to be okay and i start thinking if i was wrong with my DLL... Ah, and i've put both of projects into one solution, but i don't think it may cause any troubles. And yes, DLL project has 'class library' target while the main application one has 'console applcation' target. what's wrong with 'em? Here are some source code: ``` using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ClassLibrary1 { public class Class1 { public void Main() { System.Console.WriteLine("Hello, World!"); } } } ``` ``` using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Reflection; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { Assembly asm = Assembly.LoadFrom(@"a\long\long\path\ClassLibrary1.dll"); try { foreach (Type t in asm.GetTypes()) { if (t.IsClass == true && t.FullName.EndsWith(".Class1")) { object obj = Activator.CreateInstance(t); object res = t.InvokeMember("Main", BindingFlags.Default | BindingFlags.InvokeMethod, null, obj, null); // Exception is risen from here } } } catch (Exception e) { System.Console.WriteLine("Error: {0}", e.Message); } System.Console.ReadKey(); } } } ``` worked for one case - when DLL method takes no arguments: ``` public class Class1 { public static void Main() { System.Console.WriteLine("Hello, World!"); } } ``` ``` object res = t.InvokeMember("Main", BindingFlags.Default | BindingFlags.InvokeMethod, null, null, null); ```
C# 'could not found' existing method
CC BY-SA 2.5
null
2011-01-16T21:20:53.677
2011-01-19T21:20:07.747
2020-06-20T09:12:55.060
-1
330,471
[ "c#", ".net", "reflection", "assemblies", "runtime" ]
4,708,285
1
4,749,723
null
1
274
I am using a TTTableSubtitleItem with UITableViewStyleGrouped. When viewing the tableView, the image that is in the TTTableSubtitleItem gets skewed to fit the image view (rather than just placing image without changing dimensions) and also the image does not get a rounded edge when it is the first item in the section. ![alt text](https://i.stack.imgur.com/1jBGg.png) Does anyone know of a way to fix these two issues?
TTTableSubtitleItem squishes image and does not clip it?
CC BY-SA 2.5
0
2011-01-16T21:47:34.297
2011-01-20T16:26:57.243
null
null
144,695
[ "iphone", "ios", "uitableview", "three20" ]
4,708,454
1
4,708,504
null
5
659
I am going through page life cycle.When i referring the following ![alt text](https://i.stack.imgur.com/dEmHX.png) there the LoadPostData() method is expressed as (First Try) later (Second Try).What does here try refer to?
ASP.Net page Life Cycle
CC BY-SA 2.5
0
2011-01-16T22:16:52.980
2011-12-28T09:47:58.033
null
null
573,204
[ "asp.net", "events" ]
4,708,513
1
4,710,388
null
4
1,441
Consider a SQL Server CE 4 table with a non-nullable column: `FooDate`. The goal is to have the current UTC datetime as the default. > The function is not recognized by SQL Server Compact. Name of function GetUTCDate. The function `GetDate()` works as expected as a default to a `datetime` column in SQL Server Compact 4. Is `GetUTCDate()` supported in SQL Server CE 4 at all? ![alt text](https://i.stack.imgur.com/Yggpl.png)
Using GetUTCDate in SQL Server CE 4
CC BY-SA 2.5
null
2011-01-16T22:26:01.970
2011-01-17T05:56:32.057
null
null
23,199
[ "sql-server-ce", "webmatrix", "sql-server-ce-4" ]
4,708,613
1
4,708,735
null
36
35,411
I want to plot the pitch of a sound into a graph. Currently I can plot the amplitude. The graph below is created by the data returned by `getUnscaledAmplitude()`: ![alt text](https://i.stack.imgur.com/a2pVM.jpg) ``` AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(new BufferedInputStream(new FileInputStream(file))); byte[] bytes = new byte[(int) (audioInputStream.getFrameLength()) * (audioInputStream.getFormat().getFrameSize())]; audioInputStream.read(bytes); // Get amplitude values for each audio channel in an array. graphData = type.getUnscaledAmplitude(bytes, 1); public int[][] getUnscaledAmplitude(byte[] eightBitByteArray, int nbChannels) { int[][] toReturn = new int[nbChannels][eightBitByteArray.length / (2 * nbChannels)]; int index = 0; for (int audioByte = 0; audioByte < eightBitByteArray.length;) { for (int channel = 0; channel < nbChannels; channel++) { // Do the byte to sample conversion. int low = (int) eightBitByteArray[audioByte]; audioByte++; int high = (int) eightBitByteArray[audioByte]; audioByte++; int sample = (high << 8) + (low & 0x00ff); toReturn[channel][index] = sample; } index++; } return toReturn; } ``` But I need to show the audio's pitch, not amplitude. [Fast Fourier transform](http://en.wikipedia.org/wiki/Fast_Fourier_transform) appears to get the pitch, but it needs to know more variables than the raw bytes I have, and is very complex and mathematical. Is there a way I can do this?
Graphing the pitch (frequency) of a sound
CC BY-SA 2.5
0
2011-01-16T22:46:09.413
2016-01-18T18:52:48.483
2011-01-16T22:52:52.780
224,004
224,004
[ "java", "audio", "fft", "frequency", "pitch" ]
4,708,772
1
null
null
2
251
![](https://i.stack.imgur.com/QZMPg.png) How can I get this kind of map view in my application? Any examples?
How to get a map view in an iPhone app
CC BY-SA 3.0
0
2011-01-16T23:19:31.197
2012-02-19T07:51:48.253
2012-02-19T07:51:48.253
561,309
465,800
[ "iphone" ]
4,708,893
1
4,709,070
null
3
179
I am trying to figure out the best design for a custom floating "pallet" for initiating actions (e.g., change sorting criteria of a list) as well as switching views (e.g., Help, Options). I want the pallet to start out collapsed so the initial view is full-screen. When the user touches the corner of the screen the view slides into place with animation. Another touch slides the view out of the way. The best example of the UI I am going for is one of my favorite apps, the iThoughts mind mapper (see below). How is this done? I really want to learn how the pros create such beautiful apps. Most of the help I find points me in the direction of the standard UITabbar, UIToolbar, etc. Yawn. Thanks! ![alt text](https://i.stack.imgur.com/ohh63.png) ![alt text](https://i.stack.imgur.com/ssYoU.png)
How do they do that?... avoiding a boring, standard cookie-cutter iPhone app
CC BY-SA 2.5
null
2011-01-16T23:41:27.270
2011-01-17T00:30:37.890
null
null
413,631
[ "iphone", "uiview", "uiviewcontroller", "custom-controls", "uitoolbar" ]
4,709,026
1
4,710,211
null
15
31,132
Before today I would have said this is just not possible, to have an app that runs overlayed on top of everything else: home screens, apps, dialer, etc. If you try the free application "Super Manager" it does exactly this. It has an icon and widget like screen that will show up always and everywhere. While the icon or widget is on the screen you can still interact with the app running behind it. How is this possible and how can we recreate this functionality? Update: Here is some images of it in action. You can see the overlayed application running as a small arrow on top of Dolphin. Then when you press it you can see the application running as a big widget kind of thing. Even while the widget is up you can still interact with the background app. In this example dolphin is the background app. ![Image 1](https://i.stack.imgur.com/NKw1X.jpg) ![alt text](https://i.stack.imgur.com/m9jvg.jpg)
Android app that runs on top of ALL other apps?
CC BY-SA 2.5
0
2011-01-17T00:20:08.507
2016-05-04T13:19:58.017
2011-01-17T01:12:12.213
242,904
242,904
[ "android" ]
4,709,215
1
4,709,613
null
2
9,419
I have a navigation menu that I'm trying to recreate using only CSS3 and HTML. The design calls for a shine/glow on the currently selected menu button as per the "home" button on the attached pic. Is that effect possible using just code or will I need to use the glow image?! ![alt text](https://i.stack.imgur.com/lx7G5.jpg) Notice the shine and white line is most visible towards the center of the button and then fades towards the edges.
Button shine/glow with CSS3
CC BY-SA 2.5
0
2011-01-17T01:07:50.337
2013-07-11T11:46:47.087
null
null
541,744
[ "css" ]
4,709,289
1
4,719,217
null
2
201
I'm using Entity Framework CTP5. I have a schema like this: - - - So there are 4 tables. one-to-many many-to-many many-to-one . ![my model](https://i.stack.imgur.com/8phjk.png) So I have a many-to-many relationship where the relation also holds data. Definitions of Text and TextDescription ( since we can query on the Id for Group and Languages I havent added them here ) ``` public class Text { public int TextID { get; set; } public int TextDescriptionID { get; set; } public int LanguageID { get; set; } public string OriginalText { get; set; } public bool IsValid { get; set; } public DateTime Added { get; set; } public DateTime Updated { get; set; } public Language Language { get; set; } public TextDescription TextDescription { get; set; } public static Text GetMissingText(string input) { Text text = new Text(); text.OriginalText = "Missing: " + input; text.IsValid = true; text.TextDescription = new TextDescription() { IsStatic = true, Name = input, IsMultiline = false, }; return text; } } public class TextDescription { public int TextDescriptionId { get; set; } public int TextDescriptionGroupId { get; set; } public string Name { get; set; } public string Description { get; set; } public bool UseHtml { get; set; } public bool IsMultiline { get; set; } public bool IsStatic { get; set; } public TextDescriptionGroup TextDescriptionGroup { get; set; } public virtual ICollection<Text> Texts { get; set; } public static TextDescription GetNewItem(int textDescriptionGroupId) { var item = new TextDescription(); item.Name = item.Description = "n/a"; item.UseHtml = item.IsMultiline = item.IsMultiline = false; item.TextDescriptionGroupId = textDescriptionGroupId; return item; } } ``` When adding either a new language or a new text is inserted ... the many to many relation is not inserted into the database. (Think it would be a bad idea, so in the end, if thats the only solution, I could be able to that) So how do I handle this in a smart way when I need to fetch all the for a specific group from the database, but also get the translation if there are one for that languages. I can't start fra the translation object, since its possible its not there. If I start to query from the Text entity ... how do I only select one language without getting all languages first. ``` repo.Find(x => x.GroupId == groupId && x.Translation.Any(a => a.LanguageID == id.Value) ); ``` I'm lost here ... any there any smart way ... so I wont have to query the database for all the Texts ... and then a query for each item ... to see if there are a translation? or else just make a new empty one. In SQL I would do it like this: ``` SELECT TD.Name, T.OriginalText FROM TextDescriptions TD LEFT JOIN Texts T ON TD.TextDescriptionId = T.TextDescriptionId WHERE TextDescriptionGroupId = 41 AND ISNULL(T.LanguageId, 1) = 1 ``` The above SQL will give me the elements even if there is not record now, I get a NULL for these values. I could then handle that it my code and avoid lazy load. But can I get the same behavior in Entity Framework. I could see there would be some problems maybe for EF4 to do the mapping ... since I'm going from TextDesciptions to Texts ... and TextDesciptions have a List of Texts ... but here ... I only want either 1 or NULL, or just a new Entity that havent been added to the database yet. Looking forward to some interesting answers. mvh
entity framework when many to many is holding data
CC BY-SA 3.0
0
2011-01-17T01:28:01.160
2013-04-08T15:12:52.603
2013-04-08T15:12:52.603
558,486
196,872
[ "c#", ".net", "entity-framework-4", "entity-relationship", "ef4-code-only" ]
4,709,411
1
null
null
2
2,243
I'm using C++ and Qt's (4.6) model/view framework and wondering what is the correct way to change the display of items in a `QListView` or a class derived from `QListView` from: ![alt text](https://i.stack.imgur.com/BxJsR.png) to: ![alt text](https://i.stack.imgur.com/fiXcx.png) I'm not concerned about the sort order or `Flow`, I'm interested in the best way to correctly position the text to the right of the icon. If this can only be done by writing a custom `QStyledItemDelegate` that's totally fine, I want to rule out whether this is the correct approach or whether it's best to look at setLayout or similar, example code would help. The example application I'm looking at is the 'interview' example from qtdemo which amongst other things displays icons and text in a `QListView`.
What is the correct way to customize Icon and Text position of items in a QListView?
CC BY-SA 2.5
null
2011-01-17T01:52:09.337
2013-07-10T08:20:46.490
2011-01-17T07:23:14.683
57,465
57,465
[ "c++", "qt" ]
4,709,379
1
4,730,762
null
2
928
Short: I need to a key, which holds a (fixed length, but chosen at runtime) of arbitrary objects (for which not only , but also determines ). however `[isEqual:]`. Now what? --- Long: I have an entity (see diagram image for entity "…Link") in my Core Data model for which I have to guarantee uniqueness based on an attribute key ("tuple"). So far so good. The entity's however has to be an . And to make things a bit more difficult I of the . Nor do I know the tuple's element count. Well, actually the count is the same for every tuple (per core data context at least), but not known before the app runs. There must of my link entity . And for obvious reason only ever one tuple instance with a given array of arbitrary objects. Whereas two tuples are to be considered equal if `[tuple_1 isEqual:tuple_n]` returns `YES`. of `[isEqual:]` and `[hash]` though, otherwise things would be pretty much a piece of cake. are created together with their array of tokens (via a convenience method) and (and so is each "…Token" and its data attribute). (think of "…Tuple" as a "…Link"'s dictionary key.) "…Tuple" implements `"- (NSArray *)tokens;"`, which , based on the "order" keys of "…TokenOrder". ( are expected to .) I however (potentially even more in some edge cases) of "…Link" objects, which I have to (frequently) . Sadly I couldn't find any article (let alone solution) for such a scenario in any literature or the web. Any ideas? ![core data model](https://i.stack.imgur.com/sn2kd.jpg) A possible solution I've come up with so far would be: 1. Narrow amount of elements to compare by tuple by adding another attribute to "…Tuple" called "tupleHash", which is pre-calculated on object creation via: Snippet 1 2. Query with NSPredicate for objects of matching tupleHash (narrowing down the list of candidates quite a bit). 3. Find "…Link" featuring given tuple in narrowed candidate list by: Snippet 1 ``` NSUInteger tupleHash = [[self class] hash]; for (id token in self.tokens) { tupleHash ^= [token.data hash]; } ``` ``` __block NSArray *tupleTokens = someTokens; NSArray *filteredEntries = [narrowedCandidates filteredArrayUsingPredicate: [NSPredicate predicateWithBlock: ^(id evaluatedObject, NSDictionary *bindings) { return [evaluatedObject.tuple.tokens isEqualToArray:tupleTokens]; }]]; ``` Good idea of or just insane? Thanks in advance!
Finding objects in Core Data by array attribute, performantly in >10k elements
CC BY-SA 2.5
0
2011-01-17T01:46:52.923
2011-01-19T01:04:05.917
2011-01-17T16:09:02.517
227,536
227,536
[ "objective-c", "cocoa", "core-data", "nsarray", "unique-key" ]
4,709,596
1
4,709,858
null
1
198
I'm adding a spellcheck to my application, and have added the [Vectorlight Spell Check Component](http://www.vectorlight.net/silverlight/controls/spell_checker.aspx) to my project. When the spellcheck button is clicked I'd like to have the project make it have a pop-down wherever a spelling error occurs, and then have a pop-down list of suggestions similar to the contextual suggestions that Visual Studio gives you. Example: ![alt text](https://i.stack.imgur.com/AryOP.png) Is this doable in Silverlight 4.0 with C#? If so, what is the control called? If not possible, then perhaps have the word get the squiggly red underline and when you right-click it then that menu has the suggestions? I've no idea how to populate the right-click menu in Silverlight either. (I would imagine I'll have to change to a RichTextBox in order to have the underline bit work - correct me if I'm wrong) Thanks in advance for your help! -Sootah
Silverlight C# - Is it possible to add a contextual pop-down list to a textbox? (Example image attached)
CC BY-SA 2.5
0
2011-01-17T02:42:54.890
2011-01-17T03:41:32.517
null
null
297,092
[ "c#", "visual-studio", "silverlight", "web-applications", "silverlight-4.0" ]
4,709,611
1
null
null
0
1,195
I have a simple LINQ EF query below using the method syntax. I'm using my Include statement to join four tables: Event and Doc are the two main tables, EventDoc is a many-to-many link table, and DocUsage is a lookup table. My challenge is that I'd like to shape my results by only selecting specific columns from each of the four tables. But, the compiler is giving a compiler is giving me the following error: 'System.Data.Objects.DataClasses.EntityCollection does not contain a definition for "Doc' and no extension method 'Doc' accepting a first argument of type 'System.Data.Objects.DataClasses.EntityCollection' could be found. I'm sure this is something easy but I'm not figuring it out. I haven't been able to find an example of someone using the multi-table include but also shaping the projection. Thx,Mark ``` var qry= context.Event .Include("EventDoc.Doc.DocUsage") .Select(n => new { n.EventDate, n.EventDoc.Doc.Filename, //<=COMPILER ERROR HERE n.EventDoc.Doc.DocUsage.Usage }) .ToList(); EventDoc ed; Doc d = ed.Doc; //<=NO COMPILER ERROR SO I KNOW MY MODEL'S CORRECT DocUsage du = d.DocUsage; ``` ![alt text](https://i.stack.imgur.com/9KsZ1.png)![alt text](https://i.stack.imgur.com/k4F7F.png)
Shaping EF LINQ Query Results Using Multi-Table Includes
CC BY-SA 2.5
null
2011-01-17T02:47:23.310
2011-01-17T19:07:39.113
2011-01-17T19:07:39.113
462,477
462,477
[ "linq", "entity-framework" ]
4,709,735
1
null
null
0
936
I have a tough one, well it's tough for me because I'm kinda new to the whole jQuery carousel thing, never built one before this project. Here's my problem. If you go to the [TEST SITE](http://174.120.239.48/~peakperf) you will see a scroller with a blue background about half way down the page. If you mouse onto the "data analytics" slide you should see a black box fade in. Here is my dilemma. I want that black box to be a menu that's connected to the data analytics slide. I've done a mock up for you so you can see what I'm talking about. ![alt text](https://i.stack.imgur.com/RnmWj.gif) Here is my scroller code. I'm using jCarousel. ``` <div class="carousel"> <ul> <li> <div id="homeslide1"> testers sdfasdfasdfas asdftjhs iasndkad kasdnf <a href="#" id="#homeslide1-toggle">Close this</a> </div> <a href="#" id="homeslide1-show"><img src="<?php bloginfo('template_url'); ?>/images/home_data_analytics.jpg" width="200" height="94" /></a> </li> <li><img src="<?php bloginfo('template_url'); ?>/images/home_oem_partnerships.jpg" width="200" height="94" /></li> <li><img src="<?php bloginfo('template_url'); ?>/images/home_reporting.jpg" width="200" height="92" /></li> <li><img src="<?php bloginfo('template_url'); ?>/images/home_returning_lost_customers.jpg" width="200" height="92" /></li> <li><img src="<?php bloginfo('template_url'); ?>/images/home_sales.jpg" width="200" height="92" /></li> <li><img src="<?php bloginfo('template_url'); ?>/images/home_service_retention.jpg" width="200" height="92" /></li> </ul> ``` Here is my scroller css ``` /*HOMEPAGE SCROLLER*/ .carousel {!important padding:10px; width: 890px; margin: 0px 0px 0px 26px;} .carousel ul li element.style{height: 94px;} .carousel ul{width: 200px; padding: 5px;} .carouselitem{height: 94px;} .prev{background: url(images/home_left_scroll.png); height: 94px; width: 16px; text-indent: -999px; outline: none; cursor:pointer; float: left;} .next{background: url(images/home_right_scroll.png); height: 94px; width: 16px; text-indent: -999px; outline: none; cursor:pointer; float: right;} .carousel ul li{ padding: 0px 3px 0px 3px; margin: 0px; height:!important 94px; } .home_right_arrow{ width: 16px; float: right;} .home_left_arrow{ width: 16px; float: left;} .homeslide1{ width: 200px; height: 94px;} ``` I've tried all sorts of z-index tricks but can't seem to figure it out on my own. If you solve this riddle I'll buy you a beer if we ever meet up. I'll also give you a high five through the internet. Is there a simple way to do this via jQuery? If so could you point me in the right direction? Thanks so much.
Adding a div layer on top of a jquery carousel. Tough one
CC BY-SA 2.5
null
2011-01-17T03:19:30.363
2011-01-20T21:19:02.253
2011-01-17T07:14:54.733
106,224
247,701
[ "jquery", "css", "jquery-plugins", "css-float" ]
4,710,104
1
4,710,122
null
8
7,578
![alt text](https://i.stack.imgur.com/R1Vt1.gif) When I click the plus sign, the code would automatically collapse. Is there any plugin like this?
Is there any code-collapse-plugin of vim like this?
CC BY-SA 2.5
0
2011-01-17T04:48:33.793
2011-01-17T04:56:18.613
null
null
193,251
[ "vim" ]
4,710,244
1
4,710,272
null
1
102
I have been developing a WPF application and this morning a test user reported a strange bug in the UI. All of a sudden in only this application it has replaced all of the text with blocks (see image below) ![alt text](https://i.stack.imgur.com/dvBog.jpg) I have tried restoring the application, uninstalling it off the machine and then reinstalling it - but no luck. Anyone have an idea what could be causing the problem? The program works fine on everyone else's machines (he is using Windows XP SP3)
Strange UI error with text turning to blocks on WPF application
CC BY-SA 2.5
null
2011-01-17T05:23:34.913
2011-01-17T05:30:47.800
null
null
215,546
[ "wpf" ]
4,710,428
1
null
null
1
924
Anybody please give me some idea that how can i implement multiple UIWebView in UIView just like in BBC App. ![alt text](https://i.stack.imgur.com/dR8Qo.jpg)
Multiple UIWebView in UIView
CC BY-SA 2.5
null
2011-01-17T06:06:28.493
2011-01-17T07:28:38.297
null
null
487,342
[ "iphone", "uiwebview", "uiscrollview" ]
4,710,517
1
4,710,554
null
0
2,479
I want to fetch feeds in my webpage. The feed link is : [News](http://timesofindia.feedsportal.com/c/33039/f/533916/index.rss). I have tried this code : ``` <!-- To change this template, choose Tools | Templates and open the template in the editor. --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Gmail</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script type="text/javascript" src="jquery-1.4.4.js"></script> <script type="text/javascript"> var xmlhttp; function fetchFeed(){ if(window.XMLHttpRequest){ $.ajax({ type: "GET", url: "http://timesofindia.feedsportal.com/c/33039/f/533916/index.rss", success: function(xml) { var i=0; alert($(xml).find('item').length); $(xml).find('item').each(function(){ alert($(this).find('title').text()); i++; }); }, error: function(XMLHttpRequest, textStatus, errorThrown) { alert("XMLHttpRequest: " + XMLHttpRequest + "\nTextStatus : " + textStatus + "\nError Thrown: " + errorThrown); } }); } } </script> </head> <body> <div id="gmailForm"></div> <input type="button" value="submit" onclick="fetchFeed()"/> </body> </html> ``` Well, this works properly in IE & gives output as : ![ie](https://i.stack.imgur.com/nyrP9.jpg) But, not working in Chrome : ![chrome](https://i.stack.imgur.com/pEYTG.jpg) & also not in FireFox : ![firefox](https://i.stack.imgur.com/3ARJz.jpg) Where is my error ?
xmlhttprequest not working with all browser
CC BY-SA 2.5
null
2011-01-17T06:23:30.643
2011-01-17T08:40:34.647
null
null
null
[ "jquery", "internet-explorer", "firefox", "google-chrome", "xmlhttprequest" ]
4,710,530
1
null
null
2
395
I've added a few custom fonts to a Silverlight project. However, their behavior is very sporadic. I'm using it in a custom control. When I first add the control, it displays fine. When I rebuild, the font changes back to default. When I view the app in a browser, it also uses the default font. The font is embedded as a resource. ![Silverlight issue](https://i.stack.imgur.com/U3t6M.png) The top is right after I've added the control to the designer, the bottom is the app in the browser. I have no clue what is causing this. If you need the code for the control, I can provide it. ``` <UserControl x:Class="MindWorX.CustomPropertyReproduction.Controls.BorderedTextBlock" 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" Height="100" Width="200"> <Grid x:Name="LayoutRoot"> <Border BorderThickness="1" BorderBrush="Lime"> <TextBlock Name="MainTextBlock" Margin="4" TextWrapping="Wrap" /> </Border> </Grid> </UserControl> ``` ``` using System; using System.Windows; using System.Windows.Controls; using System.Windows.Media; namespace MindWorX.CustomPropertyReproduction.Controls { public partial class BorderedTextBlock : UserControl { public static readonly DependencyProperty TextProperty = DependencyProperty.Register("Text", typeof(String), typeof(BorderedTextBlock), new PropertyMetadata("TextBlock", new PropertyChangedCallback(OnTextChanged))); private static void OnTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { BorderedTextBlock sender = (d as BorderedTextBlock); sender.MainTextBlock.Text = (String)e.NewValue; } new public static readonly DependencyProperty FontFamilyProperty = DependencyProperty.Register("FontFamily", typeof(FontFamily), typeof(BorderedTextBlock), new PropertyMetadata(new FontFamily("Portable User Interface"), new PropertyChangedCallback(OnFontFamilyChanged))); private static void OnFontFamilyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { BorderedTextBlock sender = (d as BorderedTextBlock); sender.MainTextBlock.FontFamily = (FontFamily)e.NewValue; } new public static readonly DependencyProperty FontSizeProperty = DependencyProperty.Register("FontSize", typeof(Double), typeof(BorderedTextBlock), new PropertyMetadata(11d, new PropertyChangedCallback(OnFontSizeChanged))); private static void OnFontSizeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { BorderedTextBlock sender = (d as BorderedTextBlock); sender.MainTextBlock.FontSize = (Double)e.NewValue; } public BorderedTextBlock() { InitializeComponent(); } public String Text { get { return (String)GetValue(TextProperty); } set { SetValue(TextProperty, value); } } new public FontFamily FontFamily { get { return (FontFamily)GetValue(FontFamilyProperty); } set { SetValue(FontFamilyProperty, value); } } new public Double FontSize { get { return (Double)GetValue(FontSizeProperty); } set { SetValue(FontSizeProperty, value); } } } } ```
Silverlight Random Font Bug
CC BY-SA 2.5
null
2011-01-17T06:26:27.767
2011-01-20T18:53:40.810
2011-01-20T14:56:22.197
518,246
518,246
[ "silverlight", "xaml", "embedded-fonts" ]
4,710,671
1
4,710,750
null
0
701
I'm beginner in `ASP.Net`.I'm know developing the small project for searching data from DB. I use ASP.Net web form and ADO.Net.I would like to show the data list like stackoverflow because I don't want to use `GridView`. I've some data fields to show example. - - - - Please check out my screen shoot now I use `Literal` for draft. ![alt text](https://i.stack.imgur.com/SXYbo.png) so Please point to me what control I should use and that control will attach with `Pager` for the data list. Important: Please let me know how to make layout template for the data list (Details) Thanks
Stackoverflow style data list view
CC BY-SA 2.5
null
2011-01-17T06:49:11.723
2011-01-17T07:00:52.367
null
null
463,731
[ "asp.net", "view", "datalist" ]
4,710,709
1
4,710,716
null
0
542
I have a database with a listing for every city in the US based on zip code. By nature it has a city/state listing for every zip code in the US which produces several city/state duplicates. I want to perform a SELECT that returns a single row for each city/state. I have included a screenshot of the database structure for reference. `num` is PRIMARY. What would the syntax be for this? ![alt text](https://i.stack.imgur.com/67xpp.jpg)
Using MySQL syntax to select based on unique columns?
CC BY-SA 2.5
null
2011-01-17T06:54:06.450
2011-01-17T07:08:59.933
null
null
255,255
[ "mysql", "select" ]
4,711,099
1
4,711,175
null
2
558
Can anyone tell me that how can i rotate a view with respect to touch given by user.... I mean i want to make similar appearance like the old telephones were(press and rotate to dial...)...![alt text](https://i.stack.imgur.com/OVhx2.jpg) I know very well how to rotate but was unable to rotate according to this situation.....
How to rotate an image using touch
CC BY-SA 2.5
0
2011-01-17T08:02:32.067
2011-01-17T08:21:53.720
null
null
554,865
[ "iphone" ]
4,711,156
1
4,711,401
null
1
5,854
I have created a simple page in HTML which works fine. But when I import that to ASP.NET, the page design clutters up. Here is my ``` <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="Elite.WUI.Site" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title></title> <link rel="stylesheet" type="text/css" href="styles.css" /> </head> <body> <form id="form1" runat="server"> <asp:ContentPlaceHolder ID="headerCPH" runat="server"> <div id="header"> <h1>WUI</h1> </div> <hr /> </asp:ContentPlaceHolder> <asp:ContentPlaceHolder ID="navigationCPH" runat="server"> <div id="navigation"> <ul> <li>Home</li> <li>Users</li> <li>Campaigns</li> <li>Settings</li> </ul> </div> </asp:ContentPlaceHolder> <asp:ContentPlaceHolder ID="contentCPH" runat="server"> </asp:ContentPlaceHolder> </form> </body> </html> ``` my stylesheet ``` #navigation { float: left; border: 1pt solid; } #navigation ul { list-style-type: none; padding: 5 5 5 5; margin: 0; } #content { margin-left: 9%; border: 1pt solid; padding-left: 5; } ``` and the actual page derived from master page ``` <%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ABC.aspx.cs" Inherits="Elite.WUI.ABC" %> <asp:Content ID="Content3" ContentPlaceHolderID="contentCPH" runat="server"> <div id="content"> <p>Test content</p> </div> </asp:Content> ``` Here is how it is displayed in Firefox (ver 3.6) ![The margin property isn't working](https://i.stack.imgur.com/hZPTp.jpg) As you can see that the border, list-style-type properties are working but margin isn't working. Can anyone tell me what am I doing wrong? I have tested it in Google Chrome but same issue. While the HTML and CSS works fine when there is no ASP.NET i.e. simple .html file.
CSS not working in ASP.NET
CC BY-SA 2.5
0
2011-01-17T08:12:10.883
2011-01-17T08:55:27.237
2011-01-17T08:32:46.850
1,583
578,082
[ "asp.net", "css", "css-selectors" ]
4,711,405
1
null
null
1
356
I have a path as shown in the attached image. i would like to know if it is possible to give a fixed angle for the edge of the path, coz i would like to use the same angle while styling other controls as well. Is there a way to make this possible (in Expression Blend)? ![alt text](https://i.stack.imgur.com/91lEd.png)
Possible to give fixed angle in path?
CC BY-SA 2.5
null
2011-01-17T08:55:45.863
2011-01-17T10:21:10.433
null
null
552,050
[ "wpf", "path", "expression-blend" ]
4,711,615
1
4,711,756
null
37
19,449
I modify the UIImageView's contentMode property. So my image's frame is not equal to the frame of UIImageView. My problem is how to retrive the image's frame from UIImageView. As the following example, the orange rectangle is the UIImageView's border. It is obviously that the frame of image is not the same as UIImageView. ![Figure 1](https://i.stack.imgur.com/Qp4Zq.png)
How to get the displayed image frame from UIImageView?
CC BY-SA 2.5
0
2011-01-17T09:25:14.923
2020-09-24T09:21:14.503
null
null
419,348
[ "iphone", "uiimageview" ]
4,711,712
1
4,711,735
null
0
81
i have installed apache 2.2, php5, mysql separately and as far as they are concerned apache, mysql ans php are working fine with each other, the problem arises when i place the wordpress (unzip) in my htdocs folder the ur; "[http://localhost:81/wordpress](http://localhost:81/wordpress)" works fine but returs the kind of result as shown in the picture i have uploaded ... hw can i resolve this...![alt text](https://i.stack.imgur.com/fjS2L.png)
integrating wordpress with apache
CC BY-SA 2.5
null
2011-01-17T09:38:12.473
2011-01-17T09:41:06.530
null
null
413,670
[ "php", "apache", "wordpress" ]
4,711,895
1
4,712,462
null
3
1,692
![alt text](https://i.stack.imgur.com/LIEGB.png) Installing paint.net, I found a string I guess it is creating a restore point for Volume Shadow Service. -Isn't it? I'm not sure. If I'm right, how do I do this in my app? Let me know please if there are proper Apis.
How to create a system restore point?
CC BY-SA 2.5
0
2011-01-17T10:01:10.193
2017-01-03T14:44:25.097
2014-09-20T18:29:14.573
1,505,120
252,047
[ "windows", "winapi", "snapshot", "volume-shadow-service" ]
4,712,009
1
4,713,579
null
0
2,996
The embedded pic describes my layout. As you can see, the problem is in my horizontal menu. First of all it is right aligned and then the selected tab has no bottom border (which creates a front-paper effect). If you would select the second tab, then the 2nd wouldn't have a bottom border and the rest would be connected. Problem is, how to accomplish this? The only solution I can think of is a :hover img which would be blank to erase the selected bottom border. ![CSS layout preview](https://i.stack.imgur.com/dTjTh.jpg) The Code so far: ``` body { font:100% 'century gothic', Verdana, Arial, Helvetica, sans-serif; color:#3F3F3F; } #wrapper { width:960px; height:700px; /*temp*/ margin:0 auto; background:#FFF; } #header /*not visible on the embedded layout*/ { width:960px; height:91px; } #nav-bar { width:960px; height:50px; border-bottom:#000070 1px solid; /* If only <ul> has bottom border then i wouldn't have the bottom border for the whole #nav-right. But this is also a problem for the selected tab that doesn't have any */ } #nav-left { float:left; width:73px; height:50px; border-right:1px #000070 solid; } #nav-right { float:left; width:882px; height:50px; display:inline-block; position:relative; /*now i can use absolute on the <ul> for bottom-right positioning*/ } #nav-right ul { list-style: none; /*padding: ... ;*/ position:absolute; bottom:0px; right:5px; border-top:1px solid #000070; border-left:1px solid #000070; border-right:1px solid #000070; } #nav-right li { display:inline-block; /*padding: ...;*/ } #nav-right li a { /*padding: ...;*/ text-decoration:none; margin:0; color:#CCC; } #nav-right li a:hover { color:#000070; font-weight:bold; } #content { width:960px; clear:both; } #con-left{/*...*/} #con-right{/*...*/} HTML STRUCTURE: <body> <div id="wrapper"> <div id="header"><img src="#" /></div> <div id="nav-bar"> <div id="nav-left"></div> <div id="nav-right"> <ul> <li><a href="#">Home</a></li> <li><a href="#">Services</a></li> <li><a href="#">Items</a></li> <li><a href="#">Contact</a></li> </ul> </div> </div> <!--END: nav-bar--> <div id="content"> <div id="con-left"></div> <div id="con-right"> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam ultrices semper orci in euismod. Proin sed justo at lectus dapibus <br> interdum. Donec quis elit massa, id porttitor eros. Nullam vel consectetur diam. <br> Phasellus bibendum, justo sed vehicula luctus, velit lectus rhoncus velit, at placerat nibh sapien quis felis. Mauris id aliquet. <br> Integer mattis convallis luctus. Vivamus suscipit euismod sodales. Suspendisse cursus, erat eu egestas gravida, est mi semper ,<br> quis sagittis purus mi sit amet nisl. Praesent adipiscing molestie sem. Mauris vitae arcu nibh, tristique laoreet nisi. Proin quis<br> id sapien condimentum facilisis et at odio. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. <br> Morbi eget est elit, nec rutrum enim. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.<br> </p> </div> </div> </div><!--END: wrapper--> ``` Any suggestions on how to accomplish the no bottom-border effect for selected tabs? I'm not so good making small graphics, if it's possible I would like to do it with CSS. Does not matter if it involves adding a few div's or so.
Custom horiz.menu CSS bottom-border trick? needed
CC BY-SA 3.0
null
2011-01-17T10:15:36.667
2012-07-08T20:49:29.977
2012-07-08T20:49:29.977
1,288
298,950
[ "css", "menubar", "border" ]
4,712,373
1
4,712,572
null
2
4,857
I am using `MPMoviePlayerController` (for an iOS 4 app) in order to play some remote mp3 files. When I add the view like that: ``` [moviePlayer.view setFrame:CGRectMake(10, 240, 300, 20)]; [self.view addSubview:moviePlayer.view]; ``` I get the following: ![alt text](https://i.stack.imgur.com/qqERj.png) Is it possible to customize this view? I would like to tint the color, or even add custom controls, a different progress bar etc.
How to customize MPMoviePlayerController?
CC BY-SA 2.5
0
2011-01-17T10:55:02.573
2012-01-10T17:53:42.857
null
null
289,501
[ "iphone", "ios", "ios4", "mpmovieplayercontroller" ]
4,712,476
1
null
null
0
93
If you go here: [cmcp.dk](http://cmcp.dk/) with IE8 and choose english from left side, you will notice that News appears out of the background in IE8: ![alt text](https://i.stack.imgur.com/WJ9Be.jpg) Solved. Putting divs inside those tds and played with size.
strange table out of box error in IE8
CC BY-SA 3.0
null
2011-01-17T11:08:57.003
2011-04-16T18:07:02.380
2011-04-16T18:07:02.380
17,413
174,349
[ "css" ]
4,712,772
1
4,713,648
null
0
5,533
I was trying to install a CMS in a folder in my website. After the installation and trying to run, it shows this error: > Error 14 It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. E:\Documents\Visual Studio 2010\WebSites\WebSite20\blog\web.config 61 I added the website as a Virtual Directory and also converted that to application. On trying to browse this application, the following error occurs as shown in the screenshot: ![Screenshot](https://i.stack.imgur.com/jcRJe.jpg) How do I solve this?
Error because virtual directory not being configured as an application in IIS
CC BY-SA 2.5
null
2011-01-17T11:48:33.760
2011-01-18T01:01:57.440
2011-01-18T01:01:57.440
419
458,790
[ "asp.net", "iis", "web-config" ]
4,712,862
1
4,712,952
null
0
845
I have the following problem: I have 3 tables: ![alt text](https://i.stack.imgur.com/LWieG.jpg) If you want to create a document, there are two options: 1. You can create a Document from scratch. The program will create a record in the Config table with default configuration. In this case 1 Config record belongs to exactly 1 Document record 2. You can create a Document from a DocumentTemplate DocumentTemplate allows you to pre-define Document configurations where you can base Documents on. The program will link the new record in the Document table to the same configuration record as the DocumentTemplate configuration record. 1 Config record belongs to exactly 1 DocumentTemplate record and belongs to 0..* Document records If you have never created a template, the table 'DocumentTemplate' will not exist in the database. Now I want to select the following columns: 1. Config.config_data 2. Document.document_name OR DocumentTemplate.template_name If config is created by a template I want DocumentTemplate.template_name Else I want Document.document_name I have written the following query: ``` SELECT -- //Name must be name of Document or name of DocumentTemplate CASE WHEN [c].[config_from_template] = 0 THEN -- //Get Document name (SELECT [d].[document_name] FROM [Document] [d] WHERE [d].[document_config_id] = [c].[config_id]) WHEN [c].[config_from_template] = 1 AND OBJECT_ID ('[DocumentTemplate]','U') IS NOT NULL THEN -- //Get template name (SELECT [t].[template_name] FROM [DocumentTemplate] [t] WHERE [t].[template_config_id] = [c].[config_id]) END as 'Name', configNode.value('@Key', 'nvarchar(128)') as 'ConfigKey', -- //Key from xml @Key configNode.value('@Value', 'nvarchar(128)') as 'ConfigValue' -- //Value from xml @Value FROM [Config] [c] -- //Create one record for each config option CROSS APPLY [Config].[config_data].nodes('//ConfigOptions') as ConfigNodes(configNode) ``` This query will throw a syntax error if DocumentTemplate does not exist. > Msg 208, Level 16, State 1, Line 1 Invalid object name 'DocumentTemplate'. thanks in advance
Invalid object name in a query with CASE
CC BY-SA 2.5
null
2011-01-17T11:57:10.283
2011-01-17T12:11:41.130
2011-01-17T12:11:41.130
299,164
299,164
[ "sql", "sql-server", "tsql" ]
4,713,308
1
4,713,752
null
0
275
I've got this question. In my app I have many cells. When user clicks on something I'm loading VC and pushing it. To indicate this behaviour I'm displaying a subview which informs that now application is loading. Problem is, when user scrolls down and taps on cell my subview still is on the top of the tableView thus user isn't seeing it. I need to change frame of my subview so my user can see it. I want this frame to be the center of the current view. How I can do that? Fore example: My content is 800 pixels worth of height, now I'm displaying at 400 pixels subview with specific information about loading. When my user scrolls down to a cell that is at 2400 pixels, I'm still displaying subview at 400 pixels and thus it is unviewable by user. I was trying to calculate new frame.origin.y by checking y of a cell that is tapped. Problem is the cell at 2400 pixels could be the first cell user is seeing or the last one, so how I can get the middle of the screen? Edited with some screens: When I select first time: ![alt text](https://i.stack.imgur.com/lIUOG.png) When I select after scrolling down big time: ![alt text](https://i.stack.imgur.com/EYSBK.png)
UITableViewController, getting bounds of visible area
CC BY-SA 2.5
null
2011-01-17T12:47:28.013
2011-01-17T23:24:28.993
2011-01-17T23:24:28.993
30,461
533,765
[ "iphone", "objective-c", "cocoa-touch", "ipad", "uikit" ]
4,714,009
1
null
null
4
884
I'm having a PDF which looks perfectly in SnowLepard Preview but when i'm loading the same PDF in a WebView, the pdf won't show the right colors. My first idea was a RGB/CMYK problem, but i'm stuck. ![enter image description here](https://i.stack.imgur.com/1XLFW.png) cheers endo
UIWebview with PDF (wrong Colors)
CC BY-SA 2.5
null
2011-01-17T14:02:28.537
2011-02-08T08:54:29.247
2011-02-07T03:23:25.647
330,658
330,658
[ "iphone", "objective-c", "pdf", "colors", "uiwebview" ]
4,714,138
1
null
null
1
987
What's the best way to create "Expanded toolbar menus"? Example: ![Screenshot](https://i.stack.imgur.com/csZkM.png)
How to create iphone toolbar - dropdown/expanded menu
CC BY-SA 3.0
null
2011-01-17T14:15:10.023
2012-05-20T14:11:56.613
2012-05-20T14:08:38.577
1,028,709
578,619
[ "iphone", "objective-c", "xcode" ]
4,714,615
1
4,714,900
null
0
121
I write command to cmd: ![alt text](https://i.stack.imgur.com/bLAAt.jpg) Сonsole returns a response:![alt text](https://i.stack.imgur.com/hUzgB.jpg) I need the same thing only through myapp wpf: ![alt text](https://i.stack.imgur.com/aBMfE.jpg) ANSWER ``` System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.FileName = @"E:\1.exe"; p.Start(); string output = p.StandardOutput.ReadToEnd(); p.WaitForExit(); ```
How to work with the console via MyApp?
CC BY-SA 2.5
null
2011-01-17T15:07:55.530
2011-01-17T18:18:03.283
2011-01-17T18:18:03.283
122,207
450,466
[ "c#", "wpf", "console" ]
4,715,184
1
null
null
0
739
I applied box-shadow and border-radius property to a input box , here are the effects in chrome and firefox, ![alt text](https://i.stack.imgur.com/UUJXq.png) Is there a fix for this?
Chrome doesn't render box-shadow and border-radius properly,when both are applied,is there a fix for this?
CC BY-SA 2.5
null
2011-01-17T16:03:07.847
2011-01-20T09:20:54.857
null
null
434,354
[ "google-chrome", "chromium" ]
4,715,216
1
4,724,037
null
2
2,614
I'm trying to create a custom `JDialog`. I would like to have the components stacked on top of eachother with their preferred height, but the width should fill the container. Similar to [LinearLayout](http://developer.android.com/resources/tutorials/views/hello-linearlayout.html) in Android. I want that the components keeps their preferred height when the window is resized. From [Using Layout Managers](http://download.oracle.com/javase/tutorial/uiswing/layout/using.html): > You need to display a few components in a compact row at their natural size.Consider using a JPanel to group the components and using either the JPanel's default FlowLayout manager or the BoxLayout manager. SpringLayout is also good for this. E.g. I would like to have a `JTextField` above a `JTabbedPane`. I have tried with all the suggested layout managers FlowLayout, BoxLayout, SpringLayout but they don't preserve the natural size of my components when the `JDialog` window get increased height. Is there any Layout Manager in Java Swing that I can use for my situation? Here is a small example that shows my problem with the Swing layouts: ![A Dialog](https://i.stack.imgur.com/vYpUu.png) ``` import javax.swing.BoxLayout; import javax.swing.JDialog; import javax.swing.JPanel; import javax.swing.JTabbedPane; import javax.swing.JTextField; public class TestDialog extends JDialog { public TestDialog() { setLayout(new BoxLayout(this.getContentPane(), BoxLayout.PAGE_AXIS)); //setLayout(new SpringLayout()); JTextField field1 = new JTextField(); JTextField field2 = new JTextField(); JTextField field3 = new JTextField(); JTextField field4 = new JTextField(); JPanel panel1 = new JPanel(); JPanel panel2 = new JPanel(); panel1.setLayout(new BoxLayout(panel1, BoxLayout.PAGE_AXIS)); panel2.setLayout(new BoxLayout(panel2, BoxLayout.PAGE_AXIS)); panel1.add(field2); panel2.add(field3); panel2.add(field4); JTabbedPane tabs = new JTabbedPane(); tabs.addTab("Tab 1", panel1); tabs.addTab("Tab 2", panel2); add(field1); add(tabs); //field1.setMaximumSize(field1.getPreferredSize()); //SpringUtilities.makeCompactGrid(this.getContentPane(), 2, 1, 2, 2, 2, 2); this.pack(); this.setVisible(true); } public static void main(String[] args) { new TestDialog(); } } ```
How do I get a LinearLayout where the components are stacked on top of eachother in Swing?
CC BY-SA 2.5
0
2011-01-17T16:06:30.903
2014-07-05T11:13:46.493
2020-06-20T09:12:55.060
-1
213,269
[ "java", "swing", "layout", "android-linearlayout", "layout-manager" ]
4,715,400
1
4,715,503
null
3
100
im looking for query to load and group the data i do have 1:n relationship of Parent:Child and i want to pull latest child,instead of children, of a parent that means each entry should have unique parent with latest child. ![alt text](https://i.stack.imgur.com/EArTN.jpg) ![alt text](https://i.stack.imgur.com/yaw7p.jpg) Tried: i have tried following query but it get me oldest results ``` SELECT c.* FROM child AS c GROUP BY c.parent_id HAVING(MAX(c.order)) ``` Thanks in advance
how to pull unique results
CC BY-SA 2.5
null
2011-01-17T16:26:08.473
2011-01-20T04:48:40.453
2011-01-20T04:48:40.453
135,152
554,896
[ "sql", "mysql", "hibernate" ]
4,715,421
1
4,798,237
null
0
3,451
I recently installed Windows 7, 64 bit on my machine to try my hands at 64 bit, the website always worked fine on 32 bit Windows 7 (VS 2008 was development environment). This website is being developed on Visual Studio 2008 targeting .Net 3.5 fx and ASP .NET MVC1. On this 64 bit machine, I installed VS 2010 and started using it for the website (we are looking at migrating to VS2010 and also planning to deploy our website on 64 bit machine). The website built perfectly fine on VS 2010. But when I opened the website, it gave the following error. > Server Error in '/' Application.is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.BadImageFormatException: is not a valid Win32 application. (Exception from HRESULT: 0x800700C1) Here is the trace summary, for the above error. ![Trace, App Pool 32 bit false](https://i.stack.imgur.com/L0SG6.png) I even tried running aspnet_regiis -i for .Net 2.0 in c:\windows\Microsoft .Net\Framework64. Then, I also tried to set the app-pool in 32 bit by enabling 32 bit in advance settings for the app pool. But even that dint work for me. The error I got after enabling 32 bit on App Pool > The specified module could not be found. (Exception from HRESULT: 0x8007007E)Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)Source Error:An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. The trace is similar to what I pasted above. Any ideas on how can I solve this.
ASP .NET MVC on IIS 7.5, Windows 7 64 bit
CC BY-SA 3.0
null
2011-01-17T16:28:07.803
2013-10-03T21:19:36.940
2020-06-20T09:12:55.060
-1
129,206
[ "asp.net-mvc", "64-bit", "iis-7.5" ]
4,715,577
1
4,715,606
null
11
42,139
Currently have a problem with some DIVs overlapping their containing DIVs. See image below (the 3 products at the bottom): ![alt text](https://i.stack.imgur.com/LP6gU.png) All the body content of the page is held within the #content DIV: ``` div#content { width: 960px; float: left; background-image: url("../img/contentBg.png"); background-repeat: repeat; margin-top: 10px; line-height: 1.8em; border-top: 8px solid #5E88A2; padding: 10px 15px 10px 15px; } ``` And here is the CSS for the product boxes within the #content div: ``` .upper { text-transform: uppercase; } .center { text-align: center; } div#products { float: left; width: 100%; margin-bottom: 25px; } div.productContainer { float: left; width: 265px; font-size: 1em; margin-left: 50px; height: 200px; padding-top: 25px; text-align: right; } div.product { float: left; width: 200px; } div.product p { } div.product a { display: block; } div.product img { float: left; } div.product img:hover { opacity: 0.8; filter: alpha(opacity = 80); } div.transparent { opacity: 0.8; filter: alpha(opacity = 80); } ``` And here is the HTML for the boxes: ``` <div class="productContainer"> <div class="product"> <h2 class="upper center">A2 Print</h2> <a href='../edit/?productId=5&amp;align=v' class='upper'> <img src="../../wflow/tmp/133703b808c91b8ec7e7c7cdf19320b7A2-Print.png" alt="Representation of image printed at A2 Print through Website." /></a> <p class="upper">16.5 inches x 23.4 inches<br /><strong>&pound;15.99</strong></p> <p class="upper smaller"><em><span><span class="yes">Yes</span> - your picture quality is high enough for this size</span> </em></p> <p><a href='../edit/?productId=5&amp;align=v' class='upper'><span>Select</span></a></p> </div> </div> <div class="productContainer"> <div class="product transparent"> <h2 class="upper center">A1 Print</h2> <a href='../edit/?productId=11&amp;align=v' class='upper'> <img src="../../wflow/tmp/133703b808c91b8ec7e7c7cdf19320b7A1-Print.png" alt="Representation of image printed at A1 Print through Website." /></a> <p class="upper">23.4 inches x 33.1 inches<br /><strong>&pound;19.99</strong></p> <p class="upper smaller"><em><span><span class="no">Warning</span> - your picture quality may not be sufficient for this size</span> </em></p> <p><a href='../edit/?productId=11&amp;align=v' class='upper'><span>Select</span></a></p> </div> </div> <div class="productContainer"> <div class="product transparent"> <h2 class="upper center">Poster Print (60cm x 80cm)</h2> <a href='../edit/?productId=12&amp;align=v' class='upper'> <img src="../../wflow/tmp/133703b808c91b8ec7e7c7cdf19320b7Poster-Print-(60cm-x-80cm).png" alt="Representation of image printed at Poster Print (60cm x 80cm) through Website." /></a> <p class="upper">23.6 inches x 31.5 inches<br /><strong>&pound;13.95</strong></p> <p class="upper smaller"><em><span><span class="no">Warning</span> - your picture quality may not be sufficient for this size</span> </em></p> <p><a href='../edit/?productId=12&amp;align=v' class='upper'><span>Select</span></a></p> </div> </div> ``` Any idea what could be causing these DIVs to overlap? What I'd like is for all the boxes to fit within the #container div as expected. It's driving me crazy! Cheers
CSS content overflowing containing div
CC BY-SA 2.5
0
2011-01-17T16:43:38.387
2011-04-06T07:36:23.043
2011-04-06T07:36:23.043
484,099
484,099
[ "html", "css" ]
4,715,689
1
4,715,746
null
1
1,880
When I run the following open gl command, it only paints the bottom left part of the ipad screen red. glClearColor(255.0f, 0.0f, 0.0f, 0.0f); ![alt text](https://i.stack.imgur.com/PeucV.png) How do I make it so the whole screen gets painted red? Thanks!
How to change canvas size in OpenGL? glClearColor is only painting a small box
CC BY-SA 2.5
0
2011-01-17T16:55:49.943
2011-01-17T18:49:05.563
2011-01-17T18:38:53.443
19,679
5,653
[ "iphone", "ipad", "opengl-es" ]
4,716,315
1
4,716,362
null
1
3,312
[This site](http://meekrosoft.wordpress.com/2010/06/02/continuous-code-coverage-with-gcc-googletest-and-hudson/) has the pretty source code listing. ![alt text](https://i.stack.imgur.com/Jhh23.png) Looking into the source code I get this HTML code. ``` <pre class="brush: cpp; wrap-lines: false;"> #ifndef PROGRESSSTATE_H_ #define PROGRESSSTATE_H_ class ProgressState { ... #endif /* PROGRESSSTATE_H_ */ </pre> ``` It seems to me that the css does the magic. If so, what's the css should look like for having the source code listing? If not, what's the way to have the source code in HTML?
How can I make source code listing block in HTML?
CC BY-SA 2.5
null
2011-01-17T18:09:35.003
2015-07-28T00:54:44.870
2015-07-28T00:54:44.870
1,677,912
260,127
[ "javascript", "html", "css" ]
4,716,322
1
4,716,479
null
0
136
NET and learning WPF now. I want to create a tool for Pomodoro technique to learn WPF. This is the lay out in my mind. 1. List of tasks 2. Status for the task. One tomato for every 25 mins. This is list of interactive images/buttons, in which users can take some actions like add, remove tomato. What I am looking for is tips for laying this controls out and any words of wisdom :) ![alt text](https://i.stack.imgur.com/vbXnX.jpg)
WPF control layout for Pomodora
CC BY-SA 2.5
null
2011-01-17T18:10:05.407
2011-01-17T21:44:58.290
2011-01-17T21:44:58.290
339,725
339,725
[ "wpf", "wpf-controls" ]
4,716,582
1
4,928,270
null
1
9,641
I wish to pass values of the selected items into a database and however noticed that the selected item is not what is sent into the database you can see in the snap shot below. ![alt text](https://i.stack.imgur.com/RO7rh.jpg) during run time the following value is recorded. ![alt text](https://i.stack.imgur.com/RIzzL.jpg) Where did it all go wrong with the dropdown lists selected item? Counting on your intelligence...thanks.
Dropdown list selected item always set to default value
CC BY-SA 2.5
null
2011-01-17T18:37:55.483
2011-02-08T00:19:21.093
2020-06-20T09:12:55.060
-1
569,285
[ "c#", "asp.net" ]
4,716,673
1
4,716,831
null
0
73
![alt text](https://i.stack.imgur.com/NPLsY.png) I need it to display 5 images of my choosing and be able to switch between them. Thanks for the help.
Is there a jQuery control that does the following:
CC BY-SA 2.5
null
2011-01-17T18:48:06.530
2011-01-17T19:08:21.123
null
null
null
[ "jquery", "image" ]
4,716,985
1
null
null
1
2,412
I'm working in 3d for the first time in a long time. Basically I'm rotating a sphere and projecting x y z cords to place things on the surface based on the spheres X and Y rotation. Heres the code im using: ``` #define piover180 0.01745329252f GLfloat cosy = cos(yrot * piover180); island[i].x = rad * sin(xrot * piover180)* cosy; island[i].y = rad * sin(yrot * piover180); island[i].z = rad * cos(xrot * piover180) * cosy; ``` Problem is the Xrot positioning works fine but the Yrot placement always draw the objects into the north and south pole so they all cross at the top, which isn't correct for rotating. I need a way to solve this. Here's a picture to help explain: ![Screenshot](https://i.stack.imgur.com/gTSjh.jpg) Any help would be greatly appreciated, let me know if you need any more information?
3d movement around a sphere
CC BY-SA 3.0
0
2011-01-17T19:26:58.507
2012-05-20T14:09:57.547
2012-05-20T14:09:57.547
1,028,709
578,954
[ "iphone", "objective-c", "opengl-es", "3d" ]
4,716,948
1
null
null
0
2,355
I have own style on listbox item, here is it: ``` <Style x:Key="friendsListStyle" TargetType="{x:Type ListBox}"> <Setter Property="ItemTemplate"> <Setter.Value> <DataTemplate> <Grid Name="RootLayout"> <Grid.ColumnDefinitions> <ColumnDefinition Width="0.3*"></ColumnDefinition> <ColumnDefinition Width="*"></ColumnDefinition> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="60"></RowDefinition> </Grid.RowDefinitions> <Image Margin="4,4,4,2" Grid.Column="0"> <Image.Source > <MultiBinding Converter="{StaticResource avatarConverter}"> <Binding Path="ProfilePhoto"></Binding> <Binding Path="StatusInfo.IsLogged"></Binding> </MultiBinding> </Image.Source> </Image> <Grid Grid.Column="1"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"></ColumnDefinition> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="*"></RowDefinition> <RowDefinition Height="*"></RowDefinition> <RowDefinition Height="*"></RowDefinition> </Grid.RowDefinitions> <TextBlock Text="{Binding Path=Nick}" Margin="2,2,2,2" FontSize="13" FontWeight="Medium" Grid.Column="0" Grid.Row="0"> </TextBlock> <TextBlock Text="{Binding Path=StatusMessageInfo.Message}" FontSize="11" FontWeight="Normal" Foreground="DarkGray" Grid.Column="0" Grid.Row="1" Margin="2,2,2,2"></TextBlock> <TextBlock Style="{StaticResource StatusStyle}" Grid.Column="0" Grid.Row="2" > <TextBlock.Text> <MultiBinding Converter="{StaticResource infoConverter}"> <Binding Path="StatusInfo.IsLogged"></Binding> <Binding Path="StatusInfo.IsChating"></Binding> <Binding Path="StatusInfo.RoomName"></Binding> </MultiBinding> </TextBlock.Text> </TextBlock> </Grid> </Grid> </DataTemplate> </Setter.Value> </Setter> </Style> ``` In app look like this: ![alt text](https://i.stack.imgur.com/1r5jE.jpg) I need change color of listbox item when is selected, so I try wrote control template on listbox item and use in listbox style: Here is control template on listbox item: ``` <Style x:Key="FriendListBoxItemStyle" TargetType="ListBoxItem"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ListBoxItem}"> <Grid Name="RootLayout"> <Grid.ColumnDefinitions> <ColumnDefinition Width="0.3*"></ColumnDefinition> <ColumnDefinition Width="*"></ColumnDefinition> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="60"></RowDefinition> </Grid.RowDefinitions> <Image Margin="4,4,4,2" Grid.Column="0"> <Image.Source > <MultiBinding Converter="{StaticResource avatarConverter}"> <Binding Path="ProfilePhoto"></Binding> <Binding Path="StatusInfo.IsLogged"></Binding> </MultiBinding> </Image.Source> </Image> <Grid Grid.Column="1"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"></ColumnDefinition> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="*"></RowDefinition> <RowDefinition Height="*"></RowDefinition> <RowDefinition Height="*"></RowDefinition> </Grid.RowDefinitions> <TextBlock Text="{Binding Path=Nick}" Margin="2,2,2,2" FontSize="13" FontWeight="Medium" Grid.Column="0" Grid.Row="0"> </TextBlock> <TextBlock Text="{Binding Path=StatusMessageInfo.Message}" FontSize="11" FontWeight="Normal" Foreground="DarkGray" Grid.Column="0" Grid.Row="1" Margin="2,2,2,2"></TextBlock> <TextBlock Style="{StaticResource StatusStyle}" Grid.Column="0" Grid.Row="2" > <TextBlock.Text> <MultiBinding Converter="{StaticResource infoConverter}"> <Binding Path="StatusInfo.IsLogged"></Binding> <Binding Path="StatusInfo.IsChating"></Binding> <Binding Path="StatusInfo.RoomName"></Binding> </MultiBinding> </TextBlock.Text> </TextBlock> </Grid> </Grid> <ControlTemplate.Triggers> <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="IsMouseOver" Value="True" /> <Condition Property="IsSelected" Value="False"/> </MultiTrigger.Conditions> <Setter Property="Background" Value="Yellow" /> </MultiTrigger> <Trigger Property="IsSelected" Value="True"> <Setter Property="Background" Value="Red" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> ``` Apply on listBox style: ``` <Style x:Key="FriendListBoxStyle" TargetType="{x:Type ListBox}"> <Setter Property="ItemContainerStyle" Value="{DynamicResource FriendListBoxItemStyle}" /> </Style> ``` An finally apply listbox style on control in view: ``` <ListBox Name="Friends" SelectedIndex="{Binding Path=SelectedFriendsIndex,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" SelectedItem="{Binding Path=SelectedFriend, Mode=OneWayToSource, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource FriendListBoxStyle}"/> ``` I run app and listbox look as here: ![alt text](https://i.stack.imgur.com/VkG5D.jpg) Also items in listbox are not selectable, so I can’t select item in listbox. What is bad?
Problem with control template on listbox item
CC BY-SA 2.5
null
2011-01-17T19:22:01.907
2011-08-12T19:59:11.880
2011-08-12T19:59:11.880
305,637
null
[ "wpf", "listbox", "datatemplate", "styles", "controltemplate" ]
4,717,338
1
4,717,376
null
2
500
We are having an application ported from Windows to Mac OS, and colors are being displayed differently on both platforms. Here's an example: ![Mysterious color difference](https://i.stack.imgur.com/D9ULV.png) In this case, we're telling the application to use green 0,140,0 and blue 25,0,75. On windows, this works great (top image). On the Mac, apparently OS X decides to "reinterpret" the colors and displays them differently (bottom image). Is there something we can do to tell the operating system to stop being creative with our color definitions? It's going to be hard to make things look good on both platforms if the mac arbitrarily changes our color definitions by ~10%. Edit: Here's an example of the code we're using to set the color for the blue used above: ``` m_colour = CGColorCreateGenericRGB(25 / 255.0, //r 0 / 255.0, //g 75 / 255.0, //b 1.0); //a ``` Thanks.
Why are colors displayed differently on Windows / OS X?
CC BY-SA 2.5
null
2011-01-17T20:05:55.520
2011-01-17T20:22:48.517
2011-01-17T20:14:54.670
13,500
13,500
[ "windows", "macos", "colors" ]
4,717,639
1
4,718,374
null
1
528
I've had an issue with using [Facebook's Share feature](http://developers.facebook.com/docs/share). The user experience on the shared content below is just completely unclear (even when I tested some clarified language: e.g. "click here"). Users simply don't know what to do: they often either click "Like," or they comment with something along the lines of "I support you." ![alt text](https://i.stack.imgur.com/J5Vyn.png) According to the [documentation](http://developers.facebook.com/docs/share), it is possible to share Flash content in these posts. I'm hoping I can create a "Support" button as an SWF button. `href` *I'm not sure `href` is even the proper term, as I don't use Flash.
Creating a custom, dynamic Flash button that will work in Facebook shares
CC BY-SA 2.5
null
2011-01-17T20:37:14.777
2011-01-18T15:25:03.447
2011-01-17T20:56:09.353
373,496
373,496
[ "flash", "actionscript-3", "facebook", "dynamic", "button" ]
4,717,932
1
4,719,143
null
2
11,016
I've created a new Java project (testProject) and begin to add jars to a user library, but I'm getting project errors after adding jars to a "User Library" Here's what I'm doing:Create the User Library 1. Right mouse click the project and click Properties 2. Click Add Library..., select User Library, and click Next 3. Click button, User Libraries... 4. Click New... and give it a name: mule; click OK. 5. Select mule and click Add JARs... 6. Add a jar (e.g. I've added two, one from the root project, log4j.jar, and another from /opt/mule/lib) 7. Click OK 8. Click Finish Now I'm seeing a red x show on the mule library. 1. Click Edit, and click User Libraries 2. The message on each jar says the library is missing, and it seems to be losing the actual path. See attached image: ![alt text](https://i.stack.imgur.com/2gb0k.png) I'm running On a Mac OSX 10.5.8, running Java openjdk version "1.6.0-internal" OpenJDK Runtime Environment (build 1.6.0-internal-landonf_17_may_2009_13_58-b00) OpenJDK Client VM (build 11.0-b17, mixed mode) This doesn't seem to be a problem on a Vista PC, running Eclipse on Java 1.6.0_16. (Or under Ubuntu). Is anyone else seeing this?
Add Jars to User LIbraries in Eclipse Helios, Mac OSX
CC BY-SA 2.5
null
2011-01-17T21:11:46.637
2012-11-05T19:22:31.833
null
null
183,349
[ "java", "eclipse", "macos", "libraries" ]
4,717,961
1
4,718,077
null
2
23,310
Am trying to insert several columns into my database using the following insert query from C# but it throws the exception somehow somewhere and my guess is there are no values provided for insertion. i just want to confirm that and find out how i can fix the insert statement. i have a picture below that displays what is passed into the parameters at runtime. i used a break point to get this info. need your expertise at this one...thanks ``` if (Page.IsValid) { DateTime exhibitDate = DateTime.Now; int caseid = Convert.ToInt32(CaseIDDropDownList.SelectedItem.Text); string exhibittype = exhibitTypeTextBox.Text.ToString(); string storedloc = storedLocationTextBox.Text.ToString(); string offid = DropDownList1.SelectedItem.Text.ToString(); Stream imgStream = exhibitImageFileUpload.PostedFile.InputStream; int imgLen = exhibitImageFileUpload.PostedFile.ContentLength; byte[] imgBinaryData = new byte[imgLen]; int n = imgStream.Read(imgBinaryData,0,imgLen); try { SqlConnection connections = new SqlConnection(strConn); SqlCommand command = new SqlCommand("INSERT INTO Exhibits (CaseID, ExhibitType, ExhibitImage, DateReceived, StoredLocation, InvestigationStatus, OfficerID, SuspectID, InvestigatorID, ManagerID, AdminID ) VALUES (@CaseID, @ExhibitType, @ExhibitImage, @DateReceived, @StoredLocation, @InvestigationStatus, @OfficerID, @SuspectID, @InvestigatorID, @ManagerID, @AdminID)", connections); SqlParameter param0 = new SqlParameter("@CaseID", SqlDbType.Int); param0.Value = caseid; command.Parameters.Add(param0); SqlParameter param1 = new SqlParameter("@ExhibitType", SqlDbType.NText); param1.Value = exhibittype; command.Parameters.Add(param1); SqlParameter param2 = new SqlParameter("@ExhibitImage", SqlDbType.Image); param2.Value = imgBinaryData; command.Parameters.Add(param2); SqlParameter param3 = new SqlParameter("@DateReceived", SqlDbType.SmallDateTime); param3.Value = exhibitDate; command.Parameters.Add(param3); SqlParameter param4 = new SqlParameter("@StoredLocation", SqlDbType.NText); param4.Value = storedloc; command.Parameters.Add(param4); SqlParameter param5 = new SqlParameter("@InvestigationStatus", SqlDbType.VarChar, 50); param5.Value = ""; command.Parameters.Add(param5); SqlParameter param6 = new SqlParameter("@OfficerID", SqlDbType.NChar, 10); param6.Value = offid; command.Parameters.Add(param6); SqlParameter param7 = new SqlParameter("@SuspectID", SqlDbType.NChar, 10); param7.Value = null; command.Parameters.Add(param7); SqlParameter param8 = new SqlParameter("@InvestigatorID", SqlDbType.NChar, 10); param8.Value = null; command.Parameters.Add(param8); SqlParameter param9 = new SqlParameter("@ManagerID", SqlDbType.NChar, 10); param9.Value = null; command.Parameters.Add(param9); SqlParameter param10 = new SqlParameter("@AdminID", SqlDbType.NChar, 10); param10.Value = adminID; command.Parameters.Add(param10); connections.Open(); int numRowsAffected = command.ExecuteNonQuery(); connections.Close(); if (numRowsAffected != 0) { Response.Write("<BR>Rows Inserted successfully"); CaseIDDropDownList.ClearSelection(); exhibitTypeTextBox.Text = null; storedLocationTextBox.Text = null; DropDownList1.ClearSelection(); } else { Response.Write("<BR>An error occurred uploading the image"); } } catch (Exception ex) { string script = "<script>alert('" + ex.Message + "');</script>"; } ``` ![alt text](https://i.stack.imgur.com/BppbE.jpg) the exception is as follows > -
Insert Query in C# using Parameters
CC BY-SA 2.5
null
2011-01-17T21:14:40.503
2018-10-01T20:29:05.550
2011-01-17T21:22:50.050
569,285
569,285
[ "c#", "asp.net" ]
4,718,311
1
4,718,405
null
2
1,271
I'm interested in using an "[unrolled linked list](http://blogs.msdn.com/b/devdev/archive/2005/08/22/454887.aspx)" in my C# application. Is anyone aware of a stable implementation, especially one that will allow me to configure how much padding to allocate per array? ![alt text](https://i.stack.imgur.com/zvT1H.png)
Any implementation of an Unrolled Linked List in C#?
CC BY-SA 2.5
null
2011-01-17T21:52:39.877
2011-02-04T16:27:52.243
null
null
328,397
[ "c#", "clr", "pinvoke", "linked-list" ]
4,718,683
1
4,719,459
null
1
4,225
I have looked at several code snippets where people suggest that the AcceptsReturn property of a textbox in Silverlight will enable multiple lines. My problem however is when I add a textbox with said property and explicity set the height or allow it to fill the container, the text sits vertically in the middle of the textbox. ``` <Grid x:Name="LayoutRoot" > <TextBox TextWrapping="Wrap" Text="TextBox" AcceptsReturn="True"/> </Grid> ``` ![alt text](https://i.stack.imgur.com/w4Z6d.png) I need the text to anchor to the top of the textbox.
Silverlight multiple line textbox
CC BY-SA 2.5
null
2011-01-17T22:38:28.267
2012-03-08T14:23:00.810
null
null
40,714
[ "silverlight", "xaml" ]
4,718,691
1
4,762,510
null
4
2,561
So I've got an Android 1.6 activity using a TableLayout. One of the rows has a RatingBar in. This is my xml: ``` <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TableRow> <TextView android:text="name" android:padding="3dip"/> <TextView android:text="@+id/name" android:padding="3dip"/> </TableRow> <TableRow> <TextView android:text="tags" android:padding="3dip"/> <TextView android:id="@+id/tags" android:padding="3dip"/> </TableRow> <TableRow> <TextView android:text="rating" android:layout_width="wrap_content"/> <RatingBar android:id="@+id/rating" style="?android:attr/ratingBarStyleIndicator" android:layout_width="wrap_content" android:rating="4" android:numStars="5"/> </TableRow> <TableRow> <TextView android:text="long string" android:padding="3dip"/> <TextView android:text="this is a very very very long string" android:padding="3dip"/> </TableRow> ... </TableLayout> ``` I wanted to put a text label at the left of the table row, then have a 5 star ratings bar on the right. But when I do this, the rating value displays wrongly, and I have lots of spurious empty stars above the specified maximum of 5: ![alt text](https://i.stack.imgur.com/GjWQy.png) If I take out the 'rating' TextView, so the RatingBar is on its own table row, the RatingBar displays as expected, showing 4 out of 5 possible stars: ![alt text](https://i.stack.imgur.com/aSEKa.png) Does anyone have any idea if it's possible to have a RatingBar on the same row as a TextView? Or do I need to rethink this layout? edited to add: I think another row in the table which displays a long text string is causing the problem. Without the 'long string' row in the example above, the RatingBar displays correctly in the same row as the 'rating' text.
RatingBar displays incorrectly in Android when on same TableRow as TextView
CC BY-SA 2.5
0
2011-01-17T22:39:47.013
2011-01-21T18:39:24.067
2011-01-21T14:32:49.117
538,332
538,332
[ "android", "android-layout" ]
4,719,163
1
4,733,256
null
3
565
As per a [previous question](https://stackoverflow.com/questions/4718113/linq-orderby-sum-of-multiple-fields), I've got the following LINQ expression. ``` Events.Where(Function(e) e.EventDate >= Date.Today) _ .OrderByDescending(Function(e) (((e.EventVotes.Sum(Function(s) s.Vote)) * 2) + (e.Comments.Count))) _ .Skip(0) _ .Take(5) ``` Which converts to the following SQL ``` -- Region Parameters DECLARE @p0 DateTime2 = '2011-01-17 00:00:00.0000000' DECLARE @p1 Int = 2 DECLARE @p2 Int = 0 DECLARE @p3 Int = 5 -- EndRegion SELECT [t3].[ID], [t3].[UserID], [t3].[RegionID], [t3].[LocationID], [t3].[Title], [t3].[Description], [t3].[EventDate], [t3].[URL], [t3].[Phone], [t3].[TicketPriceLow], [t3].[TicketPriceHigh], [t3].[DatePosted], [t3].[isHighlighted] FROM ( SELECT ROW_NUMBER() OVER (ORDER BY ((( SELECT SUM([t1].[Vote]) FROM [dbo].[EventVotes] AS [t1] WHERE [t1].[EventID] = [t0].[ID] )) * @p1) + (( SELECT COUNT(*) FROM [dbo].[Comments] AS [t2] WHERE [t2].[EventID] = [t0].[ID] )) DESC) AS [ROW_NUMBER], [t0].[ID], [t0].[UserID], [t0].[RegionID], [t0].[LocationID], [t0].[Title], [t0].[Description], [t0].[EventDate], [t0].[URL], [t0].[Phone], [t0].[TicketPriceLow], [t0].[TicketPriceHigh], [t0].[DatePosted], [t0].[isHighlighted] FROM [dbo].[Events] AS [t0] WHERE [t0].[EventDate] >= @p0 ) AS [t3] WHERE [t3].[ROW_NUMBER] BETWEEN @p2 + 1 AND @p2 + @p3 ORDER BY [t3].[ROW_NUMBER] ``` My problem now is when it comes to ordering when some events don't have any votes or comments. Here is what the EventVotes table looks like (in it's entirety) ``` | UserID | EventID | Vote | | 1 | 51 | 1 | | 1 | 52 | 1 | | 2 | 52 | 1 | | 1 | 53 | 1 | | 2 | 53 | -1 | | 3 | 53 | -1 | ``` The Comments table is completely empty, so since we're just doing a `Count` on it, we can assume that everything comes back Null. Now when I run the query above, the result order is as follows > 52 51 53 1 2 3 When it "should" be > 52 51 1 2 3 53 because event number 53 has a vote count of "-1" while event numbers 1, 2, and 3 have a vote count of "0" Can anyone help figure out how to enhance the Linq expression to account for events that haven't been voted on? Here's a screenshot ![alt text](https://i.stack.imgur.com/Y5gVx.png) # EDIT: Ok, so I've simplified the query in LinqPad to this, and the result is that I only get three results. ``` Events.OrderByDescending(Function(e) (((e.EventVotes.Sum(Function(s) s.Vote)) * 2) + (e.Comments.Count))) ``` What this is telling me is that the orderby is only grabbing those three results (51, 52, 53), then it appends the rest of the results AFTER the order clause. I need to figure out a way to include the rest of the "null" results in the Lambda expression.
Linq: How to OrderBy the SUM of one table and the COUNT of another
CC BY-SA 2.5
null
2011-01-17T23:47:00.477
2011-01-20T01:56:46.910
2017-05-23T12:07:06.850
-1
124,069
[ ".net", "linq-to-sql", "lambda", "sql-order-by" ]
4,719,176
1
4,739,259
null
0
181
I am having what seems to be a mipmapping problem when rendering textures on to a flat quad. At some camera positions the object looks fine, but then at others it gets very fuzzy. Unfortunately I don't really have any good leads on this problem but I thought if I posted some pictures other who have experiences other issue might be able to give me some insight. Normal: ![alt text](https://i.stack.imgur.com/RMOCn.png) Zoomed Out: ![alt text](https://i.stack.imgur.com/KHf48.png) Rotated: ![alt text](https://i.stack.imgur.com/5xOmR.png) Could anyone give me any clues about what could be going on here?
Mipmapping issue with textures rendered on to a flat quad (OpenGL)
CC BY-SA 2.5
null
2011-01-17T23:48:40.867
2011-01-19T18:39:50.953
null
null
131,399
[ "opengl", "mipmaps" ]
4,719,175
1
4,720,687
null
15
5,886
I am encountering an odd crash in our software and I'm having a lot of trouble debugging it, and so I am The crash is an access violation reading a NULL pointer: > First chance exception at $00CF0041. Exception class $C0000005 with message 'access violation at 0x00cf0041: read of address 0x00000000'. It only happens 'sometimes' - I haven't managed to figure out any rhyme or reason, yet, for when - and only in the main thread. When it occurs, the call stack contains one incorrect entry: ![Call stack with one line, Classes::TList::Get, address 0x00cf0041](https://i.stack.imgur.com/VFNus.png) For the main thread, which this is, it should show a large stack full of other items. At this point, all other threads are inactive (mostly sitting in `WaitForSingleObject` or a similar function.) I have only seen this crash occur in the main thread. It always has the same call stack of one entry, in the same method at the same address. This method may or may not be related - we do use the VCL in our application. My bet, though, is that something (possibly quite a while ago) is corrupting the stack, and the address where it's crashing is effectively random. Note it has been the same address across several builds, though - it's probably not truly random. Here is what I've tried: - - - [Codeguard](http://docwiki.embarcadero.com/RADStudio/en/CodeGuard_Overview) My questions: I am using [Embarcadero RAD Studio 2010](http://www.embarcadero.com/products/rad-studio) (the project mostly contains C++ Builder code and small amounts of Delphi.) I thought I should add what actually caused this. There was a thread that called [ReadDirectoryChangesW](http://msdn.microsoft.com/en-us/library/aa365465%28v=vs.85%29.aspx) and then, using `GetOverlappedResult`, waited on an event to continue and do something with the changes. The event was also signalled in order to terminate the thread after setting a status flag. The problem was that when the thread exited it never called [CancelIO](http://msdn.microsoft.com/en-us/library/aa363791%28v=vs.85%29.aspx). As a result, Windows was still tracking changes and probably still writing to the buffer when the directory changed, even though the buffer, overlapped structure and event no longer existed (nor did the thread context in which they were created.) When `CancelIO` was called, there were no more crashes.
How do I debug a difficult-to-reproduce crash with no useful call stack?
CC BY-SA 3.0
0
2011-01-17T23:48:37.570
2011-08-22T07:46:19.387
2011-08-22T07:46:19.387
121,689
121,689
[ "delphi", "crash", "c++builder", "callstack" ]
4,719,520
1
null
null
1
1,699
I have a nokia E63 and I want to develop a very simple application available in the main menu (desktop? home? dashboard? main-menu? can't find a consistent name for this...) that simply allows users to change between 5 modes of my application. How to develop this particular kind of "widget" using c++/qt (or java)? ![(This model)](https://i.stack.imgur.com/cVhTt.png)
Nokia home application (Nokia E63)
CC BY-SA 2.5
null
2011-01-18T00:54:44.920
2014-04-29T21:38:06.080
2014-04-29T21:38:06.080
881,229
2,731,698
[ "widget", "nokia" ]
4,719,633
1
null
null
23
32,360
I have decided to play around with some simple concepts involving neural networks in Java, and in adapting somewhat useless code I found on a forum, I have been able to create a very simple model for the typical beginner's XOR simulation: ``` public class MainApp { public static void main (String [] args) { Neuron xor = new Neuron(0.5f); Neuron left = new Neuron(1.5f); Neuron right = new Neuron(0.5f); left.setWeight(-1.0f); right.setWeight(1.0f); xor.connect(left, right); for (String val : args) { Neuron op = new Neuron(0.0f); op.setWeight(Boolean.parseBoolean(val)); left.connect(op); right.connect(op); } xor.fire(); System.out.println("Result: " + xor.isFired()); } } ``` ``` public class Neuron { private ArrayList inputs; private float weight; private float threshhold; private boolean fired; public Neuron (float t) { threshhold = t; fired = false; inputs = new ArrayList(); } public void connect (Neuron ... ns) { for (Neuron n : ns) inputs.add(n); } public void setWeight (float newWeight) { weight = newWeight; } public void setWeight (boolean newWeight) { weight = newWeight ? 1.0f : 0.0f; } public float getWeight () { return weight; } public float fire () { if (inputs.size() > 0) { float totalWeight = 0.0f; for (Neuron n : inputs) { n.fire(); totalWeight += (n.isFired()) ? n.getWeight() : 0.0f; } fired = totalWeight > threshhold; return totalWeight; } else if (weight != 0.0f) { fired = weight > threshhold; return weight; } else { return 0.0f; } } public boolean isFired () { return fired; } } ``` In my main class, I've created the simple simulation in modeling Jeff Heaton's diagram: ![XOR diagram](https://i.stack.imgur.com/LcUt6.jpg) However, I wanted to ensure my implementation for the Neuron class is correct..I've already tested all possible inputs ( [true true], [true false], [false true], [false false]), and they all passed my manual verification. Additionally, since this program accepts the inputs as arguments, it also seems to pass manual verification for inputs such as [true false false], [true true false], etc.. But conceptually speaking, would this implementation be correct? Or how can I improve upon it before I start further development and research into this topic? Thank you!
java simple neural network setup
CC BY-SA 2.5
0
2011-01-18T01:18:29.630
2017-10-20T20:59:29.510
null
null
544,109
[ "java", "artificial-intelligence", "neural-network", "simulation" ]
4,719,814
1
4,720,334
null
1
9,124
Problem is when I am using a custom progressDrawable in a SeekBar widget (perhaps incorrectly) it is rendered in a very aliased/ugly/low quality form. I have set "drawingCacheQuality" to high and there is no difference. Anyone have any ideas? Am developing on a Nexus One (OS 2.2.1) with target build for project as API 1.5 (though I would hope that shouldn't matter). Here is a sample of what it looks like: ![alt text](https://i.stack.imgur.com/pu88j.png) My aim is to create a simple nifty visual switch with two states (on and off), and a slider to move between them. I didn't really see a better widget for this and practically everything is done for me with SeekBar. If someone has a better idea which doesn't involve rewriting tons of boiler plate code that would be nice. It just seems like this should really be doable with minimal effort somehow working with or extending SeekBar. I'm at a bit of a loss where to start though. I'm guessing one idea would be to just overlay my on_off image onto the ShapeDrawable and use that as the background (and "@android:color/transparent" for progressDrawable), but I'm not too familiar with how to do that... Basic code for a new actvitiy ``` @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); seek = (SeekBar)findViewById(R.id.seek); seek.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { public void onProgressChanged(SeekBar seekBar, int progress, boolean fromTouch) { } public void onStartTrackingTouch(SeekBar seekBar) { } public void onStopTrackingTouch(SeekBar seekBar) { if (seek.getProgress() < seek.getMax() / 2.0) seek.setProgress(0); else seek.setProgress(seek.getMax()); } }); } ``` main.xml defining the SeekBar ``` <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#FFFFFF"> <SeekBar android:id="@+id/seek" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:layout_height="wrap_content" android:layout_width="200dip" android:background="@drawable/background" android:padding="4dip" android:drawingCacheQuality="high" android:progressDrawable="@drawable/slider_on_off" android:progress="99" android:max="99" android:maxHeight="100dip" android:thumb="@drawable/slider_box" android:thumbOffset="0dip" /> </RelativeLayout> ``` background.xml Background of seekbar ``` <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" android:useLevel="false" > <corners android:radius="4dip" /> <solid android:color="#FF282828" /> </shape> ```
Android: Custom Drawable in a SeekBar widget is drawing aliased images
CC BY-SA 2.5
0
2011-01-18T01:56:23.643
2013-05-14T07:10:00.517
2011-03-10T22:27:54.993
572,002
572,002
[ "java", "android", "widget", "seekbar" ]
4,720,161
1
null
null
1
979
I have many to many relationship in my application and I am using fluent nhibernate. A login can have many roles. ( A role can also have many logins ). I have seen many examples of using a composite primary key. ``` HasManyToMany<Role>(x => x.Roles).Table("Role") .ParentKeyColumn("RoleId") .ChildKeyColumn("LoginId"); ``` Do you know if Fluent/NHibernate supports Many to Many relationships without having the database associative entity (Login_Role) requiring a composite primary key. I would prefer to have Login_Role use a surrogate primary key. Cheers, Andrew ![alt text](https://i.stack.imgur.com/hywqp.jpg)
Fluent Nhibernate many to many relationship using a surrogate primary key
CC BY-SA 2.5
null
2011-01-18T03:12:46.777
2011-01-18T12:04:36.683
null
null
484,420
[ "nhibernate" ]
4,720,381
1
4,720,598
null
1
859
I'm generating the graph below (RS2008R2) using this SQL: ``` SELECT Merchant.Name as MerchantName, CONVERT(char(8), VoucherRedemption.RedeemedAtUTC, 112) as ShortDateRedeemed, COUNT(CONVERT(char(8), VoucherRedemption.RedeemedAtUTC, 112)) as NumberRemeemedOnDay FROM Merchant INNER JOIN Terminal ON Merchant.MerchantUID = Terminal.MerchantUID INNER JOIN VoucherRedemption ON Terminal.TerminalUID = VoucherRedemption.TerminalUID WHERE Merchant.Name = 'Merchant 1' GROUP BY merchant.Name, CONVERT(char(8), VoucherRedemption.RedeemedAtUTC, 112) ``` How do I get a steady date timeline on the bottom axis of the graph? ie I want to show a lot of 0 column data in this graph with all dates showing. A though is that Reporting Services 2008R2 may handle this well, but haven't found a good example yet. ![alt text](https://i.stack.imgur.com/Ec06U.png)
SQL How to get 0 values
CC BY-SA 2.5
null
2011-01-18T04:04:19.500
2011-01-18T04:54:14.140
null
null
26,086
[ "sql", "reporting-services" ]
4,720,506
1
4,720,750
null
0
1,552
I have an App that lets the user choose a Browser, or Column View, much like Finder. Since it allows the user to browse a Backup, I'd love to have something like the Finder has in Column view. You select a file, and it shows details about it in the column view, next to the file, like this: ![Image](https://i.stack.imgur.com/w2ccc.png) My application looks like this, when a leaf is selected: ![Image](https://i.stack.imgur.com/zAXhZ.png) Here, you can see how a sort of Preview/Inspector thing might help. I have it all set up in an NSView, but just have no idea how to add that functionality in there. Any help would be greatly appreciated!
Finder-like Browser View
CC BY-SA 2.5
null
2011-01-18T04:32:16.873
2011-01-18T05:22:50.357
null
null
219,515
[ "cocoa", "finder", "nsbrowser" ]
4,720,591
1
15,532,716
null
7
13,731
I'm writing a program that makes extensive use of vectors and am developing with Qt Creator 2.0.1 on Mac OS X 10.6.6 for the first time. As I am debugging, I can see literals and arrays just fine in the `Locals and Watchers` window, but as soon as I go to expand a vector, in this case of type `Student`, I get this tree: ![alt text](https://i.stack.imgur.com/KUjQi.png) The other person I am working with on this is using the same version of Qt Creator on Ubuntu and can see the contents of the vectors just fine. What am I doing wrong? This is his debugger: ![alt text](https://i.stack.imgur.com/OZ8mY.png)
How do I make Qt Creator's debugger show the contents of C++ vectors in OS X?
CC BY-SA 2.5
0
2011-01-18T04:53:31.787
2013-03-20T19:42:59.323
2011-01-18T06:58:42.237
2,796
579,405
[ "c++", "gdb", "debugging", "qt-creator" ]
4,721,033
1
null
null
-1
3,490
i want access my friends system by typing //tom in windows RUN terminal , now i want type his full ip like 10.233.20.23 . where i set //tom . may i simplify my Questions.. ( how to call by ) NB : both computer in same local network. ( ) ![alt text](https://i.stack.imgur.com/TXMY2.png) how to change this to ????????? ![alt text](https://i.stack.imgur.com/qrT2O.png) thanks and regards...
how to access share folder from other computer by a name in xp
CC BY-SA 2.5
null
2011-01-18T06:15:23.223
2011-01-18T06:28:30.133
null
null
481,682
[ "networking", "ip-address" ]
4,721,072
1
4,721,104
null
1
5,248
How can I write ``` <input type="checkbox" name="@var.ID"/> ``` If I use it, it never works. How can I do it? It's rendered as well as I write in the code. ![alt text](https://i.stack.imgur.com/rihIz.png) It's not worked as well scottgu defined in their blog.
dynamic attribute value in MVC 3 with razor viewengine
CC BY-SA 3.0
null
2011-01-18T06:23:01.553
2012-12-23T20:38:57.803
2012-12-23T20:38:57.803
1,275,577
null
[ "html", "asp.net-mvc", "razor" ]
4,721,342
1
4,751,344
null
0
1,612
I'm trying to build a 32-bit program that can run correctly on 64-bit Windows; that is, if it needs to open a text file for the user, the file needs to be redirected from `C:\Program Files` to `C:\Program Files (x86)`. However, if I just call `Wow64DisableWow64FsRedirection`, then my program fails to load at all because some system libraries call `LoadLibrary` when portions of the GUI are loading, which tries to load a 64-bit version of a system DLL into my program. How do I solve this problem? --- Edit: See the problem in the screenshot below: ![](https://i.stack.imgur.com/fIGdX.png) --- Edit 2: Here's another question that'll solve the problem: Is there any way to disable WOW64 redirection for an arbitrary thread in your process, or for your process as a whole?
WOW64 Redirection and LoadLibrary
CC BY-SA 2.5
null
2011-01-18T07:06:16.417
2011-01-24T00:57:18.333
2011-01-24T00:57:18.333
541,686
541,686
[ "dllimport", "loadlibrary", "wow64" ]
4,721,398
1
4,721,447
null
-2
1,824
![alt text](https://i.stack.imgur.com/ZKUPU.png) My code was .... But it only send one field value to email .... I want multiple values to be send as it is in mail ... like .. ``` Category : Your name : Email ID Mobile no. etc.. ``` All form values will be transferred to mail ID ... ``` Imports System.Net.Mail Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click Try Dim SmtpServer As New SmtpClient() Dim mail As New MailMessage() SmtpServer.Credentials = New Net.NetworkCredential("[email protected]", "pink&777") SmtpServer.Port = 25 SmtpServer.Host = "mail.volvobusesindia.com" mail = New MailMessage() mail.From = New MailAddress(TextBox12.Text) mail.To.Add("[email protected]") mail.Subject = "New Bus Booking Query" mail.Body = "Category :" & " " & DropDownList3.SelectedItem.Text SmtpServer.Send(mail) MsgBox("mail send") Catch ex As Exception MsgBox(ex.ToString) End Try End Sub ```
How to send this form using SMTP and VB.NET?
CC BY-SA 2.5
null
2011-01-18T07:15:47.270
2011-01-18T07:56:55.170
2011-01-18T07:22:12.167
576,013
576,013
[ "asp.net", "vb.net" ]
4,721,772
1
4,721,855
null
0
1,402
My xml: ``` <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:id="@+id/Title" android:text="title" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" android:layout_alignParentTop="true" /> <EditText android:id="@+id/ReplyText" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="top" android:layout_below="@+id/Title" android:layout_above="@+id/Save" /> <!-- <WebView android:id="@+id/webview" android:layout_width="fill_parent"--> <!-- android:layout_height="fill_parent" android:layout_below="@+id/Title"--> <!-- android:layout_above="@+id/Save"/>--> <Button android:text="Save" android:id="@+id/Save" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" /> </RelativeLayout> ``` Output in sdk 3 (1.5) and sdk 9 (2.3) ![alt text](https://i.stack.imgur.com/hgfSs.png) Why EditText is not displaying in 1.5 version? There must be a solution of this, because if I replace EditText with WebView with a little code added in onCreate method: ``` WebView mWebView = (WebView) findViewById(R.id.webview); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.loadData("test", "text/html", "utf-8"); mWebView.setWebViewClient(new WebViewClient()); ``` It displays WebView perfectly in both the version. I want to set header and footer elements as show in picture and middle element should have full height/width of the rest of the place.
Android: Relative layout issue
CC BY-SA 2.5
null
2011-01-18T08:09:13.733
2011-06-07T12:03:09.163
2020-06-20T09:12:55.060
-1
415,865
[ "android", "android-layout" ]
4,721,971
1
4,722,321
null
1
1,334
Can anybody of you good people to help me, I just cannot to move txtIPAddress and label ip Address to left, it is cutted now. I tried to experiment with weightx 0 to 1, ipadx but it didn't help. This is my function for red panel. Any help please ? ![alt text](https://i.stack.imgur.com/XjxhC.jpg) ``` pnlCom=new JPanel(); pnlCom.setBackground(Color.red); pnlCom.setSize(460,160); pnlCom.setLocation(10, 60); add(pnlCom); //add(pnlTcp); add(pnlCommon); GridBagLayout gb=new GridBagLayout(); GridBagConstraints gc=new GridBagConstraints(); pnlCom.setLayout(gb); jLabelcommPort = setJLabel("Com Port : "); jLabelbaudRate = setJLabel("Baud Rate : "); jLabelplcAddress = setJLabel("Plc Address : "); jLabelsendTime = setJLabel("<html>Send Time : <br/>x 50 ms (2 - 99)</html>"); jLabelx50 = setJLabel(" x 50 ms (2 - 99)"); jComboBoxcommPort = setJComboBox(commPortList); jComboBoxbaudRate = setJComboBox(bitRateList); jTextAreaPlcAddress = setJTextField(""); jTextAreaSendTime = setJTextField(""); lblComType=setJLabel("Com type : "); cmbComType=setJComboBox(comType); lblIPAddress=setJLabel("IP Address : "); txtIPAddress=setJTextField(""); gc.insets = new Insets(10,0,0,0); gc.ipadx = 80; gc.weightx = 0.25; gc.gridx = 0; gc.gridy = 0; gc.anchor=GridBagConstraints.EAST; pnlCom.add(jLabelcommPort,gc); gc.insets = new Insets(10,0,0,0); gc.ipadx = 80; gc.weightx = 0.25; gc.gridx = 1; gc.gridy = 0; gc.anchor=GridBagConstraints.EAST; pnlCom.add(jComboBoxcommPort,gc); gc.insets=new Insets(10,0,0,0); gc.ipadx=80; gc.weightx = 0.5; gc.gridx=0; gc.gridy=1; gc.anchor=GridBagConstraints.EAST; pnlCom.add(jLabelbaudRate,gc); gc.insets=new Insets(10,0,0,0); gc.ipadx=80; gc.weightx = 0.5; gc.gridx=1; gc.gridy=1; gc.anchor=GridBagConstraints.EAST; pnlCom.add(jComboBoxbaudRate,gc); gc.insets=new Insets(10,0,0,0); gc.ipadx=80; gc.weightx = 0.5; gc.gridx=0; gc.gridy=2; gc.anchor=GridBagConstraints.EAST; pnlCom.add(lblComType,gc); gc.insets=new Insets(10,0,0,0); gc.ipadx=80; gc.weightx = 0.25; gc.gridx=1; gc.gridy=2; gc.anchor=GridBagConstraints.EAST; pnlCom.add(cmbComType,gc); gc.insets = new Insets(10,0,0,0); gc.ipadx = 80; gc.weightx = 0.25; gc.gridx = 2; gc.gridy = 0; gc.anchor=GridBagConstraints.WEST; pnlCom.add(lblIPAddress,gc); gc.insets = new Insets(10,0,0,0); gc.ipadx = 80; gc.weightx = 0.25; gc.gridx = 3; gc.gridy = 0; gc.anchor=GridBagConstraints.WEST; pnlCom.add(txtIPAddress,gc); ```
Move label and text box to left in Gridbaglayout
CC BY-SA 2.5
null
2011-01-18T08:37:47.810
2011-01-18T09:14:00.390
2011-01-18T08:45:22.723
21,234
486,578
[ "java", "swing", "gridbaglayout" ]
4,722,054
1
4,724,030
null
5
656
Internet Explorer 7 (but not 8/9) blocks anything downloading until the CSS file has finished on our site. We are not using Internet Explorer tests around it `<!--[if IE ]><![endif]-->`, nor are we using protocol independent URI's (`//` instead of `http://`). It is just a straight forward `/css/global/core.css` link and yet the browser waits until it has finished downloading before commencing. Are there any techniques to prevent this behaviour? PS: All the JavaScript is at the bottom, all the static content is hosted on another domain (except the CSS due to it being able to reuse the existing connection after the HTML document, resulting in a faster experience for the user even with additional cookie headers). The problem is that profiling IE7 with DynaTrace causes CSS files to block further downloads, however with DynaTrace turned off it works. So this is a DynaTrace bug, not an IE7 one. ![alt text](https://i.stack.imgur.com/bWoha.png) ![alt text](https://i.stack.imgur.com/2jFMi.png)
Preventing <link>ed CSS file blocking downloads in Internet Explorer 7
CC BY-SA 2.5
null
2011-01-18T08:46:41.720
2011-01-19T15:18:20.333
2011-01-19T15:18:20.333
179,454
179,454
[ "css", "internet-explorer" ]
4,722,114
1
null
null
16
27,802
I have a ListBox (WPF) that contains CheckBoxes. I'm using is in a configuration screen. Schematic example below: ![alt text](https://i.stack.imgur.com/rvjgO.png) Now I want to add a "Test 5" CheckBox. I have limited vertical space, so I want it to appear in the horizontal direction, as shown below: ![alt text](https://i.stack.imgur.com/wrQjP.png) Can the ListBox layout be modified so the CheckBoxes will be arranged like this?
WPF Listbox layout: multiple columns
CC BY-SA 2.5
0
2011-01-18T08:53:07.180
2018-12-18T21:53:25.257
null
null
97,060
[ "c#", "wpf", "xaml" ]
4,722,263
1
null
null
0
438
I have a simple console app that was creted in c# using VisualStudio. It has a input parameter and return it to output. This is the code: ``` static void Main(string[] args) { string msg = args[0]; Console.WriteLine(msg); } ``` Then I try to pass a param that contain a xml as string: `"<messages><message>message</message></messages>"`. There is nothing wrong if I will use console for calling application. But in the case when I trying to debug such application I have added parameter string to on the tab. ![alt text](https://i.stack.imgur.com/G0iYQ.png) After this I have got unexpected output like: ``` ^<messages^>^<message^>message^</message^>^</messages^> ``` Why we have such output and how to overcome this? Thanks in advance. --- The simplest solution for this issue should be replacing unwilling characters like here: static void Main(string[] args) { string msg = args[0]; Console.WriteLine(msg.Replace("^",""); } But the reason of such behavior placed somewhere in the core of the operation system. Windows handle this situation like launch a batch file from command line with parameters. Following the link that was presented in the answer of @Artem K. you can find out that here is two way to overcome such situation. Unfortunately, no one work with this issue. Possible, because Visual Studio add something from yourself in the question how to pass args for launching batch.
Strange XML modification when input and output it in console app using Visual Studio
CC BY-SA 2.5
0
2011-01-18T09:07:50.850
2012-04-25T10:40:31.417
2011-01-21T16:53:12.747
157,666
157,666
[ "c#", "xml", "visual-studio", "console" ]
4,722,347
1
4,722,374
null
0
65
How can I speed up this query ? ``` SELECT PadID, CatID, IconSoureURL, OsStr, PadURL, PageName, ProgramName, ProgramVersion, ReleaseStatus, English45, License, DownloadURL FROM Pads WHERE RemoveMeDate = '2001-01-01 00:00:00' ORDER BY VersionAddDate DESC LIMIT 360 , 40 ``` I already have an index, heres the query explained . ![alt text](https://i.stack.imgur.com/LZeGZ.png)
MySQL, how can I speed up this query which takes 1.4 second?
CC BY-SA 2.5
0
2011-01-18T09:16:50.447
2011-01-20T04:47:01.707
2011-01-20T04:47:01.707
135,152
450,456
[ "sql", "mysql", "query-optimization" ]
4,722,669
1
4,728,738
null
69
55,479
Is it possible to add a standard-looking badge to a standard `UIButton`? If it's not supported semi-natively, what would be the simplest way to achieve this? Example image: ![An iPhone UI button](https://i.stack.imgur.com/ij89N.png)
How can I add a badge to a standard UIButton?
CC BY-SA 3.0
0
2011-01-18T09:55:59.013
2014-10-01T06:00:17.320
2012-02-20T10:29:06.983
561,309
272,973
[ "iphone", "cocoa-touch", "ios", "badge" ]
4,722,673
1
4,724,963
null
10
873
![A class diagram](https://i.stack.imgur.com/SmuZE.jpg) I have copy pasted some classes into this project, some from other projects. At some point VS has marked `Class1` as a component (you can see from the icon shown in the screenshot above). `Class2` is OK. There's no difference in the and no interesting difference in the code between `Class1` and `Class2` (*except see below) It doesn't stop the code from compiling or running. Is it in fact a problem at all? It inconvenient in that the IDE tries to open the Design window if you double click the file. How does this happen, and how to fix? Actually, there are interesting differences in the code window. At least, there must be, since removing a large chunk of the code causes the Solution Explorer to revert the file to a file. Restore the chunk and the file goes back to being a . Currently... investigating.
Why has Visual Studio marked my class as a component?
CC BY-SA 3.0
0
2011-01-18T09:56:27.020
2013-02-20T08:02:05.163
2012-12-04T15:29:09.633
109,941
180,430
[ "visual-studio-2010", "visual-studio-2008", "ide" ]