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,034,168
1
4,035,665
null
1
186
Im currently evaluating Drupal to see if we can use it to replace our framework. My problem is I have this legacy tables which I would want to try to reflect in Drupal. It involves a join table. There's quite a lot of this kind of relationship in our existing web app so I am looking for possible ways to solve it. ![alt text](https://i.stack.imgur.com/Nmw1K.png) Thank you for your insight!
How do I do this in Drupal?
CC BY-SA 2.5
0
2010-10-27T14:09:47.943
2011-09-17T19:18:17.323
null
null
258,219
[ "drupal", "drupal-6" ]
4,034,303
1
4,257,800
null
2
976
I have a button. The button is constructed from the StateListDrawable (made of 3 9-patch images). I need to add an extra drawable that will reside on the button's right side, and i need it to be aligned with the button's right side. I tried to use the following: ``` <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/blue_back_button_drawable" /> <item> <bitmap android:src="@drawable/filter_by_button_v_mark" android:gravity="right"/> </item> </layer-list> ``` it didn't work and the V image is indeed aligned right but it has a diff from the button's right side. here's a snapshot: ![alt text](https://i.stack.imgur.com/UktI0.png) I want the image to be aligned with the button's left, the only way right now i think i can do it is: 1. inherit button, in onLayout AFTER the width has been set get the right edge. 2. get the background drawable (layerDrawable) 3. calc the button's width minus the v image width and set it as left margin in the drawable. I should not mention this sounds horrid :-) i hoped there's a better way. Oh the reason it's not part of the image is that i need to know it's width so i can calc the text padding so it wont be hidden by the button's text and because it's not so nice looking as a 9-patch.
Android Layer_Drawable as a button
CC BY-SA 2.5
0
2010-10-27T14:24:06.490
2010-11-23T15:38:44.983
null
null
312,288
[ "android", "image", "alignment", "drawable" ]
4,034,919
1
null
null
4
7,698
I'm working on a photography website. One of the things we're trying to aim for is a 'film strip' type of display for the images, as opposed to the usual thumbnail or 'tabulated' formation. It works with tables. No problemo. The only thing that makes me not want to use a table is the fact that I'm not showing data, there's no need for columns and rows. Another thing that is a slight spanner in the gears is the fact that I'm putting the images as backgrounds of divs. This is for basic 'copy protection', and also so I can overlay items over the photo on hover of the div. The way I've got it coded at the moment is: ``` container [ [image] [image] [image] [image] ] ``` I've drawn a skitch to help out with the visualisation of this.. ![alt text](https://i.stack.imgur.com/3LCui.png) As soon as the width of the container is met, the image-divs are dropping to the next line. The CSS for the Divs is as follows: ``` .gallery_block_image_p { width: 354px; height: 532px; display: inline-block; margin: 0px; padding: 0px; margin-left: 10px; float: left; background-repeat: no-repeat; } ``` and for the container... ``` #gallery { border: 0px solid black; position: relative; top: 99px; /* width: 8000px; */ /* When this is uncommented it works, with a huge amount of space to the right */ height: 532px; z-index: 99; } ``` and last but not least, the HTML used for the image divs... ``` <div id="gallery_1_0_img" class="gallery_block_image_p" style="background-image: url(gallery_img/ith/adamd_20101021_137.jpg);"></div> ```
Align DIVs horizontally within a scrolling div
CC BY-SA 2.5
0
2010-10-27T15:29:00.303
2010-10-28T03:48:57.263
null
null
379,619
[ "html", "css" ]
4,035,099
1
4,035,116
null
0
498
I have a blog of code written such as this: ``` <div class="box"> <div class="statusbox"> <div class="cleft">some stuff</div> <div class="cright">some more stuff</div> </div> </div> ``` and this is the CSS code for it: ``` .box{padding:10px; border: 1px black solid;width: inherit;} .statusbox{border-bottom: 2px #736f6e solid;} .cleft{float:left;width:84%;vertical-align:middle;min-height:50px;margin-right:10px;padding-top: 5px;} .cright{float:right;width:15%;text-align:right;vertical-align:middle;min-height:50px;padding-top: 5px;} ``` The issue I'm having is that the structure is not obeyed in terms of the CSS layout. Whilst `cleft` and `cright` show correctly, they are not being embedded within `statusbox` and `box`. `box` and `statusbox` just clump up together, just above the "some stuff". Here's an image of what I'm currently getting: ![alt text](https://i.stack.imgur.com/EN32a.png)
CSS class not inheriting
CC BY-SA 2.5
0
2010-10-27T15:49:35.817
2010-10-27T15:52:07.317
null
null
114,865
[ "html", "css" ]
4,035,211
1
null
null
0
546
I have code to rotate and size a scrollview, such that when the iPhone is landscape the orientation is correct. This is what the view looks like before rotating: ![alt text](https://i.stack.imgur.com/HRMGY.png) The scroll view is in yellow. This is what it looks like after: ![alt text](https://i.stack.imgur.com/E7MQE.png) This is the log statement i put after setting the new frame for the scroll view, and you can see that it is clearly not what it says its supposed to be! ``` CGRect for object after setting to new: UIScrollView, {{0, 100}, {480, 150}} [UIView animateWithDuration:kAnimationDuration animations:^{ CGRect boundsRect = anObject.frame; boundsRect.origin.x = x; boundsRect.origin.y = y; boundsRect.size.width = width; boundsRect.size.height = height; anObject.frame = boundsRect; NSLog(@"CGRect for object after setting to new: %@, %@",[anObject class], NSStringFromCGRect(anObject.frame)); } completion:^ (BOOL finished){ if (finished) { [UIView animateWithDuration:kAnimationDuration animations:^{ anObject.alpha = 1.0; }]; } }]; ``` What am i missing? Thanks
UIScrollView does not resize correctly
CC BY-SA 2.5
null
2010-10-27T16:02:18.803
2010-10-27T16:15:35.940
null
null
222,217
[ "iphone", "objective-c", "uiview", "uiviewcontroller", "ios4" ]
4,035,715
1
4,035,745
null
6
3,981
Basically, I have a client that wants a breadcrumb trail implemented in the navigation bar. I realize Apple doesn't recommend this behavior, but the app I'm building is for internal use only and won't be submitted to the App Store. I need something along the lines of what AirVideo uses in their iPad App. Are there any navigation controllers that provide this functionality or any other code available? ![alt text](https://i.stack.imgur.com/8BKkn.jpg)
iOS Navigation Breadcrumb Trail
CC BY-SA 2.5
0
2010-10-27T17:01:50.920
2016-01-05T12:23:18.933
2010-10-27T19:06:59.017
324,464
324,464
[ "iphone", "ipad", "ios" ]
4,035,713
1
4,044,766
null
2
167
The description below is heavily simplified - it's only one part of a bigger problem that we are tackling but the innards can be safely left out for this question. Suppose we have the following models: - ``` class Item(models.Model): name = models.CharField(max_length=150) value = models.DecimalField(max_digits=12,decimal_places=2) class Person(models.Model): name = models.CharField(max_length=150) items = models.ManyToManyField(Item, through='AssignedItem') class AssignedItem(models.Model): person = models.ForeignKey(Person) item = models.ForeignKey(Item) value = models.DecimalField(max_digits=12,decimal_places=2) ``` So basically a person may be assigned zero, one, or more items and each assigned item's value may be overridden for a particular person by specifying the new value in the `through` model. What we are aiming to achieve is an html table which has the `Item.name` as its header row, with one extra column in that header row for `Person.name`. Each `Person` may have a different set of `Person.items` assigned to them so it is expected that if a `Person` has not been assigned an `Item`, the corresponding cell for that `Person` will be blank (). ![alt text](https://i.stack.imgur.com/t1vDN.png) The question is how to place the correct AssignedItem value in the corresponding column. We have a Queryset of Items that we are looping over in the template to create the header row, and then we have a list of lists containing each person's items. But how do we ensure that the correct AssignedItem is displayed under the corresponding Item header?
Handling presentation logic in Django templates
CC BY-SA 2.5
0
2010-10-27T17:01:28.003
2010-10-28T16:03:25.550
null
null
46,928
[ "django", "django-templates" ]
4,035,767
1
null
null
19
39,502
Is it possible to have add a row to an SSRS 2008 Matrix that spans all of the matrix's columns? This crude diagram shows roughly what I'm looking for: ![visual example of the matrix layout I'm looking for](https://i.stack.imgur.com/d35IA.png) The basic idea is that each line item is a person, and each column is a field in a form for that person. The fields themselves are dynamic (and implemented as column groups on the matrix). Additional column groups are included to append non-dynamic form fields, like the time the record was entered and who entered it. Under each person's record is a comments field, which should span all of the form fields above it. At the moment I have the matrix embedded in another tablix, with the name and fields in the matrix and the comments in the parent tablix. This works for the data (each instance of the matrix ends up being one row), but the header repeats too often (once per person) because it's attached to the matrix. The only thought I have as to how to fix this is to create another matrix in the parent tablix with the same grouping and use it to display the headers... But this will require quite a lot of manual synchronization to keep the two matrices the same. The key problem here is making the second row span .
Is it possible to create a row that spans all columns of a Matrix in SSRS 2008?
CC BY-SA 2.5
0
2010-10-27T17:07:51.103
2020-03-12T16:31:06.650
2010-11-09T16:57:12.453
16,911
16,911
[ "ssrs-2008", "reporting-services", "ssrs-grouping", "ssrs-tablix" ]
4,036,081
1
4,036,493
null
9
9,189
I already know how to create shortcuts programmatically from my C# applications using `IWshRuntimeLibrary` and `WshShellClass`. Or I could use `IShellLink`. Now, if the user's PC is running Windows Vista or Windows 7, I would like to be able to set the property of that shortcut programmactically as well. ![alt text](https://i.stack.imgur.com/jcOrQ.png)
Create shortcuts programmatically from C# and set "Run as administrator" property
CC BY-SA 2.5
0
2010-10-27T17:46:18.867
2022-11-01T21:58:58.720
null
null
287,311
[ "c#", "windows-7", "uac", "shortcut" ]
4,036,398
1
4,037,281
null
40
13,907
I want to create a reusable component (a custom control) for the iPhone. It consists of several standard controls prearranged on a View, and then some associated code. My goals are: 1. I want to be able to use Interface Builder to lay out the subviews in my custom control; 2. I want to somehow package the whole thing up so that I can then fairly easily drag and drop the resulting custom component into other Views, without having to manually rewire a bunch of outlets and so on. (A little manual rewiring is fine, I just don't want to do tons and tons of it.) Let me be more concrete, and tell you specifically what my control is supposed to do. In my app, I sometimes need to hit a web service to validate data that the user has entered. While waiting for a reply from the web service, I want to display a spinner (an activity indicator). If the web services replies with a success code, I want to display a "success" checkmark. If the web service replies with an error code, I want to display an error icon and an error message. The single-use way to do this is pretty easy: I just create a UIView that contains a UIActivityIndicatorView, two UIImages (one for the success icon and one for the error icon), and a UILabel for the error message. Here's a screenshot, with the relevant parts marked in red: ![alt text](https://i.stack.imgur.com/oMHsv.png) I then wire up the pieces to outlets, and I put some code in my controller. But how do I package up those pieces -- the code and the little collection of views -- so that I can reuse them? Here are a few things I found that get me partway there, but aren't that great: - - - `WebServiceValidatorController``WebServiceValidatorController` I have a feeling I'm missing something obvious...
iPhone: Create a reusable component (control) that has some Interface Builder pieces and some code
CC BY-SA 2.5
0
2010-10-27T18:22:20.147
2011-01-31T16:09:36.847
null
null
179,675
[ "iphone", "xcode", "interface-builder" ]
4,036,761
1
null
null
0
1,900
See below - the tableView cells are getting cut off. Why doesn't this work? The width of the popover is 240. (In a subclass of UITableViewController) ``` - (void)viewDidLoad { [super viewDidLoad]; self.tableView.frame = CGRectMake(0,0,200,200); } ``` ![alt text](https://i.stack.imgur.com/d2nqq.png)
UITableView width when inside a popover
CC BY-SA 2.5
null
2010-10-27T19:11:32.243
2012-11-09T07:13:14.660
null
null
426,860
[ "uitableview", "ipod", "uipopovercontroller" ]
4,036,990
1
4,053,458
null
35
10,706
I have a GridView in my Android application that has a number of ImageViews in it. The space on my screen is limited and I want the images to take up as much of the available space as they can. Unfortunately, the GridView always leaves 5 pixels of empty screen space around the outside edge of the ImageViews (the space between ImageViews is set with horizontal/vertical spacing and behaves correctly). The empty space acts kind of like a margin around the ImageViews, but I can't get rid of it. Does anyone know what's causing this "border" and how I can get rid of it (or at least make it smaller)? Thanks. Update: I'm creating the ImageViews by inflating an .xml file in the getView() method of my Adapter class. Here's the xml I'm inflating: ``` <ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:background="#FF00FF" /> ``` I defined the GridView in my layout xml file like this: ``` <GridView android:id="@+id/mygrid" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_above="@+id/abutton" android:layout_marginBottom="8dp" android:numColumns="5" android:background="#FF0000"/> ``` Here's a screen shot of the problem. The red area in my GridView. The purple areas are my ImageViews. The image being displayed is a simple blue rectangle with a transparent center. The image is 45x45 pixels (but is only 30x30 pixels in my app - I'll worry about that later). The red border around the purple is what I am trying to eliminate. ![alt text](https://i.stack.imgur.com/6ZxDA.png)
Why are there extra pixels around my Android GridView?
CC BY-SA 2.5
0
2010-10-27T19:35:32.823
2013-10-25T13:55:47.293
2010-10-28T20:39:52.393
65,180
65,180
[ "android", "gridview", "imageview" ]
4,037,535
1
4,038,201
null
1
1,660
I have set up some database connection parameters on an OpenDS ldap server, using my own schema. It looks as the attached screenshot. ![](https://farm2.static.flickr.com/1179/5121645838_563d9f3c23_b.jpg) when I try to query the LDAP using following URL, it fails. `ldap://localhost/db-configname=local1,ou=eways,dc=repository,dc=com?db-serverName?sub` I have LDAPAdmin that automatically opens LDAP URLs and it says such an object was not found. Can someone please let me know what exactly is the LDAP URL to refer to one of the attributes such as `db-password` or `db-serverName` shown below?
LDAP Query URL - how to refer an attribute?
CC BY-SA 2.5
null
2010-10-27T20:41:49.213
2010-10-28T19:54:01.473
2017-02-08T14:30:43.350
-1
212,211
[ "java", "url", "ldap" ]
4,037,657
1
4,038,004
null
1
3,372
Currently my ListView is filling up with the given String[] but I wanted to alternate some styles on the ListView items. Something weird is happening (I'm surely missing something obvious); The ListView Index is not fixed and the styles are not alternating as supposed. My Code is the following: ``` package com.blah.blah; import android.app.ListActivity; import android.content.Context; import android.graphics.Color; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.TextView; public class Help extends ListActivity { public class CustommAdapter<E> extends ArrayAdapter<E>{ public CustommAdapter(Context context, int textViewResourceId, E[] objects) { super(context, textViewResourceId, objects); } public View getView(int position, View convertView, ViewGroup parent){ if(convertView == null){ LayoutInflater inflater = (LayoutInflater) getBaseContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = inflater.inflate(R.layout.help_item, null); } if(convertView != null){ TextView tvfila = (TextView) convertView.findViewById(R.id.tvfila); if(position % 2 == 0){ convertView.setBackgroundColor(Color.LTGRAY); tvfila.setTextColor(Color.BLACK); } } return super.getView(position, convertView, parent); } @Override public boolean areAllItemsEnabled() { return false; } @Override public boolean isEnabled(int position) { if(position % 2 == 0){ return false; }else{ return true; } } } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); String[] questions = getResources().getStringArray(R.array.help_questions); String[] answers = getResources().getStringArray(R.array.help_answers); String[] DATA = new String[questions.length + answers.length]; int dataindex = 0; for (int i = 0; i < questions.length; i++){ DATA[dataindex] = questions[i]; dataindex++; DATA[dataindex] = answers[i]; dataindex++; } setListAdapter(new CustommAdapter<String>(this, R.layout.help_item, DATA)); ListView lv = getListView(); lv.setTextFilterEnabled(true); } } ``` The question is: NOTES: Both StringArrays from resources are of the same size. The help_item.xml contains only a TextView Images that show the problem: The expected behavior ![Expected behavior](https://i.stack.imgur.com/xGjgD.png) . . The result of this code ![alt text](https://i.stack.imgur.com/XPWnl.png)
Alternating styles on ListView using extended ArrayAdapter<E> random results
CC BY-SA 2.5
0
2010-10-27T20:56:23.543
2010-10-27T21:50:46.403
null
null
356,828
[ "android", "listview", "styling", "android-arrayadapter" ]
4,037,795
1
4,038,195
null
288
160,884
Is there an easy way to add padding between the checkbox in a CheckBox control, and the associated text? I cannot just add leading spaces, because my label is multi-line. As-is, the text is way too close to the checkbox: ![alt text](https://i.stack.imgur.com/1uKaG.jpg)
Android - Spacing between CheckBox and text
CC BY-SA 2.5
0
2010-10-27T21:14:36.927
2021-11-01T11:26:32.693
null
null
205,192
[ "android", "checkbox", "padding" ]
4,038,138
1
null
null
1
1,527
I'd like to develop simple 2d games on linux. Something like one below. The only decent tecnology I've found was PyGame. Is there any other worth taking a look? Is there a possibility to develop flash games on linux? Thanks in advance. ![alt text](https://i.stack.imgur.com/FI2ea.gif)
simple game development on linux
CC BY-SA 2.5
null
2010-10-27T22:12:28.000
2011-06-15T02:34:01.810
null
null
282,307
[ "linux", "pygame" ]
4,038,470
1
5,597,029
null
3
658
Given a Classpath Container I've written as a plugin/extension, how do I add it to the classpath, automatically? Ok so I'm an experienced Java Developer but extremely new to writing Eclipse Plugins. I've been googling, following tutorials and reading source code of other plugins for a couple days. I know exactly what I want to do but not exactly how to do it. Right now, in Eclipse, when I click a resource and choose "Run as JUnit test" as in: --- ![for some reason, my pics don't work anymore. I'll fix this soon...](https://i.stack.imgur.com/NLJHS.png) --- Behind the scenes, the m2eclipse plugin somehow generates a run configuration that contains the "Maven Dependencies" classpath container, like the following: ![alt text](https://i.stack.imgur.com/WYYgA.gif) My best guess is that the "Maven Dependencies" classpath container is added through some extension point being used by the M2Eclipse plugin. Similarly, I want to add my classpath container, automatically, whenever a user runs a JUnit test--so it shows up under "User Entries." What extension point(s) can I use to make something like that happen? I've been looking at but I'm not sure that's going to do what I need. --- Ideally, I'd like to write a plugin that takes every entry in the project's build path and adds it to the classpath of a run configuration (whenever a new launch configuration is created via: ). This should be the default behavior of Eclipse but it's not! My next-best solution would be to simply add my custom classpath container to the run configuration's build path, automatically. At the end of the day, I just want one classpath for any java code our team runs/launches. This shouldn't be so hard! Any advise on how to achieve any of this would be appreciated! Even basic pointers on where to look to understand how particular Extension Points are intended to be used (the basic JavaDocs APIs are terrible). Thanks, -
Eclipse Extension Point for Updating the Classpath
CC BY-SA 3.0
null
2010-10-27T23:12:09.883
2011-04-12T13:53:51.040
2011-04-12T13:53:51.040
178,433
178,433
[ "eclipse", "eclipse-plugin", "m2eclipse", "eclipse-jdt" ]
4,039,041
1
12,713,114
null
6
2,783
Webkit allows the use of an external SVG file as a mask for any HTML element. Ie: ``` <img src="kate.png" style="-webkit-mask-image: url(circle.svg)"> ``` Resulting in: ![](https://webkit.org/blog-files/kate-circle.png) (More information here: [http://webkit.org/blog/181/css-masks/](http://webkit.org/blog/181/css-masks/)) Does anyone know if there's a way to do it without an external SVG file? More specifically, can it be done with SVG generated from javascript?
Is it possible to use webkit css masks with SVG without an external file?
CC BY-SA 2.5
0
2010-10-28T01:30:42.493
2012-10-03T16:48:36.467
2017-02-08T14:30:44.413
-1
188,729
[ "javascript", "css", "webkit", "svg" ]
4,039,219
1
4,039,327
null
1
2,243
Let's say you have a website where the body's background color is red and a content area with a white background that is 1,000 pixels wide. Now let's say you want a drop shadow on the content area that is darkest at the juncture of the content area and the red background, and gets less opaque as it goes off the the left on the left side and the right on the right side. It basically looks like this: ![sideways shadow](https://i.stack.imgur.com/nxjK3.png) So my strategy is to make the background color of the body red and grab only the shadow in photoshop with a width of ~47px and a height of 1px. My question is: How do I go about inserting that onto my website such that the browser's horizontal scroll bar only shows up when it's reached 1,000 pixels and not when it's reached 1,000 + 47 + 47 (the width of the content area plus the width of the two shadows). I'm sure this is a common question, but I really suck at phrasing these things. Thanks! : sorry for the lack of code. That's not usually my style. So here we go: : ``` <div id="mainwrapper"> <div id="left_shadow"></div> <div id="right_shadow"></div> </div> ``` : ``` #mainwrapper { width:1000px; height:100%; margin-left:auto; margin-right:auto; background-color:#e8e8e8; position:relative; } #left_shadow { position:absolute; top:0; bottom:0; left:-47px; width:47px; background:url(/images/leftshadow.png) repeat-y; } #right_shadow { position:absolute; top:0; bottom:0; right:-47px; width:47px; background:url(/images/rightshadow.png) repeat-y; } ``` With this setup, if I shrink the browser window down to 1,095 pixels, it doesn't have a horizontal scroll bar. If I shrink it to 1,094px, it has a horizontal scroll bar because it's recognize those absolutely positioned shadows as part of the content area. My question is: how do I make it so that the scroll bar only shows up when it hits the gray center (at 1,000px)? Thanks again, guys.
Making a div that sits outside the content area but doesn't cause the horizontal scroll bar to appear when browser window is shrunk
CC BY-SA 2.5
0
2010-10-28T02:16:27.887
2011-04-17T13:41:55.433
2010-10-28T02:48:59.367
385,950
385,950
[ "css" ]
4,039,229
1
4,041,286
null
41
17,474
For a personal project, I'd need to find out if two cubic Bézier curves intersect. I don't need to know where: I just need to know if they do. However, I'd need to do it fast. I've been scavenging the place and I found several resources. Mostly, there's [this question here](https://stackoverflow.com/questions/109364/bezier-clipping) that had a promising answer. So after I figured what is a [Sylvester matrix](http://en.wikipedia.org/wiki/Sylvester_matrix), what is a [determinant](http://mathworld.wolfram.com/Determinant.html), what is a [resultant](http://mathworld.wolfram.com/Resultant.html) and [why it's useful](https://stackoverflow.com/questions/109364/bezier-clipping#comment-4332265), I thought I figured how the solution works. However, reality begs to differ, and it doesn't work so well. --- # Messing Around I've used my graphing calculator to draw two Bézier splines (that we'll call B and B) that intersect. Their coordinates are as follow (P, P, P, P): ``` (1, 1) (2, 4) (3, 4) (4, 3) (3, 5) (3, 6) (0, 1) (3, 1) ``` The result is the following, B being the "horizontal" curve and B the other one: ![Two cubic Bézier curves that intersect](https://i.stack.imgur.com/ZYVaW.png) Following directions from the aforementioned question's top-voted answer, I've subtracted B to B. It left me with two equations (the X and the Y axes) that, according to my calculator, are: ``` x = 9t^3 - 9t^2 - 3t + 2 y = 9t^3 - 9t^2 - 6t + 4 ``` --- # The Sylvester Matrix And from that I've built the following Sylvester matrix: ``` 9 -9 -3 2 0 0 0 9 -9 -3 2 0 0 0 9 -9 -3 2 9 -9 -6 4 0 0 0 9 -9 -6 4 0 0 0 9 -9 -6 4 ``` After that, I've made a C++ function to calculate determinants of matrices using [Laplace expansion](http://en.wikipedia.org/wiki/Laplace_expansion): ``` template<int size> float determinant(float* matrix) { float total = 0; float sign = 1; float temporaryMatrix[(size - 1) * (size - 1)]; for (int i = 0; i < size; i++) { if (matrix[i] != 0) { for (int j = 1; j < size; j++) { float* targetOffset = temporaryMatrix + (j - 1) * (size - 1); float* sourceOffset = matrix + j * size; int firstCopySize = i * sizeof *matrix; int secondCopySize = (size - i - 1) * sizeof *matrix; memcpy(targetOffset, sourceOffset, firstCopySize); memcpy(targetOffset + i, sourceOffset + i + 1, secondCopySize); } float subdeterminant = determinant<size - 1>(temporaryMatrix); total += matrix[i] * subdeterminant * sign; } sign *= -1; } return total; } template<> float determinant<1>(float* matrix) { return matrix[0]; } ``` It seems to work pretty well on relatively small matrices (2x2, 3x3 and 4x4), so I'd expect it to work on 6x6 matrices too. I didn't conduct extensive tests however, and there's a possibility that it's broken. --- # The Problem If I understood correctly the answer from the other question, the determinant should be 0 since the curves intersect. However, feeding my program the Sylvester matrix I made above, it's -2916. Is it a mistake on my end or on their end? What's the correct way to find out if two cubic Bézier curves intersect?
Checking if two cubic Bézier curves intersect
CC BY-SA 2.5
0
2010-10-28T02:19:03.487
2021-09-18T14:03:49.987
2020-06-20T09:12:55.060
-1
251,153
[ "c++", "intersection", "bezier" ]
4,039,325
1
4,039,438
null
5
3,266
If a 32bit Operating System operated with a segmented memory model would their still be a limit? I was reading the and it states that with a Segmented memory model that it is possible map up to of memory. > "In a segmented model of memory organization, the logical address space consists of as many as 16,383 segments of up to 4 gigabytes each, or a total as large as 2^46 bytes (64 terabytes). The processor maps this 64 terabyte logical address space onto the physical address space by the address translation mechanism described in Chapter 11. Application programmers can ignore the details of this mapping. The advantage of the segmented model is that offsets within each address space are separately checked and access to each segment can be individually controlled. ![alt text](https://i.stack.imgur.com/5E2YY.png) This is not a complex question. I just want to be sure I understood the text correctly. If Windows or any other OS worked in a segmented model rather than a flat model would the memory limit be 64TB? --- ![alt text](https://i.stack.imgur.com/i7Bxg.png) Intel's 3-2 3a System Documentation. --- ![alt text](https://i.stack.imgur.com/rHpVS.gif) [http://pdos.csail.mit.edu/6.828/2005/readings/i386/c05.htm](http://pdos.csail.mit.edu/6.828/2005/readings/i386/c05.htm) --- The Segment Register should NOT be thought as in the traditional Real-Mode sense. The Segment Register acts as a SELECTOR for the Global Descriptor Table. > In Protected mode you use a logical address in the form A:B to address memory. As in Real Mode, A is the segment part and B is the offset within that segment. The registers in > protected mode are limited to 32 bits. 32 bits can represent any integer between 0 and 4Gb. Because B can be any value between 0 and 4Gb our segments now have a maximum size of 4Gb (Same reasoning as in real-mode). Now for the difference. In protected mode A is not an absolute value for the segment. In protected mode A is a selector. A selector represents an offset into a system table called the Global Descriptor Table (GDT). The GDT contains a list of descriptors. Each of these descriptors contains information that describes the characteristics of a segment. The Segment Selector provides additional security that cannot be achieved with paging. > Both of these methods [Segmentation and Paging]have their advantages, but paging is much better. Segmentation is, although still usable, fast becoming obsolete as a method of memory protection and virtual memory. In fact, the x86-64 architecture requires a flat memory model (one segment with a base of 0 and a limit of 0xFFFFFFFF) for some of it's instructions to operate properly.Segmentation is, however, totally in-built into the x86 architecture. It's impossible to get around it. So here we're going to show you how to set up your own Global Descriptor Table - a list of segment descriptors.As mentioned before, we're going to try and set up a flat memory model. The segment's window should start at 0x00000000 and extend to 0xFFFFFFFF (the end of memory). However, there is one thing that segmentation can do that paging can't, and that's set the ring level. -[http://www.jamesmolloy.co.uk/tutorial_html/4.-The%20GDT%20and%20IDT.html](http://www.jamesmolloy.co.uk/tutorial_html/4.-The%20GDT%20and%20IDT.html) A GDT for example lists the various users their access levels and the areas of memory access: ``` GDT[0] = {.base=0, .limit=0, .type=0}; // Selector 0x00 cannot be used GDT[1] = {.base=0, .limit=0xffffffff, .type=0x9A}; // Selector 0x08 will be our code GDT[2] = {.base=0, .limit=0xffffffff, .type=0x92}; // Selector 0x10 will be our data GDT[3] = {.base=&myTss, .limit=sizeof(myTss), .type=0x89}; // You can use LTR(0x18) ``` [http://wiki.osdev.org/GDT_Tutorial#What_should_i_put_in_my_GDT.3F](http://wiki.osdev.org/GDT_Tutorial#What_should_i_put_in_my_GDT.3F) The Paging portion is what maps to physical memory. (PAE) is what provides addtional memory up to 64GB. So in short. The answer is no you cannot have more than 4GB of logical memory. I consider the claim for 64TB a misprint in the .
Assembly Segmented Model 32bit Memory Limit
CC BY-SA 2.5
0
2010-10-28T02:38:47.883
2018-04-04T18:00:18.083
2018-04-04T18:00:18.083
124,486
null
[ "assembly", "x86", "operating-system", "paging", "memory-segmentation" ]
4,039,639
1
null
null
1
3,436
I got this error message in Eclipse today: ![alt text](https://i.stack.imgur.com/xuuE5.png) Any idea what went wrong?
An internal error occurred while processing dirty regions
CC BY-SA 3.0
null
2010-10-28T04:01:39.980
2014-01-14T21:41:48.847
2014-01-14T21:41:48.847
321,731
276,101
[ "java", "eclipse", "regions" ]
4,039,671
1
null
null
4
2,153
I'm trying to get an image of an offscreen window to use in a `CALayer`-based animation, but no matter which method I try I cannot get an image out the other side. Here is the code I've been using on a custom `NSWindow` subclass in my project: ``` CGImageRef windowImage = CGWindowListCreateImage(CGRectNull, kCGWindowListOptionAll, (CGWindowID)[self windowNumber], kCGWindowImageDefault); ``` This is what the image should look like: ![alt text](https://i.stack.imgur.com/WBCKO.png) and here's what I get (ignore the slightly larger size - that's my fault in the rendering of the image): ![alt text](https://i.stack.imgur.com/CoNEW.png) Can anyone see where I'm going wrong? Strangely, Quartz Debug can see the window image without issue, but the [Son of Grab sample code from Apple](http://developer.apple.com/library/mac/#samplecode/SonOfGrab/Introduction/Intro.html) cannot.
How to grab an image of an offscreen NSWindow?
CC BY-SA 2.5
0
2010-10-28T04:09:06.613
2010-10-28T04:22:25.927
null
null
63,580
[ "cocoa", "nswindow", "cgimage" ]
4,040,206
1
null
null
1
3,766
So I have an ASP.net application, with an ActiveX Control which brings up a pop up - - I then get this weird Microsoft .net Security Warning Never enter personal information or passwords into a window unless you can verify and trust the source of the request. Source: xxx.xxxxxx.com The site is in the trusted list -- just like when I was using the IP only . Is there any setting in the IIS I need to tweak for IE to trust me fully. ![alt text](https://i.stack.imgur.com/Ay2fN.png)
Microsoft .net Security Warning : Never enter personal information or passwords
CC BY-SA 2.5
null
2010-10-28T06:01:02.560
2012-02-10T21:32:28.653
2010-10-28T06:21:41.880
109,141
109,141
[ "c#", ".net", "asp.net", "iis-7", "activex" ]
4,040,244
1
4,043,044
null
5
7,161
How do I change the color of the horizonal and vertical lines? I'd like to make them a little lighter, yet leave the X and Y axis black, probably. ![alt text](https://i.stack.imgur.com/8hOE8.png) Edited: indyfromoz suggestion resulted in this: ![alt text](https://i.stack.imgur.com/IWtgg.png) The effect I want is this: ![alt text](https://i.stack.imgur.com/lcG0N.png) (Subtler horiz and vertical lines, maybe even no vertical lines.)
Visual Studio 2010 Chart control - line color
CC BY-SA 2.5
0
2010-10-28T06:06:25.243
2012-03-06T20:29:52.783
2010-10-28T12:00:24.700
109,676
109,676
[ "asp.net", "visual-studio-2010", "charts" ]
4,040,307
1
4,040,345
null
4
12,028
I am planning to use jQuery UI Autosuggest for a search form. So I need a json output which can be used by jQuery UI Auto suggest. Here's the database ![alt text](https://i.stack.imgur.com/9KvQw.png) Table name recent_tags I have tried this First connect to db ``` $do = mysql_query("SELECT * FROM recent_tags where query like '%" . $_GET['query'] . "%'"); while ($row = mysql_fetch_array($fetch, MYSQL_ASSOC)) { $row_array['query'] = $row['query']; array_push($return_arr,$row_array); } echo json_encode($return_arr); ``` but It's not working.. Please guide me.. EDIT : getting error > Warning: array_push() [function.array-push]: First argument should be an array in /pathto/my/file.php Thanks
mysql table to json
CC BY-SA 3.0
null
2010-10-28T06:20:41.023
2016-02-06T16:56:56.647
2016-02-06T16:56:56.647
13,302
411,023
[ "php", "json" ]
4,040,616
1
4,059,685
null
12
10,411
As seen in the image ![http://oi56.tinypic.com/ifu33k.jpg](https://i.stack.imgur.com/mhHwD.png) I draw set of contours (polygons) as GL_LINE_STRIP. Now I want to select curve(polygon) under the mouse to delete,move..etc in 3D . I am wondering which method to use: 1.use OpenGL picking and selection. ( glRenderMode(GL_SELECT) ) 2.use manual collision detection , by using a pick-ray and check whether the ray is inside each polygon.
OpenGL GL_SELECT or manual collision detection?
CC BY-SA 3.0
0
2010-10-28T07:14:53.547
2016-04-14T14:50:18.580
2016-04-14T14:50:18.580
895,245
180,904
[ "opengl", "3d", "geometry", "collision-detection", "picking" ]
4,040,669
1
4,040,793
null
0
379
Somewhere resets ol's padding to 0 ``` ol { padding:0; } ``` I need to set it back to default which padding is growing depends on the number ``` ol { /* ??? */ } ``` Uploaded here: [http://jsfiddle.net/jGxLS/](http://jsfiddle.net/jGxLS/) As you can see, the padding is not growing (overflow to the left): ![alt text](https://i.stack.imgur.com/HQJQZ.png) How to make the padding grow?
Set OL padding back to default after reset
CC BY-SA 3.0
null
2010-10-28T07:24:21.120
2017-10-09T06:23:30.447
2017-10-09T06:23:30.447
1,033,581
351,564
[ "css" ]
4,040,739
1
4,212,332
null
1
395
I added ``` <key>UIInterfaceOrientation~ipad</key> <string>UIInterfaceOrientationLandscapeRight</string> ``` in Info.plist When I run the app, app can't show full. ![alt text](https://i.stack.imgur.com/5rjaa.png) Why and how to make full to rightbar in UISplitview ?
UISplitview can't show full with UIInterfaceOrientation~ipad
CC BY-SA 2.5
null
2010-10-28T07:35:43.007
2011-01-10T12:31:43.103
null
null
215,939
[ "iphone", "uisplitviewcontroller" ]
4,040,804
1
null
null
3
914
is it somehow possible to have horizontal scrollable tabbar if there are more than e.g. 10 tabs in it? Have anybody implemented something like this? ![alt text](https://i.stack.imgur.com/kWsv7.png) Mur Ps. It was not nice, what I did: I've deleted almost the same topic, I'd started yesterday. A big SORRY for man, who answered it already, even if it wasn't really the answer I'm looking for.
Android scrollable Tabbar
CC BY-SA 2.5
0
2010-10-28T07:46:40.280
2014-06-16T20:31:33.847
null
null
408,780
[ "android", "tabs", "tabbar" ]
4,040,999
1
4,067,895
null
5
11,230
I have an alert dialog which lists around 100 cities. Is there a way to search within it? Or maybe autocomplete? ![alt text](https://i.stack.imgur.com/ZGplf.png) I want to add a textbox which will filter the list according to what I type. EDIT: I'm very SORRY. What I meant was that I wanted to FILTER the above list based on what I type in a textbox. For example if I type 'D', I should get only Dhaka..
Searching within AlertDialog
CC BY-SA 2.5
0
2010-10-28T08:23:59.113
2017-03-28T01:40:41.173
2010-10-28T10:01:20.003
481,239
481,239
[ "android", "search", "dialog" ]
4,041,642
1
null
null
0
1,705
A bit similar to [this question](https://stackoverflow.com/questions/807428/wpf-how-can-i-make-a-brush-that-paints-graph-paper-like-squares). My aim is to evocate a notebook-like look of the textbox. ![](https://imkxia.blu.livefilestore.com/y1pqHBeduyRbK9BsSLxc32fi1f3pBgOgmL3K-Hzt2HC7vuG-QGTb3scaKlZSDSxZIYNYIll80y5BSDLKMDKECiBPXAOszwOWp0W/WPFTextboxLines.png?psid=1) OneNote does something similar, by setting background image of the editing surface. Of course it is not possible to align the lines in OneNote because the text can be freely formatted. I would like to do this with constant font (no formatting) in WPF. How to paint lines in textbox background that will match the lines of text?
How to paint notebook-like lines as TextBox background?
CC BY-SA 3.0
null
2010-10-28T09:48:10.403
2013-07-30T20:24:49.587
2017-05-23T11:53:28.290
-1
163,393
[ ".net", "wpf", "xaml", "wpf-controls", "customization" ]
4,041,837
1
4,042,639
null
3
970
I have a non-weighted DAG graph. What I want to do is to find all the paths in a greedy way and the path should contain at least K nodes, and a given starting node. Is there any existing algorithm/implmentation that does that? For example I have the following graph: ``` my %graph =(36=>[31],31=>[30,22],30=>[20],22=>[20,8],20=>[1],8=>[5],5=>[2],2=>[1,20]); ``` ![alt text](https://i.stack.imgur.com/C3S5c.png) So if I define K=5 and starting node 36, I hope to get: ``` {1,20,22,31,36} {1,20,2,5,8,22,31,36} {1,20,30,31,36} {1,2,5,8,22,31,36} ```
Finding Paths in Directed Graph with Greedy Approach With At Least K Nodes and a Given Starting Node
CC BY-SA 2.5
null
2010-10-28T10:14:59.057
2010-10-29T09:50:16.837
2010-10-28T10:39:21.513
67,405
67,405
[ "perl", "algorithm", "unix", "graph" ]
4,042,108
1
4,043,452
null
4
8,542
Basically I want a custom `UINavigationBar`. I don't want it to be "translucent" or anything, like the pictures app. I basically want to completely remove it, but I still want to be able to add back buttons and such when navigation controllers are pushed, and I want the views (EG: `UITableViewController`) to be pushed down below it. Like this: ![alt text](https://i.stack.imgur.com/hXgIU.jpg) Any ideas how to achieve this at all? Thanks
Custom UINavigationController UINavigationBar
CC BY-SA 3.0
0
2010-10-28T10:48:51.917
2013-05-31T09:34:26.593
2013-05-31T09:33:07.197
1,571,232
414,972
[ "iphone", "uinavigationcontroller", "uinavigationbar" ]
4,042,137
1
4,042,424
null
11
8,031
I'm having an odd issue with whitespace in a design I'm building. I created a `<div>` to contain voting elements - it holds an upvote button, downvote button, and vote total, each inside their own `<div>` element, and using `<img>` for the buttons. Source: ``` <div class="votebox"> <div class="vote"><img src="upvote.png" /></div> <div class="votetotal">15</div> <div class="vote"><img src="downvote.png" /></div> </div> ``` In the mini-reset in my CSS, both `<div>` and `<img>` elements are defined to display without margins or padding, and FireBug confirms these specific elements have no margins or padding, but I'm seeing whitespace being added between the bottoms of the `<img>` elements and the bottom of their respective containing ` elements. I added the following CSS to display a border around each element: ``` .votebox * { border: 1px #000 solid; } ``` and this is how it displayed in Firefox 3.6 (yes, those are StackOverflow vote images.. I'm using them as placeholders for the moment): ![](https://i.stack.imgur.com/jR16c.png) Now, the obvious answer to this problem is to simply set the "vote" class to have an explicit height of the images (and I will do this, possibly even opting for CSS sprites over `<img>`s), but I'm much more interested in learning these elements are displaying in this manner (this is supposed to be a self-teaching project after all). Can anyone shed some light on this for me? --- Edit: Steve H has pointed out to me that I should be using outline, rather than border, to show the outer edges of elements. I've made that change, and also separated the elements in CSS so they each display as a different colour. The new outline looks like this: ![](https://i.stack.imgur.com/84CF8.png) As you can see, the issue is a bit different than I thought. It looks like there is some whitespace below the image, but this is compounded by the fact that the bottom image seems to be rendered slightly outside its containing `<div>`. This seems weird to me.
Unknown whitespace appearing inside <div> without padding or margins
CC BY-SA 2.5
0
2010-10-28T10:51:42.397
2010-10-28T11:40:38.120
2010-10-28T11:28:44.780
1,588
1,588
[ "html", "css", "image", "rendering", "whitespace" ]
4,042,179
1
4,059,630
null
2
1,438
I've this simple Entities from DB tables ![alt text](https://i.stack.imgur.com/mrAHi.jpg) ``` public class Country { public string ID { get; set; } public string Name { get; set; } public string LocalName { get; set; } // this localized public string Region { get; set; } public IEnumerable<City> Cities { get; set; } } public class City { public int ID { get; set; } public string CountryID { get; set; } public string Name { get; set; } //this localized public double? Longitude { get; set; } public double? Latitude { get; set; } } ``` Then i want Localized properties "`LocalName` for the `Country` and `Name` for the `City`" to be filled by my context. So how to map this Entities to POCO Classes? And is there better way to do that? Please help me to take decision . . I made my `ObjectContext` to deal with my POCO but when i try to fill my Additional property "`LocalName`" in repository i get this error: > ``` The entity or complex type 'Site.Country' cannot be constructed ``` in a LINQ to Entities query. and this is the method in my Repository: ``` public IQueryable<Country> GetCountries() { return from country in context.Countries join countryCul in context.CountriesCultures on country.Code equals countryCul.CountryID where countryCul.LangID == "en" select new Country { Code = country.Code, LocalName = countryCul.LocalName, Name = country.Name, Region = country.Region, }; } ``` `LocalName`
How to Support Localization by mapping two entities to one POCO in EF 4
CC BY-SA 2.5
0
2010-10-28T10:55:10.663
2015-07-27T20:51:53.433
2010-10-30T10:24:55.783
105,445
105,445
[ ".net", "entity-framework", "localization", "entity-framework-4", "poco" ]
4,042,218
1
4,155,731
null
0
178
We've built a windows service which uses some COM+ components (developed by us). It runs on a Windows server (virtual through vmware) and something is eating memory. I did a small application which runs through all `Process.GetProcesses` and return their total memory usage: First run: ``` C:\Temp>ProcessExplorer.exe Virtual: 1613Mb, Physical: 318Mb ``` Few minutes later: ``` C:\Temp>ProcessExplorer.exe Virtual: 1492Mb, Physical: 48Mb ``` Looking at processes in task manager I don't see any application with high memory usage. But If I look at the Performance tab, no memory is available. ![alt text](https://i.stack.imgur.com/ng9lh.png) I have let the server run a few days without our application and the memory usage was constant at about 30%. I turned on the application yesterday and the memory usage on the server had increased to about 60% a couple of hours ago. So where did all the memory go? How do I find it? :)
Where did all the memory go?
CC BY-SA 2.5
null
2010-10-28T11:01:41.547
2010-11-11T15:00:04.657
null
null
70,386
[ ".net", "memory-management", "com+" ]
4,042,385
1
4,113,693
null
1
1,843
in my web page i have a table and i want its first column to be resizeable. it works fine in IE8 but on Mozilla it shows resize icon in bottom right corner of the document. this is the code ``` $(".resizable").resizable({ maxHeight: 25, maxWidth: 350, minHeight: 25, minWidth: 150 }); ``` here is how it shows up in IE8 ![alt text](https://i.stack.imgur.com/33hfQ.jpg) here is how it shows up in Firefox ![alt text](https://i.stack.imgur.com/5K71g.jpg) plz see the resize icon on bottom right corner ``` <table cellspacing="0"> <thead> <tr> <th class="resizable ui-resizable">Task Number<div class="ui-resizable-handle ui-resizable-e" unselectable="on" style="-moz-user-select: none;"></div><div class="ui-resizable-handle ui-resizable-s" unselectable="on" style="-moz-user-select: none;"></div><div class="ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se" style="z-index: 1001; -moz-user-select: none;" unselectable="on"></div></th> <th>Start Date</th> <th>Duration</th> <th style="width: 100px;">DeadLine</th> <th>Parent TaskID</th> </tr> </thead> <tbody> <tr class="1" id="row-0" style=""> <td width="150"> <div style="width: 14px;" class="wrapper"> &nbsp; </div> TaskN </td> <td style="text-align: center;"> <input type="text" value="01/12/2010" style="text-align: center;" name="StartDate[0]" id="StartDate_0_" class="DatePicker 11 hasDatepicker"> </td> <td> <input type="text" value="7" name="Duration[0]" id="Duration_0_" class="DurationChange 11"> </td> <td></td> <td></td> </tr> <tr class="2" id="row-1" style=""> <td width="150"> <div style="width: 14px;" class="wrapper"> &nbsp; </div> TaskP </td> <td style="text-align: center;"> <input type="text" value="01/11/2010" style="text-align: center;" name="StartDate[1]" id="StartDate_1_" class="DatePicker 12 hasDatepicker"> </td> <td> <input type="text" value="7" name="Duration[1]" id="Duration_1_" class="DurationChange 12"> </td> <td></td> <td></td> </tr> <tr class="3" id="row-2" style="color: blue;"> <td width="150"> <div style="width: 14px;" class="wrapper"> <span lang="on" class="navigator">&nbsp;</span> </div> Task12 </td> <td style="text-align: center;"> 16/12/2010 </td> <td> 5 </td> <td>18/11/2010</td> <td></td> </tr> <tr class="3.1" id="row-3" style="color: orange;"> <td width="150"> <div style="width: 28px;" class="wrapper"> <span lang="on" class="navigator">&nbsp;</span> </div> Task2 </td> <td style="text-align: center;"> 10/12/2010 </td> <td> 5 </td> <td>19/09/2010</td> <td>1</td> </tr> <tr class="3.1.1" id="row-4" style="color: red;"> <td width="150"> <div style="width: 42px;" class="wrapper"> <span lang="on" class="navigator">&nbsp;</span> </div> Task3 </td> <td style="text-align: center;"> 22/12/2010 </td> <td> 1 </td> <td></td> <td>2</td> </tr> <tr class="3.1.1.1" id="row-5" style="color: red;"> <td width="150"> <div style="width: 56px;" class="wrapper"> &nbsp; </div> Task9 </td> <td style="text-align: center;"> <input type="text" value="30/10/2010" style="text-align: center;" name="StartDate[5]" id="StartDate_5_" class="DatePicker 9 hasDatepicker"> </td> <td> <input type="text" value="34" name="Duration[5]" id="Duration_5_" class="DurationChange 9"> </td> <td></td> <td>3</td> </tr> <tr class="3.1.2" id="row-6" style="color: orange;"> <td width="150"> <div style="width: 42px;" class="wrapper"> &nbsp; </div> Task10 </td> <td style="text-align: center;"> <input type="text" value="30/10/2010" style="text-align: center;" name="StartDate[6]" id="StartDate_6_" class="DatePicker 10 hasDatepicker"> </td> <td> <input type="text" value="12" name="Duration[6]" id="Duration_6_" class="DurationChange 10"> </td> <td>04/10/2010</td> <td>2</td> </tr> <tr class="3.2" id="row-7" style="color: red;"> <td width="150"> <div style="width: 28px;" class="wrapper"> &nbsp; </div> task5 </td> <td style="text-align: center;"> <input type="text" value="25/10/2010" style="text-align: center;" name="StartDate[7]" id="StartDate_7_" class="DatePicker 5 hasDatepicker"> </td> <td> <input type="text" value="3" name="Duration[7]" id="Duration_7_" class="DurationChange 5"> </td> <td></td> <td>1</td> </tr> <tr class="3.3" id="row-8" style="color: orange;"> <td width="150"> <div style="width: 28px;" class="wrapper"> &nbsp; </div> 001 </td> <td style="text-align: center;"> <input type="text" value="19/10/2010" style="text-align: center;" name="StartDate[8]" id="StartDate_8_" class="DatePicker 7 hasDatepicker"> </td> <td> <input type="text" value="5" name="Duration[8]" id="Duration_8_" class="DurationChange 7"> </td> <td>23/10/2010</td> <td>1</td> </tr> <tr class="4" id="row-9" style=""> <td width="150"> <div style="width: 14px;" class="wrapper"> &nbsp; </div> Task4 </td> <td style="text-align: center;"> 15/01/2011 </td> <td> 5 </td> <td></td> <td></td> </tr> </tbody> </table> ```
jquery Resizeable malfunctioning in Firefox
CC BY-SA 2.5
null
2010-10-28T11:24:20.287
2013-08-09T08:07:09.900
2010-10-28T11:37:45.650
331,174
331,174
[ "jquery", "resizable" ]
4,042,447
1
4,044,547
null
5
8,914
After a lot of searching, I have not found any solution for the following problem. I need a treeview control with "checkboxed" treeview items and the `CheckedItems` property for convenient data binding (for example, treeview of folders' structure, when user checks folders, the size of checked folders is displayed in a textbox). By the way, I have read the article [«Working with Checkboxes in the WPF TreeView», Josh Smith](http://www.codeproject.com/KB/WPF/TreeViewWithCheckBoxes.aspx), but the "IsChecked" approach is not appropriate in my case because I need to bind `CheckedItems` as a collection. I would appreciate any help! ![alt text](https://i.stack.imgur.com/wA2vg.gif) The image link has been attached. I want the listbox to be data bound to `CheckedItems` property of `CheckTreeView`. Does anybody know how to implement the generic `CheckTreeView` with possible binding to `CheckedItems` collection?
WPF TreeView with checkboxes
CC BY-SA 3.0
0
2010-10-28T11:33:04.733
2016-09-21T04:14:08.260
2016-09-21T04:14:08.260
490,018
490,018
[ "wpf", "data-binding", "treeview", "checkbox" ]
4,042,542
1
4,042,605
null
0
1,618
In my Flash File I have a wheel. The user is able to rotate the wheel by using arrows to jump to the next "segment" (think 20 images attached to each other forming the circumference of the wheel). ![Wheel](https://i.stack.imgur.com/4HKf6.png) Clicking the arrows initiates this code: ``` protected function rotate():void { var rotateTo:Number = (-360 / numItems) * currentItem + 90; TweenLite.to(planesHolder, 1, { rotationY:rotateTo, ease:Quint.easeInOut } ); } ``` However, what I want to be able to do is, click and drag to spin the wheel, complete with acceleration and deceleration and even settling on the nearest image when the wheel reduces to a certain speed. I have no idea how to go about doing this: I'll need to kinda detect a before and after position of the cursor and translate this into a speed for the wheel which then decelerates over time and also detect which image is closest at a certain speed and "snap" it, both scrolling up and down. (it'll only affect the Y-axis) Any help would be appreciated
Acceleration and Deceleration in AS3
CC BY-SA 2.5
0
2010-10-28T11:45:05.907
2010-10-28T11:53:03.187
null
null
418,146
[ "flash", "actionscript-3", "rotation", "physics", "tween" ]
4,042,627
1
4,042,807
null
0
195
The question: > This view has two levels. The first level will list all members who have associated Journal or Conference Paper records. The second level lists the titles of the papers for a selected member; the entries in this view are links to the actual papers. And all I can find from my professor's notes: ![enter image description here](https://i.stack.imgur.com/hN1Kd.png) Oh course I'm not asking for you to do it for me, but what does it mean by different levels for a view? And how do you do that?
Multi-Level Views in Drupal
CC BY-SA 3.0
null
2010-10-28T11:55:23.780
2012-01-30T12:58:35.210
2012-01-30T12:58:35.210
11,621
431,790
[ "php", "drupal", "drupal-views" ]
4,043,418
1
4,043,488
null
1
8,763
first some background. Here is the SQLite script I created: ``` create table Person( ID integer not null primary key autoincrement, Name text not null ); create table Department( ID integer not null primary key autoincrement, Name text not null, Leader integer not null references Person(ID) ); ``` It generates the following Entity Framework model: ![alt text](https://i.stack.imgur.com/ZhOqS.png) Here, I'm trying to create make a simple application so I can learn how to use SQLite, so I can save a new Person to the database, and also save a new department. A department can have only 1 leader, and a person can be leader of many departments. Right now I'm focusing on creating a new department. ``` 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 SQLite_Testing_Grounds { public partial class Form1 : Form { public Form1() { InitializeComponent(); LoadUsersToComboBox(); } private void LoadUsersToComboBox() { throw new NotImplementedException(); } private void button2_Click(object sender, EventArgs e) { CreateNewPerson(); } private void CreateNewPerson() { if (textBox2.Text != String.Empty) { ScansEntities1 db = new ScansEntities1(); Person user = new Person() { Name = textBox1.Text }; db.AddToPeople(user); db.SaveChanges(); } } private void button1_Click(object sender, EventArgs e) { CreateNewDepartment(); } private void CreateNewDepartment() { if ((textBox1.Text != String.Empty) && (comboBox1.SelectedIndex >= 0)) { ScansEntities1 db = new ScansEntities1(); Department department = new Department() { Name = textBox1.Text, //Then what goes here? :/ }; } throw new NotImplementedException(); } } } ``` How can I save the ID of the selected "Person" using the ComboBox? ![alt text](https://i.stack.imgur.com/VqZBn.png) Following John H. advice, my Department class (generated by EF) doesn't contain a definition for Leader (as I would expect if I were using MS SQL). Here is a screenshot of what it have. Thanks again for the massive help. ![alt text](https://i.stack.imgur.com/DK0Ab.png)
How can I save a foreign key using Entity Framework?
CC BY-SA 2.5
null
2010-10-28T13:36:10.247
2021-10-06T06:11:59.853
2010-10-28T14:33:55.307
null
null
[ "c#", "entity-framework", "sqlite" ]
4,043,446
1
null
null
2
2,693
this is a mockup i want to buid... I"ve having trouble properly laying out with just css/js ... is there a jquery plugin/tool that could help with this? Could this be called a reverse orientation calendar? Writing it from scratch has been hell so far, and i'm not remotely close. ![alt text](https://i.stack.imgur.com/5yBeO.png)
Building a Schedule Screen/Grid; whats the best plugin/tool for this?
CC BY-SA 2.5
0
2010-10-28T13:39:34.647
2016-04-30T04:13:29.913
null
null
2,041,708
[ "jquery", "web-applications", "layout" ]
4,043,398
1
7,625,085
null
119
114,095
So im trying to animate when i set the visibility of a linearlayout with other widgets, from GONE to VISIBLE and the opposite.Im using togglebuttons to show and hide. Here's an image to show what i want to do: ![enter image description here](https://i.stack.imgur.com/tAmrq.png) I can show and hide, but im not following how can i animate the sliding correctly....:( Heres my xml: ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/LinearLayout01" android:layout_height="wrap_content" android:layout_width="fill_parent" android:orientation="vertical"> <ScrollView android:id="@+id/ScrollView01" android:layout_width="wrap_content" android:layout_height="wrap_content"> <LinearLayout android:layout_height="wrap_content" android:layout_width="fill_parent" android:orientation="vertical"> <!-- TITULO1 --> <LinearLayout android:layout_height="wrap_content" android:layout_width="fill_parent" android:orientation="horizontal" android:background="#848284" android:padding="4px"> <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/TextView01" android:text="Informação Geral" android:textColor="#FFFFFF" android:gravity="left" android:textStyle="bold" android:singleLine="true" android:ellipsize="end" android:layout_gravity="center_vertical" android:textSize="18px" android:paddingLeft="4px"> </TextView> <LinearLayout android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_gravity="right|center_vertical" android:gravity="right|center_vertical" android:paddingTop="2px"> <ToggleButton android:layout_height="wrap_content" android:layout_width="wrap_content" android:textOff="Expandir" android:textOn="Minimizar" android:id="@+id/mostrar" android:width="80px"> </ToggleButton> </LinearLayout> </LinearLayout> <!--LINHA SEPARADORA--> <View android:id="@+id/View01" android:layout_width="wrap_content" android:background="#B5B5B5" android:layout_height="2px"> </View> <!-- CONTENT INITIALLY HIDDEN (GONE) --> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:visibility="gone" android:id="@+id/informgeral" android:orientation="vertical"> <LinearLayout android:id="@+id/LinearLayout01" android:layout_height="wrap_content" android:layout_width="fill_parent" android:paddingBottom="5px" android:paddingTop="5px" android:paddingLeft="8px" android:orientation="vertical"> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:id="@+id/consult_nrprocesso" android:textStyle="bold" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="left" android:ellipsize="end" android:layout_width="wrap_content" android:singleLine="true" android:text="@string/srch_number_proc"/> <TextView android:id="@+id/consult_nrprocessovalue" android:layout_width="0px" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="right" android:singleLine="true" android:ellipsize="end"/> </LinearLayout> <LinearLayout android:layout_height="wrap_content" android:layout_width="fill_parent"> <TextView android:id="@+id/consult_tipoprocinfo" android:text="Numero Atribuido ao Processo" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="left" android:singleLine="true" android:ellipsize="end" android:layout_width="wrap_content" android:textSize="12px"/> </LinearLayout> </LinearLayout> <View android:id="@+id/View01" android:layout_width="wrap_content" android:background="#B5B5B5" android:layout_height="1px"> </View> <LinearLayout android:id="@+id/LinearLayout02" android:layout_height="wrap_content" android:orientation="vertical" android:paddingTop="5px" android:paddingBottom="5px" android:layout_width="fill_parent" android:paddingLeft="8px"> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:id="@+id/consult_tipoproc" android:textStyle="bold" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="left" android:ellipsize="end" android:layout_width="wrap_content" android:singleLine="true" android:text="@string/proc_type"/> <TextView android:id="@+id/consult_tipoprocvalue" android:layout_width="0px" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="right" android:singleLine="true" android:ellipsize="end"/> </LinearLayout> <LinearLayout android:layout_height="wrap_content" android:layout_width="fill_parent"> <TextView android:id="@+id/consult_tipoprocinfo" android:text="Variante do Processo em causa" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="left" android:singleLine="true" android:ellipsize="end" android:layout_width="wrap_content" android:textSize="12px"/> </LinearLayout> </LinearLayout> <View android:id="@+id/View01" android:layout_width="fill_parent" android:background="#B5B5B5" android:layout_height="1px"> </View> <LinearLayout android:id="@+id/LinearLayout03" android:layout_height="wrap_content" android:orientation="vertical" android:paddingTop="5px" android:paddingBottom="5px" android:layout_width="fill_parent" android:paddingLeft="8px"> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:id="@+id/consult_etapa" android:textStyle="bold" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="left" android:ellipsize="end" android:layout_width="wrap_content" android:singleLine="true" android:text="@string/srch_task"/> <TextView android:id="@+id/consult_etapavalue" android:layout_width="0px" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="right" android:singleLine="true" android:ellipsize="end"/> </LinearLayout> <LinearLayout android:layout_height="wrap_content" android:layout_width="wrap_content"> <TextView android:id="@+id/consult_etapainfo" android:text="Etapa onde se encontra o processo" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="left" android:singleLine="true" android:ellipsize="end" android:layout_width="wrap_content" android:textSize="12px"/> </LinearLayout> </LinearLayout> <View android:id="@+id/View01" android:layout_width="wrap_content" android:background="#B5B5B5" android:layout_height="1px"> </View> <LinearLayout android:id="@+id/LinearLayout04" android:layout_height="wrap_content" android:orientation="vertical" android:paddingTop="5px" android:paddingBottom="5px" android:layout_width="fill_parent" android:paddingLeft="8px"> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:id="@+id/consult_criadopor" android:textStyle="bold" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="left" android:ellipsize="end" android:layout_width="wrap_content" android:singleLine="true" android:text="@string/criado_por"/> <TextView android:id="@+id/consult_criadoporvalue" android:layout_width="0px" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="right" android:singleLine="true" android:ellipsize="end"/> </LinearLayout> <LinearLayout android:layout_height="wrap_content" android:layout_width="wrap_content"> <TextView android:id="@+id/consult_criadoporinfo" android:text="Entidade responsável pela criação do Processo." android:layout_height="wrap_content" android:layout_weight="1" android:gravity="left" android:singleLine="true" android:ellipsize="end" android:layout_width="wrap_content" android:textSize="12px"/> </LinearLayout> </LinearLayout> <View android:id="@+id/View01" android:layout_width="wrap_content" android:background="#B5B5B5" android:layout_height="1px"> </View> <LinearLayout android:id="@+id/LinearLayout05" android:layout_height="wrap_content" android:orientation="vertical" android:paddingTop="5px" android:paddingBottom="5px" android:layout_width="fill_parent" android:paddingLeft="8px"> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:id="@+id/consult_assunto" android:textStyle="bold" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="left" android:ellipsize="end" android:layout_width="wrap_content" android:singleLine="true" android:text="@string/proc_subject"/> <TextView android:id="@+id/consult_assuntovalue" android:layout_width="0px" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="right" android:singleLine="true" android:ellipsize="end"/> </LinearLayout> <LinearLayout android:layout_height="wrap_content" android:layout_width="wrap_content"> <TextView android:id="@+id/consult_assuntoinfo" android:text="Assunto do Processo" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="left" android:singleLine="true" android:ellipsize="end" android:layout_width="wrap_content" android:textSize="12px"/> </LinearLayout> </LinearLayout> <View android:id="@+id/View01" android:layout_width="wrap_content" android:background="#B5B5B5" android:layout_height="1px"> </View> <LinearLayout android:id="@+id/LinearLayout05" android:layout_height="wrap_content" android:orientation="vertical" android:paddingTop="5px" android:paddingBottom="5px" android:layout_width="fill_parent" android:paddingLeft="8px"> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:id="@+id/consult_datainicio" android:textStyle="bold" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="left" android:ellipsize="end" android:layout_width="wrap_content" android:singleLine="true" android:text="@string/srch_datebeg"/> <TextView android:id="@+id/consult_datainiciovalue" android:layout_width="0px" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="right" android:singleLine="true" android:ellipsize="end"/> </LinearLayout> <LinearLayout android:layout_height="wrap_content" android:layout_width="wrap_content"> <TextView android:id="@+id/consult_dataincioinfo" android:text="Data da criação do Processo" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="left" android:singleLine="true" android:ellipsize="end" android:layout_width="wrap_content" android:textSize="12px"/> </LinearLayout> </LinearLayout> </LinearLayout> <!-- TITULO2 --> <LinearLayout android:layout_height="wrap_content" android:layout_width="fill_parent" android:orientation="horizontal" android:background="#848284" android:padding="4px"> <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/TextView01" android:text="Informação Complementar" android:textColor="#FFFFFF" android:gravity="left" android:textStyle="bold" android:singleLine="true" android:ellipsize="end" android:layout_gravity="center_vertical" android:paddingLeft="4px" android:textSize="16px"> </TextView> <LinearLayout android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_gravity="right|center_vertical" android:gravity="right|center_vertical" android:paddingTop="2px"> <ToggleButton android:layout_height="wrap_content" android:layout_width="wrap_content" android:textOff="Expandir" android:textOn="Minimizar" android:id="@+id/mostrar2" android:width="80px"> </ToggleButton> </LinearLayout> </LinearLayout> <View android:id="@+id/View01" android:layout_width="wrap_content" android:background="#B5B5B5" android:layout_height="2px"> </View> <!-- TITULO3 --> <LinearLayout android:layout_height="wrap_content" android:layout_width="fill_parent" android:orientation="horizontal" android:background="#848284" android:padding="4px"> <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/TextView01" android:text="Documentos Anexados" android:textColor="#FFFFFF" android:gravity="left" android:textStyle="bold" android:singleLine="true" android:ellipsize="end" android:layout_gravity="center_vertical" android:textSize="18px" android:paddingLeft="4px"> </TextView> <LinearLayout android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_gravity="right|center_vertical" android:gravity="right|center_vertical" android:paddingTop="2px"> <ToggleButton android:layout_height="wrap_content" android:layout_width="wrap_content" android:textOff="Expandir" android:textOn="Minimizar" android:id="@+id/mostrar" android:width="80px"> </ToggleButton> </LinearLayout> </LinearLayout> <!--LINHA SEPARADORA--> <View android:id="@+id/View01" android:layout_width="wrap_content" android:background="#B5B5B5" android:layout_height="2px"> </View> <!-- TITULO4 --> <LinearLayout android:layout_height="wrap_content" android:layout_width="fill_parent" android:orientation="horizontal" android:background="#848284" android:padding="4px"> <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/TextView01" android:text="Etapas" android:textColor="#FFFFFF" android:gravity="left" android:textStyle="bold" android:singleLine="true" android:ellipsize="end" android:layout_gravity="center_vertical" android:textSize="18px" android:paddingLeft="4px"> </TextView> <LinearLayout android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_gravity="right|center_vertical" android:gravity="right|center_vertical" android:paddingTop="2px"> <ToggleButton android:layout_height="wrap_content" android:layout_width="wrap_content" android:textOff="Expandir" android:textOn="Minimizar" android:id="@+id/mostrar" android:width="80px"> </ToggleButton> </LinearLayout> </LinearLayout> <!--LINHA SEPARADORA--> <View android:id="@+id/View01" android:layout_width="wrap_content" android:background="#B5B5B5" android:layout_height="2px"> </View> </LinearLayout> </ScrollView> ``` And here's the java code that calls the button event: ``` final ToggleButton bt=(ToggleButton) findViewById(R.id.mostrar); bt.setOnClickListener(new OnClickListener() { public void onClick(View v) { if (bt.isChecked()) { /*TranslateAnimation slide = new TranslateAnimation(0, 0, 0, -findViewById(R.id.informgeral).getHeight()*2); slide.setDuration(500); slide.setFillAfter(true); findViewById(R.id.informgeral).startAnimation(slide);*/ findViewById(R.id.informgeral).setVisibility(View.VISIBLE);; } else { /* TranslateAnimation slide = new TranslateAnimation(0, 0, 0, findViewById(R.id.informgeral).getHeight()); slide.setDuration(500); slide.setFillAfter(true); findViewById(R.id.informgeral).startAnimation(slide);*/ //findViewById(R.id.listBut).startAnimation(slide); findViewById(R.id.informgeral).setVisibility(View.GONE);; } } }); ```
Animate visibility modes, GONE and VISIBLE
CC BY-SA 3.0
0
2010-10-28T13:33:40.837
2018-03-24T01:31:24.217
2014-02-12T22:09:36.890
901,200
382,115
[ "android", "animation", "visibility", "slide" ]
4,043,559
1
4,043,756
null
0
219
I know that this has been discussed several times in many other topics, blogs, book, youtube, etc. But, let me explain my case. I want so that when an application opens up, it shows a facebook connect button to login. After the user login, then it will bring up the tabBarView. In my app delegate I first add the MainViewController and there I had shown the facebook connect login button. Then after it's logged in it adds the tabBarViewController as it's sub view. Now inside this tabBarViewController I want so that it has 2 tabs. The first tab people and second is map. I want to add a navBar in the people tab. So what I did in my code was the following: ``` tabBarViewController = [[TabBarViewController alloc] init]; mvc = [[MapViewController alloc] init]; UIImage* mapIcon = [UIImage imageNamed:@"13-target.png"]; mvc.tabBarItem = [[[UITabBarItem alloc] initWithTitle:@"Map" image:mapIcon tag:0] autorelease]; tvc = [[TableViewController alloc] init]; UIImage* peopleIcon = [UIImage imageNamed:@"112-group.png"]; tvc.tabBarItem = [[[UITabBarItem alloc] initWithTitle:@"People" image:peopleIcon tag:0] autorelease]; friendsNavController = [[FriendsNavController alloc] init]; tabBarViewController.viewControllers = [NSArray arrayWithObjects: friendsNavController, tvc, mvc, nil]; tvc.userInfo = _userInfo; [self.tabBarViewController viewWillAppear:YES]; [self.view addSubview:self.tabBarViewController.view]; ``` The result now is that I have 3 tab bar, one with a nav bar, one with a table list, and one is the map. How can I change the code so that the nav bar and the table view are in one tab bar? What am I doing wrong here? Here's how it looks on interface builder: ![alt text](https://i.stack.imgur.com/AsfPE.png)
UITabBarController + UINavBarController
CC BY-SA 2.5
null
2010-10-28T13:54:07.593
2010-10-28T14:15:29.213
2010-10-28T14:01:54.630
95,265
95,265
[ "iphone", "objective-c" ]
4,043,593
1
null
null
2
2,638
If I set the properties of "`buttonMode`" and "`useHandCursor`" to true in `DataGrid`, it does not work as I expect. Only if I move the cursor to the edge between two rows, the hand cursor displayes. What I expect is that no matter where the cursor is moved, it should always show hand cursor. The following the `itemRenderer`: ``` <?xml version="1.0" encoding="utf-8"?> <mx:Label xmlns:mx="http://www.adobe.com/2006/mxml" useHandCursor="true" buttonMode="true"> <mx:Script> <![CDATA[ import valueObject.Employee; override public function set data(value:Object):void{ super.data = value; var employee:Employee = value as Employee; this.text = employee.lastName; } ]]> </mx:Script> </mx:Label> ``` ![enter image description here](https://i.stack.imgur.com/2gVgI.png) ![enter image description here](https://i.stack.imgur.com/3fAs5.png)
buttonMode and useHandCursor property in DataGrid doesn't work
CC BY-SA 2.5
0
2010-10-28T13:58:36.943
2011-04-19T23:40:23.863
2011-01-25T02:20:01.590
419
422,390
[ "apache-flex", "actionscript-3" ]
4,043,859
1
4,105,743
null
9
29,294
I'm getting the following exception in my log when I try to perform an XA transaction: > javax.transaction.xa.XAException: com.microsoft.sqlserver.jdbc_SQLServerException: failed to create the XA control connection. Error: "The EXECUTE permission was denied on the object 'xp_sqljdbc_xa_init_ex', database 'master' schema 'dbo' I followed these tutorials [Understanding XA Transactions](http://msdn.microsoft.com/en-us/library/aa342335.aspx) and [How to make MSSQL Server XA Datasource Work?](http://www.senthilb.com/2010/01/how-to-make-xa-datasource-work-in-mssql.html) After following the first tutorial I also ran the following command in SSMS: > use master GO EXEC sp_addrolemember [SqlJDBCXAUser], 'MyUserName' GO I'll also add that I ran > use master GO EXEC sp_grantdbaccess 'MyUserName','MyUserName' GO to verify that the user has access to the master db and I got an error that "the user already exists in the current database". Lastly I verified, via SSMS, that the role `SqlJDBCXAUser` does have EXECUTE granted in regard to `xp_sqljdbc_xa_init_ex`. The DB I'm using is obviously not `master` but `myDBName`. The only correlation between the two, with regard to this issue, is that `MyUserName` is the owner of `myDBName` and exists as a user in `master`. My Server is running on Windows XP SP3 (so the hotfix mentioned in the first tutorial is not relevant as it is meant for XP SP2 and under, I know as I tried to run the hotfix). Has someone encountered this issue? I'd really appreciate some leads. Thanks, Ittai I've looked at the first tutorial, from `Microsoft`, again and there are two paragraphs which I'm not sure what they mean and they might contain the solution: > Execute the database script xa_install.sql on every SQL Server instance that will participate in distributed transactions. This script installs the extended stored procedures that are called by sqljdbc_xa.dll. These extended stored procedures implement distributed transaction and XA support for the Microsoft SQL Server JDBC Driver. You will need to run this script as an administrator of the SQL Server instance. When they say `SQL Server instance`, do they mean the sql server which contains several databases, including `master` and `myDBName`(I'm used to oracle terms which are a bit different)? I ran the `xa_install.sql` script once as it was given and it states `use master`. This is the second paragraph: > To grant permissions to a specific user to participate in distributed transactions with the JDBC driver, add the user to the SqlJDBCXAUser role. For example, use the following Transact-SQL code to add a user named 'shelby' (SQL standard login user named 'shelby') to the SqlJDBCXAUser role: ``` USE master GO EXEC sp_grantdbaccess 'shelby', 'shelby' GO EXEC sp_addrolemember [SqlJDBCXAUser], 'shelby' ``` > SQL user-defined roles are . To create your own role for security purposes, you will have to define the role in each database, and add users in a per database manner. because it is used to grant access to the SQL JDBC extended stored procedures that reside in master. You will have to first grant individual users access to master, and then grant them access to the SqlJDBCXAUser role while you are logged into the master database. I'm not sure but I think that the above bolded sentence says that the `SqlJDBCXAUser` role should only be defined on `master` and that other users which access `myDBName` should be granted access to `master` and then added to the role and that will (don't know how) will enable them when using the `myDBName` database to use the xa packages. This is a screenshot from SSMS of the stored procedure's security settings under the SqlJDBCXAUser role ![alt text](https://i.stack.imgur.com/Rtgv8.jpg)
Exception with MS-SQL Server,JDBC and XA Transactions
CC BY-SA 2.5
0
2010-10-28T14:29:01.630
2010-11-05T12:14:20.737
2010-11-01T15:33:40.243
170,013
170,013
[ "java", "sql-server", "jdbc" ]
4,043,950
1
4,044,004
null
1
63
I'm not a SQL server expert by any means, and I'm hoping this is something simple. The scenario: I create a new database with all the defaults, then add a table with a primary key and two nvarchar(max) fields, but I forget to set the identity specification on the key so I go back and try to change it the IsIdentity property from No to Yes and I get the following error: ![alt text](https://i.stack.imgur.com/qRBJE.png)
Is there any way to avoid the 'saving changes is not permitted' error when trying to change the schema
CC BY-SA 2.5
null
2010-10-28T14:39:34.190
2010-10-28T14:46:56.217
null
null
398,546
[ "ssms" ]
4,044,101
1
4,044,707
null
7
1,198
I have the following collection of nodes and edges. What I want to do is to find all the distinct graph from it. ``` my %connections=(36=>[31],10=>[3,4],31=>[30,22],30=>[20],22=>[20,8],20=>[1],8=>[5],5=>[2],2=>[1,20], 3=>[7]); ``` In this example it will yield: ``` my %all_graph = { graph1 => {36=>[31],31=>[30,22],30=>[20],22=>[20,8],20=>[1],8=>[5],5=>[2],2=>[1,20]}. graph2 => {10=>[3,4], 3=>[7]} }; ``` Is there any existing algorithms that does that? ![alt text](https://i.stack.imgur.com/w50cB.jpg)
How can I find the connected components of a graph in Perl?
CC BY-SA 2.5
null
2010-10-28T14:56:38.080
2010-10-31T01:54:03.430
2010-10-31T01:54:03.430
67,405
67,405
[ "linux", "perl", "unix", "graph" ]
4,044,107
1
4,044,159
null
11
9,341
Previously, when I first design a stock application related software, I decide to use `java.util.Date` to represent date/time information of a stock. Later, I realize most of the methods in `java.util.Date` is deprecated. Hence, very soon, I refactor all my code to make use of `java.util.Calendar` However, there is 2 shortcomings I encounter. 1. Construct java.util.Calendar is comparative slower than java.util.Date 2. Within the accessors getCalendar method of Stock class, I need to clone a copy, as Calendar is a mutable class Here is the current source code for [Stock.java](http://jstock.cvs.sourceforge.net/viewvc/jstock/jstock/src/org/yccheok/jstock/engine/Stock.java?revision=1.18&view=markup) Recently, I discover [Joda-Time](http://www.joda.org/joda-time/). I do the following benchmarking, by creating 1,000,000 `java.util.Date`, `java.util.Calendar` and `org.joda.time.DateTime`. I found `org.joda.time.DateTime` performs better than `java.util.Calendar`, during instantiation. Here is the benchmarking![alt text](https://i.stack.imgur.com/YDq2E.png) result. This instantiation speed is important, especially many instance of Stocks will be created, to represent a long price history of a stock. Do you think is it worth to migrate from Java Calendar to Joda Date Time, to gain application speed performance? Is there any trap I need to pay attention to?
Migrating from Java Calendar to Joda Date Time
CC BY-SA 3.0
0
2010-10-28T14:57:49.587
2016-07-08T14:08:12.707
2014-03-25T10:57:52.747
12,960
72,437
[ "java", "jodatime" ]
4,044,123
1
4,044,153
null
0
283
I'm new to android sdk. I started with the HelloAndroid program. I followed all specified instructions, but to my surprise, the emulator is not diplaying the "Hello Android" text. ![alt text](https://i.stack.imgur.com/ZHZNH.png) Instead the emulator looks like the one shown above(You can see "LogCat" at the bottom of the image). The Console shows msgs like, --- [2010-10-28 20:14:59 - HelloAndroid] New emulator found: emulator-5554 [2010-10-28 20:14:59 - HelloAndroid] Waiting for HOME ('android.process.acore') to be launched... [2010-10-28 20:15:34 - HelloAndroid] HOME is up on device 'emulator-5554' [2010-10-28 20:15:34 - HelloAndroid] Uploading HelloAndroid.apk onto device 'emulator-5554' [2010-10-28 20:15:35 - HelloAndroid] Installing HelloAndroid.apk... [2010-10-28 20:16:13 - HelloAndroid] Success! [2010-10-28 20:16:13 - HelloAndroid] Starting activity com.example.helloandroid.HelloAndroid on device [2010-10-28 20:16:18 - HelloAndroid] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.helloandroid/.HelloAndroid } --- After some 7 min, "request time failed" error message is thrown in "LogCat". Can someone help, please? Thanks.
HelloAndroid Program
CC BY-SA 2.5
null
2010-10-28T14:59:23.323
2010-10-28T15:03:48.423
null
null
441,575
[ "android", "android-emulator" ]
4,044,146
1
4,044,236
null
2
901
I I want to show some kind of confirmation tick type thing by a textbox - (it's traditional windows forms stuff, not WPF) - but not sure if it's a bit naff. I would like some kind of slick way of showing that a value is incorrect or valid after some tests have been done i.e. a web service is valid with that name or SMTP server seems to running with that name etc. Should there be even any visual stuff going on or should a simple message on a status strip at the bottom of the window be enough..... Any ideas are most welcome. PS - if the tick thing is a good idea what's the best way to implement this with a textbox control. Example.... ![alt text](https://i.stack.imgur.com/1C03a.png)
Best practice for visual validation of textbox control data
CC BY-SA 2.5
null
2010-10-28T15:02:11.290
2010-10-28T15:12:59.410
null
null
5,175
[ "c#", "winforms", "validation" ]
4,044,759
1
4,045,533
null
0
541
For a small timer app I want to write a GTK interface where I can set the desired time. Here is a picture of the interface: ![alt text](https://i.stack.imgur.com/shq8D.png) However, I am having trouble reading out the fields of the spin buttons. My envisaged procedure for this is the following: 1. Read out the buttons using methods for each button Here is one of the methods that does this: ``` # Get the fields of the spinbuttons def get_seconds(self, widget, spin): self.rSeconds = spin.get_value_as_int() ``` It is then called like this: ``` button = gtk.Button("Start") button.connect("clicked", self.get_seconds, spinnerS) ``` 1. Create a timer object with the data from the buttons This is planned to be accomplished using this method: ``` # Create the timer object ... def prepare_timer(self, widget, hours, minutes, seconds, title, text): self.timer = eggTimer(hours, minutes, seconds, title, text) ``` Which is called here: ``` button.connect("clicked", self.prepare_timer, self.rHours, self.rMinutes, self.rSeconds, "some title", "some text") ``` Unfortunately, when running the script I get the following error message: ``` Traceback (most recent call last): File "GTKInterface.py", line 140, in <module> SpinButtonExample() File "GTKInterface.py", line 126, in __init__ button.connect("clicked", self.prepare_timer, self.rHours, self.rMinutes, self.rSeconds, "Title", "Text") AttributeError: SpinButtonExample instance has no attribute 'rSeconds' ``` To check whether there really is no instance of that variable, I programmed a short method to print it: ``` def returnS(self, widget): print self.rSeconds ``` And surprisingly this method "see" self.rSeconds. This makes me wonder what determines the visibility of the variable. What am I doing wrong to read this out?
How can I properly read out spin buttons in pyGTK?
CC BY-SA 2.5
0
2010-10-28T16:02:48.430
2010-10-28T17:42:46.853
2010-10-28T17:14:00.627
429,653
429,653
[ "python", "pygtk" ]
4,045,007
1
null
null
0
399
I made some changes to one of my web pages (CSS and HTML) and now Firefox is not rendering this textarea properly. It has a sort of jitter effect happening in the middle of the top line. I'm not sure if it has anything to do with the changes I made, but what could be causing this? ![alt text](https://i.stack.imgur.com/5VGa7.png) ``` <div id="CommentForm"> <form action="/posts/add-comment" method="post"> <input type="hidden" id="Table_Name" name="Table_Name" value="Posts" /> <input type="hidden" id="Table_ID" name="Table_ID" value="47" /> <input type="hidden" id="IsLiveBroadcast" name="IsLiveBroadcast" value="1" /> <textarea name="Comment_Body" id="Comment_Body" rows="1"></textarea> <div id="error-messages"></div> <input type="submit" class="floatRight" id="postComment" value="Post your response" /> </form> <div class="clear"></div> </div> ``` And the CSS being applied: ``` #live_broadcast_post #CommentForm { margin: 0; padding: 0; width: 460px; height: auto; background: none; } #live_broadcast_post #CommentForm textarea { font-family: "Lucida Grande",Verdana,"Bitstream Vera Sans",Arial,sans-serif; font-size: 12px; padding: 5px; width: 98%; } ``` The strange thing is that this wasn't happening before I made the changes, and now it only affects Firefox, not any other browser I have tested. ## Update: I noticed that when the page loads, it renders correctly. Only after an iframe (also on this page) is finished loading does the rendering change.
Why is Firefox not properly rendering this textarea element?
CC BY-SA 2.5
null
2010-10-28T16:25:09.030
2011-02-08T22:37:54.367
2020-06-20T09:12:55.060
-1
48,523
[ "firefox" ]
4,045,319
1
4,084,621
null
12
13,407
I'd like to create a linear transparent gradient to a div. Is there any way to do that with jquery? Or should I use some other library like raphaeljs? I'd like to achieve an effect like the following: ![alt text](https://i.stack.imgur.com/ijdoO.png)
Creating a linear transparent gradient to a div
CC BY-SA 2.5
0
2010-10-28T17:01:37.143
2014-09-12T09:05:12.277
2010-10-30T21:16:01.847
370,927
370,927
[ "javascript", "jquery", "css", "opacity", "raphael" ]
4,045,335
1
null
null
1
5,356
** Solved as of now. Please see Edit 2 and Edit 3 ** I am NHibernate Newbie- a week old but I though working with it will save me time on new project and not otherwise. I have been banging my head trying to get Nhibernate to save Parent - Child Collection to SQL server database. ![alt text](https://i.stack.imgur.com/LxFGD.jpg) My Class Map : ``` public class OrderMap : ClassMap<Order> { public OrderMap() { Table("orders"); Not.LazyLoad(); Id(x => x.Id,"id"); Map(x => x.Status, "status").CustomType(typeof(OrderStatus)).Not.Nullable(); Map(x => x.PurchaseOrder, "purchaseorder").Not.Nullable(); Map(x => x.SalesOrder, "salesorder").Not.Nullable(); Map(x => x.SupplierLocationId, "shipfrom").Not.Nullable(); Map(x => x.CustomerLocationId, "shipto").Not.Nullable(); Map(x => x.TypeOfShipment, "shipmenttype").CustomType(typeof (ShipmentType)).Not.Nullable(); HasMany(x => x.OrderLineItems).Table("orderitems").KeyColumns.Add("orderid").Cascade.All(); } } public class OrderLineMap : ClassMap<OrderLine> { public OrderLineMap() { Table("orderitems"); Not.LazyLoad(); Id(x => x.Id,"id"); Map(x => x.Order.Id, "orderid").Not.Insert().Not.Update(); Map(x => x.PartNumber, "partnumber"); Map(x => x.LineNumber, "linenumber"); Map(x => x.ReleaseNumber, "releasenumber"); Map(x => x.Quantity, "quantity"); Map(x => x.AttachedQuantity, "attached"); Map(x => x.ActivatedQuantity, "activated"); Map(x => x.ReshippedQuantity, "reshipped"); Map(x => x.ReturnRequestQuantity, "requestreturn"); Map(x => x.ReturnedToSupplierQuantity, "returnedtosupplier"); Map(x => x.ReturnedFromResellerQuantity, "returnedfromreseller"); Map(x => x.SplitQuantity, "split"); Map(x => x.CombineQuantity, "combine"); Map(x => x.Status, "status").CustomType(typeof(OrderLineStatus)); Map(x => x.ReferenceOrderId, "reforderid"); Map(x => x.ReferenceOrderLineId, "reforderlineid"); References(oi => oi.Order, "id"); } } ``` I am trying to do a operation. Now I was made to believe (from lot of other posts in SO and Blogs) that it is not possible unless I have a Orders class reference in OrderItems ![alt text](https://i.stack.imgur.com/nhI7S.png) I am doing testing through Nunit and NH Profiler and insert statement for orders is getting profiled... ``` OrderTesting.CreateNewOrder : FailedNHibernate.StaleStateException : Unexpected row count: 0; expected: 1 at NHibernate.AdoNet.Expectations.BasicExpectation.VerifyOutcomeNonBatched(Int32 rowCount, IDbCommand statement) at NHibernate.AdoNet.NonBatchingBatcher.AddToBatch(IExpectation expectation) at NHibernate.Persister.Collection.AbstractCollectionPersister.PerformInsert(Object ownerId, IPersistentCollection collection, IExpectation expectation, Object entry, Int32 index, Boolean useBatch, Boolean callable, ISessionImplementor session) at NHibernate.Persister.Collection.AbstractCollectionPersister.Recreate(IPersistentCollection collection, Object id, ISessionImplementor session) at NHibernate.Action.CollectionRecreateAction.Execute() at NHibernate.Engine.ActionQueue.Execute(IExecutable executable) at NHibernate.Engine.ActionQueue.ExecuteActions(IList list) at NHibernate.Engine.ActionQueue.ExecuteActions() at NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource session) at NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event) at NHibernate.Impl.SessionImpl.Flush() at NHibernate.Transaction.AdoTransaction.Commit() at Repository.OrderRepository.Save(Order entity) in OrderRepository.cs: line 30 ``` Any help will be appreciated on how to solve it. Thank you, Mar ### Edit: Update statement now seen in NH profiler after making changes as Joseph asked: ``` UPDATE orderitems SET partnumber = 670712 /* @p0 */, linenumber = 1 /* @p1 */, releasenumber = 1 /* @p2 */, quantity = 2 /* @p3 */, attached = 0 /* @p4 */, activated = 0 /* @p5 */, reshipped = 0 /* @p6 */, requestreturn = 0 /* @p7 */, returnedtosupplier = 0 /* @p8 */, returnedfromreseller = 0 /* @p9 */, split = 0 /* @p10 */, combine = 0 /* @p11 */, status = 0 /* @p12 */, reforderid = '00000000-0000-0000-0000-000000000000' /* @p13 */, reforderlineid = '00000000-0000-0000-0000-000000000000' /* @p14 */, orderid = NULL /* @p15 */ WHERE id = '66f8c7c6-ece6-47c6-93f0-b8e1975a96dc' /* @p16 */ ``` ### Edit 2: Resolution for Update Statements In the Child Class Map, change the ID line to: ``` Id(x => x.Id, "id").GeneratedBy.Assigned().UnsavedValue(null); ``` ### Edit 3: Improve inserts Based on the above code, NH profiler will show that for each object instance being persisted it will first generate a select statement based on which, it will determine if the object instance is new or dirty. To avoid it use Interceptor as [http://www.kkaok.pe.kr/doc/hibernate/reference/html/example-parentchild.html](http://www.kkaok.pe.kr/doc/hibernate/reference/html/example-parentchild.html) Navigate to the very bottom of the article where you will find about how to implement Interceptor. Persistent class will be your base class for your Entities that needs to be saved to database. Interceptor will need to be registered firing the session I have read that Interceptors have been replaced by events. Could not read a lot on it but Interceptor works great for me.
Fluent Nhibernate : Unexpected row count: 0; expected: 1
CC BY-SA 3.0
null
2010-10-28T17:03:07.853
2014-09-29T20:14:27.437
2014-09-29T20:14:27.437
241,211
148,819
[ "nhibernate", "fluent-nhibernate", "has-many" ]
4,045,414
1
null
null
6
9,967
I'm just using and realized that I get a ![alt text](https://i.stack.imgur.com/lVy2f.png) And I can't get ride of it... Biggest problem is that on other browser I do get the same behavior with this ghost CSS, and it's driving me crazy! On the image above I'm using Firefox 3.6.11 with Firebug 1.5.4 I have this `html.css` file nowhere in my Visual Studio Solution, how can I get ride of it as it's screwing my design with it's ``` ul, menu, dir { display:block; list-style-type:disc; margin-bottom:1em; margin-left:0; margin-right:0; margin-top:1em; padding-left-ltr-source:logical; padding-right-rtl-source:logical; padding-start-value:40px; } ```
where does `resource://gre/res/html.css` come from?
CC BY-SA 2.5
0
2010-10-28T17:14:28.160
2019-11-06T00:24:09.737
null
null
28,004
[ "css", "firefox", "firebug" ]
4,045,753
1
4,047,771
null
0
4,472
I have css code to do layout. i have basic header panel, footer, left panel, and center panel. I want to have left panel and center panel automatically stretch to bottom(blue and gray part all the way to black footer). is there any way to do that? following are my codes. thank you, ![alt text](https://i.stack.imgur.com/SUwRJ.jpg) ``` body { text-align: center; } .wrapper { position: relative; width: 960px; font-size: 0.9em; margin: 0 auto -20px; text-align: left; } .header { height: 125px; background-color:purple; } .footer { position: relative; width: 960px; margin: 0 auto; background-color:black; } .footer a { color: #fff; text-decoration: underline; border: 0; } .footer p { position: absolute; left: 0; bottom: 4px; width: 960px; padding: 0; color: #fff; font: 0.8em arial,sans-serif; text-align: center; } html, body { height: 100%; } .wrapper { min-height: 100%; height: auto !important; height: 100%; margin: 0 auto -20px; /* the bottom margin is the negative value of the footer's height */ background-color:yellow; } .footer, .push { height: 20px; /* .push must be the same height as .footer */ } .leftPanel{ width:200px; background-color:blue; float:left; height: 100%; } .centerPanel{ width:760px; background-color:gray; float:left; height: 100%; } dl,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,body,html,div,p,blockquote,fieldset,legend,input,select,textarea { margin:0; padding:0 } ``` ``` <div class="wrapper"> <div class="header"> <h1>header</h1> </div> <div class="leftPanel"> leftPanel </div> <div class="centerPanel"> center Panel </div> <div class="push"></div> </div> <div class="footer"> <p>footer</p> </div> </body> ```
CSS layout 100% height extends to bottom bar
CC BY-SA 2.5
0
2010-10-28T17:56:23.097
2013-09-10T14:52:32.400
null
null
450,795
[ "css" ]
4,046,304
1
4,046,544
null
0
287
Here's my full markup: ``` <%@page Title="" Language="VB" MasterPageFile="~/Master Pages/MasterPage.master" AutoEventWireup="false" CodeFile="Statistics.aspx.vb" Inherits="Statistics" %> <%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server"> </asp:Content> <asp:Content ID="Content3" ContentPlaceHolderID="phPageContent" runat="Server"> <asp:Label ID="Label1" runat="server" Text="Label" CssClass="CaptionLabel"></asp:Label> <asp:DropDownList ID="DropDownList1" runat="server" CssClass="DefaultDropDown" /> <asp:Chart ID="Chart1" runat="server" Height="438px" Width="877px" Palette="Bright"> <Series> <asp:Series ChartArea="ChartArea1" ChartType="Line" Legend="Legend1" Name="Clicks"> </asp:Series> <asp:Series ChartArea="ChartArea1" ChartType="Line" Legend="Legend1" Name="Conversions"> </asp:Series> </Series> <ChartAreas> <asp:ChartArea Name="ChartArea1"> <AxisY Title="Count" TitleFont="Microsoft Sans Serif, 10pt"> </AxisY> <AxisX Title="Month" TitleFont="Microsoft Sans Serif, 10pt"> </AxisX> <AxisY2 TextOrientation="Rotated270" Title="Commission (USD)" TitleFont="Microsoft Sans Serif, 12pt, style=Bold"> </AxisY2> </asp:ChartArea> </ChartAreas> <Legends> <asp:Legend Name="Legend1" Title="Legend"> <CellColumns> <asp:LegendCellColumn Name="Column1" Text="#SERIESNAME"> <Margins Left="15" Right="15" /> </asp:LegendCellColumn> <asp:LegendCellColumn ColumnType="SeriesSymbol" Name="Column2"> <Margins Left="15" Right="15" /> </asp:LegendCellColumn> </CellColumns> </asp:Legend> </Legends> <Titles> <asp:Title Font="Microsoft Sans Serif, 12pt" Name="Title1" Text="Monthly Clicks and Conversions "> </asp:Title> </Titles> </asp:Chart> </asp:Content> ``` And here's how it renders. The code behind simply adds the points. ![alt text](https://i.stack.imgur.com/u4JqQ.png)
ASP.NET markup has two controls, A, then B. Why does B appear first?
CC BY-SA 2.5
null
2010-10-28T19:03:53.617
2010-10-28T19:34:56.920
2010-10-28T19:10:27.127
1,583
109,676
[ "asp.net", "user-interface" ]
4,046,804
1
4,318,826
null
1
1,478
I have 2 table stacked at a single page,one for filtering previous year and 2nd table for the current year and i pass in the same value from the DataSet to these two table , the only difference is that i need to filter it with the year using the Tablix Properties. Right now i am filtering the Year with the hardcoded value like 2008,2009 for 2nd table. I planned to do it dynamically, so i created another DataSet (DS2) and tried to put it in the `fx(Expression) as =First(Fields!Year1.Value, "DataSet2")` in the Filter in the Value Textbox just like the diagram. but i get ``` Error as : A FilterValue for the tablix ‘Tablix1’ includes an aggregate function. Aggregate functions cannot be used in dataset filters or data region filters. ``` i tried to use parameters, but it doen't return any table. any help would be appreciated. ![alt text](https://i.stack.imgur.com/wTzJT.png)
Pass Value from one DataSet to another DataSet to filter row in Reporting Services 2008
CC BY-SA 2.5
null
2010-10-28T20:13:56.033
2011-01-24T11:53:54.567
2011-01-24T11:53:54.567
573,261
178,769
[ "c#", "sql-server-2008", "ssrs-2008", "ssrs-tablix" ]
4,047,249
1
null
null
0
1,628
Looking through some html email examples, I noticed is all about tables. I wanted an image inside of one of the rows of the main table to look like half of the image is outside the table and the other half inside. I can't get the solution to do that. Any helps would be appreciated, really appreciated Here's is what I like. ![alt text](https://i.stack.imgur.com/NunID.png) The orange thin line would be the table border I got it working int the webpage where I can use divs and a lot of stylesheet but in html embedded in email haven't found the way. As you can see there's text and images above the image
place background image outside of a <table> <td> <tr> borders in embedded html mail
CC BY-SA 2.5
null
2010-10-28T21:18:54.243
2010-10-28T22:02:21.993
2020-06-20T09:12:55.060
-1
287,796
[ "html", "css", "html-email" ]
4,047,333
1
4,047,571
null
0
311
I really like a certain Silverlight feature that I've seen in a couple of sites. I would like to know what this "concept(s)" is/are so I can do more research and implemented it on my own. If you see the attached image, I like those expandable sections, reference (1) and (2) sections. They are circled in red and the features that I like are green and expandable. For a live demo: [http://demos.telerik.com/silverlight/#DataPager/FirstLook](http://demos.telerik.com/silverlight/#DataPager/FirstLook) ![alt text](https://i.stack.imgur.com/GrWED.png) Thanks for any advice.
Silverlight Guidance - How to do this from Telerik? (reference attached image)
CC BY-SA 2.5
0
2010-10-28T21:31:18.743
2011-09-27T16:51:36.620
null
null
118,190
[ "silverlight", "telerik" ]
4,048,012
1
4,048,036
null
0
336
I have a UILabel in a UITableCell, and when I make the label's background transparent, I get these strange ghost characters (see image below), and it looks terrible. Here's my code: Left: ``` UILabel *unreadLabel = [[UILabel alloc] initWithFrame:CGRectMake(270, 7, 25, 25)]; unreadLabel.text = [NSString stringWithFormat:@"%d", source.unreadCount]; unreadLabel.textColor = [UIColor colorWithWhite:100.0f/255.0f alpha:1.0]; unreadLabel.font = [UIFont systemFontOfSize:11.0f]; [cell addSubview:unreadLabel]; [unreadLabel release]; ``` Right is the same as the left but with this added: ``` unreadLabel.backgroundColor = [UIColor colorWithWhite:1.0 alpha:0.0]; ``` UnreadCount is a NSInteger. ![alt text](https://i.stack.imgur.com/DWac4.png)
UILabel ghosting when printing NSInteger with transparent background
CC BY-SA 2.5
null
2010-10-28T23:44:48.943
2010-10-28T23:52:46.743
null
null
310,385
[ "iphone", "objective-c", "uilabel" ]
4,048,056
1
4,068,668
null
2
4,364
I currently have a `Use Case Diagram` that is similar to the above one: ![alt text](https://i.stack.imgur.com/2T3wx.jpg) In my final application I will probably share the same `Login` form for both `Employees` and `Employers`. Should I reflect that in this `Use Case Diagram`, having both `Actors` using the same `Login` `Use Case`? If so, how can I then represent what each one of them can do after doing the `Login`?
Should different actors in a Use Case Diagram share the same Login Use Case?
CC BY-SA 2.5
0
2010-10-28T23:57:15.747
2010-11-01T12:02:28.127
null
null
130,758
[ "use-case", "uml" ]
4,048,389
1
4,048,420
null
1
4,827
I have a logo that is a transparent png and i want to overlay it on my bg image but when i do it shows only the background color. Here is an example: ![failed transparency](https://i.stack.imgur.com/IkRy6.png) I am using a modified copy of the WP theme Colourise The Css is here: [http://files01.s0urc3.ismywebsite.com/colourise/style.css](http://files01.s0urc3.ismywebsite.com/colourise/style.css) And the page here: [http://s0urc3.ismywebsite.com/index.php](http://s0urc3.ismywebsite.com/index.php)
Transparent png not showing bg image just bg color in html
CC BY-SA 2.5
null
2010-10-29T01:38:43.157
2010-10-29T01:51:51.620
null
null
null
[ "html", "css", "png", "transparency", "background-color" ]
4,048,528
1
4,048,664
null
0
5,909
How to add pause button in this jQuery image slider? I want to add button at last after ? Like this: see example pic [http://shup.com/Shup/431390/110929231254-My-Desktop.png](http://shup.com/Shup/431390/110929231254-My-Desktop.png) ![alt text](https://i.stack.imgur.com/gTcRl.png) [http://www.sohtanaka.com/web-design/examples/image-slider/](http://www.sohtanaka.com/web-design/examples/image-slider/) I want add another link button to pause the slider on current slide. and it should not rewind to 1st slide. I need like a toogle button to on/off the animation. This is html code of buttons. ``` <div class="paging"> <a href="#" rel="1">1</a> <a href="#" rel="2">2</a> <a href="#" rel="3">3</a> <a href="#" rel="4">4</a> </div> ``` This is jquery code of buttons. ``` $(document).ready(function () { //Set Default State of each portfolio piece $(".paging").show(); $(".paging a:first").addClass("active"); //Get size of images, how many there are, then determin the size of the image reel. var imageWidth = $(".window").width(); var imageSum = $(".image_reel img").size(); var imageReelWidth = imageWidth * imageSum; //Adjust the image reel to its new size $(".image_reel").css({ 'width': imageReelWidth }); //Paging + Slider Function rotate = function () { var triggerID = $active.attr("rel") - 1; //Get number of times to slide var image_reelPosition = triggerID * imageWidth; //Determines the distance the image reel needs to slide $(".paging a").removeClass('active'); //Remove all active class $active.addClass('active'); //Add active class (the $active is declared in the rotateSwitch function) //Slider Animation $(".image_reel").animate({ left: -image_reelPosition }, 500); }; //Rotation + Timing Event rotateSwitch = function () { play = setInterval(function () { //Set timer - this will repeat itself every 3 seconds $active = $('.paging a.active').next(); if ($active.length === 0) { //If paging reaches the end... $active = $('.paging a:first'); //go back to first } rotate(); //Trigger the paging and slider function }, 7000); //Timer speed in milliseconds (3 seconds) }; rotateSwitch(); //Run function on launch //On Hover $(".image_reel a").hover(function () { clearInterval(play); //Stop the rotation }, function () { rotateSwitch(); //Resume rotation }); //On Click $(".paging a").click(function () { $active = $(this); //Activate the clicked paging //Reset Timer clearInterval(play); //Stop the rotation rotate(); //Trigger rotation immediately rotateSwitch(); // Resume rotation return false; //Prevent browser jump to link anchor }); }); ``` Try here with live editable example [http://jsfiddle.net/3TJrj/128/](http://jsfiddle.net/3TJrj/128/)
How to add "pause" button in this jquery slider?
CC BY-SA 3.0
null
2010-10-29T02:23:24.570
2013-04-06T04:43:40.300
2013-04-06T04:43:40.300
969,612
84,201
[ "javascript", "jquery", "css", "xhtml", "slider" ]
4,048,682
1
4,048,703
null
5
843
I have tried to remove specific items from a listview using the `RemoveAt()` method. But When I remove it the first time some items will stay. For example: see the image below ![alt text](https://i.stack.imgur.com/jyLeg.jpg) ``` private void button1_Click(object sender, EventArgs e) { for (int i = 0; i < listView1.Items.Count; i++) { if (listView1.Items[i].SubItems[0].Text == "A1") { listView1.Items.RemoveAt(i); } } } private void Form1_Load(object sender, EventArgs e) { for(int i = 0; i<3; i++) { ListViewItem lvi = new ListViewItem("A1"); lvi.SubItems.AddRange(new string[] {"desc" + i.ToString(), i.ToString()}); listView1.Items.Add(lvi); } for (int i = 0; i < 2; i++) { ListViewItem lvi = new ListViewItem("A2"); lvi.SubItems.AddRange(new string[] { "desc" + i.ToString(), i.ToString() }); listView1.Items.Add(lvi); } } ```
Specified items will not be deleted when using ListView.Item.RemoveAt()
CC BY-SA 2.5
null
2010-10-29T03:05:00.153
2010-11-01T16:16:21.453
null
null
416,801
[ "c#", "winforms", "listview", "listviewitem" ]
4,048,712
1
null
null
0
405
I am working on a sinatra app with datamapper connected to a mysql database and am having problems retrieving/finding records from only one specific table. I can insert into it with datamapper find but when I try to do @sleepEntries = Sleep_Log.all I get the following error: ArgumentError: argument out of range. When I load everything into irb I get the same error. I also turned on the ability to see the queries and I get back SELECT `id`, `start_time`, `length`, `timestamp` FROM `sleep_logs` ORDER BY `id` when I call Sleep_Log.all. When I connect to the mysql database through the mysql command line tool I can confirm that there are entries in that table. When I run the query that datamapper is erroring out on I have no problem getting the results. Here is my datamapper model info for Sleep_Log ``` class Sleep_Log include DataMapper::Resource property :id, Serial property :start_time, Time, :required => true property :length, Integer, :required => true property :timestamp, DateTime, :writer => :private belongs_to :user end ``` This is what the table looks like in the database accessed through describe sleep_logs; ![alt text](https://i.stack.imgur.com/Losd4.gif) What is weird is that retrieve results from all other tables. The backtrace from irb ![alt text](https://i.stack.imgur.com/GQlz4.gif)
can't find/retrieve results from a specific table with datamapper
CC BY-SA 2.5
null
2010-10-29T03:14:48.223
2011-04-22T20:28:45.700
2010-10-29T08:04:04.330
485,810
485,810
[ "ruby", "sinatra", "haml", "datamapper" ]
4,048,894
1
4,048,913
null
4
5,193
I'm wanting to make a password unlock screen for my app, and I'm not sure how I'd go about it. I'm wanting it to look like the Apple-designed version of it, which is the passcode lock setting screen. ![alt text](https://i.stack.imgur.com/NlsFi.png) How might I go about doing something like this, where as soon as all four digits are entered the code is immediately checked against a pre-set password? Thanks!
Making a password lock for an app?
CC BY-SA 2.5
0
2010-10-29T04:03:09.087
2014-01-17T03:28:23.150
null
null
456,851
[ "iphone", "objective-c", "locking", "passwords" ]
4,049,104
1
4,053,735
null
0
1,105
In one of my apps, I have a custom drawn semitransparent `UIView` that I use as a cover on top of another UIView for a special effect. Lower View: ![alt text](https://i.stack.imgur.com/sYAdV.png) Lower View with Custom View on Top: ![alt text](https://i.stack.imgur.com/kIBlu.png) It works, its great on the iPhone where the side margins are only 10 pixels, but now I need to expand the left and right margins to match the row below it. Here is my code: ``` - (void)draw:(TTStyleContext*)context { CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextSaveGState(ctx); [_color setStroke]; CGContextSetLineWidth(ctx, MIN(_xwidth, _ywidth)); CGFloat fw = context.frame.size.width; CGFloat fh = context.frame.size.height; CGContextMoveToPoint(ctx, fw, floor(fh/2)); CGContextAddArcToPoint(ctx, fw, fh, floor(fw/2), fh, RD(_radius)); CGContextAddArcToPoint(ctx, 0, fh, 0, floor(fh/2), RD(_radius)); CGContextAddArcToPoint(ctx, 0, 0, floor(fw/2), 0, RD(_radius)); CGContextAddArcToPoint(ctx, fw, 0, fw, floor(fh/2), RD(_radius)); CGContextClosePath(ctx); CGContextStrokePath(ctx); CGContextRestoreGState(ctx); context.frame = CGRectInset(context.frame, _xwidth/2, _ywidth/2); return [self.next draw:context]; } ``` After setting the `_xwidth` and `_ywidth`, the key part of this code is the `MIN` for the stroke width. The idea here is that the frame is by default, the same stroke width all around. What I am asking it to do is make the stroke width bigger on the sides than on the top and bottom. Using `MIN` ensures that the stroke does not get the thicker `_xwidth` size and bleed into the center. If I use the `_ywidth` value, the sides look great but I don't get the transparent red anymore because the top and bottom borders bleed into the center. This brings me to my question: `_xwidth``_ywidth` If not, is there another easier way I am overlooking? With my code, _xwidth set to 42, _ywidth set to 10, I get this: ![alt text](https://i.stack.imgur.com/HZcyt.png) You can see what I am going for here, and how I need to get the side stroke to cover up the uncovered red background.
CGContextSetLineWidth of varying width around path
CC BY-SA 2.5
0
2010-10-29T05:01:08.127
2014-03-08T17:50:24.897
null
null
69,634
[ "iphone", "cocoa", "cocoa-touch", "core-graphics" ]
4,049,120
1
null
null
0
649
I've had this app on app store with no problem until iphone 4 came out. My home page has an image covering the whole screen. UIImageView added in interface builder, and image path added in interface builder. In all phones this image shows up; however, the image does not show up in any iphone 4, and instead the user sees a blank screen like the following: Anybody knows what's causing this? thanks ![store](https://i.stack.imgur.com/jgp1F.png) ## . - I only have 1 set of images with normal resolution- This problem only happens to one of the images in my application which is the background for my home page- the graphic file should not be corrupted because the exact same image works for all other iphones and itouches- my image is a jpg file- image size is 480x270, which in interface builder i make it 563x330 to display only a part of it- I have no outlet to this uiimageview so it cannot be changed in code
iphone 4 - Application doesn't show image?
CC BY-SA 2.5
0
2010-10-29T05:04:28.677
2013-09-08T19:03:03.157
2020-06-20T09:12:55.060
-1
242,769
[ "uiimageview", "iphone-4" ]
4,049,666
1
null
null
6
10,991
i want to change layout without calling the onCreate method. i also define android:configChanges="orientation|keyboardHidden" in my activity and it is not calling the onCreate method but the layout not adjust appropriately on landscape mode. my current layout look like as follows. ![alt text](https://i.stack.imgur.com/2QHYX.png) after change orientation as landscape it look like as follows: ![alt text](https://i.stack.imgur.com/8utAA.png) but on landscape i want the following result. ![alt text](https://i.stack.imgur.com/WaUqm.png) is there any auto adjacent property? how can i do it?
change orientation without onCreate call
CC BY-SA 2.5
0
2010-10-29T06:58:17.867
2014-06-20T03:53:10.073
null
null
309,990
[ "android" ]
4,049,643
1
4,049,687
null
1
1,043
I've got the following mapping in my application. The mapping is generated, by a custom tool. Other mappings generated work ok, but this one is giving me a strange error which I don't understand. This is the mapping; ``` <?xml version="1.0" encoding="utf-8"?> <!--Generated by NHibernate.Mapping.Attributes on 2010-10-29 08:39:48Z.--> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> <class name="Plugin.Twitter.Business.Entities.Tweet, Plugin.Twitter" table="PluginTwitter_Tweet"> <id name="Id" column="Id"> <generator class="guid" /> </id> <property name="TweetMessage" /> <property name="TweetDate" /> <property name="TweetId" /> </class> </hibernate-mapping> ``` This is the error which i'm getting in the browser when i trying to open the website containing the mapping file; ![Mapping Error](https://i.stack.imgur.com/7NbeM.png) The stacktrace with it is as below; ``` [InvalidOperationException: Could not find the dialect in the configuration] NHibernate.Dialect.Dialect.GetDialect(IDictionary 2 props) +204 NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc) +155 [MappingException: Could not compile the mapping document: Plugin.Twitter.Business.Entities.Hbm.Tweet.hbm.xml] NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc) +534 NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream, String name) +378 NHibernate.Cfg.Configuration.AddResource(String path, Assembly assembly) +419 NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly) +355 NHibernate.Cfg.Configuration.AddAssembly(String assemblyName) +291 CMS.ResourceAccess.DataAccessLogic.SessionManagement.SessionManager..ctor() in C:\Projects\Website\Website.ResourceAccess\DataAccessLogic\SessionManagement\SessionManager.cs:73 Website.ResourceAccess.DataAccessLogic.SessionManagement.NestedSessionManager..cctor() in C:\Projects\Website\Website.ResourceAccess\DataAccessLogic\SessionManagement\SessionManager.cs:90 [TypeInitializationException: The type initializer for 'NestedSessionManager' threw an exception.] Website.ResourceAccess.DataAccessLogic.SessionManagement.SessionManager.get_Instance() in C:\Projects\Website\Website.ResourceAccess\DataAccessLogic\SessionManagement\SessionManager.cs:39 CMS.ResourceAccess.DataAccessLogic.SessionManagement.SessionManager.get_SessionFactory() in C:\Projects\Website\Website.ResourceAccess\DataAccessLogic\SessionManagement\SessionManager.cs:23 Website.Backend.MvcApplication.StartNHibernateSession() in C:\Projects\Website\Website.Web\Global.asax.cs:82 Website.Backend.MvcApplication.Application_Start() in C:\Projects\Website\Website.Web\Global.asax.cs:47 [HttpException (0x80004005): The type initializer for 'NestedSessionManager' threw an exception.] System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +3988565 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +191 System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +325 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +407 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +375 [HttpException (0x80004005): The type initializer for 'NestedSessionManager' threw an exception.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11529072 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4784373 ``` I think the import thing to notice is that the exception i'm getting is an mapping exception as shown with this rule; ``` MappingException: Could not compile the mapping document: Plugin.Twitter.Business.Entities.Hbm.Tweet.hbm.xml] ``` I don't understand how and why though so I hope someone can tell me what the error means and how I can fix this issue. I've got the mapping marked as embedded resource. UPDATE: We're using the following hibernate.cfg.xml file in the application. ``` <?xml version="1.0" encoding="utf-8" ?> <hibernate-configuration xmlns='urn:nhibernate-configuration-2.2'> <session-factory> <property name="show_sql">true</property> <property name="dialect">NHibernate.Dialect.MsSql2008Dialect</property> <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property> <property name="connection.connection_string_name">NHibernate</property> <property name="current_session_context_class">managed_web</property> <property name='proxyfactory.factory_class'>NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property> <!--Needed for NH Profiler--> <property name="generate_statistics">false</property> </session-factory> </hibernate-configuration> ```
C# mvc2 nhibernate problem
CC BY-SA 2.5
null
2010-10-29T06:52:44.530
2010-10-29T07:30:37.570
2010-10-29T07:30:37.570
291,293
291,293
[ "c#", "asp.net-mvc", "nhibernate", "asp.net-mvc-2", "nhibernate-mapping" ]
4,050,145
1
7,512,505
null
0
855
i want to build a component that will be able to show a integer number max 5 digits in the style of the old analog car counters and animate the digit change. that looks something like this maybe... ![alt text](https://i.stack.imgur.com/lR5KR.jpg) i have tried searching for this kinda of examples but i couldn't find anything so far. in your opinion what is the best approach to achieve this? i looked at the iphone alarm time picker and as far as i can tell there is only a fixed background and they push the numbers in or out the view. but how do i place the digits in this case and reference them to a particular value? tnx.
animate number change
CC BY-SA 2.5
0
2010-10-29T08:17:53.073
2012-12-17T21:48:38.207
null
null
448,192
[ "android", "uiviewanimation" ]
4,050,169
1
4,080,722
null
3
1,327
This is weird. I have a with a button inside. I have added a to this button whose command target is another user control which is again added to the same window. What could be the reason. Am I missing something in here ?!? *A better representation of my words as an image. Also I have uploaded my source code with binaries @ [https://code.google.com/p/commandbindingsample/](https://code.google.com/p/commandbindingsample/) and at [http://cid-6fc1e241d4534589.office.live.com/embedicon.aspx/Wpf%20Samples/CommandBinding.zip](http://cid-6fc1e241d4534589.office.live.com/embedicon.aspx/Wpf%20Samples/CommandBinding.zip) (not versioned) * ![alt text](https://i.stack.imgur.com/Be2pd.png)
Command Binding not working when the host control is added programatically in wpf
CC BY-SA 2.5
0
2010-10-29T08:23:36.233
2010-11-02T18:07:34.450
2010-11-02T04:50:27.437
119,044
119,044
[ "wpf", "xaml", "user-controls", "command", "commandbinding" ]
4,050,303
1
4,050,486
null
3
4,406
I am creating a Text Editor Type app. I can have multiple editors open via tabs. In my first try, I used simple `TextBox`es to edit text. Everything worked ok. Then I created a `UserControl` encapsulating the text box + buttons to perform text manipulation eg. bold/italic etc. I found out that when I open different tabs, they all contain the same content. eg. In Tab1 i enter "hello world" that will appear in all tabs. There is "no separation" even though they are in different tabs ``` <Window.Resources> <DataTemplate DataType="{x:Type vm:EditorTabViewModel}"> <me:MarkdownEditor /> </DataTemplate> </Window.Resources> ``` I then as a test, tried a textbox and the usercontrol together to see if I have the same problem. ``` <Window.Resources> <DataTemplate DataType="{x:Type vm:EditorTabViewModel}"> <StackPanel> <me:MarkdownEditor Text="{Binding Content}" Height="360" /> <TextBox Text="{Binding Content}" Height="360" /> </StackPanel> </DataTemplate> </Window.Resources> ``` I then discovered a few strange things. With a new document, where content should be nothing, my `MarkdownEditor` had "System.Windows.Controls.Grid" in its text box as it a Grid was bound to the text. Text simple `TextBox` works as expected. Also I still had the same problem with all `UserControl`s in the app having the same content. `UserControl` ``` <UserControl x:Class="MarkdownEditMVVM.Controls.MarkdownEditor.MarkdownEditor" ...> <Grid> <ToolBar Grid.Row="0"> <Button Command="{x:Static local:Commands.PreviewCommand}"> <Image Source="../../Images/16/zoom.png" /> </Button> <!-- more buttons --> </ToolBar> <TextBox Grid.Row="1" x:Name="txtEditor" AcceptsReturn="True" Text="{Binding Path=Text, UpdateSourceTrigger=PropertyChanged}" /> </Grid> </UserControl> ``` # Update I discovered that this has something to do with the way I have usercontrols rendered in the tabs where tabs are bound to `ObservableCollection<TabViewModel>` Suppose I have a `TabViewModel` even just a empty class ``` public class TabViewModel {} ``` Then in my ``` public partial class Window1 : Window { protected ObservableCollection<TabViewModel> _tabs; protected ICollectionView _tabsCollectionView; public Window1() { InitializeComponent(); this.DataContext = this; _tabs = new ObservableCollection<TabViewModel>(); _tabs.Add(new TabViewModel()); _tabs.Add(new TabViewModel()); _tabsCollectionView = CollectionViewSource.GetDefaultView(_tabs); } public ICollectionView Tabs { get { return _tabsCollectionView; } } } ``` ``` <TabControl ItemsSource="{Binding Tabs}" IsSynchronizedWithCurrentItem="True"> <TabControl.ItemTemplate> <DataTemplate> <TextBlock /> </DataTemplate> </TabControl.ItemTemplate> <TabControl.ContentTemplate> <DataTemplate> <TextBox /> </DataTemplate> </TabControl.ContentTemplate> </TabControl> ``` I have created a simple Visual Studio Project hosted @[mediafire](http://www.mediafire.com/?61aydndajjj6o3n) illustrating this problem. I have a feeling it got something to do with the `TabViewModel`s or the Tab Data Templates # Update 2 I further tested the user control problem by adding another tab control, this time without the `TabViewModel` ``` <TabControl Grid.Column="1"> <TabItem Header="Tab 1"> <TextBox /> </TabItem> <TabItem Header="Tab 2"> <TextBox /> </TabItem> </TabControl> ``` It all worked ok. update also posted to [mediafire](http://www.mediafire.com/?mcf7960f84tpn28) # Update 3 Made yet another finding. This time, I tested with a binding. things worked fine ... ``` <TabControl Grid.Column="2" ItemsSource="{Binding Tabs}" IsSynchronizedWithCurrentItem="True"> <TabControl.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding TabTitle}" /> </DataTemplate> </TabControl.ItemTemplate> <TabControl.ContentTemplate> <DataTemplate> <TextBox Text="{Binding Text}" /> </DataTemplate> </TabControl.ContentTemplate> </TabControl> ``` Update also posted @[mediafire](http://www.mediafire.com/?zcszjzgux0xysdn) # Update 4 Ok now I did a more complete set of tests ![alt text](https://i.stack.imgur.com/nm2WH.jpg) - `TextBox``ObservableCollection<TabViewModel>``TextBox`- `ObservableCollection<TabViewModel>``TextBox`- `ObservableCollection<TabViewModel>``TextBox`- `UserControl``ObservableCollection<TabViewModel>``UserControl`- `UserControl``ObservableCollection<TabViewModel>``UserControl` Update @[mediafire](http://www.mediafire.com/?8sheh265ah0875v)
Can I have multiple instances of the same UserControl in 1 app?
CC BY-SA 2.5
null
2010-10-29T08:42:44.833
2010-11-06T11:49:57.693
2010-10-30T15:05:03.720
229,044
292,291
[ "c#", "wpf", "user-controls", "mvvm", "tabcontrol" ]
4,050,653
1
4,098,795
null
0
653
im working a project lately to get download progress info remotely when im away. i googled a bit but i couldnt find any useful info. on this issue im using Internet Download Manager. please help :/ i appreciate any suggestions im thinking about making software with python but Also C is Ok. if there is a solution ![alt text](https://i.stack.imgur.com/y6oVx.jpg)
How to get download progress info from I.D.Manager to python?
CC BY-SA 2.5
0
2010-10-29T09:36:26.377
2010-11-04T16:22:02.237
2010-10-29T13:27:09.153
401,006
401,006
[ "python", "download", "status" ]
4,050,651
1
4,050,698
null
1
105
Here's my issue, I'm using a namespace to remove ambiguity from a factory class which is creating domain objects from entity framework entity objects (a POCO factory,.. if that makes sense!). Call me old fashioned but I like things this way :-) The namespaces I'm working with are aliased as such - ``` using Entities = DataAccess.Models.AccessControl; using Cases = DomainModel.BusinessObjects.Implimentations.Cases; ``` Now, the `DomainModel.BusinessObjects.Implimentations.Cases` namespace only has one type so far called `CaseType`. However whilst I was working on another type which consumes the `CaseType` class I noticed that when I 'dot' into the `Cases` alias, it points to a totally different namespace in my `DataAccess` assembly and gives me the `CaseTypeFactory` in intellisense. ![alt text](https://i.stack.imgur.com/WLU2O.jpg) So I checked the `CaseType` and `CaseTypeFactory` classes and they are namespaced correctly. What in god's name is going on? I really can't work this one out. Here's the code for the `CaseType` and `CaseTypeFactory` if it helps. ``` using Domain = DomainModel.BusinessObjects.Implimentations.Cases; using Entities = DataAccess.Models.AccessControl; using Interfaces.DataAccess; namespace DataAccess.Factories.Cases { public class CaseTypeFactory : IEntityPOCOFactory<Domain.CaseType, Entities.CaseType> { #region IEntityPOCOFactory<CaseType,CaseType> Members public Domain.CaseType CreatePOCO(Entities.CaseType entity) { return new Domain.CaseType(entity.Id, entity.Name, entity.LastChanged); } public IList<Domain.CaseType> CreatePOCOs( IEnumerable<Entities.CaseType> entities) { var toReturn = new List<Domain.CaseType>(); foreach (var entity in entities) { toReturn.Add(CreatePOCO(entity)); } return toReturn; } #endregion } } ``` ``` using System; using System.Collections.Generic; using System.Linq; using System.Text; using DomainModel.BusinessObjects.Base; namespace DomainModel.BusinessObjects.Implimentations.Cases { public class CaseType : NamedNumberedAndVersioned { public CaseType(string name, DateTime lastChanged) : this(0, name, lastChanged) { } public CaseType(int id, string name, DateTime lastChanged) : base(id, name, lastChanged) { } public void Update(string name) { this.Name = name; } } } ``` It's probably worth mentioning I'm working with .Net 4.0 / VS2010 help would be massively appreciated. Thanks in advance.
Odd bug in C#4 compiler? Alias namespaces getting mixed up
CC BY-SA 2.5
null
2010-10-29T09:36:01.393
2010-10-29T09:43:13.703
null
null
5,559
[ "visual-studio-2010", "c#-4.0", "alias" ]
4,050,749
1
4,051,432
null
1
5,239
this is a question how to override themable items in Drupal 6. According to the book "Pro Drupal Development", we can override themable items in two ways: 1. overriding via Theme functions 2. overriding via Template files So for example, in order to reformat the breadcrumb, I can: 1. via function theme_breadcrumb($breadcrumb) 2. via breadcrumb.tpl.php But on my local testing server, the second approach (i.e. via template file) is not working! I see no breadcrumbs at all, while the first approach works fine. Any idea how could this happen? any special settings I need to configure my Drupal? thanks! My custom theme "greyscale": sites\all\themes\custom\greyscale: - breadcrumb.tpl.php - greyscale.info - node.tpl.php - page.tpl.php - style.css - template.php relevant file contents: * template.php: ``` function phptemplate_preprocess_breadcrumb(&$variables) { $variables['breadcrumb_delimiter'] = '#'; } ``` - ![alt text](https://i.stack.imgur.com/lwvVa.jpg)
Why is Drupal not aware of my template file?
CC BY-SA 2.5
null
2010-10-29T09:49:14.760
2010-10-29T13:32:45.567
2010-10-29T11:20:05.217
33,006
462,547
[ "drupal", "themes" ]
4,050,786
1
null
null
0
378
I set up the facebook like button on my blog and when I click "LIKE", on my facebook profile, it says "XXX (my name) likes Yeok-Rin « GOINGNOWHERE on raw.herobo.com." Only problem is that at facebook recent activity page, it doesn't show the link, as shown here --- ![Example image](https://i.stack.imgur.com/JXmof.jpg) --- I "liked" a random post and a post from my blog and the one below has a link (blue text with underline) while my post just comes out as a text. raw.herobo.com/blog/ (again, i can only place one link yet) is my blog, and you can try clicking "LIKE" yourself. Anyone knows how to fix it? Thank you.
facebook "LIKE" button on Wordpress blog doesn't create a link on facebook?
CC BY-SA 2.5
null
2010-10-29T09:54:21.290
2014-02-21T16:03:57.677
2011-08-26T12:04:16.147
764,846
491,141
[ "facebook", "wordpress", "hyperlink", "facebook-like" ]
4,050,860
1
null
null
0
1,095
I'm trying to set up a new Zend project using Zend Server CE under OS X 10.6 First, I have downloaded and successfully installed Zend Server CE: opening `http://localhost:10081` in my browser shows the dashboard, and everything seems to be working fine. Than I created a new project, following the tutorial: ``` $ cd /usr/local/zend/apache2/htdocs $ /usr/local/zend/share/ZendFramework/bin/zf.sh create project quickstart ``` The project was created without errors. Then I added ``` <VirtualHost quickstart.local:10088> ServerName quickstart.local DocumentRoot /usr/local/zend/apache2/htdocs/quickstart SetEnv APPLICATION_ENV "development" <Directory /usr/local/zend/apache2/htdocs/quickstart> DirectoryIndex index.php AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost> ``` to the `/usr/local/zend/apache2/conf/extra/httpd-vhosts.conf` file and the entry `127.0.0.1 quickstart.local` to my `/etc/hosts/` file. Finally, I restarted the Apache bundled with Zend Server CE. But now, if I open [http://quickstart.local:10088/](http://quickstart.local:10088/) in my browser, I see this: ![alt text](https://i.stack.imgur.com/7Yvxf.png) instead of the default index view I was expecting. What a I missing? Thanks.
Set up a Zend project in OS X
CC BY-SA 2.5
0
2010-10-29T10:07:10.720
2013-02-15T01:57:41.790
2010-10-30T13:57:28.347
208,809
28,582
[ "php", "macos", "zend-framework", "zend-server" ]
4,051,163
1
null
null
1
869
According from [Emulator Color Depth](http://social.msdn.microsoft.com/Forums/en/windowsphone7series/thread/24aa46db-bb93-4aed-9520-430de8119216) on Windows Phone 7 forum, I just heard about limitation of Silverlight on Windows Phone 7 that it display only 16-bit color-depth image on Silverlight application just like previous version of Windows Mobile. Is it true? Anyone can confirm this. PS.Normally, Silverlight natively support 32-bit color-depth and all modern smart phones also support 24-bit color-depth. I'm not sure what color-depth will be displayed. I have quite bad experience for using HTC Sense in windows mobile 6.5 on my Omnia Pro 2(OLED display with 24-bit color-depth support). ![Windows Mobile 6.5 with 16-bit color depth](https://i.stack.imgur.com/PIGPa.png)
Which is the real color-depth on Windows phone 7 product?
CC BY-SA 2.5
null
2010-10-29T10:59:27.397
2011-01-13T18:20:49.547
2010-10-29T11:15:39.547
null
null
[ "windows-phone-7", "color-depth" ]
4,051,223
1
4,051,428
null
0
5,503
I have several tables in my ERD which which I would like to combine in a relational manner. I have several use cases, but I completely lost track of what kind of relations to use between the tables. - - - - I used a bridge model in table 'roles' with 2 PK's to link the users and projects together and defining a role for that user and project at the same time (is this the correct way?). Could somebody please help me assist the correct relations between the tables? and maybe suggest columns (which are missing) for tables (or tables as a whole of course). Kind of lost sight of this. With kind regards, B. ![alt text](https://i.stack.imgur.com/t6MtD.jpg) (Original image: [http://i55.tinypic.com/2mq2ejs.jpg](http://i55.tinypic.com/2mq2ejs.jpg))
ERD diagram and SQL relationships linking user, project and dataset tables
CC BY-SA 2.5
null
2010-10-29T11:08:18.503
2010-10-29T14:15:07.910
2010-10-29T14:03:09.660
null
475,967
[ "sql", "mysql", "relational-database", "erd" ]
4,051,319
1
4,060,260
null
0
1,198
I have a simple data structure (the properties are of course Dependency Properties): ``` class MenuData{ public string Header {get; protected set;} public ObservableCollection<MenuData> Items { get; protected set; } } ObservableCollection<MenuData> Menus {get; protected set;} ``` I want to bind the Menus property as Menu element ItemsSource. The result should look as standard Windows menu bar: First level of items will be lined horizontally with sub-items being hidden is sub-menus. I experimented with XAML to create the first level for now (the horizontal menu bar): ``` <my:MenuElement ItemsSource="{Binding Menus}"> <my:MenuElement.ItemTemplate> <DataTemplate> <MenuItem Header="{Binding Header}"> <!-- Try to add some sub-menus to see what it is going to look like. --> <MenuItem Header="A" /> <MenuItem Header="A" /> <MenuItem Header="A" /> <MenuItem Header="A" /> </MenuItem> </DataTemplate> </my:MenuElement.ItemTemplate> </my:MenuElement> ``` I used my custom overload of MenuItem, because the ItemTemplate is already wrapped in MenuItem tag for Menu element, so I had to get rid of that: ``` class MenuElement: System.Windows.Controls.Menu { protected override DependencyObject GetContainerForItemOverride() { return new System.Windows.Controls.ContentPresenter(); } } ``` But the result looks all wrong (notice the highlight being too large and the sub-menu arrows) ![alt text](https://i.stack.imgur.com/jUvNp.png) Thanks for any help.
Binding Menu ItemsSource to a recursive data structure
CC BY-SA 2.5
0
2010-10-29T11:24:31.330
2010-10-30T19:13:37.523
2010-10-29T13:01:52.467
38,256
38,256
[ "c#", "wpf", "binding", "menu", "itemssource" ]
4,051,373
1
4,051,413
null
15
42,016
A table of width 100% is not filling its parent div. Example html: ``` <div style="width:100%; margin-top:20px;"> <div style="width:100%; padding:5px; background:#ccc; font-weight:900;">Table Top</div> <table width="100%" border="0" cellspacing="0" cellpadding="5" style="border:1px solid #aaa;"> <tr style="background:#eee;"> <td>&nbsp;</td> <td><strong>L</strong></td> <td><strong>B</strong></td> <td><strong>H</strong></td> <td><strong>W</strong></td> </tr> <tr style="background:#fafafa;"> <td style="border:1px solid #ccc; border-width:1px 1px 0 0;"> Unit 1 </td> <td style="border:1px solid #ccc; border-width:1px 1px 0 0;"> 550 mm </td> <td style="border:1px solid #ccc; border-width:1px 1px 0 0;"> 550 mm </td> <td style="border:1px solid #ccc; border-width:1px 1px 0 0;"> 25 mm </td> <td style="border:1px solid #ccc; border-width:1px 0 0 0;"> 60.00 kg </td> </tr> </table> </div> ``` This produces the following output: ![alt text](https://i.stack.imgur.com/ZucZB.jpg) The table is not filling the div. What could be the problem?
Table of width 100% not filling parent <div>
CC BY-SA 3.0
0
2010-10-29T11:31:28.587
2018-02-21T17:58:49.953
2018-02-21T17:58:49.953
1,028,230
137,954
[ "html", "css" ]
4,051,414
1
4,076,180
null
6
2,685
I trying to build a tree with BioPython, Phylo module. What I've done so far is this image: ![alt text](https://i.stack.imgur.com/70oPe.png) each name has a four digit number followed by - and a number: this number refer to the number of times that sequence is represented. That means 1578 - 22, that node should represent 22sequences. the file with the sequences aligned: [file](http://pastie.org/1266360) the file with the distance to build a tree: [file](http://pastie.org/1266361) So now I known how to change each size of the node. Each node has a different size, this is easy doing an array of the different values: ``` fh = open(MEDIA_ROOT + "groupsnp.txt") list_size = {} for line in fh: if '>' in line: labels = line.split('>') label = labels[-1] label = label.split() num = line.split('-') size = num[-1] size = size.split() for lab in label: for number in size: list_size[lab] = int(number) a = array(list_size.values()) ``` But the array is arbitrary, I would like to put the correct node size into the right node, I tried this: ``` for elem in list_size.keys(): if labels == elem: Phylo.draw_graphviz(tree_xml, prog="neato", node_size=a) ``` but nothing appears when I use the if statement. Anyway of doing this? I would really appreciate! Thanks everybody
Phylo BioPython building trees
CC BY-SA 2.5
0
2010-10-29T11:36:36.133
2010-11-03T07:33:09.537
2010-11-02T15:05:44.977
426,176
426,176
[ "python", "numpy", "graphviz", "biopython" ]
4,051,433
1
4,051,813
null
2
628
![Screenshot](https://i.stack.imgur.com/LQ9MS.jpg)
How to create a custom WPF Window like this one?
CC BY-SA 2.5
0
2010-10-29T11:39:36.590
2010-10-29T12:25:10.117
null
null
132,917
[ "wpf" ]
4,051,446
1
4,053,571
null
2
5,341
I'm trying to write my first groovy class. When I do so, Eclipse complains about syntax errors as though it's parsing a Java file. It wants semicolons on the end of each line, it doesn't recognize the "def" keyword, etc. I have both Groovy 1.7.5 and the latest Groovy Eclipse plugin installed. I have also converted the project to a Groovy project and opened the file in the Groovy editor. What else could be causing this: ![alt text](https://i.stack.imgur.com/jGvna.png) --- EDIT: update - even when I disable all builders via , I still get the red lines. What causes this? I thought the builders were responsible for creating the lines and markers??? If I can figure out "who" determines errors/problems in an open workspace file, I could deactivate that functionality...
Groovy not compiling properly in Eclipse
CC BY-SA 2.5
0
2010-10-29T11:40:54.227
2011-03-15T00:57:47.003
2010-10-29T18:17:44.883
178,433
178,433
[ "eclipse", "groovy" ]
4,051,384
1
4,052,487
null
5
8,932
I’m trying to launch an application (Operating System, My Application and the application I want to launch are all 32 bits), from .NET 3.51. The code that launches the Process is used for other applications, but there’s one that is giving us a headache. If we “double click” on the application’s icon, it works as expected, meaning that it works fine as an application in the computer. Double clicking the .exe directly, also works. The operating system is Windows 7 32Bits (Home and/or Professional). Our .NET application is compiled with x86 to avoid problems. The code that launches “Processes” is located inside a DLL (also 32 bits) made by us, basically it’s a simple DLL that holds some “Common Code” across the board, common methods, functions and stuff we use throughout our code. One of those methods look like this: ``` public static bool FireUpProcess( Process process, string path, bool enableRaisingEvents, ProcessWindowStyle windowStyle, string arguments ) { if ( process != null ) { try { process.StartInfo.FileName = @path; if ( arguments != null ) { if ( arguments != String.Empty ) { process.StartInfo.Arguments = arguments; } } process.StartInfo.WindowStyle = windowStyle; process.EnableRaisingEvents = enableRaisingEvents; process.Start(); } catch { try { process.Kill(); } catch ( InvalidOperationException ) { } // The process is not even created return false; } } else { return false; } return true; } ``` I don’t know who wrote this method, but it has been working for roughly six years with different applications, therefore I assume it’s “ok”. However, we have a customer with a piece of software that won’t launch when passed through that argument. : 1. process is a System.Diagnostics.Process created with a simple "new Process();” 2. path is a full path to the .exe “c:/path/to/my.exe”. 3. enableRaisingEvents is false 4. windowStyle is Maximized (but have tried others). It gives a crappy MessageBox… which I have happily immortalized. It’s in spanish but the translation ought to be easy: ![alt text](https://i.stack.imgur.com/wGzaS.jpg) It says: An unexpected exception has occurred for the program (0x0eedfade) at … Googling that 0x0eedfade gives strange results that look scary, but the truth is, if I go to the .exe that I’m trying to launch and double click it, it works perfectly. : If I try to launch other things (I.e.: Notepad.exe, Adobe Acrobat Reader) it works, Firefox doesn’t open and doesn’t show an error. This “some work, some doesn’t” behavior leads me to believe that there might be a problem with a Windows 7 security mechanism or similar that I don’t know. What am I missing or doing wrong? : Ok; I’ve gotten a copy of the software. It’s a messy software but it works. Now that I can debug, I see that the program gives an error when launched with my `FireUpProcess` method. As suggested I added the WorkingDirectory code, but here’s the code: ``` public static bool FireUpProcess(Process process, string path, bool enableRaisingEvents, ProcessWindowStyle windowStyle) { if (process != null) { try { if ( !String.IsNullOrEmpty(@path) ) { process.StartInfo.FileName = @path; process.StartInfo.WorkingDirectory = System.IO.Path.GetDirectoryName(@path); process.StartInfo.WindowStyle = windowStyle; // Suscribe to the exit notification process.EnableRaisingEvents = enableRaisingEvents; // Disable to prevent multiple launchs Framework.Check.LogWarning("LAUNCHING EXTERNAL DEVICE WITH PATH: " + path); process.Start(); // HERE The program reports the following: ``` ![alt text](https://i.stack.imgur.com/9LfkT.png) That means, “The program could not be started because ddip.dll is missing… try reinstalling bla bla”. The thing is, if I execute the same @path from the command line, the program opens perfectly: ![alt text](https://i.stack.imgur.com/ih8nY.png) That opens the program. And the same happens if I click on the “shortcut” that it’s located in the “programs” menu. There aren’t any parameters in that shortcut, it’s a simple call to the executable file. So the question is now: There has got to be something different that causes my process not to start. Any ideas? I made it work by using one of the below provided answers. Turns out that none directly pointed me to the solution, but they all gave me good ideas here and there. I added an app manifest to application (should have had it since the age of vista, don’t know why it wasn’t there in the 1st place). The app manifest I added by using VStudio 2008 add file -> app manifest. In it, I made sure we have this: ``` <requestedExecutionLevel level=“asInvoker” uiAccess=“false” /> ``` We don’t need admin or anything like that, but apparently Vista/7 need to know it. After that was added, the process is correctly launched. : UseShellExecute is by default (as suggested by some), you have to explicitly turn it to false if that’s what you want.
Problem launching a System.Diagnostics.Process under Windows 7
CC BY-SA 2.5
0
2010-10-29T11:33:03.640
2010-12-09T10:15:05.963
2010-12-09T10:15:05.963
2,684
2,684
[ "c#", ".net", "windows-7", "system.diagnostics" ]
4,051,745
1
4,129,082
null
4
2,082
I need some examples or tutorial, how to implement iPhone side index for Android. ![alt text](https://i.stack.imgur.com/PKAjg.jpg) I read already [this topic (https://stackoverflow.com/questions/1201962/android-equivalent-to-iphone-indexed-uitableview)](https://stackoverflow.com/questions/1201962/android-equivalent-to-iphone-indexed-uitableview) and I'm trying AlphabetIndexer, but: - - - If you downvote the topic, could you at least argue, why. Thank you Mur
iPhone section index for android?
CC BY-SA 2.5
0
2010-10-29T12:16:16.467
2010-12-08T05:39:45.033
2017-05-23T12:30:36.930
-1
408,780
[ "android" ]
4,051,816
1
4,052,120
null
6
29,360
How to test fileupload using SOAP UI. There is a service which accepts file as input I want to simulate that using SOAP UI It gives me . content should be inline . ![alt text](https://i.stack.imgur.com/gg38h.png)
How to test fileupload using SOAP UI
CC BY-SA 2.5
0
2010-10-29T12:25:37.150
2012-08-01T18:14:41.377
2010-11-14T10:21:38.080
70,604
null
[ "java", "soap", "file-upload", "webservice-client" ]
4,051,853
1
4,052,956
null
5
635
Is there a way to prevent closed branches from showing up when running the hg view command? I know about the 'limit' option. I don't really need closed branches to completely disappear from the view, but it would be nice if they would stay down (they were closed long ago), rather than popping up near the top every time I perform a merge. ![hg view with a closed branch near current development](https://i.stack.imgur.com/rYR8k.png) Here is an example screenshot where this happens. You can see on the right that the times are all mixed up, which isn't too terrible in this case, but in my real repo the closed-off branches pop up near the top everytime I have a merge, which gets annoying when the closed-off branch is well over a year ago and truly not interesting.
Suppress closed branches in hg view
CC BY-SA 2.5
0
2010-10-29T12:31:51.920
2018-02-27T15:12:30.620
2012-03-30T12:35:48.823
110,204
27,600
[ "mercurial", "branch", "dvcs" ]
4,052,232
1
4,052,287
null
3
917
How would i prevent text from being automatically formatted when added to a RichTextBox, or better yet, override the formatting that does occur? For instance, the following code sets the text, but then creates a formatted link to a server. ``` rtbSomeField.Text = "\\\\just some text"; ``` Results in ![alt text](https://i.stack.imgur.com/PjY3J.jpg) I understand why it's doing this, but is there a way to disable or override that particular feature?
How to prevent or override automatic formatting within RichTextBox
CC BY-SA 2.5
null
2010-10-29T13:18:48.640
2013-10-28T11:12:56.053
null
null
4,126
[ "c#", "winforms", "richtextbox" ]
4,052,631
1
4,071,013
null
3
1,712
My VS 2008 created installer doesn't call the override `Uninstall` method in my installer class. why? The `Install` method was called. My installer class looks like this: ``` [RunInstaller(true)] public partial class InstallerClass : Installer { public InstallerClass() { InitializeComponent(); } public override void Install(IDictionary stateSaver) { base.Install(stateSaver); //encrypt connection string encryptConntStr(); //create database createDatabase(); } public override void Commit(IDictionary savedState) { base.Commit(savedState); } public override void Rollback(IDictionary savedState) { base.Rollback(savedState); } public override void Uninstall(IDictionary savedState) { base.Uninstall(savedState); System.Diagnostics.Debugger.Break(); MessageBox.Show("I am in Uninstall now."); string exePathStr = Context.Parameters["targetdir"]; ... } } ``` EDIT: ![alt text](https://i.stack.imgur.com/tbo53.jpg)
Why is my Uninstall method not being called?
CC BY-SA 2.5
0
2010-10-29T14:11:11.607
2010-11-01T16:42:42.220
2010-10-29T14:31:57.713
117,039
117,039
[ "c#", ".net", "installation", "windows-installer" ]
4,052,766
1
null
null
5
6,332
I would like to create an [Options Menu](http://developer.android.com/guide/topics/ui/menus.html) in my Flash AIR application for Android. I've figured out already, that this ActionScript code could be used for capturing the hardware button press event: ``` stage.addEventListener(KeyboardEvent.KEY_DOWN, _onKeyDown); function onKeyDown(event:KeyboardEvent):void { if(event.keyCode == Keyboard.MENU) { event.preventDefault(); trace("Menu Pressed"); } } ``` but how do you create the actual menu? If you can't do it with AIR, then has anybody tried to recreate/mimic it manually already and could you please share the properties (colors, transparency, any gradients?) and transitions (sliding in/out) you've used? I've found some [guidelines](http://developer.android.com/guide/practices/ui_guidelines/icon_design.html) already, but would appreciate any Flash-specific tips/properties (like which easing to use for sliding transitions?) you have Thank you, Alex ![alt text](https://i.stack.imgur.com/xJgTF.png)
How to create Android Options Menu in Adobe AIR? (not Java)
CC BY-SA 2.5
0
2010-10-29T14:27:09.697
2013-05-15T07:04:58.010
2010-10-29T14:34:42.597
165,071
165,071
[ "android", "flash", "actionscript-3", "air" ]
4,052,940
1
4,201,472
null
109
65,370
Rendering contexts usually have a solid color on the background (black or whatever, see the image below): ![alt text](https://i.stack.imgur.com/YxAXx.gif) I'm wondering if it's possible to setup a window, with no decorations AND with the transparent background, while allowing me to render OpenGL stuff on it. This would give the illusion that the triangle is floating on the screen. The transparent background should allow you to see the desktop or other applications that might be behind it. Could you please exemplify with source code? Platform: Windows (win32 only)
How to make an OpenGL rendering context with transparent background?
CC BY-SA 3.0
0
2010-10-29T14:47:25.787
2021-01-04T23:24:23.373
2012-11-19T02:45:01.603
1,487,475
176,769
[ "c", "winapi", "opengl", "transparency" ]
4,053,361
1
null
null
1
971
I am looking for a click based single select list. Instead of the normal drop down list, I want an overlay menu (similar to how we see on facebook when we change privacy settings, the single select list that appears). Is that CSS based or any code examples to creating a similar list? All the lists i found of the net are hover lists not same as we see on f/b. Thanks. Something like this: ![alt text](https://i.stack.imgur.com/OFeSk.jpg)
CSS single select list example
CC BY-SA 2.5
null
2010-10-29T15:31:07.337
2010-10-29T16:10:25.180
2010-10-29T16:10:25.180
82,548
491,472
[ "javascript", "css", "list" ]
4,053,396
1
4,053,792
null
3
3,160
I'm coding a flocking algorithm in Java but I'm stuck at a certain point (using the Ardor3D libraries, in a 2D plane). Basically, I need to find the angle difference to add to the current rotation. If you can only get the way it should be pointing with polar coordinates with 0 degs at north and not the difference, not to worry -- I have a method which returns the angle difference taking into account the wraparound on the angle and negative angles. ![alt text](https://i.stack.imgur.com/3LX3Z.png) At the moment, I have the following code, which clearly wouldn't work since the algorithm has no reference to the initial rotation: ``` long tpf = currUpdateTimeMS - lastUpdateTimeMS; Vector2 pos = new Vector2(); rt.getPosition(pos); double rot = pos.angleBetween(app.getAvgBoidPos(new Vector2()).normalizeLocal()); rt.setRotation(rot); pos.addLocal( Math.cos((rot - MathUtils.HALF_PI)) * (tpf / 10f), Math.sin((rot - MathUtils.HALF_PI)) * (tpf / 10f) ); rt.setPosition(pos); super.updateLogic(); ``` Updated code (not working, from first answer): ``` long tpf = currUpdateTimeMS - lastUpdateTimeMS; //rt.setRotation(rt.getRotation() + ((tpf / (ROT_SPEED / 2f)) % 360)); Vector2 avgpos = app.getAvgBoidPos(new Vector2()); Vector2 pos = rt.getPosition(new Vector2()); avgpos.subtractLocal(pos); double angleRads = rt.getRotation() * FastMath.DEG_TO_RAD; double rot = MathUtils.acos(( (avgpos.getX() * MathUtils.sin(angleRads) ) + (avgpos.getY() * MathUtils.cos(angleRads) )) / ((Math.pow(avgpos.getX(), 2) + Math.pow(avgpos.getY(), 2)) * 0.5)); double adegdiff = rot * FastMath.RAD_TO_DEG; rt.setRotation(rt.getRotation() - adegdiff); double newrot = rt.getRotation(); pos.addLocal( Math.cos((newrot - MathUtils.HALF_PI)) * (tpf / 10f), Math.sin((newrot - MathUtils.HALF_PI)) * (tpf / 10f) ); rt.setPosition(pos); super.updateLogic(); ``` Another modification based on the other answer: ``` long tpf = currUpdateTimeMS - lastUpdateTimeMS; //rt.setRotation(rt.getRotation() + ((tpf / (ROT_SPEED / 2f)) % 360)); Vector2 avgpos = app.getAvgBoidPos(new Vector2()); Vector2 pos = rt.getPosition(new Vector2()); avgpos.subtractLocal(pos); double rot = pos.angleBetween( app.getAvgBoidPos(new Vector2()).normalizeLocal() ) - (rt.getRotation() * MathUtils.DEG_TO_RAD); rt.setRotation(rt.getRotation() - (rot * MathUtils.RAD_TO_DEG)); double newrot = rt.getRotation(); pos.addLocal( Math.cos((newrot - MathUtils.HALF_PI)) * (tpf / 10f), Math.sin((newrot - MathUtils.HALF_PI)) * (tpf / 10f) ); rt.setPosition(pos); super.updateLogic(); ``` I'm not really too good at Maths problems, so code would be helpful rather than formulas :) Inputs - - Output - - Thanks in advance if you can help :) Chris
Find delta angle to use for rotation given entity with position, initial rotation and target point to 'face toward'
CC BY-SA 2.5
null
2010-10-29T15:33:56.960
2010-11-27T03:50:27.133
2010-10-29T18:55:46.187
87,197
87,197
[ "java", "math", "vector", "rotation", "ardor3d" ]
4,053,531
1
null
null
1
4,888
On my MS SQL Server 2008, I've created a temporary table like this : ``` create table #test ( A varchar(50), B int, ) insert into #test select 'a',45 insert into #test select 'b',587 insert into #test select 'a',4 insert into #test select 'b',58 ``` Now the following request take forever ``` select A,SUM(B) from #test group by A -- takes 4 seconds to execute ``` while the following requests are instantaneous ``` select * from #test order by A select SUM(B) from #test ``` All other requests (including huge requests) that don't use temporary tables are running fine, while each request using a temporary table seems to encouter the same performance issue. Those requests all ran usually fast yesterday, and I can't think of anything unusual that could have happend since. I've checked that my tempdb wasn't full using spaceused (70MB free out of 85 MB) I've also retrieved the execution plan : ![alt text](https://i.stack.imgur.com/Lt1xW.png) What could cause this very poor performance ? Is there something I should to to troubleshoot the issue ?
Very slow request on temporary table
CC BY-SA 2.5
null
2010-10-29T15:47:14.807
2010-10-29T15:51:27.050
null
null
47,341
[ "sql", "performance", "sql-server-2008" ]
4,053,738
1
4,053,795
null
14
3,226
It feels strange to me to be casting null to a type so I wanted to double check that this is the right way to do this: ``` decimal? d = data.isSpecified ? data.Value : (decimal?)null; ``` ![alt text](https://i.stack.imgur.com/cXuPD.png) ![alt text](https://i.stack.imgur.com/JL7x2.png) NOTE: I am marking the answer that suggests the method that I personally like the best: ``` decimal? d = data.isSpecified ? data.Value : default(decimal?) ```
Is it right to cast null to nullable when using ternary expression assigning to a nullable type?
CC BY-SA 2.5
0
2010-10-29T16:09:46.753
2010-10-29T16:33:06.440
2010-10-29T16:33:06.440
398,546
398,546
[ "c#", "nullable" ]