Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
⌀ | ParentId
int64 1.68k
75.6M
⌀ | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
⌀ | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
⌀ | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
⌀ | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
⌀ | LastEditorUserId
int64 -1
21.3M
⌀ | OwnerUserId
int64 1
21.3M
⌀ | Tags
sequence |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3,767,745 | 1 | 3,767,983 | null | 5 | 5,904 | I need an algorithm to calculate, numerically, the degree of similarity between two drawn lines. The lines are drawn using a mouse, and are stored as a set of cartesian coordinates before being filtered and smoothed using separate algorithms.
For example, within the following diagram:

Lines A and B are clearly similar, but B and C are not. The algorithm should reflect this. Additionally, the 'direction' of the line, as indicated by the start and end points, matters. Does such an algorithm already exist?
| Calculating similarity between drawn lines | CC BY-SA 2.5 | 0 | 2010-09-22T09:05:24.873 | 2019-01-08T12:31:03.860 | null | null | 174,871 | [
"algorithm",
"graph",
"filtering",
"line",
"similarity"
] |
3,768,208 | 1 | null | null | 0 | 2,963 | i'm new to nhibernate so maybe the response depends on my lack of knowledge.
I created these two tables:

(sorry for italian language, i hope you can understand withouth any problems).
Then, i have these object in my model:
```
[Serializable]
public class Profilo
{
public virtual int Id { get; set; }
public virtual string Matricola { get; set; }
public virtual string Ruolo { get; set; }
public virtual IList ListaSedi { get; set; }
public Profilo()
{
ListaSedi = new List();
}
}
[Serializable]
public class Sede
{
public virtual string CodiceSede { get; set; }
public virtual string DescrizioneSede { get; set; }
public virtual Profilo Profilo { get; set; }
}
```
This is the way i mapped entities using fluent nhibernate:
```
public class Map_Sede : FluentNHibernate.Mapping.ClassMap
{
public Map_Sede()
{
Table("TBA_Sede");
Id(x => x.CodiceSede).Column("codice_sede").GeneratedBy.Assigned();
Map(x => x.DescrizioneSede)
.Column("descrizione");
References(prof => prof.Profilo)
.Column("codice_sede");
}
}
public class Map_Profilo : FluentNHibernate.Mapping.ClassMap
{
public Map_Profilo()
{
Table("TBA_Profilo");
Id(x => x.Id).Column("id").GeneratedBy.Identity();
Map(x => x.Matricola)
.Column("matricola");
Map(x => x.Ruolo)
.Column("ruolo");
HasMany(x => x.ListaSedi)
.AsBag()
.KeyColumns.Add("codice_sede")
.Not.LazyLoad()
.Cascade.None();
}
}
```
Now, i'd like to insert a new Profilo instance on my. Everything seems to work but nhibernate does not insert values on TBA_Profilo.codice_sede column. I noticed that the insert statement is composed by two parameters (matricola, ruolo) - why does it forget the third parameter?
I read somewhere (on nhibernate mailing list) that's quite normal 'cause nhiberate insert values with null first and then update the same records with right values contained in the list property.
Is it right?
Am i doing any errors?
I hope to have clarified the situation.
thx guys
ps: I'm using Nhibernate 2.1 and fluent nhibernate 1.1
: This is the code i use to save entity.
```
var sesionFactory = NHibernateHelper.createSessionFactory();
using (NHibernate.ISession session = sesionFactory.OpenSession())
{
using (var transaction = session.BeginTransaction())
{
try
{
session.SaveOrUpdate(entity);
transaction.Commit();
session.Flush();
}
catch (Exception)
{
transaction.Rollback();
throw;
}
finally
{
transaction.Dispose();
}
}
}
```
: Following sly answer i slightly modified my solution. These are new model entities:
```
[Serializable]
public class Profilo
{
public virtual int Id { get; set; }
public virtual string Matricola { get; set; }
public virtual string Ruolo { get; set; }
public virtual IList ListaSedi { get; set; }
public Profilo()
{
ListaSedi = new List();
}
}
[Serializable]
public class Sede
{
public virtual string CodiceSede { get; set; }
public virtual string DescrizioneSede { get; set; }
public virtual IList ProfiliAssociati { get; set; }
}
```
And new mappings:
```
public class Map_Sede : FluentNHibernate.Mapping.ClassMap
{
public Map_Sede()
{
Table("TBA_Sede");
Id(x => x.CodiceSede).Column("codice_sede").GeneratedBy.Assigned();
Map(x => x.DescrizioneSede)
.Column("descrizione");
HasMany(x => x.ProfiliAssociati)
.AsBag()
.KeyColumns.Add("codice_sede")
.Cascade.All();
}
}
public class Map_Profilo : FluentNHibernate.Mapping.ClassMap
{
public Map_Profilo()
{
Table("TBA_Profilo");
Id(x => x.Id).Column("id").GeneratedBy.Identity();
Map(x => x.Matricola)
.Column("matricola");
Map(x => x.Ruolo)
.Column("ruolo");
HasMany(x => x.ListaSedi)
.AsBag()
.Inverse()
.KeyColumns.Add("codice_sede")
.Cascade.SaveUpdate();
}
}
```
Now it seems quite to work: i mean that nhibernate can write TBA_Profilo.codice_sede column even if it doesn't cicle on Profilo.IList (it inserts the last element of this List).
Any ideas?
| Fluent NHibernate hasmany save insert null value | CC BY-SA 3.0 | null | 2010-09-22T10:09:18.213 | 2011-05-24T19:26:58.817 | 2011-05-24T19:20:10.223 | 5,744 | 136,995 | [
"c#",
"nhibernate",
"fluent-nhibernate",
"nhibernate-mapping"
] |
3,768,779 | 1 | 3,769,267 | null | 2 | 2,649 | I have a Silverlight 4 application where I am making use of shared classes. In the .Web project, I have a class called "X.Shared.cs". This class has three string properties. When I build the application, it gives an error saying "The type 'X' already contains a definition for 'Y'". It seems that the properties in the generated code in the Silverlight Application are being seen as duplicates. I have tried cleaning my solution and rebuilding, this helps every now and then but is totally inconsistent.
Has anyone had experience in this issue? Am I perhaps doing something wrong?
The code for the shared class (X.Shared.cs) is as follows:
```
public partial class VideoItem
{
[Key]
public String ID
{
get;
set;
}
public String ImageURL
{
get;
set;
}
public String URL
{
get;
set;
}
}
```
Here is a screenshot of the solution explorer showing the generated shared file:

| Silverlight Shared classes in RIA service causing build errors -The type 'X' already contains a definition for 'Y' | CC BY-SA 2.5 | null | 2010-09-22T11:34:45.043 | 2011-04-12T16:44:47.297 | 2010-09-22T11:53:09.557 | 61,197 | 61,197 | [
"c#",
"silverlight",
"class",
"shared"
] |
3,768,877 | 1 | 3,769,136 | null | 4 | 1,659 | Heap memory size thrashes between 2gigs and ~8gigs about once a minute (see picture).
Relevant details:
- - - - - -
I have little experience with memory tuning, but it seems like MaxPermSize is out of whack with Xms and Xmx. Or is this normal?

| Why does my JVM heap size thrash from 2gigs to 8 gigs? | CC BY-SA 2.5 | null | 2010-09-22T11:49:43.740 | 2021-11-08T13:34:19.717 | 2021-11-08T13:34:19.717 | 5,459,839 | 320,220 | [
"java",
"jvm",
"glassfish",
"heap-memory"
] |
3,769,105 | 1 | 14,468,426 | null | 46 | 42,415 | [This property](https://stackoverflow.com/questions/1666736/android-textview-automatically-truncate-and-replace-last-3-char-of-string) makes
> "short and very-long-word"
to
> "short and"
. But I want to have smth. like
> "short and very-lon..."
Right now I truncate the String in Java code. However, thats based on the number of characters and not the actual length of the link. So, the result isn't very nice.
```
String title;
if(model.getOrganization().length() > 19) {
title = model.getText().substring(0, 15).trim() + "…";
} else {
title = model.getText();
}
((TextView) findViewById(R.id.TextViewTitle)).setText(title);
```
Just noticed, this property actually adds "..." in a few cases. But not in all of them:
> 12345678901234567890 becomes
"12345678901234..."
However,
> "1234567890 1234567890"
becomes "1234567890" and not
"1234567890 123..."
Now it really gets funky! I just set singleLine=true and removed maxLine (The bug appears with and without setting ellipsize attribute)...

This is a screenshot take from Motorola Milestone with android 2.1 update 1. Same happens on HTC Desire with the same android version
Now I use android:ellipsize="marquee". That seems to be the only properly working setting. It's also only moving, when focused. I see it in many other apps also. I guess its common practise.
| Android: Something better than android:ellipsize="end" to add "..." to truncated long Strings? | CC BY-SA 2.5 | 0 | 2010-09-22T12:19:01.413 | 2015-04-21T18:25:42.153 | 2017-05-23T12:09:58.560 | -1 | 433,718 | [
"android",
"string",
"layout",
"truncate",
"android-layout"
] |
3,769,874 | 1 | 3,776,955 | null | 4 | 11,631 | I'm trying to analyse a ~800mb heap dump, which requires a bigger heap than the standard for my eclipse. however, when I go to the eclipse.ini file and set a `-Xmx2g` (or `-Xmx2048m`) I get an error "Failed to create the Java Virtual Machine".
1) yes, I have enough memory. 2) I can change it up to exactly -Xmx976m. 3) I've tried the standalone MAT analyser and it works with -Xmx1024m, not a byte more. 4) No, 1gb is not enough to analyse that heap, I get a OOM
This is the eclipse error:

This is the MAT error:

(I reckon they are the same, this is just so you can see an example with MAT)
My current eclipse.ini (working) is:
```
-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.0.v20100503
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx384m
```
Anybody figures this out?
thanks!
f.
| Eclipse memory allocation problem | CC BY-SA 2.5 | null | 2010-09-22T13:46:42.657 | 2013-11-25T07:15:29.857 | null | null | 323,129 | [
"eclipse",
"memory",
"jvm",
"heap-dump"
] |
3,769,885 | 1 | 3,770,275 | null | 2 | 540 | I have an array of "lines" each defined by 2 points. I am working with only the line segments lying between those points. I need to search lines that could continue one another (relative to some angle) and lie on the same line (with some offset)
I mean I had something like 3 lines

I solved some mathematical problem (formulation of which is my question) and got understanding that there are lines that could be called relatively one line (with some angle K and offset J)

And of course by math formulation I meant some kind of math formula like

| How to formulate such problem mathematicaly? (line continuation search) | CC BY-SA 2.5 | null | 2010-09-22T13:48:10.467 | 2010-09-22T14:42:56.870 | 2010-09-22T14:19:18.640 | 1,450 | 434,051 | [
"algorithm",
"math",
"geometry",
"formula"
] |
3,769,915 | 1 | 3,770,025 | null | 1 | 2,169 | Open up this site in IE8:
[http://www.bavarianblue.com](http://www.bavarianblue.com)
See the white background? Any ideas what is causing that? I tried assigning a clear gif to it, and nothing changed. Works great in Chrome and FF

Help please : )
| white background problem in IE | CC BY-SA 2.5 | 0 | 2010-09-22T13:52:34.400 | 2013-12-06T17:15:33.010 | null | null | 227,411 | [
"css",
"internet-explorer-8"
] |
3,770,012 | 1 | 3,770,075 | null | 39 | 126,150 | I have the following table

I have inserted Product B to it and it gives me an ID of 15
Then I have the definition table which is as follows.

I want to select the ProductDefinition rows where ProdID = 14 and replicate the same and insert it for ProdID = 15 like the following

How to achieve this using SQL code?
| Copy rows from the same table and update the ID column | CC BY-SA 2.5 | 0 | 2010-09-22T14:02:31.860 | 2022-01-29T03:53:38.997 | 2010-09-22T14:30:41.743 | 226,897 | 529,866 | [
"sql",
"sql-server"
] |
3,770,084 | 1 | null | null | 9 | 8,813 | I'm using a QTableView with a subclass of QItemDelegate to control the look and feel of the tableview's cells.
Each cell displays the name and status of a of an externally connected device, and as many as 100 devices may be connected at once.
The name and type of each device is essentially static, updating very rarely (perhaps once an hour), but each cell needs to display a real time value of the device's input, which I currently poll for every 50 milliseconds. This value is displayed as a basic bar graph drawn by the painter provided to the Delegate::paint() method by the TableView.
The problem with updating my model 20 times per second is that the entire table is redrawn each time, which is highly inefficient. Limiting the paint method to only drawing the bar graph shows that the majority of CPU time is dedicated to drawing the name, status and associated image on each cell, rather than the graph.
What I need to find is a way to update the graph for each cell regularly without redrawing the cell, but I can't work out how to do it.
What is the most efficient way of achieving this?
Image represents 10 sensors in a QTableView. The Number, Name and Status are virtually static, almost never updating. The bar graph next to the 'Sensor Value' text updates every 50ms. I only want to paint this bar, rather than the text, status and the cell background. The status lights and background are complex images, so take much more CPU time than simply drawing and filling a rect.

