Id
int64
1.68k
75.6M
PostTypeId
int64
1
2
AcceptedAnswerId
int64
1.7k
75.6M
ParentId
int64
1.68k
75.6M
Score
int64
-60
3.16k
ViewCount
int64
8
2.68M
Body
stringlengths
1
41.1k
Title
stringlengths
14
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
1
CreationDate
stringlengths
23
23
LastActivityDate
stringlengths
23
23
LastEditDate
stringlengths
23
23
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
1
21.3M
Tags
sequence
1,525,514
1
1,525,523
null
4
778
For the life of me, I don't know when and how these "dots" started showing up in my IDE. I'm not sure if it's Visual Studio OR Code Rush from DevExpress that is doing it. ![alt text](https://lh4.ggpht.com/_MwlyfvVOvjY/SstCb_gB-5I/AAAAAAAAAIk/FUR_vlRe2sY/s720/Screenshot.png) If anyone knows how to make them go away, please help! =)
Where are these dots coming from? How to get rid of them?
CC BY-SA 2.5
0
2009-10-06T13:15:27.240
2010-01-21T00:51:14.843
2017-02-08T14:16:01.513
-1
1,768
[ ".net", "visual-studio-2008", "ide" ]
1,526,767
1
1,542,435
null
16
18,826
What is the proper way to implement Custom Properties in Silverlight UserControls? Every "Page" in Silverlight is technically a UserControl (they are derived from the UserControl class). When I say UserControl here, I mean a Custom UserControl that will be used inside many different pages in many different scenarios (similar to an ASP.NET UserControl). I would like the Custom UserControl to support Binding and not rely on the Name of the Property it is binding to, to always be the same. Instead, I would like the UserControl itself to have a property that the Controls inside the UserControl bind to, and the ViewModels outside the UserControl also bind to. (please see the example below) Binding within the UserControl works, Binding within the MainPage works, The Binding I set up between the MainPage and the UserControl does not work. Specifically this line: ``` <myUserControls:MyCustomUserControl x:Name="MyCustomControl2" SelectedText="{Binding MainPageSelectedText, Mode=TwoWay}" Width="200" Height="50" /> ``` example output: ![alt text](https://i690.photobucket.com/albums/vv264/cfalc0n/SilverlightUserControlCustomPropert.png) MainPage.xaml ``` <UserControl x:Class="SilverlightCustomUserControl.MainPage" 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" xmlns:myUserControls="clr-namespace:SilverlightCustomUserControl" mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480" DataContext="{Binding RelativeSource={RelativeSource Self}}"> <Canvas x:Name="LayoutRoot"> <StackPanel Orientation="Vertical"> <TextBlock Text="UserControl Binding:" Width="200"></TextBlock> <myUserControls:MyCustomUserControl x:Name="MyCustomControl2" SelectedText="{Binding MainPageSelectedText, Mode=TwoWay}" Width="200" Height="50" /> <TextBlock Text="MainPage Binding:" Width="200"></TextBlock> <TextBox Text="{Binding MainPageSelectedText, Mode=TwoWay}" Width="200"></TextBox> <Border BorderBrush="Black" BorderThickness="1"> <TextBlock Text="{Binding MainPageSelectedText}" Width="200" Height="24"></TextBlock> </Border> </StackPanel> </Canvas> </UserControl> ``` MainPage.xaml.cs ``` namespace SilverlightCustomUserControl { public partial class MainPage : UserControl, INotifyPropertyChanged { //NOTE: would probably be in a ViewModel public string MainPageSelectedText { get { return _MainPageSelectedText; } set { string myValue = value ?? String.Empty; if (_MainPageSelectedText != myValue) { _MainPageSelectedText = value; OnPropertyChanged("MainPageSelectedText"); } } } private string _MainPageSelectedText; public MainPage() { InitializeComponent(); } #region INotifyPropertyChanged Members public event PropertyChangedEventHandler PropertyChanged; protected virtual void OnPropertyChanged(string name) { PropertyChangedEventHandler ph = this.PropertyChanged; if (ph != null) ph(this, new PropertyChangedEventArgs(name)); } #endregion } } ``` MyCustomUserControl.xaml ``` <UserControl x:Class="SilverlightCustomUserControl.MyCustomUserControl" 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" DataContext="{Binding RelativeSource={RelativeSource Self}}"> <Grid> <StackPanel> <TextBox Text="{Binding SelectedText, Mode=TwoWay}" /> <Border BorderBrush="Black" BorderThickness="1"> <TextBlock Text="{Binding SelectedText}" Height="24"></TextBlock> </Border> </StackPanel> </Grid> </UserControl> ``` MyCustomUserControl.xaml.cs ``` namespace SilverlightCustomUserControl { public partial class MyCustomUserControl : UserControl { public string SelectedText { get { return (string)GetValue(SelectedTextProperty); } set { SetValue(SelectedTextProperty, value); } } public static readonly DependencyProperty SelectedTextProperty = DependencyProperty.Register("SelectedText", typeof(string), typeof(MyCustomUserControl), new PropertyMetadata("", SelectedText_PropertyChangedCallback)); public MyCustomUserControl() { InitializeComponent(); } private static void SelectedText_PropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) { //empty } } } ``` References (how I got this far): use DependencyPropertys: [http://geekswithblogs.net/thibbard/archive/2008/04/22/wpf-custom-control-dependency-property-gotcha.aspx](https://web.archive.org/web/20200215181601/http://geekswithblogs.net:80/thibbard/archive/2008/04/22/wpf-custom-control-dependency-property-gotcha.aspx) use DependencyPropertys, add x:Name to your UserControl - add Binding with ElementName, set Custom property again in the PropertyChangedCallback method: [Setting Custom Properties in UserControl via DataBinding](https://stackoverflow.com/questions/845564/setting-custom-properties-in-usercontrol-via-databinding) don't use custom properties, rely on underlying datacontext names (I do not like this solution): [wpf trouble using dependency properties in a UserControl](https://stackoverflow.com/questions/1145435/wpf-trouble-using-dependency-properties-in-a-usercontrol)
Silverlight UserControl Custom Property Binding
CC BY-SA 4.0
0
2009-10-06T16:46:26.587
2022-12-18T15:00:38.047
2022-12-18T15:00:38.047
4,751,173
47,226
[ "silverlight", "binding", "user-controls" ]
1,526,898
1
null
null
15
58,739
I want to plot a heart shape wireframe as shown in the following image ([source](http://zedomax.com/blog/2008/09/03/i-love-meth-t-shirt/)): ![heart-shape](https://i.stack.imgur.com/jWNtP.jpg) I have tried to make it by using this MATLAB program: ``` n=100; x=linspace(-3,3,n); y=linspace(-3,3,n); z=linspace(-3,3,n); [X,Y,Z]=ndgrid(x,y,z); F=((-(X.^2) .* (Z.^3) -(9/80).*(Y.^2).*(Z.^3)) + ((X.^2) + (9/4).* (Y.^2) + (Z.^2)-1).^3); isosurface(F,0) lighting phong caxis axis equal colormap('flag'); view([55 34]); ``` But I didn't get the desired shape of framework as shown in the figure. I have identified the problem: to create a wireframe we usually use the command `mesh()`. But this plotting facility only allow us to plot a function of two variables such as `z=f(x,y)`. But my program makes use of three variables: `F(x,y,z)`. How can I solve the problem?
How do I reproduce this heart-shaped mesh in MATLAB?
CC BY-SA 3.0
0
2009-10-06T17:12:52.520
2017-07-08T04:28:40.750
2017-05-25T14:36:30.460
97,160
183,780
[ "matlab", "3d", "volume", "wireframe" ]
1,526,910
1
1,566,975
null
4
3,369
I have a custom table cell which contains a number of UILabels. At runtime, I am adjusting the height of the labels to fit their contents using `sizeWithFont:constrainedToSize:lineBreakMode:` and repositioning them accordingly. The last label in the cell contains a large amount of text, causing it to wrap, and I'm having a very odd problem. Although the `sizeWithFont` call returns the correct size, and I'm setting the UILabel's frame to that height, it draws a couple of lines short. This screenshot illustrates what I'm talking about: ![Screenshot of UILabel problem](https://content.screencast.com/users/MrTact/folders/Jing/media/e040f4ec-be5c-432a-888a-b438f84ce8f5/00000003.png) In this example, the height of the full block of text should be 90 (as checked in Interface Builder), and that's what returns from `sizeWithFont`. It's also the height that the UILabel's frame is set to, which I have verified by logging and also by stopping execution and inspecting the value. However, as you can see, it's clearly drawing the full 90 pixels high, although it's correctly allocating the space for it (the thin black line above 'Edited' is the table cell border). I'm completely perplexed. If anyone can offer some insight as to why it's behaving this way, I would be very grateful.
UILabel inside custom UITableViewCell not drawing at the correct size
CC BY-SA 2.5
0
2009-10-06T17:14:12.460
2014-09-12T11:26:48.410
2017-02-08T14:16:03.453
-1
9,279
[ "iphone" ]
1,530,600
1
1,530,744
null
7
1,354
I have a scenario in my project where I need to share a single file between multiple projects in the same solution. Back in my Visual Source Safe days (Shudder), I'd use the "Share" option to allow me to make changes to this file in any of the locations. Then once it was checked in I could guarantee that the other locations will get the update. ![alt text](https://farm4.static.flickr.com/3504/3989925288_f9ee73178d_o.jpg) I'm trying to do this in Subversion but I can't seem to find the option anywhere. I do know about svn:externals however I'm only interested in sharing a single file between multiple locations. Does anyone know how to do this in Subversion? Thanks In the end i decided to use the sharing capabilities in visual studio. It works exactly like the share used to work in Visual Source safe. I.e. I only have to maintain 1 file and both are updated. To do this you goto Add Existing Item >> Then CLick Add as Link from the top down bottom right.
Subversion (SVN) equivalant to Visual Source Safe (VSS) "Share"
CC BY-SA 2.5
0
2009-10-07T09:52:13.917
2010-06-23T11:36:53.507
2017-02-08T14:16:05.987
-1
30,317
[ "svn", "visual-sourcesafe", "share" ]
1,532,955
1
1,533,027
null
2
5,090
Hey guys, hoping for some help with this :( been stuck on it for a couple days now. I'm creating a ScrollBar using [Lee Brimelow's ScrollBar class](http://www.gotoandlearn.com/play?id=72). I've had to modify it to work inside of my Class files and think I'm on the right track, but I'm getting the dreaded: error. When I run debug, it hits on the line where I have CODE FROM SCROLLBAR CLASS: ``` import flash.display.*; import flash.events.*; import caurina.transitions.*; public class ScrollBar extends MovieClip { private var yOffset:Number; private var yMin:Number; private var yMax:Number; private var thumbsnailTab:MovieClip; private var theRoller:MovieClip; public function ScrollBar(myRoller:MovieClip, myTrack:MovieClip, thumbsnails:MovieClip):void { yMin = 0; yMax = myTrack.height - myRoller.height; theRoller = myRoller; thumbsnailTab = thumbsnails; myRoller.addEventListener(MouseEvent.MOUSE_DOWN, rollerDown); stage.addEventListener(MouseEvent.MOUSE_UP, rollerUp); } ``` This is what my debug is showing me: ![alt text](https://farm3.static.flickr.com/2502/3989957503_ff3b06a261_o.png) At first I wasn't sure if it was the stage reference that is causing the error or the rollerUp function, but since I commented out the stage.removeEventListener and added a basic trace statement it still throws up an error so I believe it has something to do with: ``` stage.addEventListener(MouseEvent.MOUSE_UP, rollerUp); ``` Now I have imported events.*; to the ScrollBar class... maybe the problem is in my main class where I create the graphics for the ScrollBar as well as add the ScrollBar to the display list? CODE FROM MAIN CLASS: ``` // Creating Graphics track1 = new Track; track1.x = 0; track1.y = 0; roller1 = new Roller; roller1.x = 0; roller1.y = 0; sc1 = new EmptyMov; sc1.x = 764; sc1.y = 470; sc1.addChild(track1); sc1.addChild(roller1); // Adding ScrollBar to Stage scroll1 = new ScrollBar(roller1, track1, tab1); container.addChild(sc1); container.addChild(scroll1); addChild(container); ``` I'm stuck here, not sure why I'm getting that Null reference error, as well as not sure if I'm creating the graphics the right way as well as using the ScrollBar class correctly :( any tips appreciated! ![alt text](https://farm4.static.flickr.com/3443/3989982811_398b554215.jpg) --- ## Update Code Working! :D ``` public function ScrollBar(myRoller:MovieClip, myTrack:MovieClip, thumbsnails:MovieClip):void { yMin = 0; yMax = myTrack.height - myRoller.height; theRoller = myRoller; thumbsnailTab = thumbsnails; myRoller.addEventListener(MouseEvent.MOUSE_DOWN, rollerDown); } private function rollerDown(e:MouseEvent):void { stage.addEventListener(MouseEvent.MOUSE_UP, rollerUp); stage.addEventListener(MouseEvent.MOUSE_MOVE, rollerMove); yOffset = mouseY - theRoller.y; } ``` ![alt text](https://farm4.static.flickr.com/3529/3990879022_8bac543617.jpg)
Help - Null Object error when using stage.addEventListener (ScrollBar)
CC BY-SA 2.5
0
2009-10-07T17:09:58.747
2010-04-27T17:43:37.010
2017-02-08T14:16:07.017
-1
168,738
[ "flash", "actionscript-3", "null", "scrollbar" ]
1,535,625
1
null
null
0
224
I'm designing a little website ([you can see it here](http://www.brianjameswelsh.com/veganauts/)), but I'm getting conflicts with something going from Mac based web browsers to PC based browsers. It seems to pop up on all Mac browsers and not on PC browsers. I have tested on Safari and Firefox on the Mac and Firefox/Internet Explorer on PC. The image on the left is from a PC, the one on the right is from a Mac. As you can see there is a one pixel or so gap being placed under the menu. The menu should be flush with the main content. ![https://forums.adobe.com/servlet/JiveServlet/showImage/2-2299788-12861/2up.jpg](https://forums.adobe.com/servlet/JiveServlet/showImage/2-2299788-12861/2up.jpg) Why is it doing this? I have tried everything I can think of without success.
Compatibility problem on Mac browsers
CC BY-SA 3.0
null
2009-10-08T04:29:05.513
2011-05-03T13:00:43.087
2017-02-08T14:16:08.063
-1
72,571
[ "css", "macos", "cross-browser", "html" ]
1,535,826
1
1,535,921
null
16
22,819
I'd like the user to resize a borderless window on bottom right corner like I can resize the autocomplete window of the combobox control. I cannot find the properties to configure a form that way. Maybe someone could help me on the problem. An image could be found here: ![enter image description here](https://i.stack.imgur.com/hJCzo.png)
Resize borderless window on bottom right corner
CC BY-SA 3.0
0
2009-10-08T05:49:04.993
2019-09-16T18:51:33.327
2013-08-05T04:40:11.603
1,026,805
91,963
[ "c#", "winforms" ]
1,536,618
1
1,677,330
null
3
8,475
I'm having a problem sorting this out, basically it will be a list with icons and text below. Icon size remains the same but the text doesn't, as shown in the picture ![alt text](https://i.stack.imgur.com/RQucW.png). The problem is when a `<li>` has a lot of text the rest float to the right of it. How can I sort this out. My code is below: ``` ul.iconifier { width: 100%; list-style: none; margin: 0 auto; padding: 0; } ul.iconifier li { float: left; margin: 10px; padding: 0; text-align: center; border: 1px solid #ccc; width:8em; height:200px; -moz-border-radius: 3px; /*--CSS3 Rounded Corners--*/ -khtml-border-radius: 3px; /*--CSS3 Rounded Corners--*/ -webkit-border-radius: 3px; /*--CSS3 Rounded Corners--*/ display: block; /*--IE6 Fix--*/ height:101%; } ul.iconifier li a.thumb{ width: 128px; height: 128px; overflow: hidden; display: block; cursor: pointer; } ul.iconifier li a.thumb:hover { } ul.iconifier li p { font: normal 0.75em Verdana, Arial, Helvetica, sans-serif; margin: 0; padding: 10px 5px; background: #f0f0f0; border-top: 1px solid #fff; /*--Subtle bevel effect--*/ text-align:center; width:118px; } ul.iconifier li a {text-decoration: none; color: #777; display: block;} ``` html: ``` <ul class="iconifier"> <li> <a href="#" class="thumb" Title=""><img src="img/sprite.png" alt="Contacts" /></a> <p><a href="#">English Depatment</a></p> </li> <li> <a href="#" class="thumb" title="art"><img src="img/sprite.png" alt="Art" /></a> <p><a href="#">Art Deptartment</a></p> </li> <li> <a href="#" class="thumb" title="Travel and Tourism"><img src="img/sprite.png" alt="Travel and Tourism" /></a> <p><a href="#">Mathematics</a></p> </li> <li> <a href="#" class="thumb" Title=""><img src="img/sprite.png" alt="Contacts" /></a> <p><a href="#">Business Studies</a></p> </li> <li> <a href="#" class="thumb" Title=""><img src="img/sprite.png" alt="Contacts" /></a> <p><a href="#">English Depatment with a really long title that will hopefully fall</a></p> </li> <li> <a href="#" class="thumb" title="art"><img src="img/sprite.png" alt="Art" /></a> <p><a href="#">Art Deptartment</a></p> </li> <li> <a href="#" class="thumb" title="Travel and Tourism"><img src="img/sprite.png" alt="Travel and Tourism" /></a> <p><a href="#">Mathematics</a></p> </li> <li> <a href="#" class="thumb" Title=""><img src="img/sprite.png" alt="Contacts" /></a> <p><a href="#">Business Studies</a></p> </li> <li> <a href="#" class="thumb" Title=""><img src="img/sprite.png" alt="Contacts" /></a> <p><a href="#">English Depatment</a></p> </li> <li> <a href="#" class="thumb" title="art"><img src="img/sprite.png" alt="Art" /></a> <p><a href="#">Art Deptartment</a></p> </li> </ul> ```
List doesn't display as grid with long texts
CC BY-SA 4.0
null
2009-10-08T09:14:19.327
2019-04-29T16:33:44.830
2019-04-29T16:33:44.830
4,751,173
107,658
[ "css", "css-float" ]
1,540,003
1
null
null
12
2,252
In IE6, IE7 and FF2 the `.outer` div below is stretching out to the right edge of the document. Here is a complete test case: ``` <!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> <style> .outer { position:absolute; border:1px solid red; } .outer .floater { float:right; } </style> </head> <body> <div class="outer"> <div class="floater">Lorem ipsum</div> </div> </body> ``` As I understand `position:absolute`, the outer div should be removed from the flow of the document and (without a width specified) take up the minimal amount of space needed to display its contents. However `float:right` on any child breaks this. Expected output (IE8, FF3+, Chrome 2+, Safari 4, Opera 9+): ![Expected output - IE8, FF3+, Chrome 2+, Safari 4, Opera 9+](https://i.stack.imgur.com/bOxv9.gif) Actual output (IE6, IE7, FF2): ![Actual output - IE6, IE7, FF2](https://i.stack.imgur.com/EzqFH.gif) This is only happening in IE6, IE7 and Firefox 2. Requirements: - `.outer``width``"auto"`- `.outer`- `.floater` --- : I've reproduced the behavior as a "real world" example using jQuery dialog. The characteristics are the same: 1. There is an absolutely positioned div (i.e. the dialog container, jQuery-UI creates this) 2. The div from 1) has width="auto" 3. There is an element inside this dialog that is floated to the right. [See it here](http://jsbin.com/iguxe). Again, IE6, IE7 and FF2 are the only problematic browsers. This replicates the conditions inside my application. I tried boiling down the problem to what you see above this Update, but I'm getting the sense that people could use a real-world example where my requirements make sense. I hope I've done this.
Absolutely positioned parent and float:right child stretches
CC BY-SA 3.0
0
2009-10-08T19:44:28.053
2015-06-20T18:21:38.930
2015-06-20T18:21:38.930
1,159,643
172,188
[ "css", "cross-browser", "testcase" ]
1,541,311
1
1,541,695
null
2
2,209
I have a link that opens a Thickbox... ``` <a href="page.php?tag=lists-element&keepThis=true&TB_iframe=true&height=450&width=500"> ``` Everything works with this except when the Thickbox opens up the title is displayed twice: ![alt text](https://reljac.com/so_1/ThickBoxTitle.jpg) Any ideas as to why this is happening or how it can be fixed?
Thickbox title showing up twice
CC BY-SA 2.5
null
2009-10-09T00:45:25.633
2016-01-06T12:28:27.567
2017-02-08T14:16:09.250
-1
99,401
[ "jquery", "thickbox" ]
1,541,805
1
null
null
2
7,229
how to make an image as an anchor in codeigniter? I've tried the following code, > echo anchor("admin/conf/edit/".$list['id'],img(array('src' => '../img/edit.jpg', 'alt' => ""))); It gives me a grey box like in the Actions column ![alt text](https://i575.photobucket.com/albums/ss197/yonghan79/help.jpg) Thanks...
image as anchor in codeigniter
CC BY-SA 2.5
null
2009-10-09T04:32:13.087
2014-05-14T11:50:57.340
2017-02-08T14:16:09.590
-1
68,944
[ "codeigniter" ]
1,544,163
1
1,544,376
null
5
1,640
I have a table of data which is generated dynamically with Javascript. Every few minutes the page refreshes the data by firing off an Ajax request, getting the data back from the server, and replacing the data in the table. This is pretty standard, and the table ends up looking like this: ![](https://imgur.com/SCHZe.jpg) This works just fine if I generate the data by emptying the table and gradually adding the rows back in. However, this table can potentially have thousands of rows, and it can potentially take so long to generate the table that the browser gives the user a "This script is taking too long to execute" errors. So I fixed this by breaking the table generation into chunks and doing a bit at a time using `setInterval`. This worked fine, but because the table can take awhile to be totally generated, I tried to be clever and do some pseudo-double-buffering. I have a second table which has its `display` set to `none` to hide it, and when I re-generate the table I add the rows to the hidden table a bit at a time. This way the existing data is visible to the user until the table re-generation is complete, at which point we just replace it with our new content all at once. I'm doing my replacement with the following line of code ``` $("#loading_area tbody").children().appendTo( $("#unplanned tbody").empty() ); ``` This works just fine on Firefox, Safari, and Google Chrome. But on IE, I get the following: ![](https://imgur.com/JDpXH.jpg) These rows are actually not blank - the content is there if I scroll horizontally enough: ![](https://imgur.com/6Dr2B.jpg) It seems that the first column is over 55,000 pixels wide! And here's the really weird part: the content re-displays properly as soon as I change ANYTHING about the style of the table. So if I change the font color to green, IE will immediately re-render the table, correctly. But I can't make the change directly. So if I say ``` $("#unplanned").css("color", "green"); ``` then it doesn't re-render properly; the color changes, but the first column stays 55,000 pixels wide. But if I make the change directly to the stylesheet ``` document.styleSheets[1].rules[3].style.color = "green"; ``` then it re-renders the table, correctly. So I ended up fixing this by by making a random style change, toggling the margin of the Expand/Collapse button between `1px` and `0px`, every time I'm finished laying out the table, and this worked. My problem is that when I try to print the page, the rows are blank-looking, because the page content is improperly rendered to the printer. So I'll be trying more trickery, probably just toggling which table is displayed and swapping their `id`s or whatever gets this to work. My question is, what's going on here? This seems like a bug in IE; I'm using IE8 but this same thing happens on IE6 and IE7. I'd like to avoid falling into this pit in the future, but I'm not sure what's causing this, so I'm not really sure what I should be avoiding. Any light that anyone could shed on this would be much appreciated. EDIT: Swapping which table is displayed makes the rendering problem go away in the browser without needing a stylesheet hack, but the problem with printing is still there. In fact, the printing problem is there even when the table is generated directly with no show/hide or element movement trickery at all. So I'm definitely confused and not sure what I can do to make this problem go away. I may have to make a separate, static page just for printing if I can't figure this out.
IE improperly rendering dynamic content until a stylesheet change is made
CC BY-SA 2.5
0
2009-10-09T14:34:26.903
2009-10-09T15:07:28.817
2009-10-09T15:07:28.817
1,694
1,694
[ "javascript", "jquery", "internet-explorer", "rendering", "stylesheet" ]
1,544,500
1
1,544,531
null
37
27,597
In IIS 6 (and other versions too afaik), there is a Session Timeout setting in Properties -> Home Directory Tab -> Configuration button -> Options tab. Looks like this: ![picture of IIS dialog](https://i258.photobucket.com/albums/hh260/zzbucket/IISTimeout.gif) And in the ASP.NET web.config there is a SessionState setting, looks like this: ``` <system.web> <sessionState timeout="120" /> <!-- etc .. --> </system.web> ``` Are they, by any chance, related? Do they set the same thing, or different things?
IIS Session Timeout vs ASP.NET Session Timeout
CC BY-SA 2.5
0
2009-10-09T15:29:08.010
2014-09-22T08:05:56.330
2017-02-08T14:16:09.927
-1
22,194
[ "asp.net", "iis", "session", "session-timeout" ]
1,545,131
1
1,575,329
null
1
7,474
As you can seen in the diagram below there is a one-to-many relationship between the ProjectTask and Dependency table. ![Database Diagram](https://i.stack.imgur.com/8LZ32.jpg) Entities tries to map every field in the View to fields in the Dependency table, which wouldn't work. Any suggestions on how I can add the navigation property? Thanks, Abe --- Here's the link to the Mapping diagram: [Mapping Diagram](http://i805.photobucket.com/albums/yy339/abepark/tableAssoc.jpg)
Entities: Adding a Navigation Property between a View and Table
CC BY-SA 3.0
null
2009-10-09T17:37:14.050
2016-12-26T09:30:45.193
2016-12-26T09:30:45.193
4,099,593
172,202
[ "linq-to-entities", "navigation", "properties", "entity" ]
1,548,214
1
1,549,013
null
7
419
Consider a beginner dealing with Dependency Injection. We're analyzing two relevant classes in NerdDinner. from the application: ![Repo image](https://imgur.com/Lv0Uz.png) from the tests: ![Fakes image](https://imgur.com/TVLV9.png) They implement different logic, which of course is necessary, as the key idea here is to implement the `IDinnerRepository`, and provide different implementations and private members. I understand the test is for the controller, but I am concerned that there are two different implementations of the data access logic. Consider any project that uses any kind of ORM, ADO.NET, SubSonic, or whatever flavour of data access you like. Yes, you can setup your fake repository to match the real repo. My worry is that over time, implementation details in the real repo change. Perhaps a typo slips in, or some other important implementation detail changes in the . This leads to a potential mismatch of the logic in the Model between the fake and the real repo. The worry is that the implementation of the real repo and test repo get out of sync. - - -
Dependency injection in NerdDinner - actually testing your repository or model
CC BY-SA 2.5
0
2009-10-10T15:23:41.070
2010-05-18T05:29:04.467
2010-05-18T05:29:04.467
19,756
23,199
[ "unit-testing", "dependency-injection", "inversion-of-control", "nerddinner" ]
1,550,878
1
1,551,208
null
20
59,628
I am trying to write my own function for scaling up an input image by using the Nearest-neighbor interpolation algorithm. The bad part is I am able to see how it works but cannot find the algorithm itself. I will be grateful for any help. Here's what I tried for scaling up the input image by a factor of 2: ``` function output = nearest(input) [x,y]=size(input); output = repmat(uint8(0),x*2,y*2); [newwidth,newheight]=size(output); for i=1:y for j=1:x xloc = round ((j * (newwidth+1)) / (x+1)); yloc = round ((i * (newheight+1)) / (y+1)); output(xloc,yloc) = input(j,i); end end ``` Here is the output after [Mark](https://stackoverflow.com/users/5987/mark-ransom)'s suggestion ![alt text](https://i.stack.imgur.com/KnNpF.png)
Nearest-neighbor interpolation algorithm in MATLAB
CC BY-SA 3.0
0
2009-10-11T14:53:56.083
2017-02-27T20:02:09.690
2017-05-23T12:32:31.727
-1
151,937
[ "matlab", "image-processing", "interpolation", "nearest-neighbor", "resize-image" ]
1,551,422
1
1,551,433
null
1
285
How do you look up a list of language IDs available within SQL Server? I am specifically looking if there are any views within `sys` schema. ![alt text](https://farm3.static.flickr.com/2510/4001341199_dfc0dd3f45_o.png)
How to look up Language ID of messages?
CC BY-SA 2.5
0
2009-10-11T18:44:16.523
2009-10-11T19:03:03.803
2017-02-08T14:16:11.307
-1
4,035
[ "sql", "sql-server", "tsql" ]
1,554,635
1
null
null
33
30,430
I have a graph file like this: ``` digraph { "Step1" -> "Step2" -> "Step3"; subgraph step2detail { "Step2" -> "note1"; "Step2" -> "note2"; "Step2" -> "note3"; "Step2" -> "note4"; rankdir=TB } } ``` I want the subgraph step2detail to hang off to the right of 'Step2'. Right now it looks like this: ![enter image description here](https://i.stack.imgur.com/g3QLF.png) I want Step1, Step2 and Step3 to all be vertically under each other and in 1 column.
GraphViz - How to have a subgraph be left-to-right when main graph is top-to-bottom?
CC BY-SA 3.0
0
2009-10-12T13:37:04.293
2019-05-31T06:34:29.830
2013-12-23T18:46:02.693
153,049
161,922
[ "graphviz" ]
1,554,956
1
1,581,556
null
2
2,019
I’m using c#.net. I have been looking round the web and can’t find anything that helps me out. I have a list of contractors, daily hours, daily slots (three different tables). - - For example ![alt text](https://i.stack.imgur.com/yrc42.jpg) I thought I could use a ListView however I am having trouble working out where I would place the code. ``` <asp:ListView ID="contractorListView" runat="server"> <LayoutTemplate> <table runat="server"> <tr> <td>Times</td> // Contractors names pulled from another <th><asp:PlaceHolder id="itemPlaceholder" runat="server" /></th> </tr> </LayoutTemplate> <ItemTemplate> <tr> <td>Times pulled from one database table</td> <td align="left" style="width: 200px;"> // Customers name - attached to correct time <asp:Label runat="server" Text='<%#Eval("person_name")%>' /> </td> </tr> </ItemTemplate> </asp:ListView> ``` Uses Linq model so can connect to customers 'slotted time' ``` ObjectDataSource contractorDataSource = new ObjectDataSource(); contractorDataSource.SelectMethod = "GetContractorByDateCategory"; contractorDataSource.TypeName = "contractBook.classes.contractorRepository"; contractorListView.DataSource = contractorDataSource; contractorDataSource.DataBind(); contractorListView.DataBind(); ``` Anyone got any ideas / example? Thanks in advance for any help. Clare
c#.net ListView - pull different information back from different tables
CC BY-SA 3.0
0
2009-10-12T14:39:44.977
2015-06-20T18:26:45.470
2015-06-20T18:26:45.470
1,159,643
140,065
[ "c#", ".net", "asp.net", "data-binding", "listview" ]
1,555,414
1
1,555,945
null
1
568
I want to transform images like this to add an effect to pictures in django as [described here](https://stackoverflow.com/questions/1546205/what-is-needed-to-add-an-paperprint-like-effect-to-photos-in-python). ![koala waved](https://www.imagemagick.org/Usage/warping/arched.jpg) I decided to implement it as a process for the great [django](http://bitbucket.org/jdriscoll/django-imagekit/wiki/Home)-imagekit/photologue My knowledge of PIL isn't very good, so my question is any hints (code, lins, general thoughts) are welcomed
How to iterate over columns of an image?
CC BY-SA 2.5
null
2009-10-12T16:02:37.993
2012-02-24T13:02:50.803
2017-05-23T12:24:21.783
-1
106,435
[ "django", "python-imaging-library", "imagekit", "django-imagekit", "photologue" ]
1,555,433
1
1,555,486
null
2
1,276
I'm working with a complicated xml schema, for which I have created a class structure using xsd.exe (with some effort). I can now reliably deserialize the xml into the generated class structure. For example, consider the following xml from the web service: ``` <ODM FileType="Snapshot" CreationDateTime="2009-10-09T19:58:46.5967434Z" ODMVersion="1.3.0" SourceSystem="XXX" SourceSystemVersion="999"> <Study OID="2"> <GlobalVariables> <StudyName>Test1</StudyName> <StudyDescription/> <ProtocolName>Test0001</ProtocolName> </GlobalVariables> <MetaDataVersion OID="1" Name="Base Version" Description=""/> <MetaDataVersion OID="2" Name="Test0001" Description=""/> <MetaDataVersion OID="3" Name="Test0002" Description=""/> </Study> </ODM> ``` I can deserialize the xml as follows: ``` public ODMcomplexTypeDefinitionStudy GetStudy(string studyId) { ODMcomplexTypeDefinitionStudy study = null; ODM odm = Deserialize<ODM>(Service.GetStudy(studyId)); if (odm.Study.Length > 0) study = odm.Study[0]; return study; } ``` Service.GetStudy() returns an HTTPResponse stream from the web service. And Deserialize() is a helper method that deserializes the stream into the object type T. My question is this: is it more efficient to let the deserialization process create the entire class structure and deserialize the xml, or is it more efficient to grab only the xml of interest and deserialize that xml. For example, I could replace the above code with: ``` public ODMcomplexTypeDefinitionStudy GetStudy(string studyId) { ODMcomplexTypeDefinitionStudy study = null; using (XmlReader reader = XmlReader.Create(Service.GetStudy(studyId))) { XDocument xdoc = XDocument.Load(reader); XNamespace odmns = xdoc.Root.Name.Namespace; XElement elStudy = xdoc.Root.Element(odmns + "Study"); study = Deserialize<ODMcomplexTypeDefinitionStudy>(elStudy.ToString()); } return study; } ``` I suspect that the first approach is preferred -- there is a lot of dom manipulation going on in the second example, and the deserialization process must have optimizations; however, what happens when the xml grows dramatically? Let's say the source returns 1 MB of xml and I'm really only interested in a very small component of that xml. Should I let the deserialzation process fill up the containing ODM class with all it's arrays and properties of child nodes? Or just go get the child node as in the second example!!?? Not sure this helps, but here's a summary image of the dilemma: ![alt text](https://farm3.static.flickr.com/2631/4004603153_25989c820f_o.png)
Efficiency of deserialization vs. XmlReader
CC BY-SA 2.5
null
2009-10-12T16:05:28.720
2009-10-12T16:16:12.163
2017-02-08T14:16:12.333
-1
188,474
[ "serialization", "xmlreader" ]
1,558,943
1
null
null
5
2,105
I'm rendering some strings manually on top of a GraphicsBox, because you can't have a Label with a treansparent backdrop. No matter which rendering mode I try though, I can't get the strings to look any good (ie. as they would appear in Word or in a graphics program. Here's a picture of the interface mockup compared to what renders onscreen: ![enter image description here](https://i.stack.imgur.com/vYFaF.png) Unfortunately StackOverflow seems to shrink the picture so here's a direct link too: [http://i.stack.imgur.com/vYFaF.png](https://i.stack.imgur.com/vYFaF.png) And here's the code used to render: ``` private void pictureBox1_Paint(object sender, PaintEventArgs e) { Graphics labelDrawing = e.Graphics; labelDrawing.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit; labelDrawing.DrawString("Setup Progress", new Font("Calibri", 10, FontStyle.Bold, GraphicsUnit.Point, 0), new SolidBrush(Color.Black), new Point(12, 9)); labelDrawing.DrawString("The following components are being configured.", new Font("Calibri", 10, FontStyle.Regular, GraphicsUnit.Point, 0), new SolidBrush(Color.Black), new Point(24, 27)); } ``` I've tried changing the TextRenderingHint to every option in turn, but no matter what I try if there's any antialiasing then it comes out in a blurry, smeared mess like in the screenshot. Any idea?
Why do my Windows Forms strings look so ugly when anti-aliased?
CC BY-SA 3.0
null
2009-10-13T08:38:44.890
2014-09-10T09:14:30.860
2014-09-10T09:14:30.860
45,563
45,563
[ "windows", "winforms", "forms", "antialiasing" ]
1,559,311
1
1,570,447
null
0
1,798
When I use QtCreator debugger, it shows local variable as "not in scope". What causes such situations? ![alt text](https://imgur.com/TvPrN.jpg)
Variable not in scope
CC BY-SA 2.5
null
2009-10-13T10:12:19.333
2009-10-15T05:25:32.687
2009-10-14T11:49:18.417
113,071
113,071
[ "debugging", "qt-creator" ]
1,559,958
1
null
null
2
1,950
I'm working with JFreeChart to plot several TimeSeries charts. It seemed to be working fine, but as of today, all the graphs seem to flicker and are randomly glitching making them impossible to see. If I minimize and maximize, the issue gets fixed for a few seconds until the next update or mouse click. Does anyone have an idea about what the issue could be? ![alt text](https://i18.photobucket.com/albums/b115/thodinc/jfreechartglitch.jpg) The code is pretty simple: ``` TimeSeries ts = new TimeSeries("Graph", Millisecond.class); TimeSeriesCollection dataset = new TimeSeriesCollection(ts); JFreeChart Graph = createChart(dataset); ChartPanel panel_Graph = new ChartPanel(Graph); .... JFrame newWindow = new JFrame("Graph"); newWindow.setLayout(new GridLayout()); newWindow.setContentPane(panel_Graph); newWindow.setMinimumSize(new Dimension(600, 480)); newWindow.setLocationRelativeTo(null); newWindow.setVisible(true); static private JFreeChart createChart(TimeSeriesCollection dataset) { JFreeChart chart = ChartFactory.createTimeSeriesChart( "Graph", "Time", "Value", dataset, false, true, false ); final XYPlot plot = chart.getXYPlot(); ValueAxis timeaxis = plot.getDomainAxis(); timeaxis.setAutoRange(true); timeaxis.setFixedAutoRange(60000.0); return chart; } ```
Glitchy graphing using JFreeChart
CC BY-SA 2.5
null
2009-10-13T12:41:34.547
2010-01-24T07:00:04.383
2017-02-08T14:16:13.903
-1
135,706
[ "java", "graph", "jfreechart" ]
1,563,067
1
1,563,829
null
0
618
In my Qt4 application I can't seem to hide certain options in the system Menu bar on OS X such as 'Services'. Any ideas? ![QMenubar](https://i993.photobucket.com/albums/af54/g4egk/Picture1.png)
How to hide Services item in QMenubar on Mac OS X?
CC BY-SA 2.5
null
2009-10-13T21:40:47.990
2009-10-14T01:33:46.390
2017-02-08T14:16:15.160
-1
122,075
[ "macos", "qt", "qt4", "menubar" ]
1,564,070
1
null
null
1
1,026
Please have a look at my IE issue pic: ![screenshot](https://i.stack.imgur.com/GNqPz.gif) When I float the first `<div>` to the left and set the second `<div>` with `margin-left: 220px`, it works very well with FF and IE8. Yet in IE6 and 7 it doesn't work at all. My second `<div>` collapses and sits at the rightmost bottom of the first `<div>`. Here is HTML markup: ``` <ol id="listingList"> <li> <div class="media"> ....... </div> <div class="listingInfo"> ....... </div> </li> </ol> ``` CSS code: ``` #listingList div.media { width: 200px; float: left; padding-right: 10px; } #listingList div.listingInfo { margin-left: 220px; width: 540px; color: #6A6A6C; } ```
float:left and margin-left issue in ie6 and 7
CC BY-SA 3.0
null
2009-10-14T03:16:53.717
2017-03-04T20:38:14.483
2017-03-04T20:38:14.483
4,824,627
146,812
[ "html", "css", "internet-explorer-7", "internet-explorer-6" ]
1,565,476
1
1,565,489
null
2
2,700
The system I'm currently working on involves the creation of binary decision trees. Lots of them. Some of them are stored in XML format so they can be analyzed manually if needed. The tree structure is basically nested <NODE> tags. Each node may also have a few child tags defining the properties of the node. What I would like to do is display the trees graphically. Vertically or horizontally does not matter but I would like to use a geometrically tree-shaped layout e.g. like this: ![alt text](https://upload.wikimedia.org/wikipedia/commons/thumb/9/91/BDD.png/546px-BDD.png) ...rather than the layout commonly used in file system browsers, which isn't the best way to display binary trees. Is there a .NET based library or, alternatively, a stand-alone tool which does this well?
Tool for displaying binary decision tree
CC BY-SA 2.5
0
2009-10-14T10:28:44.967
2014-05-18T20:54:53.850
2017-02-08T14:16:15.833
-1
5,085
[ ".net", "xml", "binary-tree", "data-visualization" ]
1,566,517
1
1,601,778
null
1
1,254
In a [recent blog post announcing Blackberry Widgets](http://supportforums.blackberry.com/t5/BlackBerry-Developer-s-Blog/BlackBerry-Widgets-are-Here/ba-p/351085) the following was said about getting Java library functionality in a Blackberry Widget (emphasis added by me): > RIM will continue to add new JavaScript APIs for BlackBerry Widgets. Most will not require new BlackBerry Device Software upgrades to be used. They also go on to describe the architecture of a packaged widget with the following diagram:                                        ![](https://supportforums.blackberry.com/t5/image/serverpage/image-id/873i339E1042E029F5EC/image-size/original?v=mpbl-1&px=-1)
How can I create a JavaScript Blackberry Widget Extention?
CC BY-SA 2.5
0
2009-10-14T14:13:55.880
2009-10-21T15:51:16.677
2017-02-08T14:16:17.060
-1
68,507
[ "blackberry", "blackberry-widgets" ]
1,566,524
1
1,566,598
null
8
6,087
I have a query that uses `for xml explit` to return XML result. select ... from ... order by [BatchType!1!TypeName], [FormType!2!TypeName], Tag, Parent for xml explicit, root('ClientImages') But the name of resultant column name is something as cryptic as ![alt text](https://farm3.static.flickr.com/2578/4011608808_30c0b16e35_o.png) --- I had a several nested `WITH` statements so I have saved the result of query without applying `FOR XML EXPLICIT` into a temp table `@xmlTable` and then set the XML EXPLICIT result to an XML then returned it. ``` declare @xmlResult xml set @xmlResult =( select * from @xmlTable for xml explicit, root('ClientImages')) select @xmlResult as XmlResult ```
Name XML result column of TSQL "for xml explicit"?
CC BY-SA 2.5
0
2009-10-14T14:14:35.520
2016-02-25T21:16:51.293
2017-02-08T14:16:17.400
-1
4,035
[ "sql", "sql-server", "xml", "tsql" ]
1,567,064
1
15,994,778
null
5
4,109
When CSS float is used on a DIV, other DIVs that are not floated continue to occupy the space of the floated DIV. While I am sure this is intentional, I do not know how to achieve the effect I am looking for. Please consider this example: ``` <html> <div style="width:400px"> <div style="width:150px;float:right;border:thin black solid"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam.</div> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. <div style="background-color:red;border:thin black solid">Some sample text</div> Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. </div> </html> ``` If you paste this HTML in a browser (or examine its [jsfiddle](http://jsfiddle.net/MS5z5/)), you'll notice that "Some sample text" is red, and that the red background extends all the way through the floated DIV. While I am sure there is a way to obscure the parts of the red background I don't want, it would still leave the border cropped off and hidden underneath the DIV. Ideally, I want the background color and border to only occupy valid text space, and not creep underneath the floated DIV. Is this effect possible? Please note that I am using the float property not as a replacement for columns, but as a block that will have the text flow around it. So far none of the proposed solutions takes this into account. For clarity, here are some images. This is what I get: ![Bad](https://i.stack.imgur.com/h8Fod.png) This is what I want: ![Good](https://i.stack.imgur.com/ZY6uF.png) You'll notice that in both examples, the final text wraps around the floated part as the text reaches the bottom. My second example I can achieve by directly specifying the width of the div containing "Some sample text". I do not want to specify the width. It seems redundant since I want the same width as that of the text around it. But perhaps that isn't possible?
How to use CSS float without hiding parts of a DIV
CC BY-SA 3.0
0
2009-10-14T15:24:51.087
2013-04-20T01:58:52.340
2013-04-20T01:58:52.340
189,950
189,950
[ "html", "css", "layout", "positioning", "css-float" ]
1,572,500
1
null
null
4
989
I am trying to improve the design of a program that I am using state pattern for. I will post a brief description of the problem, an image of the class diagram/description of the current design, followed by header code for the relevant classes. I'm using a variation of the State Pattern for a program. In this variation, I have a 'controller' that utilizes two abstract classes, 'state' and 'event', which several concrete types are extended from both. These two abstract classes are used to carry out responses to 'events' that vary based upon the type of event, and the current state. Each state has a 'handler' function that is overloaded to take each concrete event type. The 'controller' contains a queue of type 'event' (the abstract class), which contains the list of of 'events' (concrete classes) that have occurred. The controller 'processes' each event one at a time, by retrieving it from the queue, and passing it to the state's handler for that particular type of event. The problem is that in order to get the correct type to pass the event to the state's appropriate handler, I have to the event to the correct concrete type. Currently, I accomplish this by adding a method to class 'state' (getType()) which is implemented by each concrete event type, and returns an integer that represents that event type. However, this practice is very 'un-elegant' and results in using enums to drive 'switch' blocks and 'downcasting' - which are not very good design practices. How can I change this design to make the passing of events to states more elegant? ![Class diagram](https://i.stack.imgur.com/q48V4.jpg) ``` /***** * CONTROLLER (driver) CLASS */ queue<event> events; //gets populated by other threads that hold reference to it state* currentState; vector<state*> allStates; allStates.push_back( new state_1(&allStates) ); // passes reference to 'allStates' to each state allStates.push_back( new state_2(&allStates) ); // so that it may return the 'next state' ... while( true ){ event nextEvent; state* nextState; if( events.size() > 0 ){ nextEvent = events.front(); //Get next Event events.pop(); //remove from queue switch( nextEvent.getType() ){ //determine 'concrete type' based on 'getType method' case 1: //Downcast to concrete state type, and let state handle event nextState = currentState->handle( *dynamic_cast<event_type_1*>(&nextEvent) ); break; case 2: state* nextState = currentState->handle( *dynamic_cast<event_type_1*>(&nextEvent) ); break; ... } //Transition to next state currentState = nextState; else Sleep(5); // } /***** * EVENT CLASSES */ class event{ public: virtual int getType(); } class event_type_1 : public event{ public: int getType(){ return 1; }; int specializedFunc1(); double specializedFunc2(); } class event_type_2 : public event{ public: int getType(){ return 2; }; std::string specializedFunc3(); } /***** * STATE CLASSES */ class state{ protected: vector<state*>* m_states; public: state( vector<state*>* p_states ){ m_states = p_states; }; virtual state* handle( event_type_1 ); virtual state* handle( event_type_2 ); } class state_1 : public state{ public: state* handle( event_type_1 ); state* handle( event_type_2 ); } class state_2 : public state{ public: state* handle( event_type_1 ); state* handle( event_type_2 ); } ```
Using a 'variation' on State Pattern - C++
CC BY-SA 3.0
0
2009-10-15T13:47:30.217
2020-03-23T00:50:09.753
2020-03-23T00:50:09.753
1,371,329
190,635
[ "c++", "design-patterns", "state-pattern" ]
1,573,926
1
null
null
1
3,841
I am using `ReportViewer.WebForms` in `asp.net` page. I have the parameter toolbar showing up where I can select a parameter, it does a postback to get the next parameter (dependent on the first), and so forth. When I click the `View Report` button there is a postback and the report will display fine. All this works great. What I would like to do is set the `ShowReportBody` to false ``` ReportViewer.ShowReportBody = False ``` At this point I would like to grab all the parameters that have been selected by the user and run the render method to export to a file (of my choosing .. maybe excel, maybe `pdf` .. does not really matter, nor is the topic of this question). So, my question is, how (or can I) trap the button event of the `View Report` button? I would like to be able to use the `ReportViewer` UI in order to capture all the parameters instead of building custom parameters. I'd also like to rename this, but, again .. another topic :) ![enter image description here](https://i.stack.imgur.com/UnUEK.jpg)
How can I trap "View Report" in ReportViewer (webforms) for SSRS?
CC BY-SA 3.0
0
2009-10-15T17:35:43.840
2015-05-13T16:42:37.637
2015-05-13T16:42:37.637
4,840,746
59,858
[ "asp.net", "reporting-services", "reportviewer" ]
1,574,016
1
1,574,039
null
44
4,543
I am a programmer doing web development for over two years now. Even though I’ve been doing front end engineering for the past two years I don’t think I have done it the right way - - `display: none``visibility: hidden`- `#`- - ![alt text](https://i.stack.imgur.com/lrd9j.png) - I know I am doing a lot of things wrong(and I need to get it right) here but I manage to get things into place and somehow show it up, only to see it messed up in a different browser. I don’t want do a primer on CSS or CSS for dummies. I know more than that. I want to learn CSS the right way. Focusing on problems like the examples I showed above and rectifying them. Can you point me to resources or add common suggestions and tips used by CSS developers to get it right.
Re-learning CSS the right way
CC BY-SA 3.0
0
2009-10-15T17:52:58.737
2020-11-30T12:27:03.233
2015-06-20T18:40:30.960
1,159,643
113,247
[ "css", "user-interface", "frontend" ]
1,574,953
1
1,575,262
null
10
10,793
If I compile the source for a C-language DLL with CL.exe, how do I set the file properties including File version Product name, Product version, Copyright and so on, so that I can view these properties in Windows Explorer? ![version number](https://imgur.com/1D7d0.png) In a .NET application written in C#, I could do this with assembly attributes like `[assembly: AssemblyVersion("1.2.3.4")]`. How do I do this in a C-language project?
How do I set the version of a DLL built in C, compiled with CL.EXE?
CC BY-SA 2.5
null
2009-10-15T20:47:11.113
2021-07-14T19:49:07.330
2009-10-15T20:58:21.683
48,082
48,082
[ "c", "windows", "dll", "version", "cl.exe" ]
1,577,893
1
null
null
1
1,172
I use lot of jquery in CMS that I made myself and now I've noticed some strange behavior of Google Chrome when it tries to display content of CMS. When clicking on link via navigation menu search form is displayed like this: ![](https://i.stack.imgur.com/xBvtn.jpg) sometimes even like this: ![](https://i.stack.imgur.com/VDHgD.jpg) But when I refresh page using refresh button or F5 then it's displayed correctly. In Firefox, Opera and IE this problem doesn't occur. Locally tested, Chrome also makes errors but bit different then showed on these images. When I disable all jquery and javascript this problem disappears. Has anyone noticed anything similar in Chrome? This is html code of that container: ``` <div class="forma_odabir_vijesti"> <form class="po_broju" method="GET" action=""> <input type="hidden" name="link" value="news" /> <label class="prikazi">Prika&#382;i</label> <input class="broj_vijesti" name="broj_vijesti" type="text" /> <select name="sort" class="sortiranje"> <option value="DESC">zadnjih vijesti</option> <option value="ASC">prvih vijesti</option> </select> <input class="submit" type="submit" name="broj_v" value="Ok" /> </form> <form class="po_idu" method="GET" action=""> <input type="hidden" name="link" value="news" /> <label class="prikazi">Prika&#382;i vijest id#</label> <input class="id_vijesti" name="id_vijesti" type="text" /> <input class="submit" type="submit" name="id_v" value="Ok" /> </form> <form class="po_datumu" method="GET" action=""> <input type="hidden" name="link" value="news" /> <label class="prikazi">Prika&#382;i vijesti iz dana</label> <input class="datum_prikaza" name="datum_prikaza" type="text" id="mydate" /> <input class="submit" type="submit" name="datum_v" value="Ok" /> </form><div class="dno"></div> <form class="po_rasponu_datuma" method="GET" action=""> <input type="hidden" name="link" value="news" /> <label class="prikazi">Prika&#382;i vijesti od</label> <input class="datum_prikaza" name="datum_prikaza2" type="text" id="mydate2" /> <label class="prikazi">do</label> <input class="datum_prikaza" name="datum_prikaza3" type="text" id="mydate3" /> <input class="submit" type="submit" name="raspon_datuma_v" value="Ok" /> </form> <form class="trazilica" method="GET" action=""> <input type="hidden" name="link" value="news" /> <label class="prikazi">Tra&#382;i vijesti</label> <input class="trazi_vijest" name="trazilica" type="text" /> <input class="submit" type="submit" name="trazi_v" value="Tra&#382;i" /> </form> <div class="dno"></div> </div> ```
Google Chrome - strange display of html
CC BY-SA 3.0
0
2009-10-16T12:54:43.993
2015-06-20T18:37:47.587
2015-06-20T18:37:47.587
1,159,643
168,535
[ "jquery", "google-chrome" ]
1,578,227
1
1,578,241
null
3
1,120
When i want to use delegate class to make call while windows form working, i always have to use InvokeRequired. It is ok. But who changed the InvokeReuqired property while it is working. Please check this image: ![alt text](https://content.screencast.com/users/uzay95/folders/Jing/media/813e6d67-2b86-4a15-841d-526d9bcb389e/2009-10-16_1652.png)
When does the vaIue of the InvokeRequired property change?
CC BY-SA 2.5
null
2009-10-16T13:59:45.720
2010-07-05T10:04:19.073
2017-02-08T14:16:18.097
-1
104,085
[ "c#", "multithreading", "delegates", "invokerequired" ]
1,581,267
1
1,581,277
null
8
3,607
I need an algorithm to figure out if one angle is within a certain amount of degrees from another angle. My first thought was `(a-x < b) && (a+x > b)`, but it fails when it has to work with angles that wrap around from -179 to 180. ![](https://imgkk.com/i/CQmC4h.png) In the diagram above, the region (green) that the angle must be between wraps between the negative and positive sides. How can I determine whether the angle (the red line) falls inside this region?
Find if an angle is within X degrees from another
CC BY-SA 2.5
null
2009-10-17T02:49:38.283
2014-01-01T23:31:51.250
2017-02-08T14:16:19.513
-1
null
[ "algorithm", "language-agnostic", "geometry", "angle" ]
1,582,404
1
1,635,107
null
0
665
I'm writing a "custom makefile" project using QtCreator and I want to delete a file of my project, so, I select the file in the tree view, press the right click and the "delete" option is disabled and I did not find any way of enable it. My environment: QtCreator 1.2.1 on SnowLeopard: ![Screenshot](https://i.stack.imgur.com/slqIJ.png) Thanks in advance, Ernesto
QtCreator delete file is not working
CC BY-SA 3.0
null
2009-10-17T15:07:24.107
2015-06-20T18:26:40.570
2015-06-20T18:26:40.570
1,159,643
1,680,261
[ "c++", "qt-creator" ]
1,583,064
1
1,583,165
null
3
3,479
Why is this happening: ![](https://i.stack.imgur.com/GNpas.png) As you can see, in the "Allowed Toolbar Items" the image looks fine for the "PHP" toolbar item, and when its actually in the toolbar, it scales weirdly. Thanks
NSToolbarItem image scaling
CC BY-SA 3.0
0
2009-10-17T19:54:55.967
2018-12-05T09:39:34.140
2015-06-20T18:25:27.333
1,159,643
153,112
[ "objective-c", "cocoa", "scaling", "nstoolbar", "nstoolbaritem" ]
1,586,094
1
2,671,403
null
6
17,709
I have been trying to figure out a way to convert bitmap files into a JPEG using the GD library in PHP. I have tried numerous implementations but nothing seems to work. I have tried to tell my client that they should not use Bitmap files but he insists and quite frankly does not comprehend enough about computers to convert them to JPG on his own. I can not use ImageMagick on this server and I need a pure GD solution. Thank you in advance for any and all help. The bitmap images that are being used are 16-bit and that is where the problem is occurring. I have this function that I have working .... kinda: ``` function ImageCreateFromBMP($filename) { if (! $f1 = fopen($filename,"rb")) return FALSE; $FILE = unpack("vfile_type/Vfile_size/Vreserved/Vbitmap_offset", fread($f1,14)); if ($FILE['file_type'] != 19778) return FALSE; $BMP = unpack('Vheader_size/Vwidth/Vheight/vplanes/vbits_per_pixel'. '/Vcompression/Vsize_bitmap/Vhoriz_resolution'. '/Vvert_resolution/Vcolors_used/Vcolors_important', fread($f1,40)); $BMP['colors'] = pow(2,$BMP['bits_per_pixel']); if ($BMP['size_bitmap'] == 0) $BMP['size_bitmap'] = $FILE['file_size'] - $FILE['bitmap_offset']; $BMP['bytes_per_pixel'] = $BMP['bits_per_pixel']/8; $BMP['bytes_per_pixel2'] = ceil($BMP['bytes_per_pixel']); $BMP['decal'] = ($BMP['width']*$BMP['bytes_per_pixel']/4); $BMP['decal'] -= floor($BMP['width']*$BMP['bytes_per_pixel']/4); $BMP['decal'] = 4-(4*$BMP['decal']); if ($BMP['decal'] == 4) $BMP['decal'] = 0; $PALETTE = array(); if ($BMP['colors'] < 16777216 && $BMP['colors'] != 65536) { $PALETTE = unpack('V'.$BMP['colors'], fread($f1,$BMP['colors']*4)); } $IMG = fread($f1,$BMP['size_bitmap']); $VIDE = chr(0); $res = imagecreatetruecolor($BMP['width'],$BMP['height']); $P = 0; $Y = $BMP['height']-1; while ($Y >= 0) { $X=0; while ($X < $BMP['width']) { if ($BMP['bits_per_pixel'] == 24) $COLOR = unpack("V",substr($IMG,$P,3).$VIDE); elseif ($BMP['bits_per_pixel'] == 16) { $COLOR = unpack("v",substr($IMG,$P,2)); $blue = ($COLOR[1] & 0x001f) << 3; $green = ($COLOR[1] & 0x07e0) >> 3; $red = ($COLOR[1] & 0xf800) >> 8; $COLOR[1] = $red * 65536 + $green * 256 + $blue; } elseif ($BMP['bits_per_pixel'] == 8) { $COLOR = unpack("n",$VIDE.substr($IMG,$P,1)); $COLOR[1] = $PALETTE[$COLOR[1]+1]; } elseif ($BMP['bits_per_pixel'] == 4) { $COLOR = unpack("n",$VIDE.substr($IMG,floor($P),1)); if (($P*2)%2 == 0) $COLOR[1] = ($COLOR[1] >> 4) ; else $COLOR[1] = ($COLOR[1] & 0x0F); $COLOR[1] = $PALETTE[$COLOR[1]+1]; } elseif ($BMP['bits_per_pixel'] == 1) { $COLOR = unpack("n",$VIDE.substr($IMG,floor($P),1)); if (($P*8)%8 == 0) $COLOR[1] = $COLOR[1] >>7; elseif (($P*8)%8 == 1) $COLOR[1] = ($COLOR[1] & 0x40)>>6; elseif (($P*8)%8 == 2) $COLOR[1] = ($COLOR[1] & 0x20)>>5; elseif (($P*8)%8 == 3) $COLOR[1] = ($COLOR[1] & 0x10)>>4; elseif (($P*8)%8 == 4) $COLOR[1] = ($COLOR[1] & 0x8)>>3; elseif (($P*8)%8 == 5) $COLOR[1] = ($COLOR[1] & 0x4)>>2; elseif (($P*8)%8 == 6) $COLOR[1] = ($COLOR[1] & 0x2)>>1; elseif (($P*8)%8 == 7) $COLOR[1] = ($COLOR[1] & 0x1); $COLOR[1] = $PALETTE[$COLOR[1]+1]; } else return FALSE; imagesetpixel($res,$X,$Y,$COLOR[1]); $X++; $P += $BMP['bytes_per_pixel']; } $Y--; $P+=$BMP['decal']; } fclose($f1); return $res; } ``` The resulting image is this: ![Uploaded Image](https://i.stack.imgur.com/4RcOI.jpg) If you look at the image on the left hand side you can see that the resulting image is not correctly lined up. The little sliver belongs on the right hand side. Where is the code going wrong? The problem is occurring in the 16-bit else-if. Thank you again for all the help.
Convert Bitmap Files into JPEG using the GD library in PHP
CC BY-SA 3.0
0
2009-10-18T21:35:21.137
2019-08-09T11:20:50.183
2014-11-22T11:54:20.407
964,243
59,517
[ "php", "bitmap", "gd", "jpeg" ]
1,586,600
1
1,586,617
null
0
304
I was going through [Getting Started](http://www.postsharp.org/about/getting-started) (with [PostSharp](http://www.postsharp.org/)) And when I saw PostSharp injected (is this expression is right?) an aspect code into assembly, I saw this oddly named class marked with `CompilerGeneratedAttribute`. ![alt text](https://farm3.static.flickr.com/2434/4024643564_1c3528ca8c_o.png) It is named `<>AspectsImplementationDetails_1`. As far as I know, class name cannot be started with `<>`. But how is it possible for PostSharp to create such class? Is `<>` some kind of unknown/internal operator? --- I did some testing and it looks like I was able to generate types with interesting names. ![alt text](https://farm3.static.flickr.com/2466/4024152931_1df08887c3_o.png) Here is the sample code used ``` using System; using System.Reflection; using System.Reflection.Emit; namespace ReflectionDemo { class Program { public static void Main(string[] args) { var typeNames = new[] { "<>", "-", "+", "~", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "=" }; const string assemblyName = "Test"; foreach (var typeName in typeNames) { PrintTypeName( BuildType(assemblyName, typeName).CreateType()); } } private static void PrintTypeName(Type type) { Console.WriteLine("TypeName = '{0}'", type.FullName); } private static TypeBuilder BuildType( string assemblyName, string typeName) { var name = new AssemblyName(assemblyName); var assemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly( name, AssemblyBuilderAccess.Run); var moduleBuilder = assemblyBuilder.DefineDynamicModule(name.Name, false); return moduleBuilder.DefineType( typeName, TypeAttributes.Public); } } } ```
Invalid compiler-generated .NET Class Name
CC BY-SA 2.5
null
2009-10-19T01:35:28.473
2009-10-19T02:52:39.660
2017-02-08T14:16:22.010
-1
4,035
[ ".net", "reflection", "aop", "identifier" ]
1,586,658
1
1,590,385
null
73
104,258
I am building a balancing robot using the Lego Mindstorm's NXT system. I am using two sensors from HiTechnic, the first being an Accelerometer and the second being a Gyroscope. I've successfully filtered out noise from both sensors and derived angles for both in a range between -90 and 90 degrees, with 0 degrees being perfectly balanced. My next challenge is to combine both of the sensor values to correct for the Gyroscope's drift over time. Below is an example graph I created from actual data to demonstrate the drift from the gyroscope: ![enter image description here](https://i.stack.imgur.com/AHx4r.png) The most commonly used approach I've seen to make combining these sensors rock solid is by using a Kalman filter. However, I'm not an expert in calculus and I really don't understand mathematical symbols, I do understand math in source code though. I'm using RobotC (which is like any other C derivative) and would really appreciate if someone can give me examples of how to accomplish this in C. Thank you for your help! Alright, kersny solved my problem by introducing me to complementary filters. This is a graph illustrating my results: ![enter image description here](https://i.stack.imgur.com/MqRid.png) ![enter image description here](https://i.stack.imgur.com/mePBt.png) As you can see, the filter corrects for gyroscopic drift and combines both signals into a single smooth signal. Since I was fixing the broken images anyways, I thought it would be fun to show the rig I used to generate this data: ![enter image description here](https://i.stack.imgur.com/hWbBh.jpg)
Combine Gyroscope and Accelerometer Data
CC BY-SA 3.0
0
2009-10-19T01:56:14.813
2015-07-17T14:16:24.810
2013-10-02T18:47:08.427
69,735
69,735
[ "c", "algorithm", "accelerometer", "lego-mindstorms", "nxt" ]
1,589,034
1
null
null
6
7,624
I have a WPF window that has a `ToolBar`. I have a collection of objects in my VM that I'm binding to. They appear as buttons but they always get pushed to the expanded drop down part of the `ToolBar`. How do I make those buttons appear in the standard part of the `ToolBar`? I have the following XAML: ``` <ToolBarTray Grid.Row="1"> <ToolBar ItemsSource="{Binding Path=MyList}" > <ToolBar.ItemTemplate> <DataTemplate > <Button ToolTip="{Binding ButtonName}" Command="{Binding Path=ButtonCommand}" > <Button.Content> <Image Width="32" Height="32" Source="{Binding ImageSource}"/> </Button.Content> </Button> </DataTemplate> </ToolBar.ItemTemplate> </ToolBar> </ToolBarTray> ``` I have the following C#: ``` public List<MyClass> MyList { get { return new List<MyClass> { new MyClass{ButtonName="Button1",ImageSource=@"C:\Projects\WpfApplication2\WpfApplication2\Employee.png"}, new MyClass{ButtonName="Button2",ImageSource=@"C:\Projects\WpfApplication2\WpfApplication2\Employee.png"}, new MyClass{ButtonName="Button3",ImageSource=@"C:\Projects\WpfApplication2\WpfApplication2\Employee.png"}, new MyClass{ButtonName="Button4",ImageSource=@"C:\Projects\WpfApplication2\WpfApplication2\Employee.png"}, }; } } ``` This is the visual result: ![alt text](https://farm3.static.flickr.com/2424/4025573611_97501285b3.jpg)
How to get a WPF Toolbar to bind to a collection in my VM without using expander
CC BY-SA 3.0
0
2009-10-19T14:36:26.170
2020-07-14T10:57:28.080
2017-02-08T14:16:22.347
-1
11,771
[ "wpf", "data-binding", "mvvm", "toolbar" ]
1,591,829
1
null
null
16
3,597
Ok, this is a more general "ugly critters in the corner" question. I am planning to start a project on WCF and PRISM. I have been playing around with PRISM some time know, and must say, I like it. Solid foundation for applications with nice possibilities to grow. Now I want to incorporate WCF and build a distributed application, with one part on a server and two on the clients. It could be even the same machine, or not, depending on the scenario. My idea is now to take the event concept from PRISM and extend it "over the wire" using WCF and callbacks, like described here [WCF AlarmClock Callback Example](http://dotnetaddict.dotnetdevelopersjournal.com/wcf_alarmclock.htm). I created a small picture to illustrate the idea (mainly for me), perhaps this makes things a little more clear: ![Illustration of concept](https://i.stack.imgur.com/XVgA8.png) The grey arrows stand for "using lib". The WCF-Event-Base meaning normal PRISM events, where the publish method is called "over the wire". There are a few questions which come to mind: - - - Regarding the second question, I currently think about raising the events using a string (the type of the concrete event I want to raise) and the payload as argument. Something like `public void RaiseEvent(string eventType, object eventPayload){}` The payload needs to be serializeable, perhaps I even include a hashcheck. (Meaning if I raise e.g. an event with a picture as argument 10 times, I only transfer the picture once, afterwards using the hash to let the server use the buffer when publish)... Ok, I think you get the idea. This "thing" should behave like a giant single application, using a kind of instead of the normal PRISM r. (wow, while writing I just got the idea to "simply" extend the IEventAggregator, have to think about this)... Why do I write this? Well, for feedback mainly, and to sort my thoughts. So comments welcome, perhaps anything I should be "careful" about? Chris [EDITS] ## Client distribution There should be an undefined number of client, the server should not be aware of clients. The server itself can be a client to itself, raising strongly typed PRISM events in other parts of the source code. The main difference between a "client" and a "server" is the actual implementation of the WCF_PRISM connector, see next chapter... ## Client Event raising (PRISM feature) In PRISM, to raise simple events you do NOT even need a reference to a service interface. The IEventAggregator can be obtained via dependency injection, providing an instance of the desired event (e.g. WeatherChangedEvent). This event can be raised by simply calling because the event is implemented as `public class WeatherChangedEvent : CompositePresentationEvent<int>` ## WCF - PRISM Connector As simple as raising events is subscribing to events. Every module can subsribe to events using the same technique, obtaining a reference and using to attach to this event. Here is now where the "magic" should happen. The clients will include a prism module responsible for connecting PRISM events to "wcf message sends". It will basically subsribe to all available events in the solution (they are all defined in the infrastructure module anyway) and send out a WCF message in case an event is raised. The difference between a SERVER and a CLIENT is the implementation of this module. There needs to be a slight difference because of two things. - - The event flow will be (example) 1. Client obtain ref to WeatherChangedEvent 2. wChanged.Publish(27) --> normal PRISM event raising 3. WCF_PRISM module is subscribed to event and 4. send this event to the server 5. Server internally gets instance of WeatherChangedEvent and publishes 6. Server calls back to all clients raising their WeatherChangedEvent ## Open Points The obvious point is preventing a loop. If the server would raise the event in ALL clients, the clients would call back to the server, raising the event again, and so on... So there needs to be a difference between an event caused locally (which means I have to send it to the server) and a "server caused event" which means I do not have to send it to the server. Also, if a client has initiated the event itself, it does not need to be called by the server, because the event has already be raised (in the client itself, point 2). All this special behaviour will be encapsulated in the WCF event raiser module, invisible from the rest of the app. I have to think about "how to know if event already published", perhaps a GUID or something like this would be a good idea. And now the second big question, what was I was aiming at when telling about "strings" earlier. I do not want to write a new service interface definition every time I add an event. Most events in PRISM are defined by one line, especially during development I do not want to update the WCF_Event_Raising_Module each time I add an event. I thought about sending the events directly when calling WCF, e.g. using a function with a signature like: ``` public void RaiseEvent(EventBase e, object[] args) ``` The problem is, I do not really know if I can serialize PRISM events that easy. They all derive from EventBase, but I have to check this... For that reason, I had the idea to use the type (as string), because I know the server shares the infrastructure module and can obtain its own instance of the event (no need to send it over the wire, only the arg) So far till here, I will keep the question open for more feedback. Main new "insight" I just got: Have to think about the recursion / infite loop problem. Btw. if anybody is completely confused by all this event talk, give PRISM a try. You will love it, even if you only use DI and Events (RegionManager e.g. is not my favorite) Chris [END EDIT 1]
PRISM and WCF - Do they play nice?
CC BY-SA 3.0
0
2009-10-20T00:19:33.413
2015-06-20T18:26:53.817
2015-06-20T18:26:53.817
1,159,643
109,646
[ "wcf", "events", "prism" ]
1,592,285
1
1,598,089
null
6
4,291
How does one outline a graphicspath using GDI+? For example, I add two intersecting rectangles to a GraphicsPath. I want to draw the outline of this resulting graphicspath only. Note that I don't want to fill the area, I just want to draw the outline. Example: ![http://i.stack.imgur.com/IAVft.png](https://i.stack.imgur.com/IAVft.png)
Outline a path with GDI+ in .Net
CC BY-SA 3.0
0
2009-10-20T03:27:26.173
2015-06-20T18:39:57.893
2015-06-20T18:39:57.893
1,159,643
192,815
[ "c#", ".net", "gdi+" ]
1,592,328
1
1,592,393
null
7
14,117
I have an input of type `text`, from which I have already entered value `1234` it has been saved in cache as shown below. ![alt text](https://farm3.static.flickr.com/2801/4028497878_70e799fece_o.png) The here is that, it is extremely frustrating to select the textbox in the next row. `12334`
How to cancel edit/disable cached input (of type text) value?
CC BY-SA 2.5
null
2009-10-20T03:47:25.490
2014-05-20T08:27:40.670
2017-02-08T14:16:23.377
-1
4,035
[ "javascript", "html", "caching", "autocomplete", "textinput" ]
1,592,722
1
1,592,909
null
0
2,339
Help with this criteria ? Users can be able to add as many Names as they want, ADD NAME link serves the purpose for this. How can I handle this specification ? Please check the spec below: ![alt text](https://i327.photobucket.com/albums/k457/luvboy7/family/work/clone.jpg) Thanks.
How to add textbox dynamically?
CC BY-SA 3.0
null
2009-10-20T05:59:06.550
2016-04-06T03:38:54.237
2017-02-08T14:16:23.713
-1
455,847
[ "php", "javascript", "clone" ]
1,593,783
1
1,593,787
null
0
462
Do the characters in the preview box mean anything? ![alt text](https://www.carmagazine.co.uk/upload/htmlemail/sample.jpg) Have wracked my brains and probably missed the obvious, or I'm a bit daft and its something I should already know!
Visual Studio 2010 beta 2 fonts & colors dialog
CC BY-SA 2.5
null
2009-10-20T10:47:15.813
2012-05-03T05:54:45.927
2017-02-08T14:16:24.397
-1
124,266
[ "visual-studio", "visual-studio-2010" ]
1,594,061
1
1,594,364
null
113
49,879
This question may be old, but I couldn't think of an answer. Say, there are two lists of different lengths, ; how do we know where the merging point is? Conditions: 1. We don't know the length 2. We should parse each list only once. ![Example of two merged linked lists.](https://i.stack.imgur.com/xjn0S.png)
Check if two linked lists merge. If so, where?
CC BY-SA 3.0
0
2009-10-20T11:51:10.817
2021-01-06T05:22:21.890
2014-05-29T03:10:32.860
752,843
147,632
[ "algorithm", "linked-list", "data-structures" ]
1,594,423
1
1,595,053
null
7
71,744
I have 3 panels. One is the main panel which holds 2 smaller panels. For the main panel, I used ``` setPreferredSize(new Dimension(350, 190)); ``` For the smaller left panel, I used ``` setPreferredSize(new Dimension(100, 190)); ``` For the smaller right panel, I used ``` setPreferredSize(new Dimension(250, 190)); ``` but the smaller panels remain the same size. How can I fix this?![alt text](https://i.stack.imgur.com/Djn5J.jpg) This is the code I have in my main Panel. ``` import model.*; import java.awt.*; import javax.swing.*; public class Panel extends JPanel { public Panel(Prison prison) { setup(); build(prison); } private void setup() { setBorder(BorderFactory.createLineBorder(Color.blue)); setLayout(new BorderLayout(1, 1)); setPreferredSize(new Dimension(350, 190)); } private void build(Prison prison) { JTabbedPane tab = new JTabbedPane(); tab.addTab("Input", null, new InputPanel(), "Input"); tab.addTab("Display", null, new DisplayPanel(), "Display"); add(tab); } } ```
Setting the size of panels
CC BY-SA 3.0
0
2009-10-20T12:57:12.073
2016-06-20T16:07:43.240
2015-06-20T19:03:37.360
1,159,643
172,390
[ "java", "user-interface", "size", "panel" ]
1,595,482
1
1,595,667
null
4
4,002
I'm looking for the right textfield parameters or work-around for my latest problem here dealing with Flash fonts & text fields. I have a textFormat and textField generation some text using the Font: Franklin Gothic Book point size 8. Currently this is how the font will look when I run the movie: [](https://i.stack.imgur.com/acm2u.png) [flickr.com](https://farm3.static.flickr.com/2503/4028956835_98cfbcb457_o.png) The bottom ®MYLOGO is a jpg from Photoshop, clean and how it should look. Next up is the font directly typed on the stage in Flash, and the very top ®MYLOGO is generated from my code. What parameters am I missing to make the code generated copy look as close as possible to the Jpeg? My Code below: ``` var tsFont = new TextFormat(); tsFont.font = FranklinGothic; tsFont.size = 8; tsFont.color = 0xFFFFFF; tsFont.align = TextFormatAlign.LEFT; var tsLogo:TextField = new TextField(); tsLogo.defaultTextFormat = tsFont; tsLogo.selectable = false; tsLogo.mouseEnabled = false; tsLogo.x = 18; tsLogo.y = 98; tsLogo.width = 64; tsLogo.height = 16; tsLogo.text = "®MYLOGO"; addChild(tsLogo); ``` You guys may remember this code from [my last question](https://stackoverflow.com/questions/1589495/access-of-undefined-property-for-timeline-addchild-code) X_x --- thx to [Andy Li](https://stackoverflow.com/users/160372/andy-li) ``` var tsFont = new TextFormat(); tsFont.font = (new FranklinGothic() as Font).fontName; tsFont.size = 8; tsFont.color = 0xFFFFFF; tsFont.align = TextFormatAlign.LEFT; var tsLogo:TextField = new TextField(); tsLogo.selectable = false; tsLogo.mouseEnabled = false; tsLogo.embedFonts = true; tsLogo.antiAliasType = flash.text.AntiAliasType.NORMAL; tsLogo.gridFitType = "pixel"; tsLogo.sharpness = 400 tsLogo.x = 6; tsLogo.y = 5; tsLogo.width = 600; tsLogo.height = 40; tsLogo.text = "®MYLOGO"; tsLogo.setTextFormat(tsFont) ``` Graphic Examples: NORMAL ![alt text](https://farm3.static.flickr.com/2539/4223118869_310e65760d_o.jpg) ADVANCED ![alt text](https://farm3.static.flickr.com/2759/4223882208_1290b80cca_o.jpg)
Problem embedding font and displaying it correctly in Flash
CC BY-SA 4.0
0
2009-10-20T15:29:16.917
2019-05-02T10:05:17.003
2019-05-02T10:05:17.003
4,751,173
168,738
[ "flash", "actionscript-3", "text", "fonts", "antialiasing" ]
1,597,320
1
null
null
19
16,857
I'm looking for a Split Button in .NET WinForms. The kind where one side is a button and the other side has a dropdown button. I see them used all over in windows, like in the Visual Studio Save As window, so I figured they've got to have the control in some library. I know there's one for toolstrips, but I need one thats usable outside of toolstrips. Is there a Microsoft library that has one or preferably a free library? I'm using .NET 3.5 For an example: ![Example Button](https://i.stack.imgur.com/BChaI.png)
Split button in .NET Winforms
CC BY-SA 3.0
0
2009-10-20T21:09:07.737
2015-01-16T12:01:03.077
2014-04-01T20:05:00.040
1,275,574
193,394
[ ".net", "winforms", "controls" ]
1,597,511
1
1,597,621
null
2
8,906
I'm developing a little portfolio where I can choose a category and when I click it, the content (thumbnails) of that category will be shown (this is via an array). e.g. ``` photography[0] = <a href="..." rel="lightbox" /><img ... /></a> photography[1] = <a href="..." rel="lightbox" /><img ... /></a> ``` At first the site shows the content of all categories and when I click a thumbnail it activates lightbox, however if I choose a category and then press one of the remaining thumbnails is simply leads to the image and does not open the image with lightbox. This is how the thumbnails look like on the initial load of the page: ``` <div><a title="..." rel="lightbox" href="http://...yellow-brick-road.jpg" class="thumbnaila"> <img class="thumbnail " alt="" src="http://...yellow-brick-road.jpg" /></a> ``` When a category is selected it removes the content within the div and replaces it by other content e.g. exactly the same content. (so the rel="lightbox" is still there). If anyone could help me out with this one I would love it (I'm using jquery btw). EDIT after response Alex Sexton: ``` $(".thumbnaila").live("mouseover", function(){ activateLightbox($(this));}); function activateLightbox(dit) { $('a[rel="lightbox"]').lightBox({ overlayBgColor: '#000', overlayOpacity: 0.65, containerResizeSpeed: 350 }); ``` } but now when I choose a categorie and select a thumbnail it loads the right lightbox but also loads an empty lightbox above the one I want as you can see: ![enter image description here](https://i.stack.imgur.com/8NAya.jpg) Anyone know what's causing this?
activate lightbox on dynamically added content
CC BY-SA 3.0
null
2009-10-20T21:44:48.380
2011-12-08T22:28:40.427
2011-08-17T14:11:35.730
318,465
null
[ "jquery", "dynamic", "lightbox" ]
1,599,235
1
1,601,670
null
18
17,779
I have the following code which works on Windows XP and Vista - both 32 and 64 bit: ``` public static Icon GetFolderIcon(IconSize size, FolderType folderType) { // Need to add size check, although errors generated at present! uint flags = Shell32.SHGFI_ICON | Shell32.SHGFI_USEFILEATTRIBUTES; if (FolderType.Open == folderType) { flags += Shell32.SHGFI_OPENICON; } if (IconSize.Small == size) { flags += Shell32.SHGFI_SMALLICON; } else { flags += Shell32.SHGFI_LARGEICON; } // Get the folder icon var shfi = new Shell32.SHFILEINFO(); Shell32.SHGetFileInfo( null, Shell32.FILE_ATTRIBUTE_DIRECTORY, ref shfi, (uint) Marshal.SizeOf(shfi), flags ); Icon.FromHandle(shfi.hIcon); // Load the icon from an HICON handle // Now clone the icon, so that it can be successfully stored in an ImageList var icon = (Icon)Icon.FromHandle(shfi.hIcon).Clone(); User32Dll.DestroyIcon( shfi.hIcon ); // Cleanup return icon; } ``` The constants are defined the following way: ``` public const uint SHGFI_ICON = 0x000000100; public const uint SHGFI_USEFILEATTRIBUTES = 0x000000010; public const uint SHGFI_OPENICON = 0x000000002; public const uint SHGFI_SMALLICON = 0x000000001; public const uint SHGFI_LARGEICON = 0x000000000; public const uint FILE_ATTRIBUTE_DIRECTORY = 0x00000010; ``` This gives the following results in windows 7 when fetching the folder icon: ![alt text](https://photos-4.dropbox.com/t/2/AADxu8bhKAW-3XvsfDNjXfOCO8sC1dabGkdhRN8ILSpRMA/12/1193207/png/32x32/3/1513688400/0/2/folder_win7.png/EM-MhAEYvtyMnwUgAigC/jz_BeJXsJ5dznj1mXicHw9oq3eYsPl9qOu2XoNbLQGY?dl=0&preserve_transparency=1&size=2048x1536&size_mode=3) While at Vista - using the same method result in the following folder icon: ![alt text](https://photos-4.dropbox.com/t/2/AAC1IZ23R2yD_HzPFPwU4SK2s0wxqa5TG0Fr7vPhm3Y3nQ/12/1193207/png/32x32/3/1513688400/0/2/folder_vista.png/EM-MhAEYvtyMnwUgAigC/NsEVcxLhrpzyXLgXa6getlW5qO4vTwn1SUSKG43WBF8?dl=0&preserve_transparency=1&size=2048x1536&size_mode=3) I would like the "correct" Windows folder icon for Windows 7 also - not the icon used to indicate the drive where Windows is installed. I don't know the win32 API and my non-managed programming is next to none on the Windows platform.
How do I fetch the folder icon on Windows 7 using Shell32.SHGetFileInfo
CC BY-SA 3.0
0
2009-10-21T07:19:02.733
2017-12-19T08:16:08.203
2017-12-19T08:16:08.203
6,896
6,896
[ "c#", ".net", "shell", "windows-7" ]
1,600,431
1
1,600,987
null
3
3,402
Normally Eclipse 'File Compare' compares files in vertical panels like: ![Compare using Vertical Panel](https://rubenlaguna.com/wp/wp-content/uploads/2007/08/comparebefore.png) Is there a way I can compare them horizontally like: [Compare using Horizontal Panel http://www.sqlservertool.com/images/ad_hex_diff_small.gif](http://www.sqlservertool.com/images/ad_hex_diff_small.gif) Its too tiring to scroll everytime to see what was changed!! Thx
Eclipse (3.5) how to compare files horizontally?
CC BY-SA 2.5
0
2009-10-21T12:15:11.420
2009-11-13T11:12:37.313
2017-02-08T14:16:27.160
-1
7,759
[ "eclipse", "compare", "filecompare", "file-comparison" ]
1,600,502
1
1,601,414
null
11
17,033
I have developed a simple C# Winforms application that loads MS-Word 2007 documents via COM automation. This is all very simple and straight forward, however depending on the document I need to programamtically Enable or Disable Macros as well as ActiveX controls. There is probably a way to store this in the registry, but I want to control these settings on an instance by instance basis as multiple concurrent requests may be running at a time. So my question is ''. I have Googled for hours, but all I have been able to find is the Application.AutomationSecurity property, but this only accepts the following values: - - - The Word 2007 Trust Center however exposes the following settings: Macro Settings: - - - - [](https://i.stack.imgur.com/ZezzV.png) [visguy.com](http://www.visguy.com/wp-content/uploads/2007/05/v2007-security-settings.png) --- ActiveX controls (configured separately, I have not found any way to control these, note that according to the screenshot these settings are shared between all applications) - - - - ![alt text](https://www.mathworks.com/access/helpdesk/help/toolbox/slvnv/ug/activex_settings.gif) I have tried the old trick of recording an MS-Word macro while changing these settings, but none of these steps are recorded. I have found the following entries for the ActiveX controls settings in the registry. Looks like ActiveX settings are indeed global and cannot be specified for a single MS-Word instance unless someone proves me wrong. ActiveX Disabled [HKEY_CURRENT_USER\Software\Microsoft\Office\Common\Security] "DisableAllActiveX"=dword:00000001 "UFIControls"=dword:00000002 ActiveX Enabled with safe mode [HKEY_CURRENT_USER\Software\Microsoft\Office\Common\Security] "DisableAllActiveX"=dword:00000000 "UFIControls"=dword:00000002 ActiveX Enabled without safe mode [HKEY_CURRENT_USER\Software\Microsoft\Office\Common\Security] "DisableAllActiveX"=dword:00000000 "UFIControls"=dword:00000001 Still keen to resolve the macro settings problem
Programmatically configuring MS-Word's Trust Center settings using C#
CC BY-SA 4.0
0
2009-10-21T12:32:01.373
2019-05-02T22:05:04.220
2019-05-02T22:05:04.220
4,751,173
79,448
[ "c#", "automation", "ms-word", "ms-office", "office-2007" ]
1,601,600
1
1,601,694
null
11
6,039
Say you have a collection of points with coordinates on a Cartesian coordinate system. ![an unwarped grid](https://i.stack.imgur.com/SIWEQ.jpg) You want to plot another point, and you know its coordinates in the same Cartesian coordinate system. However, the plot you're drawing on is distorted from the original. Imagine taking the original plane, printing it on a rubber sheet, and stretching it in some places and pinching it in others, in an asymmetrical way (no overlapping or anything complex). ![a warped grid](https://i.stack.imgur.com/nRSLp.jpg) ([source](http://www.retinamd.com/macular-degeneration-treatment.asp)) You know the stretched and unstretched coordinates of each of your set of points, but not the underlying stretch function. You know the unstretched coordinates of a new point. How can you estimate where to plot the new point in the stretched coordinates based on the stretched positions of nearby points? It doesn't need to be exact, since you can't determine the actual stretch function from a set of remapped points unless you have more information. other possible keywords: warped distorted grid mesh plane coordinate unwarp
How to map a point onto a warped grid
CC BY-SA 3.0
0
2009-10-21T15:24:07.027
2019-03-12T03:17:49.763
2012-10-04T21:14:18.807
125,507
125,507
[ "geometry", "grid", "coordinates", "mesh", "unwarp" ]
1,603,526
1
1,603,556
null
35
30,284
I can't seem to figure this out. I have two group boxes on the left side of my form window. When the window is normal size (1000x700), the two boxes are the same. However, when the window is maximized, it ends up looking like this: ![http://imgur.com/X2Ou7.png](https://imgur.com/X2Ou7.png) What I want is for both the "Log" group box and the tab control to extend down to the bottom of the window. I have tried messing with anchoring, but that just seems to move it and not resize it. Docking fills the whole side. What options do I have here?
How can I make a control resize itself when the window is maximized?
CC BY-SA 2.5
0
2009-10-21T20:50:00.837
2019-11-19T10:36:52.073
null
null
49,018
[ "c#", ".net", "winforms" ]
1,608,102
1
1,608,149
null
8
17,077
I want to add whatever is written in a textbox to a menustrip. In the File > Recent Searches thing I have. How can I do programatically? And can I assign an event handler dynamically so that when a user clicks on X item in that subfolder, the text is copied BACK to the textbox? ![alt text](https://imgur.com/YrRvq.png)
How to add things to a menustrip programatically?
CC BY-SA 2.5
0
2009-10-22T15:39:32.707
2009-10-22T16:07:00.343
2009-10-22T16:07:00.343
112,355
112,355
[ "c#", "winforms", "menustrip" ]
1,609,864
1
null
null
2
1,344
I've seen a lot of html that behaves like an iPhone UI. Is there a library for this? Any tutorial/guides in building these html? See screenshot for an example. ![alt text](https://www.gearfuse.com/wp-content/uploads/2009/06/img_0024.png)
How to compose HTML that acts like the iPhone UI?
CC BY-SA 2.5
null
2009-10-22T20:48:44.410
2009-10-22T21:34:28.947
2017-02-08T14:16:29.953
-1
56,952
[ "iphone", "html", "css" ]
1,618,594
1
1,618,757
null
0
2,610
I don't know what to call the type of menu that RegexPal use for their quick reference, therefore I've called it a "Pin Menu" (not sure if there's a more appropriate name?), but I'd like to recreate the functionality which essentially is: - - - How would I go about creating this in JQuery and/or standard javascript. The RegexPal example can be found [here](http://regexpal.com/) (it's the quick reference). And I've posted a screenshot below: ![screenshot](https://i.stack.imgur.com/73QTT.png)
"Pin Menu" using JQuery
CC BY-SA 3.0
0
2009-10-24T17:41:04.377
2015-06-21T01:10:21.370
2015-06-21T01:10:21.370
1,159,643
141,327
[ "javascript", "jquery" ]
1,618,724
1
null
null
-1
907
I want to project a grid on the xz-plane like shown here: ![im](https://habibs.files.wordpress.com/2009/07/2-1.jpg) To do that, I created a vertex grid with x and z range [-1|1]. In the shader I multiply the xz screen coordinate of a vertex with the inverse of the View-Projection matrix. Then I want to adjust the height, depending on the new world xz coordinates and finally I transform these coordinates back to screenspace by multiplying them with the View-Projection matrix. I dont know why, but I get a very strange plane shown on the screen. Are the mathematical oprations I use correct?
Project a grid in screenspace on the world xz plane
CC BY-SA 3.0
null
2009-10-24T18:40:25.100
2015-02-26T19:53:43.197
2017-02-08T14:16:35.327
-1
164,165
[ "math", "opengl", "directx", "direct3d", "3d" ]
1,619,505
1
1,622,980
null
103
72,703
I just started learning the MVVM pattern for WPF. I hit a wall: `OpenFileDialog`? Here's an example UI I'm trying to use it on: ![alt text](https://i.stack.imgur.com/rKeux.png) When the browse button is clicked, an `OpenFileDialog` should be shown. When the user selects a file from the `OpenFileDialog`, the file path should be displayed in the textbox. How can I do this with MVVM? : How can I do this with MVVM and make it unit test-able? The solution below doesn't work for unit testing.
WPF OpenFileDialog with the MVVM pattern?
CC BY-SA 4.0
0
2009-10-24T23:36:35.723
2022-12-24T04:11:55.917
2020-05-18T06:08:46.863
10,927,863
536
[ "c#", "wpf", "xaml", "mvvm", "openfiledialog" ]
1,619,560
1
1,619,584
null
1
2,880
Using the jquery UI Dialog, why is it that when the div that I want to make a dialog of has a position of absolute, the resulting dialog is minimized (can only see the header of the dialog .. if I take out the absolute position everything is fine ..? Thanks ``` <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="en-us" http-equiv="Content-Language" /> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>Untitled 1</title> <link type="text/css" href="css/cupertino/jquery-ui-1.7.2.custom.css" rel="stylesheet" /> <script src="js/jquery-1.3.2.js" type="text/javascript"></script> <script src="js/jquery-ui-1.7.2.custom.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ $("#layer2").dialog(); }); </script> </head> <body style="font-size:62.5%;"> <div id="layer2" style="position: absolute; left: 70px; top: 66px; width: 161px; height: 160px; z-index: 1"> test layer</div> </body> </html> ``` ![alt text](https://i.stack.imgur.com/nYFSW.png)
Jquery Dialog and Div Position
CC BY-SA 3.0
null
2009-10-25T00:10:23.923
2015-06-21T00:49:16.767
2015-06-21T00:49:16.767
1,159,643
130,211
[ "jquery", "user-interface" ]
1,619,917
1
1,621,328
null
7
934
In my application I would like to provide a dashboard like screen when they login to get an overview of what is happening. I have about 4 models I would need to collect data from and sort them into order. My problem is knowing action, so I can get specific fields per model. Here are a few ideas of how to go about it, but I feel they aren't the best and incomplete at best. 1. I have a separate model that contains the: model, associated_id, action. "Post, 1, created" could be an example. 2. Have 4 different arrays, and merge them with the correct order by say created_at. What is the best way to go about this? I have provided an example below: ![alt text](https://imgur.com/QHVc3.png)
Application Dashboard View Logic
CC BY-SA 2.5
0
2009-10-25T03:26:58.317
2011-03-17T15:52:34.150
null
null
59,220
[ "ruby-on-rails", "ruby", "dashboard" ]
1,620,496
1
1,620,523
null
2
331
Let's say i have a 2d linear grid and a point in said grid. How do i map the point from that grid into a related non-linear grid? ![example image](https://www.mediafire.com/imgbnc.php/34e81da59ea0a20680100660bc2752634g.jpg) The red dot is the point in the regular grid and i want to know how to figure out where the point would go in a similar deformed grid (an example one is shown). I'm thinking of using the difference between the points in the non-deformed grid and the deformed one to derive a solution but i'm not sure how.
How do i map points from one grid to another?
CC BY-SA 2.5
null
2009-10-25T10:02:09.000
2009-10-25T10:23:14.507
2017-02-08T14:16:35.667
-1
117,069
[ "c#", ".net", "grid" ]
1,620,721
1
1,620,853
null
3
4,658
After trying several .bst files I am still mostly satisfied with the layout of the ChicagoReedWeb.bst file. However, I don't like the handling of entries by the same author, eg: --- ![Example of Chicago Style](https://i.stack.imgur.com/R6sHL.jpg) --- If have looked at the ChicagoReedWeb.bst file but only understand some of the basics. So how can I edit the code of the ChicagoReedWeb.bst file in such a way that it will print the author's full reference instead of the "--------" ?
How to edit the BibTeX .bst FUNCTION {format.names}?
CC BY-SA 3.0
0
2009-10-25T12:05:59.257
2012-05-26T15:03:08.953
2012-05-26T15:03:08.953
485,561
196,166
[ "latex", "bibtex" ]
1,621,012
1
null
null
1
2,580
I'm trying to capture raw data from my line-in using DirectSound. My problem is that, from a buffer to another the data are just inconsistent, if for example I capture a sine I see a jump from my last buffer and the new one. To detected this I use a graph widget to draw the first 500 elements of the last buffer and the 500 elements from the new one: ![snapshot](https://i.stack.imgur.com/LeOFn.jpg) [http://img199.imageshack.us/img199/206/demodsnap.jpg](http://img199.imageshack.us/img199/206/demodsnap.jpg) I initialized my buffer this way: ``` format = new WaveFormat { SamplesPerSecond = 44100, BitsPerSample = (short)bitpersample, Channels = (short)channels, FormatTag = WaveFormatTag.Pcm }; format.BlockAlign = (short)(format.Channels * (format.BitsPerSample / 8)); format.AverageBytesPerSecond = format.SamplesPerSecond * format.BlockAlign; _dwNotifySize = Math.Max(4096, format.AverageBytesPerSecond / 8); _dwNotifySize -= _dwNotifySize % format.BlockAlign; _dwCaptureBufferSize = NUM_BUFFERS * _dwNotifySize; // my capture buffer _dwOutputBufferSize = NUM_BUFFERS * _dwNotifySize / channels; // my output buffer ``` I set my notifications one at half the buffer and one at the end: ``` _resetEvent = new AutoResetEvent(false); _notify = new Notify(_dwCapBuffer); bpn1 = new BufferPositionNotify(); bpn1.Offset = ((_dwCapBuffer.Caps.BufferBytes) / 2) - 1; bpn1.EventNotifyHandle = _resetEvent.SafeWaitHandle.DangerousGetHandle(); bpn2 = new BufferPositionNotify(); bpn2.Offset = (_dwCapBuffer.Caps.BufferBytes) - 1; bpn2.EventNotifyHandle = _resetEvent.SafeWaitHandle.DangerousGetHandle(); _notify.SetNotificationPositions(new BufferPositionNotify[] { bpn1, bpn2 }); observer.updateSamplerStatus("Events listener initialization complete!\r\n"); ``` And here is how I process the events. ``` /* Process thread */ private void eventReceived() { int offset = 0; _dwCaptureThread = new Thread((ThreadStart)delegate { _dwCapBuffer.Start(true); while (isReady) { _resetEvent.WaitOne(); // Notification received /* Read the captured buffer */ Array read = _dwCapBuffer.Read(offset, typeof(short), LockFlag.None, _dwOutputBufferSize - 1); observer.updateTextPacket("Buffer: " + count.ToString() + " # " + read.GetValue(read.Length - 1).ToString() + " # " + read.GetValue(0).ToString() + "\r\n"); /* Print last/new part of the buffer to the debug graph */ short[] graphData = new short[1001]; Array.Copy(read, graphData, 1000); db.SetBufferDebug(graphData, 500); observer.updateGraph(db.getBufferDebug()); offset = (offset + _dwOutputBufferSize) % _dwCaptureBufferSize; /* Out buffer not used */ /*_dwDevBuffer.Write(0, read, LockFlag.EntireBuffer); _dwDevBuffer.SetCurrentPosition(0); _dwDevBuffer.Play(0, BufferPlayFlags.Default);*/ } _dwCapBuffer.Stop(); }); _dwCaptureThread.Start(); } ``` Any advise? I'm sure I'm failing somewhere in the event processing, but I cant find where. I had developed the same application using the WaveIn API and it worked well. Thanks a lot...
C# DirectSound - Capture buffers not continuous
CC BY-SA 3.0
null
2009-10-25T14:11:38.177
2012-02-23T13:15:24.987
2012-02-23T13:15:24.987
650,492
196,189
[ "c#", "api", "audio", "directx", "sampling" ]
1,621,480
1
1,623,264
null
16
1,530
I just finished participating in the 2009 ACM ICPC Programming Conest in the Latinamerican Finals. These questions were for Brazil, Bolivia, Chile, etc. My team and I could only finish two questions out of the eleven (not bad I think for the first try). Here's one we could finish. I'm curious to seeing any variations to the code. The question in full: --- In the land of ACM ruled a greeat king who became obsessed with order. The kingdom had a rectangular form, and the king divided the territory into a grid of small rectangular counties. Before dying the king distributed the counties among his sons. The king was unaware of the rivalries between his sons: The first heir hated the second but not the rest, the second hated the third but not the rest, and so on...Finally, the last heir hated the first heir, but not the other heirs. As soon as the king died, the strange rivaly among the King's sons sparked off a generalized war in the kingdom. Attacks only took place between pairs of adjacent counties (adjacent counties are those that share one vertical or horizontal border). A county X attacked an adjacent county Y whenever X hated Y. The attacked county was always conquered. All attacks where carried out simultanously and a set of simultanous attacks was called a . After a certain number of battles, the surviving sons made a truce and never battled again. For example if the king had three sons, named , the figure below shows what happens in the first battle for a given initial land distribution: ![alt text](https://imgur.com/4FcP4.png) --- The input contains several test cases. The first line of a test case contains four integers, . 1. N - The number of heirs (2 <= N <= 100) 2. R and C - The dimensions of the land. (2 <= R,C <= 100) 3. K - Number of battles that are going to take place. (1 <= K <= 100) Heirs are identified by sequential integers starting from zero. Each of the next R lines contains C integers HeirIdentificationNumber (saying what heir owns this land) separated by single spaces. This is to layout the initial land. The last test case is a line separated by four zeroes separated by single spaces. (To exit the program so to speak) --- For each test case your program must print R lines with C integers each, separated by single spaces in the same format as the input, representing the land distribution after all battles. --- ``` Sample Input: Sample Output: 3 4 4 3 2 2 2 0 0 1 2 0 2 1 0 1 1 0 2 0 2 2 2 0 0 1 2 0 0 2 0 0 0 1 2 2 ``` Another example: ``` Sample Input: Sample Output: 4 2 3 4 1 0 3 1 0 3 2 1 2 2 1 2 ```
CodeGolf: Brothers
CC BY-SA 2.5
0
2009-10-25T17:27:45.533
2015-12-09T15:31:35.793
2015-12-09T15:31:35.793
100,297
112,355
[ "algorithm", "console-application" ]
1,621,557
1
1,622,414
null
12
11,260
How do I overlay widgets in Qt? I want to create some widgets and place them out-of-layout, but rather tweak their size and position when some other widget's geometry is changed. Something like the buttons on the screenshot: ![alt text](https://img-fotki.yandex.ru/get/4006/goodrone.0/0_2aa7e_f82c79f6_orig)
Qt Widget Overlays
CC BY-SA 2.5
0
2009-10-25T17:56:40.593
2018-03-12T14:47:51.583
2017-02-08T14:16:36.000
-1
13,543
[ "language-agnostic", "qt", "layout", "overlay" ]
1,622,739
1
1,627,696
null
0
522
I am having a problem with creating a navigation controller after on the other side of the application :) ... I mean after clicking this small info button and flipping on the other side ... I'm getting this error:Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "InfoController" nib but the view outlet was not set.' And I know that the problem is somewhere in connecting the view outlet to the the view ... Screenshot from my IB is here: ![enter image description here](https://i.stack.imgur.com/Vg4ic.png) I will appreciate any help as this is the last piece of my app I need to finish ...
UINavigationController on the flipside view
CC BY-SA 3.0
null
2009-10-26T01:36:21.430
2013-04-18T09:28:10.893
2013-04-18T09:28:10.893
664,177
182,551
[ "iphone", "uinavigationcontroller" ]
1,623,483
1
1,623,532
null
5
1,949
I remember doing this in Delphi 7, but I don't remember how, or it is different in the new Delphi IDE. But how do I add a new template to the items gallery? ![Customize items Gallery](https://content.screencast.com/users/JimMcKeeth/folders/Jing/media/f8a4d64c-a49d-42e3-ba57-ff024acbd018/Delphi_2010_New_Item_Gallery.png) So then it will show up under the / menu.
How to add new project template to Delphi
CC BY-SA 2.5
null
2009-10-26T07:25:54.220
2009-10-26T07:53:35.070
2017-02-08T14:16:36.340
-1
255
[ "delphi", "templates", "delphi-2010", "gallery" ]
1,627,189
1
8,984,879
null
35
8,505
If I've got my Eclipse windows split vertically, is there any keyboard shortcut to move to the logical left/right editor? For example, in the image blow, the right editor is selected, and I want to move to the left window: ![split windows](https://i.stack.imgur.com/iqSHj.png) For those of you who know Vim, I am trying to recreate `c-w h` and `c-w l`.
Shortcut for "move to left editor" and "move to right editor" in Eclipse?
CC BY-SA 3.0
0
2009-10-26T20:37:02.413
2018-04-24T05:09:06.933
2018-04-24T05:09:06.933
6,083,675
71,522
[ "eclipse", "keyboard-shortcuts" ]
1,630,314
1
null
null
1
1,192
I want to write a search query that search on the criteria like city, rent, area. i am new to database and sql queries. How to write query. Please help. Any suggestions will be highly appreciated. My form snapshot is here ->> ![Form Snapshot](https://farm3.static.flickr.com/2658/4049101771_f3fcd2c7f7.jpg)
How to write a search query for this form
CC BY-SA 2.5
0
2009-10-27T11:53:05.620
2009-10-27T12:16:03.527
2017-02-08T14:16:37.320
-1
148,814
[ "php", "sql", "mysql" ]
1,631,414
1
1,732,444
null
314
72,668
Battleship! Back in 2003 (when I was 17), I competed in a [Battleship AI](http://www.xtremevbtalk.com/t89846.html) coding competition. Even though I lost that tournament, I had a lot of fun and learned a lot from it. Now, I would like to resurrect this competition, in the search of the best battleship AI. Here is [the framework, now hosted on Bitbucket](https://bitbucket.org/otac0n/battleship). The competition will be held starting on the . No entries or edits later than zero-hour on the 17th will be accepted. (Central Standard Time) Submit your entries early, so you don't miss your opportunity! 1. The game is be played on a 10x10 grid. 2. Each competitor will place each of 5 ships (of lengths 2, 3, 3, 4, 5) on their grid. 3. No ships may overlap, but they may be adjacent. 4. The competitors then take turns firing single shots at their opponent. A variation on the game allows firing multiple shots per volley, one for each surviving ship. 5. The opponent will notify the competitor if the shot sinks, hits, or misses. 6. Game play ends when all of the ships of any one player are sunk. 1. The spirit of the competition is to find the best Battleship algorithm. 2. Anything that is deemed against the spirit of the competition will be grounds for disqualification. 3. Interfering with an opponent is against the spirit of the competition. 4. Multithreading may be used under the following restrictions: No more than one thread may be running while it is not your turn. (Though, any number of threads may be in a "Suspended" state). No thread may run at a priority other than "Normal". Given the above two restrictions, you will be guaranteed at least 3 dedicated CPU cores during your turn. 5. A limit of 1 second of CPU time per game is allotted to each competitor on the primary thread. 6. Running out of time results in losing the current game. 7. Any unhandled exception will result in losing the current game. 8. Network access and disk access is allowed, but you may find the time restrictions fairly prohibitive. However, a few set-up and tear-down methods have been added to alleviate the time strain. 9. Code should be posted on stack overflow as an answer, or, if too large, linked. 10. Max total size (un-compressed) of an entry is 1 MB. 11. Officially, .Net 2.0 / 3.5 is the only framework requirement. 12. Your entry must implement the IBattleshipOpponent interface. 1. Best 51 games out of 101 games is the winner of a match. 2. All competitors will play matched against each other, round-robin style. 3. The best half of the competitors will then play a double-elimination tournament to determine the winner. (Smallest power of two that is greater than or equal to half, actually.) 4. I will be using the TournamentApi framework for the tournament. 5. The results will be posted here. 6. If you submit more than one entry, only your best-scoring entry is eligible for the double-elim. Good luck! Have fun! --- Thanks to [Freed](https://stackoverflow.com/users/190480/freed), who has found an error in the `Ship.IsValid` function. It has been fixed. Please download the updated version of the framework. Since there has been significant interest in persisting stats to disk and such, I have added a few non-timed set-up and tear-down events that should provide the required functionality. This is a . That is to say: the interface has been modified to add functions, but no body is required for them. Please download the updated version of the framework. Bug Fix 1: `GameWon` and `GameLost` were only getting called in the case of a time out. Bug Fix 2: If an engine was timing out every game, the competition would never end. Please download the updated version of the framework. Tournament Results: ![](https://i.stack.imgur.com/5R5Bm.png)
What is the best Battleship AI?
CC BY-SA 3.0
0
2009-10-27T15:02:20.603
2017-09-09T19:50:03.867
2017-09-09T19:50:03.867
366,904
57,986
[ "c#", ".net", "artificial-intelligence" ]
1,631,444
1
1,631,953
null
6
2,992
I have this application that need to do some things in protected paths (like %PROGRAMFILES%), I know that I should be using %APPDATA%, but I can't change that for now. I have isolated all the things that could require UAC to show up on another project, here's a sample code: ``` using System; using System.Diagnostics; using System.IO; using System.Windows.Forms; class Class1 { static void Main(string[] args) { try { File.CreateText(Path.Combine(Application.StartupPath, "something.txt")); } catch (UnauthorizedAccessException ex) { MessageBox.Show(ex.Message, "UnauthorizedAccessException", MessageBoxButtons.OK, MessageBoxIcon.Error); if (args.Length == 0) { Process proc = new Process(); proc.StartInfo.FileName = Application.ExecutablePath; proc.StartInfo.Arguments = "not again"; proc.StartInfo.Verb = "runas"; proc.Start(); } else { MessageBox.Show("Exit to avoid loop."); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } ``` So, I call this executable from my main program, and if it fails because of an unauthorized access, it will launch itself showing the UAC request. My questions are: 1) I had to convert the project output from a DLL to an EXE because I couldn't find any way to request UAC elevation from a DLL, is there any easy way to do that? 2) I also noticed that some programs show a personalized UAC message, with the program logo and all those things, let me show you an example: ![Ugly UAC](https://imgur.com/mJXaj.png) ![Personalized UAC](https://imgur.com/ujuyd.png) How can I do that for my program? 3) To avoid entering in a loop when is running with elevated privileges an it gets another UnauthorizedAccessException I did that thing passing any args. What would you do to achieve the same goal? I think that's all for now. Thanks for your time.
Pimp my UAC and a few questions about it
CC BY-SA 2.5
0
2009-10-27T15:06:25.573
2009-10-30T01:22:16.390
2009-10-30T01:22:16.390
4,386
4,386
[ "c#", ".net", "windows-7", "windows-vista", "uac" ]
1,632,717
1
1,633,353
null
1
397
I've been using [Markdown](http://daringfireball.net/projects/markdown/syntax) recently. One of my biggest problems with Markdown is that Markdown has no syntax for including files within a document (vs., say, the [listings](http://en.wikibooks.org/wiki/LaTeX/Packages/Listings) package for LaTeX). I'd like to extend Markdown to support including whole and partial files as code snippets. For instance, it could look like this: ``` ![:include src/foo/bar.rb](10-20) ``` and that would put the contents of `bar.rb` lines 10-20 into my document as a `code` block. The rationale is that - - My questions are: 1. What should the syntax be? 2. Has this already been done and I am missing it?
Request for comments: What should the syntax be to include code snippets in Markdown? (from external files)
CC BY-SA 2.5
null
2009-10-27T18:17:57.670
2009-11-03T19:49:56.653
null
null
110,644
[ "perl", "syntax", "comments", "markdown", "rfc" ]
1,632,842
1
1,837,348
null
8
2,488
![alt text](https://z1mag3.s3.amazonaws.com/chrome.gif) I have inherited development of a Java/SWT application running on Windows only. One of the feature requests that I need to scope is a Google-chrome-type title bar in place of the SWT windows title bar. The application's tabs appear at the same level as the window control buttons. My understanding is that I will need to: - - - I have a lot of experience with Java programming, GUI programming with Swing/AWT, and non-GUI C# programming. Windows GUI programming and SWT are new to me so I'm not sure where to start. The best I have found so far is a 2001 article on [writing your own SWT widget](http://eclipse.org/articles/Article-Writing%20Your%20Own%20Widget/Writing%20Your%20Own%20Widget.htm). My biggest unknown is the best way to implement a custom Windows application-window.
How to implement a Google-chrome-like title bar for Java SWT application
CC BY-SA 2.5
0
2009-10-27T18:42:01.210
2018-03-30T02:31:23.423
2017-02-08T14:16:37.657
-1
197,562
[ "windows", "user-interface", "google-chrome", "swt", "java-native-interface" ]
1,633,429
1
6,877,830
null
92
45,547
I'm installing a Windows Service using the `ServiceProcessInstaller` and `ServiceInstaller` classes. I've used the `ServiceProcessInstaller` to set the start type, name, etc. But I know I can do it manually after the service is installed by going to the Services management console and changing the settings on the recovery tab of the service's properties, but is there a way to do it during the install? ![Service Property Recovery Tab](https://imgur.com/Ro2OQ.png)
Install Windows Service with Recovery action to Restart
CC BY-SA 2.5
0
2009-10-27T20:23:50.740
2018-09-24T08:55:02.077
null
null
233
[ ".net", "windows-services", "service" ]
1,634,890
1
null
null
0
498
I am currently working on a web service which is periodically polled. It does not store its state and is instantiated everytime it is queried. Essentially, it retrieves the state of other external entities e.g. databases and delivers it back to the requester. Recently, the need to store state as arisen in that - - I came up with the following idea: ![alt text](https://yuml.me/diagram/scruffy/class/%5BWeb%20Service%20that%20is%20polled%20periodically%5DRead%3C-%5BStatic%20Shared%20Data%5D%2C%20%5BStatic%20Shared%20Data%5DWrite%3C-%5BService%20that%20continously%20collects%20%26%20processes%20data%5D) My main concern here is the fact that I am using a static class (essentially a global) to share data between the two services. Is there a better way to doing this? Thanks for the responses thus far. Apologies for the vaguesness of this question: just trying to work out what is the best way to share data across different services and am unsure as to the specifics (i.e. what is required). The platform that I am developing on is the .NET framework and both services are simply WCF services hosted as a Windows service. The database route sounds like the most conventional way to go - however I am reluctant to go down that path for now (mainly for deployment/setup issues; it introduces the need to create new tables, etc in addition to simply installing the software) for at this point the transfer of relatively small amounts of data. This may of course change in the future and going the database route might be the way to go at that point. Is there any other way besides adding a database persistance layer?
How do we share data between two different services
CC BY-SA 2.5
null
2009-10-28T02:30:24.077
2009-10-29T06:56:47.127
2017-02-08T14:16:38.343
-1
4,368
[ "sharing" ]
1,640,760
1
1,644,134
null
1
206
I want to change a user created control based on content of the input inside of textbox tied to JS. My user control has an attribute field titled "userInput" where I pass the content of the textbox. My page looks like this:![alt text](https://imgur.com/8wk5b.png) The textbox has an autocompleteextender and a Javascript function runs when an item from the dropdown is selected. How do I pass the selected value back to the server so that my ascx user control can be updated with the appropriate data. (corresponding to what is in the textbox) Assume that updatepanels/scriptmanagers are set up correctly (they are :-) )
Changing a user created control based on content of input from JS tied textbox
CC BY-SA 2.5
null
2009-10-28T23:20:18.027
2009-10-29T14:29:31.743
null
null
127,257
[ "c#", "asp.net", "ajax", "asp.net-ajax" ]
1,641,070
1
3,617,454
null
0
700
I'm trying to replicate the input box shown in the image on windows mobile 5+ ![Android textbox](https://content.screencast.com/users/One_SHOT/folders/Jing/media/1d16ebf7-b358-4dde-813c-b3bd4ca3c1aa/Textbox.png) but i'm struggling for ideas! So far the only things I have come up with (I haven't managed to make either work) were to either; - - Has anybody done this or know of how this could be acheived? Thanks in advance OneShot
Windows Mobile Custom Textbox
CC BY-SA 2.5
null
2009-10-29T00:59:35.040
2010-09-01T11:21:42.983
2017-02-08T14:16:40.063
-1
1,996,973
[ "user-interface", "windows-mobile", "textbox" ]
1,641,808
1
1,641,909
null
2
2,073
I took 2 images with a cross point and now I'm trying to compare these 2 images and find out what is the distance and angle moved. How can I use MATLAB to do this? Thank you very much! ![Pic3](https://farm4.static.flickr.com/3494/4055134756_2781fb9534.jpg) ![Pic2](https://farm3.static.flickr.com/2601/4054392111_38265ae655.jpg)
Comparing cross point between 2 images in MATLAB
CC BY-SA 2.5
null
2009-10-29T05:47:17.103
2017-05-19T21:25:04.800
2017-02-08T14:16:40.743
-1
177,990
[ "matlab", "image-processing", "computer-vision", "distance", "angle" ]
1,647,689
1
null
null
2
1,519
I've recently been working on a website that uses a mix of png and jpg files. I used a few jpgs because of size issues. Everything was working great, until I tested it in IE. In all versions of IE that I tested it in, the jpgs were lighter, and the colors didn't match with my pngs. Firefox: ![](https://i9.photobucket.com/albums/a70/jman76/fxtest.jpg) IE: ![](https://i9.photobucket.com/albums/a70/jman76/ietest.jpg) As you can see, this is a bit of a problem. Is there a way to correct this? I can't seem to find much information on why this is happening. If it makes any difference, I used GIMP 2.6 to export all my images.
jpg displaying differently in Firefox and IE
CC BY-SA 2.5
0
2009-10-30T02:29:28.947
2012-12-10T03:14:37.327
2017-02-08T14:16:43.503
-1
81,553
[ "firefox", "internet-explorer", "jpeg" ]
1,648,410
1
1,648,650
null
7
3,636
I need a control in silverlight that shows a CPU performance in real time just like the windows task manager does. Something like: ![](https://jira.secondlife.com/secure/attachment/18226/CPU+Usage+History-06.png)
CPU performance control WPF
CC BY-SA 2.5
0
2009-10-30T07:05:31.360
2013-12-20T20:18:45.447
2009-10-30T10:16:38.003
60,761
100,751
[ "c#", "wpf", "silverlight", "graph" ]
1,649,903
1
1,661,353
null
0
2,256
I am trying to create GTK Widget like shows in following Images ![alt text](https://farm3.static.flickr.com/2437/4057640731_edc90caa77_o.jpg) Is it possible to create it in GTK+ under C, I tried using GtkExpander but it is not working out ... Can any one Help....
Creating GTK Widget Using Expander
CC BY-SA 2.5
0
2009-10-30T13:46:47.210
2009-11-03T22:28:41.567
2017-02-08T14:16:43.850
-1
314,247
[ "gtk" ]
1,651,835
1
1,653,766
null
2
1,152
Happy Pre-Halloween everyone :) My issue today is a DisplayObject error I'm getting when remove a child object. I have code that will launch(addChild) a video container and video controls as well as add a close button. [Now the close button works fine and everything](http://gamerfeed.tv/stackoverflow/button_overlap/displayobject.html), removing the video and controls and I'm able to choose another video again, but when you click close a 2nd time I get this error: So I've narrowed down the problem to where I remove the videoContainer (which holds the video object) ``` public function videoSwitch(videoName):void { nv.closeOut(); nv.resetNav = false; if (!videoPlaying) { vc = new VideoClass(videoName, videoHolder); vc.addEventListener("KillMovie", removePlayer); container.addChild(videoContainer); container.addChild(vc); //container.addChildAt(videoContainer, 1); //container.addChildAt(vc, 2); videoPlaying = true; closeVideo(); } else if (videoPlaying) { vc.clearSource(); container.removeChild(videoContainer); container.removeChild(vc); vc = new VideoClass(videoName, videoHolder); vc.addEventListener("KillMovie", removePlayer); container.addChild(videoContainer); container.addChild(vc); //container.addChildAt(videoContainer, 1); //container.addChildAt(vc, 2); closeVideo(); } trace("videoPlaying = "+videoPlaying+"\r"); } ``` You can see in my comments other code I tried, but still getting the error. ``` function closeVideo():void { closeBtn.visible = true; closeBtn.x = 770; closeBtn.y = 20; closeBtn.buttonMode = true; container.addChild(closeBtn); closeBtn.addEventListener(MouseEvent.MOUSE_UP, closeButtonClicked); function closeButtonClicked(event:MouseEvent):void { vc.clearSource(); container.removeChild(videoContainer); //container.removeChildAt(videoContainer, 1); container.removeChild(vc); videoPlaying = false; closeBtn.visible = false; } } ``` Now [my movie](http://gamerfeed.tv/stackoverflow/button_overlap/displayobject.html) works fine, but I'm worried that this error happening in the background (and showing up in my output window) will eventually cause a problem else where :( Thanks in advance for any eyes on this one! :) --- The problem was I remove the kill VC listener, but forgot to remove the stupid Close Button Mouse_Event listener :( ``` function addCloseButton():void { container.addChild(closeBtn); closeBtn.addEventListener(MouseEvent.MOUSE_UP, closeButtonClicked); function closeButtonClicked(event:MouseEvent):void { videoPlaying=false; vc.clearSource(); removeContainerChildren(); // <- thx Joel! closeBtn.removeEventListener(MouseEvent.MOUSE_UP, closeButtonClicked); //^ Forgot this line - thx Jotham! container.removeChild(closeBtn); } } ``` Don't know if this graphic helps but: ![alt text](https://farm3.static.flickr.com/2638/4058417529_11928bdd00_o.jpg)
Getting error when using the removeChild method
CC BY-SA 2.5
null
2009-10-30T19:25:47.527
2009-11-18T19:49:17.123
2017-02-08T14:16:44.527
-1
168,738
[ "flash", "actionscript-3", "addchild", "displayobject", "removechild" ]
1,652,344
1
null
null
0
772
I have html that looks roughly like this ``` <div> <div id="header"></div> <div id="chart"></div> <div id="legend"></div> <div id="info1"></div> <div id="info2"></div> <div id="info3"></div> </div> ``` I would like to position the elements like this: ![positioning](https://content.screencast.com/users/togakangaroo/folders/Jing/media/629c28a7-51a1-4479-8911-f9aad6202721/2009-10-30_1608.png) How in the world do I go about doing this? This is a question about "the right way to do it" and it is certainly not easily Google-able. Essentially what I want to do, rather than define columns in html, is to define a height for the container div, and then have the other divs position themselves naturally within it.
How to use CSS to position divs?
CC BY-SA 2.5
0
2009-10-30T21:10:39.280
2017-08-17T13:36:17.307
2017-02-08T14:16:45.213
-1
5,056
[ "css" ]
1,659,085
1
1,677,393
null
0
1,442
I'm currently working on a small script that needs to use `gtk.StatusIcon()`. For some reason, I'm getting some weird behavior with it. If I go into the python interactive shell and type: ``` >> import gtk >> statusIcon = gtk.status_icon_new_from_file("img/lin_idle.png") ``` Pygtk does exactly what it should do, and shows an icon (lin_idle.png) in the system tray: ![This works fine](https://imgur.com/ZPriJ.png) However, if I try to do the same task in my script: When `gtkInit()` gets called, I see this instead: ![WHY WON'T YOU WORK GSFKLJFSGDJKHSFDGHJKL](https://imgur.com/XNkU2.png) I made I ran the script in the same working directory as the interactive python shell, so I'm pretty sure it's finding the image, so I'm stumped... Any ideas anyone? Thanks in advance. : For some reason or another, after calling `gtk.status_icon_new_from_file()` a few times in the script, it does eventually create the icon, but this issue still remains unfortunately. Does anyone at all have any ideas as to what could be going wrong? Here's the full script. This is actually an application that I'm in the very early stages of making, but it work at the moment if you get it setup correctly, so feel free to play around with it if you want (and also help me!), you just need to get an imgur developer key and put it in `linup_control.py` Linup.py linup_control.py
Pygtk StatusIcon not loading?
CC BY-SA 2.5
0
2009-11-02T01:50:19.127
2009-11-05T04:16:47.287
2009-11-04T22:03:46.007
29,291
29,291
[ "python", "gtk", "pygtk" ]
1,659,254
1
1,659,265
null
2
3,489
Consider a fresh install of Visual Studio 2010 Beta 2. In this case, the web-downloader was used, but that's unlikely relevant. The Visual Studio Command Prompt is missing. ![start menu](https://imgur.com/ri07Q.png) I had expected it to be there, just like 2005 & 2008. The intention is to call `aspnet_regsql` without having to navigate to its path at `c:\WINDOWS\Microsoft.NET\Framework\versionNumber\`, or having to add that path to the environment variables. Doing either of those would be quick, but the idea is to be able to reuse the Command Prompt more than once. : - - -
VS 2010 Beta 2: where is the Visual Studio command prompt?
CC BY-SA 2.5
null
2009-11-02T03:04:23.727
2012-04-06T10:52:14.883
null
null
23,199
[ "visual-studio", "visual-studio-2010" ]
1,660,679
1
1,686,937
null
7
2,446
I'm working on summary on the eclipse modeling project and its various sub - projects. It is not going to get published, it's sole purpose is to help my colleagues and above all my boss to get an overall impression of the topic. For better understanding I took a diagram from the eclipse GEF User Guide and modified it. I want to show the Relationship between GEF (Graphical Editing Framework) and GMF (Graphical Modeling Framework). Did i get this right? ![Diagram](https://i.stack.imgur.com/hLYID.png)
Relationship between GEF and GMF?
CC BY-SA 3.0
null
2009-11-02T11:16:46.653
2012-05-14T08:30:42.717
2011-05-23T06:06:07.837
17,343
200,887
[ "java", "eclipse", "modeling", "eclipse-gef", "eclipse-gmf" ]
1,660,957
1
1,661,009
null
1
1,203
Actually it's a lot easier to show you what I want to achieve instead of trying to explain. State 1: ![enter image description here](https://i.stack.imgur.com/Geu4j.png) The field Responsibles hos no focus. Pretty simple. State 2: ![enter image description here](https://i.stack.imgur.com/nUc7r.png) The field Responsibles got focus. A div shows up around the textbox and the text. It's no problem showing the gray box and position it. The problem is to have the textbox show up inside the box, but still maintain it's current position. When the textbox is being positioned absolute (tried z-index), the content is being messed up ofcourse. I'm using jQuery. Any ideas anyone?
Show box on textbox focus, wrapping the textbox
CC BY-SA 3.0
null
2009-11-02T12:15:46.960
2013-05-20T18:01:53.977
2013-05-20T18:01:53.977
664,177
131,512
[ "jquery", "css" ]
1,661,851
1
1,661,869
null
5
2,431
I'm looking for a software for drawing scientific data, mostly vectors, coordinate systems and diagrams, for example: ![Example diagram](https://zone.ni.com/cms/images/devzone/tut/a/2f52fe69817.gif)
Software for drawing scientific data
CC BY-SA 2.5
0
2009-11-02T15:11:16.970
2012-03-20T14:09:00.507
2017-02-08T14:16:52.273
-1
452,521
[ "vector", "drawing" ]
1,663,889
1
null
null
0
1,838
I'm working on a tricky bit of styling that's working on Safari/Webkit but not on Firefox/Gecko. I can't figure out just what's going wrong. Here's the HTML that I'm using: ``` <div class="showcase"><a href=><div class="showtit"><span class="showname">Stripes!</span> <span class="showtype">a theme</span> <span class="showdate">October 2009</span></div></a></div> ``` So, it creates the Showcase div, then inside that makes a link that encompasses the Showtit div (used for positioning), and then the Showname, Showtype, and Showdate spans. Here's how that's all being styled: ``` .showcase { border-bottom-color: #eeeeee; border-bottom-width: 1px; border-bottom-style: solid; font-size: 20pt; } .showtit { text-align: left; width: 800px; margin: 0 auto; padding: 20; } .showtit:hover{background-color: #3f3f3f;} a .showcase { color: black; } .showcase:hover { background-color: #3f3f3f; color: white; } .showcase a{color:black;} .showcase a:hover {background-color: #3f3f3f; color: white;} .showtype { text-transform: lowercase; font-size: 0.7em; color: #cecece; } .showdate { z-index: 0; top: 0.35em; float: right; position: relative; font-size: 0.7em; color: #cecece; } ``` Messy code, I know, but this is after I've tried plugging every leak I could think of. Now, on Safari this code results in a layout like this: ![imgur.com/54VFo.png](https://i.stack.imgur.com/ec3En.png) Where the middle is being hovered over. But on Firefox, I instead get this: ![imgur.com/MCNYV.png](https://i.stack.imgur.com/CDN2M.png) With that same middle being hovered over. So the div background hover isn't working, and, what's more, the spans I aligned on the right aren't aligning themselves. Why is this? How do I fix this? How do I make certain this never happens again?
Firefox float positioning and Firefox div:hover not working how it should?
CC BY-SA 3.0
null
2009-11-02T21:38:47.017
2012-06-04T15:09:15.760
2012-06-04T15:09:15.760
44,390
201,236
[ "css", "firefox", "html", "css-float" ]
1,663,979
1
null
null
3
6,802
In my app I am drawing bus routes on top of a [MapView](http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/MapView.html). The routes have anywhere between a dozen and a few hundred GPS coordinates that describe the route that the bus takes. ![Hosted by imgur.com](https://imgur.com/GC2T1.png) The problem I'm having is that once I draw out all these lines panning/zooming the `MapView` is incredibly slow (even clicking the 'Back' button takes a minute to happen). I'm not sure how relevant it is, but I put in some debug code then checked the logcat output and the `MapView` is repeatedly calling the `draw()` method of the [Overlay](http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/Overlay.html) whether anything has changed or not. This is happening several times a second and is causing a massive amount of garbage collection to happen (2-3 MB every second). Does anyone have any ideas/suggestions for a method to try and speed this up?
More efficient map overlays in Android
CC BY-SA 2.5
0
2009-11-02T21:56:30.270
2012-01-01T15:24:22.920
null
null
76,835
[ "android", "overlay", "android-mapview" ]
1,663,993
1
1,665,003
null
86
412,140
From what I've read in the past, you're encouraged not to change the priority of your Windows applications programmatically, and if you do, you should never change them to 'Realtime'. What does the 'Realtime' process priority setting do, compared to 'High', and 'Above Normal'?![The process priority list, ranging from Low to Realtime.](https://i.stack.imgur.com/frFln.jpg)
What is the 'realtime' process priority setting for?
CC BY-SA 4.0
0
2009-11-02T21:59:09.993
2023-01-25T10:41:02.057
2020-11-29T04:25:09.737
8,321,285
21,574
[ "windows", "task", "taskmanager", "thread-priority", "task-management" ]
1,664,323
1
1,664,354
null
3
6,793
I am looking for a suitable package (free or otherwise) to duplicate the functionality (mainly in visual department) of IBM's [Many Eyes Visualizations Bubble Chart](http://manyeyes.alphaworks.ibm.com/manyeyes/) in our app. Below attached a screenshot of what I am talking about. Ideally it does the following: 1. Renders with ether flash or javascript. 2. Ability to generate graphs at least once a day. 3. Ability to be interactive, i.e. clicking a bubble would be able to do a callback to our javascript 4. Looks very similar to the Bubble Chart from Many Eyes (attached below). Any ideas if such a solution exists? ![Many Eyes Bubble Chart](https://imgur.com/X71kA.png)
Alternative to Many Eyes Bubble Chart
CC BY-SA 2.5
0
2009-11-02T23:10:13.047
2019-05-09T13:04:04.063
null
null
40,786
[ "php", "javascript", "flash", "visualization", "data-visualization" ]
1,665,387
1
null
null
2
163
``` SELECT u.user_id, u.first_name, u.last_name, i.path AS image_path FROM bgy_users u LEFT JOIN bgy_images i ON i.image_id = u.image_id WHERE u.commentary_id = '0' ``` ## Error: When there definitely is a column `image_id` in table `bgy_users` What am I doing wrong? `DESCRIBE BGY_USERS` ![alt text](https://imgur.com/5SpG4.png) `DESCRIBE BGY_IMAGES` ![alt text](https://imgur.com/9JDPA.png)
What's wrong with this query?
CC BY-SA 3.0
0
2009-11-03T05:22:14.323
2011-12-08T16:33:26.280
2011-12-08T16:33:26.280
560,648
157,837
[ "sql", "mysql", "database" ]
1,667,310
1
1,667,789
null
116
30,911
I recently came across a problem where I had four circles (midpoints and radius) and had to calculate the area of the union of these circles. Example image: ![](https://i.stack.imgur.com/LxEIF.png) For two circles it's quite easy, ![](https://i.stack.imgur.com/L9WCg.png) I can just calculate the fraction of the each circles area that is not within the triangles and then calculate the area of the triangles. But is there a clever algorithm I can use when there is more than two circles?
Combined area of overlapping circles
CC BY-SA 3.0
0
2009-11-03T13:22:02.473
2021-11-10T16:06:24.003
2015-11-25T12:09:06.470
3,301,367
160,695
[ "algorithm", "geometry", "area" ]