Id
int64
1.68k
75.6M
PostTypeId
int64
1
2
AcceptedAnswerId
int64
1.7k
75.6M
ParentId
int64
1.68k
75.6M
Score
int64
-60
3.16k
ViewCount
int64
8
2.68M
Body
stringlengths
1
41.1k
Title
stringlengths
14
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
1
CreationDate
stringlengths
23
23
LastActivityDate
stringlengths
23
23
LastEditDate
stringlengths
23
23
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
1
21.3M
Tags
list
4,194,129
1
4,198,880
null
28
61,474
does anyone know if it is possible to validate an xml with an xsd while i am editing the xml in eclipse? this is how my xml begins: ``` <root xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../definitions.xsd"> ``` ![alt text](https://i.stack.imgur.com/EoRhy.png)
eclipse: validate xml with xsd
CC BY-SA 2.5
0
2010-11-16T12:32:35.187
2012-03-16T09:30:26.227
2010-11-25T19:59:17.233
97,688
97,688
[ "xml", "eclipse", "validation", "xsd" ]
4,194,274
1
4,194,357
null
0
372
i'm trying to use dynamic typing in Obj-C, i've got following code and errors: ![alt text](https://i.stack.imgur.com/1fJ8t.png) For me it seems good, but it don't want to work, any ideas?
NSClassFromString - doesn't work
CC BY-SA 2.5
null
2010-11-16T12:49:18.050
2010-11-16T14:05:08.500
2010-11-16T13:42:36.860
74,118
399,021
[ "iphone", "objective-c" ]
4,194,281
1
4,225,080
null
2
289
I'm using data visualisation libary and I want to do something like in the attached image: ![alt text](https://i.stack.imgur.com/3gA7E.png) two kinds of bars one on each other, How can I do that ?
Wpf data visualisation
CC BY-SA 2.5
null
2010-11-16T12:50:09.730
2010-11-22T18:13:22.633
null
null
138,627
[ "wpf", "silverlight", "charts" ]
4,195,032
1
null
null
0
641
What I want to accomplish is something like this: ![alt text](https://i.stack.imgur.com/rLWK1.png) Two different scrollViews, and each one scrolls horizontically. Each showing 3 images, and a half one (or 1/3th) piece of the next image in the datasource of the scrollview. Does anyone know how to accomplish such a scrollview? I also want to be able to tap an image to flip it and show some information and a button to the detail. (See lower scrollview). Tapping it again would just show back the image, much like the coverflow ui inside itunes, but without the coverflow being 3D... Any help is welcome :) Thanks in advance, Lewion
Special UIScrollView with multiple objects (3) on each page
CC BY-SA 2.5
null
2010-11-16T14:16:17.200
2010-11-16T15:17:41.780
null
null
372,990
[ "iphone", "ios4", "uiscrollview", "coverflow" ]
4,195,096
1
4,195,633
null
4
6,384
According to MSDN [vb.net uses this extended character set](http://msdn.microsoft.com/en-us/library/9hxt0028(v=VS.80).aspx). In my experience it actually uses this: ![alt text](https://i.stack.imgur.com/bQaqu.gif) 1. What am I missing? Why does it say it uses the one and uses the other? 2. Am I doing something wrong? 3. Is there some sort of conversion tool to the original character set?
vb.net character set
CC BY-SA 2.5
null
2010-11-16T14:23:15.520
2017-01-13T12:25:21.657
2017-01-13T12:25:21.657
1,993,366
500,819
[ "vb.net", "character-encoding", "character-set" ]
4,195,283
1
4,195,308
null
0
275
I'm trying to learn how to use the PivotViewer control for Silverlight. I used the excel tool to create a collection and I output the files to a folder called 'asdf'. Then I copied this folder with all of it's contents to the D: partition and here is the code I use to call the collection: ``` using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; namespace PivotTest { public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); Pivot.LoadCollection(@"D:\asdf\my.cxml", string.Empty); } } } ``` Here's a screenshot of what's inside the folder and what I get in the browser when running the application. ![alt text](https://i.stack.imgur.com/HzC2J.png) ![alt text](https://i.stack.imgur.com/5r3QM.png) Any suggestions on what I'm doing wrong? Thanks for the help!
My PivotViewer isn't displaying any information
CC BY-SA 2.5
0
2010-11-16T14:38:59.743
2010-11-16T14:42:12.657
null
null
null
[ "c#", "silverlight", "pivotviewer" ]
4,195,858
1
4,196,189
null
7
2,203
![alt text](https://i.stack.imgur.com/B7RKx.gif) 1. From the picture above, I would conclude that Java EE 6 architecture is an 3 tier architecture. What I dont understand is what exactly is the client tier? Isn't the UI code suppose to be the client tier. JSF handle the UI of the application, shouldn't JSF be at the client tier? 2. Java EE 6 utilizes 3-tiers architecture, and JSF is an MVC model, can somebody tell me what I am about to say is correct or not? 3-Tiers architecture is a linear model, where client input cant go directly to the data tier. Everything must go through the middle tier. Then we have JSF is a MVC model. Well we all know the controller is the FacesServlet, the view is the Page itself. What is the Model? a. It cant be the database itself, since 3-tiers said that everything must go through the middle tier. Is the Model is the managed bean, served as a gate way to the database? b. since JSF is already in the middle tier, therefore the Model is in fact the database.
Question about Java EE 6 architecture
CC BY-SA 2.5
0
2010-11-16T15:37:15.453
2014-05-29T08:56:35.157
2010-11-16T15:43:38.940
240,337
240,337
[ "model-view-controller", "design-patterns", "jsf", "jakarta-ee", "n-tier-architecture" ]
4,196,265
1
4,266,297
null
5
12,723
We had a problem adding this reference at first because of the rights the service had in IIS. we fixed that problem however, when adding the reference again it seems to only partly add the reference. It does appear in the service list but not in the app config, and it can't be used (intellisense doesn't find it nor does manually typing work). if we try this in a diffrent project it does add perfectly and wehave tried deleting anything we can find about the reference before readding it (the subfolder, opening the project in notepad and deleting all references there) but nothing seems to work. when deleting and readding a diffrent service to this project in similar ways and that works and we can add it to diffrent projects in the same solution, just not in this project. Anyone have any idea why this could happen and possible solutions? EDIT: When we recreated the project in the same solution and dragged all classes etc over we can add and remove this reference as we want. although this would count as a solution i would actually like to know why things happened like they happened rather then recreate projects when things seem to get stuck. Is there a cache or something in visual studio that could cause this? Also at times it takes longer (or never finds it) to find the service then at other times where it does so in <1 second. the best way to get it seems to stop and start the search. not sure if it is related but it does seem like a difference between my PC and the other one we use as well. Edit2: we have also tried deleting the services folder, re-adding services recreates the folder and adds this reference it does not work. if we add a different service after the deletion of the folder, that reference does work. adding the reference we want to add after that does not make it work. Edit3: in an additional project, i can add it once where it works however deleting the reference and then re-adding it makes it so it doesn't work again. a similar reference to this one i can delete and re-add as many times as i want within the same project and it keeps working. this one reference keeps not being found when re-added after a delete and giving the "Type or namespace can't be found" error. We also tried changing the solution and projects GUIDs and still, it does not add the service reference correctly in the project.) **Edit4: When turning off the Reuse types in referenced Assemblies in Configure Service Reference.. Dialog box visual studio adds the information to the Reference.cs page leaving that page empty. unticking this box does add all references to that file and makes the service reference work. However i can use most of the reference, i am missing the entry point meaning i can't run it. this is the dialog box where i untick to be able to get a tad further. ![Print Screen of the dialog box](https://i.stack.imgur.com/jaCOu.png)
adding a service reference in Visual Studio 2010 seems to not work
CC BY-SA 2.5
0
2010-11-16T16:12:40.760
2012-07-21T04:41:29.430
2010-12-22T15:31:57.510
465,651
465,651
[ "c#", ".net", "c#-4.0", "wcf", "project" ]
4,196,735
1
4,196,817
null
0
693
I created an application using a `UITableview`. But when I scroll the table view, I see a white space view before and after the table view. How can I fit the `UITableview` so it doesn't show that empty view? Here's an image of what happens when I scroll the UITableview. ![alt text](https://i.stack.imgur.com/Jp5WS.png)
Fit UITableview within Scrollview
CC BY-SA 3.0
null
2010-11-16T16:58:29.670
2017-11-21T22:53:22.390
2017-11-21T22:53:22.390
472,495
409,571
[ "iphone" ]
4,196,854
1
4,197,085
null
2
2,946
I'm attempting to color disabled rows in a gtk tree view widget a light gray color. From what I've read, I'm supposed to set the background-gdk property of the corresponding cellrenderer and bind it to a model column. This sort of works. ``` Gtk::CellRendererText* textRenderer = manage(new Gtk::CellRendererText()); textRenderer->property_editable() = false; Gtk::TreeViewColumn *col = manage(new Gtk::TreeViewColumn("Column1", *textRenderer)); col->add_attribute(*textRenderer, "background-gdk", m_treeview_columns.m_back_color); my_treeview.append_column(*col); Gtk::TreeModel::Row row; for (int i = 0; i < NUMBER_OF_ROWS; iLane++){ row = *(treeview_liststore->append()); row[m_workListColumns.m_back_color] = Gdk::Color("#CCCCCC"); } ``` ![alt text](https://i.stack.imgur.com/lU900.png) In the end though, I get only the cells colored properly. BUT I also get an ugly white-space in between the cells. Does anyone know of a way to fix this or a better way to achieve the effect I'm after?
Row Background Color GtkTreeView Widget
CC BY-SA 3.0
null
2010-11-16T17:08:46.700
2013-01-23T06:29:30.020
2013-01-23T06:29:30.020
278,878
16,363
[ "c++", "gtk", "gtkmm", "gtktreeview" ]
4,197,268
1
4,313,495
null
1
400
I'm trying to render text aligned within the center of a box using imagettftext() and a standard Arial Bold font. I'm developing the code on a Mac and the text aligns in the center of a box just the way I would expect. But then I deploy my code to a proper linux server and it seems the origin the text is render from is different and the kerning is off. I have confirmed I'm on the latest and greatest version of php and php gd on both machines. See example images below: This is what happens on mac ![alt text](https://i.stack.imgur.com/EJk7k.png) This is what happens on linux ![alt text](https://i.stack.imgur.com/IJqew.png) My question has anyone experience this before and know of a fix or workaround for this issue with out having to resort to actually just offsetting the text a couple of pixels on the linux server. Or is there something I'm missing when it comes to rendering text with the above function? EDIT: I do use imagettfbbox() to get the size of the text I'm rendering to center it properly (I also have tried dummy rendering using imagettftext() to get the bounding box as well, the problem seems to be the origin imagettftext() renders too is strange) EDIT 2: Maybe its a difference between implementations in freetype? though I would hope they use the same code base
PHP GD - Different text offset Mac vs Linux
CC BY-SA 2.5
null
2010-11-16T17:53:23.857
2011-09-09T13:31:32.440
2011-09-09T13:31:32.440
764,846
298,745
[ "php", "linux", "macos", "cross-platform", "gd" ]
4,197,404
1
4,197,881
null
5
31,673
I'm getting a bizarre error in Chrome... check out the screenshot below. I define record using object literal syntax. I try setting the "id" property and get the exception. I've tried both : ``` record['id'] = 'wtf'; ``` and also ``` record.id = 'wtf'; ``` I use this type of syntax all over the place in my script.... what could be going on here ? Is this a bug in Chrome ? ![alt text](https://i.stack.imgur.com/E13Sm.jpg) EDIT : I've solved the problem for now, but I'm still not sure why this is happening. I moved the definition of record to occur outside of the if block. Anyone know what could be occurring ? I thought all variable declarations were scoped to the function and therefore this shouldn't be an issue.
Cannot Set Property ... of undefined --- bizarre
CC BY-SA 2.5
0
2010-11-16T18:06:41.560
2010-11-16T19:28:00.383
2010-11-16T18:15:13.807
316,028
316,028
[ "javascript", "google-chrome" ]
4,197,417
1
4,208,460
null
4
262
I am creating a UISegmentedControl replacement so that it works with your own custom images. Because the separators need different colors on both sides I decided to give the middle item the two borders. Now to display the UISegmentedControl replacement, I calculate the available width for one item (frame.size.width / numberOfItems). Then I create a UIButton with a custom background image (the stretchable middle segment image). The next thing is to position everything. Because the 1px separators need to be visible when you select an item, I give every item a 1px larger frame than it actually should have. So the next item overlaps 1px to the left. ``` segmentRect = CGRectMake(indexOfObject * (self.frame.size.width / numberOfSegments), 0, (self.frame.size.width / numberOfSegments) + 1, self.frame.size.height); ``` Using this result I get a perfect custom UISegmentedControl (retina): ![alt text](https://i.stack.imgur.com/ZbkzC.png) Now things look pretty ok, but it all changes when adding more/less segments. This was a 300px wide control by the way, so each segment gets 25px of space. If I change that number to let's say 13, this shows up: ![alt text](https://i.stack.imgur.com/Q1YnT.png) Notice the slightly different border between the '3' and '4'. (Easier to spot on non-retina actually because of pixel doubling) I think this is caused by the not so nice amount of space each segment gets. (300 / 13 = 23,0769) One should think that the stretchable image would accommodate for this, no? The separators are exactly 1px in width and I change the frame by 1px, so the two separators should be placed on top of each other, which is definitely not the case here. Does anyone have an explanation why this happens and more important a way to fix this?
Positioning stretched UIImages correctly
CC BY-SA 2.5
0
2010-11-16T18:07:37.990
2010-11-17T19:45:28.737
2020-06-20T09:12:55.060
-1
239,683
[ "iphone" ]
4,197,744
1
4,197,904
null
39
8,104
My question is this: - --- If I have two heads in my Mercurial repository, and use TortoiseHg as my client, the repository might look like this: ![two heads](https://i.stack.imgur.com/nXRdp.png) Then I can get rid of the `test2` head by doing a merge and discarding. First I would update to the head I'd like to keep (`test3` in this case, which in the image above is already the current parent of my working folder). Then I would right-click and select "Merge with...": ![merge with...](https://i.stack.imgur.com/UnMR1.png) and in the dialog that pops up I would choose to discard the changes from the merge target (ie. the branch I'd like to discard all the changes from): ![merge dialog](https://i.stack.imgur.com/CTm2j.png) After this merge has gone through, all the changes in the `test2` head has been discarded, and I can commit. The head has now disappeared, but the changeset is still part of history. My question is this: How can I do the same thing using only the command line client? I can't find any matching options to the `hg merge` command: --- : debugsetparents worked nicely: `--tool internal:local```` @echo off setlocal if exist repo rd /s /q repo hg init repo cd repo rem revision 0 echo >test1.txt hg commit -m "test1" --addremove rem revision 1 echo >test2.txt hg commit -m "test2" --addremove rem revision 2 hg update 0 echo >test3.txt hg commit -m "test3" --addremove rem now let's get rid of change in revision 1 with merge hg merge --tool internal:local -r 1 hg commit -m "merged" dir ``` output of execution:
How to merge to get rid of head with Mercurial command line, like I can do with TortoiseHg?
CC BY-SA 2.5
0
2010-11-16T18:41:49.637
2020-10-07T17:01:29.183
2010-11-16T19:15:06.510
267
267
[ "mercurial", "merge", "branch" ]
4,198,322
1
4,198,350
null
0
50
This is from a practice exam, anyhow, I was thinking, what are the exception that I should take care of? ![screenshot](https://i.stack.imgur.com/tFS85.png) Thanks.
Is there any exceptions to be avoided in this simple class?
CC BY-SA 2.5
null
2010-11-16T19:53:26.203
2010-11-16T19:57:26.503
null
null
323,926
[ "java", "exception" ]
4,198,331
1
7,349,792
null
34
12,627
One of the most powerful features of the Kinesis dvantage keyboards is the ability to remap keys. I've been using one for about 6 months with the Colemak layout and am loving it. Below is my layout. I primarily use Matlab. What is your optimal layout? ![alt text](https://i.stack.imgur.com/cgGCK.png) The 2 things I found most useful were to put the shift key under the left thumb and putting all the arrows under the right hand. This allows me to comfortably hit ctrl+shift with my thumb and move with the arrows on the other hand to select text and navigate around excel.
Optimized Layout for Kinesis Advantage
CC BY-SA 3.0
0
2010-11-16T19:54:56.440
2022-04-20T22:13:58.100
2014-02-10T23:58:04.187
521,078
509,908
[ "keyboard" ]
4,198,562
1
null
null
13
13,324
For the [XMPP interface for the Stack Overflow chat](https://meta.stackexchange.com/questions/57316/offer-an-xmpp-method-for-chat/63420#63420), I am currently [taking the HTML of the chat messages and converting to valid XML](https://stackoverflow.com/questions/4101525/using-ruby-how-can-i-confirm-that-an-xml-snippit-is-valid), and setting that as the `html` child element of the XMPP `message` object. In my Mac OS X jabber client this was working great! It meant that when users in the SO chat posted a oneboxed image, the image would show up in my XMPP client (Adium for OS X): ![My Mind Is Blown](https://i.stack.imgur.com/0kfu2.png) However I just updated Adium to the latest version and apparently [they considered what I was doing to be a security hole and against XMPP specs, and changed that behavior](http://trac.adium.im/ticket/11506). Their reasoning was that XMPP should not reveal your Ip address, and to fetch an image over HTTP would reveal my IP address. So now the chats are imageless over XMPP. How can I make images work over XMPP? Should my XMPP component download the images and embed them into the `<Message>` stanzas? Can the images be proxied through the XMPP server? Or is this an impossibility?
How can I send an image on the web in an XMPP (Jabber) message?
CC BY-SA 2.5
0
2010-11-16T20:21:43.937
2011-10-07T22:49:04.253
2017-05-23T10:29:57.607
-1
75,801
[ "ruby", "security", "image", "xmpp", "xmpp4r" ]
4,198,676
1
7,687,527
null
333
100,351
It's been a while since I've had to adjust project build settings. After upgrading to a recent SDK I'm having trouble building my ad hoc distribution configuration. Build generates this warning and error: > warning: iPhone apps should include an armv6 architecture (current ARCHS = "armv7")iPhone/iPod Touch: application executable is missing a required architecture. At least one of the following architecture(s) must be present: armv6 (-19033) However in my project I thought I had things set correctly: - - - ![alt text](https://i.stack.imgur.com/4XhKI.png) I have cleaned all targets. I appreciate any tips.
"Warning: iPhone apps should include an armv6 architecture" even with build config set
CC BY-SA 3.0
0
2010-11-16T20:35:58.880
2018-01-01T08:25:42.210
2015-08-07T13:48:18.790
916,299
296,003
[ "ios", "xcode" ]
4,199,135
1
4,199,183
null
1
305
Do you know what is the name of this layout for Java/Swing? Does the Java library already bring us this or should I do that on my own? If so, could any one of you show some samples? ![alt text](https://i.stack.imgur.com/BHqWf.jpg)
What is the name of this kind of Java/Swing interface?
CC BY-SA 3.0
null
2010-11-16T21:25:00.887
2017-04-25T09:11:07.520
2017-04-25T09:11:07.520
4,370,109
420,661
[ "java", "swing" ]
4,199,644
1
4,232,767
null
10
8,688
My website looks on the iPhone but looks sub-optimal on the iPad. I'm having a lot of trouble finding information on the differences between iPad's webkit/safari rendering engine and iPhones' webkit/safari rendering engine. If you don't believe me, go to [http://www.finishline.com](http://www.finishline.com) on both the iPhone and the iPad (note that you will have to click "standard site" at the bottom of the page if you get thrown over to our Mobile site). The main differences being a missing white background and the main tabbed navigation menu at the top (also the little mini-cart up at the top right is way off). iPhone (looks correct): ![alt text](https://i.stack.imgur.com/BwsJM.png) iPad (looks wrong): ![alt text](https://i.stack.imgur.com/8PZwS.png) What are the rendering differences between mobile webkit on iPhone and iPad?
List of known differences between "Safari on iPad" and "Safari on iPhone"
CC BY-SA 2.5
null
2010-11-16T22:20:38.700
2019-03-23T00:05:03.693
2010-11-19T18:00:53.040
58
58
[ "iphone", "ipad", "mobile-safari" ]
4,199,710
1
null
null
8
2,142
I'm having a bit of trouble working out the "best" way to render text in my application. My main view consists of a text view, and the design of the application dictates a few things: - - - At the moment i'm using a UILabel and the following code to try and guess the best font size to use for the amount of text: ``` txt = @"this is just some sample text"; mylabel.font = [self getFontForString:txt]; mylabel.adjustsFontSizeToFitWidth = YES; mylabel.numberOfLines = 0; [mylabel setText:txt]; ``` And: ``` - (UIFont *) getFontForString:(NSString *)txt { CGFloat textLength = txt.length; CGFloat maxFontSize = 71; CGFloat minFontSize = 27; CGFloat newFontSize = 0; NSArray *chunks = [txt componentsSeparatedByString:@" "]; NSSortDescriptor *sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"length" ascending:NO] autorelease]; NSArray *sortedChunks = [chunks sortedArrayUsingDescriptors:[NSArray arrayWithObject:sortDescriptor]]; CGSize labelSize = theThingLabel.bounds.size; CGSize projectedSize = [[sortedChunks objectAtIndex:0] sizeWithFont:[UIFont boldSystemFontOfSize:maxFontSize]]; if (projectedSize.width > labelSize.width) { CGFloat percentageDifference = ((projectedSize.width - labelSize.width)/labelSize.width)*100; if (percentageDifference > 50) { newFontSize = ((minFontSize/percentageDifference)*100) - 10; if (newFontSize < minFontSize) newFontSize = minFontSize; } else { newFontSize = ((percentageDifference/maxFontSize)*100) - 10; if(newFontSize < (maxFontSize/2)) newFontSize = maxFontSize - abs(newFontSize); } } else { if ( textLength > 11 && textLength < 255) { newFontSize = (maxFontSize - ((maxFontSize - minFontSize) * ((textLength- 11) / 100))); } else if (textLength <= 11) { newFontSize = maxFontSize; } else if (textLength >= 255) { newFontSize = minFontSize; } } return [UIFont boldSystemFontOfSize:newFontSize]; } ``` This works, to an extent, but often falls over when the text is a bit on the long side, these two example show it rendering the following strings: - - ![short text](https://i.stack.imgur.com/fxFrr.png) ![longer text](https://i.stack.imgur.com/Zn8xP.png) As you can see in the second example (with far longer text) there are a number of issues: - - - So with all this in mind, what are my options, I'm open to moving to using coretext if this is the right solution, but have no idea where to start, it's also possible I've made a mistake which I just can't see in my "font size guessing" code.
Scaling text to fit on iPhone
CC BY-SA 4.0
0
2010-11-16T22:28:22.730
2018-08-21T22:20:35.297
2018-06-08T09:27:28.417
472,495
68,943
[ "iphone", "layout", "text", "uilabel", "core-text" ]
4,199,897
1
4,200,388
null
4
3,226
The following code will draw an ellipse on an image and fill that ellipse with the Tomato colour ``` string imageWithTransEllipsePathToSaveTo = "~/Images/imageTest.png"; Graphics g = Graphics.FromImage(sourceImage); g.FillEllipse(Brushes.Tomato, 50, 50, 200, 200); sourceImage.Save(Server.MapPath(imageWithTransEllipsePathToSaveTo), ImageFormat.Png); ``` If I change the brush to Transparent it obviously will not show because the ellipse will be transparent and the image underneath will show. How do I set the 'background' of the ellipse to be transparent so that the image contains a transparent spot? EDIT: Sorry for the confusion but like this... ![alt text](https://i.stack.imgur.com/u3w3v.png)
.NET Graphics - creating an ellipse with transparent background
CC BY-SA 2.5
0
2010-11-16T22:54:09.340
2010-11-17T00:34:54.990
2010-11-17T00:34:54.990
76,337
124,966
[ "c#", "graphics" ]
4,200,170
1
4,200,233
null
6
3,632
## Solved - Problem with constructor [Matthew Flaschen](https://stackoverflow.com/users/47773/matthew-flaschen) and [Michael Burr](https://stackoverflow.com/users/12711/michael-burr) pointed out the problem of the overloaded constructor of `Node(int)` calling `Node()` which doesn't work [because...](https://stackoverflow.com/users/238419/blueraja-danny-pflughoeft) --- I have built a program (I am debugging it) and have run into a weird problem... A `if` statement is not getting triggered when it should be... This is a school project where we must build an AVL Tree with at least one 'optimizing' feature. I am sure and have tested that the `rdown` and `ldown` work (as the balancing factors) - the tree is not perfectly balanced. Rather it is based on the hight of the branches (i.e. - `balance()` should only return (1,0,-1) otherwise it is unbalanced. I hope this is enough information to solve this weird problem... I have never ran into anything like this before with Microsoft Visual Studio 2010. ## Node struct: ``` struct Node { int data; // the data in the Node int rdown; // the number of ellements below the node on the right side int ldown; // the number of ellements below the node on the left side Node * parrent; // the node's parrent Node * lchild; // the nodes left child Node * rchild; // the nodes right child Node () { rdown = 0, ldown = 0; data = 0; parrent = NULL; lchild = NULL; rchild = NULL; } Node (int dat) {rdown = 0, ldown = 0; parrent = NULL; lchild = NULL; rchild = NULL; data = dat; } bool end() { if (lchild == NULL && rchild == NULL) return true; // check if this node is the 'end of the line' - where it doesn't return false; } // have any children bool goodToAdd() { if (lchild == NULL || rchild == NULL) return true; // make sture the current node has at least one spot to add return false; } // a new node to - either lchild or rchild must be NULL int balance() { return (ldown - rdown); } // get a balance number for the node }; ``` ## Search function that is causing the problems ``` Node * AVL_Tree::search(const Node * num) { Node * tmpNode = AVL_Tree::root; // tmpNode is a place holder for the search for (int i = 1; true; i++) { // increment int i to check for excess searching -> pervents endless loop if (tmpNode == NULL) //****** causing problems******** // the search has reached a dead end (the data is not contained) ==> NULL return NULL; if (tmpNode->data == num->data) // if the data of num is the same as tmpNode the data is contained ==> Node * return tmpNode; // since the node has not been found yet move down the tree... if (tmpNode->data > num->data && tmpNode->lchild != NULL) // if the data is smaller than the tmpNode move to the lchild tmpNode = tmpNode->lchild; else if (tmpNode->rchild != NULL) // since the node has been proven to not be = to the data to be searched for tmpNode = tmpNode->rchild; // and it is not smaller... move to the right if (i > (root->ldown + 1) && i > (root->rdown + 1) ) { // the while loop has searched suffecent time and has not ended string tmp = "the search incountered a critical error... aborting..."; // to prevent an endless loop the string error throw tmp; // is thrown (should not happen) - indicates a broken tree } } } ``` --- ## A screen shot of the first encounter with the for loop ![alt text](https://i.stack.imgur.com/ymCoW.jpg) ## A screen shot of the second encounter with the for loop If you would note in the 'Autos' tab at the bottom that all the data and the node itself's address is `NULL` - yet in the next screen shot it continues ![alt text](https://i.stack.imgur.com/M2pSJ.jpg) ## The program continues!!! what?>! I pushed F-10 (the 'go to next command' button) ... and it jumps right over the statement? why? ![alt text](https://i.stack.imgur.com/hA9A3.jpg)
Visual Studio 2010 Debugging "if (var == NULL)" not triggering
CC BY-SA 2.5
null
2010-11-16T23:40:50.087
2010-11-17T00:16:54.433
2017-05-23T12:01:09.963
-1
207,138
[ "c++", "visual-studio-2010", "null", "if-statement" ]
4,200,477
1
4,200,606
null
0
144
All I did was I added a single more argument (iterations) to this function: ``` /** * saveImage : save the last image received. * @param pName name of the file */ void GVMsample::saveImageLocal(const std::string& pName, const std::string& pImageFormat, const int &iterations) { // Check that a video module has been registered. if (!fRegisteredToVim) { throw ALError(getName(), "saveImageLocal()", "No video module is currently " "registered! Call registerToVIM() first."); } #ifdef GENERICVIDEOMODULE_IS_REMOTE_ON // If this module is running in remote mode, we shouldn't use saveImageLocal. throw ALError(getName(), "saveImageLocal()", "Module is run in remote mode, " "use saveImageRemote instead !"); #else ALImage* imageIn = NULL; for ( int iter = 0; iter < iterations; iter++ ) { // Now you can get the pointer to the video structure. imageIn = (ALImage*) (fCamProxy->call<int>("getImageLocal", fGvmName)); if (!imageIn) { throw ALError(getName(), "saveImageLocal", "Invalid image returned."); } fLogProxy->info(getName(), imageIn->toString()); // You can get some image information that you may find useful. const int width = imageIn->fWidth; const int height = imageIn->fHeight; const int nbLayers = imageIn->fNbLayers; const int colorSpace = imageIn->fColorSpace; const long long timeStamp = imageIn->fTimeStamp; const int seconds = (int)(timeStamp/1000000LL); // Set the buffer we received to our IplImage header. fIplImageHeader->imageData = (char*)imageIn->getFrame(); saveIplImage(fIplImageHeader, pName, pImageFormat, seconds); // send image over UDP to the PC // we will use udt } // Now that you're done with the (local) image, you have to release it from the V.I.M. fCamProxy->call<int>("releaseImage", fGvmName); #endif } ``` The functions is defined like this in the header file: ``` /** * saveImage : save the last image received. * @param pName name of the file */ void saveImageLocal(const std::string& pName, const std::string& imageFormat, const int &iterations); ``` And I am getting this error: ![alt text](https://i.stack.imgur.com/F0QBq.png) When I take that argument away it compiles ok again.
Problem compiling C++ program after adding one argument to a function
CC BY-SA 2.5
null
2010-11-17T00:33:29.110
2010-11-17T01:03:39.903
null
null
95,944
[ "c++" ]
4,200,620
1
4,200,737
null
1
951
![image showing the online duration of network device](https://i.stack.imgur.com/6fiIU.jpg) i want my c# program to be able to display the online duration of the network device. i have tried `NetworkInterface` class but it does not have that info.
How to get online duration of the network device?
CC BY-SA 2.5
0
2010-11-17T01:06:25.127
2021-05-02T11:06:39.713
2010-11-17T11:29:11.073
452,202
452,202
[ "c#", "networking" ]
4,200,710
1
4,200,715
null
3
184
I am looking at the sample project for a [ColorPicker CustomControl](http://msdn.microsoft.com/fr-fr/library/ms771620%28VS.85%29.aspx). I am trying to debug it to see how the code runs. I am getting ![alt text](https://i.stack.imgur.com/6kVt6.jpg) I think it has to do with ![alt text](https://i.stack.imgur.com/gqFLO.jpg) No build config for debug?
Why no debug for Project
CC BY-SA 2.5
null
2010-11-17T01:25:32.263
2010-11-17T02:08:29.097
null
null
292,291
[ "c#", "visual-studio", "debugging" ]
4,201,049
1
4,203,353
null
0
197
In monotouch, how can I write to the console which the iPhone Configuration Utility displays. This is the console I am referring to: ![alt text](https://i.stack.imgur.com/grjVm.png)
Monotouch - Write to the console from an iPad
CC BY-SA 2.5
null
2010-11-17T02:52:32.383
2010-11-17T10:10:55.420
null
null
172,861
[ "console", "xamarin.ios" ]
4,201,348
1
4,211,800
null
1
299
Since 10.5, Spotlight on Mac OS X has this nice you might have seen: ![Dictionary integration in Spotlight](https://i.stack.imgur.com/ylIHN.png) Any ideas how anything like this could be implemented? It seems that the current Dictionary+Spotlight friendship is somewhat hardcoded into Spotlight's code (for example, there is a specific user defaults key `com.apple.spotlight.DictionaryLookupEnabled` present just for toggling dictionary searching). I've read in the [Spotlight Importer Programming Guide](http://developer.apple.com/library/mac/#documentation/Carbon/Conceptual/MDImporters/MDImporters.html) that one can create a Spotlight importer only on a , that is if your application opens/creates files with extension `.foo`, you can then write a Spotlight importer for indexing properties of those files. What I need, however, is for the Spotlight to somehow with its own query (exactly what it now does with Dictionary).
OS X Spotlight searching from a user-defined database?
CC BY-SA 2.5
0
2010-11-17T03:56:13.850
2010-11-18T04:56:57.193
null
null
200,603
[ "macos", "dictionary", "spotlight" ]
4,201,439
1
4,201,572
null
0
389
i need to get contents on web page and read it via URL,but contents not include data on javascript any body can help me to solve this problem ? For example : i want to get bibtext content ' javascrip from URL : [http://portal.acm.org/citation.cfm?id=152610.152611&coll=DL&dl=GUIDE&CFID=111326695&CFTOKEN=18291914](http://portal.acm.org/citation.cfm?id=152610.152611&coll=DL&dl=GUIDE&CFID=111326695&CFTOKEN=18291914) how can i get content (2) from (1)![alt text](https://i.stack.imgur.com/HpPNc.jpg)
How can get html content include content of javascript?
CC BY-SA 2.5
null
2010-11-17T04:16:40.067
2010-11-18T10:08:15.840
null
null
326,878
[ "java", "http" ]
4,201,804
1
4,208,363
null
0
3,191
I am displaying a custom marker on my Google Map. They are placed fine, but they have this funny shadow. How can I remove the shadow?![alt text](https://i.stack.imgur.com/laquO.png) ``` @Override public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { super.draw(canvas, mapView, shadow); // ---translate the GeoPoint to screen pixels--- Point screenPts = new Point(); mapView.getProjection().toPixels(geoPnt, screenPts); // ---add the marker--- /*Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.pushpin); canvas.drawBitmap(bmp, screenPts.x, screenPts.y - 67, null);*/ return true; } } ```
How can I remove the shadow on the markers on my map?
CC BY-SA 2.5
0
2010-11-17T05:36:16.267
2013-04-08T15:54:42.383
2010-11-17T19:25:46.113
19,875
19,875
[ "java", "android", "google-maps", "overlay", "android-mapview" ]
4,201,953
1
4,237,676
null
0
4,306
I have eclipse Galileo 3.5 with maven plugin installed. I want to know if there is any way to uninstall that plugin. I do not see any option as uninstall a plugin in this version if eclipse. The following is the screen i got after reading one of the comments on this question. but the uninstall button is disabled. What to do? ![alt text](https://i.stack.imgur.com/ziOSw.jpg) Thanks in advance.
How to uninstall a plugin from Eclipse Galileo 3.5?
CC BY-SA 2.5
null
2010-11-17T06:13:53.700
2011-10-08T16:37:02.043
2010-11-17T07:27:35.743
501,767
501,767
[ "eclipse-plugin", "maven-plugin" ]
4,202,179
1
4,203,575
null
1
5,367
I am using graphics.h library to implement the a shutdown button on the display screen.The problem I am facing is that the color function(setfillcolor()) is not working by which I want to color the area between the two circles in red.My compiler is turbo C. ``` void shutdown(void) { setcolor(RED); circle(550,50,10); setfillcolor(RED); //color. circle(550,50,15); setcolor(CYAN); } ``` ![alt text](https://i.stack.imgur.com/xceXZ.jpg)
setfillcolor() failing to set color?
CC BY-SA 4.0
null
2010-11-17T06:59:36.887
2022-04-06T20:56:36.867
2022-04-06T20:56:36.867
44,729
null
[ "c", "turbo-c", "bgi" ]
4,202,457
1
4,202,608
null
32
46,177
I have a registration form in a `LinearLayout` as shown below: ![alt text](https://i.stack.imgur.com/US13J.jpg) When emulator screen is in it's default position it is working fine. But when I rotate the emulator screen it only displays the elements which are fit to screen and remaining are wrap up. As shown in below screen: ![alt text](https://i.stack.imgur.com/1asgs.jpg) Now I want to make this layout scrollable but not getting the idea. Any help will be highly appreciated.
Scrollable layout in Android
CC BY-SA 2.5
0
2010-11-17T07:54:54.830
2018-10-26T08:26:12.740
2011-01-11T07:33:08.620
457,982
457,982
[ "android", "forms", "android-linearlayout" ]
4,202,623
1
4,203,238
null
1
642
I would like to reproduce this effect : ![alt text](https://i.stack.imgur.com/WZKHH.jpg) How can I do with xaml ? (note that the text can be variable) Thanks in advance for your help
How do I implement a "Frame effect" in Silverlight
CC BY-SA 2.5
null
2010-11-17T08:24:22.050
2010-11-17T10:06:20.713
2010-11-17T10:06:20.713
59,303
491,723
[ "silverlight", "xaml" ]
4,202,934
1
4,203,179
null
1
1,725
I'm trying to define a reusable layout element I want to include in another layout. But I'm not sure what's the best way to archive the layout I want. The reusable component should look like this. ![Layout](https://i.stack.imgur.com/puQ8t.png) It should be separated into 3 areas. Each area will get a separate background image.The both areas on the left should each contain 2 TextViews whereas the right area should contain 3 TextViews. The whole component should fill the width of the screen. I've already started to build the layout but I'm still not sure whether to do it by nesting multiple LinearLayouts or by using a TableLayout. Which way should I go? Or would you suggest a totally different approach?
Android: Linear vs. table layout for a reusable UI component
CC BY-SA 2.5
0
2010-11-17T09:09:54.353
2014-06-07T08:57:03.243
null
null
19,601
[ "android", "android-layout", "android-linearlayout", "tablelayout" ]
4,202,973
1
4,203,062
null
3
6,560
In the following extJS page, when I click the button, the content of the HTML Div "buttonInfo" changes correctly. I want to also change the contents of the panel that I created with extJS. However, when I change the contents of the panel as I do the div, the whole panel is simply replaced. # before: ![alt text](https://i.stack.imgur.com/Gk9jW.png) # after: ![alt text](https://i.stack.imgur.com/Tbw7r.png) ``` <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link rel="stylesheet" type="text/css" href="ext/resources/css/ext-all.css"> <style type="text/css"> body { padding: 20px; } div#infoBox { margin: 10px 0 0 0; width: 190px; height: 100px; background-color: lightblue; padding: 10px; } div#content { margin: 10px 0 0 0; } div.x-panel-body { padding: 10px; } </style> <script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script> <script type="text/javascript" src="ext/ext-all-debug.js"></script> <title>Simple extJS</title> <script type="text/javascript"> Ext.BLANK_IMAGE_URL = 'ext/resources/images/default/s.gif'; Ext.onReady(function(){ Ext.get('buttonInfo').on('click', function(){ Ext.get('infoBox').update('This is the <b>new</b> content.'); Ext.get('panel1').update('new info'); //Ext.get('panel1').html = 'new info111'; //doesn't work //panel1.html = 'new info222'; //doesn't work }); new Ext.Panel({ id: 'panel1', renderTo: 'content', width: '210px', title: 'Extended Info', html: 'original text', collapsible: true }); }); </script> </head> <body> <button id="buttonInfo"> Show Info </button> <div id="infoBox"> </div> <div id="content-wrapper"> <div id="content"></div> </div> </body ``` >
How can I manipulate contents of an extjs panel as I can a DOM element?
CC BY-SA 2.5
0
2010-11-17T09:17:19.567
2014-07-30T11:57:53.630
null
null
4,639
[ "extjs" ]
4,203,163
1
4,203,836
null
148
72,043
I've had some really awesome help on my previous questions [for detecting paws](https://stackoverflow.com/questions/4087919) and [toes within a paw](https://stackoverflow.com/questions/3684484), but all these solutions only work for one measurement at a time. [Now I have data](http://dl.dropbox.com/u/5207386/RAR-collectie.rar) that consists off: - - - - - ![alt text](https://i.stack.imgur.com/8x2uG.png) Obviously sticking everything into one big object isn't going to cut it, so I figured I needed to use classes instead of the current slew of functions. But even though I've read Learning Python's chapter about classes, I fail to apply it to my own code ([GitHub link](http://cloud.github.com/downloads/ivoflipse/DogsRus/pressureanalysis.py)) I also feel like it's rather strange to process all the data time I want to get out some information. Once I know the locations of each paw, there's no reason for me to calculate this again. Furthermore, I want to compare all the paws of the same dog to determine which contact belongs to which paw (front/hind, left/right). This would become a mess if I continue using only functions. So now I'm looking for advice on how to create classes that will let me process my data ([link to the zipped data of one dog](http://dl.dropbox.com/u/5207386/Krupp_Krulle.rar)) in a sensible fashion.
How do I design a class in Python?
CC BY-SA 2.5
0
2010-11-17T09:43:13.197
2018-11-18T16:40:07.347
2017-05-23T10:31:35.960
-1
77,595
[ "python", "oop", "class-design" ]
4,203,371
1
null
null
1
178
A `<div>` element has `text-align:left; width:500px;` and, inside it, a child `<div>` has more than 20 other `<div>` elements with `width:20px;`. My question is, without using `float:left` how we can put all elements side by side from the left? --- Screenshot: ![alt text](https://i.stack.imgur.com/0VSh0.png)
parent div have text-align:left;
CC BY-SA 2.5
0
2010-11-17T10:14:46.870
2010-11-17T11:01:50.537
2010-11-17T10:52:08.047
287,047
510,537
[ "html", "css" ]
4,203,430
1
null
null
1
498
I made a project in visual studio 2008 and attached a database to it... But later on it installed visual studio 2010 and it automatically updated my project... As now i reinstalled my windows and again approched to my project, it showed the following message when i double clicked my database file in the server explorer in vs 2008, vs 2008 sp1, vs 2010... ![alt text](https://i.stack.imgur.com/eLlvW.png)
convert .mdf 2008 file to .mdf2005 file
CC BY-SA 2.5
null
2010-11-17T10:24:28.283
2010-11-17T10:30:34.327
null
null
509,084
[ "visual-studio", "visual-studio-2008", "sql-server-2005", "visual-studio-2010", "sql-server-2008" ]
4,203,529
1
4,205,147
null
5
580
I have a network that could look like this: ![Network](https://i.stack.imgur.com/P2Mll.png) Basically, I want to know the minimum number of green circles that can disconnect the source and drain if removed/disabled. (in this case 1) I have already succesfully implemented the Edmonds-Karp algrorithm, but I don't know how to model the network with directed edges, so I get the desired result. If I just replace each connection between the nodes with two opposite directed edges with capacity 1, I get a max flow of 2 with EdmondsKarp, but I only need to remove 1 green circle to break the network. How do I model my network as nodes and directed edged?
Modeling network as directed graph
CC BY-SA 2.5
null
2010-11-17T10:38:17.720
2010-11-17T14:05:06.943
2010-11-17T10:50:59.923
355,942
355,942
[ "algorithm", "graph-theory" ]
4,203,687
1
4,203,737
null
1
2,294
i've added a checkbox to a checkedlistbox using the following code: ``` CheckBox cb = new CheckBox(); cb.Enabled = false; cb.Text = "A B C D"; checkedListBox1.Items.Add(cb); ``` but, as seen in the picture, the text wont show up. what have I done wrong ? Thanks! ![alt text](https://i.stack.imgur.com/kjhXn.jpg)
checkbox text (inside a checkedlistbox) wont appear
CC BY-SA 2.5
null
2010-11-17T11:00:45.350
2014-06-04T11:26:07.110
null
null
437,997
[ "c#", ".net", "winforms", "checkbox", "checkedlistbox" ]
4,203,730
1
null
null
7
17,548
I have this custom compiled PHP (v5.3.3) with the following extensions enabled (via configure): ``` ./configure --prefix=/usr/local/php5.3.3 --with-config-file-path=/usr/local/apache2/conf --with-apxs2=/usr/local/apache2/bin/apxs --with-bz2 --with-curl=/usr/lib --with-curlwrappers --with-freetype-dir=/usr/local --with-gd=/usr/local --with-gettext --with-gmp --with-iconv=/usr/local --with-imap=/usr/local/imap2007e --with-imap-ssl --with-jpeg-dir=/usr/local/lib --with-kerberos --with-libxml-dir=/usr/lib --with-mcrypt=/usr/local --with-mhash --with-mysql=/usr/lib/mysql --with-mysql-sock=/var/lib/mysql/mysql.sock --with-mysqli=/usr/lib/mysql/mysql_config --with-openssl=/usr --with-pcre-dir=/usr/local/lib --with-pear --with-png-dir=/usr/local/lib --with-readline --with-sqlite --with-xmlrpc --with-xsl=/usr/local --with-zlib-dir=/usr/local/lib --with-zlib=/usr/local --without-pgsql --enable-bcmath --enable-calendar --enable-exif --enable-embedded-mysqli=shared --enable-ftp --enable-gd-jis-conv --enable-gd-native-ttf --enable-mbstring=all --enable-mbregex --enable-shared --enable-sockets --enable-soap --enable-sqlite-utf8 --enable-zend-multibyte --enable-zip --disable-pdo --disable-phar ``` clearly states that mbstring is enabled: ![alt text](https://i.stack.imgur.com/jHhgr.png) Funny thing is when I try to run some PHP scripts (SugarCRM updates), it reports the following error: > PHP Fatal error: Call to undefined function mb_strlen() in crm/include/pclzip/pclzip.lib.php on line 4165 Can anyone throw some light into WHY this is happening and how to fix this? Thanks, m^e
PHP: Call to undefined function mb_strlen() - on custom compiled PHP with mbstring enabled
CC BY-SA 3.0
0
2010-11-17T11:04:11.923
2017-09-29T06:57:21.233
2013-02-26T12:06:33.573
107,625
112,364
[ "php", "compilation", "fatal-error", "mbstring" ]
4,204,249
1
4,301,158
null
12
5,539
I am working on a web application which supports file uploading. I am already familiar checking the size in server side, but i wanted to check the file size in a client side. I know its a browser limitation that we cant access the file properties for security reasons. So i have tried both swfupload and uploadify component. Both are good and serve the needs. But the limitation is both depends on flash, so if my end user not installed flash then i would end up in a problem. Asking them to install flash is another thing, but its a web portal and the user base is huge. So i don't like the idea of asking them to install flash. Today i came across file upload functionality in gmail. And tested this in browser(IE) without having flash installed. What i found was interesting. If you upload a big file, they made a postback and immediately returning the message the file size is too large. How this is possible, how they can find the size of the file without downloading the whole content.? I believe this must be done by reading HTTP header info. am i right? So this is the exact functionality i wanted to implement. If the flash is installed already, i can use uploadify to check the size otherwise may be i ll implement-the-never-heardof-technique-used-by-google. can someone recommend me how to do this? anybody faced the similar problems earlier, what have you done?? Gmail upload with flash installed in FF ![alt text](https://i.stack.imgur.com/5SRma.jpg) without flash in IE ![alt text](https://i.stack.imgur.com/CSro4.jpg)
Recommended way to check file size on upload
CC BY-SA 2.5
0
2010-11-17T12:18:20.527
2011-03-01T15:07:40.540
2010-11-17T13:34:25.603
97,572
97,572
[ "c#", "http", "file-upload", "web", "http-headers" ]
4,204,295
1
19,451,256
null
10
3,854
I have an Android TextView displaying some text, and it's multi-line. However, in the text, I sometimes have domain names; how can I stop the TextView from splitting the lines up on the periods in them? Is there a unicode non-breaking-period, for example? --- To see the issue in action in wrapping an email address, run `android create project --target 16 --path demo --package com.example.demo --activity MainActivity` and change the text in `res/layout/main.xml` to "`Hello World, MyActivity filler text + email [email protected]`". That produces this output on a Galaxy S3 (API level 16): ![Email wrapping](https://i.stack.imgur.com/hxIzQ.png) (Adjust text as appropriate to see wrapping on devices with other screen sizes. Notably, the wrapping is done correctly in Intellij's layout preview, it's only on the device that it's faulty.)
Stopping text from splitting to multiple lines on the periods in web addresses
CC BY-SA 3.0
0
2010-11-17T12:23:51.590
2016-01-08T13:37:26.547
2013-10-16T06:03:43.173
85,950
15,721
[ "android", "unicode", "textview", "word-wrap" ]
4,204,321
1
4,204,368
null
2
1,001
If I have a File `Default.html` in my project ![alt text](https://i.stack.imgur.com/3rCV7.jpg) How can I read it in code? I need the path # One Possible Solution `./Controls/MarkdownEditor/Templates/Default.html` works too. Also I set "Copy to output directory" to "Copy if newer"
C#: Reference Application Resource File
CC BY-SA 2.5
null
2010-11-17T12:26:44.950
2010-11-17T12:50:27.827
2010-11-17T12:50:27.827
292,291
292,291
[ "c#", "file", "path", "application-resource" ]
4,204,894
1
4,212,352
null
4
205
I'm trying to add a stikcy header to a listview. I've put the header-field and the listview inside a relativelayout and defined the listview's android:layout_below="@id/header". The problem is that I want the listview and the header to be positioned at the same place when the listview is not scrolled to the top. The header's background is transparent. I drew an amazing image in paint to illustrate how I want them to interact. ![Header and ListView](https://i.stack.imgur.com/Vzjo1.png) I figured I could override the listviews onscrollistener and change the listviews layout_below-tingy at runtime when it's getScrollY() == 0, but that seems to happen all the time. Has anyone done something similar that could point me in the right direction?
Any way of knowing when a listview has scrolled to top?
CC BY-SA 2.5
0
2010-11-17T13:37:40.770
2010-11-18T06:55:27.010
null
null
397,060
[ "android", "listview", "header" ]
4,205,407
1
4,274,018
null
0
523
I have a Google Map (API v2). It is located in [http://mydomain/maps](http://mydomain/maps). Under that address it works fine in every browser. I use it, however within a Thickbox (3.1) from the home site [http://mydomain](http://mydomain). That doesn't work in IE8 (but only in the IE8 mode; IE7 and IE8-compatibility work fine) - the output is as attached. No Javascript errors occur in the console. ![alt text](https://i.stack.imgur.com/tst4F.png)
Google Map doesn't load in Thickbox in IE8
CC BY-SA 2.5
null
2010-11-17T14:33:19.893
2010-11-25T05:29:35.647
null
null
298,858
[ "google-maps", "internet-explorer-8", "compatibility", "thickbox", "google-maps-api-2" ]
4,205,429
1
null
null
3
4,344
I created an adorner on a WPF line element, because there was neet to add some text. Now, when this line is moved, the adorner does not "follow" the line automatically. In fact, it does not refresh itsef: ![alt text](https://i.stack.imgur.com/FMIbC.jpg) ![alt text](https://i.stack.imgur.com/IWGyi.jpg) here black curves is the Control drawing, and the red "120 m" is the adorner one. Some code ``` void SegmentLine_Loaded(object sender, RoutedEventArgs e) { AdornerLayer aLayer = AdornerLayer.GetAdornerLayer(this); if (aLayer != null) { aLayer.Add(new TextAdorner(this)); } } class TextAdorner : Adorner { public TextAdorner(UIElement adornedElement) : base(adornedElement) { } protected override void OnRender(DrawingContext drawingContext) { SegmentLine segment = (this.AdornedElement as SegmentLine); if (segment != null) { Rect segmentBounds = new Rect(segment.DesiredSize); var midPoint = new Point( (segment.X1 + segment.X2) / 2.0, (segment.Y1 + segment.Y2) / 2.0); var lineFont = // get line font as Font FormattedText ft = new FormattedText( string.Format("{0} m", segment.Distance), Thread.CurrentThread.CurrentCulture, System.Windows.FlowDirection.LeftToRight, new Typeface(lineFont.FontFamily.ToString()), ligneFont.Size, Brushes.Red); drawingContext.DrawText(ft, midPoint); } } } ```
WPF Control moves but its Adorner - Not :"/
CC BY-SA 2.5
0
2010-11-17T14:34:57.707
2010-11-19T16:37:06.143
2010-11-17T19:23:27.880
185,593
185,593
[ "wpf", "wpf-controls", "adorner" ]
4,205,531
1
4,205,590
null
5
2,860
How can I create a ListBox control on my Winforms application that has images in an orderly fashion, just like it holds text? I'd like the images to appear like this: ![alt text](https://i.stack.imgur.com/BQlrP.png) Maybe I don't even need to use a ListBox. Maybe there's a better control out there for this purpose? Thanks!
Creating a ListBox of images?
CC BY-SA 2.5
null
2010-11-17T14:45:23.307
2011-08-21T23:13:56.380
2011-08-21T23:13:56.380
885,854
null
[ "c#", "winforms", "image", "listbox" ]
4,205,541
1
9,892,791
null
4
8,048
This was working correctly in Visual Studio 2008, but since I have switch to Visual Studio 2010 and Crystal Reports for Visual Studio 2010, my passed parameters are ignored. They display in the report, just ignored when it comes to the selection formula! Here is my code for creating the report and passing the parameters. ``` private void Prepare() { var reportDocument = new ReportDocument(); string reportPath = string.Format( "{0}\\{1}", Globals.FormPath, this.FormTemplate.Filename); reportDocument.Load(reportPath); ParameterDiscreteValue parameter; foreach (var control in this.FormTemplateFieldControls) { switch (control.FormTemplateField.DataType) { case FormFieldDataType.Date: this.AddParameterForDateTime( reportDocument, control.FormTemplateField.Name, (DateTime)control.EditValue); break; case FormFieldDataType.DateTime: this.AddParameterForDateTime( reportDocument, control.FormTemplateField.Name, (DateTime)control.EditValue); break; case FormFieldDataType.Time: this.AddParameterForDateTime( reportDocument, control.FormTemplateField.Name, (DateTime)control.EditValue); break; case FormFieldDataType.Guid: this.AddParameterForGuid( reportDocument, control.FormTemplateField.Name, (Guid)control.EditValue); break; default: this.AddParameterForString( reportDocument, control.FormTemplateField.Name, control.EditValue.ToString()); break; } } this.SetConnectionInfo(reportDocument); var frm = new FormViewer(); frm.Report = reportDocument; frm.ShowDialog(); frm.Dispose(); this.Close(); } ``` When I run the report from the designer it works just fine. You can see the parameters are being passed as I am displaying them in my report. ![alt text](https://i.stack.imgur.com/yoOHn.png) For my reports that run from stored procedures the parameters seem to pass just fine, it's just the ones composed of all tables. For what it's worth, here is my selection formula: ``` {employee.HireDate} >= {?StartDate} And {employee.HireDate} <= {?EndDate} ```
How to pass parameters to Crystal Report for Visual Studio 2010? Looks like they are ignored
CC BY-SA 3.0
0
2010-11-17T14:46:18.877
2016-06-06T06:22:33.913
2016-06-06T06:22:33.913
5,735,460
1,768
[ "c#", "visual-studio-2010", "crystal-reports", "crystal-reports-2010" ]
4,205,562
1
null
null
4
241
it's a secret message on a postcard. Please don't post the result, it would be nice if you could give a hint on how to find out what it is written in instead: ![image](https://dl.dropbox.com/u/1358257/hausaufgabe.jpg)
can anyone identify this programming language?
CC BY-SA 2.5
null
2010-11-17T14:49:12.807
2010-11-17T15:25:38.607
2017-02-08T14:30:59.223
-1
252,641
[ "programming-languages" ]
4,205,662
1
4,206,726
null
13
9,454
I have an `NSBezierPath` and I want to draw in inset shadow (similar to Photoshop) inside the path. Is there anyway to do this? Also, I know you can `-stroke` paths, but can you stroke inside a path (similar to Stroke Inside in Photoshop)? ## Update 3 ``` static NSImage * graydient = nil; if (!graydient) { graydient = [[NSImage alloc] initWithSize: NSMakeSize(22, 22)]; [graydient lockFocus]; NSGradient * gradient = [[NSGradient alloc] initWithColorsAndLocations: clr(@"#262729"), 0.0f, clr(@"#37383a"), 0.43f, clr(@"#37383a"), 1.0f, nil]; [gradient drawInRect: NSMakeRect(0, 4.179, 22, 13.578) angle: 90.0f]; [gradient release]; [graydient unlockFocus]; } NSColor * gcolor = [NSColor colorWithPatternImage: graydient]; [gcolor set]; NSShadow * shadow = [NSShadow new]; [shadow setShadowColor: [NSColor colorWithDeviceWhite: 1.0f alpha: 1.0f]]; [shadow setShadowBlurRadius: 0.0f]; [shadow setShadowOffset: NSMakeSize(0, 1)]; [shadow set]; [path fill]; [NSGraphicsContext saveGraphicsState]; [[path pathFromIntersectionWithPath: [NSBezierPath bezierPathWithRect: NSInsetRect([path bounds], 0.6, 0)]] setClip]; [gcolor set]; [shadow setShadowOffset: NSMakeSize(0, 1)]; [shadow setShadowColor: [NSColor blackColor]]; [shadow set]; [outer stroke]; [NSGraphicsContext restoreGraphicsState]; [NSGraphicsContext saveGraphicsState]; [[NSGraphicsContext currentContext] setCompositingOperation: NSCompositeSourceOut]; [shadow set]; [[NSColor whiteColor] set]; [inner fill]; [shadow set]; [inner fill]; [NSGraphicsContext restoreGraphicsState]; ``` ![Final Result](https://i.stack.imgur.com/lyn2J.png) This is my final result. It looks pretty good. I had to change the shadow to White @ 1.0 Alpha to make it work. Even though the shadow alpha norm for menu bar items is 0.5, it doesn't look half bad. Many thanks go out to [Joshua Nozzi](https://stackoverflow.com/users/201199/joshua-nozzi).
Draw an Inset NSShadow and Inset Stroke
CC BY-SA 2.5
0
2010-11-17T14:59:50.120
2014-02-24T06:52:48.417
2017-05-23T12:24:43.060
-1
205,895
[ "cocoa", "drawing", "photoshop", "shadow", "bezier" ]
4,205,697
1
4,205,796
null
0
213
My goal is to use to make it easy for non-programmers to execute a Python script with fairly complex options, on a single local machine that I have access to. I'd like to use the browser (specifically Safari on OS X) as a poor man's GUI. A short script would process the form data and then send it on to the main program(s). I have some basic examples of python scripts run using the built-in Apache server, by clicking submit on a form whose html is th: ![alt text](https://i.stack.imgur.com/Dy5hA.png) e.g. [here](http://telliott99.blogspot.com/2010/11/simple-server-running-python-script-on_17.html). What I want to do now is do it the server, just getting the form to invoke the script in the same directory. Do I have to learn javascript or ...? I'd be grateful for any leads you have. Thanks.
cgi scripts with no server
CC BY-SA 2.5
null
2010-11-17T15:03:38.843
2010-11-17T15:12:37.877
null
null
215,679
[ "python" ]
4,205,719
1
4,214,288
null
0
201
Ok I have a method that kicks off an object that deasl with data - a kind of factory. The factory splits data and sends the data that is split to custom objects that further process/refine the data. My problem is I log errors with an object that basically just appends the strings together into a log of error. Some errors are ok - meaning the flow of program can continue - however some are and therefore the process needs to terminate and I need to throw the error log back to the original method. And stop processing the data at that point or it could mess things up. The original method returns a string you see. I don't have to worry about how the method returns the error just need to get it to it. ![alt text](https://i.stack.imgur.com/zuFJG.jpg) Thanks
Disrupting the flow of a program if an error is caught?
CC BY-SA 2.5
0
2010-11-17T15:06:11.643
2010-11-18T11:33:42.403
2010-11-17T15:50:50.710
57,095
406,777
[ "java", "exception", "error-handling" ]
4,205,762
1
4,212,304
null
4
1,897
I have the following grid on an extJS page. What is the syntax to attach an onfocus or onclick event handler to a row so when the user clicks on a row I can call a function sending it the index of the row, or the row object itself? ![alt text](https://i.stack.imgur.com/QSADC.png) ``` var myData = [['Computer1', 29.89, 0.24, 0.81, '2010-11-17 08:31:12'], ['Computer2', 83.81, 0.28, 0.34, '2010-11-14 08:31:12'], ['Network1', 71.72, 0.02, 0.03, '2010-11-12 08:31:12'], ['Network2', 52.55, 0.01, 0.02, '2010-11-11 08:31:12'], ['Other', 29.01, 0.42, 1.47, '2010-11-04 08:31:12']]; var myReader = new Ext.data.ArrayReader({}, [{ name: 'object' }, { name: 'Number of Connections', type: 'float' }, { name: 'status', type: 'float' }, { name: 'rank', type: 'float' }, { name: 'lastChange', type: 'date', dateFormat: 'Y-m-d H:i:s' }]); var grid = new Ext.grid.GridPanel({ style: 'margin-top: 10px', store: new Ext.data.Store({ data: myData, reader: myReader }), columns: [{ header: 'Object', width: 120, sortable: true, dataIndex: 'object' }, { header: 'Status', width: 90, sortable: true, dataIndex: 'status' }, { header: 'Rank', width: 90, sortable: true, dataIndex: 'rank' }, { header: 'Last Updated', width: 120, sortable: true, renderer: Ext.util.Format.dateRenderer('Y-m-d H:i:s'), dataIndex: 'lastChange' }], viewConfig: { forceFit: true }, renderTo: 'content', title: 'Computer Information', width: 500, autoHeight: true, frame: true }); grid.getSelectionModel().selectFirstRow(); ```
How can I attach an onfocus event handler to a row in an extJS grid?
CC BY-SA 2.5
null
2010-11-17T15:10:15.567
2010-11-18T06:46:24.223
null
null
4,639
[ "extjs", "event-handling", "grid" ]
4,205,903
1
null
null
1
6,959
I have created a Package and i want to use the BPL File of my Package ... My Package have VCL.dcp and RTL.dcp as Required libraries , i load this Package in my application without any errors but when i want to unload it , an Access Violation shown ! If i Build my Application with Run-Time Packages ( "vcl" and "rtl" ) , Access Violation not shown ! ![alt text](https://i.stack.imgur.com/Nutzn.jpg) What is this mean ?! My Application need VCL and RTL Libraries to Load BPLs ?! I want to Load my Package like a DLL File , is there any solution ? I`m using Delphi 2010 thanks a lot ...
BPL File needs Run-Time Packages !
CC BY-SA 2.5
null
2010-11-17T15:22:18.693
2010-11-18T10:30:11.170
2010-11-17T15:45:32.707
420,972
420,972
[ "delphi", "delphi-2010", "package", "bpl" ]
4,205,946
1
null
null
3
5,203
I want to write a application in C# using WMI that can get and change Windows credential stored in the Windows Credential Manager, as you see in the picture below: ![Windows Credential manager](https://i.stack.imgur.com/BVeom.png)
How to Get and Change Windows Credential Username and Password
CC BY-SA 2.5
null
2010-11-17T15:25:38.540
2017-03-08T12:46:46.297
2011-03-26T10:23:15.600
53,236
510,945
[ "c#", "windows", "credentials" ]
4,205,950
1
4,207,000
null
2
422
I'm very new to Android and I have the following layout xml code: ``` <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:stretchColumns="1" android:background="#CCC"> <TableRow android:background="#333" android:padding="10px"> <Button android:text="Sign-up" android:id="@+id/signUp" android:layout_width="wrap_content" android:textSize="18px" android:layout_height="wrap_content" android:layout_gravity="left"> </Button> <Button android:text="About" android:id="@+id/about" android:layout_width="wrap_content" android:textSize="18px" android:layout_height="wrap_content" android:layout_gravity="right" android:gravity=""> </Button> </TableRow> </TableLayout> ``` This produces the following layout: ![alt text](https://i.stack.imgur.com/AJxlv.png) How can I nudge the rightmost button to the left?
Nudge a button to the left
CC BY-SA 3.0
null
2010-11-17T15:25:45.473
2016-11-09T19:39:24.870
2016-11-09T19:39:24.870
4,370,109
395,974
[ "android", "button", "android-tablelayout" ]
4,206,112
1
4,206,167
null
0
264
Could any one give the html code for the below table using rowspan and colspan ![alt text](https://i.stack.imgur.com/ghUSa.png) Many Thanks Hari Gillala
Table Format HTML
CC BY-SA 2.5
null
2010-11-17T15:41:18.233
2010-11-17T15:48:36.087
null
null
424,611
[ "html" ]
4,206,347
1
4,206,544
null
1
1,197
Here's screenshots: ![alt text](https://i.stack.imgur.com/pbzB2.png) ![alt text](https://i.stack.imgur.com/PHxW0.png) Here's the code I'm using to load the pictureBoxes to the Panel: ``` using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WebServiceScanner { public partial class MainForm : Form { int pictureYPosition = 8; public MainForm() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { LoadImageFromScanner(); } private void LoadImageFromScanner() { Image pic = Image.FromFile(@"C:\Users\Public\Pictures\Sample Pictures\Penguins.jpg"); PictureBox pictureHolder = new PictureBox(); pictureHolder.Image = pic; pictureHolder.SizeMode = PictureBoxSizeMode.StretchImage; pictureHolder.Size = new System.Drawing.Size(180, 250); pictureHolder.Location = new Point(13, pictureYPosition); panel1.Controls.Add(pictureHolder); pictureYPosition += 258; } } } ``` What could be causing the problem? The Panel has Autoscroll set to true, so maybe that's causing the issue? The pictures load absolutely FINE, if I don't touch the scrollbar and leave it in it's initial position (topmost). If I scroll down and add pictures it seems it has a different idea of where the point I'm giving it really is. Any suggestions?
Adding controls to the Panel works the first couple of times, then fritzes out
CC BY-SA 2.5
null
2010-11-17T16:00:20.793
2014-03-30T20:38:33.393
null
null
null
[ "c#", "winforms" ]
4,206,790
1
4,223,918
null
2
278
Consider a `upgrades` relationship: ![Incomplete order relationship](https://dl.dropbox.com/u/1164414/SO/upgrades.png) I need to make sure that `upgrades` cannot be circular. How can I do that in Alloy?
How can one express that a relationship must not be cyclic?
CC BY-SA 2.5
null
2010-11-17T16:38:13.353
2012-08-16T18:34:40.257
2017-02-08T14:30:59.573
-1
13,992
[ "alloy" ]
4,206,951
1
4,207,100
null
0
1,771
I have these 4 hashmaps and use them in code so I can show the comparison in an excel sheet. HashMap 1 - is with a key of unique id and value as another hashmap containing tagid as key and description of fields to compare. ``` [343, ((id_1,Plan Features),(a, Deductible),(b,Individual),(c,Family),(id_4,Individual Out-of-network),(id_2, Out-of-pocket Annual Maximum),(d,Individual),(e,Family),(u, Life Time Maximum))] ``` HashMap 2 - is with a key of unique id same as Hashmap 1 and value as another hashmap containing tagid as key and value of description used in Hashmap 1. ``` [343, ((id_1,""),(a, Calendar Year),(b,5000),(c,10000)(id_4,15000),(id_2,""),(d,5000),(e,10000),(u,"Unlimited"))] ``` Same is the case with HashMap 3 and HashMap 4 ``` [347, ((id_1,Plan Features),(a, Deductible),(b,Individual),(id_5, Individual Out-of-network),(c,Family),(id_4,Family Out-of-network),(id_2, Out-of-pocket Annual Maximum),(d,Individual),(e,Family),(u, Life Time Maximum))] [347, ((id_1,""),(a, Calendar Year),(b,7000),(id_5, 9000),(c,12000),(id_4,14000),(id_2, ""),(d,6000),(e,15000),(u, "Unlimited"))] ``` I want to show the comparison in an excel sheet by showing all descriptions in one column and respective values in another 2 columns. ![alt text](https://i.stack.imgur.com/N8b3j.jpg)
Comparing Hashmap to download data in excel
CC BY-SA 2.5
null
2010-11-17T16:54:11.910
2010-11-25T06:48:28.827
2010-11-17T19:31:21.913
203,018
203,018
[ "java", "excel", "hashmap" ]
4,206,983
1
4,207,891
null
14
2,424
I have an application that is very "connection-based", i.e. multiple inputs/outputs. The UI concept of a "cable" is exactly what I'm looking for to make the concept clear to the user. Propellerhead took a similar approach in their Reason software for audio components, illustrated in [this YouTube video (fast forward to 2m:50s)](http://www.youtube.com/watch?v=wj7b0esJB_o). I can make this concept work in GDI by painting a spline from point A to point B, there's got to be a more elegant way to use Paths or something in WPF for this, but where do you start? Is there a good way to simulate the animation of the cable swing when you grab it and shake it? I'm also open to control libraries (commercial or open source) if this wheel has already been invented for WPF. Thanks to the links in the answers so far, I'm almost there. ![alt text](https://i.stack.imgur.com/m0Rhq.jpg) I've created a `BezierCurve` programmatically, with Point 1 being `(0, 0)`, Point 2 being the bottom "hang" point, and Point 3 being wherever the mouse cursor is. I've created a `PointAnimation` for Point 2 with an `ElasticEase` easing function applied to it to give the "Swinging" effect (i.e., bouncing the middle point around a bit). Only problem is, the animation seems to run a little late. I'm starting the Storyboard each time the mouse moves, is there a better way to do this animation? My solution so far is located here: [Bezier Curve Playground](http://static.x9tech.com/Brandon/HangingCable/BezierCurvePlayground.zip) Code: ``` private Path _path = null; private BezierSegment _bs = null; private PathFigure _pFigure = null; private Storyboard _sb = null; private PointAnimation _paPoint2 = null; ElasticEase _eEase = null; private void cvCanvas_MouseMove(object sender, MouseEventArgs e) { var position = e.GetPosition(cvCanvas); AdjustPath(position.X, position.Y); } // basic idea: when mouse moves, call AdjustPath and draw line from (0,0) to mouse position with a "hang" in the middle private void AdjustPath(double x, double y) { if (_path == null) { _path = new Path(); _path.Stroke = new SolidColorBrush(Colors.Blue); _path.StrokeThickness = 2; cvCanvas.Children.Add(_path); _bs = new BezierSegment(new Point(0, 0), new Point(0, 0), new Point(0, 0), true); PathSegmentCollection psCollection = new PathSegmentCollection(); psCollection.Add(_bs); _pFigure = new PathFigure(); _pFigure.Segments = psCollection; _pFigure.StartPoint = new Point(0, 0); PathFigureCollection pfCollection = new PathFigureCollection(); pfCollection.Add(_pFigure); PathGeometry pathGeometry = new PathGeometry(); pathGeometry.Figures = pfCollection; _path.Data = pathGeometry; } double bottomOfCurveX = ((x / 2)); double bottomOfCurveY = (y + (x * 1.25)); _bs.Point3 = new Point(x, y); if (_sb == null) { _paPoint2 = new PointAnimation(); _paPoint2.From = _bs.Point2; _paPoint2.To = new Point(bottomOfCurveX, bottomOfCurveY); _paPoint2.Duration = new Duration(TimeSpan.FromMilliseconds(1000)); _eEase = new ElasticEase(); _paPoint2.EasingFunction = _eEase; _sb = new Storyboard(); Storyboard.SetTarget(_paPoint2, _path); Storyboard.SetTargetProperty(_paPoint2, new PropertyPath("Data.Figures[0].Segments[0].Point2")); _sb.Children.Add(_paPoint2); _sb.Begin(this); } _paPoint2.From = _bs.Point2; _paPoint2.To = new Point(bottomOfCurveX, bottomOfCurveY); _sb.Begin(this); } ```
How can I simulate a hanging cable in WPF?
CC BY-SA 3.0
0
2010-11-17T16:57:27.923
2011-07-20T21:34:36.557
2011-07-20T21:34:36.557
180,239
63,775
[ "c#", "wpf", "silverlight", "graphics", "gdi+" ]
4,207,562
1
null
null
27
39,017
I need to scale down images coming from a Network stream without losing quality. I am aware of this solution [Strange out of memory issue while loading an image to a Bitmap object](https://stackoverflow.com/questions/477572/android-strange-out-of-memory-issue) but it is too coarse - `inSampleSize` is an integer and does not allow finer control over the resulting dimensions. That is, I need to scale images to specific h/w dimensions (and keeping aspect ratio). I dont mind having a DIY bicubic/lancoz algorithm in my code but I cant find any examples that would work on Android as they all rely on Java2D (JavaSE). EDIT: Ive attached a quick source. The original is 720x402 HD screen capture. Please ignore the top 2 thumbnails. The top large image is resized automatically by android (as part of layout) to about 130x72. It is nice and crisp. The bottom image is resized with API and has severe artifacting ![alt text](https://i.stack.imgur.com/kp3he.png) I've also tried using the BitmapFactory and, as I said earlier, it has two problems - no way to scale to exact size and the scaled image is blurry. Any ideas on how to fix the artifcating? Thanks, S.O.! ``` package qp.test; import android.app.Activity; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Matrix; import android.os.Bundle; import android.widget.ImageView; public class imgview extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Bitmap original = BitmapFactory.decodeResource(getResources(), R.drawable.a000001570402); Bitmap resized = getResizedBitmap(original, 130); //Bitmap resized = getResizedBitmap2(original, 0.3f); System.err.println(resized.getWidth() + "x" + resized.getHeight()); ImageView image = (ImageView) findViewById(R.id.ImageViewFullManual); image.setImageBitmap(resized); } private Bitmap getResizedBitmap(Bitmap bm, int newWidth) { int width = bm.getWidth(); int height = bm.getHeight(); float aspect = (float)width / height; float scaleWidth = newWidth; float scaleHeight = scaleWidth / aspect; // yeah! // create a matrix for the manipulation Matrix matrix = new Matrix(); // resize the bit map matrix.postScale(scaleWidth / width, scaleHeight / height); // recreate the new Bitmap Bitmap resizedBitmap = Bitmap.createBitmap(bm, 0, 0, width, height, matrix, true); bm.recycle(); return resizedBitmap; } private Bitmap getResizedBitmap2(Bitmap bm, float scale) { /* float aspect = bm.getWidth() / bm.getHeight(); int scaleWidth = (int) (bm.getWidth() * scale); int scaleHeight = (int) (bm.getHeight() * scale); */ // original image is 720x402 and SampleSize=4 produces 180x102, which is // still too large BitmapFactory.Options bfo = new BitmapFactory.Options(); bfo.inSampleSize = 4; return BitmapFactory.decodeResource(getResources(), R.drawable.a000001570402, bfo); } } ``` And the layout ``` <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" > <!-- <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="hullo" android:background="#00ff00" /> --> <ImageView android:id="@+id/ImageViewThumbAuto" android:layout_width="130dip" android:layout_height="72dip" android:src="@drawable/a000001570402" /> <ImageView android:id="@+id/ImageViewThumbManual" android:layout_width="130dip" android:layout_height="72dip" android:src="@drawable/a000001570402" android:layout_toRightOf="@id/ImageViewThumbAuto" /> <ImageView android:id="@+id/ImageViewFullAuto" android:layout_width="300dip" android:layout_height="169dip" android:scaleType="fitXY" android:src="@drawable/a000001570402" android:layout_below="@id/ImageViewThumbAuto" /> <ImageView android:id="@+id/ImageViewFullManual" android:layout_width="300dip" android:layout_height="169dip" android:scaleType="fitXY" android:src="@drawable/a000001570402" android:layout_below="@id/ImageViewFullAuto" /> </RelativeLayout> ```
Android: high quality image resizing / scaling
CC BY-SA 2.5
0
2010-11-17T18:03:43.393
2017-03-06T10:28:19.237
2017-05-23T12:34:25.273
-1
450,741
[ "android", "algorithm", "image", "scaling" ]
4,207,580
1
4,219,369
null
2
1,396
I am working on a dashboard application where I would like to let the user resize the widgets on a canvas. Looking around, the best solution to me seemed to use Microsoft's ResizingAdorner class. The example can be found [here](http://msdn.microsoft.com/en-us/library/ms771714.aspx) and the code can be found [here](http://code.msdn.microsoft.com/wpfsamples) (About a quarter way down the page). Everything seemed to work until I clicked one of the widgets (chart controls from [ComponentOne](http://www.componentone.com/)). The bottom right [adorner](http://msdn.microsoft.com/en-us/library/ms743737.aspx#about_Adorners) and the top right [adorner](http://msdn.microsoft.com/en-us/library/ms743737.aspx#about_Adorners) seemed to appear about the width of the and height from the side of the canvas when ever moved. See example below : ![alt text](https://i.stack.imgur.com/Snog8.png) ![alt text](https://i.stack.imgur.com/kwsQe.png) I have been to the StackOverflow question [here](https://stackoverflow.com/questions/2834452/resizing-textbox-at-runtime-in-wpf) about using a grid splitter, but this will not work for me since controls will be overlapping grid columns. I also have been to a similar [question](https://stackoverflow.com/questions/771275/resizing-a-control-in-wpf), but the first [answer](https://stackoverflow.com/questions/771275/resizing-a-control-in-wpf/771361#771361) does not work at all, and the second [answer](https://stackoverflow.com/questions/771275/resizing-a-control-in-wpf/771360#771360) just merely points to a [blog](http://denisvuyka.wordpress.com/2007/10/15/wpf-simple-adorner-usage-with-drag-and-resize-operations/) where the gentleman either works for microsoft and created the ResizingAdorner class or just copied the code from the wpf samples site. I have also tried is revised code [here](http://denisvuyka.wordpress.com/2007/10/13/the-wpf-resizing-adorner-for-canvas/) but with no luck.
C# WPF Resizing issue
CC BY-SA 2.5
null
2010-11-17T18:06:01.633
2010-11-18T20:40:17.890
2017-05-23T12:30:36.930
-1
271,977
[ "c#", "wpf", "resize" ]
4,207,847
1
4,207,855
null
0
81
![alt text](https://i.stack.imgur.com/pvpAN.png) Sometimes, actually, it's lowercase. Other times, it has someone else's login. Like it'll be "jdoe" for some reason. Why does it change like that? This is my work computer, if that explains anything. Thanks!
Terminal commandline basics
CC BY-SA 2.5
null
2010-11-17T18:34:40.853
2010-11-17T18:35:44.790
null
null
177,541
[ "command-line", "terminal" ]
4,207,966
1
4,208,611
null
0
306
I would like to know if it's possible to remove red areas(on JProgressBar) on the following image. ![JProgressBar](https://i.stack.imgur.com/x2n4f.png) These are blue lines on the top and left side of the progress bar which I would like to remove. I have managed to remove it with paint() method, painting progress bar manually. But probably there is more correct way of doing it. Thanks, Serhiy.
Remove some layout elements from JProgressBar
CC BY-SA 2.5
null
2010-11-17T18:46:24.747
2010-11-17T20:00:57.270
null
null
168,233
[ "java", "jprogressbar" ]
4,207,958
1
4,208,207
null
8
4,045
For a current project, I needed a dropdown menu with color names (strings) with a small example square of the color next to it (image). So, I was able to design a custom ComboBox to achieve this. However, I'm having one problem....when I select an item from the list, the color example doesn't show up, only the name of the color does. (See examples below) Expanded Menu: ![alt text](https://i.stack.imgur.com/2a47V.jpg) After item is chosen: ![alt text](https://i.stack.imgur.com/mHQrS.jpg) In order to draw the colors next to the strings to begin with, I used: ``` // Draws the items into the ColorSelector object protected override void OnDrawItem(DrawItemEventArgs e) { e.DrawBackground(); e.DrawFocusRectangle(); DropDownItem item = (DropDownItem)Items[e.Index]; // Draw the colored 16 x 16 square e.Graphics.DrawImage(item.Image, e.Bounds.Left, e.Bounds.Top); // Draw the value (in this case, the color name) e.Graphics.DrawString(item.Value, e.Font, new SolidBrush(e.ForeColor), e.Bounds.Left + item.Image.Width, e.Bounds.Top + 2); base.OnDrawItem(e); } ``` Where a DropDownItem contained the image and the string to be drawn. So...does anyone know what I need to override or what I need to do in order to get the ComboBox to draw the image and the string both, just like it already does when the list is expanded, when an item is selected? Thanks a lot; Cheers!
Drawing Images within a Custom ComboBox
CC BY-SA 2.5
0
2010-11-17T18:45:57.240
2012-04-23T11:39:26.017
2020-06-20T09:12:55.060
-1
397,985
[ "c#", "image", "user-controls", "combobox", "drawing" ]
4,208,184
1
4,208,220
null
1
2,773
I want to create layout like this on facebook app. Тo appear with effect from bottom to top. I don't know where to find example (xml and code) for this Thanks ![alt text](https://i.stack.imgur.com/dYlZK.jpg)
Android floating layout with buttons
CC BY-SA 2.5
0
2010-11-17T19:13:22.203
2010-11-17T19:43:09.940
2020-06-20T09:12:55.060
-1
432,848
[ "android" ]
4,208,231
1
4,208,272
null
24
14,630
Sometimes (but not always!?) when I paste or end a line with a semi-colon, Visual Studio will add a space after the `if` statement! For example, when pasting, this ``` if() ``` will turn into this: ``` if (condition) ``` and, when completing a line, this ``` if(condition) DoSomething() ``` will turn into this: ``` if (condition) DoSomething(); ``` Having to constantly delete this space (sometimes twice!) is driving me absolutely It seems to happen with `if` and `while` but not `for`. I cannot find anything relating to this in the VS options. I do have Resharper installed, but it is set to not add the space automatically: ![(image of my resharper settings)](https://i.stack.imgur.com/npujN.png)
Visual Studio adding space after if-statements
CC BY-SA 2.5
0
2010-11-17T19:19:29.637
2023-01-24T22:18:23.560
null
null
238,419
[ "c#", "visual-studio-2008", "formatting", "resharper" ]
4,208,317
1
4,209,313
null
0
2,725
I am using the Wordpress plugin, [Audio Player](http://wordpress.org/extend/plugins/audio-player/). While it displays perfectly in a Full Post after clicking on "Read More...", it displays `[Audio clip: view full post to listen]` in the Excerpt Preview. I imagine it is because of Wordpress stripping Shortcodes, but I'm not entirely sure. For the website I am creating, I the Audio Player to show up on the Category & Home Page. Feedback is appreciated. --- ![Excerpt](https://i.stack.imgur.com/CBqys.png) --- ![Full Post](https://i.stack.imgur.com/ogGpL.png) ---
How to display Audio Player in Post Excerpt?
CC BY-SA 2.5
null
2010-11-17T19:28:21.590
2015-08-28T21:04:27.687
2010-11-22T16:22:59.493
313,758
480,763
[ "wordpress" ]
4,208,438
1
4,209,264
null
0
263
![alt text](https://i.stack.imgur.com/tJB9E.jpg) I have modified the structure of d xml file. i want to edit value of visible
I want to edit xml file
CC BY-SA 2.5
0
2010-11-17T19:42:32.377
2010-11-23T15:03:55.960
2010-11-17T20:14:59.297
428,747
428,747
[ "c#", "asp.net", "xml", "xmlreader", "xmltextwriter" ]
4,208,456
1
4,208,575
null
0
6,280
Is it possible to show TGA thumbnails in OpenFileDialog? When using the System.Windows.Controls.OpenFileDialog control to browse image folders Windows 7, it will show preview thumbnails icons for JPG, PNG, or BMP image files. Unfortunately, Windows does show previews for TGA files. However, Windows show TGA preview thumbnails in Windows . Is there an extension or setting that will show TGA thumbnails in OpenFileDialog? OpenFileDialog shows thumbnails for JPG files: ![OpenFileDialog with JPGs](https://i.stack.imgur.com/ajy90.png) OpenFileDialog does NOT show TGA thumbnails: ![OpenFileDialog with JPGs](https://i.stack.imgur.com/i5b30.png) However, Explorer DOES show TGA thumbnails: ![OpenFileDialog with JPGs](https://i.stack.imgur.com/Qu4Pf.png)
How does one display thumbnail images for TGA files with OpenFileDialog?
CC BY-SA 2.5
null
2010-11-17T19:44:07.323
2012-12-01T20:37:01.387
null
null
70,578
[ "winforms", "windows-7", "thumbnails", "preview", "openfiledialog" ]
4,208,795
1
4,210,230
null
4
1,504
I need to create an extension method for a `GraphicsPath` object that determines if the `GraphicsPath` is wound clockwise or counter-clockwise. Something like this: ``` public static bool IsClockwise(GraphicsPath gp) { bool bClockWise = false; PointF[] pts = gp.PathPoints; foreach (PointF pt in pts) { //?? } return bClockWise; } ``` Note: I just assume that we'd need a `foreach` on the points in the `GraphicsPath` here, but if there is a better way, please feel free to offer. The reason for this is because the `FillMode` of the `GraphicsPath` determines if overlapping sections of adjacent GraphicsPaths are 'filled' (`Winding`) or 'holes' (`Alternate`). However, this is only true if the adjacent GraphicsPaths are wound in the same direction. ![Fillmode Winding vs Alternate](https://i.stack.imgur.com/RFXiv.gif) If the two paths are wound in opposing directions, even setting the `FillMode` to `Winding` results in the (unwanted) holes. Interestingly enough, the GraphicsPath DOES have a `.Reverse()` method that allows one to change the direction of the path (and this DOES solve the problem), but it is impossible to know WHEN the GraphicsPath needs to be .Reversed without knowing the direction of the path. Can you help out with this extension method?
GraphicsPath.IsClockWise() Extension Method
CC BY-SA 2.5
0
2010-11-17T20:21:17.893
2010-11-18T17:24:47.103
null
null
494,219
[ "c#", "algorithm", "methods", "graphicspath" ]
4,209,198
1
4,209,249
null
0
114
My entity model was generated from the existing database. There is a many-to-many junction table picked up and hidden by EF. ![](https://imgur.com/dLuSu.png) The relationship is definitely working because this query returns 2 users as expected. ``` public IQueryable<User> FindUsersByGroupID(int group_id) { return db.Users.Where(u => u.Groups.Any(g => g.Group_ID == group_id)); } ``` But when locating a user that is part of the above result set the Groups navigation property count is 0. I shouldn't have to explicitly join.. right? ``` public User FindUserByID(int id) { return db.Users.First(u => u.User_ID == id); } ``` ![](https://imgur.com/00Vmp.png)
EF1 navigation properties not working?
CC BY-SA 2.5
null
2010-11-17T21:10:16.733
2010-11-17T21:16:24.523
null
null
390,407
[ "asp.net", "entity-framework", ".net-3.5" ]
4,209,360
1
4,216,620
null
3
3,422
I'm solving the following problem: I have an object and I know its position now and its position 300ms ago. I assume the object is moving. I have a point to which I want the object to get. What I need is to get the angle from my current object to the destination point in such a format that I know whether to turn left or right. The idea is to assume the current angle from the last known position and the current position. I'm trying to solve this in MATLAB. I've tried using several variations with `atan2` but either I get the wrong angle in some situations (like when my object is going in circles) or I get the wrong angle in all situations. Examples of code that screws up: ``` a = new - old; b = dest - new; alpha = atan2(a(2) - b(2), a(1) - b(1); ``` where `new` is the current position (eg. `x = 40; y = 60; new = [x y];`), `old` is the 300ms old position and `dest` is the destination point. ## Edit Here's a picture to demonstrate the problem with a few examples: ![Illustration of the problem](https://i.stack.imgur.com/bf3UT.png) In the above image there are a few points plotted and annotated. The black line indicates our estimated current facing of the object. If the destination point is `dest1` I would expect an angle of about 88°. If the destination point is `dest2` I would expect an angle of about 110°. If the destination point is `dest3` I would expect an angle of about -80°.
How can I correctly calculate the direction for a moving object?
CC BY-SA 2.5
0
2010-11-17T21:30:26.520
2011-01-08T08:43:15.840
2010-12-31T06:42:49.777
52,738
333,786
[ "matlab", "trigonometry" ]
4,209,383
1
4,209,401
null
17
3,755
I have an image prepared with transparency, like this: ![alt text](https://i.stack.imgur.com/A1DZq.png) With two UIviews, I configure the background colors as so: ``` self.view.backgroundColor = [UIColor groupTableViewBackgroundColor]; self.dashedView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"red_square.png"]]; ``` I expect the red square to be repeated over the UIView with transparency preserved, but it's been filled by a solid color like this: ![alt text](https://i.stack.imgur.com/qAe92.png) I don't understand why. Is there a simple way to draw a tiled image with transparency? Or do I need to look at drawing Core Graphics patterns?
How to preserve image transparency when using colorWithPatternImage:
CC BY-SA 2.5
0
2010-11-17T21:33:09.667
2012-05-18T18:38:32.777
null
null
27,606
[ "iphone", "objective-c", "uiview" ]
4,209,490
1
4,209,694
null
12
22,382
I've inherited an ASP.NET web site that has an SSL certificate bought via GoDaddy. The problem is that the certificate seems to be invalid because of some "mixed content/resources" (I think that's how its called) coming from http sites. Chrome is showing the red cross over the lock next to https, meaning it's unsecured. The popups says the following: ![alt text](https://i.stack.imgur.com/KOzhi.jpg) Click in "What do these mean?" goes [here](http://www.google.com/support/chrome/bin/answer.py?hl=en&answer=95617) which says: > The [crossed-lock] icon appears when Google Chrome detects high-risk mixed content, such as JavaScript, on the page or when the site presents an invalid certificate. The certificate is correct and valid because I tried creating a blank "Hi world" .aspx page and it's showing the green lock with no problems. Reading a little bit, I found that I should only include images and javascript coming from https sites. The only thing it had coming from http was the addthis widget, but [they support https](http://www.addthis.com/help/ssl), so I changed to https, but it's still saying that is unsecured. I've searched for anything else coming from http in the source, but didn't find anything. I've never dealt with SSL/HTTPS certificates, but I need to fix this issue asap.
How to identify mixed content in https website
CC BY-SA 2.5
0
2010-11-17T21:48:26.527
2018-04-01T16:22:08.703
null
null
105,937
[ "security", "resources", "web", "https", "ssl-certificate" ]
4,209,555
1
4,209,869
null
0
5,591
Basically, I have multiple widgets I'm trying to switch between... and the default is a QTabWidget. Aside from some modification, the two examples (QStackedWidget and QTabsExapmle) are just mingled together. I can't get the "connect" portion to work (get an error: no matching function for call to QTabsExample::connect), and nothing displays on screen unless `stackedWidget->addWidget(tabWidget)` is the first in the list (and even then, I only see the view in the upper left hand corner). QTabsExample.h ``` #ifndef QTABSEXAMPLE_H #define QTABSEXAMPLE_H #include <QtGui/QMainWindow> #include <QtGui/QScrollArea> #include <QtGui/QFrame> #include <QtGui/QVBoxLayout> #include <QtGui/QPushButton> #include <QtGui/QLabel> #include <QtGui/QLineEdit> #include <QtGui/QGroupBox> #include <QtGui/QFormLayout> #include <QtGui/QMessageBox> #include <QtCore/QPointer> #include <QtCore/QFile> #include <QtCore/QIODevice> #include <QtCore/QList> #include <QtCore/QMap> #include <QtCore/QString> #include <QtXml/QXmlStreamReader> #include <QtDebug> #include <QBool> #include <QSignalMapper> #include <QStackedLayout> class QTabsExample: public QMainWindow { Q_OBJECT public: QTabsExample(QWidget *parent = 0); ~QTabsExample(); private: void buildTabMenuBar(int index); public slots: void activeTabChanged(int index); void setCurrentIndex(int); signals: void activated(int); private: QTabWidget* tabWidget; QWidget* customWidget1; QWidget* customWidget2; QWidget* customWidget3; }; // --------------------------------------------------------------------------- // QMyWidget - Tab1 // class QMyWidget: public QWidget { Q_OBJECT public: QMyWidget(QWidget *parent = 0); ~QMyWidget(); public slots: void runOnTabSelect(); private: QPointer<QVBoxLayout> _layout; }; // --------------------------------------------------------------------------- // QMyWidget2 - Tab2 // class QMyWidget2: public QWidget { Q_OBJECT public: QMyWidget2(QWidget *parent = 0); ~QMyWidget2(); public slots: void runOnTabSelect(); }; // --------------------------------------------------------------------------- // QMyWidget3 - Tab3 // class QMyWidget3: public QWidget { Q_OBJECT public: QMyWidget3(QWidget *parent = 0); ~QMyWidget3(); public slots: void runOnTabSelect(); private: QPointer<QVBoxLayout> _layout; }; #endif // QTABSEXAMPLE_H ``` QTabsExample.cpp ``` #include <QtGui> #include <QApplication> #include "QTabsExample.h" QTabsExample::QTabsExample(QWidget *parent) : QMainWindow(parent) { setContextMenuPolicy(Qt::NoContextMenu); this->setWindowTitle("Main Window, I think"); QStackedLayout *stackedLayout = new QStackedLayout; //create tab widget QTabWidget *tabWidget = new QTabWidget(); tabWidget->setContextMenuPolicy(Qt::NoContextMenu); QObject::connect(tabWidget, SIGNAL(currentChanged(int)),this, SLOT(activeTabChanged(int))); QMyWidget* widget1 = new QMyWidget(); tabWidget->addTab(widget1, "Tab1"); QMyWidget2* widget2 = new QMyWidget2(); tabWidget->addTab(widget2, "Tab2"); QMyWidget3* widget3 = new QMyWidget3(); tabWidget->addTab(widget3, "Tab3"); //set programatically tabWidget->setStyleSheet("QTabBar::tab { height: 70px; width: 80px; font-size: 15px;}"); //create other widgets QWidget* customWidget1 = new QWidget; QWidget* customWidget2 = new QWidget; QWidget* customWidget3 = new QWidget; //add layouts to widgets customWidget1->setContextMenuPolicy(Qt::NoContextMenu); customWidget2->setContextMenuPolicy(Qt::NoContextMenu); customWidget3->setContextMenuPolicy(Qt::NoContextMenu); customWidget1->setWindowTitle("Widget 1"); customWidget2->setWindowTitle("Widget 2"); customWidget3->setWindowTitle("Widget 3"); //insert content to make sure it's viewable QPalette palette; palette.setBrush(this->backgroundRole(), QBrush(QImage("c://default.png"))); customWidget1->setPalette(palette); palette.setBrush(this->backgroundRole(), QBrush(QImage("c://default2.png"))); customWidget2->setPalette(palette); palette.setBrush(this->backgroundRole(), QBrush(QImage("c://default3.png"))); customWidget3->setPalette(palette); //add widgets to stack stackedLayout->addWidget(tabWidget); stackedLayout->addWidget(customWidget1); stackedLayout->addWidget(customWidget2); stackedLayout->addWidget(customWidget3); QComboBox *pageComboBox = new QComboBox; pageComboBox->addItem(tr("Tab Page")); pageComboBox->addItem(tr("page 2")); pageComboBox->addItem(tr("page 3")); pageComboBox->addItem(tr("page 4")); connect(pageComboBox, SIGNAL(activated(int))), stackedLayout, SLOT(setCurrentIndex(int)); QVBoxLayout *_layout = new QVBoxLayout; _layout->addWidget(pageComboBox); _layout->addLayout(stackedLayout); setLayout(_layout); //setCentralWidget(tabWidget); #ifdef Q_OS_SYMBIAN QWidgetList widgets = QApplication::allWidgets(); QWidget* w = 0; foreach(w,widgets) { w->setContextMenuPolicy(Qt::NoContextMenu); } #endif } QTabsExample::~QTabsExample(){ } void QTabsExample::activeTabChanged(int index) { buildTabMenuBar(index); } void QTabsExample::buildTabMenuBar(int index) { QMenuBar* menubar = menuBar(); menubar->clear(); switch (index) { case 0: { menubar->addAction("", tabWidget->widget(index), SLOT(runOnTabSelect())); break; } case 1: { menubar->addAction("", tabWidget->widget(index), SLOT(runOnTabSelect())); break; } case 2: { menubar->addAction("", tabWidget->widget(index), SLOT(runOnTabSelect())); break; } default: { break; } }; } //tab1 QMyWidget::QMyWidget(QWidget *parent) : QWidget(parent) { setContextMenuPolicy(Qt::NoContextMenu); QVBoxLayout* _layout = new QVBoxLayout(this); //buttons get created this->setLayout(_layout); } QMyWidget::~QMyWidget() { } void QMyWidget::runOnTabSelect() { } //tab2 QMyWidget2::QMyWidget2(QWidget *parent) : QWidget(parent) { setContextMenuPolicy(Qt::NoContextMenu); QVBoxLayout* _layout = new QVBoxLayout(this); //buttons get created this->setLayout(_layout); } QMyWidget2::~QMyWidget2() { } void QMyWidget2::runOnTabSelect() { } //tab3 QMyWidget3::QMyWidget3(QWidget *parent) : QWidget(parent) { setContextMenuPolicy(Qt::NoContextMenu); QVBoxLayout* _layout = new QVBoxLayout(this); //buttons get created this->setLayout(_layout); } QMyWidget3::~QMyWidget3() { } void QMyWidget3::runOnTabSelect() { } ``` main.cpp ``` #include "QTabsExample.h"" #include <QtGui> #include <QApplication> #include <QtGui/QApplication> #include <QPixmap> #include <QWidget> #include <QMainWindow> #include <QSplashScreen> int main(int argc, char *argv[]) { QApplication a(argc, argv); QTabsExample w; w.showMaximized(); return a.exec(); } ``` ![What I see when I run the app](https://i.stack.imgur.com/vdVzf.png)
Qt - QStackedWidget and QTabsExample help
CC BY-SA 2.5
null
2010-11-17T21:56:46.383
2010-11-18T19:24:52.243
2010-11-18T18:44:39.920
null
null
[ "c++", "qt", "qt4" ]
4,209,767
1
null
null
2
617
I'm working on a project where I need to render diagrams in the browser similar to this: ![alt text](https://i.stack.imgur.com/2AkDT.jpg) I've looked at a number of organisational charting tools such as the [Google Visualisations Organisation Chart](http://code.google.com/apis/visualization/documentation/gallery/orgchart.html) but none of them seem to let me change the orientation. The nodes shown in the diagram above don't have to be icons, in fact I'd prefer to work with just plain old boxes where I can inject a snippet of HTML (in the same way you can do with the Google Visualisations Organisation Chart). It would also be useful to be able to highlight a specific path through the chart, as the green lines in the example above do. Does such a library exist?
Is there a Javascript library that allows me to draw organisation charts left to right?
CC BY-SA 2.5
null
2010-11-17T22:22:20.537
2010-11-18T19:24:04.690
2010-11-18T11:21:20.723
419
419
[ "javascript", "html", "charts" ]
4,209,791
1
4,211,307
null
146
68,104
I have read the other stackoverflow threads regarding . I understand the intent of each pattern. However, I am not clear on the definition. > Factory Method defines an interface for creating an object, but lets subclasses decide which of those to instantiate. A factory method lets classes defer instantiation to subclasses.By contrast, an Abstract Factory provides an interface for creating families of related or dependent objects without specifying their concrete classes. -[John Feminella](https://stackoverflow.com/a/1001803/45112) The looks very similar to the . I have drawn a few UML classes to illustrate my point. Note: - - ![Factory Method](https://i.stack.imgur.com/69jJo.jpg) ![Abstract Factory (only 1 member)](https://i.stack.imgur.com/BQOzX.jpg7866ef51) ![alt text](https://i.stack.imgur.com/yMP7a.jpg) 1. If the Abstract Factory has only one creator and one product, is it still the Abstract Factory pattern? (an interface for creating familes) 2. Can the Factory Method concrete creator be created from an Interface or does it have to be from a class? (classes defer instantiations to subclasses) 3. If the Abstract Factory can have only one creator and one product, is the only difference between the Abstract Factory and the Factory Method that the creator for the former is an Interface and the creator for the latter is a Class?
Design Patterns: Abstract Factory vs Factory Method
CC BY-SA 4.0
0
2010-11-17T22:25:07.523
2021-09-30T07:04:49.447
2019-12-03T16:23:42.747
45,112
null
[ "design-patterns", "language-agnostic", "uml", "factory-method", "abstract-factory" ]
4,209,835
1
4,210,027
null
1
483
How can I make the selection color (blue here) stop at the end of the filename instead of going all the way to the edge of the `ListView`? I put the orange background on the item `StackPanel` to show that it is not because it fills the whole width which I first thought. ``` <Expander Header="Project"> <Expander.Resources> <DataTemplate x:Key="IconTextItemTemplate"> <StackPanel Orientation="Horizontal" Background="Orange"> <Image Source="{Binding icon}"/> <TextBlock Text="{Binding text}"/> </StackPanel> </DataTemplate> </Expander.Resources> <ListView ItemTemplate="{StaticResource IconTextItemTemplate}"/> </Expander> ``` ![alt text](https://i.stack.imgur.com/BbZkP.png)
How to limit selection background color to item width in WPF ListView?
CC BY-SA 2.5
null
2010-11-17T22:30:34.430
2010-11-18T05:35:26.563
2010-11-18T05:35:26.563
228,755
212,865
[ "listview", "width", "selection", "listviewitem", "wpf-4.0" ]
4,209,897
1
null
null
3
1,159
I am getting a very frequented error ( as I could find from web) but none of the solutions have helped me I am deploying ASP.NET MVC 2 Project with Target Framework as 4.0 on IIS 6 . Thanks to [Phil Haack](http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx) I was able to configure IIS 6 to recognize URL Routes but now I am facing another issue![alt text](https://i.stack.imgur.com/YJnpL.jpg) I have made sure of the following: - Web service extension has 4.0.30319 enabled/ Allowed- Have created a separate Application pool for this website - My website has been configured with correct ASP.NET Version 4.0.30319- .aspx is mapped to right verion : c:\windows\microsoft.net\framework\v4.0.30319\aspnet_isapi.dll- Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053 What I think is interesting is that (ans as you can see in the screenshot) the page seems to indicate that the website is using Please help me get around this issue. Thank you, Mar
ASP.NET MVC 2, .NET 4 IIS 6 and Unrecognized attribute 'targetFramework'
CC BY-SA 2.5
0
2010-11-17T22:38:51.090
2010-11-18T21:36:25.813
null
null
148,819
[ "asp.net-mvc-2", "deployment" ]
4,210,480
1
4,216,221
null
13
9,390
Suppose I have a DataGrid that is defined like this ``` <DataGrid AreRowDetailsFrozen="True" ItemsSource="{Binding MyCollection}" AutoGenerateColumns="False"> <DataGrid.RowDetailsTemplate> <DataTemplate> <Border CornerRadius="5" BorderBrush="Red" BorderThickness="2" Background="Black"> <TextBlock Foreground="White" Text="{Binding RowDetails}" TextWrapping="Wrap"/> </Border> </DataTemplate> </DataGrid.RowDetailsTemplate> <DataGrid.Columns> <DataGridTextColumn Header="0" Binding="{Binding Value1}"/> <DataGridTextColumn Header="1" Binding="{Binding Value2}"/> <DataGridTextColumn Header="2" Binding="{Binding Value3}"/> <DataGridTextColumn Header="3" Binding="{Binding Value4}"/> </DataGrid.Columns> </DataGrid> ``` And looks like this with and without RowDetails ![alt text](https://i.stack.imgur.com/zfkop.png) In the picture to the right I get a very long DataGridRow that never wraps. Is it possible to get the RowDetails to use the same width as the DataGrid and not effect the Width itself? Things I have tried that achieves wrapping but not in a satisfying way - -
DataGrid RowDetails Width problem
CC BY-SA 3.0
0
2010-11-18T00:05:30.273
2015-05-18T11:41:51.920
2011-08-30T05:59:24.070
318,425
318,425
[ "wpf", "datagrid", "wpfdatagrid", "rowdetails" ]
4,210,717
1
4,211,960
null
2
754
I am having an issue applying a transform to a UIImageView's layer. Using the code below, I am trying to rotate this needle, but I am getting duplicate copies drawn. I have checked that there is no other place where the needle image is added, and commenting out the `addSubview` makes neither one show up, so it is definitely drawing twice. The needle on the left is in the position that the image view should be started at, `-20`. The needle on the right works in the aspect that it rotates and displays the correct value for the `needleValue`. What am I doing wrong to get duplicate draws? ![alt text](https://i.stack.imgur.com/GxrC0.png) ``` - (UIImageView *)needle { if (_needle == nil) { UIImage *image = [UIImage imageNamed:@"needle.png"]; self.needle = [[[UIImageView alloc] initWithImage:image] autorelease]; [_needle sizeToFit]; [_needle setFrame:CGRectMake(floor((self.width - _needle.width)/2), self.height - _needle.height + 68, // this - offset comes from the lowering of the numbers on the meter _needle.width, _needle.height)]; _needle.contentMode = UIViewContentModeCenter; _needle.autoresizingMask = UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin; _needle.autoresizesSubviews = YES; // CALayer's transform property is a CATransform3D. // rotate around a vector (x, y, z) = (0, 0, 1) where positive Z points // out of the device's screen. _needle.layer.anchorPoint = CGPointMake(0.05,1); [self addSubview:_needle]; } return _needle; } - (void)updateNeedle { [UIView beginAnimations:nil context:NULL]; // arguments are optional [UIView setAnimationDuration:VU_METER_FREQUENCY]; CGFloat radAngle = [self radianAngleForValue:needleValue]; self.needle.transform = CGAffineTransformMakeRotation(radAngle); [UIView commitAnimations]; } ```
Duplicate layers drawn with a UIImageView and CGAffinetransform
CC BY-SA 2.5
0
2010-11-18T01:04:23.123
2010-11-18T05:29:23.080
2010-11-18T01:37:08.393
69,634
69,634
[ "iphone", "animation", "uiview", "transform", "cgaffinetransform" ]
4,211,204
1
null
null
1
2,835
I have a JLabel with a box icon on it. I create the icon's image in photoshop. It's a png-24 image with the background full erased. But when moved on top of a dark background, you can see that the background isn't fully transparent: ![image](https://i.stack.imgur.com/anUsJ.png) --- EDIT #2: The image IS transparent. I've even gone through photoshop tutorials to make sure I'm creating a transparent image the correct way. The problem seems to be with Java (and JLabels).
Java - JLabel background isn't fully transparent?
CC BY-SA 3.0
0
2010-11-18T02:45:04.897
2011-12-04T00:13:51.163
2011-12-04T00:13:51.163
84,042
505,544
[ "java", "image", "transparency", "transparent", "jlabel" ]
4,211,683
1
8,741,434
null
13
2,962
I suspect there's probably an easy answer to this I'm just not seeing, but whenever I run a TeamCity build with either MSBuild or the Visual Studio solution runner against a .csproj and target "Package", the build artifacts always include the "csproj.teamcity.patch" string after the project name: ![alt text](https://i.stack.imgur.com/vS5Cl.png) Running the same process via command line doesn't include these. The problem it's causing me is that my build script has a target which looks for "Web.deploy.cmd" after the package task runs and obviously it's not finding it when files are named this way. I'm reticent to change the command in the build script to include the TeamCity string as it will play havoc with running it from outside the build servers. Can anyone tell me why this is happening and how you'd work around it when you need to be able to refer to the artifacts by name?
Why does TeamCity add "csproj.teamcity.patch" to web app package files?
CC BY-SA 2.5
0
2010-11-18T04:27:42.723
2013-05-03T14:01:44.090
null
null
73,948
[ "msbuild", "teamcity" ]
4,211,694
1
4,211,840
null
0
909
![alt text](https://i.stack.imgur.com/uaA02.gif)Hi All, I am binding the SSN value to the grid using ASP.net which i am getting from the SQL database. I have used the below code to format the SSN. But i could not get the specified format. Please help me to find out the solution.
Bind SSN to telerik grid in formatted way XXX-XX-XXXX instead of XXXXXXXXX
CC BY-SA 2.5
null
2010-11-18T04:31:41.750
2010-11-18T05:04:35.167
2010-11-18T04:34:00.283
231,317
231,317
[ "asp.net", "format", "itemtemplate" ]
4,211,751
1
4,899,004
null
0
399
I'm modifying "Randy Drisgill" blank master page template( publishing ) . I've added a combo box like, ![alt text](https://i.stack.imgur.com/Mfk9f.png) When I preview on web , everything looks fine as below, ![alt text](https://i.stack.imgur.com/YR9by.png) But I noticed upload document form is getting the same combo box header , ![alt text](https://i.stack.imgur.com/k8SZI.png) Am I missing something ?
SharePoint master page problem
CC BY-SA 2.5
null
2010-11-18T04:44:21.827
2011-02-04T14:20:02.137
2010-11-19T07:14:23.357
263,357
263,357
[ "sharepoint-2010", "sharepoint-designer" ]
4,212,157
1
null
null
1
120
Greetings to all, I am trying to implement in app purchases and still finding difficulty to get it working..since i get invalid product identifiers as response. In this case, i am having a doubt, in the iTunes to get it working on in app purchases, i have created a paid app contract but i have not provided any bank information or tax related information - Pls Refer the image.. Do i need to provide bank and tax related information for getting the valid product identifiers on iTunes connect ... Kindly guide me out and thanks for your time ![alt text](https://i.stack.imgur.com/wI7b1.png)
Help on iTunes Connect
CC BY-SA 2.5
null
2010-11-18T06:19:06.040
2010-11-29T00:09:05.177
2010-11-18T08:24:41.540
352,627
352,627
[ "iphone", "iphone-sdk-3.0" ]
4,212,220
1
4,215,558
null
0
429
![alt text](https://i.stack.imgur.com/2R1GN.jpg) Using XQuery: List the id, name, publisher and platforms for each game that is supported by more than one platform. Platforms should be enclosed in one XML tag delimited by a comma. I am getting problem in thinking that how do i count the patforms. The platforms that I need to count is given like in the above figure. Playstation3,XBox are the patlforms for one game. Outside the box, under it, that format of data is given.Please help me in it.
Xquery problem in counting
CC BY-SA 2.5
null
2010-11-18T06:32:31.837
2010-11-28T09:50:12.407
2010-11-28T09:50:12.407
23,354
507,087
[ "xquery" ]
4,212,247
1
null
null
0
73
So I am just wondering what it means for a foreign key relationship. I have two tables. Courses and Schools. One school can have many courses. So does the following relationship make sense? ![alt text](https://i.stack.imgur.com/oONEQ.png) ![alt text](https://i.stack.imgur.com/6tdxr.png)
does this very simple relationship make sense?
CC BY-SA 2.5
null
2010-11-18T06:37:53.840
2010-11-18T07:22:01.847
null
null
50,312
[ "foreign-key-relationship" ]
4,212,305
1
null
null
0
38
So I am working on a project. Very small to learn ASP MVC 2. Currently I am working on my computer and for my db I am using a sql server database file (mdf). When I host this online, the server will probably have sql server full version. So my question is can I use LINQ to SQL ORM designer to design my database? Add my "properties" and such and it should automatically create the table in whatever database its connected too. for example check the following picture. I want the test table to automatically make the table in whatever database I am using. ![alt text](https://i.stack.imgur.com/2hTUp.png)
so what is a db repository
CC BY-SA 2.5
null
2010-11-18T06:46:26.653
2010-11-18T17:30:21.423
null
null
50,312
[ "linq-to-sql" ]
4,212,314
1
4,213,977
null
1
1,413
I tried to install the Google App Engine plugin in Eclipse (Version 3.6 Helios) via `Install New Software...`, but the download never finished because it kept timing out. I then tried to install the plugin via the "dropin" method as described [in this answer](https://stackoverflow.com/questions/4202592/how-to-increase-download-timeout-setting-in-eclipse-3-6-helios/4202692#4202692). No success. I think the GAE plugin was partially installed by my initial attempts, so Eclipse no longer accepts the dropin method. The Google plugin shows up under installed items, but it doesn't look too healthy: ![](https://imgur.com/7Yayi.png) My best option seems to uninstall the GAE plugin and start over using the dropin approach, but how can I do this? Any other solutions? This is on Windows XP. Thanks!
How to fix an Eclipse 3.6 plugin installation?
CC BY-SA 2.5
null
2010-11-18T06:48:39.157
2012-02-12T10:35:21.743
2017-05-23T12:19:43.823
-1
67,063
[ "java", "eclipse", "google-app-engine", "eclipse-plugin", "gae-eclipse-plugin" ]
4,212,568
1
4,213,628
null
3
6,439
I am a total beginner in WPF. I would like to bind the following `DataSet` containing nodes and relations to a `TreeView`. The dataset is: ``` internal static DataSet getData() { DataTable dt = new DataTable("data"); dt.Columns.Add("Id", typeof(int)); dt.Columns.Add("ParentId", typeof(int)); dt.Columns.Add("NodeDescription"); dt.Rows.Add(1, null, "Employees"); dt.Rows.Add(2, null, "Cars"); dt.Rows.Add(3, 1, "Men"); dt.Rows.Add(4, 1, "Women"); dt.Rows.Add(5, 2, "BMW"); dt.Rows.Add(6, 2, "Lexus"); dt.Rows.Add(7, 3, "Adam Kowalski"); dt.Rows.Add(8, 3, "Dawid Nowacki"); dt.Rows.Add(9, 4, "Ilona Wacek"); DataSet ds = new DataSet(); ds.Tables.Add(dt); //add a relationship ds.Relations.Add("rsParentChild" ,ds.Tables["data"].Columns["Id"] ,ds.Tables["data"].Columns["ParentId"]); return ds; } ``` I would like to have: ![alt text](https://i.stack.imgur.com/TnY1c.png) Now I achieve this by resursive retrieveing all datatable and ading nodes to the treeview. However, I hope there is a direct `XAML` binding. I'd like to add that the dataset will be dynamically changing and there might many nesting levels. Thanks.
WPF how to bind self-referential dataset to a treeview
CC BY-SA 2.5
null
2010-11-18T07:34:31.967
2010-11-18T10:08:20.783
2010-11-18T07:54:32.200
318,425
428,789
[ "c#", "wpf", "treeview", "dataset" ]
4,212,636
1
null
null
0
803
I have some problems 1. how do I make my statusbar context menu that consists of 2 choices of menu preferences and addons status example of context menu i want to make ![alt text](https://i.stack.imgur.com/P0nCg.png) this is my code : ``` <popupset> <menupopup id="intransContextMenu"> <menuitem label="intrans aktif"/> <menuitem label="preferensi"/> </menupopup> </popupset> <statusbar id="status-bar"> <image src="chrome://inlinetrans/skin/imagesOn_kecil.png" /> <statusbarpanel id="status-bar-intrans" label="intrans" context="intransContextMenu" onclick="alert('okeh cuy')" tooltiptext="intrans versi 1.0" /> </statusbar> ``` 1. how to add images in the context menu? I have tried but why do I paste a picture that always appears under the label is not on the side of the label as I expected? example of context menu i want to make ![alt text](https://i.stack.imgur.com/Zmebi.png) this is my code : ``` <popup id="contentAreaContextMenu"> <image src="chrome://inlinetrans/skin/imagesOn_kecil.png" /> <menuitem class="inlinetrans" id="inlineContext" oncommand= "hadits_mean.startFind(null);" label="Cari Terjemahan"/> </popup> ``` whether the code used to display the menu by right clicking on the statusbar and allows web pages to be made in one file? thank you for the answer..
how to create context menu in statusbar?
CC BY-SA 2.5
0
2010-11-18T07:45:46.987
2010-11-18T10:33:37.707
null
null
495,688
[ "firefox-addon", "xul" ]
4,212,736
1
4,213,216
null
-1
1,038
I'm developing an app in c# that uses directinput... in my dev pc, that there's installed directx sdk everything works fine... but in another pc that have only directx client installed, the app didn't work.. I added into the folder the dll: - I need to add someother to let's play??? thanks in advance! the error is this: ![alt text](https://i.stack.imgur.com/Pr6d6.jpg) Is not an application WIn32 valid (Exception from HRESULT: 0x800700C1) this happens here: ``` // Find all the GameControl devices that are attached. DeviceList gameControllerList = Manager.GetDevices(DeviceClass.GameControl, EnumDevicesFlags.AttachedOnly); ```
directinput dll problem
CC BY-SA 2.5
0
2010-11-18T08:03:42.407
2010-11-18T09:18:54.630
2010-11-18T08:23:47.270
349,045
349,045
[ "c#", "directx", "directinput" ]
4,213,155
1
4,219,710
null
0
1,718
I'm using Measurement Studio. I need to use the `DAQmx Timing VI` functionality in my C# application. How to do this. Please Help me. The VIs are here ![alt text](https://i.stack.imgur.com/jClTj.jpg) ![alt text](https://i.stack.imgur.com/AwEmh.jpg) ![alt text](https://i.stack.imgur.com/oP7ao.jpg)
How to use DAQmx Timing (Sample Clock ) in C#.Net
CC BY-SA 2.5
null
2010-11-18T09:11:40.530
2013-03-21T15:04:34.573
2011-02-26T15:28:26.393
11,343
336,940
[ "c#", "labview", "nidaqmx", "measurement-studio" ]
4,213,710
1
4,213,852
null
4
4,511
I know xcode don't have radio Button so I try to add a custom button and make it action like a radio button This is the image I use ![alt text](https://i.stack.imgur.com/V1M6H.png) ![alt text](https://i.stack.imgur.com/C2jN9.png) and this is the code I set to cell ``` UIButton *but = [UIButton buttonWithType:UIButtonTypeCustom]; [but setImage:[UIImage imageNamed:@"radio-off.png"] forState:UIControlStateNormal]; [but setImage:[UIImage imageNamed:@"radio-on.png"] forState:UIControlStateSelected]; [but setFrame:CGRectMake(0, 0, 44, 44)]; [but addTarget:self action:@selector(radioButton:) forControlEvents:UIControlEventTouchUpInside]; cell.accessoryView= but; ``` and this is the problem I want to ask is how can I give a void in `- (IBAction)radioButton:(UIButton *)button` To control Two Radio Button in Two Rows If Row 1 Radio button's selected is YES btn in row 2 will be `btn.state=NO` and won't response the `- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath` It will be like this pic ![alt text](https://i.stack.imgur.com/mT1RF.png) How to set the if conditions in `- (IBAction)radioButton:(UIButton *)button` this pic is fake...I only add the button in the cell...and changed the text color Great Thanks to all stack overflow friends~
Add Radio Button in Tableview Got Some Problem
CC BY-SA 2.5
0
2010-11-18T10:16:58.487
2010-11-19T12:59:05.173
2010-11-19T12:59:05.173
106,435
437,132
[ "iphone", "cocoa-touch", "uitableview", "radio-button" ]
4,213,778
1
4,213,814
null
0
603
I want to find out how to shear images in IOS 4.0. I have an image. The output should look like the following image... ![alt text](https://i.stack.imgur.com/tk85m.png) I have seen the Affine transform [method specified here](http://iphonedevelopment.blogspot.com/2008/10/cgaffinetransform-11-little-more.html). But couldnt solve my problem. It would be of great help of i can find any solution or tutorials to my problem.
How to shear images in iphone
CC BY-SA 2.5
null
2010-11-18T10:27:17.677
2010-11-18T10:30:50.230
null
null
303,155
[ "iphone", "ios4" ]