| Efficiently updating a QTableView at high speed | CC BY-SA 2.5 | 0 | 2010-09-22T14:10:09.220 | 2010-09-24T13:44:44.513 | 2010-09-22T15:01:46.887 | 104,507 | 104,507 | [
"c++",
"model-view-controller",
"user-interface",
"qt",
"performance"
] |
3,770,103 | 1 | 3,771,072 | null | 4 | 2,176 | This is a continuation of [this](https://stackoverflow.com/questions/3764609/javascript-is-not-able-to-convince-the-mouse-to-change-its-cursor/3764704#3764704) question.
I have an ASP.NET app that has some sections displaying differently when viewed in IE8 in DEBUG vs displaying off the published TEST server location.
When I view the page in Debug (through VS 2010), I see this:

However, when I publish to the server and view it directly, it looks like this:

The title box only has the text background color as black instead of the whole section.
Here's the CSS:
```
.imageBox
{
position: relative;
float: left;
border-style: solid;
border-width: 1px;
text-align: center;
}
.imageBoxTitle
{
width: 100%;
background-color: #333333;
padding: 5px;
}
.imageBoxTitleLbl
{
font-family: Verdana;
font-weight: bold;
font-size: small;
color: White;
}
```
Here's the generated HTML
```
<div class="imageBox">
<div class="imageBoxTitle">
<span id="MainContent_ImagesPanel_ImageHolder1_ImageBoxTitleLabel" class="imageBoxTitleLbl">ITEM OVERVIEW</span>
</div>
<div class="imagePlaceHolder">
<p class=".centeredImage"><a id="MainContent_ImagesPanel_ImageHolder1_ImageHyperLink" href="UserImages/nu5t3hhs.jpg" target="_blank"><img src="UserImages/nu5t3hhs.jpg" height="200" width="200" /></a></p>
<span id="MainContent_ImagesPanel_ImageHolder1_CustomValidator1" style="color:Red;visibility:hidden;">*</span>
</div>
<div class="imageAction">
</div>
</div>
```
So I was thinking that this is probably some kind of caching issue. However, if I make slight changes to the CSS (e.g. change the background color) it picks that up and displays it. Also, I've added a dynamically generated GUID to the querystring for the css files, so they should never get cached. Fiddler confirms that they are not cached, too.
IE seems to render the HTML/CSS differently when viewing through Visual Studio Debug vs accessing the page directly from the server.
What things might cause this behavior?
UPDATE: When I view the page in Chrome or Firefox on the published server, it appears correctly. I have cleared the IE cache (ctrl-f5), deleted the .css off the server and reloade, etc.
| IE displays page differently between debug in visual studio and on the server | CC BY-SA 2.5 | 0 | 2010-09-22T14:11:58.210 | 2010-09-22T17:20:11.760 | 2017-05-23T12:24:45.863 | -1 | 6,624 | [
"html",
"css"
] |
3,770,591 | 1 | 3,770,786 | null | 3 | 1,497 | i've got an UIImageView, now i want to repeat this image, that it always shows up again when scrolling left or right.
Little Example:

is this possible? it should feel like an infinite loop
| repeat an image when scrolling on iphone | CC BY-SA 2.5 | 0 | 2010-09-22T15:02:36.400 | 2010-09-23T00:46:33.530 | null | null | 253,288 | [
"iphone",
"objective-c",
"loops",
"ios4",
"uiimageview"
] |
3,771,054 | 1 | 3,771,320 | null | 4 | 1,599 | I need to find out a method to determine how many items should appear per column in a multiple column list to achieve the most visual balance. Here are my criteria:
1. The list should only be split into multiple columns if the item count is greater than 10. If multiple columns are required, they should contain no less than 5 (except for the last column in case of a remainder) and no more than 10 items.
2. If all columns cannot contain an equal number of items All but the last column should be equal in number. The number of items in each column should be optimized to achieve the smallest difference between the last column and the other column(s).

| How to balance the number of items across multiple columns | CC BY-SA 2.5 | 0 | 2010-09-22T15:46:11.677 | 2010-09-23T17:46:15.453 | 2010-09-22T16:10:06.543 | 5,651 | 5,651 | [
"algorithm",
"language-agnostic"
] |
3,771,229 | 1 | 3,776,731 | null | 7 | 4,232 | I'm trying to achieve a custom controller containing of various buttons in different shapes. I'm wondering how I can achieve this with Android.
The result should look similar like this, where every color is a different button.

I suppose I have to subclass `View` so please don't write that as an answer ;-) Please give some methodical steps what's needs to be implemented, like drawing, sensing touches, etc or maybe point me to some examples (if exist).
Thanks
| Android: custom button shape | CC BY-SA 2.5 | 0 | 2010-09-22T16:04:20.863 | 2010-12-12T11:24:37.693 | null | null | 184,367 | [
"android",
"touch",
"draw"
] |
3,771,587 | 1 | 3,771,653 | null | 1 | 381 | I'm a bit stuck on this SCJP practice question, specifically line 5 (with the String constructor). I thought it should be private, but the solution is 'protected'. I think protected access would not satisfy the requirement that all Alpha instances have the String alpha set to A. If the constructor is protected, then any other class that's also in package alpha, OR any subclass of Alpha regardless of package, can invoke it and set alpha to whatever it wants. Amirite? Can anyone clarify? Thanks!

| Why should the String constructor be protected instead of private here? | CC BY-SA 2.5 | null | 2010-09-22T16:42:39.913 | 2010-09-22T17:05:15.980 | 2010-09-22T16:51:50.360 | 243,500 | 243,500 | [
"java",
"constructor",
"access-modifiers"
] |
3,771,589 | 1 | null | null | 1 | 2,958 | We are doing an AJAX call to retrieve from database. Since our clients may use different languages we encode everything into Unicode to store in the database (saves worrying about collations and such). Now when we fetch such content to be displayed in an input text field it is displaying the Unicode codes. Checked the [HTML 4 documentation for input](http://www.w3.org/TR/html401/interact/forms.html#h-17.4) and value is a [CDATA](http://www.w3.org/TR/html401/types.html#type-cdata) which tells me those unicode should be displayed as their character.
From the screen shot attached you can see this is not the case, I'm wondering if there is a way to "force" this behavior.

| Force display text from Unicode in input field | CC BY-SA 3.0 | 0 | 2010-09-22T16:43:08.540 | 2014-03-01T14:52:58.887 | 2014-03-01T14:52:58.887 | 2,074,608 | 363,217 | [
"javascript",
"ajax",
"unicode",
"html-entities"
] |
3,771,638 | 1 | null | null | 2 | 1,359 | 
The above is the complete list of MS-DOS header fields, but I don't know which of them are mandatory and which are optional, does anyone know?
| Which of the MS-DOS header fields are mandatory/optional? | CC BY-SA 3.0 | 0 | 2010-09-22T16:49:22.153 | 2014-06-12T12:41:32.520 | 2012-01-10T12:50:52.417 | 587,803 | 417,798 | [
"portable-executable"
] |
3,771,556 | 1 | null | null | 12 | 6,529 | Ok, so this question is related to Windows Phone 7/Silverlight (updated WP7 Tools, Sept 2010), specifically filtering an underlying `ObservableCollection<T>`.
In mucking about with the WP7 template Pivot control application, I've run into an issue whereby changing an underlying item in an `ObservableCollection<T>`, does not result in the on-screen ListBox being updated. Basically, the sample app has two pivots, the first directly bound to the underlying `ObservableCollection<T>`, and the second bound to a `CollectionViewSource` (i.e., representing a filtered view on the underlying `ObservableCollection<T>`).
The underlying items that are being added to the `ObservableCollection<T>` implement `INotifyPropertyChanged`, like so:
```
public class ItemViewModel : INotifyPropertyChanged
{
public string LineOne
{
get { return _lineOne; }
set
{
if (value != _lineOne)
{
_lineOne = value;
NotifyPropertyChanged("LineOne");
}
}
} private string _lineOne;
public string LineTwo
{
get { return _lineTwo; }
set
{
if (value != _lineTwo)
{
_lineTwo = value;
NotifyPropertyChanged("LineTwo");
}
}
} private string _lineTwo;
public bool IsSelected
{
get { return _isSelected; }
set
{
if (value != _isSelected)
{
_isSelected = value;
NotifyPropertyChanged("IsSelected");
}
}
} private bool _isSelected = false;
public event PropertyChangedEventHandler PropertyChanged;
private void NotifyPropertyChanged(String propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
```
Then, in the main class, a data collection is concocted (list reduced for brevity, also note that unlike other items, three of the LoadData() entries have IsSelected == true):
```
public class MainViewModel : INotifyPropertyChanged
{
public MainViewModel()
{
this.Items = new ObservableCollection<ItemViewModel>();
}
public ObservableCollection<ItemViewModel> Items { get; private set; }
public bool IsDataLoaded
{
get;
private set;
}
public void LoadData()
{
this.Items.Add(new ItemViewModel() { LineOne = "runtime one", IsSelected = true, LineTwo = "Maecenas praesent accumsan bibendum" });
this.Items.Add(new ItemViewModel() { LineOne = "runtime two", LineTwo = "Dictumst eleifend facilisi faucibus" });
this.Items.Add(new ItemViewModel() { LineOne = "runtime three", IsSelected = true, LineTwo = "Habitant inceptos interdum lobortis" });
this.Items.Add(new ItemViewModel() { LineOne = "runtime four", LineTwo = "Nascetur pharetra placerat pulvinar" });
this.Items.Add(new ItemViewModel() { LineOne = "runtime five", IsSelected = true, LineTwo = "Maecenas praesent accumsan bibendum" });
this.Items.Add(new ItemViewModel() { LineOne = "runtime six", LineTwo = "Dictumst eleifend facilisi faucibus" });
this.IsDataLoaded = true;
}
public event PropertyChangedEventHandler PropertyChanged;
public void NotifyPropertyChanged(String propertyName)
{
if (null != PropertyChanged)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
```
In the MainPage.xaml file, the first Pivot has its `ItemSource` based directly on the `ObservableCollection<T>` list. Within the second Pivot, the on-screen ListBox has its `ItemSource` Property set to a `CollectionViewSource`, whose underlying source is based on the `ObservableCollection<T>` populated in `LoadData()` above.
```
<phone:PhoneApplicationPage.Resources>
<CollectionViewSource x:Key="IsSelectedCollectionView" Filter="CollectionViewSource_SelectedListFilter">
</CollectionViewSource>
</phone:PhoneApplicationPage.Resources>
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<!--Pivot Control-->
<controls:Pivot Title="MY APPLICATION">
<!--Pivot item one-->
<controls:PivotItem Header="first">
<!--Double line list with text wrapping-->
<ListBox x:Name="FirstListBox" Margin="0,0,-12,0" ItemsSource="{Binding Items}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Margin="0,0,0,17" Width="432">
<TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}"/>
<TextBlock Text="{Binding LineTwo}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</controls:PivotItem>
<!--Pivot item two-->
<controls:PivotItem Header="second">
<!--Triple line list no text wrapping-->
<ListBox x:Name="SecondListBox" Margin="0,0,-12,0" ItemsSource="{Binding Source={StaticResource IsSelectedCollectionView}}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Margin="0,0,0,17">
<TextBlock Text="{Binding LineOne}" TextWrapping="NoWrap" Margin="12,0,0,0" Style="{StaticResource PhoneTextExtraLargeStyle}"/>
<TextBlock Text="{Binding LineThree}" TextWrapping="NoWrap" Margin="12,-6,0,0" Style="{StaticResource PhoneTextSubtleStyle}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</controls:PivotItem>
</controls:Pivot>
</Grid>
<!--Sample code showing usage of ApplicationBar-->
<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
<shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1" Click="ApplicationBarIconButton_Click"/>
<shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
<shell:ApplicationBar.MenuItems>
<shell:ApplicationBarMenuItem Text="MenuItem 1"/>
<shell:ApplicationBarMenuItem Text="MenuItem 2"/>
</shell:ApplicationBar.MenuItems>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>
```
Note that in the MainPage.xaml.cs, the `Filter` attribute on the `CollectionViewSource` in the `Resources` section above is assigned a filter handler, which sifts through those items that have `IsSelected` set to true:
```
public partial class MainPage : PhoneApplicationPage
{
public MainPage()
{
InitializeComponent();
DataContext = App.ViewModel;
this.Loaded += new RoutedEventHandler(MainPage_Loaded);
}
private void MainPage_Loaded(object sender, RoutedEventArgs e)
{
if (!App.ViewModel.IsDataLoaded)
{
App.ViewModel.LoadData();
CollectionViewSource isSelectedListView = this.Resources["IsSelectedCollectionView"] as CollectionViewSource;
if (isSelectedListView != null)
{
isSelectedListView .Source = App.ViewModel.Items;
}
}
}
private void CollectionViewSource_SelectedListFilter(object sender, System.Windows.Data.FilterEventArgs e)
{
e.Accepted = ((ItemViewModel)e.Item).IsSelected;
}
private void ApplicationBarIconButton_Click(object sender, EventArgs e)
{
ItemViewModel item = App.ViewModel.Items[App.ViewModel.Items.Count - 1];
item.IsSelected = !item.IsSelected;
}
}
```
Also note that immediately after loading up the data, I obtain the `CollectionViewSource` and set its data source as the `ObservableCollection<T>` list, in order that there is base data upon which the filtering can take place.
When application loads, the data is displayed as expected, with those items in the `ObservableCollection<T>` which have `IsSelected` true, being displayed in the second Pivot:


You'll notice that I've uncommented the Application Bar Icons, the first of which toggles the `IsSelected` property of the last item in the `ObservableCollection<T>` when clicked (see the last function in MainPage.xaml.cs).
- when I click the applicable bar icon, I can see when the last item in the list has its `IsSelected` property set to true, howoever the second Pivot does not display this changed item. I can see that the `NotifyPropertyChanged()` handler is being fired on the item, however the collection is not picking up this fact, and hence the list box in Pivot 2 does not change to reflect the fact that there should be a new item added to the collection.
I'm pretty certain that I'm missing something quite fundamental/basic here, but failing that, does anyone know the best way to get the collection and it's underlying items to play happily together?
I suppose this problem also applies to sorting as well as filtering ((in the sense that if a `CollectionViewSource` is based on sorting, then when a property of an item that is used in the sort changes, the sort order of the collection should reflect this as well))
| How to automatically update filter and/or sort order on CollectionViewSource, when an individual item's property changes? | CC BY-SA 2.5 | 0 | 2010-09-22T16:38:54.123 | 2011-04-12T11:48:17.040 | 2010-09-22T16:58:11.097 | 24,207 | 24,207 | [
"silverlight",
"collections",
"filter",
"windows-phone-7",
"collectionviewsource"
] |
3,771,932 | 1 | null | null | 14 | 2,756 | Are there any tools or Visual Studio 2010 extensions which allow me to view the output of a configuration file transformation short of having to publish the entire project? Is the process which performs the transformation directly invokable?
---
After a little more Googling I came across [this](http://blogs.msdn.com/b/webdevtools/archive/2009/05/04/web-deployment-web-config-transformation.aspx):
> Open Visual Studio Command prompt by
going to Start --> Program Files –>
Visual Studio v10.0 –> Visual Studio
tools –> Visual Studio 10.0 Command
PromptType “MSBuild “Path to Application
project file (.csproj/.vbproj) ”
/t:TransformWebConfig
/p:Configuration=Staging" and hit
enter as shown below:Once the transformation is successful
the web.config for the “Staging”
configuration will be stored under obj
-->Staging folder under your project root (In solution explorer you can
access this folder by first un-hiding
the hidden files) :- - - - You can now verify that the new
staging web.config file generated has
the changed connection string section.[Web Deployment: Web.Config Transformation](http://blogs.msdn.com/b/webdevtools/archive/2009/05/04/web-deployment-web-config-transformation.aspx)
This isn't really a perfect solution for me as it still requires building the entire project- at least with the command he posted. If anyone knows of way to skip the build step with the MSBuild command that would be helpful (although that sounds somewhat unlikely).
I also found this [Config Transformation Tool](http://ctt.codeplex.com/) on CodePlex, which offers some nice functionality to extend the transformation process. This is tool is the closest thing I've seen for the functionality I'm seeking and would be a great starting point for developing an extension which creates previews. It uses the Microsoft.Web.Publishing.Tasks library to perform the transformation and does not depend on building an actual project.
| Tools for previewing configuration file transformations | CC BY-SA 2.5 | 0 | 2010-09-22T17:25:25.957 | 2014-11-21T16:36:17.713 | 2012-02-11T20:04:31.150 | 105,999 | 143,327 | [
"visual-studio-2010",
"web-config",
"configuration-files",
"slowcheetah"
] |
3,772,218 | 1 | 3,772,338 | null | 4 | 4,666 | problem with width:50% when border != none
take a look
[http://jsfiddle.net/5nYSf/](http://jsfiddle.net/5nYSf/)
result should be like this

| problem with width:50% when border != none (CSS) | CC BY-SA 2.5 | 0 | 2010-09-22T17:58:27.497 | 2017-11-13T07:36:33.083 | null | null | 423,903 | [
"html",
"css",
"width",
"border"
] |
3,772,323 | 1 | 3,772,875 | null | 7 | 1,090 | On Mac OSX running the latest JDK, my IntelliJ 9.0.3 pops up these incredibly annoying and persistent windows:

This stuff compiles and runs fine, the JDK is definitely operational on this machine. It should be a java.util.string, not some other apache string.
what is this supposed to be, and how do i get rid of it? Thanks!
| How to get IntelliJ From making annoying blue popups? | CC BY-SA 2.5 | null | 2010-09-22T18:10:10.730 | 2020-02-21T20:08:34.360 | null | null | 59,890 | [
"java",
"ide",
"intellij-idea"
] |
3,772,476 | 1 | 3,797,263 | null | 3 | 1,408 | I'm displaying a few 3D-models as Model3DGroups.
They are surrounded by Viewport3D which catches MouseDown-events.
I want to determine which Model3DGroup (they all have names) was clicked.
I'm starting with this:
```
Point location = e.GetPosition(karte.ZAM3DViewport3D);
HitTestResult hitResult = VisualTreeHelper.HitTest(karte.ZAM3DViewport3D, location);
if (hitResult != null )
{
Debug.WriteLine("BREAKPOINT");
// Hit the visual.
}
```
After hitting the breakpoint set at the WriteLine-command I'm looking at the local-view to find the right variable but can't find it.
Can you help me out which path I need to take to find the group, the modelvisual3d belongs to?
Here is a screenshot of the tree:

| WPF: How to walk up the Visual Tree to find a Model3DGroup a clicked 3d-model is in? | CC BY-SA 2.5 | 0 | 2010-09-22T18:27:55.087 | 2017-10-07T06:25:26.813 | null | null | 446,835 | [
"c#",
".net",
"wpf",
"visual-tree"
] |
3,772,777 | 1 | 3,775,004 | null | 3 | 1,235 | I want to run a Greasemonkey script on Firefox network error pages, such as (but not limited to) this one:

Can I do this with `chrome://` URLs? If so, what are they? If not, is there another way?
| Greasemonkey script on Firefox network error page | CC BY-SA 2.5 | null | 2010-09-22T19:11:21.897 | 2010-09-23T02:22:48.200 | null | null | 68,086 | [
"firefox",
"greasemonkey"
] |
3,772,779 | 1 | 3,772,972 | null | 17 | 49,846 |
I have already created this project, but I wanted to start over.
1. deleted the HelloAndroid folder from my workspace folder
2. restarted Eclipse
3. now I can't create a project with the same name, because Finish is greyed out, and it gives me the following message: A project with that name already exists in the workspace eclipse
How can I completely delete my old `HellowAndroid` project from Eclipse?

| A project with that name already exists in the workspace eclipse | CC BY-SA 2.5 | 0 | 2010-09-22T19:11:34.997 | 2017-08-25T01:20:03.957 | null | null | 287,311 | [
"eclipse",
"android"
] |
3,772,843 | 1 | null | null | 1 | 4,438 |
I can create a new project using the New Android Project wizard shown below.
However, if I wanted to go back and edit some of these settings after I click `Finish`, how would I do that?

| How do I edit project settings for an existing project in Eclipse? | CC BY-SA 2.5 | 0 | 2010-09-22T19:20:55.660 | 2010-09-22T19:33:49.257 | null | null | 287,311 | [
"eclipse"
] |
3,773,388 | 1 | 3,782,050 | null | 1 | 2,564 | I've been trying to create a custom skin/template for a TabControl in WPF.
I want the tabs to be displayed in a ComboBox. When you select the item from the ComboBox, I want the content area of the tab control to display the TabItem contents.
Here's an image showing what I'm looking for:

I could do this using some sort of master-detail setup with data objects and templates, but the problem is I want to set up the controls using the TabControl XAML format, like this:
```
<TabControl Style="{DynamicResource ComboTabControlStyle}">
<TabItem Header="TabItem1">
<TextBlock Text="TabItem1 Content!" FontSize="18.667" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</TabItem>
<TabItem Header="TabItem2">
<TextBlock Text="TabItem2 Content!" FontSize="18.667" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</TabItem>
<TabItem Header="TabItem3">
<TextBlock Text="TabItem3 Content!" FontSize="18.667" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</TabItem>
</TabControl>
```
Any thoughts or suggestions?
It is very easy to change the layout of the tab items using a different Panel, but a ComboBox is an ItemsControl, not a Panel.
I tried putting the ComboBox in the TabControl template and binding the ItemsSource of the ComboBox to the TabControl.Items property, but it didn't seem to work correctly.
I also tried creating a custom panel that only shows one "selected" item at a time and shows all of the items in a drop-down when you click on it (basically a "ComboBox" panel). I ran into trouble because visuals can only be in one place in the visual tree. So putting the children of the panel into a popup caused an exception to be thrown.
Anybody have any other ideas?
Thanks for the help!
| Drop-down TabControl | CC BY-SA 2.5 | null | 2010-09-22T20:32:16.247 | 2010-09-23T19:54:42.070 | null | null | 64,329 | [
"wpf",
"templates",
"combobox",
"tabcontrol"
] |
3,773,430 | 1 | 11,603,104 | null | 100 | 105,566 | Is it possible to remove the dotted line surrounding a selected item in a select element?

I have tried to add the `outline` property in CSS but it did not work, at least not in FF.
```
<style>
select { outline:none; }
</style>
```
Before you go ahead and remove the outline, please read this.
[http://www.outlinenone.com/](http://www.outlinenone.com/)
| Remove outline from select box in FF | CC BY-SA 3.0 | 0 | 2010-09-22T20:38:27.183 | 2021-10-28T14:10:42.320 | 2015-09-08T12:51:48.927 | 219,443 | 219,443 | [
"html",
"css",
"firefox",
"xhtml"
] |
3,773,774 | 1 | 5,185,863 | null | 11 | 7,709 | I have a very odd problem. Whenever I try to use the "Add View" dialog in ASP.NET MVC2 and then try to "Create a strongly-typed view" by selecting a "View data class" from the drop down of available classes none of the classes ("models") in my MVC project are showing up.
The very odd part is all of the assemblies that my MVC project is referencing, even other projects in the solution, their classes are showing up. I have tried cleaning, rebuilding, cleaning the obj folder but every single time for some reason none of the classes in my actual MVC assembly are showing up. It was working fine before but now it doesn't anymore and I can't really think of anything that has changed.
Anyone experienced this issue before?
Thanks for the help!
Image of example:

| Attempting to add a strongly typed view does not find any classes in the MVC project | CC BY-SA 3.0 | 0 | 2010-09-22T21:29:40.477 | 2015-01-16T07:58:43.943 | 2012-09-20T05:16:07.087 | 455,556 | 455,556 | [
"asp.net-mvc",
"asp.net-mvc-2"
] |
3,774,152 | 1 | 3,795,410 | null | 3 | 2,655 | I have a problem with a durable client on ActiveMQ. I am using stomp.py in Python.
```
conn.start()
conn.connect(wait=True, header = {'client-id': 'myhostname' })
conn.subscribe(
'/topic/testTopic', ack='auto',
headers = {
'activemq.subscriptionName': 'myhostname',
'selector': "clientid <> '%s'" % 'myhostname'
}
)
```
As you can see from my code, I am setting my clientId to be my own hostname. As shown in the attached screenshot (below), the clientId is shown to be something like "ID:Atlas....".
The problem is that every time I disconnect my stomp.py-based client, I get a new "clientId" the next time I connect again. That causes the list of subscribers in ActiveMQ to fill up:

(The image above shows a subscriber on my ActiveMQ broker. Next time I disconnect and then connect, the entry above will still remain, and another one will be added. Pretty soon I have many subscribers in the list).
The strange thing is that the selector works 100% (I verify that by changing <> to be =, so that the messages come back to me), so the clientId must be
| stomp.py based durable client fills up subscribers list in ActiveMQ | CC BY-SA 2.5 | null | 2010-09-22T22:39:45.487 | 2010-09-25T20:17:19.280 | null | null | 224,705 | [
"python",
"activemq",
"stomp"
] |
3,774,500 | 1 | null | null | 0 | 224 | OK here is a very basic iPad app that i am starting out with and I am already into issue. I have been doing iphone apps but in that too never implemented rotation things.. well here is the issue. This is a simple viewbased app build with interface builder that looks like this:

when i run the app, the vertical orientation has both elements like this :

However, when the orientation changes to horizontal, the app hides the label which is at the top.. :

Suggestions please !
| ipad rotation hides elements in view ! | CC BY-SA 2.5 | null | 2010-09-22T23:59:10.470 | 2011-06-10T19:30:22.840 | null | null | 431,226 | [
"iphone",
"ipad",
"uiview",
"rotation",
"screen-rotation"
] |
3,774,738 | 1 | 3,774,760 | null | 8 | 18,928 | I have a program that needs to send the BM_CLICK message to another applications button.
I can get the parent window handle but when I try to get the button handle if always returns 0
I got the button caption name and button type from Spy++ it seems right but I know I must have gotten something wrong. below is my code
```
public const Int BM_CLICK = 0x00F5;
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern IntPtr SendMessage(IntPtr hwnd, uint Msg, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
private void button1_Click(object sender, EventArgs e)
{
Process[] processes = Process.GetProcessesByName("QSXer");
foreach (Process p in processes)
{
////the Button's Caption is "Send" and it is a "Button".
IntPtr ButtonHandle = FindWindowEx(p.MainWindowHandle, IntPtr.Zero, "Button", "Send");
//ButtonHandle is always zero thats where I think the problem is
SendMessage(ButtonHandle, BM_CLICK, IntPtr.Zero, IntPtr.Zero);
}
}
```
Spy screen shot

| Getting a Button handle from another application | CC BY-SA 3.0 | 0 | 2010-09-23T01:10:27.870 | 2016-12-14T10:04:15.743 | 2013-11-13T16:20:21.833 | 55,721 | 427,869 | [
"c#",
"winapi",
"sendmessage"
] |
3,775,071 | 1 | 3,782,567 | null | 1 | 3,511 | Ok I have an application I am coding and am trying to get a layout simpler to this:

Notice how the text is left justified and the input boxes are all aligned, I see this in the wxPython demo code, but they all use the flexgrid sizer and I am trying to only use BoxSizers (due to them being simpler and because I only understand a little of sizers and even struggle with using BoxSizers, in 6 months I would have an even harder time)
I have tried having the input and text in two vertical sizers and then putting those in a horizontal sizer, didn't work because the text was not aligned with the inputs. I also tried doing that and also having each text, input pairing in a sizer, even worse. Any suggestions?
| wxPython GUI BoxSizers | CC BY-SA 2.5 | 0 | 2010-09-23T02:37:24.897 | 2011-03-01T20:20:52.070 | null | null | 410,368 | [
"python",
"user-interface",
"wxpython"
] |
3,775,073 | 1 | 3,800,858 | null | 4 | 790 | We have a simple Entity Framework 4.0 model :-

- - `abstract`- `Discussion``List``concretes`
When we try to save a `Discussion`, we do the following code :-
`Posts.AddObject(discussion);`
And the Sql Server syntax is in two parts. The second one errors. Notice the sql schema namespace? why is that?
(Code taken from [EFProf](http://efprof.com/))
```
insert [dbo].[Posts]
([Subject],
[UniqueSubject],
[Content],
[CreatedOn],
[ModifiedOn],
[IsVisible],
[UserId])
values('Test Subject' /* @0 */,
'sdfsdfsdfsdfsfdssd' /* @1 */,
'this is a lot of content - pew pew pew' /* @2 */,
'23/09/2010 12:22:08 PM +10:00' /* @3 */,
'23/09/2010 12:22:08 PM +10:00' /* @4 */,
1 /* @5 */,
1 /* @6 */)
select [PostId]
from [dbo].[Posts]
where @@ROWCOUNT > 0
and [PostId] = scope_identity()
insert [XWingModelStoreContainer].[Discussions]
([PostId])
values(20132 /* @0 */)
```
.
.
## UPDATE:
Also, here's another screen shot of the properties of our designer .. so u can see that we that it should be calling [dbo] as that is the default `Database Scheme Name` ..

and in the Xml `edmx` file.. there's two name'd lines..
```
<edmx:StorageModels>
<Schema Namespace="XWingModel.Store" Alias="Self"
Provider="System.Data.SqlClient" ProviderManifestToken="2008"
xmlns:store="http://schemas.microsoft.com.. snip ..."
xmlns="http://schemas.microsoft.com/ ..snip ..">
<EntityContainer Name="XWingModelStoreContainer">
.....
```
and ..
```
<!-- C-S mapping content -->
<edmx:Mappings>
<Mapping xmlns="http://schemas.microsoft.c.. snip .." Space="C-S">
<Alias Key="Model" Value="XWingModel" />
<Alias Key="Target" Value="XWingModel.Store" />
<EntityContainerMapping CdmEntityContainer="XWingEntities"
StorageEntityContainer="XWingModelStoreContainer">
.......
```
Does this also help? I have no idea how those names got there (i'm assuming autogenerated) and how do i need to change them? If so, it looks like it's only possible via the xml file .. which is fine .. but feels ... wrong?
Cheers :)
| Why is this Entity Framework code not saving to the database? | CC BY-SA 2.5 | 0 | 2010-09-23T02:38:03.907 | 2010-09-27T03:11:13.723 | 2020-06-20T09:12:55.060 | -1 | 30,674 | [
".net",
"sql-server",
"entity-framework",
"sql-server-2008",
"entity-framework-4"
] |
3,775,546 | 1 | 3,775,751 | null | 5 | 1,264 | I'm currently exploring threading implementation in C# WinForms and I created this simple app:
I'm just wondering why the memory usage of this app keeps growing after I start, stop, start, and stop again the application. I'm having a thought that my thread instance doesn't really terminate or abort when I press the stop button. Please consider my code below, and any help or suggestions will be greatly appreciated.

```
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;
using System.Threading;
namespace ThreadingTest
{
public partial class Form1 : Form
{
private delegate void TickerDelegate(string s);
bool stopThread = false;
TickerDelegate tickerDelegate1;
Thread thread1;
public Form1()
{
InitializeComponent();
tickerDelegate1 = new TickerDelegate(SetLeftTicker);
}
private void Form1_Load(object sender, EventArgs e)
{
thread1 = new Thread(new ThreadStart(disp));
thread1.Start();
}
void disp()
{
while (stopThread == false)
{
listBox1.Invoke(tickerDelegate1, new object[] { DateTime.Now.ToString() });
Thread.Sleep(1000);
}
}
private void SetLeftTicker(string s)
{
listBox1.Items.Add(s);
}
private void btnStop_Click(object sender, EventArgs e)
{
stopThread = true;
if (thread1.IsAlive)
{
thread1.Abort();
}
}
private void btnStart_Click(object sender, EventArgs e)
{
stopThread = false;
thread1 = new Thread(new ThreadStart(disp));
thread1.Start();
}
private void btnCheck_Click(object sender, EventArgs e)
{
if (thread1.IsAlive)
{
MessageBox.Show("Is Alive!");
}
}
private void btnClear_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
}
}
}
```
| Simple Threading, why does this happen? (C# WinForms) | CC BY-SA 2.5 | 0 | 2010-09-23T04:56:09.877 | 2010-09-23T06:10:24.310 | 2010-09-23T05:00:30.583 | 396,335 | 396,335 | [
"c#",
"multithreading"
] |
3,775,815 | 1 | 3,777,871 | null | 0 | 428 | I have been implementing AES onto my website for security and I have ran into a glitch/problem to which I am un-able to find an answer and I find it quite bizzare.
I BELIEVE I know where it resides but I don't know how/where to do the fix.
Currently I have PHP 5 and the latest MySQL running on my local server.
Here is a small test that I am running which seems to work great.
```
<?php
$fName = "Giesbrecht";
$fNameEncrypt = common::encryptMe($fName);
echo $fNameEncrypt ."<br />";
echo common::decryptMe($fNameEncrypt);
?>
```
My function for actually using the common:encryptMe()
```
public static function encryptMe ($value)
// USE THE AES ENCRYPTION TO ENCRYPT ANY VALUE
{
include_once('../resources/crypt/AES.php');
$aes = new Crypt_AES();
$aes->setKey(AES_KEY);
return $aes->encrypt($value);
}
```
So the problem seems to run when I insert my values into my MySQL server. So I thought it might have been my Character Set, which WAS set to Latin1, and now I have moved to
Other factors regarding my MySQL setup:
I have attempted at using field types such as:
varchar, varbinary (where I currently sit), and text with a length of (256 on all). I do have many column fields in my table, and many of them will need to be encrypted, although i'm just testing with 2 until I have everything figured out.
So the glitch that i've run into is when I insert into the Database and I actually look at the value inside my Database I have the characters value, they equal ¥ÄÎó¸LOI„˜:é0 (although i'm sure the trans-coding on here will modify it) I have inserted a screenshot of the actual value in the database here:

But when I try to DeCrypt the value, I get nothing, and it runs blank. It seems as if there is an issue with any word that starts with a CAPITAL "G". if I have a lower case "g" it seems to work just fine...
I am completely stumped on this and have no idea how to troubleshoot this anymore.
Any help would be greatly appreciated.
PS. I am also curious to know if using PHP AES_Encryption is better or using MySQL AES_ENCRYPT is better?
Thanks.
I have now added a new section of working code based off of responses using base64...
Please notify me if there is anything wrong with this structure.
```
<?php
$connect = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
mysql_select_db(DB_NAME, $connect);
$fName = "Giesbrecht";
$encode = common::cleanUp($fName);
$encode = common::encryptMe($encode);
$encode = base64_encode($encode);
mysql_query("INSERT INTO contacts (userId, firstName, lastName) VALUES ('15', 'Justin', '".$encode."')") or die(mysql_error());
$results = mysql_query("SELECT * FROM contacts WHERE userId = '15'")
or die(mysql_error());
while ($row = mysql_fetch_array($results))
{
echo "<br />FN: ". $row['firstName'];
echo "<br />LNE: ". $row['lastName'];
echo "<br />LN: ". common::decryptMe(base64_decode($row['lastName']));
}
?>
```
| PHP + AES Security Glitch | CC BY-SA 2.5 | null | 2010-09-23T06:12:37.790 | 2011-01-16T23:35:08.177 | 2010-09-23T16:07:05.377 | 679,601 | 679,601 | [
"php",
"aes"
] |
3,776,125 | 1 | null | null | 1 | 2,698 | I am trying to run example of facebook android sdk , in that i have run stream example to fetch the
data from facebook.
Now hen ever i click on "fconnect" button to log in into facebook i am getting following dialog box

so is it possible to replace this dialog box with following to make it simple ???

| Replace facebook dialog with custom dialog in android | CC BY-SA 2.5 | null | 2010-09-23T07:15:11.227 | 2010-09-23T16:45:02.197 | null | null | 405,383 | [
"android",
"facebook"
] |
3,776,535 | 1 | 3,791,537 | null | 6 | 1,886 | Silly web element inspector (safari / chrome) question, but I can't seem to figure out why some properties are dimmed.

| web element inspector (safari / chrome) dimmed css properties | CC BY-SA 2.5 | 0 | 2010-09-23T08:25:33.417 | 2013-03-05T13:23:54.017 | null | null | 199,029 | [
"css",
"google-chrome",
"safari",
"properties",
"web-inspector"
] |
3,776,613 | 1 | null | null | 1 | 555 | I am learning Vim, and it is great. But the problem with Vim and gVim is that it doesn't support any complex scripts like Devanāgarī; it is not rendered properly. See the screenshots below:


Is there any way to make Vim or gVim support complex scripts? This affects all Indic scripts. I tried changing the font just in case, but it didn't help.
| Complex Scripts in Vim and gVim | CC BY-SA 4.0 | 0 | 2010-09-23T08:39:31.330 | 2020-08-05T21:08:12.163 | 2020-08-05T21:07:39.713 | 254,635 | 455,325 | [
"vim"
] |
3,776,987 | 1 | null | null | 9 | 2,126 | Our W3WP process on our production server is constantly high. It doesn't max out at 100% but jumps up into the 90%s a fair bit. To help look into this I profiled the live aplication using JetBrains dotTrace.
The results were as expected. All the slow methods were NHibernate functions that queried our database. My question is, would these slow methods actaully affect the CPU on our web server, as our database server is on a separate machine. Surely if the database server is doing some work then the web server jsut waits for a response, and the CPU shouldn't go up?
If this is the case, how do I use dotTrace (or another tool if neccesary) to work out where the CPU is being used as opposed to the server just waiting for a response from elsewhere?

You can see from the screenshot that most of the time is spend waiting for external HTTP requests to complete. However, these shouldn't affect the CPU usage on the web server I'd have thought
| Detecting W3WP CPU issues using jetBrains dotTrace | CC BY-SA 2.5 | 0 | 2010-09-23T09:30:24.943 | 2013-02-04T06:37:24.443 | 2010-09-24T12:04:28.003 | 17,765 | 17,765 | [
"asp.net",
"performance",
"nhibernate",
"iis",
"dottrace"
] |
3,777,102 | 1 | 3,777,126 | null | 5 | 934 | What are the numbers in a .NET stack trace on an ASPX error page (see picture)? They don't seem to be line numbers as they are too large? How can those numbers help me in determining the line of code that threw the exception?

| What are the numbers in a .NET stack trace on an ASPX error page? | CC BY-SA 2.5 | null | 2010-09-23T09:44:53.543 | 2010-09-23T13:17:31.363 | null | null | 163,573 | [
".net",
"stack-trace"
] |
3,777,226 | 1 | null | null | 0 | 140 | I'm using this method to try to move my view up but without success, this is the code in my MainViewController implementation file :
```
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
CGRect rect = self.view.frame;
if (movedUp)
{
NSLog(@"should move Up");
rect.origin.y -= 50;
rect.size.height += 300;
}
self.view.frame = rect ;
[UIView commitAnimations];
```
It is not erroring out and it's printing out "should move Up" so I know that the method is executed properly .
This is the IB hierarchy ( I`m trying to move the highlighted View) :

Any help would be greatly appreciated, I`m running out of ideas ..
---
Ok, Editing here I've isolated the problem to be something else, I'm using this code now :
```
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:.5];
self.containerView.frame = CGRectMake(0, 0, 250, 50);
[UIView commitAnimations];
```
and if I injecting this code in "- (void)viewDidLoad" it's working fine .
but if I use the same code in a different function in the same ViewController implementation file , it's not working :
```
- (void)setViewMovedUp:(BOOL)movedUp {
NSLog(@"test movedUp");
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:.5];
self.containerView.frame = CGRectMake(0, 0, 250, 50);
[UIView commitAnimations];
}
```
it's still printing out "test moved up" so the code is executed, just the view not animating .
| View not animating | CC BY-SA 2.5 | null | 2010-09-23T10:02:06.373 | 2015-10-07T02:39:09.333 | 2010-09-24T19:21:34.693 | 415,088 | 415,088 | [
"iphone",
"objective-c"
] |
3,777,645 | 1 | 3,777,658 | null | 0 | 211 | I am getting this error in rails whenever i am trying to create an object for the model. I am working on Windows 7
```
C:\Ruby\joker\chapter3>ruby script/console
Loading development environment (Rails 2.3.8)
>> mycb = ComicBook.new
SyntaxError: C:/Ruby/joker/chapter3/app/models/comic_book.rb:19: syntax error, u
nexpected $end, expecting kEND
from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_suppo
rt/dependencies.rb:380:in `load_without_new_constant_marking'
from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_suppo
rt/dependencies.rb:380:in `load_file'
from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_suppo
rt/dependencies.rb:521:in `new_constants_in'
from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_suppo
rt/dependencies.rb:379:in `load_file'
from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_suppo
rt/dependencies.rb:259:in `require_or_load'
from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_suppo
rt/dependencies.rb:425:in `load_missing_constant'
from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_suppo
rt/dependencies.rb:80:in `const_missing'
from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_suppo
rt/dependencies.rb:92:in `const_missing'
from (irb):1
>>
```
I have also attached the image so that you can look at the model itself

Also I am attaching you the created model ComicBook
```
C:\Ruby\joker\chapter3>ruby script/generate model ComicBook
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/comic_book.rb
create test/unit/comic_book_test.rb
create test/fixtures/comic_books.yml
create db/migrate
create db/migrate/20100923101842_create_comic_books.rb
```
The environment I am working is
```
Ruby version 1.8.7 (i386-mingw32)
RubyGems version 1.3.7
Rack version 1.1
Rails version 2.3.8
Active Record version 2.3.8
Active Resource version 2.3.8
Action Mailer version 2.3.8
Active Support version 2.3.8
Application root C:/Ruby/joker/chapter3
Environment development
Database adapter mysql
Database schema version 20100923101842
```
Looking forward for your help
Thank You
| Error while creating new object in rails | CC BY-SA 2.5 | null | 2010-09-23T11:02:41.490 | 2010-09-23T11:21:12.183 | null | null | 351,132 | [
"mysql",
"ruby-on-rails",
"object",
"syntax-error"
] |
3,777,810 | 1 | 3,779,450 | null | 14 | 14,402 | I have a somewhat strange problem. I have two maps on my site, a big one and a small one. I want to use the big one to show a route to a certain address. I'm now trying to implement the two maps but get a weird problem. The small map is working fine, but on the big map only a small area of the div is filled with the map, the rest is empty. (See the image.)

I use the following code to display the two maps:
```
function initialize() {
var latlng = new google.maps.LatLng(51.92475, 4.38206);
var myOptions = {zoom: 10, center: latlng,mapTypeId: google.maps.MapTypeId.ROADMAP};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var marker = new google.maps.Marker({position: latlng, map:map, title:"Home"});
var image = '/Core/Images/Icons/citysquare.png';
var myLatLng = new google.maps.LatLng(51.92308, 4.47058);
var cityCentre = new google.maps.Marker({position:myLatLng, map:map, icon:image, title:"Centre"});
marker.setMap(map);
var largeLatlng = new google.maps.LatLng(51.92475, 4.38206);
var largeOptions = {zoom: 10, center: largeLatlng,mapTypeId: google.maps.MapTypeId.ROADMAP};
var largeMap = new google.maps.Map(document.getElementById("largeMap"), largeOptions);
var largeMarker = new google.maps.Marker({position: largeLatlng, map:largeMap, title:"Cherrytrees"});
largeMarker.setMap(largeMap);
}
[..]
jQuery(document).ready(function () {
[..]
initialize();
});
```
What's going wrong here?
Unfortunately the suggestions below doesn't seem to work. The closes i came is to remove the from the elements and set the elements to hide with jquery
```
[..]
jQuery(document).ready(function () {
[..]
$("#shadow").add($("#shadowContent"),$("#closebar"),$("#content")).hide();
});
```
With the following result

| Google Maps don't fully load | CC BY-SA 2.5 | 0 | 2010-09-23T11:25:51.223 | 2014-02-23T15:50:58.367 | 2013-12-30T07:37:12.430 | 881,229 | 450,454 | [
"javascript",
"jquery",
"google-maps"
] |
3,777,931 | 1 | 4,433,633 | null | 0 | 1,619 | I've two problems, the second of which is only an issue because it's a possible way to fix the first!
I'm developing a Flex 4.1 application, using a Spark theme: I can't change these; Halo isn't an option.
It's providing the facility to fill multiple-selected cells of an AdvancedDataGrid with a single character, from a single keypress. So the user selects their cells using the Shift key, hits H (for example) and sees all the cells update with H, without using an itemEditor but via grid keyDown events instead. Then they click somewhere else and the selection should clear.
However the visible selection isn't fully cleared and the newly coloured cells won't all change from their selected colour.
Underneath I can verify that the selection has cleared: mygrid.selectedCells is empty. All behaviour afterwards points to some kind of display glitch with the grid: The cells aren't selected any more but they look like they are.
After the keypress over the selected cells:

After the mouse-click away to clear the selection:

Note the alternating columns: this is always the way it happens.
This is using the default itemRenderer. It still happens with a very basic custom itemRenderer but I haven't looked further down this avenue because there's a complication that I can't get the label in the itemRenderer to recognise backgroundAlpha so the 'selected' background is barely visible and looks terrible. I read somewhere that this is a problem with Spark, and it's certainly true that if I switch back to the default renderer, all is fine. Well...except for this selection-colour glitch.
Here's how it looks with the custom renderer:

If I'm missing something obvious, here's the itemRenderer I tried:
```
<?xml version="1.0" encoding="utf-8"?>
<s:MXAdvancedDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
focusEnabled="true" autoDrawBackground="true"
>
<s:layout>
<s:VerticalLayout horizontalAlign="center" verticalAlign="middle"/>
</s:layout>
<s:Label id="lblData" text="{listData.label}" backgroundAlpha="0"/>
</s:MXAdvancedDataGridItemRenderer>
```
So in summary: what I need is a way to fix the multiple selection glitch; the item renderer problem is only an issue if I need a custom itemRenderer to fix the selection glitch.
Any help gratefully received.
| Flex AdvancedDataGrid multiple cell selection highlight not fully clearing | CC BY-SA 2.5 | null | 2010-09-23T11:39:35.203 | 2013-12-10T14:14:47.910 | 2010-09-23T17:26:48.777 | 125,828 | 125,828 | [
"apache-flex",
"advanceddatagrid"
] |
3,778,115 | 1 | 3,797,014 | null | 1 | 2,045 | Hi all,
I'm using DevExpress XtraGrid control in a C#.Net application. I'mbinding the values from one table to a grid, and the table contains one bit field: `Authorized`. So the grid displays that column with a checkBox. I want to get that checkBox object or get the event of that control.

| How to get checkBox object from c# Xtragrid column | CC BY-SA 3.0 | null | 2010-09-23T12:00:35.503 | 2012-05-27T19:18:00.990 | 2012-05-27T19:18:00.990 | 275,567 | 434,910 | [
"c#",
"checkbox",
"devexpress",
"xtragrid"
] |
3,778,951 | 1 | 3,778,982 | null | 3 | 619 | I'm having trouble grasping reflection in C#, so I'm going to put my specific situation down and see what you guys can come up with. I've read TONS of C# reflection questions on here, but I still just simply don't get it.
So here's my situation; I'm trying to access an array which is a non-public member of a class I have access to.

Basically it's a which has an array variable called "list", but it has this parent type of and the reflection of it is just confusing the hell out of me.
I have to do a lot of these so a good guide or example would really help. Please let me know if you would like more information.
| C# Reflection How-to? | CC BY-SA 2.5 | 0 | 2010-09-23T13:40:30.823 | 2016-11-10T22:09:02.783 | null | null | 50,391 | [
"c#",
"reflection"
] |
3,778,945 | 1 | 3,779,091 | null | 1 | 101 | I have a partial view where I render, if the user has choosen an option, a button that permit the user to generate automatically a value for a certain field. Please give a look at this picture to understand what I mean:

This is achieved using the following markup on the partial view
```
<%= Html.LabelFor( model => model.IssueCode )%>
<br />
<% if ( Model.HasCodeGenerator ) { %>
<%= Html.TextBoxFor( model => model.IssueCode, new { style = "width:120px;background-color:#eeeeee;border: solid 2px #dfdfdf", @readonly = "readonly" } )%>
<% if (Model.ModelState == ModelStateEnum.Add) { %>
<button id="codeGenerator" style="font-size: 0.7em;margin-right: 10px">Genera codice fascicolo</button>
<% } %>
<% } else { %>
<%= Html.TextBoxFor(model => model.IssueCode, new { style="width: 120px" })%>
<% } %>
<%= Html.ValidationMessageFor(model => model.IssueCode, "*")%>
```
As you can see I append always an Html.ValidationMessageFor() at the end of the input field and a ValidationSummary aut the end of the view.
When the user submits the form the first block of code executed by the action is the following
```
if ( !ModelState.IsValid ) {
//Invalid - redisplay form with errors
return PartialView( "IssueCodeGenerator", model );
}
```
and this is the result I am getting in all of the three cases

Why the markup code for the button disappear?
Thanks for helping!
:
After validation the IssueCode textbox loose it's readonly="readonly" attribute. This means that the first condition is not meet, I think....
As per the Darin comment I am including
1. The action that show the Partial View
2. An extract of the partial that show that the ModelState variable is kept as an hidden control inside the form
3. The controller Action called by the Partial
4. The jQuery code that submit the partial
1 - This is the action that shows the partial
```
[HttpGet]
public ActionResult Create()
{
IssueModel im = new IssueModel()
{
ModelState = ModelStateEnum.Add,
FirmID = _firmManager.GetMyFirmID(),
CreatedDate = DateTime.Now,
LastUpdateDate = DateTime.Now,
HasCodeGenerator = _optionManager.HasIssueCodeGenerator()
};
return PartialView("Issue", im);
}
```
2 - Extract of the partial Issue.ascx
```
<% using (Html.BeginForm("SaveOrDelete", "Issue", FormMethod.Post, new { id = "crudForm" })) { %>
<%= Html.HiddenFor(model => model.FirmID) %>
<%= Html.HiddenFor(model => model.IssueID) %>
<%= Html.HiddenFor(model => model.ModelState) %>
```
3 - This is the controller action called when the form is submitted
```
[HttpPost]
public ActionResult SaveOrDelete( IssueModel model ) {
if ( !ModelState.IsValid ) {
//Invalid - redisplay form with errors
return PartialView( "Issue", model );
}
try {
Issue i = null;
if ( model.ModelState == ModelStateEnum.Add )
i = new Issue();
else
i = _manager.FindIssueByIssueID( model.IssueID );
if ( model.ModelState != ModelStateEnum.Delete ) {
_manager.BindIssueModel( i, model );
if ( model.ModelState == ModelStateEnum.Add )
i.FirmID = _contactManager.GetMyContact().FirmID;
i.LastUpdateDate = DateTime.Now;
_manager.SaveIssue( i );
} else {
_manager.DeleteIssue( i );
}
return PartialView( "ActionCompleted" );
}
catch ( Exception ex ) {
return PartialView( "ActionError",
new ActionErrorModel() { Message = ex.Message } );
}
}
```
4 - This is the jQuery code that submit the form
```
$("#crudForm").submit(function(event) {
event.preventDefault();
$("#crudForm").block();
$.ajax({
type: "post",
dataType: "html",
url: "/Issue/SaveOrDelete",
sync: true,
data: $("#crudForm").serialize(),
success: function(response) {
$("#crudForm").parent().html('').html(response);
$("#crudForm").unblock();
},
error: function(response) {
$("#crudForm").unblock();
}
});
});
```
Hope that this would help in finding the problem. Thank you.
| Why does my button not show up? | CC BY-SA 2.5 | null | 2010-09-23T13:39:46.600 | 2010-09-23T23:06:27.770 | 2010-09-23T23:06:27.770 | 25,300 | 431,537 | [
"asp.net",
"asp.net-mvc",
"validation",
"asp.net-mvc-2",
"partial-views"
] |
3,779,121 | 1 | 3,779,158 | null | 0 | 366 | I recently downloaded the Java JNA from [https://github.com/twall/jna/servlets/ProjectDocumentList?folderID=7408&expandFolder=7408&folderID=0](https://github.com/twall/jna/servlets/ProjectDocumentList?folderID=7408&expandFolder=7408&folderID=0) and tried using it. However, as exemplified by the screenshot below, the demo source code provided in [https://github.com/twall/jna/](https://github.com/twall/jna/) won't compile, no matter where I place the files. Mind you, I've tried placing them both in the default package an every other combination of package mix-ups, and this is only the latest version. Does anybody know why the compiler can't find what is contained within the JAR file? (Also, as you can see, the class files are all in the jar file to be found)

| Java JNA does not seem to be working | CC BY-SA 2.5 | null | 2010-09-23T13:57:28.567 | 2010-09-23T14:07:19.793 | null | null | 453,435 | [
"java",
"jar",
"jna"
] |
3,779,172 | 1 | 3,825,567 | null | 3 | 2,462 | This is an extjs single-page application which works fine in FF, IE, and Safari.
There are several problems with viewing or using this extjs app in the iphone. The extjs panels/windows do not resize, as it would in a normal screen. When the user zooms out, the expanding viewing area is blanked out. An example image is below:
- -

Viewport Issue:
The main issue is with the viewport. It does not scroll or zoom properly in Iphone.
| extjs apps on iphone | CC BY-SA 2.5 | null | 2010-09-23T14:02:45.603 | 2017-09-30T11:18:31.683 | 2017-09-30T11:18:31.683 | 1,000,551 | 83,719 | [
"ios",
"extjs",
"mobile-safari",
"viewport",
"responsive"
] |
3,779,573 | 1 | null | null | 3 | 4,195 | I am trying to create an excel file from datagrid in my asp.net page using the below code.I am able to create the excel file.But the created excel file does not has the cell borders.Without the cell borders,it looks like a word document.

My code is
```
Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("content-disposition", "attachment;filename=asas.xls");
Response.Charset = "";
this.EnableViewState = false;
System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);
this.ClearControls(dgShipping);
dgShipping.AllowPaging = false;
DisplayRecords();
dgShipping.RenderControl(oHtmlTextWriter);
Response.Write(oStringWriter.ToString());
Response.End();
dgShipping.AllowPaging = true;
```
Any workarounds for this ? Thanks for help
| C#: Datagrid to Excel .Cell border is missing in the created excel file | CC BY-SA 2.5 | 0 | 2010-09-23T14:45:03.437 | 2015-12-16T13:02:29.480 | null | null | 40,521 | [
"asp.net",
"excel",
"datagrid",
"export-to-excel"
] |
3,779,729 | 1 | 3,779,753 | null | 35 | 128,664 | I need to show the sum of the `count` column from this `datagridview`, but I don't know how I can get to the data in the datagridview.
When I click on the button, I want to show `94` in `label1`.
How can this be done?

| how I can show the sum of in a datagridview column? | CC BY-SA 2.5 | 0 | 2010-09-23T15:03:31.240 | 2022-04-29T06:48:46.073 | 2010-10-05T22:32:14.077 | 431,281 | 431,281 | [
"c#",
"winforms",
"datagridview"
] |
3,779,763 | 1 | 3,779,933 | null | 20 | 18,204 | I have a program that needs to repeatedly compute the approximate percentile (order statistic) of a dataset in order to remove outliers before further processing. I'm currently doing so by sorting the array of values and picking the appropriate element; this is doable, but it's a noticable blip on the profiles despite being a fairly minor part of the program.
More info:
- - - - - - [selection algorithm](http://en.wikipedia.org/wiki/Selection_algorithm)
Although this is all done in a loop, the data is (slightly) different every time, so it's not easy to reuse a datastructure as was done [for this question](https://stackoverflow.com/questions/3738349/fast-algorithm-for-repeated-calculation-of-percentile).
# Implemented Solution
Using the wikipedia selection algorithm as suggested by Gronim reduced this part of the run-time by about a factor 20.
Since I couldn't find a C# implementation, here's what I came up with. It's faster even for small inputs than Array.Sort; and at 1000 elements it's 25 times faster.
```
public static double QuickSelect(double[] list, int k) {
return QuickSelect(list, k, 0, list.Length);
}
public static double QuickSelect(double[] list, int k, int startI, int endI) {
while (true) {
// Assume startI <= k < endI
int pivotI = (startI + endI) / 2; //arbitrary, but good if sorted
int splitI = partition(list, startI, endI, pivotI);
if (k < splitI)
endI = splitI;
else if (k > splitI)
startI = splitI + 1;
else //if (k == splitI)
return list[k];
}
//when this returns, all elements of list[i] <= list[k] iif i <= k
}
static int partition(double[] list, int startI, int endI, int pivotI) {
double pivotValue = list[pivotI];
list[pivotI] = list[startI];
list[startI] = pivotValue;
int storeI = startI + 1;//no need to store @ pivot item, it's good already.
//Invariant: startI < storeI <= endI
while (storeI < endI && list[storeI] <= pivotValue) ++storeI; //fast if sorted
//now storeI == endI || list[storeI] > pivotValue
//so elem @storeI is either irrelevant or too large.
for (int i = storeI + 1; i < endI; ++i)
if (list[i] <= pivotValue) {
list.swap_elems(i, storeI);
++storeI;
}
int newPivotI = storeI - 1;
list[startI] = list[newPivotI];
list[newPivotI] = pivotValue;
//now [startI, newPivotI] are <= to pivotValue && list[newPivotI] == pivotValue.
return newPivotI;
}
static void swap_elems(this double[] list, int i, int j) {
double tmp = list[i];
list[i] = list[j];
list[j] = tmp;
}
```

Thanks, Gronim, for pointing me in the right direction!
| Fast Algorithm for computing percentiles to remove outliers | CC BY-SA 2.5 | 0 | 2010-09-23T15:08:19.170 | 2016-03-29T19:54:52.140 | 2017-05-23T11:45:25.620 | -1 | 42,921 | [
"c#",
"c++",
"algorithm",
"percentile"
] |
3,780,048 | 1 | 3,780,224 | null | 5 | 730 | I want to write formulas in Mathematica format in my blog, inside tag's formula. What js should I use (and what libary), to replace those tag's, with [http://www.wolframalpha.com/](http://www.wolframalpha.com/) search result image, when Dom gets loaded?
For example:
```
<formula>Limit[((3 + h)^(-1) + -1/3)/h, h -> 0]</formula>
```
gets replaced with:

If it's to complex or can not be done with javascript, please explain why.
| Complex wolframalpha ajax query | CC BY-SA 2.5 | 0 | 2010-09-23T15:42:23.627 | 2010-09-24T02:34:58.917 | null | null | 97,754 | [
"javascript",
"ajax",
"wolfram-mathematica",
"wolframalpha"
] |
3,780,140 | 1 | 3,780,174 | null | 5 | 1,861 | Sometimes my UserControl's Visible property does not get updated correctly. It happens at my app's boot time, in OnFontChanged, fired from inside InitializeComponent, probably because some other stuff has not been set up yet. I just can't find out what.

`vScrollBar` is a UserControl and is inside another UserControl. Apparently, this only happens when trying to set the value to true.
`vScrollBar` already has its handle created, as a watch on IsHandleCreated says it's true.
| Why is the Visible property not correctly updated in a UserControl? | CC BY-SA 2.5 | 0 | 2010-09-23T15:50:53.437 | 2010-09-23T16:27:08.943 | null | null | 231,306 | [
"c#",
"user-controls",
"visibility",
"scrollbars"
] |
3,780,493 | 1 | 3,781,811 | null | 3 | 3,787 |

I have two triangles in 3D space. Given that i know (x,y,z) of point in first triangle and i know vectors V1,V2,V3. I need to find point (x',y',z'). What transformation i should do to point (x,y,z) with vectors V1,V2,V3 to get that transformed point in the second triangle ?
Thanks for help !!!
| map points between two triangles in 3D space | CC BY-SA 2.5 | 0 | 2010-09-23T16:28:09.320 | 2015-03-04T02:13:16.487 | 2015-03-04T02:13:16.487 | 1,118,321 | 380,331 | [
"math",
"geometry",
"computational-geometry"
] |
3,780,583 | 1 | 3,780,826 | null | 3 | 950 | I am planning to develop a site which will have interface very similar to IDE

I was wondering if there is a jQuery plugin which allows the resizing of divs (horizontal / vertical based on settings) or any ideas on what would be the best approach.
| IDE Like interface with jQuery (Resizing divs) | CC BY-SA 2.5 | 0 | 2010-09-23T16:39:07.817 | 2010-09-23T17:09:25.307 | null | null | 107,129 | [
"javascript",
"jquery"
] |
3,781,058 | 1 | 3,781,260 | null | 2 | 2,282 | Say, I have a variable `rv` which has some numerical value. Now, I want to plot the value of this variable on a base plot but preceded by a nicely formatted symbol e.g., r subscript m, using `expression`. To write on the plot I use `mtext`.
However, what I get is either the value of the variable, but no nicely formatted symbol (left annotation), or a nicely formatted symbol, but not the value of the variable, but the variable name...
I tried to play around with `eval`, but didn't get what I wanted. Here is my code:
```
plot(1:10, rep(10,10), ylim=c(0,12))
rv <- 0.43
#left annotation:
mtext(paste(expression(italic(r[M])), " = ", rv), side = 1, line = -1.5, adj = 0.1)
#right annotation:
mtext(expression(paste(italic(r[M]), " = ", rv)), side = 1, line = -1.5, adj = 0.9)
```
This is the result:

Thanks.
btw: I know that I can get it, if I use two times `mtext` and play around with `adj` and stuff. But I would really like to get it in one call or without playing around with the position of two annotations.
| How to add nice formated anotations to a R base graph using expression and the value of a variable? | CC BY-SA 2.5 | 0 | 2010-09-23T17:37:59.330 | 2010-09-23T18:06:57.977 | 2010-09-23T17:44:47.720 | 289,572 | 289,572 | [
"r",
"formatting",
"graph"
] |
3,781,072 | 1 | null | null | 3 | 150 | 
I'm making an isometric game. When the player tries to walk diagonally into a wall I want them to slide smoothly across it, so whatever portion of the movement would be legal is used, and anything in the direction of the normal is thrown away. Walls can be any angle, not just vertical or horizontal, and the player has 360 motion.
I feel like I'm almost there but I can't put the last piece into place.
| How to make the player slide smoothly against terrain in a game? | CC BY-SA 2.5 | null | 2010-09-23T17:39:52.113 | 2010-09-23T18:01:47.880 | null | null | 11,911 | [
"math"
] |
3,781,359 | 1 | 3,781,740 | null | 3 | 1,438 | I would like to have suggestions as to how to use Qt to implement the following:
I have multiple identical widgets that I want to display once at a time.
I know that QToolbox exists, but the problem is the following:
I need to change the order in which the tabs or buttons appears (see image):

The widget that is set to an index does not stay at the same index, but should follow the header.
It doesn't have to be exactly as I describe, it's more the general idea of reordering my widgets that matters.
Thanks to all.
| Reorder widgets in Qt | CC BY-SA 2.5 | null | 2010-09-23T18:21:18.863 | 2010-09-23T19:12:38.337 | null | null | 150,343 | [
"user-interface",
"qt"
] |
3,781,473 | 1 | null | null | 1 | 493 | Here's my problem. It looks perfect in Firefox, Safari, IE8, but in IE7 and IE8 comparability mode, it adds about 4000px of width to the div.team elements nested within the list item. the problem goes away if i remove the span.score elements.
The image attached shows the score in the first box in white number text. The top image is the way it's supposed to look. The bottom is IE7.


I've been trying to figure this out for hours. I even tried making the list a bunch of divs in case it was a weird IE7 list item bug, but I got the exact same results.
Here's my html:
```
<ul class="selected" data-league="ncaaf">
<li>
<div class="time">THU 12:30PM</div>
<div class="teams">
<div class="team">AUB (21) <span class="score">10</span></div>
<div class="team">MSST <span class="score">22</span></div>
</div>
</li>
...
```
Here's my CSS:
```
.boxList ul {
float:left;
margin:0 0 0 0;
heigth:40px;
width:5000px;
clear:left;
display:none;
}
.boxList ul.selected {
display:block;
}
.boxList li {
float:left;
height:40px;
padding:0 5px;
min-width:56px;
background:url(../images/scoreSchedBoxTile.png) repeat-x;
border:1px solid #000;
list-style-type:none;
margin:0;
font-size:9px;
line-height:13px;
font-weight:bold;
cursor:pointer;
position:relative;
}
.boxList li .time {
text-align:center;
}
.boxList li .teams {
}
.boxList li .team {
text-align:left;
color:#000;
clear:left;
line-height:13px;
height:13px;
}
.boxList li .score {
font-weight:bold;
text-align:right;
color:#fff;
float:right;
display:block;
}
```
| IE7 (IE8 Compatability Mode) bug: crazy amound of width applied to a floated element that is parent to another float | CC BY-SA 2.5 | null | 2010-09-23T18:38:37.747 | 2012-06-12T13:39:13.523 | 2012-06-12T13:39:13.523 | 44,390 | 261,375 | [
"internet-explorer-7",
"nested",
"css-float"
] |
3,781,705 | 1 | 3,809,370 | null | 2 | 880 | I have a very simple WCF Data Services application and I am doing some basic CRUD operations. I have a ChangeInterceptor on the entity set that is changing, but the object in the ChangeInterceptor is the current state in the database, not what is sent in the HTTP PUT.
Here is my ChangeInterceptor:
```
[ChangeInterceptor("People")]
public void OnChangePerson(Person personChanging, UpdateOperations updateOperations) {
switch (updateOperations) {
case UpdateOperations.Change:
// personChanging is the database version here, not the changed version.
break;
default:
break;
}
}
```
Here is my client-side code (jQuery):
```
var data = {
FirstName: "NewFN",
LastName: "NewLN"
};
$.ajax({
type: "PUT",
url: serviceUrl + "/People(" + personID + ")",
contentType: "application/json",
dataType: "json",
data: JSON.stringify(data),
success: function (data) {
alert("Success!");
},
error: function (error) {
alert("An error occured");
}
});
```
Here is the JSON being sent to the server:

Here is the ChangeInterceptor when the message is received:

I have uploaded the code for this project here: [http://andyjmay.com/test/2921612/ODataTest.zip](http://andyjmay.com/test/2921612/ODataTest.zip)
| Can I validate an entity before saving the changes? | CC BY-SA 2.5 | null | 2010-09-23T19:07:17.930 | 2010-09-28T02:56:47.897 | 2010-09-24T12:52:15.623 | 12,367 | 12,367 | [
"c#",
"json",
"wcf-data-services",
"odata"
] |
3,783,160 | 1 | null | null | 3 | 670 | Twitter recently added hoverable multi-media "tooltips" -- when you hover over a username or avatar on your feed, it pops up (in-place) more details on the user (tweets sent/received, location, last tweet). It also includes a "Follow" button. There's a 'more-info' link which will load some more details on-demand.
I'd like to emulate how they're doing this-- which I think is a very elegant solution. There's a single empty/hidden div on the page, and on hover, that div is relocated to the appropriate place, display is set to "block" and populated with information (on-demand).
If I'm on the prototype/scriptaculous framework, is there a straightforward way of doing this same implementation? I don't have the ability to use other frameworks. Thank you in advance!
Screenshot:

| Hoverable tooltips with AJAX-pulled content on Prototype/Scriptaculous (to act like Twitter's)` | CC BY-SA 3.0 | null | 2010-09-23T23:10:50.000 | 2013-01-25T20:55:21.093 | 2011-12-27T22:09:09.337 | 938,089 | 456,742 | [
"javascript",
"twitter",
"tooltip",
"prototypejs",
"scriptaculous"
] |
3,783,207 | 1 | null | null | 8 | 12,983 | Fellow programmers,
I know this is a little outside your juridistiction, but I was wondering perhaps if you have time, if you could help me with one "procedure". Not in view of math but what would be the best way to take.


This is an airfoil / profile. Usually, profiles are defined with two sets of data. One is the position of mean camber line, given in the form of x,y where x is usually given in percentages of chord length. Second set of data is thickness at percentages of chord length. Thickness is always drawn perpendicular to the camber line(!), and that gives the profile points.
Now, I have a reverse problem - I have points of a profile, and I need to determine the position of the camber line. Method of interpolation through points can vary, but it doesn't matter, since I can always interpolate as many points as I need, so it comes to linear in the end.
Remember, since the thinkness is drawn perpendicular to the camber line, the position of camber line is not mean between the points of upper and lower line of profile (called the back and face of profile).
---
Uhh, painfully and in large scale (I'm talking long A0 paper here, that is 1189x5945mm on a large drawing desk. You start by drawing a first camber line (CL) iteration through the midpoints (mean points) between the points of face and back at same x ordinates. After that you draw a lot of perpendicular lines, perpendicular to that CL, and find their midpoints between face and back (those points on face and back will no longer have same x values). Connect those, and that is your second iteration CL. After that you just repeat the second step of the procedure by drawing perpendicular lines onto that 2nd CL ... (it usually converges after 3 or 4 iterations).
---
Replaced the picture with one which better shows how the thinkness is "drawn" onto the camber line (CL). Another way of presenting it, would be like picture no.2. If you drew a lot of circles, whoce center points are at the camber line, and whose radiuses were the amounts of thickness, then tangents to those circles would be the lines (would make up the curve) of the profile.
The camber line is not the mean line (mean between the points of face and back); it can coincide with it (therefore usually the confusion). That difference is easily seen in more cambered profiles (more bent ones).
---
3rd edit - to illustrate the difference dramatically (sorry it took me this long to draw it) between the mean line and camber line, here is the process of how it is usually done "on paper". This is a rather deformed profile, for the reason, that the difference between the two can be more easily shown (although profiles like this exist also).
In this picture the mean line is shown - it is a line formed by the mean values of face and back on the same x coordinates.

In this picture onto the mean line, perpendicular lines were drawn (green ones). Midpoints of those perpendicular lines make up for the 1st iteration of the camber line (red intermittent line). See how those circles fit better inside the airfoil compared to the first picture.

In the picture below the 2nd iteration of the camber line is shown, along with the mean line from the first picture as to illustrate the difference between the two. Those circles are fitting even better now inside (except that first one which flew out, but don't mind him).

| Determining a mean camber line | CC BY-SA 2.5 | 0 | 2010-09-23T23:26:55.140 | 2015-09-14T16:50:20.570 | 2017-02-08T14:30:24.567 | -1 | 62,699 | [
"algorithm",
"geometry"
] |
3,783,763 | 1 | 3,783,860 | null | 0 | 2,998 | I feel like I hit a wall trying to structure what I thought would be a simple database schema for modeling basic financial transactions. I'm hoping some of you with more experience can weigh in and point me in the right direction.
My application has four distinctly different types of leases that customers can purchase. As such, each type of lease has it's own table, and in order to keep referential integrity, each lease table has it's own transactions table.
My original sketch looked like this:

First off, I used a FK reference to Function Types to avoid using signed integers. It makes no sense to have a negative payment, so I figured it would work well for each transaction to have either a debit or credit reference. Does this make sense?
Another thing that was bothering me is that all transactions don't appear to be equal. That is, I feel like the transctions for this application should possibly be grouped into separate tables.
Should transactions such as flat rate fees, variable rate fees, payments, interest and voids all be stuffed into the same table? It seems messy to me, but I'm already stuck with a transactions table for each lease type so splitting those tables up even more is not very appealing.
Just about every transaction type other than payments will be built programmatically, so I can have references in the "Notes" field that specifies which payment a bounced check or void transaction is referencing. Is this good enough or am I thinking about this all wrong?
Thanks!
| How should I model these simple financial transactions? | CC BY-SA 2.5 | 0 | 2010-09-24T02:08:54.773 | 2010-09-24T08:35:48.343 | null | null | 274,837 | [
"design-patterns",
"database-design",
"financial"
] |
3,783,833 | 1 | null | null | 0 | 434 | I know how to draw straight lines in C#, but I would like to draw a horizontal line, with two colors. Light blue on the top, and dark blue on the bottom. Also, how would I sort of... Append to that line? For example, every few seconds, that line will become bigger... like a ProgressBar. (btw, I'm not creating a ProgressBar, just using that as an example).
Here's the kind of line that I'd like to draw. I am aware that I can simply use PictureBox. But I want to start drawing!
Also, if there are other ways of drawing, than GDI or GDI+, could you list or link to those?

Thanks!
| Drawing, and Appending to a Double-Horizontal Line | CC BY-SA 2.5 | null | 2010-09-24T02:28:54.193 | 2010-09-24T13:27:15.193 | 2010-09-24T06:28:41.327 | null | null | [
"c#",
".net",
"winforms",
"drawing",
"gdi"
] |
3,783,839 | 1 | 3,784,870 | null | 1 | 1,987 | I am still learning to do javascript and django and yesterday I tried to do a simple hello world ajax exercise.
Server logs show that python code is being called but somehow django/python does not return anything when I check the xmlhttp.responseText and responseXML in firebug.
I removed the checking of the http status returned so that code immediately goes to print the output from the server
```
<html>
<head>
<title>Javascript example 1</title>
<script type="text/javascript">
function doAjax()
{
xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
alert("response text: "+xmlhttp.responseText+"\n"
+"response XML: "+ xmlhttp.responseXML);
if (xmlhttp.responseText!="") {
$("thediv").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","http://127.0.0.1/test/",true);
xmlhttp.send();
}
function $(element){
return document.getElementById(element);
}
</script>
</head>
<body>
<input type="button" value="click me" onClick=javascript:doAjax()>
<br/><br/>
<div id="thediv">
some test
</div>
</body>
</html>
```
my views.py
```
from django.http import HttpResponse
def test(request):
response_string="hello"
return HttpResponse(response_string,mimetype='text/plain')
```
my urls.py
```
from django.conf.urls.defaults import *
from project1.views import test
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
(r'^test/$', test)
# Example:
# (r'^project1/', include('project1.foo.urls')),
# Uncomment the admin/doc line below and add 'django.contrib.admindocs'
# to INSTALLED_APPS to enable admin documentation:
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
# (r'^admin/', include(admin.site.urls)),
)
```
Here is the code in action

| Can't do an AJAX call with Python and Django | CC BY-SA 2.5 | null | 2010-09-24T02:30:57.167 | 2010-09-24T11:52:17.357 | 2010-09-24T11:52:17.357 | 160,950 | 160,950 | [
"javascript",
"python",
"django"
] |
3,783,868 | 1 | 3,783,885 | null | 0 | 3,172 | I'm making a new Project which is a class library.

my problem is I always got this error:
```
The type or namespace name 'Drawing'
does not exist in the namespace 'System' (are you missing an assembly reference?)
```
this is my code:
```
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
namespace ClassLibrary1
{
public class Class1
{
public void ReturnImage(object imageStream)
{
try
{
byte[] data = (byte[])imageStream;
MemoryStream ms = new MemoryStream(data);
return Image.FromStream(ms);
}
catch
{
}
}
}
}
```
I'm planning to use this class to serve as a repository of common methods that I will be reusing in my program. In the above code, I have a public method `ReturnImage` which supposedly will accept an object and returns an `Image`.
But why I get that error? Please help...
| How to reference Image Class in C# winforms? | CC BY-SA 2.5 | null | 2010-09-24T02:38:10.507 | 2010-09-24T02:46:55.867 | 2020-06-20T09:12:55.060 | -1 | 396,335 | [
"c#"
] |
3,784,147 | 1 | 3,784,505 | null | 0 | 404 | If you use [GlobalMemoryStatusEx](http://msdn.microsoft.com/en-us/library/aa366589(v=VS.85).aspx) to get statistics, one is [dwMemoryLoad](http://msdn.microsoft.com/en-us/library/aa366770(v=VS.85).aspx) which is the approximate percentage of physical memory in use. Is memory that SuperFetch has consumed added to dwMemoryLoad? I'm working on software which uses this statistic to manage its own caching, flushing cache when the percentage goes too high. I'm worried that SuperFetch causes false results.
Reading about SuperFetch, games users on Vista [often say](http://www.howtogeek.com/howto/windows-vista/how-to-disable-superfetch-on-windows-vista/) turning it off improves performance. That confirms my hypothesis that SuperFetch will cause an application to falsely believe more physical RAM is in use than is actually used by the apps being run.
Mark Russinovitch's [Vista Kernel posting](http://technet.microsoft.com/en-us/magazine/2007.03.vistakernel.aspx) has a nice explanation of SuperFetch.
In an interesting example of where the original Task Manager is more informative than Sysinternals Process Explorer, Jeff Atwood has pictures of the [Physical Memory usage with Superfetch](http://www.codinghorror.com/blog/2006/09/why-does-vista-use-all-my-memory.html) in Task Manager.

Note the 6MB free Physical Memory!
I'm not just being lazy - all our 32bit test machines are running XP and I only have access to 64 bit Vista or Windows 7 machines, so I'd still like to hear from people as to how it affects 32 bit systems.
| Does SuperFetch affect dwMemoryLoad percentage and clash with smart memory management? | CC BY-SA 2.5 | null | 2010-09-24T04:10:59.207 | 2010-09-24T05:44:40.480 | 2010-09-24T05:37:00.997 | 53,870 | 53,870 | [
"windows-7",
"windows-vista"
] |
3,784,236 | 1 | 3,784,415 | null | 0 | 5,821 | I have the following AlertDialog with an image inside it:

As you can see there is a small gap just above and just below the image. I'd like to remove that gap.
My layout xml looks like:
```
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/alert_thumb_root"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageView android:id="@+id/thumb"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
```
| Resize AlertDialog to fit image exactly | CC BY-SA 2.5 | null | 2010-09-24T04:41:44.017 | 2019-05-10T09:35:35.253 | null | null | 149,166 | [
"android",
"xml",
"imageview",
"android-alertdialog"
] |
3,784,597 | 1 | 3,784,627 | null | 0 | 146 | I'm trying to display images from a database table to my dataGridView control.
Other cells display image. But some doesn't and throws this exception:

What does this exception means? What should I do to fix it?
| What this exception means? C# winforms | CC BY-SA 2.5 | null | 2010-09-24T06:05:48.557 | 2010-09-24T06:40:17.850 | 2020-06-20T09:12:55.060 | -1 | 396,335 | [
"c#"
] |
3,784,735 | 1 | 3,840,063 | null | 0 | 1,184 | I've recently updated my Internet Explorer version from 8 to 9. Now, I'm getting the following exception

This is kind of weird. Following are the re-producing steps.
1. Open a Silverlight application [Currently, using Silverlight 4].
2. Use Clean, Build and Run. [The above mentioned exception occurs]
3. Now, again hit refresh in browser. [The application loads and works correctly.]
This is same for both as well as .
Note: Once, you got it working after the second time refresh technique it won't occur until you Clean and Build the solution once again. Before, it shows this Internet cannot display the webpage "ieframe.dll error" is displayed in the Tab header of IE.
How to resolve this? or is it a known issue?
| ieframe.dll error while running silverlight application in IE9 | CC BY-SA 2.5 | 0 | 2010-09-24T06:34:20.097 | 2010-10-01T14:23:21.113 | 2010-09-24T08:12:48.127 | 17,516 | 270,190 | [
"silverlight",
"internet-explorer",
"silverlight-4.0",
"internet-explorer-9"
] |
3,784,763 | 1 | null | null | 0 | 1,019 | Hi please find the screenshot attached and provide me the logic how we can acheive this. I need to import this excel file. This is a sample image. I have no. of header rows and no. of columns will differ in each header.

Here is another information about the excel file.
Col cells are set with background color. IS there any way to read the values from the cells having background color
| Excel import to database using C# | CC BY-SA 2.5 | null | 2010-09-24T06:39:05.920 | 2010-09-29T11:19:53.667 | 2010-09-29T11:19:53.667 | 50,447 | 320,009 | [
"c#",
"asp.net",
"excel"
] |
3,784,802 | 1 | 3,784,853 | null | 0 | 289 | 
I need to design a table like the sudoko Table where the user has to enter the numbers.Is there any way to do it in C#?or we have to use create usercontrol?
| How to make the textbox type table in C#? | CC BY-SA 3.0 | null | 2010-09-24T06:46:19.210 | 2011-09-25T02:17:18.060 | 2011-09-25T02:17:18.060 | 142,162 | 412,982 | [
"c#-4.0"
] |
3,784,842 | 1 | 3,785,020 | null | 3 | 3,902 | I'm searching for an online JavaScript CSS editor like this:

Did somebody know of one?
| Javascript - Online CSS Editor | CC BY-SA 2.5 | 0 | 2010-09-24T06:53:31.187 | 2018-04-20T21:46:26.133 | 2010-09-24T06:56:18.123 | 23,897 | 2,136,202 | [
"javascript"
] |
3,784,933 | 1 | 3,791,362 | null | 1 | 239 | I have a simple view that has 2 textboxes and 1 file input.
```
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<iLoyalty.BackOfficePortal.Models.SegmentModel>" %>
<% using (Html.BeginForm("SaveSegment", "Segment", FormMethod.Post, new { id = "SegmentForm", enctype = "multipart/form-data" }))
{ %>
<div class="StContent">
<h3>
<%= iLoyalty.BackOfficePortal.Globals.GetResourceText("CardSegmentInsert")%></h3>
<br />
<%= Html.HiddenFor(model => model.ApplicationName, new { id = "ApplicationName" })%>
<%--<%= Html.HiddenFor(model => model.SegmentID, new { id = "SegmentID" })%>--%>
<table width="95%" border="0" cellspacing="1" cellpadding="4" class="Table" style="margin: 0 0 0 10px">
<tr class="Tr0">
<td style="width: 200px" class="Tr1">
<%= iLoyalty.BackOfficePortal.Globals.GetResourceText("ApplicationName")%>
</td>
<td>
<span id="ApplicationName">
<%= Model.ApplicationName %></span>
</td>
</tr>
<tr class="Tr0">
<td style="width: 200px" class="Tr1">
<%= iLoyalty.BackOfficePortal.Globals.GetResourceText("CardSegmentName")%>
</td>
<td>
<%= Html.TextBoxFor(model => model.SegmentName, new { id = "SegmentName", @class = "txtBox" })%>
</td>
</tr>
<tr class="Tr0">
<td style="width: 200px" class="Tr1">
<%= iLoyalty.BackOfficePortal.Globals.GetResourceText("RewardRate")%>
</td>
<td>
<%= Html.TextBoxFor(model => model.GainRate, new { id = "GainRate", @class = "txtBox" })%>
</td>
</tr>
<tr class="Tr0">
<td style="width: 200px" class="Tr1">
</td>
<td>
<input name="PostedFile" id="PostedFile" type="file" class="txtBox" style="width: 200px" />
</td>
</tr>
<tr class="Tr0">
<td class="Tr1" colspan="2" style="text-align: right">
<input id="saveBtn" type="submit" class="button" value='<%= iLoyalty.BackOfficePortal.Globals.GetResourceText("Add")%>' />
</td>
</tr>
</table>
</div>
<script type="text/javascript">
$(document).ready(function () {
$('#saveBtn').click(function () {
//BlockPage();
var options = {
target: '#contentDiv',
success: function () {
BlockDivSuccess('generalCover');
}
};
$('#SegmentForm').ajaxForm(options);
});
});
</script>
<% } %>
```
After clicking saveBtn I see that in debug mode it posts the appropriate data to the appropriate action and it works well. And in firebug I see the response to the ajax call is just like what I expect to have. But I get an javascript error that just says:
After I remove the line above, everything is ok in all browsers. But I need this too.
```
<input name="PostedFile" id="PostedFile" type="file" class="txtBox" style="width: 200px" />
```
Do you have any idea about this problem? It is interesting that it occurs only in ie.

Thanks in advance,
| Returning response from a view that contains input type file - Microsoft JScript runtime error: Object expected | CC BY-SA 2.5 | null | 2010-09-24T07:13:14.353 | 2010-09-25T09:30:43.247 | 2010-09-25T09:30:43.247 | 104,969 | 104,969 | [
"ajax",
"asp.net-mvc-2",
"jquery"
] |
3,784,977 | 1 | null | null | 3 | 817 | I'm trying to add JFace source code on my Target Platform in Eclipse 3.6.
Many [help](http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.pde.doc.user/guide/tools/preference_pages/source_code_locations.htm) [page](http://publib.boulder.ibm.com/infocenter/rsmhelp/v7r0m0/index.jsp?topic=/org.eclipse.pde.doc.user/guide/tools/preference_pages/source_code_locations.htm) on the internet refers to a "Source Code Locations" tab from the Target Platform preferences page.
I do have that tab on a fresh Eclipse 3.6 including RCP development (eclipse-rcp-helios-SR1-RC4-win32.zip). Here's a screenshot of my Target Platform preferences page :

Any idea how add source code to my target platform ?
| Why is the "Source Code Locations" page missing on eclipse 3.6 (Helios) | CC BY-SA 2.5 | 0 | 2010-09-24T07:23:20.867 | 2010-09-24T07:58:56.790 | null | null | 3,122 | [
"eclipse-plugin",
"eclipse-rcp",
"target-platform"
] |
3,785,390 | 1 | 3,786,061 | null | 1 | 1,591 | I am developing a web application on joomla cms. In which i am using open inviter for send invitation to Gmail , AOL and Facebook ID. Gmail and AOL receiver get mail in proper html format which i am sending. like this

But same mail displaying like this
It is showing html format in html code.

Can anyone explanin me how can i get facebook mail in proper html format like Gmail or AOL?
Is this any default setting in facebook for sending mail by third party web application?
Thanks
| Customised the facebook friends invite email format in openinviter | CC BY-SA 2.5 | null | 2010-09-24T08:26:56.820 | 2012-02-21T14:23:01.550 | 2010-09-24T10:13:14.473 | 221,434 | 390,452 | [
"email",
"facebook",
"joomla"
] |
3,785,500 | 1 | 4,874,413 | null | 1 | 709 | I get this strange error if I use a link_to with the :remote => true parameter in IE 6 and IE 7. IE 8 and all other browsers works just fine:

If I commenting out the code for the link (jQuery binding on ajax:success), the error still appears. I don't know how to locate/track this error, because line 1529... does not exists. What is going wrong here?
| Rails3 + link_to(..., :remote => true) + IE 6/7 does not work | CC BY-SA 2.5 | null | 2010-09-24T08:48:11.620 | 2011-02-02T12:22:38.170 | null | null | 6,851 | [
"javascript",
"internet-explorer",
"ruby-on-rails-3"
] |
3,785,704 | 1 | 3,785,735 | null | 0 | 195 | 
my image is `1.` Normal repeat-x is `2.`
I need image repeat like this `3.`
| custom repeating background image using css | CC BY-SA 2.5 | null | 2010-09-24T09:21:25.940 | 2010-09-24T09:26:06.083 | 2020-06-20T09:12:55.060 | -1 | 60,200 | [
"html",
"css"
] |
3,785,919 | 1 | 3,786,144 | null | 0 | 353 | Basically, i have purchased HTC Hero (Android sdk 1.5) , but i just got the notification of "System software update" and i agreed to update the .
I was developing application for android sdk 1.5 successfully, but now i have created a Hello world application for the Android sdk 2.1 and then when i am trying to run it on my updated phone, at that time below screen is showing up:

On console window, it is showing up an error:
What i need to do to run the application(sdk 2.1) which i am developing ? pls let me know
And ya, when i am trying to connect phone using USB cable, it is showing an alert dialog regarding "Choose a connection type:" showing below options:
1. Charge only
2. HTC Sync
3. Disk drive
4. Internet Sharing
: so which mode should i select for the development of application and running it on phone.
| Android - Run application on SDK 2.1 | CC BY-SA 2.5 | 0 | 2010-09-24T09:52:09.743 | 2010-09-24T10:30:33.327 | 2010-09-24T10:30:33.327 | 379,693 | 379,693 | [
"android",
"android-2.1-eclair"
] |
3,785,938 | 1 | null | null | 18 | 6,669 | I'm developing an application that contains a number of panes. See the [screenshot](https://i.stack.imgur.com/4d2KN.png):

- `wx.ScrolledPanel``wx.Panels`- `wx.grid.Grid`- `wx.Panel``wx.grid.Grid`- `wx.Panel`[enthought chaco](http://code.enthought.com/chaco/)- `wx.Panel`
I would like to implement so that when I move my mouse over the plot I can immediately zoom in or out using my scroll wheel without first clicking on the plot to give it the focus.
Similarly when I move my mouse over the left , the top or the bottom panes I would like to be able to immediately scroll the window using the scroll wheel without first clicking on the window.
Currently I defined a function:
```
def focusFollowsMouse(window):
window.Bind(wx.EVT_ENTER_WINDOW, lambda event: window.SetFocus())
```
I would like to apply this function only on the four top-level panes: , , and .
However I need to call this function for each sub-panel or control in each of the top-level panes to get this to work. For example I need to apply this function individually to the , , etc. panels.
Most likely the `EVT_ENTER_WINDOW` event is not propagated to parent windows.
Is there a way to get this to work without applying `focusFollowsMouse` to each and every sub-panel or control?
Thanks
| Focus-follows-mouse in wxPython? | CC BY-SA 2.5 | 0 | 2010-09-24T09:54:59.927 | 2010-09-30T15:35:13.980 | 2010-09-24T11:21:17.757 | 442,793 | 442,793 | [
"python",
"wxpython",
"wxwidgets"
] |
3,786,019 | 1 | 3,787,320 | null | 1 | 2,406 | I've imported a CSV file into an sqlite table. everything went fine except it included quotes " " around the data in the fields. not sure why because there are no quotes in the CSV file.
anyone know how to avoid this or get rid of the quotes somehow?
Here's a screenshot from the firefox sqlite import settings I'm using:

thanks for any help.
| importing CSV file into sqlite table | CC BY-SA 2.5 | null | 2010-09-24T10:06:47.580 | 2010-09-24T13:05:18.787 | null | null | 388,458 | [
"sql",
"database",
"sqlite",
"csv"
] |
3,786,083 | 1 | null | null | 6 | 11,499 | I'm developing an app for iPad and I try to handle multiple orientation.
My app contains a webview and a loading UIImageView that appears when my webview is loading content.
This UIImageView has a background image that I set in InterfaceBuilder. When I change orientation to landscape, the image is cut.
I'd like the UIImageView to set image-portrait.png when the ipad is in portrait mode and image-landscape.png when it's in landscape mode.
Thank you for your help and advices!
Screenshots :


| iPad SDK, how to handle orientation with an UIImageView | CC BY-SA 2.5 | 0 | 2010-09-24T10:19:03.600 | 2016-06-09T23:39:19.153 | 2010-09-24T12:18:19.300 | 312,654 | 312,654 | [
"iphone",
"ipad",
"sdk",
"uiimageview",
"orientation"
] |
3,786,093 | 1 | 3,787,368 | null | 4 | 1,565 | I have this very simple Combobox in my XAML:
```
<ComboBox Name="cmb1" Width="200" Height="23" ItemsSource="{Binding}" />
```
and this is my code behind:
```
public class Test //: System.Windows.DependencyObject
{
public string Name { get; set; }
public override string ToString() { return Name; }
}
public MainWindow()
{
InitializeComponent();
var col = new ObservableCollection<Test>();
cmb1.DataContext = col;
col.Add(new Test { Name = "A" });
col.Add(new Test { Name = "B" });
col.Add(new Test { Name = "C" });
col.Add(new Test { Name = "D" });
}
```
As long as class is NOT inherited from everything is fine. But when it is inherited, ComboBox does not show when it is not expanded.
Current Item is selected when I click on ComboBox and see its drop-box.

| WPF ComboBox does not show current item when it is a DependencyObject | CC BY-SA 2.5 | null | 2010-09-24T10:21:31.350 | 2010-09-24T15:28:12.710 | 2010-09-24T14:30:07.607 | 383,515 | 383,515 | [
"wpf",
"xaml",
"binding",
"combobox"
] |
3,786,141 | 1 | 3,789,330 | null | 0 | 206 | I'm creating a new ASP.net website via Visual Studio. I then try to run the default.aspx page it generates, and it throws this error:

I've tried deleting the affected lines as suggested by MSDN but to no avail! I am on Windows 7, with ASP.net installed
If I delete all the lines I get:

Any ideas?
| ASP.net IIS Error Message (Screenshot included) | CC BY-SA 2.5 | null | 2010-09-24T10:28:20.240 | 2010-09-24T17:01:39.803 | 2010-09-24T10:40:55.000 | 356,635 | 356,635 | [
"asp.net",
"iis"
] |
3,786,214 | 1 | null | null | 3 | 4,025 | 

i am developing gallery view using gridview,in small screen my layout design fixed very well,but large screen did not my design,In large screen have some spaces bellow "load more picture" button refer fig2,how can i solve this problem,my Manifest file added this lines for support various screen,please give some sample code for me..
```
<supports-screens android:largeScreens="true"
android:normalScreens="true" android:smallScreens="true"
android:anyDensity="false" />
```
and my xml code
```
<?xml version="1.0" encoding="utf-8"?>
<merge android:layout_width="wrap_content" android:layout_height="340dp" xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="335dp" android:orientation="vertical"
android:background="@color/black">
<GridView
android:id="@+id/jr_lookbook_grid" android:layout_width="fill_parent"
android:layout_height="335dp" android:numColumns="4"
android:verticalSpacing="10dp" android:horizontalSpacing="10dp"
android:columnWidth="90dp" android:stretchMode="columnWidth"
android:adjustViewBounds="true"
android:background="@drawable/shape"
android:gravity="center" android:layout_weight="1"/>
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout0209_img"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
android:paddingTop="311dp">
<Button android:id="@+id/click"
android:background="#AA000000"
android:text="Load More Pictures..."
android:textColor="@color/white"
android:layout_width="fill_parent" android:layout_height="30dp"/>
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout02_img"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center"
android:layout_alignParentBottom="true"
android:background="@color/black"
android:layout_alignParentLeft="true">
<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars="none" />
<ImageView android:id="@+id/ImageView01"
android:layout_gravity="center_horizontal"
android:scaleType="centerInside"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:adjustViewBounds="true">
</ImageView>
</LinearLayout>
<LinearLayout android:id="@+id/LinearLayout02" android:background="#AA000000"
android:layout_width="400px"
android:layout_height="50dp"
android:layout_gravity="bottom">
<Button
android:id="@+id/back
android:layout_height="wrap_content"
android:background="@drawable/back1"
android:layout_alignParentRight="true"
android:layout_marginLeft="10dp" /
<Button
android:background="@drawable/forward5"
android:id="@+id/next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_alignParentRight="true"
android:layout_marginLeft="150dp"/>
<Button
android:background="@drawable/menushare"
android:id="@+id/photoshare"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_alignParentRight="true"
android:layout_marginLeft="20dip" />
</LinearLayout>
</merge>
```
Thanks All
| how to layout support for various screen in android? | CC BY-SA 2.5 | null | 2010-09-24T10:38:49.917 | 2013-03-18T22:27:48.040 | 2010-09-25T08:48:04.560 | 410,757 | 410,757 | [
"android"
] |
3,786,278 | 1 | 3,786,662 | null | 0 | 114 | I'm wondering what is the difference between Debug and Debug 1.0 within Visual Studio 2008.

Is Debug 1.0 something new? I don't remember to see it earlier.
| What is the difference between Debug and Debug 1.0 within Visual Studio 2008? | CC BY-SA 2.5 | null | 2010-09-24T10:48:03.257 | 2010-11-23T16:25:38.393 | 2010-11-23T16:25:38.393 | 53,587 | 262,693 | [
".net",
"visual-studio"
] |
3,787,821 | 1 | 3,787,851 | null | 12 | 3,009 | I'm learning on a box and dusting off my skills (skillz?).

When I got started on VIM way back in my c++ days, I had a friend with a great vimfiles folder that had tons of stuff to get started. Starting from scratch, vim is great, but it feels like it could be a lot better.
I currently have:
- [vim-ruby](http://github.com/vim-ruby/vim-ruby)- [buffer explorer](http://vim.sourceforge.net/scripts/script.php?script_id=42)- [xml-edit](http://vim.sourceforge.net/scripts/script.php?script_id=301)
I know that barely scratches the surface of what some more experienced vim/ruby devs have (including the one offs in the vim.rc file).
Is there a list somewhere (or could we create one) of a bunch of the standard vim configurations needed to make programming ruby (and rails) more fun? Is there a zip/tarball somewhere with a good base setup?
| What components make VIM a good (great) ruby editor? | CC BY-SA 2.5 | 0 | 2010-09-24T14:01:42.220 | 2010-12-06T15:49:05.200 | null | null | 72,995 | [
"ruby-on-rails",
"ruby",
"vim"
] |
3,788,270 | 1 | 3,807,528 | null | 2 | 286 | So I have a simple split view that functions great except when the view loads. For some reason if it loads in landscape mode, it only loads on ~half the screen (it seems like it is the width of the portrait mode). Does anyone know what may be causing this behavior? I am using the default split view controller provided by the apple SDK.
That is an image of what I am talking about. I am not doing anything special in my view did load and things are wired up in IB properly. I am kind of at a loss and any help would be awesome. Thanks!
| iPad split view loading strangely | CC BY-SA 2.5 | 0 | 2010-09-24T14:54:03.900 | 2010-09-27T20:21:04.833 | null | null | 410,856 | [
"iphone",
"xcode",
"ipad",
"ios"
] |
3,788,470 | 1 | 3,788,512 | null | 4 | 107 | This is the sample output
Let me explain what's going on:
The query returns all invoices # of every year along with the products
that is involved in the invoice.
As you see, we have two invoice in 2010...The invoices are 30463 and 30516.
The invoice 30463 has 4 products, its shipping price is 105.88. As you see
the shipping price is repeated on every product which causes troubles when
i calculate sum at reporting level. The 4 products of invoice # 30463 has
shipping price of 105.00 overall. I want every shipping price of every invoice
to be shown only once regardless how many products within an invoice. How can i achieve it?
HERE IS THE QUERY:
```
SELECT
DATEPART(year, CustomerInvDetail.sentDate) AS "Year",
CustomerInvoice.cuInvoiceID,
Product.productName,
CustomerQuoteProducts.unitPrice,
CustomerQuoteProducts.qty,
CustomerQuoteProducts.qty * CustomerQuoteProducts.unitPrice AS "Price",
CustomerShipping.shippingPrice
FROM CustomerInvoice INNER JOIN CustomerInvDetail
ON CustomerInvoice.cuInvoiceID = CustomerInvDetail.cuInvoiceID
INNER JOIN CustomerQuote
ON CustomerQuote.customerQuoteID = CustomerInvoice.customerQuoteID
INNER JOIN CustomerQuoteProducts
ON CustomerQuoteProducts.customerQuoteID = CustomerQuote.customerQuoteID
INNER JOIN CustomerShipping
ON CustomerShipping.customerQuoteID = CustomerInvoice.customerQuoteID
INNER JOIN Customer
ON Customer.customerID = CustomerQuote.customerID
INNER JOIN Product
ON CustomerQuoteProducts.productID = Product.productID
WHERE (DATEPART(year, CustomerInvDetail.sentDate) BETWEEN 2001 AND 2022) AND (Customer.customerID = 500)
```
| How Can I Rid off Redundant Values from a Column? | CC BY-SA 2.5 | null | 2010-09-24T15:17:00.350 | 2010-09-24T22:09:49.273 | null | null | 311,509 | [
"sql",
"sql-server",
"sql-server-2005",
"tsql",
"sql-server-2008"
] |
3,788,564 | 1 | 3,788,611 | null | 3 | 10,786 | I've been hunting around to see if I can find a simple CSS or jQuery solution to achieve the following styling for a select box:

There are various items on SO such as the [one here](https://stackoverflow.com/questions/1072239/is-it-possible-to-style-a-select-box), but these come close but the issue seems to be more with styling the "arrow" section of the select box. Many of the samples I've found style the whole of the select field.
Is this really possible or feasible. Any pointers would be appreciated.
| select box styling - css/jquery | CC BY-SA 2.5 | 0 | 2010-09-24T15:30:05.727 | 2010-09-24T15:56:16.170 | 2017-05-23T11:48:22.880 | -1 | 255,755 | [
"jquery",
"css",
"forms",
"select"
] |
3,788,804 | 1 | 3,788,882 | null | 1 | 427 | I've been playing about with the layout of a view with Android (lets say within the MainActivity) and I'm looking to create this sort of layout using 3 ImageView's (where each block represents an image):

This is rather easy to pull of using LinearLayout's but only if you specify the exact size and position of each ImageView. This then obviously causes problems when looking at different screen sizes.
Using AbsoluteLayout looked like it was going to work at first, but I've read that it's deprecated and it still causes problems with different screen sizes.
Then there is RelativeLayout, which I've tried using with [DroidDraw](http://www.droiddraw.org), but it doesn't seem to get me very far when I implement it :(
So, does anyone have an ideas of how to achieve this?
EDIT: I've got close to doing this using `dp` instead of `px` but this still gets screwed up when using larger resolution devices! :(
Thanks
| Android View Design Issues | CC BY-SA 2.5 | null | 2010-09-24T15:52:06.330 | 2010-09-28T15:28:55.310 | 2010-09-28T15:28:55.310 | 143,979 | 143,979 | [
"android",
"xml",
"user-interface"
] |
3,789,017 | 1 | 4,617,160 | null | 1 | 428 | I'm debugging a web service and only the first time I connect to it I get this exception on the DefaultWsdlHelpGenerator.aspx(?) class (take a look at the path)

Now it seems to be related to compliance of the basic profile 1.1 but I have that turned off in the config file.
`<configuration> <system.web> <webServices> <conformanceWarnings> <remove name='BasicProfile1_1'/> </conformanceWarnings> </webServices> </system.web> </configuration>`
If I disable exceptions and let it run it finally goes thru after blowing up 4 times in the same place. After that I can go on and debug the application just fine.
This is annoying me, specially because I haven't had this problem before and I don't know how to get rid of it.
Please help.
| Web Service Debugger Exception : Undefined complexType 'http://schemas.xmlsoap.org/soap/encoding/:Array' | CC BY-SA 2.5 | 0 | 2010-09-24T16:22:06.793 | 2011-01-06T16:30:00.430 | null | null | 439,166 | [
".net",
"asp.net",
"web-services",
"visual-studio-2010"
] |
3,789,283 | 1 | 3,792,046 | null | 8 | 13,335 | I'm following the second tip from [here](http://osmorphis.blogspot.com/2009/05/multiple-buttons-on-navigation-bar.html). In this tip two UIBarButtonItems are put together in a UIToolbar. Finally, the UIToolbar is added to the UINavigationBar. Now to my problems:
1) A white line is on top of the UIToolbar. If I increase the size of the UIToolbar, the gradient is wrong. I'm using the following size for the UIToolbar:
```
UIToolbar *toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 90, 44.01)];
```
How can I get rid of the white line? See here:

The problem is that there is a white instead of a grey line. If it would be grey, everything would be perfect.
2) What about the difference of the display size of iPhone 3 and iPhone 4? Do I have to check which iPhone is used and then double the size?
The buttons are created like in the following example I took from the above mentioned website:
```
// create a toolbar to have two buttons in the right
UIToolbar* tools = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 133, 44.01)];
// create the array to hold the buttons, which then gets added to the toolbar
NSMutableArray* buttons = [[NSMutableArray alloc] initWithCapacity:3];
// create a standard "add" button
UIBarButtonItem* bi = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:NULL];
bi.style = UIBarButtonItemStyleBordered;
[buttons addObject:bi];
[bi release];
// create a spacer
bi = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
[buttons addObject:bi];
[bi release];
// create a standard "refresh" button
bi = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(refresh:)];
bi.style = UIBarButtonItemStyleBordered;
[buttons addObject:bi];
[bi release];
// stick the buttons in the toolbar
[tools setItems:buttons animated:NO];
[buttons release];
// and put the toolbar in the nav bar
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:tools];
[tools release];
```
@ tc.:
I tried to subclass `UIToolbar`.
```
// MyToolbar.h
#import <Foundation/Foundation.h>
@interface MyToolbar : UIToolbar {
}
@end
// MyToolbar.m
#import "MyToolbar.h"
@implementation MyToolbar
- (void)drawRect:(CGRect)rect {
// do nothing
}
- (id)initWithFrame:(CGRect)aRect {
if ((self = [super initWithFrame:aRect])) {
self.opaque = NO;
self.backgroundColor = [UIColor clearColor];
self.clearsContextBeforeDrawing = YES;
}
return self;
}
@end
```
| Adding UIToolbar with two UIBarButtonItem to a UINavigationBar: poor UIToolbar and what about iPhone 4 | CC BY-SA 2.5 | 0 | 2010-09-24T16:55:04.650 | 2011-02-28T21:09:07.277 | 2010-09-26T12:48:16.467 | 426,227 | 426,227 | [
"iphone",
"objective-c",
"cocoa-touch",
"uinavigationbar",
"uitoolbar"
] |
3,789,510 | 1 | 3,789,591 | null | 0 | 131 | sorry im a newbie in css, so please dnt be angry at me, i really wanted postion something like this:
taking in mind that the number will grow, so the text has to stay in the middle. if you get what i mean! :))

| positioning in css? | CC BY-SA 2.5 | null | 2010-09-24T17:26:51.457 | 2010-09-24T17:39:05.360 | 2010-09-24T17:29:07.757 | 428,137 | 428,137 | [
"css",
"text",
"layout",
"positioning"
] |
3,789,512 | 1 | 3,790,350 | null | 12 | 4,271 | How would I go about making the following animation for my form submissions?
(I figured instead of typing it, I would create a visual.)

| Create a notification popup animated in a specific way? | CC BY-SA 3.0 | 0 | 2010-09-24T17:26:58.430 | 2015-09-11T03:36:01.760 | 2015-09-11T03:36:01.760 | 1,832,942 | 160,797 | [
"javascript",
"jquery",
"html"
] |
3,790,012 | 1 | null | null | 4 | 539 | I'm examining some biological data which is basically a long list (a few million values) of integers, each saying how well this position in the genome is covered. Here is a graphical example for a data set:


I would like to look for "valleys" in this data, that is, regions which are significantly lower than their surrounding environment.
Note that the size of the valleys I'm looking for is not really known - it may range from 50 bases to a few thousands. Defining what is a valley is of course one of the questions I'm struggling with, but the previous examples are relatively easy for me:


What kind of paradigms would you recommend using to find those valleys? I mainly program using Perl and R.
Thanks!
| How can I find low regions in a graph using Perl/R? | CC BY-SA 2.5 | 0 | 2010-09-24T18:46:43.200 | 2014-10-24T18:08:10.643 | null | null | 377,031 | [
"perl",
"r",
"statistics",
"graph"
] |
3,790,115 | 1 | 3,790,180 | null | 2 | 351 | When I ran this code using gcc,
```
$ cat eatup.c
#include<stdio.h>
#include<stdlib.h>
int main() {
int i = 0;
while(1) {
i++;
}
}
$
```
the CPU graph went like this :

I am not sure why there is a cross in the CPU core usage.
- I started the run at the rise to the left of the 40 mark, then initially core2 usage rose to 100% but after sometime there was a and core1 usage went 100%.- Any subsequent runs have not reproduced the situation. All I get is a single rise

> This might be a bit OS dependent (scheduling processes on the cores), but is there anything that could explain why the switch happened (as shown in the first screenshot)? Any guesses?
---
Turns out these are not so uncommon. Here is a screenshot of System Monitor just after bootup (Ubuntu 10.04)
[Full Size](https://i.stack.imgur.com/FJV14.png)

| Why is there a switch in the CPU core usage when I run this C code? | CC BY-SA 2.5 | null | 2010-09-24T19:01:47.213 | 2010-09-25T17:30:43.870 | 2010-09-25T17:07:28.437 | 113,124 | 113,124 | [
"c",
"gcc",
"scheduling",
"cpu-usage",
"ubuntu-10.04"
] |
3,790,195 | 1 | 3,790,605 | null | 0 | 673 | This Java Swing JComboBox is modified based on changes to the system configuration.
In the example image, "Press to Select" is the case where nothing is selected and there is one "Test Unit" in the configuration, but "Press to Select" is displayed twice in the drop down. The additional "Press to Select" item behaves like item 0 so it is functional, but it looks crappy this way. Any ideas?
```
public class Controller extends javax.swing.JFrame implements Observer {
...
public void update(Observable o, Object arg) {
jComboBox.removeAllItems();
jComboBox.addItem("Press to Select");
String[] names = Configuration.getNames();
for (String n : names) {
jComboBox.addItem(n);
}
...
```

| Why does JComboBox seem to add multiple item instances? | CC BY-SA 2.5 | null | 2010-09-24T19:12:41.937 | 2018-05-08T15:14:26.097 | 2018-05-08T15:14:26.097 | 1,033,581 | 398,460 | [
"java",
"swing",
"jcombobox"
] |
3,791,019 | 1 | 3,791,100 | null | 1 | 5,352 | i wanted to know how can i display the images like the on in the picture: i know that i have to retrive the images using a while loop, but then displaying them like this is the difficult bit, thanks!! :))

| how do i get images to display in a rows like this using php and css? | CC BY-SA 2.5 | null | 2010-09-24T21:10:19.590 | 2010-09-24T21:24:36.200 | null | null | 428,137 | [
"php",
"css",
"image",
"rows"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.