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,809,109 | 1 | 3,920,693 | null | 4 | 3,286 | I've got a varchar(max) column I'm trying to read but the field is being truncated at 4,000 characters. I've seen [similar questions](https://stackoverflow.com/questions/2502734/my-varcharmax-field-is-capping-itself-at-4000-what-gives), but they are on the sql side.
What do I need to do to get the entire field?
Eg:
```
using (DataContext dc = new DataContext())
{
var foo = dc.foos.First();
if (foo.Formula2.Length > 4000)
{
Console.WriteLine("success!");
}
}
```
I've tried things like [setting TextSize](http://msdn.microsoft.com/en-us/library/ms186238.aspx) but it didn't make a difference.:
```
dc.ExecuteCommand("SET TEXTSIZE 100000;");
var foo = dc.foos.First();
```
The server data type is varchar(max). The field in question is formula2:

If I try and change the type to something different like Object, I get message ''
Any suggestions?
| varchar(max) + linq to sql | CC BY-SA 2.5 | 0 | 2010-09-28T01:41:46.690 | 2010-10-13T04:05:09.513 | 2017-05-23T12:13:29.403 | -1 | 5,188 | [
"c#",
"linq-to-sql",
"varchar"
] |
3,809,103 | 1 | 3,809,186 | null | 3 | 569 | I have tried again to ask the same [question](https://stackoverflow.com/questions/3808708/delete-parts-of-a-dynamic-array-and-grow-other), but I ended up asking a different question by not providing essential information about my problem.
I implement a data structure which is a tree. Each node of this tree has an array/vector/(random access structure) with all its children which can be arbitrary many. The insertion/removal of elements is easy since we always double/divide-by-two the number of the elements in this array.
That is what the `O(k)` insertion/removal means in this context. We have `k` elements and we append `k` more or delete `k/2`. Rebuilding the whole data structure is fine so far. A `dynamic array` (or a `vector`) works.
The operation that raises the question is the following. Sometimes we have to `"split"` a node having `n` children, which means we "divide" the children among different nodes. The way we dive is in continuous groups. The most efficient way for this split is, I guess, to have one pointer for each new node at the position where its children are and how many there are (let's say each node takes `k` children). But then, the number of these children may change and that should not affect its siblings (or even worse, the whole tree) i.e the execution time of an insertion should be `O(k)` and not `O(n)`. How do we do it?
An easy but inefficient work-around would be that every time we split a node, we replace the "big" array of `children` with many (as many as the split parts) "small" dynamic arrays.
Each of the following "boxes" is a random access structure.

| I need a container that supports efficient random access and O(k) insertion and removal | CC BY-SA 2.5 | null | 2010-09-28T01:39:41.360 | 2010-09-28T06:53:27.260 | 2017-05-23T12:01:18.040 | -1 | 157,663 | [
"c++",
"algorithm",
"pointers",
"data-structures"
] |
3,809,161 | 1 | 3,812,026 | null | 0 | 1,195 | I would like to make some bindings that toggle item titles in a popup menu based on a single numerical value in a text field. Let me explain:


I want my menu items to automatically adjust to singular or plural based on the number in the text field. For example, when I type "1" in the box, I want the menu items to be labeled "minute", "hour" and "day". When I type "4", I want the menu items to be labeled "minutes", "hours" and "days".
1. I bound the three menu item's labels to the same key path as the text field's value.
2. I created an NSValueTransformer subclass to interpret the value in the text field and return singular or plural to be used as item titles.
3. I applied this value transformer to the three bindings.
My value transformer can either return singular or plural but it can't set the appropriate string based on the menu item it's applied to.
It looks to me like a value transformer is generic and can't return different values for different destinations. That would mean that to have the three titles change automatically, I would need to have three different value transformers that return the appropriate string for each menu item. That doesn't seem optimal at all.
Ideally I would be able to combine a string stored in the destination menu item (let's say in the item's tag property) with an "s" in the value transformer when the text field's value is larger than one, or something similar that would enable me to use a single value transformer for all the menu items.
Is there something I missed? What would be an ideal solution?
| How to use a single NSValueTransformer subclass to toggle the titles of multiple menu items | CC BY-SA 2.5 | null | 2010-09-28T01:54:20.803 | 2010-09-28T11:11:00.723 | null | null | 167,983 | [
"objective-c",
"cocoa",
"interface-builder",
"cocoa-bindings"
] |
3,809,235 | 1 | 3,809,309 | null | 0 | 709 | I had been looking for a "variable highlight" feature which can be found in Netbeans or Notepad++.
This means, when I select a variable, the same variable which is being scattered around other place will be highlighted as well. This feature is very valuable, to help me scan the code quickly.
May I know is it possible I can have this feature as well in Visual Studio 2008?

| Looking for variable hightlight feature in Visual Studio 2008 | CC BY-SA 2.5 | null | 2010-09-28T02:15:06.457 | 2010-11-26T12:54:12.773 | null | null | 72,437 | [
"visual-studio",
"visual-studio-2008"
] |
3,809,247 | 1 | 3,809,877 | null | 0 | 378 | I have a tile based game and I need to find the closest tile within a `32px` radius. So say a user is at `400, 200` and the user clicks at `500, 400`. I need to create a path or line from the player to the mouse position on click and the closest tile that is underneath the path within `32px` (or 2 tiles) must be chosen. The map is tiled at `16px`.
A function call to see if a tile is at a given tile position is available `Map.at(x,y)`.
I just don't know the maths to use to work this out.

The block blocks are within 16px, the red are within 32px. The grey block is the tile to be destroyed and the blue line is the invisible path between the player and mouse.
| Find the closest tile along a path | CC BY-SA 2.5 | null | 2010-09-28T02:18:31.200 | 2010-09-29T00:31:53.767 | 2010-09-29T00:31:53.767 | 233,427 | 233,427 | [
"math",
"path",
"position"
] |
3,809,484 | 1 | 3,809,756 | null | 0 | 247 | When you select text message from a contact in the contact's app you get a list of phone numbers and email addresses with the 'type' also in the button, however the 'type' is styled differently. Is there a way to get this effect with UIActionSheet buttons or would I have to roll my own?

| Is there a way to have text display on the UIActionSheet buttons the way it does from the contacts app? | CC BY-SA 2.5 | 0 | 2010-09-28T03:26:37.427 | 2010-09-28T04:47:36.277 | null | null | 63,104 | [
"iphone",
"objective-c",
"ios4",
"ios"
] |
3,809,494 | 1 | null | null | 7 | 3,508 | So here's the deal- I'm using AJAX to load page content via XML files. The content gets loaded correctly, no problem there. But, when I load a specific piece of HTML, Firebug shows it as grayed out, and I know from looking online that means it's not visible on the page itself, which is true in my case- I do not see that div on the page. The question is, why is this piece grayed out???? PLEASE HELP!! I'm totally stuck!!
The screen shot of the HTML from Firebug is below. Towards the bottom notice there are two divs that are grayed out. Thanks in advance
| Firebug's HTML in the HTML tab is grayed not, therefore not visible on the page itself.. why? | CC BY-SA 2.5 | 0 | 2010-09-28T03:29:01.237 | 2010-09-28T03:53:56.167 | 2010-09-28T03:53:56.167 | 51,507 | 420,135 | [
"jquery",
"html",
"firebug"
] |
3,809,692 | 1 | 3,809,807 | null | 5 | 11,617 | I have implemented Autocomplete and I'm having trouble with the label vs. value in the text box after the item is selected. When I type in a zip code, I see the label in the dropdown:

but after I select one, instead of the label showing in the text box, the value (which is the ID that needs to be saved to the database) is displayed:

How do I still show the label after it's selected, but then when the form is saved, it passes the ZipCodeID for the field?
Here's my Controller method:
```
public JsonResult FindZipCode(string term)
{
VetClinicDataContext db = new VetClinicDataContext();
var zipCodes = from c in db.ZipCodes
where c.ZipCodeNum.ToString().StartsWith(term)
select new { value = c.ZipCodeID, label = c.ZipCodeNum};
return this.Json(zipCodes, JsonRequestBehavior.AllowGet);
}
```
And here's my markup:
```
<script type="text/javascript">
$(document).ready(function() {
$("#ZipCodeID").autocomplete({
source: '<%= Url.Action("FindZipCode", "Customers") %>',
});
});
</script>
<div class="ui-widget"><input type="text" name="ZipCodeID" id="ZipCodeID" /></div>
```
EDIT: Here's my final working code:
Controller:
```
public JsonResult FindZipCode(string term)
{
VetClinicDataContext db = new VetClinicDataContext();
var zipCodes = from c in db.ZipCodes
where c.ZipCodeNum.ToString().StartsWith(term)
select new { value = c.ZipCodeID, label = c.ZipCodeNum};
return this.Json(zipCodes, JsonRequestBehavior.AllowGet);
}
```
and markup:
```
<script type="text/javascript">
$(document).ready(function() {
$("#ddZipCode").autocomplete({
source: '<%= Url.Action("FindZipCode", "Customers") %>',
select: function(event, ui) {
var zipCodeID = parseInt(ui.item.value, 1);
$("#ddZipCode").val(ui.item.label);
$("#ZipCodeID").val(ui.item.value);
return false;
}
});
});
</script>
<div class="ui-widget"><input type="text" name="ddZipCode" id="ddZipCode" /></div>
<%= Html.Hidden("ZipCodeID")%>
```
| JQuery UI Autocomplete with .Net MVC: How to display the label when selected but save the value | CC BY-SA 2.5 | 0 | 2010-09-28T04:30:55.480 | 2012-01-05T09:32:40.240 | 2017-02-08T14:30:26.620 | -1 | 209,081 | [
"asp.net-mvc",
"json",
"jquery-ui",
"autocomplete"
] |
3,809,788 | 1 | 3,826,554 | null | 14 | 13,168 | I know 3D rotation is well documented on SO and many other sites, but despite reading countless explanations I still haven't figured out where I'm going wrong. My background is in art and design, not math and programming, and I'm never really certain if my angle of attack (no pun intended) is the right one. Rather than paste a patchwork of my dismal code, I'm including an image describing my problem. What I'd really like is a step-by-step worded breakdown of how to solve it. Pseudo code is useful, but I will learn more if someone will just aim me in the right direction or point out common pitfalls.
---

Red = X-Axis, Green = Y-Axis, Blue = Z-Axis
Magenta vectors = origin --> some X,Y,Z point
Magenta cube = average of the endpoints of the two magenta vectors (is there a better name for this?)
White vector = cross product of the two magenta vectors (extended for display, actual vector is normalized)
Cyan cube object = rotation fail
---
I've previously used Away3D and Papervision; in these libraries, applying Euler angles to an object's rotationX, rotationY, or rotationZ properties will rotate the object locally, as if it's at the origin regardless of its actual position. With Three.js, this is not the case. Modifying an object's rotation.x and rotation.y properties produces a bizarre effect where the object apparently tilts a bit on the Z axis. Even more confusing is that this happens when the object rests at the origin. I thought that maybe using Quaternion-->Matrix or Axis/Angle-->Matrix functions would solve my problem, but no dice. It seems there's a core concept I'm not getting.
Anyway, what I'd like to do is orient the cube to the cross product vector (white), so that the top of the cube is facing the direction of that vector. Then I'd like to rotate the cube along the same axis. The image I've attached shows the result of more hours than I'd like to admit trying to achieve this result. My code loosely looks like this:
```
axis = Vector3.cross(a, b)
axis.normalize()
angle = 45 * TO_RADIANS;
quat = AxisAngle2Quaternion(axis, angle)
rot = Quaternion2Matrix(quat)
cube.matrix = rot
```
Thanks in advance,
Casey
---
Maybe I am misunderstanding how this is supposed to work. Here's another image:

Am I incorrect in thinking that this magenta vector is the axis, and the orange arrows indicate rotation about this axis based on the angle? One way or another, I want to orient the cyan cube based on some directional vector and spin it. What am I doing wrong!?
| 3D rotation with Axis & Angle | CC BY-SA 2.5 | 0 | 2010-09-28T04:56:02.140 | 2012-01-27T18:04:21.590 | 2010-09-30T05:44:16.877 | 242,944 | 242,944 | [
"javascript",
"actionscript-3",
"3d",
"matrix",
"rotation"
] |
3,810,122 | 1 | null | null | 2 | 995 | I would like to design a layout for my android app which has imageviews/Textviews placed as shown in the figure below. 
Right now, i tried to use Absolute layout, but i know that will create problems as the screen size changes.
Please help me with your ideas.
All comments are welcomed.
Thanks & Regards,
Sen
| How to create this layout? | CC BY-SA 2.5 | 0 | 2010-09-28T06:10:57.060 | 2010-09-28T07:50:19.460 | null | null | 449,378 | [
"android"
] |
3,810,546 | 1 | 3,811,188 | null | 1 | 668 | Anybody can tell me how to make Twitter's row menu in iOS app like img below?

This menu appear when i touch down move finger to left (Touch in UITableCell of UITableView). Can i make row menu like it? Thanks :)
| How can i make Twitter's row menu in iOS app? | CC BY-SA 2.5 | null | 2010-09-28T07:28:35.613 | 2010-09-30T03:52:16.940 | 2010-09-28T07:52:41.710 | 122,456 | 122,456 | [
"iphone",
"objective-c",
"ios"
] |
3,810,641 | 1 | 3,841,192 | null | 0 | 3,784 | I am new to android.I am working on voice recognition.I got a sample program
## main.xml
```
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Speak"
android:id="@+id/speakButton"/>
<ListView
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>
```
## VoiceRec:
```
public class VoiceRec extends Activity implements OnClickListener {
private static final int VOICE_RECOGNITION_REQUEST_CODE = 1234;
private ListView mList;
/**
* Called with the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Inflate our UI from its XML layout description.
setContentView(R.layout.main);
// Get display items for later interaction
Button speakButton = (Button) findViewById(R.id.speakButton);
mList = (ListView) findViewById(R.id.list);
// Check to see if a recognition activity is present
PackageManager pm = getPackageManager();
List<ResolveInfo> activities = pm.queryIntentActivities(
new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0);
if (activities.size() != 0) {
speakButton.setOnClickListener(this);
} else {
speakButton.setEnabled(false);
speakButton.setText("Recognizer not present");
}
}
/**
* Handle the click on the start recognition button.
*/
public void onClick(View v) {
if (v.getId() == R.id.speakButton) {
startVoiceRecognitionActivity();
}
}
/**
* Fire an intent to start the speech recognition activity.
*/
private void startVoiceRecognitionActivity() {
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Speech recognition demo");
startActivityForResult(intent, VOICE_RECOGNITION_REQUEST_CODE);
}
/**
* Handle the results from the recognition activity.
*/
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == VOICE_RECOGNITION_REQUEST_CODE && resultCode == RESULT_OK) {
// Fill the list view with the strings the recognizer thought it could have heard
ArrayList<String> matches = data.getStringArrayListExtra(
RecognizerIntent.EXTRA_RESULTS);
mList.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,
matches));
}
super.onActivityResult(requestCode, resultCode, data);
}
}
```
I got the output like

Please help out where i went wrong.....
| Android-Voice recognition | CC BY-SA 3.0 | null | 2010-09-28T07:42:23.920 | 2013-05-11T12:45:27.940 | 2011-12-20T15:50:36.180 | 109,302 | 366,916 | [
"android"
] |
3,810,687 | 1 | null | null | 1 | 154 | I'm creating a window app using C# (looks like this)

I'm using MySQL database.
But my database is hosted by some free hosting site.
I posted a question here [post1](https://stackoverflow.com/questions/3792039/cant-connect-to-an-online-database-using-my-window-application-c-winforms)[post2](https://stackoverflow.com/questions/3810250/can-i-access-a-remote-database-through-webservice-c-winforms) regarding on how to connect to a remote database and they say that I have to use a webservice to connect my window app to a remote database, since the hosting site doesn't allow remote connection.
My problem is I don't know how to start from the scratch, please recommend a site where i can use as a guide in making webservice and how to use it. I found some, but it's too advance for me and for my simple requirements. (A simple insert sql statement will work right?)
My Server Information:
VistaPanel version:2.4.1 RC3
Operating systemLinux
Apache version:2.2.15 (Unix)
PHP version:5.2.13
MySQL version:5.1.45
| How to make a web service? | CC BY-SA 2.5 | 0 | 2010-09-28T07:48:41.023 | 2010-09-28T08:18:53.987 | 2017-05-23T11:48:22.880 | -1 | 396,335 | [
"c#",
"php"
] |
3,810,768 | 1 | 3,810,842 | null | 6 | 2,249 | I have to draw lines around a circle (like in clock). How can i achieve this using a for loop?

| mathematics for drawing little lines around circle | CC BY-SA 2.5 | 0 | 2010-09-28T08:00:13.183 | 2012-09-11T09:05:05.833 | null | null | 277,696 | [
"javascript",
"html",
"canvas"
] |
3,810,927 | 1 | 4,947,179 | null | 6 | 1,945 | is there a way in ggplot2 to get the plot type "b"? See example:
```
x <- c(1:5)
y <- x
plot(x,y,type="b")
```
Ideally, I want to replace the points by their values to have something similar to this famous example:

EDIT:
Here some sample data (I want to plot each "cat" in a facet with plot type "b"):
```
df <- data.frame(x=rep(1:5,9),y=c(0.02,0.04,0.07,0.09,0.11,0.13,0.16,0.18,0.2,0.22,0.24,0.27,0.29,0.31,0.33,0.36,0.38,0.4,0.42,0.44,0.47,0.49,0.51,0.53,0.56,0.58,0.6,0.62,0.64,0.67,0.69,0.71,0.73,0.76,0.78,0.8,0.82,0.84,0.87,0.89,0.91,0.93,0.96,0.98,1),cat=rep(paste("a",1:9,sep=""),each=5))
```
| R plot type "b" with text instead of points - Slope graph with ggplot2 | CC BY-SA 4.0 | 0 | 2010-09-28T08:27:11.837 | 2022-01-02T10:35:40.680 | 2021-11-13T13:58:33.083 | 7,941,188 | 279,497 | [
"r",
"ggplot2"
] |
3,810,922 | 1 | 3,811,436 | null | 1 | 869 | I am using `addRowData` method to populate my grid. But my current JSON data have another object inside of each object in the JSON data. To make it view in the grid, i followed the notations in the [documentation of jQgrid](http://www.trirand.com/jqgridwiki/doku.php?id=wiki:retrieving_data#json_dot_notation). But that column remain empty.
My Grid definition:
```
$("#ExpenseTable").jqGrid({
datatype : "local",
mtype : 'GET',
colNames : [ 'Entry ID','User Name', 'Category Name','Date','Amount','Status'],
colModel : [
{name:'expnsId',label:'ID', width:150 ,editable: false},
{name:'userName',label:'NAME', width:150 ,editable: false},
{name:'category.catName',label:'CATEGORY', width:150 ,editable: false},
{name:'date',label:'DATE', width:150 ,editable: false},
{name:'amount',label:'AMOUNT', width:150 ,editable: false},
{name:'status',label:'STATUS', width:150 ,editable: false},
],
pager : '#ExpPager',
rowNum : 10,
rowList : [ 10, 20, 30 ],
sortname : 'invid',
sortorder : 'desc',
viewrecords : true,
autowidth : false,
caption : 'Expenses Details',
onSelectRow : function(expnsId) { dispExpensData(expnsId); }
});
```
Code used to populate the Grid:
```
ExpenseDetailsManagement.getexpenseList(function(expRecords){
//for(count = 0; count<expRecords.length; count++){
// expRecords[count].catId = expRecords[count].category.catId;
// expRecords[count].catName = expRecords[count].category.catName;
//}//I am using this for loop to convert the category object
$("#ExpenseTable").clearGridData(true);
$("#ExpenseTable").jqGrid('addRowData', "expnsId", expRecords);
});
```
The data returned from the server looks like:

Any idea or suggestions about where i am going wrong!!!
| JSON dot notation in jQgrid? | CC BY-SA 2.5 | null | 2010-09-28T08:25:50.667 | 2010-09-28T09:55:44.700 | 2020-06-20T09:12:55.060 | -1 | null | [
"json",
"jqgrid"
] |
3,811,214 | 1 | 3,811,233 | null | 1 | 215 | I need the red box to expand with the blue box content, so they are always both the same size.

The red box is defined as:
```
.leftMenu{
float:left;
width:20%;
background-image:url(../images/leftMenuBG.jpg);
background-position:bottom;
background-color:#BFDAE3;
background-repeat:repeat-x;
}
```
Can't seem to get it to work, whatever I try! Any ideas? Thanks!
| Div inside div not auto expanding (screenshot) | CC BY-SA 2.5 | null | 2010-09-28T09:07:22.537 | 2010-09-28T10:40:53.373 | null | null | 356,635 | [
"html",
"height",
"css"
] |
3,811,458 | 1 | 3,873,120 | null | 0 | 596 | I can use the [Facebook iPhone API](http://github.com/facebook/facebook-ios-sdk) to authorize and publish posts, but I want the textbox on the dialogue view bigger, to display more text, instead of only showing 2 lines, as the screenshot:
---

Anybody know how to make this textbox bigger? Does it have to change the Facebook API code?
If the textbox is supposed to be short as the title of the wall post, how to send the App icon and more text underneath the textbox as shown in the screenshot? (I only know how to publish the text in the textbox for the moment)
| How to make the textbox in the Facebook dialogue view bigger, and show App brief? | CC BY-SA 2.5 | null | 2010-09-28T09:37:50.567 | 2010-10-06T13:48:11.220 | null | null | 312,938 | [
"objective-c",
"facebook"
] |
3,811,588 | 1 | 3,819,653 | null | 2 | 7,793 | I need to create fixed size sqare buttons with relatively large characters on them for a calculator app.
When I increase text size, the character is no more displayed in the center of the button and the button's position gets shifted some pixels to the top (very strange).
[http://img9.imageshack.us/i/buttontest.png/](http://img9.imageshack.us/i/buttontest.png/)
If it's possible I don't want to use images for the buttons.
Update:
I use this xml:
```
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/TableLayout01" android:layout_width="wrap_content" android:layout_height="wrap_content">
<TableRow>
<Button android:layout_width="50dp" android:layout_height="50dp" android:text="1" android:textSize="8dp"></Button>
<Button android:layout_width="50dp" android:layout_height="50dp" android:text="2" android:textSize="10dp"></Button>
<Button android:layout_width="50dp" android:layout_height="50dp" android:text="3" android:textSize="12dp"></Button>
<Button android:layout_width="50dp" android:layout_height="50dp" android:text="4" android:textSize="14dp"></Button>
<Button android:layout_width="50dp" android:layout_height="50dp" android:text="5" android:textSize="16dp"></Button>
<Button android:layout_width="50dp" android:layout_height="50dp" android:text="6" android:textSize="18dp"></Button>
</TableRow><TableRow>
<Button android:layout_width="50dp" android:layout_height="50dp" android:text="7" android:textSize="20dp"></Button>
<Button android:layout_width="50dp" android:layout_height="50dp" android:text="8" android:textSize="22dp"></Button>
<Button android:layout_width="50dp" android:layout_height="50dp" android:text="9" android:textSize="24dp"></Button>
<Button android:layout_width="50dp" android:layout_height="50dp" android:text="A" android:textSize="26dp"></Button>
<Button android:layout_width="50dp" android:layout_height="50dp" android:text="B" android:textSize="28dp"></Button>
<Button android:layout_width="50dp" android:layout_height="50dp" android:text="C" android:textSize="30dp"></Button>
</TableRow>
<TableRow></TableRow>
</TableLayout>
```
And get this result:

how do I get all buttons equallly arranged with centered text?
| How to create small buttons with large text in Android 2.2? | CC BY-SA 2.5 | 0 | 2010-09-28T09:54:37.103 | 2012-04-20T18:13:50.930 | 2010-09-28T17:52:18.453 | 458,904 | 458,904 | [
"android",
"android-layout"
] |
3,811,621 | 1 | 3,811,690 | null | 3 | 1,727 | What is the fastes way of determening which point q out of n points in 2D space is the closest (smallest euclidian distance) to point p, see attached imgage.

My current method of doing this in Python is storing all the distances in a list and then running
```
numpy.argmin(list_of_distances)
```
This is however a bit slow when calculating this for m number of points p. Or is it?
| Fastest way to calculate euclidian distance in 2D space | CC BY-SA 2.5 | null | 2010-09-28T10:00:57.993 | 2010-09-28T11:02:17.590 | null | null | 441,337 | [
"python",
"optimization",
"distance"
] |
3,811,646 | 1 | 3,811,709 | null | 6 | 1,477 |
Is there any way to make code blocks highlighting/collapsing in Resharper ?
In CodeRush it is called "structural highlighting" feature:

Or maybe other Visual Studio 2010 add-on(preferably free) which would do this simple job and would not conflict with Resharper.
thanks
| C# structural highlighting in Visual Studio | CC BY-SA 2.5 | 0 | 2010-09-28T10:04:23.907 | 2017-11-22T16:10:33.580 | 2010-09-28T12:25:01.587 | 435,976 | 435,976 | [
"c#",
"visual-studio",
"highlighting",
"visual-studio-addins"
] |
3,811,750 | 1 | 3,811,776 | null | 2 | 652 | I'm having problem with GROUP BY. It returns the first entry it could find, but I would like it to return the last entry. Is that possible?
Here is my query (prepared query):
```
SELECT stamp_user, stamp_date, stamp_type
FROM rws_stamps
WHERE stamp_date >= ?
GROUP BY stamp_user
ORDER BY stamp_date DESC
```
My table looks like this:

What I want it to return is row 7 and 3, but i get 1 and 2.
| Get the last entries using GROUP BY | CC BY-SA 2.5 | 0 | 2010-09-28T10:21:01.893 | 2010-09-28T10:24:37.493 | null | null | 397,195 | [
"mysql",
"group-by",
"prepared-statement"
] |
3,811,837 | 1 | 3,811,856 | null | 2 | 172 | I want to create the following design to my IPhone application.

| Custom Design in IPhone Applications | CC BY-SA 3.0 | 0 | 2010-09-28T10:35:02.823 | 2017-07-03T00:04:44.667 | 2017-07-03T00:04:44.667 | 472,495 | 409,571 | [
"iphone"
] |
3,812,277 | 1 | 3,812,306 | null | 1 | 2,896 | I'm having an xml file like
```
<Root>
<Child val1="1" val2="2"/>
<Child val1="1" val2="3"/>
<Child val1="2" val2="4"/>
</Root>
```
i need to display the data from the Xml file to a Listview like

(Added `A` to index value)
Now i'm using like
1.Stores the data in an `XmlNodesList`
2.Then iterate through the `nodeslist` and add the attribute value to the list view
Here i can not use `Dictionary<String,String>` as a temporary storage because there exist multiple keys with same name.
Is there any idea to do this using `LINQ to XML`.?
| How to display data from XML file to ListView using LINQ to XML? | CC BY-SA 2.5 | null | 2010-09-28T11:34:48.663 | 2010-09-29T05:52:00.723 | 2010-09-28T12:26:41.427 | 8,562 | 336,940 | [
"c#",
"xml",
"winforms",
"linq",
"lambda"
] |
3,812,436 | 1 | 3,812,519 | null | 1 | 2,801 | I have a HABTM relation and when i use the following code. the Multiple Select is pretty long in size. i wanna know how to reduce the size.
```
<label for="checkbox">Cuisines:</label>
<?php echo $this->Form->input('Cuisine', array('label' => false, 'div'=> false, 'class' => 'short')); ?>
```

I am not finding any option to reduce this size. should i do it with CSS only ?
| Cakephp how to reduce number of rows displayed with the Multiple Select | CC BY-SA 2.5 | null | 2010-09-28T12:01:42.930 | 2011-04-20T06:52:23.010 | null | null | 155,196 | [
"cakephp",
"cakephp-1.3",
"multipleselection"
] |
3,812,602 | 1 | 3,813,098 | null | 4 | 4,305 | I have this HTML code fragment (in a valid document using strict doctype):
```
<p>Without <br /></p>
<table border="1" width="220">
<tbody>
<tr>
<td>lorem</td>
<td>ipsum</td>
<td>lorem ipsum</td>
<td>lorem</td>
<td>ipsum</td>
</tr>
</tbody>
</table>
<p>With <br /></p>
<table border="1" width="220">
<tbody>
<tr>
<td>lorem</td>
<td>ipsum</td>
<td>lorem<br>ipsum</td>
<td>lorem</td>
<td>ipsum</td>
</tr>
</tbody>
</table>
```
This is rendered like this in any browser:

Please note that the third <td> is wider in the first table, only because I haven't used a <br> tag there. Otherwise the code for the two tables are identical.
I would like to find a way to have the table rendered like it is on the second example, but without having to use a <br> tag.
# Clarification
| Width of a <td> is narrower when I use a <br> in it on a fixed width <table>. Why? | CC BY-SA 2.5 | null | 2010-09-28T12:21:59.870 | 2010-11-19T07:40:19.443 | 2020-06-20T09:12:55.060 | -1 | 63,377 | [
"html",
"line-breaks"
] |
3,812,790 | 1 | 3,812,819 | null | 3 | 1,963 | I have two Resources files under `App_GlobalResources`
```
MyApp.resx
MyApp.sv.resx
```
All languages will fallback to `MyApp.resx` the Swedish UICulture will use the `MyApp.sv.resx`
and I have a simple page that shows 3 `<asp:Label>` in witch the `Text` property is called differently like:
```
<i>using Resource.Write:</i><br />
<asp:Label ID="Label1" runat="server" />
<hr />
<i>using HttpContext.GetGlobalResourceObject:</i><br />
<asp:Label ID="Label2" runat="server" />
<hr />
<i>using Text Resources:</i><br />
<asp:Label ID="Label3" runat="server"
Text="<%$ Resources:MyApp, btnRemoveMonitoring %>" />
<p style="margin-top:50px;">
<i>Current UI Culture:</i><br />
<asp:Literal ID="litCulture" runat="server" />
</p>
```
`Label3` is the only one called on Page, the first 2 are set like:
```
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Label1.Text = Resources.AdwizaPAR.btnRemoveMonitoring;
Label2.Text = HttpContext.GetGlobalResourceObject("MyApp", "btnRemoveMonitoring").ToString();
litCulture.Text = System.Threading.Thread.CurrentThread.CurrentUICulture.Name;
}
}
```
if I use the all works fine, but I want to override that setting and load the correct translation based on other input, so I need to overwrite the `UICulture` and for that I use:
```
protected void Page_Init(object sender, EventArgs e)
{
Page.Culture = "en-US";
Page.UICulture = "en-US";
}
```
witch is the same as:
```
protected void Page_Init(object sender, EventArgs e)
{
System.Globalization.CultureInfo cinfo = System.Globalization.CultureInfo.CreateSpecificCulture("en-US");
System.Threading.Thread.CurrentThread.CurrentCulture = cinfo;
System.Threading.Thread.CurrentThread.CurrentUICulture = cinfo;
}
```
with all this, what I'm getting is this:

I'm getting the correct localization only if I use `code-behind` to set the correct text, all `inline` localization simply uses the browser language.
| Nightmare with Localization under Global Resources | CC BY-SA 2.5 | 0 | 2010-09-28T12:44:53.093 | 2010-09-28T14:10:29.417 | null | null | 28,004 | [
"c#",
"asp.net",
"localization",
"app-globalresources"
] |
3,813,619 | 1 | 7,972,409 | null | 5 | 779 | 
I've noticed that when I use TRibbon control that comes with Delphi 2010, it works flawlessly on my Windows 7 system. However, the application has some weird painting issues on a Windows XP system with the "classic theme" (I haven't tried the playschool theme).
I know there are other Ribbon components available from [DevExpress](http://www.devexpress.com/Products/VCL/Exbars/) and [TMS Software](http://www.tmssoftware.com/site/advtoolbar.asp), however purchasing a 3rd party control is not an option for this project.
Has anyone had this issue, or know of a solution?
| Why does the Delphi 2010 TRibbon control "flicker" on Windows XP, but not Vista/7? | CC BY-SA 2.5 | 0 | 2010-09-28T14:08:18.433 | 2011-11-01T21:23:11.593 | null | null | 12,458 | [
"delphi",
"delphi-2010",
"ribbon"
] |
3,814,297 | 1 | 3,842,391 | null | 7 | 1,553 | I've a weird problem with my application, its memory usage goes up a few hundred megabytes at once every now and then and eventually the application freezes. The application is written with Delphi, it uses database, COM (for OPC) and TCP/IP.
With FastMM I've got following the screen shot of memory usage. I'm not completely sure how to read that table, but it looks like something has allocated 296463552 bytes (0x100fb000, is that "magic number"?) three times.

Any ideas? Is there any way to track non-Delphi-MM memory allocations?
I'm using Delphi 2007 with FastMM 4.96.
I wrote a small helper class using IMallocSpy to track COM memory allocations. Here's excerpt from what I got:
```
00119023 5:52:27.484 [4496] TCOMAllocSpy.PreRealloc size: 269462304
00119024 5:52:27.734 [4496] (0002760C){ntdll.dll } [7C82860C] KiFastSystemCallRet + $0
00119025 5:52:27.734 [4496] (0009F83A){MyApp.exe} [004A083A] JclDebug.JclCreateThreadStackTrace (Line 3943, "JclDebug.pas" + 7) + $1E
00119026 5:52:27.734 [4496] (003D496A){MyApp.exe} [007D596A] ComLeakHelper.TCOMAllocSpy.DebugStack (Line 46, "ComLeakHelper.pas" + 2) + $9
00119027 5:52:27.734 [4496] (003D4B52){MyApp.exe} [007D5B52] ComLeakHelper.TCOMAllocSpy.PreRealloc (Line 125, "ComLeakHelper.pas" + 4) + $2
00119028 5:52:27.734 [4496] (000053B6){MyApp.exe} [004063B6] System.@WStrAsg (Line 14090, "sys\system.pas" + 10) + $0
00119029 5:52:27.734 [4496] (002E4490){MyApp.exe} [006E5490] DBXCommon.TDBXCommand.SetText (Line 5304, "..\..\..\..\..\src\pas\dbx\driver\DBXCommon.pas" + 13) + $5
00119030 5:52:27.734 [4496] (0010A340){MyApp.exe} [0050B340] WideStrings.TWideStrings.GetValue (Line 580, "common\WideStrings.pas" + 3) + $D
00119031 5:52:27.734 [4496] (002E1AFC){MyApp.exe} [006E2AFC] DBXCommon.TDBXProperties.GetValue (Line 4046, "..\..\..\..\..\src\pas\dbx\driver\DBXCommon.pas" + 1) + $7
00119032 5:52:27.734 [4496] (002E3FC9){MyApp.exe} [006E4FC9] DBXCommon.TDBXConnectionEx.GetProductName (Line 5071, "..\..\..\..\..\src\pas\dbx\driver\DBXCommon.pas" + 1) + $E
00119033 5:52:27.734 [4496] (003765FA){MyApp.exe} [007775FA] SqlExpr.TSQLConnection.DoConnect (Line 2467, "..\..\..\..\..\src\pas\dbx\vcl\SqlExpr.pas" + 66) + $21
00119034 5:52:27.734 [4496] (0011876D){MyApp.exe} [0051976D] DB.TCustomConnection.SetConnected (Line 2628, "DB.pas" + 8) + $4
00119035 5:52:27.734 [4496] (00118728){MyApp.exe} [00519728] DB.TCustomConnection.Open (Line 2611, "DB.pas" + 0) + $4
00119036 5:52:27.734 [4496] (00375D6F){MyApp.exe} [00776D6F] SqlExpr.TSQLConnection.CheckConnection (Line 2302, "..\..\..\..\..\src\pas\dbx\vcl\SqlExpr.pas" + 4) + $2
00119037 5:52:27.734 [4496] (00379241){MyApp.exe} [0077A241] SqlExpr.TCustomSQLDataSet.CheckConnection (Line 3955, "..\..\..\..\..\src\pas\dbx\vcl\SqlExpr.pas" + 2) + $2
00119038 5:52:27.734 [4496] (0037968A){MyApp.exe} [0077A68A] SqlExpr.TCustomSQLDataSet.OpenCursor (Line 4045, "..\..\..\..\..\src\pas\dbx\vcl\SqlExpr.pas" + 3) + $4
00119039 5:52:27.734 [4496] (00125EA9){MyApp.exe} [00526EA9] DB.TDataSet.SetActive (Line 9245, "DB.pas" + 12) + $7
00119040 5:52:27.734 [4496] (00125CA1){MyApp.exe} [00526CA1] DB.TDataSet.Open (Line 9201, "DB.pas" + 1) + $6
...
```
So, the problem seems to be in database connection. I'm using Firebird 2.1, DBExpress and InterXpress for Firebird drivers from Upscene.
This seems to analyze similar problem, at least the focus is on same lines as here: [http://www.yac.com.pl/mt.texts.sqlexpr-2.en.html](http://www.yac.com.pl/mt.texts.sqlexpr-2.en.html)
| Memory leak with Delphi/DBExpress | CC BY-SA 3.0 | 0 | 2010-09-28T15:20:27.683 | 2014-03-21T09:33:02.917 | 2014-03-21T09:33:02.917 | 3,235,496 | 7,735 | [
"delphi",
"debugging",
"memory-management",
"memory-leaks",
"dbexpress"
] |
3,814,482 | 1 | 4,049,456 | null | 2 | 1,501 | For searching a document, I like using the floating Find/Replace window that pops up. Lately, however, hitting - pulls up this Find/Replace bar at the bottom of the editor window. I suppose I wouldn't mind it so much, except instead of selecting the text to search it puts the insertion point whatever I've searched for before. Very annoying. Clicking on the magnifying glass pops up the other Find/Replace dialog.
How can I get the normal dialog to pop-up by default?
I should add that for some reason search is no longer working in Preferences, so I can no longer just search for "Find" to locate the setting I might need to change. So you'll have to give me the exact location.

A little more experimenting reveals that this is PyDev-specific behavior but I still can't find the setting that needs changing.
| How do I get rid of the Eclipse Find/Replace Bar | CC BY-SA 2.5 | null | 2010-09-28T15:37:33.703 | 2013-02-05T23:26:14.860 | 2010-09-28T15:43:15.550 | 255,918 | 255,918 | [
"eclipse",
"preferences",
"pydev"
] |
3,815,558 | 1 | 3,817,147 | null | 0 | 5,469 | Is there anyone who experienced with the scrollviewer component in WPF? I have a basic selection zoom, and the problem is that it does not scroll to the right place.
Output, trying to zoom the flower:

Actually, the `RectangleZoom` (see bellow) method scales the picture, but it does not focus it on the specified rectangle, but always in the same position... I believe there is a way to scroll to that position, but till now, any success....
Here is my code:
XAML:
```
<Window x:Class="WpfApplication3.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<ScrollViewer x:Name="scrollViewer"
HorizontalScrollBarVisibility="Auto">
<Canvas Height="200" Name="mainCanvas" Width="400"
MouseLeftButtonDown="mainCanvas_MouseLeftButtonDown"
MouseLeftButtonUp="mainCanvas_MouseLeftButtonUp"
MouseMove="mainCanvas_MouseMove">
<Canvas.Background>
<ImageBrush ImageSource="/WpfApplication3;component/Images/natural-doodle.jpg"/>
</Canvas.Background>
<Canvas.LayoutTransform>
<TransformGroup>
<ScaleTransform x:Name="scaleTransform"/>
</TransformGroup>
</Canvas.LayoutTransform>
</Canvas>
</ScrollViewer>
</Window>
```
Code behind:
```
public partial class MainWindow : Window
{
private Point startPoint;
private Point endPoint;
private Shape rubberBand;
public MainWindow()
{
InitializeComponent();
}
private void mainCanvas_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (!mainCanvas.IsMouseCaptured)
{
startPoint = e.GetPosition(mainCanvas);
Mouse.Capture(mainCanvas);
}
}
private void mainCanvas_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
if (mainCanvas.IsMouseCaptured)
{
if (rubberBand != null)
{
this.RectangleZoom(
Canvas.GetLeft(rubberBand),
Canvas.GetTop(rubberBand),
rubberBand.Width,
rubberBand.Height);
mainCanvas.Children.Remove(rubberBand);
rubberBand = null;
mainCanvas.ReleaseMouseCapture();
}
}
}
private void mainCanvas_MouseMove(object sender, MouseEventArgs e)
{
if (mainCanvas.IsMouseCaptured)
{
endPoint = e.GetPosition(mainCanvas);
if (rubberBand == null)
{
rubberBand = new Rectangle();
rubberBand.Stroke = Brushes.Red;
rubberBand.StrokeDashArray = new DoubleCollection(new double[] { 4, 2 });
mainCanvas.Children.Add(rubberBand);
}
rubberBand.Width = Math.Abs(startPoint.X - endPoint.X);
rubberBand.Height = Math.Abs(startPoint.Y - endPoint.Y);
double left = Math.Min(startPoint.X, endPoint.X);
double top = Math.Min(startPoint.Y, endPoint.Y);
Canvas.SetLeft(rubberBand, left);
Canvas.SetTop(rubberBand, top);
}
}
private void RectangleZoom(double x, double y, double width, double height)
{
double rWidth = scrollViewer.ViewportWidth / width;
double rHeight = scrollViewer.ViewportHeight / height;
double rZoom = 1.0;
if (rWidth < rHeight)
rZoom = rWidth;
else
rZoom = rHeight;
scaleTransform.ScaleX = rZoom;
scaleTransform.ScaleY = rZoom;
}
}
```
| WPF: Zoom and Scroll to selection (sample) | CC BY-SA 2.5 | null | 2010-09-28T17:46:33.540 | 2015-11-12T10:32:07.190 | 2010-09-28T20:10:00.667 | 185,593 | 185,593 | [
"wpf",
"zooming",
"scrollviewer"
] |
3,815,676 | 1 | 4,693,473 | null | 1 | 779 | On upload of images, the code creates several different thumbnails. In some cases, the thumbnail may be larger than the original image, in which case a padding is applied. In the case of JPEGs, the padding is white, and all is well. In the case of GIFs and PNGs, the padding should be transparent. And it is. Or not. Which is weird.
If I was getting an entirely black or transparent padding, I'd have some idea where the problem is, but I'm getting paddings which are transparent in places and black in others, which makes no sense.
Sample PNG and GIF images at [http://filedump.xn--es-zka.info/broken_thumbs/](http://filedump.xn--es-zka.info/broken_thumbs/) (on a shocking pink background colour so you can see the difference between white and transparent).

Any bright ideas?
```
class Image {
public static function exec($path) {
// This function receives the path to an image.
// Logic here skipped: For each thumbnail, check whether Crop is set. If it is, call self::crop(). Otherwise, call self::resize().
return true;
}
public static function resize($file, $class, $width='-', $height='-', $fit=0) {
$a = getimagesize($file);
switch ($a[2]) {
case 1:
$tag = 'gif';
break;
case 2:
$tag = 'jpeg';
break;
case 3:
$tag = 'png';
break;
default:
return;
}
$w = $a[0];
$h = $a[1];
if ($width == 0) {
$fw = 0;
$fh = $h / $height;
} elseif ($height == 0) {
$fw = $w / $width;
$fh = 0;
} else {
$fw = $w / $width;
$fh = $h / $height;
}
if (($fw == 1) and ($fh == 1)) {
$file2 = dirname($file) . '/' . $class . basename($file);
copy($file, $file2);
return true;
} elseif (($fw >= 1) and ($fh >= 1)) {
if ($fw > $fh) {
$w = $width;
$h = floor($h / $fw);
} else {
$h = $height;
$w = floor($w / $fh);
}
} elseif ($fh == 0) {
if ($fw > 1) {
$fit = 0;
$w = $width;
$h = floor($h / $fw);
} else {
if ($fit) {
$height = $h;
}
}
} elseif ($fw == 0) {
if ($fh > 1) {
$fit = 0;
$w = floor($w / $fh);
$h = $height;
} else {
if ($fit) {
$width = $w;
}
}
} elseif (($fw < 1) and ($fh < 1)) {
//
} elseif ($fw > $fh) {
if ($fw >= 1) {
$w = $width;
$h = floor($h / $fw);
}
} elseif ($fh > $fw) {
if ($fh >= 1) {
$w = floor($w / $fh);
$h = $height;
}
}
if ($fit) {
$x = ($width - $w) / 2;
$y = ($height - $h) / 2;
$cw = $width;
$ch = $height;
} else {
$x = 0;
$y = 0;
$cw = $w;
$ch = $h;
}
$file2 = dirname($file) . '/' . $class . basename($file);
$f1 = 'imagecreatefrom' . $tag;
$src = $f1($file);
$new = imagecreatetruecolor($cw, $ch);
return self::create($new, $src, $file2, $x, $y, $w, $h, $a);
}
public static function crop($file, $class, $width='-', $height='-', $fit=0) {
if (!$class) return trigger_error('ExecImage: Original image can not be overwritten.');
$small = 0;
$a = getimagesize($file);
switch ($a[2]) {
case 1:
$tag = 'gif';
break;
case 2:
$tag = 'jpeg';
break;
case 3:
$tag = 'png';
break;
default:
return;
}
$w = $a[0];
$h = $a[1];
if ($height == 0) {
//resize by width -- height will follow
$fh = 0;
$fw = $w / $width;
} elseif ($width == 0) {
//resize by height -- width will follow
$fw = 0;
$fh = $h / $height;
} else {
$fw = $w / $width;
$fh = $h / $height;
}
if (($fw <= 1) and ($fh <= 1)) {
$small = 1;
//don't resize
} else {
$fit = 1;
//chop by the smallest
if ($fh < $fw) {
//Crop By Height
$h = $height;
$w = floor($w / $fh);
//$w = $width;
//$h = floor($h /$fw);
//$w = $width;
} else {
//Crop By Width
$w = $width;
$h = floor($h /$fw);
//$h = $height;
//$w = floor($w / $fh);
}
}
$file2 = dirname($file) . '/' . $class . basename($file);
$f1 = 'imagecreatefrom' . $tag;
$src = $f1($file);
if ($small) {
if ($fit) {
//image must be padded
$x = ($width - $w) / 2;
$y = ($height - $h) / 2;
} else {
//image goes as is -- shrinked
$x = 0;
$y = 0;
}
} else {
//image must be centered -- this should be a square from js
$x = ($width - $w) / 2;
$y = ($height - $h) / 2;
}
if ($small) {
if ($fit) {
//create with the full size
$new = imagecreatetruecolor($width, $height);
} else {
//nah, just with the original size
$new = imagecreatetruecolor($w, $h);
}
} else {
if ($fit) {
$new = imagecreatetruecolor($width, $height);
} else {
$new = imagecreatetruecolor($w, $h);
}
}
return self::create($new, $src, $file2, $x, $y, $w, $h, $a);
}
private static function create($new, $src, $file2, $x, $y, $w, $h, $a) {
switch ($a[2]) {
case 1: // GIF
case 3: // PNG
// http://www.akemapa.com/2008/07/10/php-gd-resize-transparent-image-png-gif/
// http://www.mummey.org/2008/11/transparent-gifs-with-php-and-gd/
imagealphablending($new, false);
imagesavealpha($new, true);
$back = imagecolorallocatealpha($new, 255, 255, 255, 127);
imagefilledrectangle($new, 0, 0, $w, $h, $back);
imagecolortransparent($new, $back);
break;
case 2: // JPEG
$back = imagecolorallocate($new, 255, 255, 255);
break;
}
imagefill($new, 0, 0, $back);
imagecopyresampled($new, $src, $x, $y, 0, 0, $w, $h, $a[0], $a[1]);
if (file_exists($file2)) unlink($file2);
switch ($a[2]) {
case 1:
imagegif($new, $file2);
break;
case 2:
imagejpeg($new, $file2, 100);
break;
case 3:
imagepng($new, $file2, 0);
break;
}
imagedestroy($src);
imagedestroy($new);
return true;
}
}
```
Well, I've solved the main problem: padding added to PNG or GIF images is now transparent, instead of black. The smaller problem, that GIF transparency becomes black, is still with us, but I don't use GIF transparency much.
```
<?php
class Image {
public static function exec($path) {
$file = Nearest::file('.config.php', dirname($path) . '/', BD . '/images/');
if (!file_exists($file)) exit('The ".config.php" file doesnt exist');
require $file;
foreach ($config['operations'] as $k => $v) {
if (!isset($v['class'])) $v['class'] = '.' . $k . '.';
if (Core::val($v, 'crop')) {
self::crop($path, $v['class'], Core::val($v, 'width', '-'), Core::val($v, 'height', '-'), Core::val($v, 'fit', 0));
} else {
self::resize($path, $v['class'], Core::val($v, 'width', '-'), Core::val($v, 'height', '-'), Core::val($v, 'fit', 0));
}
}
return true;
}
public static function delete($path) {
$a = glob(dirname($path) . '/.*.' . basename($path));
foreach ($a as $v) unlink($v);
unlink($path);
}
public static function resize($file, $class, $width='-', $height='-', $fit=0) {
$a = getimagesize($file);
switch ($a[2]) {
case 1:
$tag = 'gif';
break;
case 2:
$tag = 'jpeg';
break;
case 3:
$tag = 'png';
break;
default:
return;
}
$w = $a[0];
$h = $a[1];
if ($width == 0) {
$fw = 0;
$fh = $h / $height;
} elseif ($height == 0) {
$fw = $w / $width;
$fh = 0;
} else {
$fw = $w / $width;
$fh = $h / $height;
}
if (($fw == 1) and ($fh == 1)) {
$file2 = dirname($file) . '/' . $class . basename($file);
copy($file, $file2);
return true;
} elseif (($fw >= 1) and ($fh >= 1)) {
if ($fw > $fh) {
$w = $width;
$h = floor($h / $fw);
} else {
$h = $height;
$w = floor($w / $fh);
}
} elseif ($fh == 0) {
if ($fw > 1) {
$fit = 0;
$w = $width;
$h = floor($h / $fw);
} else {
if ($fit) {
$height = $h;
}
}
} elseif ($fw == 0) {
if ($fh > 1) {
$fit = 0;
$w = floor($w / $fh);
$h = $height;
} else {
if ($fit) {
$width = $w;
}
}
} elseif (($fw < 1) and ($fh < 1)) {
//
} elseif ($fw > $fh) {
if ($fw >= 1) {
$w = $width;
$h = floor($h / $fw);
}
} elseif ($fh > $fw) {
if ($fh >= 1) {
$w = floor($w / $fh);
$h = $height;
}
}
if ($fit) {
$x = ($width - $w) / 2;
$y = ($height - $h) / 2;
$cw = $width;
$ch = $height;
} else {
$x = 0;
$y = 0;
$cw = $w;
$ch = $h;
}
$file2 = dirname($file) . '/' . $class . basename($file);
$f1 = 'imagecreatefrom' . $tag;
$src = $f1($file);
$new = imagecreatetruecolor($cw, $ch);
return self::create($new, $src, $file2, $x, $y, $w, $h, $cw, $ch, $a);
}
public static function crop($file, $class, $width='-', $height='-', $fit=0) {
if (!$class) exit('ExecImage: Original image can not be overwrite.');
$small = 0;
$a = getimagesize($file);
switch ($a[2]) {
case 1:
$tag = 'Gif';
break;
case 2:
$tag = 'Jpeg';
break;
case 3:
$tag = 'Png';
break;
default:
return;
}
$w = $a[0];
$h = $a[1];
if ($height == 0) {
//resize by width -- height will follow
$fh = 0;
$fw = $w / $width;
} elseif ($width == 0) {
//resize by height -- width will follow
$fw = 0;
$fh = $h / $height;
} else {
$fw = $w / $width;
$fh = $h / $height;
}
if (($fw <= 1) and ($fh <= 1)) {
$small = 1;
//dont resize
} else {
$fit = 1;
//chop by the smallest
if ($fh < $fw) {
//Crop By Height
$h = $height;
$w = floor($w / $fh);
//$w = $width;
//$h = floor($h /$fw);
//$w = $width;
} else {
//Crop By Width
$w = $width;
$h = floor($h /$fw);
//$h = $height;
//$w = floor($w / $fh);
}
}
$file2 = dirname($file) . '/' . $class . basename($file);
$f1 = 'ImageCreateFrom' . $tag;
$src = $f1($file);
if ($small) {
if ($fit) {
//image must be padded
$x = ($width - $w) / 2;
$y = ($height - $h) / 2;
} else {
//image goes as is -- shrinked
$x = 0;
$y = 0;
}
} else {
//image must be centered -- this should be a square from js
$x = ($width - $w) / 2;
$y = ($height - $h) / 2;
}
if ($small) {
if ($fit) {
//create with the full size
$new = imagecreatetruecolor($width, $height);
return self::create($new, $src, $file2, $x, $y, $w, $h, $width, $height, $a);
} else {
//nah, just with the original size
$new = imagecreatetruecolor($w, $h);
return self::create($new, $src, $file2, $x, $y, $w, $h, $w, $h, $a);
}
} else {
if ($fit) {
//create with the full size
$new = imagecreatetruecolor($width, $height);
return self::create($new, $src, $file2, $x, $y, $w, $h, $width, $height, $a);
} else {
//nah, just with the original size
$new = imagecreatetruecolor($w, $h);
return self::create($new, $src, $file2, $x, $y, $w, $h, $w, $h, $a);
}
}
}
private static function create($new, $src, $file2, $x, $y, $w, $h, $cw, $ch, $a) {
switch ($a[2]) {
case 1: // GIF
case 3: // PNG
// http://www.akemapa.com/2008/07/10/php-gd-resize-transparent-image-png-gif/
// http://www.mummey.org/2008/11/transparent-gifs-with-php-and-gd/
imagealphablending($new, false);
imagesavealpha($new, true);
$back = imagecolorallocatealpha($new, 255, 255, 255, 127);
imagefilledrectangle($new, 0, 0, $cw, $ch, $back);
imagecolortransparent($new, $back);
break;
case 2: // JPEG
$back = imagecolorallocate($new, 255, 255, 255);
break;
}
imagefill($new, 0, 0, $back);
imagecopyresampled($new, $src, $x, $y, 0, 0, $w, $h, $a[0], $a[1]);
if (file_exists($file2)) unlink($file2);
switch ($a[2]) {
case 1:
imagegif($new, $file2);
break;
case 2:
imagejpeg($new, $file2, 100);
break;
case 3:
imagepng($new, $file2, 0);
break;
}
imagedestroy($src);
imagedestroy($new);
return true;
}
```
}
So, any hints on how to preserve GIF transparency?
| Preserving GIF tansparencies when rebuilding thumbnails | CC BY-SA 2.5 | 0 | 2010-09-28T17:59:40.200 | 2011-01-14T16:40:44.620 | 2011-01-14T16:15:32.507 | 209,139 | 209,139 | [
"php",
"transparency",
"transparent",
"gif",
"thumbnails"
] |
3,816,019 | 1 | 3,816,865 | null | 6 | 2,789 | Given any number of intersection, disjoint and touching rectangles, how to find the (multiple) outline polylines? Rectangles are defined in pixel coordinates so they have integer accuracy, but they may be thousands of units large.

I really need numeric coordinates for the outlines, merging GDI regions won't do. I know I can simplify the problem by creating a GDI region and calling GetRegionScans, but it still won't solve the problem.
This is part of real-time UI, so the algorithm needs to be reasonably fast (I'm guessing never more than a dozen or so boxes, maybe a hundred).
I'm doing this in C#, but since this is an algorithmic question I don't really care about language. Any ideas most welcome.
| Merge (Boolean Union) rectangular regions with integer accuracy | CC BY-SA 2.5 | 0 | 2010-09-28T18:46:48.083 | 2010-09-28T20:51:02.420 | null | null | 81,947 | [
"c#",
"geometry",
"2d",
"region"
] |
3,816,065 | 1 | 3,816,094 | null | 1 | 2,590 | I'm new to macro programming in VB, and what I'm trying to do is clone a row in my word document when a button is clicked. I've made an attempt as shown in the picture below. What do I need to do to make the addTwoDependants() subroutine run when the button is clicked?

| How to call a macro on a button click in a word document | CC BY-SA 2.5 | null | 2010-09-28T18:53:28.077 | 2015-02-23T19:23:55.817 | 2015-02-23T19:23:55.817 | 3,204,551 | 139,861 | [
"vba",
"ms-word"
] |
3,816,513 | 1 | 3,837,813 | null | 0 | 88 | I have a strange problem with IE in a CSS menu.
Have an `<li>` with a text and an `<ul>` (with position absolute) and `<li>` inside.
In Mozilla Firefox the sub `<ul>` assumes the desired position (see picture below).
In IE the text forces the sub `<ul>` to go forward. Any ideas?
Thanks in advance!
```
li {
float:left;
width:auto;
}
li ul {
left:-999em;
margin-left:0;
margin-top:5px;
padding:0;
position:absolute;
width:150px;
}
li:hover {
left:auto
}
```

| Problem with IE in a menu with CSS | CC BY-SA 2.5 | null | 2010-09-28T19:53:40.897 | 2010-10-01T09:10:58.050 | 2010-09-28T20:53:48.457 | 155,905 | 155,905 | [
"css"
] |
3,816,566 | 1 | 3,966,161 | null | 2 | 1,710 | Solved. See fix at bottom.
In my iPad app which supports all orientations, if the app is loaded in landscape, weird things happen:
1. Alert views appear in portrait, even though the rest is in landscape
2. Rotating the iPad from landscape to portrait does not trigger a rotation (nor does it trigger any of the shouldAutorotate style methods).
3. Rotating the iPad 180 degrees (to "other landscape") does trigger rotation, and after this, the iPad behaves like normal (i.e. rotates correctly to portrait and landscape when rotated).
Alert view screen below. Weird, weird. Any ideas why this might be happening? It only happens when loading in landscape -- loading in portrait and then rotating to landscape works just fine.

This problem occurred because I was adding a UIViewController (modally) on top of the main view controller as soon as the app finished loading (more specifically, in the app's `viewDidAppear:` method).
iOS sends a number of (4) `shouldAutorotateToInterfaceOrientation:` calls to the current/main view controller after things have started up, to figure out which orientations are currently supported. When I added the other VC so soon, this occurred in the middle of the aforementioned calls. Thus, I only got one or two calls (for "portrait", because it starts with portrait).
The main view controller was then left with a default support of "NO" for the landscape orientations, but the newly added view controller (which is also asked about orientations) now happily responds yes.
If I had removed the other VC (which is in landscape), I would have realized that my main view controller was stuck in portrait. So I had a portrait view, on top of which there was a landscape view. The alerts and such heeded the orientation of the former, hence the disastrous results above.
Additionally, if I tried to rotate to portrait, I couldn't, because the main view controller was already in portrait. Rotating to landscape was also impossible because the other view controller is already in landscape. Only when I did the "landscape but that other one" rotation, did both view controllers agree that rotation was required, and thus the device rotated.
The fix in my case was to simply put the creation of the other controller at a slight delay. using `performSelector:withObject:afterDelay.` -- 0 seemed to work but I just put it at 1 to be sure. It looks a bit weird, with the main vc appearing and then the other vc, but it's better than the above.
| Alert views in portrait, iPad in landscape, and unable to rotate to anything but "other" landscape (180 degrees) | CC BY-SA 2.5 | 0 | 2010-09-28T19:59:30.317 | 2020-05-23T17:52:16.697 | 2010-09-29T18:37:44.040 | 271,166 | 271,166 | [
"iphone",
"objective-c",
"rotation",
"landscape",
"portrait"
] |
3,816,633 | 1 | 3,816,973 | null | 2 | 4,532 | I have an encoding problem with ASIHttpRequest. When I get an URL, the data is returned perfectly except for a little encoding problem.
This is my code:
```
- (void)fetchGamesForCategory
{
NSString *url_string = [[NSString alloc] initWithFormat:url_match, theCategory._id];
NSURL *url = [NSURL URLWithString:url_string];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request startSynchronous];
NSError *error = [request error];
if (!error) {
NSString *response = [request responseString];
NSLog(@"response: %@", response);
NSData *data = [response dataUsingEncoding:NSUTF8StringEncoding];
NSString *errorDesc = nil;
NSPropertyListFormat format;
NSDictionary * dict = (NSDictionary*)[NSPropertyListSerialization
propertyListFromData:data
mutabilityOption:NSPropertyListMutableContainersAndLeaves
format:&format
errorDescription:&errorDesc];
NSDictionary *categoryListPathDictionary = [[NSDictionary alloc] initWithDictionary:dict];
categoryMatchList *categoryMatchListFile = [[[categoryMatchList alloc] initWithDictionary:categoryListPathDictionary] retain];
matchArray = [categoryMatchListFile getMatchListXmlSet];
[self loadPage];
}
}
```
And this is my result:
```
2010-09-28 21:49:35.970 oddsApp[46429:190f] response: <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist>
<dict>
<key>matches</key>
<array>
<dict>
<key>name</key>
<string>Gais - Häcken</string>
<key>date</key>
<string>2010-09-29 18:00</string>
<key>id</key>
<string>156</string>
<key>odds</key>
<dict>
<key>1</key>
<string>2.6</string>
<key>X</key>
<string>3.28</string>
<key>2</key>
<string>2.862</string>
</dict>
</dict>
</array>
</dict>
</plist>
```
As you can see, the encoding is screwed up at `<string>Gais - Häcken</string>`, allthough it is correct when showing the page in the browser:

Does someone know what is wrong?
| Encoding issue with ASIHttpRequest | CC BY-SA 3.0 | null | 2010-09-28T20:10:27.533 | 2013-02-14T22:15:05.770 | 2012-11-06T12:07:37.833 | 406,677 | 406,677 | [
"iphone",
"encoding",
"ios4",
"plist",
"asihttprequest"
] |
3,816,860 | 1 | 3,875,949 | null | 6 | 7,848 | I have no style set anywhere in my application!

UPDATE:

| Why does my WPF GroupBox looks so weird? | CC BY-SA 2.5 | 0 | 2010-09-28T20:38:26.270 | 2016-04-28T16:16:52.403 | 2011-08-13T16:41:51.600 | 305,637 | 320,460 | [
"wpf",
"styles",
"groupbox"
] |
3,816,839 | 1 | null | null | 4 | 3,478 | I'm looking for a way of making simple event log for my tables. I have few tables that can be changed by various users, and I want to keep track on:
```
- who made the change
- when
- what was before update
- what is the new value
- which table and which record & column
```
somthing like will be great:
```
20:00:00 | john | update | products | 113 | product_name | "xbox" | "xbox 360"
20:00:10 | jim | update | products | 113 | product_name | "xbox 360" | ""
20:01:00 | jim | delete | products | 113
```
So i read that triggers could be the answer but as far as I read it seems that I need to have a complete new table for each column I want to keep track on. Triggers are not perfect for this job also because I want to log who made the change, and from what I read this is not possible.
I thought of making 3 different functions for CRUD (insert, update, delete), and just before making the query, to check what is changed and to make the log and then run the query. But from here it seems to be very slow and complicated.
Is there another better way ?
Thanks
---
Ok, I checked again the triggers and its not what I was looking for, so I wrote simple functions that will check for each query you want to log if the new values are different, and if so - it logs it.
The main problem is, and I didn't measure it, but it obviously slower.
first you need to make a new mysql table as follow:
- - - - - - - - -
after that, write the functions. I didn't write yet the 'INSERT' and 'DELETE' sections but I think i should be much easier.
```
function log_query($action_type, $table, $values, $parameters){
if ($action_type == 'UPDATE'){
log_updates($action_type, $table, $values, $parameters);
$query = "UPDATE $table SET ";
foreach ($values as $key => $value){
$query .= $key."='";
$query .= $value."', ";
}
unset($value);
$query = substr($query, 0, -2);
$query .= ' WHERE ';
foreach ($parameters as $key => $value){
$query .= $key."='";
$query .= $value."' AND ";
}
unset($value);
$query = substr($query, 0, -4);
$result = mysql_query($query);
}
}
```
and :
```
function log_updates($action_type, $table, $values, $parameters){
$where = " WHERE ";
$user_id = '1234'; //example
foreach ($parameters as $key => $value){
$where .= $key."='";
$where .= $value."' AND ";
}
unset($value);
$where = substr($where, 0, -4);
foreach ($values as $key => $value){
$result = mysql_query("SELECT $key, id FROM $table $where");
$row = mysql_fetch_row($result);
$old_value = $row[0];
$record_id = $row[1];
if ($action_type == 'UPDATE'){
if ($old_value != $value){
$logger = mysql_query("INSERT INTO auditing (event_date, action_type, user_id, table_name, record_id, cell_name, old_value, new_value)
VALUES (NOW(), '$action_type', $user_id, '$table', '$record_id', '$key', '$old_value', '$value')");
if (!$logger) echo mysql_error();
}
}
}
unset($value);
}
```
to call the functions you need to first order the parameters to find the specific row, and the new values in to arrays, and after that call the log_query function:
```
$update = Array('name' => 'barbara', 'description' => 'new name');
$parameters = Array('id' => '1', 'name' => 'barbi');
log_query('UPDATE', 'checktable', $update, $parameters);
```
This will actualy will check if the 'name' has changed and if the description is changed. for each one, if it change, it will insert new record into 'auditing' table specifying the exact change.
after loging the change, it will run the update query. in our example:
```
UPDATE checktable SET name='barbara', description='new name' WHERE id='1' AND name='barbi'
```
hope this is helping. It tested for now and works. If there will be updates - I'll post it here.

| mysql (almost) complete auditing | CC BY-SA 2.5 | 0 | 2010-09-28T20:35:54.673 | 2010-09-29T08:49:36.947 | 2010-09-29T08:49:36.947 | 154,978 | 154,978 | [
"php",
"mysql",
"audit",
"auditing"
] |
3,817,523 | 1 | null | null | 0 | 1,057 | Navicat does not show primary keys which are also foreign key on table report as foreign keys. Why?
I gave the image explaining the situation:

| MySQL not showing foreign keys that are also primary keys | CC BY-SA 2.5 | null | 2010-09-28T22:37:25.470 | 2010-09-28T22:44:03.483 | 2010-09-28T22:44:03.483 | 222,908 | 459,904 | [
"mysql",
"foreign-keys"
] |
3,817,662 | 1 | 5,640,142 | null | 4 | 3,625 | In my android application, I use a listview and some linear layout on wich the user can click.
Of course, I had to set the background of my LinearLayout to a xml file where the stated pressed, selected are defined:
```
myView.setBackgroundDrawable(
getDrawable(android.R.drawable.list_selector_background));
```
So no problem I set the drawable to transparent when normal use and orange when clicked.
My only problem is that on the galaxy S and some other customized phone (Sense UI) the color of the listview clicked is blue or green!
 
So I need to pick this color to set it to the background of my linearlayout.
I don't want to mix orange and blue, or orange and green for my user!
Where can I get this color???
That woule be really helpfull!
| Getting the Listview default clicked color, depending on the Device | CC BY-SA 2.5 | null | 2010-09-28T23:09:01.290 | 2011-04-12T19:12:19.553 | null | null | 327,402 | [
"android",
"listview",
"colors",
"default",
"device"
] |
3,818,060 | 1 | null | null | 3 | 2,071 | I was profiling our ASP .NET application to try and reduce the CPU usage and fond some strange behaviour regarding NHibernate and log4net.
Over 50% of the time on our app is spent in the log4net GetLogger and CreateRepository methods, which are called from ExecuteReader in NHibernate. The screenshot below is a jetBrains dottrace hotspot analysis where the arrows point from a calling method to the called method.

The below screenshot is just a straight up list of slowest functions.As you can see the NHybridDataReader constructor calls GetLogger and it takes ages.

Clearly something fishy is going on, and I want to disable log4net completely in NHibernate as we use other logging functionality.
Our web.config has no entries in it regarding log4net, so how do I disable it? There are no log files being produced, and from the look of the method names, it hasn't actually got round to logging anything, but is merely trying to find the logger it should write stuff to.
Most confusing, can anyone help?
| NHibernate log4net performance problem - how to disable? | CC BY-SA 2.5 | 0 | 2010-09-29T00:50:24.767 | 2011-11-29T05:14:33.680 | 2011-11-29T05:14:33.680 | 3,043 | 17,765 | [
"asp.net",
"nhibernate",
"log4net"
] |
3,818,369 | 1 | 3,879,391 | null | 4 | 7,183 | I'm using a WPF data grid to bind to an object (i.e. not a database). I have the horizontal alignment on Stretch. I currently have it within a Border, which is within a Grid.
However when I run the application the DataGrid has a blank column and grid showing. That is say I have 5 columns & 5 rows, then there is a blank 6th column and row showing. See image:

Question - How can I get rid of these blank rows? Note that the contents of the DataGrid are populated programmatically (i.e. are not static).
thanks
EDIT: I got the extra row fixed (via CanUserAddRows), but I still have an issue with the extra column on the right.
The issue with the extra column on the right seems to be to do with automatically setting column widths. The DataGrid is actually setup (see XAML below) such that there is a GridSplitter just on it's right. When I move the GridSplitter I note that the DataGrid columns don't resize automatically. So overall the issue is both (a) on startup there is a partial extra column visible, and (b) after moving the GridSplitter they don't resize either.
Any ideas on how to get this working?
```
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Label Content="Summary" Grid.Row="0" HorizontalAlignment="Center" />
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<RadioButton IsChecked="{Binding Path=Period, Converter={StaticResource enumBooleanConverter}, ConverterParameter=AllTime}" Grid.Column="0">All Time</RadioButton>
<RadioButton IsChecked="{Binding Path=Period, Converter={StaticResource enumBooleanConverter}, ConverterParameter=Month}" Grid.Column="1">Month</RadioButton>
<RadioButton IsChecked="{Binding Path=Period, Converter={StaticResource enumBooleanConverter}, ConverterParameter=Week}" Grid.Column="2">Week</RadioButton>
<RadioButton IsChecked="{Binding Path=Period, Converter={StaticResource enumBooleanConverter}, ConverterParameter=Day}" Grid.Column="3">Day</RadioButton>
</Grid>
<Border Grid.Row="2">
<DataGrid Name="SummaryDataGrid" HorizontalGridLinesBrush="#FF726868" VerticalGridLinesBrush="#FF726868" AlternatingRowBackground="#FFD0F896" CanUserReorderColumns="False" CanUserResizeRows="False" CanUserAddRows="False" CanUserSortColumns="True" CanUserResizeColumns="False" ColumnWidth="Auto" />
</Border>
</Grid>
<GridSplitter HorizontalAlignment="Right"
VerticalAlignment="Stretch" Grid.Column="1" ResizeBehavior="PreviousAndNext"
Width="5" Background="#FFBCBCBC"/>
<Grid Grid.Column="2" Name="RTChartGrid">
<-- CUT -->
</Grid>
</Grid>
```
| WPF Data Grid - How to hide the next column/row that is visible? | CC BY-SA 2.5 | null | 2010-09-29T02:32:03.987 | 2013-09-16T13:45:55.543 | 2010-09-29T22:36:10.327 | 173,520 | 173,520 | [
"c#",
".net",
"wpf",
"datagrid",
"wpfdatagrid"
] |
3,818,719 | 1 | 3,819,106 | null | 20 | 42,358 | I believe I am missing something obvious here. When I request a JSON response from an OData service I get a different result for the DateTime properties than I do when I request XML. I'll use the NerdDinner OData feed as an example.
```
http://www.nerddinner.com/Services/OData.svc/Dinners(1)?$format=json
"EventDate": "\/Date(1235764800000)\/"
```
```
http://www.nerddinner.com/Services/OData.svc/Dinners(1)
<d:EventDate m:type="Edm.DateTime">2009-02-27T20:00:00</d:EventDate>
```
When I do an alert(new Date(1235764800000)) I get this result:

I also get a result of 8PM when I run the same query with LINQPad. It seems to assume that the response is in GMT. Should I handle this on the client (via javascript) or is this something that I can set on the server?
I'm using jQuery on the client and WCF Data Services (and Entity Framework) on the server.
I am using [Datejs](http://code.google.com/p/datejs) on the client side to handle the UTC datetime formatting. I'm wondering if this is the correct way to go about this problem.
```
function getDateString(jsonDate) {
if (jsonDate == undefined) {
return "";
}
var utcTime = parseInt(jsonDate.substr(6));
var date = new Date(utcTime);
var minutesOffset = date.getTimezoneOffset();
return date.addMinutes(minutesOffset).toString("M/d/yyyy h:mm tt");
}
```
| How to handle json DateTime returned from WCF Data Services (OData) | CC BY-SA 2.5 | 0 | 2010-09-29T04:25:53.687 | 2016-08-08T19:18:58.740 | 2010-09-29T12:51:57.523 | 12,367 | 12,367 | [
"wcf",
"json",
"wcf-data-services",
"odata"
] |
3,818,827 | 1 | null | null | 2 | 408 | 
What does this mean in the 2nd column?
```
==
|
|
|
|
==
```
| What does the quote mean in ollydbg? | CC BY-SA 2.5 | null | 2010-09-29T04:54:43.633 | 2012-01-09T08:50:23.947 | 2010-09-29T08:21:21.057 | 339,038 | 339,038 | [
"ollydbg"
] |
3,818,847 | 1 | 3,819,533 | null | 0 | 408 | What is a model.cs file?

This appears in a project I am sharing with other dev's. What is a model.cs file?
| What is a model.cs file? | CC BY-SA 2.5 | null | 2010-09-29T05:01:01.260 | 2011-07-12T10:36:35.080 | 2010-09-29T05:08:33.533 | 167,149 | 54,760 | [
"c#",
"model",
"viewmodel"
] |
3,819,086 | 1 | null | null | 10 | 11,608 | please see the figure to get idea of the scenario.

Now when my Package will run after executing the s! task, either A or B path will be followed. So If A is followed then Task S2 and F2 is executed. But if path B is followed, task F1 and F3 is executed. But also after completing task F3, the flow should go to task S2 via path E. But this doesn't happen and as the task F3 is completed, the package ends with success.
I need help on this on how to move to path E and execute task S2 and F2 after task F3 completion.
Thanks.
| How two different task can goto one task in SSIS | CC BY-SA 2.5 | 0 | 2010-09-29T05:53:33.177 | 2010-09-29T18:44:19.420 | null | null | 328,518 | [
"ssis",
"path",
"task",
"execution"
] |
3,819,189 | 1 | 3,819,203 | null | 101 | 235,954 | I can not scroll down the screen to view the data in the "Replied By:" section. How can I make my layout scrollable?

| How to make my layout able to scroll down? | CC BY-SA 3.0 | 0 | 2010-09-29T06:17:08.133 | 2020-06-16T05:20:36.827 | 2016-12-20T07:43:27.657 | null | 438,864 | [
"android",
"layout"
] |
3,819,396 | 1 | 3,819,437 | null | 7 | 12,734 | I can compute horizontal and vertical points, but I cant figure out how to compute distance using diagonal points. Can someone help me with this.
here's the code for my horizontal and vertical measuring:
```
private float ComputeDistance(float point1, float point2)
{
float sol1 = point1 - point2;
float sol2 = (float)Math.Abs(Math.Sqrt(sol1 * sol1));
return sol2;
}
protected override void OnMouseMove(MouseEventArgs e)
{
_endPoint.X = e.X;
_endPoint.Y = e.Y;
if (ComputeDistance(_startPoint.X, _endPoint.X) <= 10)
{
str = ComputeDistance(_startPoint.Y, _endPoint.Y).ToString();
}
else
{
if (ComputeDistance(_startPoint.Y, _endPoint.Y) <= 10)
{
str = ComputeDistance(_startPoint.X, _endPoint.X).ToString();
}
}
}
```
Assuming that the _startPoint has been already set.

In this image the diagonal point is obviously wrong.
| How can I measure diagonal distance points? | CC BY-SA 2.5 | 0 | 2010-09-29T06:52:38.847 | 2020-02-16T10:56:31.637 | 2010-09-29T22:57:48.767 | 416,801 | 416,801 | [
"c#",
"winforms",
"gdi",
"distance",
"measurement"
] |
3,819,760 | 1 | 3,820,554 | null | 3 | 13,323 | 
How can I prevent this overlapping from occurring without reducing the font size? Here is my XML:
```
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/nameText"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="Symbol"
android:textStyle="bold"
android:textSize="24sp"
android:layout_width="100dp"
android:textColor="#4871A8"
android:paddingTop="2dip"
android:paddingLeft="5dip"
android:paddingBottom="1dip"/>
<TextView
android:id="@+id/changeText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:gravity="right"
android:textSize="18sp"
android:paddingTop="9dip"
android:paddingRight="5dip"
android:paddingBottom="1dip" android:text="13.07(+43.08%)" android:paddingLeft="5dip"/>
<ImageView android:layout_toLeftOf="@+id/changeText" android:layout_width="wrap_content" android:layout_height="fill_parent" android:id="@+id/verticalDivider" android:background="@drawable/stocks_selected_gradient"></ImageView><TextView
android:id="@+id/priceText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/changeText"
android:gravity="right"
android:textStyle="bold"
android:textSize="24sp"
android:textColor="#4871A8"
android:paddingTop="2dip"
android:paddingBottom="1dip"
android:paddingRight="25dip" android:text="15000"/>
</RelativeLayout>
```
| How can I prevent my TextView from overlapping? | CC BY-SA 2.5 | null | 2010-09-29T08:02:53.307 | 2011-09-05T12:14:41.587 | null | null | 19,875 | [
"android",
"textview",
"android-layout",
"android-relativelayout"
] |
3,819,778 | 1 | 3,821,450 | null | 5 | 4,114 | I'm not in a position to make out the difference between `vld4_f32` and `vld4q_f32` in ARM NEON instructions.
The confusion started when I raised my coding levels and started looking at the assembly instructions rather than the less informative intrinsics.
The reason I need to use variant instruction here is because, I would like to capture `float32_t`'s from every of my large array.

The `vld4_f32` intrinsics and the corresponding assembly instructions look like this ([From this link](http://gcc.gnu.org/onlinedocs/gcc/ARM-NEON-Intrinsics.html))
```
float32x2x4_t vld4_f32 (const float32_t *)
Form of expected instruction(s): vld4.32 {d0, d1, d2, d3}, [r0]
```
The `vld4q_f32` intrinsics and its corresponding assembly instructions looks like this
```
float32x4x4_t vld4q_f32 (const float32_t *)
Form of expected instruction(s): vld4.32 {d0, d1, d2, d3}, [r0]
```
Well, at the intrinsics level , but if I look at the assembly instruction and the number of registers, they both look like the same. How will the compiler or the assembler know the difference between the two?
Can somebody clarify more on this and also explain how I can achieve loading values which are positioned into a single register?
| ARM NEON: What's the difference between vld4_f32 and vld4q_f32? | CC BY-SA 2.5 | 0 | 2010-09-29T08:07:09.317 | 2011-04-28T10:35:02.037 | null | null | 317,331 | [
"memory",
"assembly",
"arm",
"neon",
"cpu-registers"
] |
3,819,857 | 1 | 3,820,415 | null | 2 | 6,605 |
I have a web-application with more than 5 themes. Each themes covers a completely different style for different customers. whenever we publish a new version of our application we send it for all of customers.
We specify theme in web.config file in `<Page>` tag. like
```
<page theme="Theme1" /> // or Theme2 for second customer.
```
with this approach we easily change the style of application from each other without writing codes which needs a new publish for each one.
With changing the `theme="Theme1"`. nothing change and we didn't write a code in application , so why changing `theme` don't change the theme and we need a new publish?
we want to change it in `web.config` or somewhere else and with changing it the theme change without needing a new publish for each one.
---
I Publish Once and then copy the published version for each customer (5 times) then in each `web.config` file I change the `theme="CustomerTheme"`. but only the theme which was active in publish process is usable in all of 5 versions and other 4 themes are un-usable
--
Actually the main question is that why changes in Web.Config need a different publish while it is XML and do not need a complie. I should Add this note that, App_Theme include all of 5 themes so that all of them Compiles and are ready to use
--
This is the way I publish the application

[Photo Link](http://hajloo.files.wordpress.com/2010/09/publish.png)
---
Update 2
here IFound the exact problem reported by someone else. he resolve the problem but I can't underestand how he resolved this Issue. can anybody tell me how he resolved the issue?
he used `aspnet_compiler command` and told that `automatically ADDS the 'theme' on the Page directive`
(first post is the question and the last post is the answer)
[http://bytes.com/topic/asp-net/answers/495850-themes-web-config](http://bytes.com/topic/asp-net/answers/495850-themes-web-config)
| How to change Asp.net Theme via Web.Config on the fly | CC BY-SA 2.5 | null | 2010-09-29T08:22:12.870 | 2017-09-19T11:59:53.890 | 2010-09-29T11:55:44.143 | 243,213 | 243,213 | [
"c#",
"asp.net",
"web-config",
"build-process",
"publishing"
] |
3,820,082 | 1 | 3,879,872 | null | 0 | 1,348 | I'm aware some of you may not be familiar with Monotouch, but this could certainly be a general iOS issue rather than a specific Monotouch issue.
I'm recreating an app with similar functionality to the default mail app: 
This is a simple recreation of our app. It's a `UIView` which contains a `UITableView` and a `UIToolbar`. It's loaded from a XIB file (which contains accompanying view controller code). This view is a UITabController view (though I'm sure this shouldnt affect things?).

This has been pushed from a navigation Controller using
```
controller.PushViewController(inboxItem.Controller, true);
```
(where inboxItem is a custom object I've made, the Controller property being the inboxItem's view controller).
Pressing the right hand button on the toolbar presents a new modal view (compose new message) - which does its thing and no matter which way its dismissed, upon dismissal, the `UIToolbar` disappears. However, if I am to click on another tab then click back onto this tab, the Toolbar reappears. Is this a redraw issue?
Am I doing something wrong with the way I'm structuring my app? Or have I happened to stumble across some bizarre iOS/Monotouch bug? (I'm hoping it's for the former - so I can improve my iOS development).
| UIToolbar disappears after dismissing Modal View Controller | CC BY-SA 2.5 | 0 | 2010-09-29T08:52:51.290 | 2010-10-07T08:27:32.300 | null | null | 399,123 | [
"iphone",
"xamarin.ios",
"uitoolbar",
"modalviewcontroller"
] |
3,820,240 | 1 | 3,821,421 | null | 2 | 11,648 | When trying to plot a normal PDF with mean=0 and standard deviation=20 using the MATLAB command normpdf() I get weird results, see picture.

The code used to plot the figure is as follows:
```
plot(normpdf((-100:0.1:100),0,20))
```
What is the correct way of using this function?
| How does MATLAB's normpdf function work? | CC BY-SA 2.5 | null | 2010-09-29T09:17:11.603 | 2010-10-01T19:41:41.073 | 2010-10-01T19:41:41.073 | 4,928 | 429,653 | [
"matlab"
] |
3,820,318 | 1 | null | null | 1 | 4,738 | 
What does `Z 1 DS 0023 32bit 0(FFFFFFFF)` mean?
| How to understand the register window of ollydbg? | CC BY-SA 2.5 | 0 | 2010-09-29T09:31:04.743 | 2015-08-25T13:02:04.600 | 2020-06-20T09:12:55.060 | -1 | 339,038 | [
"ollydbg"
] |
3,820,577 | 1 | 3,820,776 | null | 1 | 4,505 | I am using ext do draw charts in the browser,I meet a problem:
I want to draw two lines in one chart, so I use the ColumnChart, this is my data:
```
var store = new Ext.data.JsonStore({
fields:['name', 'visits', 'views'],
data: [
{name:'Jul 07', visits: 245, views: 3000000},
{name:'Aug 07', visits: 240, views: 3500000},
{name:'Sep 07', visits: 355, views: 4000000},
{name:'Oct 07', visits: 375, views: 4200000},
{name:'Nov 07', visits: 490, views: 4500000},
{name:'Dec 07', visits: 495, views: 5800000},
{name:'Jan 08', visits: 520, views: 6000000},
{name:'Feb 08', visits: 620, views: 7500000}
]
});
```
Since the Visit data is much less than views.
So the line which respresent the visit is too close to the xaxis, is there any idea?

---
Thanks for your reply, I decide to make them the same scale.
BTW, I have another question,hope you can give some suggesion:

| extjs chart problem | CC BY-SA 2.5 | null | 2010-09-29T10:06:07.960 | 2011-11-30T18:37:00.570 | 2010-09-29T11:42:31.363 | 306,719 | 306,719 | [
"extjs",
"charts"
] |
3,820,954 | 1 | 3,820,965 | null | 13 | 47,356 | I wanted to get Java running at 1.6xxx - I changed the JAVA_HOME variable and pointed it to the directory C:\Program Files\Java\jdk1.6.0._16.
I restart the PC - and I think I can check which version of Java my machine is pointing at - but it still points to the older version of Java e.g v1.5.0_16
Can you help me rejog my memory on correct setup for Java JDK?

| JAVA_HOME environment variable and Java JDK fun | CC BY-SA 3.0 | 0 | 2010-09-29T11:01:49.433 | 2019-01-03T06:28:02.497 | 2016-01-15T09:34:22.710 | 3,885,376 | 5,175 | [
"java",
"java-home"
] |
3,822,123 | 1 | null | null | 0 | 830 | 
The image above is the first page of my game. Normally the big blue 'button' background image should not show up there.
I declare my custom background image for my buttons in layout file like this:
```
<Button android:id="@+id/id_button_startgame"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_weight="1"
android:textSize="26sp"
android:text="@string/start_game"
android:textColor="@color/solid_red"
android:background="@drawable/button_bg"
/>
```
And here's button_bg.xml in drawable folder
```
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/button01_focused" />
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/button01_pressed" />
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/button01_pressed" />
<item android:drawable="@drawable/button01_idle" />
</selector>
```
As you can see the attached image. The three button below is the normal case. I use them everywhere in my apps. But sometimes the one on the center of the screen shows up. This big button cannot be pressed or anything. It's just up there hovering over my game. I can start the game but obviously can't see the content because this big blue thing cover it all.
I can reproduce this bug by keep launching/exiting my game several times.
I'd love to include more info. But don't know what info should I be giving you. I use `FrameLayout` to lay the UI above a SurfaceView.
And most of the time this bug DON'T happen. It seems to happen randomly after I launch/exit my game and repeat for several times.
Anyone have seen something like this before? If so please let me know how did you manage to fix it?
| Weird layout problem. (please see the attached image) | CC BY-SA 2.5 | null | 2010-09-29T13:39:40.283 | 2010-09-30T08:05:33.587 | 2010-09-29T13:43:19.220 | 244,296 | 461,783 | [
"android",
"layout",
"button",
"surfaceview"
] |
3,822,193 | 1 | 3,845,118 | null | 12 | 2,784 | I have a view that is round and hovering above (-> in z-axis direction coming out of the screen) the main content. When the someone taps the screen I want either the main content to be selected or the view hovering above, when it covers the main view.
So far that works perfectly. I have a round shaped item on a transparent canvas. Meaning you can see everything of the background that is outside of that circle. However, you cannot select it, because it is still the hovering canvas, just with a transparent paint.
Now I'm wondering, to solve this issue, if it is possible to make the view/canvas itself round shaped?
---
I added an image for better explanation what I try to achieve.

| Android: can I create a view/canvas that is not rectangular, but e.g. round? | CC BY-SA 2.5 | 0 | 2010-09-29T13:46:03.047 | 2014-08-15T22:02:28.853 | 2010-09-30T15:08:24.580 | 184,367 | 184,367 | [
"android",
"view",
"canvas",
"rounding"
] |
3,822,247 | 1 | 3,829,381 | null | 2 | 248 | I really don't get why this is not working. I want to avoid a specific form item being collapsed.
This is my element I want to modify (after the change with the code below):
```
[taxonomy] => Array
(
[tags] => Array
(
[1] => Array
(
[#type] => textfield
[#title] => Tags
[#description] => A comma-separated list of terms describing this content. Example: funny, bungee jumping, "Company, Inc.".
[#required] => 0
[#default_value] =>
[#autocomplete_path] => taxonomy/autocomplete/1
[#weight] => 0
[#maxlength] => 1024
[#collapsed] => 0
[#collapsible] => 0
)
[#collapsed] => 0
[#collapsible] => 0
)
[#weight] => -3
[#tree] => 1
[#collapsed] => 0
[#collapsible] => 0
```
This is my code in hook_form_alter (I'm sure the form is modified by the code):
```
$form['taxonomy']['#collapsed'] = 0;
$form['taxonomy']['tags']['#collapsed'] = 0;
$form['taxonomy']['tags'][2]['#collapsed'] = 0;
$form['taxonomy']['#collapsible'] = 0;
$form['taxonomy']['tags']['#collapsible'] = 0;
$form['taxonomy']['tags'][3]['#collapsible'] = 0;
```
But it doesn't work. The element is always collapsed. And I've refreshed all caches

[http://dl.dropbox.com/u/72686/tagsform.txt](http://dl.dropbox.com/u/72686/tagsform.txt)
:
```
$form['taxonomy']['#required'] = TRUE;
$form['taxonomy']['tags']['#required'] = TRUE;
$form['taxonomy']['tags'][5]['#required'] = TRUE;
```

| Drupal: how can I avoid this form item being collapsed? | CC BY-SA 2.5 | null | 2010-09-29T13:52:02.020 | 2010-09-30T16:46:07.417 | 2010-09-30T16:46:07.417 | 257,022 | 257,022 | [
"drupal",
"drupal-6"
] |
3,822,609 | 1 | 3,826,784 | null | 18 | 6,748 | I am looking for good resources for learning to use the Win32/GDI APIs or whatever supercedes it to draw and paint directly using the Win32 API to a glass form.
While I am using Delphi, I tagged this as Delphi or Visual C++. Any code samples and articles that you can find would be appreciated. MSDN articles do not seem to be written about this.
As a goal, let's imagine you want to either:
(a) Reproduce what Google Chrome does (tabs as part of the glass frame)
(b) Reproduce what MS Office 2010 does (save button on the glass frame, referred to in MFC for VS 2010, as "Quick Access Toolbar" (see picture below).
I am not using MFC, but if examining the MFC sources would be a good source of information, I am curious to know where in the MFC sources or BCG original sources (I have both) are implemented the Quick Access Toolbar rendering/painting code.

Update: A related neato link from one of the answers below shows the NC (nonclient) Paint message, and how to handle it when painting on a glass frame, and an MSDN article about it [here](http://msdn.microsoft.com/en-us/library/bb688195(VS.85).aspx).
| Documentation and API Samples for drawing on Windows Aero Glass (DWM, GDI, GDI+) for all Win32 programmers | CC BY-SA 3.0 | 0 | 2010-09-29T14:31:08.640 | 2013-12-03T23:38:13.147 | 2013-12-03T23:38:13.147 | 464,709 | 84,704 | [
"windows",
"delphi",
"visual-c++",
"windows-7",
"aero-glass"
] |
3,822,854 | 1 | 3,834,467 | null | 0 | 621 | I have a movieclip moving on a path by means of a tween. At the starting point a (virtual) line on the movieclip is tangent to the path. Is there an easy way to automagically rotate the movieclip such that this line remains tangent to the path throughout the tween?

TIA
Steven
| Object rotation while moving on a path in Flash | CC BY-SA 2.5 | null | 2010-09-29T14:55:08.617 | 2010-09-30T20:13:50.773 | null | null | 66,056 | [
"flash"
] |
3,823,489 | 1 | 3,835,492 | null | 16 | 10,188 | In Google's documentation it is said that an event can be tracked in the following way:
```
<a onclick="_gaq.push(['_trackEvent', 'category', 'action', 'opt_label', opt_value]);">click me</a>
```
or older version:
```
<a onclick="pageTracker._trackEvent('category', 'action', 'opt_label', opt_value);">click me</a>
```
I was looking with Firebug to the request that are made when a click on a link and I see there aborted request:
`http://www.google-analytics.com/__utm.gif?utmwv=4.7.2&utmn=907737223&....`
This happens because browser unload all javascript when user navigates to a new page. How in this case event tracking is performed?
Since one picture can be worth a thousand words...

When I click a link firebug shows me this sequence of requests (here are shown first four, after follows requests to fill page content)
| How does google analytics track events when user navigates to other page inside one domain | CC BY-SA 2.5 | 0 | 2010-09-29T16:04:36.970 | 2014-07-14T23:15:42.243 | 2010-09-30T06:38:17.710 | 86,913 | 86,913 | [
"google-analytics"
] |
3,823,585 | 1 | null | null | 0 | 100 | In solutions that contain a few different projects, I find myself constantly shuffling around in solution explorer looking for a particular file, when the tree gets expanded a little, there are often 4 'pages' of files to scroll through.
Does anyone have any tips for making solution explorer a bit more usable?
Perhaps Some 'collapse all folders' shortcut? or Some way of colour coding different projects?
I'm guessing theres not much that can be done, but thought I'd ask. I've got tons of horizontal screen space utilizing this in some way would be good.
Thanks
---
UPDATE
Regarding the right click context menus on solution and project nodes, here's what I have:


| Anything I can do to improve usability of 'Solution Explorer' in VS2008? | CC BY-SA 2.5 | null | 2010-09-29T16:15:00.833 | 2010-09-30T15:15:56.657 | 2010-09-30T08:11:56.640 | 324,381 | 324,381 | [
"visual-studio",
"visual-studio-2008"
] |
3,823,713 | 1 | 3,824,063 | null | 2 | 5,120 | This is ordinarily a simple task. I have a simple sign in form that has an email input,password input, and a submit button, all in a horizontal line. After hours and hours of taking styles off, and trying different structures, the button sits a little lower then the boxes. I am thinking it might be because I have absolutely positioned elements involved or that its' sitting in a div that has a background image.
Thanks in advance.
Here is the screen shot:

Here is the html structure:
```
<div id="new_home_join">
<div id="sign_up_home">
<div id="sign_in_table">
<form name="sendEmail" action="Home.php" method="post">
<table>
<tr>
<td class="sign_in_input">
<input type="text" name="email" class="text" value="Email<?php if($formError == "true") { echo stripslashes($_POST['name']); } ?>" onclick="clearify(this);" />
</td>
<td class="sign_in_input">
<input type="password" name="password" class="text" value="Password<?php if($formError == "true") { echo stripslashes($_POST['']); } ?>" onfocus="clearify(this);" />
</td>
<td class="sign_submit">
<input type="hidden" name="return" value="<?php echo $_GET['return']; ?>" />
<input type="submit" name="subSignIn" value="Login" />
</td>
</tr>
</table>
</form>
<div class="forget_pw">
<a href="password_forget.php">
Forgot Password?
</a>
</div>
</div>
<div id="not_member">
<a href="http://www.cysticlife.org/signUp.php">
<span style="color:#808080;font-size:18px;">Not a CysticLife member?</span><br /> Join our community today!
</a>
</div>
<div id="browse">
or just browse the
<a href="http://www.cysticlife.org/Blogs_future.php">blogs</a> and <a href="http://www.cysticlife.org/Questions_future.php">questions</a>
</div>
</div>
<div id="fuss">
<a href="http://www.cysticlife.org/what-is-cysticlife.php">What is the CysticLife community?</a>
</div>
</div>
```
and here is the relevant css:
```
#new_home_join {background:url(images/join_today.png) no-repeat;width:333px; height:200px;margin:0px 0px 0px 0px;}
#sign_up_home {width:343px;}
#sign_in_table {width:338px;margin:0px auto 0px auto;position:relative;}
#sign_in_table {width:338px;margin:0px auto 0px auto;position:relative;}
#sign_in_table table tr td.sign_in_input {padding:40px 0px 5px 10px;}
#sign_in_table table tr td.sign_in_input input {width:105px; border:1px #999999 solid;padding:2px;font-family:Arial,Helvetica,sans-serif; font-size:12px; color:#666666;}
#sign_in_table table tr td.sign_submit input{width:72px; height:34px; background:url(images/search_button.png) no-repeat; font-style:Arial,Helvetica, sans-serif; color:#333333; font-size:11px;padding:5px 0px 10px 0px; border:0;}
.forget_pw {margin:5px 0px 0px 0px;position:absolute; top:62px; right:82px;}
.forget_pw a {padding:10px;font-family:Arial,Helvetica, sans-serif; font-size:10px; color:#626262; text-decoration:none;}
.forget_pw a:hover {color:#F37336;}
#sign_in_table table tr td.sign_submit input{width:72px; height:34px; background:url(images/search_button.png) no-repeat; font-style:Arial,Helvetica, sans-serif; color:#333333; font-size:11px;padding:5px 0px 10px 0px; border:0;}
#join_us {margin:0px auto 40px 60px; font-family:Arial,Helvetica, sans-serif; font-size:12px; color:#F37336; font-weight:bold; text-align:left;padding:0px 50px 80px 0px;float:right}
#join_us a {font-family:Arial,Helvetica, sans-serif; font-size:14px; color:#999999;text-decoration:none;}
#join_us a:hover {color:#F37336;}
#fuss {margin:25px auto 0px auto; font-family:Arial,Helvetica, sans-serif; text-align:center; color:#666666; font-size:12px;}
#fuss a {font-family:Arial,Helvetica, sans-serif; font-size:12px; color:#666666; text-decoration:none;}
#fuss a:hover {color:#FF4701;}
```
| submit button not lining up no matter what with two input boxes in a table | CC BY-SA 2.5 | null | 2010-09-29T16:28:25.977 | 2010-09-29T17:32:27.860 | null | null | 302,093 | [
"html",
"css",
"input",
"css-position",
"submit-button"
] |
3,823,864 | 1 | 4,066,521 | null | 28 | 12,494 | I have an TFS server installation that through time has gone through upgrades from TFS 2005 to TFS 2008 and then to TFS 2010.
During the lifetime of the installation a lot of projects have been created and different project templates have been used. MSF Agile 4.0, 4.1, 4.2 and 5.0. and a few MSF CMMI ones.
What I would like to do is "replace" the project template used for all these projects to use a new one common one: Microsoft Visual Studio Scrum 1.0.
I am aware that TFS project templates are used as for creating new projects and cannot modify the tfs projects definitions after creation.
Uptil now only the version control and build server part of TFS have been used and there are no existing work item types.
Additionally all projects and build scripts are depending on the source code paths stay the same.
As I see it I have the following options:
1. All code is moved to a temporary team project.
2. The old project is deleted
3. New project with the original name and correct process template is created
4. Code is moved to the new team project
5. Temporary team project is deleted All the build definitions needs to be to recreated which is not an option. The source code move/branch will "mess up" the versioning history

By messing up the versioning history I mean that when you move source code it will behind the scenes do a delete + source rename on the original location and the history will still be located in the old project. This will make searching in the history difficult and if I actually delete the old project I will loose all the history before the source code move.
This is really not an option for me since there is years of code change history that is needed to for supporting the different applications being built.
-
For each tfs project
- Delete existing work item definitions using "witadmin deletewitd"- Import each work item definition from the new process template using "witadmin importwitd"- Import work item categories using "witadmin importcategories"- Delete old reports in project folder in report server- Upload the report definitions from the new process template- Modify data sources used for the reports using the report manager to point to the correct shared data sources (TfsReportDS and TfsOlapReportsDS)- Modify the report parameter ExplicitProject default value to "" (empty string) and disable prompt user option.- Export the documents in the old SharePoint site using stsadm- Delete the old SharePoint site- Recreate the sharepoint site using the TFS2010 Agile Dashboard site template- Activate site feature "Team Foundation Server Scrum dashboard"- In TFS Project Settings -> Project Portal Settings: Enable "team project portal" and ensure the url is correct. Enable "reports and dashboards refer to data for this team project"
And finally..
- Process the Warehouse- Process the Analysis Database
Even though that this involves a lot of small steps this looks more appealing because
this option will not force me to move the source code and my existing build definitions will be intact.
Are there other ways to achieve the replacement of work item types that I haven't mentioned?
And/or am I missing any steps in last solution?
| Steps for changing process template for an existing project in TFS 2010 | CC BY-SA 2.5 | 0 | 2010-09-29T16:44:14.250 | 2010-11-01T03:43:54.800 | 2010-10-01T12:06:51.570 | 29,449 | 29,449 | [
"tfs",
"tfs-workitem",
"tfs-process-template"
] |
3,824,113 | 1 | 3,824,275 | null | 2 | 3,693 | I am playing around with a small MFC-wizard-generated application, in Visual C++ 2010, and I just decided to put my own bitmap into the resources to replace the three-cubes MFC bitmap that shows up in the ribbon UI Application Button, aka the "marble".
The original appeared to use black (0,0,0) as a transparency color, but I am unable to determine what the MFC Ribbon (mfc-feature-pack stuff) stuff in Visual Studio 2010 does to determine transparency on a bitmap used as the ribbon's main icon.
The properties of the ribbon (IDR_RIBBON) show Image=IDB_MAIN, and IDB_MAIN is a 32x32 bitmap in BMP format, loaded from a disk file called main.bmp.
Some of the bitmap resources in this project have what looks like what I would expect: A magenta color which becomes transparent, but the MFC main bitmap did not use this color scheme or palette.
Here is an example of the actual results, which are I hope show that the results are not what I wanted:

Incidentally, It does not seem possible to use an ICON resource in the Application Button, so I am a little mystified how they pull off the transparency in it.
| Visual Studio 2010 - C++ MFC application with Ribbon UI - Transparency in bitmaps | CC BY-SA 2.5 | 0 | 2010-09-29T17:10:51.550 | 2010-09-29T17:55:30.980 | 2010-09-29T17:22:15.173 | 84,704 | 84,704 | [
"visual-studio-2010",
"visual-c++",
"mfc-feature-pack"
] |
3,824,456 | 1 | 3,827,607 | null | 1 | 713 | Is there a free implementation of the text box in Blend's property grid that allows you to change the number by clicking and dragging? Or perhaps another way to ask is what kind of control called so I can google it?

| Blend Slider Control | CC BY-SA 2.5 | 0 | 2010-09-29T17:57:13.117 | 2010-09-30T03:56:19.617 | 2010-09-29T18:07:22.973 | 632 | 632 | [
"wpf",
"expression-blend"
] |
3,824,519 | 1 | 6,363,698 | null | 3 | 5,020 | I'm having a problem similar to [jQuery $.ajax Not Working in IE8 but it works on FireFox & Chrome](https://stackoverflow.com/questions/2721970/jquery-ajax-not-working-in-ie8-but-it-works-on-firefox-chrome), but with a different use case.
I'm using the jQuery Form plug-in to handle a file upload to an ASP.NET MVC controller, which sends the file off for parsing and processing. If an Exception is thrown, it should alert the user to the issue.
```
//client side code
//make an ajax call, sending the contents of the file
$("#ajaxUploadForm").ajaxSubmit({
dataType: 'json',
url: '/plan/Something/ExcelImport',
iframe: true,
beforeSend: function () {
$(".ui-dialog-buttonpane").find("#my_progress").fadeIn();
},
success: function (data, textStatus) {
output = "<center><span class='flash'>" + data.message + "</span></center>";
$("#flash_message").html(output).fadeIn('slow');
setTimeout(function () { $("#flash_message").fadeOut() }, 5000);
cleanup();
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert("XMLHttpRequest is " + XMLHttpRequest);
var contents = "";
for (prop in XMLHttpRequest) {
contents += "\na property is " + prop + " it's value is " + XMLHttpRequest[prop];
}
alert("the contents are " + contents);
alert("textStatus is " + textStatus);
alert("errorThrown is " + errorThrown);
//comes back in an HTML envelope. This should be parsed with regex, but I can't get it to work. Dirty hack
response = XMLHttpRequest.responseText.substring(XMLHttpRequest.responseText.indexOf("<body>"));
response = response.replace("<body>", "");
response = response.replace("</body>", "");
alert("There was a problem with the upload.\r\n" + response);
},
complete: function (XMLHttpRequest, textStatus) {
$(".ui-dialog-buttonpane").find("#my_progress").remove();
something_import.dialog('close');
something_import.dialog('destroy');
}
});
//server side code
public FileUploadJsonResult ExcelImport()
{
FileUploadJsonResult result = new FileUploadJsonResult();
HttpPostedFileBase hpf = Request.Files[0] as HttpPostedFileBase;
if (hpf.ContentLength == 0)
return new FileUploadJsonResult { Data = new { message = "File contained no data" } };
String fileName = Path.GetFileName(hpf.FileName);
String timeStampedFile = fileName.Insert(fileName.IndexOf('.'),"_"+DateTime.Now.ToFileTimeUtc());
string savedFileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory + "tempo", timeStampedFile);
hpf.SaveAs(savedFileName);
try
{
result = ProcessFile(savedFileName, Request["Id"]) as FileUploadJsonResult;
}
catch (ArgumentException e)
{
this.Response.StatusCode = 500;
this.Response.StatusDescription = System.Net.HttpStatusCode.BadRequest.ToString();
Response.Write(e.Message);
result = Json(new { message = e.Message, stackTrace = e.StackTrace }) as FileUploadJsonResult;
}
return result;
}
```
This works perfectly in Chrome and Firefox. In IE, the XMLHttpRequest object coming back is different:
FF:
IE:

I've been Googling around for differences between the browser implementations of XMLHttpRequest, but haven't found anything that deals specifically with this case. Stymied.
| XMLHttpRequest different in IE8 vs. FireFox/Chrome | CC BY-SA 2.5 | null | 2010-09-29T18:05:48.323 | 2011-06-15T20:09:11.040 | 2017-05-23T12:01:09.963 | -1 | 197,101 | [
"asp.net-mvc",
"ajax",
"asp.net-ajax",
"cross-browser",
"xmlhttprequest"
] |
3,825,058 | 1 | 3,825,830 | null | 3 | 1,406 | I'd like generate the representation below by `<div>`. The constraints :
- - - - - -
PS : no debate table vs div ;-)

| Generate "table" with <div> | CC BY-SA 3.0 | 0 | 2010-09-29T19:19:34.970 | 2017-06-11T08:29:07.847 | 2017-06-11T08:29:07.847 | 4,370,109 | 118,584 | [
"html",
"css",
"css-tables"
] |
3,825,377 | 1 | 5,309,884 | null | 4 | 468 | I want to create list with different types of items. They should call different intents or do other things (display a map etc.) . It should act like contact details. Numbers of items and actions is predefined.

How to achieve this effect elegantly? I don't need exact code but guidelines and information where to look. Any help will be appreciated :)
---
UPDATE:
By "this effect" I mean creating a list of different types of items (onClickListener, layout). On picture above you can see that you have a contact with various options: calling somebody, emailing, chatting, looking at google maps etc. All of those options are grouped at list.
I'm wondering if it could be achieved by xml layout without defining custom `Adapter` class. I want also be able to add some static header rows with eg. category name.
| How to create list with different elements and actions? | CC BY-SA 3.0 | 0 | 2010-09-29T20:00:55.367 | 2011-09-05T11:52:39.577 | 2011-09-05T11:52:39.577 | 415,347 | 296,427 | [
"android",
"list",
"android-intent"
] |
3,825,358 | 1 | 5,523,518 | null | 2 | 849 | I'm trying to add my own drawable and use it in a series of overlays on a MapView. The drawable is basically a rounded box with a black outline and a number in the middle.
I have managed to achieve this using the code below, however there is what looks like a flag to the left of my box, which I certainly don't think I have drawn - so I'm wondering what it can be.
This is an example of the image: 
---
Edit - this is what happens if a circle is drawn:

---
My code is below:
Custom Drawable:
```
public class BikeDrawable extends Drawable {
int colour;
String bikes;
public BikeDrawable (int bikes){
this.bikes = Integer.toString(bikes);
if (bikes < 4) {
colour = Color.RED;
}
else if (bikes > 3 && bikes < 9){
colour = Color.argb(244, 255, 127, 42);
}
else {
colour = Color.GREEN;
}
}
@Override
public void draw(Canvas canvas) {
Paint rectanglePaint = new Paint();
rectanglePaint.setColor(colour);
rectanglePaint.setStyle(Style.FILL);
RectF rectangle = new RectF(0.0f, 0.0f, 20.0f, 20.0f);
Paint strokepaint = new Paint();
strokepaint.setStyle(Paint.Style.STROKE);
strokepaint.setStrokeWidth(2);
strokepaint.setARGB(255, 0, 0, 0);
canvas.drawRoundRect(rectangle, 4.0f, 4.0f, rectanglePaint);
canvas.drawRoundRect(rectangle, 4.0f, 4.0f, strokepaint);
Paint textpaint = new Paint();
textpaint.setARGB(255, 0, 0, 0);
textpaint.setTextAlign(Paint.Align.CENTER);
canvas.drawText(bikes, 10, 14, textpaint);
}
@Override
public int getOpacity() {
return 0;
}
@Override
public void setAlpha(int alpha) {
}
@Override
public void setColorFilter(ColorFilter cf) {
}
}
```
Use in MapView:
```
bikeOverlay = new PointsOverlay(start_icon);
BikeDrawable start_1_drawable = new BikeDrawable (start_1.capacity);
OverlayItem start_1_overlayitem = new OverlayItem(new GeoPoint(start_1.lat,start_1.lon), null, null);
start_1_overlayitem.setMarker(start_1_drawable);
mapOverlays.add(bikeOverlay);
bikeOverlay.addOverlay(start_1_overlayitem);
```
Does anyone have any idea what is going on here? Is it an artefact from OverlayItem?
| Strange drawing artefact using custom drawable with MapView | CC BY-SA 2.5 | null | 2010-09-29T19:57:40.213 | 2011-04-02T13:47:16.323 | 2010-09-29T21:17:52.840 | 278,638 | 278,638 | [
"android",
"android-mapview",
"drawable"
] |
3,825,431 | 1 | 3,825,983 | null | 1 | 1,641 | I'm using Flash CS5's new Text Layout Framework (TLF) for the first time. Whenever I set the TLF text dynamically through actionscript, the resulting text renders with multiple fonts! (The same text set statically doesn't have any issues)
Example:

I can understand if, when a client machine lacks a given font, Flash would choose a default, but in this case the font is Arial Bold, which the client does have, and moreover only certain characters are screwy. Any ideas here??
| Flash dynamic TLF text mixes fonts together- very weird | CC BY-SA 2.5 | null | 2010-09-29T20:07:35.940 | 2011-10-11T11:52:59.090 | null | null | 165,673 | [
"flash",
"text",
"flash-cs5",
"tlf"
] |
3,825,615 | 1 | 3,825,756 | null | 0 | 119 | How do you get Internet Explorer 6 and 7 to not literally interpret whitespace and line breaks in HTML list items? In the image below, I have marked the undesired whitespace in red. I would prefer to not squeeze everything into one giant line of code. It's very hard to read that way. Is there a CSS alternative?

```
<ol>
<li>
<img>
Sentence 1
Sentence 2
</li>
<li>
<img>
sentence
</li>
<li>
sentence
</li>
</ol>
```
| IE6/7 literally interpret whitespace in list items | CC BY-SA 2.5 | null | 2010-09-29T20:33:14.197 | 2012-06-04T11:41:48.823 | 2012-06-04T11:41:48.823 | 426,671 | 459,987 | [
"html",
"internet-explorer",
"html-lists"
] |
3,825,935 | 1 | null | null | 0 | 808 | I'm looking to build or incorporate a dropdown menu system into an app I'm building however I need some help figureing out how it's accomplished. From my best guess I'd have to use the UIActionSheet, however it doesn't seem all that customizable. The best example I've come accross is within the AppShopper iOS application:

Drop down active: notice how it pushed the table down, it did not overlay the menu as the UIActionSheet might.

| Dropdown menu within a UITableView | CC BY-SA 2.5 | 0 | 2010-09-29T21:17:01.593 | 2012-10-09T07:27:56.510 | null | null | 248,487 | [
"iphone",
"objective-c",
"drop-down-menu"
] |
3,825,939 | 1 | 3,832,379 | null | 2 | 669 | I have a group of equations and I'd like to show under some transformation, the system looks like something else. So I'd like to group the AMS Align environment inside a pair of brackets such that the align environment is vertically centered on the line and I can do something like:

(That uses the matrix environment, so the alignment is centered.)
I am using LyX.
| How can I add delimiters around the amsmath align environment? | CC BY-SA 3.0 | 0 | 2010-09-29T21:17:37.223 | 2011-08-24T23:10:09.143 | 2011-08-24T23:05:54.747 | 600,500 | 415,404 | [
"latex",
"lyx"
] |
3,826,038 | 1 | null | null | 6 | 8,594 | I get this error message:
```
System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='System.Windows.Data.ListCollectionView' BindingExpression:Path=MaterialList; DataItem='MaterialBrowserListViewModel' (HashCode=24964411); target element is 'CollectionViewSource' (HashCode=36518048); target property is 'Source' (type 'Object')
```
Below is the important Xaml + ViewModel code.
What is wrong with my binding?
VIEWMODEL:
```
public class MaterialBrowserListViewModel : ViewModelBase
{
private IDocumentRepository _docRepo;
private ICollectionView _materialList;
public MaterialBrowserListViewModel()
{
_docRepo= new DocumentRepository();
MaterialList = CollectionViewSource.GetDefaultView(_docRepo.GetMaterialList());
//_materialList.GroupDescriptions.Add(new PropertyGroupDescription("Schoolclasscode"));
}
public ICollectionView MaterialList
{
get { return _materialList; }
set
{
_materialList = value;
this.RaisePropertyChanged("MaterialList");
}
}
}
```
VIEW:
```
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!--<ResourceDictionary Source="Themes\DataGrid.Generic.xaml"/>-->
</ResourceDictionary.MergedDictionaries>
<CollectionViewSource Source="{Binding MaterialList}" x:Key="groupedView">
<CollectionViewSource.GroupDescriptions>
<PropertyGroupDescription PropertyName="DocumentName"/>
</CollectionViewSource.GroupDescriptions>
</CollectionViewSource>
<!-- GroupHeaderStyle -->
<Style x:Key="GroupHeaderStyle" TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True"
Background="Blue"
Foreground="White">
<Expander.Header>
<TextBlock Text="{Binding Name.Name}"/>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="10" Background="AliceBlue">
<Grid.RowDefinitions>
<RowDefinition Height="35" />
<RowDefinition Height="25"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel Margin="0,0,0,10" Grid.Row="0" Orientation="Horizontal">
<Button Content="Open" />
<Button Content="Delete" />
<Button Content="Export" />
<Button Content="Clear Filter" />
</StackPanel>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding ElementName=col0, Path=ActualWidth}" />
<ColumnDefinition Width="{Binding ElementName=col1, Path=ActualWidth}" />
<ColumnDefinition Width="{Binding ElementName=col2, Path=ActualWidth}" />
<ColumnDefinition Width="{Binding ElementName=col3, Path=ActualWidth}" />
<ColumnDefinition Width="{Binding ElementName=col4, Path=ActualWidth}" />
<ColumnDefinition Width="{Binding ElementName=col5, Path=ActualWidth}" />
</Grid.ColumnDefinitions>
<DatePicker Grid.Column="0" />
<TextBox Grid.Column="1" />
<ComboBox Grid.Column="2" />
<ComboBox Grid.Column="3" />
<TextBox Grid.Column="4" />
</Grid>
<DataGrid
CanUserAddRows="False"
CanUserDeleteRows="False"
AutoGenerateColumns="False"
ItemsSource="{Binding Source={StaticResource groupedView}}"
Grid.Column="0"
Grid.Row="2"
Grid.ColumnSpan="15"
x:Name="MaterialGrid"
IsSynchronizedWithCurrentItem="True"
AlternatingRowBackground="AliceBlue"
VirtualizingStackPanel.VirtualizationMode="Recycling"
VirtualizingStackPanel.IsVirtualizing="True"
HeadersVisibility="Column"
CanUserResizeColumns="True"
CanUserSortColumns="True"
IsReadOnly="True"
>
<DataGrid.GroupStyle>
<GroupStyle ContainerStyle="{StaticResource GroupHeaderStyle}">
<GroupStyle.Panel>
<ItemsPanelTemplate>
<DataGridRowsPresenter/>
</ItemsPanelTemplate>
</GroupStyle.Panel>
</GroupStyle>
</DataGrid.GroupStyle>
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Schoolday}" x:Name="col0" Header="Date" />
<DataGridTextColumn Binding="{Binding Period}" x:Name="col1" Header="Period" />
<DataGridTextColumn Binding="{Binding SchoolclassCode}" x:Name="col2" Header="Class code" />
<DataGridTextColumn Binding="{Binding DocumentName}" x:Name="col3" Header="Document name" />
<DataGridTextColumn Binding="{Binding Keywords}" x:Name="col4" Header="Keywords" />
<DataGridTextColumn Binding="{Binding DocumentId}" x:Name="col5" Header="Doc Id" />
</DataGrid.Columns>
</DataGrid>
</Grid>
</UserControl>
```
: Why is the Binding not working for "Schoolclasscode" below?
Error: `System.Windows.Data Error: 40 : BindingExpression path error: 'SchoolclassCode' property not found on 'object' ''CollectionViewGroupInternal' (HashCode=15576908)'. BindingExpression:Path=SchoolclassCode; DataItem='CollectionViewGroupInternal' (HashCode=15576908); target element is 'TextBlock' (Name=''); target property is 'Text' (type 'String')`
```
<!-- GroupHeaderStyle -->
<Style x:Key="GroupHeaderStyle" TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True"
Background="AliceBlue"
Foreground="White">
<Expander.Header>
<TextBlock Text="{Binding SchoolclassCode}"/>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
```
I have changed the binding now to the current datacontext to see whats in there:
```
<DataGrid
CanUserAddRows="False"
CanUserDeleteRows="False"
AutoGenerateColumns="False"
ItemsSource="{Binding Source={StaticResource ResourceKey=groupedView}}"
Grid.Column="0"
Grid.Row="2"
Grid.ColumnSpan="15"
x:Name="MaterialGrid"
IsSynchronizedWithCurrentItem="True"
AlternatingRowBackground="AliceBlue"
VirtualizingStackPanel.VirtualizationMode="Recycling"
VirtualizingStackPanel.IsVirtualizing="True"
HeadersVisibility="Column"
CanUserResizeColumns="True"
CanUserSortColumns="True"
IsReadOnly="True"
>
<DataGrid.GroupStyle>
<GroupStyle>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander.Header>
<TextBlock Foreground="Black" Text="{Binding }"/>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</DataGrid.GroupStyle>
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Schoolday}" x:Name="col0" Header="Date" />
<DataGridTextColumn Binding="{Binding Period}" x:Name="col1" Header="Period" />
<DataGridTextColumn Binding="{Binding SchoolclassCode}" x:Name="col2" Header="Class code" />
<DataGridTextColumn Binding="{Binding DocumentName}" x:Name="col3" Header="Document name" />
<DataGridTextColumn Binding="{Binding Keywords}" x:Name="col4" Width="*" Header="Keywords" />
<!--<DataGridTextColumn Binding="{Binding DocumentId}" x:Name="col5" Header="Doc Id" />-->
</DataGrid.Columns>
</DataGrid>
```
Do you see the class name at the Expander Text ? How can I access my ObservableCollection from this point?

| WPF DataGrid Grouping does not show up due to binding error | CC BY-SA 2.5 | 0 | 2010-09-29T21:34:16.623 | 2012-11-15T11:30:24.383 | 2010-09-30T18:47:03.143 | 320,460 | 320,460 | [
"wpf",
"mvvm",
"datagrid",
"grouping"
] |
3,826,762 | 1 | 3,839,696 | null | 1 | 1,331 | I would like to collect your ideas on the following:
SharePoint 2010 (and 2007) does have a preview button... while you are editing a publishing page you can switch to the "Page" tab and hit the Preview button:

Clicking this button does some magic to save your data, and opens a new window where the preview page is displayed. Nice, but could be better. What I would like is live update on editing of field controls from the edit page on the preview page.
My thoughts on this is are as follows:
- - - [http://www.sfpeter.com/2008/03/13/communication-between-browser-windows-with-jquery-my-new-plugin/](http://www.sfpeter.com/2008/03/13/communication-between-browser-windows-with-jquery-my-new-plugin/)
Does this sound doable? Would be great to work dual monitor, edit on one monitor, preview page in its real rendering on the other monitor. Especially if the edit mode differs from the display mode.
Looking forward to your input!
| SharePoint 2010 Publishing Page live preview... any thoughts? | CC BY-SA 2.5 | null | 2010-09-30T00:02:09.523 | 2010-10-01T13:38:47.713 | null | null | 48,050 | [
"sharepoint",
"sharepoint-2010"
] |
3,826,938 | 1 | 6,021,506 | null | 2 | 806 | For those times when a UISlider just isn't fun enough I was thinking I'd work up a custom UIControl to do something similar to a Google O Meter from the google chart API on iOS.
Here's an example of what I'm talking about visually. My goal would be to enable touch manipulation of the needle and easy customization of the range labels and coloring gradients. The Google Charts API is a great inspiration:

Before I re-invent the wheel is anyone aware of an existing effort I could leverage good sample code with something like this or project I could contribute too?
Thanks for any pointers.
| UIControl for a Needle Gauge aka Google O Meter | CC BY-SA 2.5 | 0 | 2010-09-30T00:42:51.583 | 2011-05-24T12:57:27.277 | 2017-02-08T14:30:28.347 | -1 | 296,003 | [
"iphone",
"uikit",
"uicontrol"
] |
3,827,125 | 1 | 3,827,332 | null | 8 | 10,573 | When faced by an untrusted certificate, every single browser I know displays a blaring error like this:

is that?
This strongly discourages web developers to use an awesome technology like SSL out of fears that users will find the website extremely shady. Ilegitimate (ie: phishing) sites do fine on HTTP, so that can't be a concern.
Why do they make it look like such a big deal? Isn't having SSL even if untrusted better than not having it at all?
---
It looks like I am being misunderstood. I am taking issue with the fact that HTTP sites cannot be more secure than an HTTPS site, even if untrusted. HTTP doesn't do encryption or identification. Phishers can make their sites on HTTP and no warnings are shown. In good faith, I am at the very least encrypting traffic. How can that be a bad thing?
| Why do browsers show ugly errors for untrusted SSL certificates? | CC BY-SA 2.5 | 0 | 2010-09-30T01:36:52.750 | 2010-10-03T23:02:14.877 | 2010-09-30T02:05:20.213 | 1,000,000 | 1,000,000 | [
"browser",
"ssl"
] |
3,827,308 | 1 | 3,827,782 | null | 8 | 2,485 | I am trying to get a better understanding about insertion speed and performance patterns in mysql for a custom product. I have two tables to which I keep appending new rows. The two tables are defined as follows:
```
CREATE TABLE events (
added_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
id BINARY(16) NOT NULL,
body MEDIUMBLOB,
UNIQUE KEY (id)) ENGINE InnoDB;
CREATE TABLE index_fpid (
fpid VARCHAR(255) NOT NULL,
event_id BINARY(16) NOT NULL UNIQUE,
PRIMARY KEY (fpid, event_id)) ENGINE InnoDB;
```
And I keep inserting new objects to both tables (for each new object, I insert the relevant information to both tables in one transaction). At first, I get around 600 insertions / sec, but after ~ 30000 rows, I get a significant slowdown (around 200 insertions/sec), and then a more slower, but still noticeable slowdown.
I can see that as the table grows, the IO wait numbers get higher and higher. My first thought was memory taken by the index, but those are done on a VM which has 768 Mb, and is dedicated to this task alone (2/3 of memory are unused). Also, I have a hard time seeing 30000 rows taking so much memory, even more so just the indexes (the whole mysql data dir < 100 Mb anyway). To confirm this, I allocated very little memory to the VM (64 Mb), and the slowdown pattern is almost identical (i.e. slowdown appears after the same numbers of insertions), so I suspect some configuration issues, especially since I am relatively new to databases.
The pattern looks as follows: 
I have a self-contained python script which reproduces the issue, that I can make available if that's helpful.
Configuration:
- -
[EDIT]
Thank you very much to Eric Holmberg, he nailed it. Here are the graphs after fixing the innodb_buffer_pool_size to a reasonable value: 
| Insertion speed slowdown as the table grows in mysql | CC BY-SA 2.5 | 0 | 2010-09-30T02:36:26.663 | 2010-09-30T05:18:23.323 | 2010-09-30T05:18:23.323 | 11,465 | 11,465 | [
"mysql",
"performance"
] |
3,827,484 | 1 | 3,827,708 | null | 1 | 443 | i have a list in Twwgrid as below:

i wan to delete the same stock at once with the right-click pop-up menu as shown above (eg. delete both OREO_CHOC_CREAM either is CTN or UNIT). But now i only can delete 1 by 1 with the code below, any idea to solve this problem?
```
procedure Tfrm1.mniDeleteClick(Sender: TObject);
begin
inherited;
with grdItems.DataSource.DataSet do begin
if (RecordCount <> 0) and (MessageBox( Application.Handle, 'Delete Record ?', 'Confirmation', MB_YESNO + MB_ICONQUESTION + MB_DEFBUTTON2 + MB_APPLMODAL) = IDYES) then
Delete;
end;
end;
```
| How to delete 2 items with same name at once from dataset? | CC BY-SA 2.5 | null | 2010-09-30T03:27:59.727 | 2010-09-30T04:22:53.097 | null | null | 367,856 | [
"delphi"
] |
3,827,586 | 1 | 3,828,121 | null | 1 | 296 | I have created a shared assemby MyLibray version 1.0.0.1 and installed it in gac. Again I created MyLibrary version 1.0.0.2 and installed it in gac.
See the gac screen shot.

But in Add Reference dialog box only older version 1.0.0.1 is available.
See the screenshot.

| Can't see an assembly in add reference dialog box after installing it in gac | CC BY-SA 2.5 | null | 2010-09-30T03:52:05.647 | 2011-06-18T14:02:09.707 | 2010-09-30T05:43:54.827 | 301,459 | 301,459 | [
"c#",
".net",
"vb.net"
] |
3,828,374 | 1 | null | null | 10 | 6,145 | [I don't understand](https://stackoverflow.com/questions/2557619)[best practice](https://stackoverflow.com/questions/503573)
I have a varchar field in a SQLServer database that is guaranteed to be longer than 7 chars.
I need to extract a char(4) field consisting of the 2nd, 3rd, 4th and 5th chars in the varchar.
For example if the varchar had the value 1234567890 I would be looking for the 2345 part.
Is there a performance benefit to using a substring over a right-left combo?
```
SELECT SUBSTRING(account,2,4) FROM payment
```
or
```
SELECT RIGHT(LEFT(account,5),4) FROM payment
```
I have noticed a advantage by using a right-left on a table with 1,760,335 records, but I am not sure if this is due to caching queries or the like.
I've done a bit more homework. It seems that in this case the Right-Left is ultimately performed as a Right-Substring. Is this a rule? or is it just the way SQLServer decided to skin this particular cat?

| Relative Performance in SQLServer of Substring vs a Right-Left combo | CC BY-SA 2.5 | 0 | 2010-09-30T06:45:08.480 | 2010-09-30T07:30:29.307 | 2017-05-23T10:30:23.117 | -1 | 939 | [
"sql-server",
"performance",
"substring"
] |
3,828,442 | 1 | 3,828,512 | null | 12 | 18,507 | I want to achieve this thing:

Height of table row and grey line should be dynamic depend on contents in right column.
I've read in [How to make <div> fill <td> height](https://stackoverflow.com/questions/3542090/how-to-make-div-fill-td-height), so I tried with this [http://jsfiddle.net/hyNWy/](http://jsfiddle.net/hyNWy/)
But still no luck. Any suggestions?
| Full height div inside td | CC BY-SA 2.5 | 0 | 2010-09-30T06:56:41.243 | 2011-11-12T23:52:12.173 | 2017-05-23T12:09:20.917 | -1 | 351,564 | [
"css"
] |
3,828,747 | 1 | 3,828,859 | null | 0 | 895 | For some reason I cannot seem to get IE8 to display my jqgrid right as you can see below. This isn't the only grid that doesn't display properly. I have another one in my project that renders just like the one below :(. Needless to say, I tried all sort of column widths, tried turning the scrollbars off etc etc. but nothing seems to improve the situation.
Am I missing something obvious ?
I am using the very latest JQgrid version 3.8.
Firefox:

Explorer:

| JQgrid not sizing properly in IE8 | CC BY-SA 2.5 | null | 2010-09-30T07:49:36.990 | 2010-09-30T08:10:31.243 | null | null | 31,489 | [
"javascript",
"jqgrid"
] |
3,828,809 | 1 | 3,828,885 | null | 6 | 9,533 | I double clicked on `EIP` in register window,but seems un-editable.
Why is `EIP` special?How can I change it?

| How to change value of EIP in ollydbg? | CC BY-SA 2.5 | 0 | 2010-09-30T07:58:34.397 | 2015-08-25T11:39:07.160 | null | null | 431,665 | [
"ollydbg"
] |
3,828,807 | 1 | null | null | 2 | 1,001 | I'm trying to get my application hidden to systray and the systray thing works fine, except my app won't disspaear from the taskbar. The icon seem to dissapear, but another icon pops up and when I click to show that window I get a windowframe but the contents aren't drawn.
```
def hideEvent(self, event):
self.trayIcon.show()
self.hide()
```
How does this not hide my window from the taskbar? It seems like the window contents are hidden but not the window itself. I'm running Windows 7.
Here's a screen showing how it looks after I've minimized it and then click on the icon that seem to pop up:

| Hide app from taskbar | CC BY-SA 2.5 | 0 | 2010-09-30T07:58:28.430 | 2010-12-27T10:20:10.867 | 2010-10-16T01:53:14.403 | 197,657 | 197,657 | [
"python",
"pyqt4"
] |
3,829,102 | 1 | 3,829,178 | null | 0 | 1,128 | 

How to get the result `77D507EA` manually from `DS:[0040207A]` according to register info above?

| How to calculate DS:[0040207A] manually? | CC BY-SA 2.5 | null | 2010-09-30T08:51:56.397 | 2010-10-08T09:25:19.290 | 2010-10-08T08:41:53.993 | 431,665 | 431,665 | [
"assembly",
"x86"
] |
3,829,243 | 1 | 3,829,280 | null | 8 | 3,111 | A hatch pattern is made from two colors: one defined by the BackgroundColor, which fills the background and one for the lines that form the pattern over the background defined by the ForegroundColor property. The [HatchStyle property](http://msdn.microsoft.com/en-us/library/system.drawing.drawing2d.hatchstyle.aspx) defines what type of pattern the brush has and can be any value from the HatchStyle enumeration. There are more than fifty elements in the HatchStyle enumeration.
The following illustration shows an ellipse filled with a horizontal hatch pattern.

[Just like for the colors defined in the Color class](http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/colors/ColorTable.htm), I'd like to have a graphical list of all styles defined in HatchStyle, but found none in the MSDN. Do you know of such a overview?
| Is there a graphical overview of the HatchStyle enumeration? | CC BY-SA 2.5 | null | 2010-09-30T09:12:46.720 | 2010-09-30T09:17:21.300 | null | null | 39,590 | [
".net",
"brush",
"drawing2d",
"hatchstyle"
] |
3,829,315 | 1 | 3,829,533 | null | 3 | 7,681 | I'm currently working on a WPF UI and I have a combobox on my window.
So I want the user to be able to select an item from this combobox but when it is selected
I don't want it to be highlighted in the default blue colour.
I assume there is some way to stop this in XAML but I have not been able to find the solution so far.
Thanks.
P.S. I don't have access to Expression Blend so if anyone suggests a solution could it be in XAML
EDIT: Just to make it clearer I by selected I mean once you have selected a value and the SelectionChanged event has fired and the item is displayed in the combobox and the combo box is highlighted like so:

| Stop highlighting selected item WPF ComboBox | CC BY-SA 2.5 | 0 | 2010-09-30T09:24:27.737 | 2010-09-30T13:06:47.590 | 2010-09-30T11:01:34.863 | 333,943 | 333,943 | [
"c#",
".net",
"wpf",
"combobox",
"wpf-controls"
] |
3,829,459 | 1 | 3,829,561 | null | 0 | 1,136 | I have the following collection ( see image ) . I wish to parse this into
List. I have tried NHibernate's "Transformers.AliasToBean"
Like so
var result = _session.CreateQuery(hql)
.SetResultTransformer(Transformers.AliasToBean(typeof(OrderProduct)))
.List();
Tho i'm getting the following error:
Could not find a setter for property '0' in class 'EStore.Domain.Projection.OrderProduct'
At this stage i would settle for just parsing this into the List. How can i do this with linq?
```
public class OrderProduct
{
public int Id { get; set; }
public string Name { get; set; }
public decimal Quantity { get; set; }
}
```
| parsing a dynamic collection | CC BY-SA 2.5 | 0 | 2010-09-30T09:47:12.287 | 2010-09-30T15:26:28.310 | null | null | 461,880 | [
"c#",
"linq",
"nhibernate",
"c#-4.0"
] |
3,829,572 | 1 | 3,829,604 | null | 0 | 495 | It seems i keep stumbling upon strange problems. I'm working on a sort of really simple lightbox thing, but now an image loads twice. I don't know if it's because of it is the center image or because it is stretched (while the rest isn't) but it don't work as it should.
I have this html
```
<ul>
<li><a href="largeImage1.jpg" class="box"><img src="smallImage1.jpg" id="image1"></a></li>
<li><a href="largeImage2.jpg" class="box"><img src="smallImage2.jpg" id="image1"></a></li>
<li><a href="largeImage3.jpg" class="box"><img src="smallImage3.jpg" id="image1"></a></li>
</ul>
```
Image 1 and three have a dimension of 800 x 553 while image 2 has a dimension of 400 x 600
I run this code
```
$("a").click(function(event){
$("#shadow").add($("#shadowContent"),$("#closeBox"),$("#imageSelectPrevious"),$("#imageSelectNext"),$("#content")).remove();
[..]
var parentEl = $(this).closest("ul");
var currPosition = $(this).parent().prevAll().length + 1;
var totalItems = $("#"+$(parentEl).attr("id")+" li").length;
var newImage = new Image();
$(newImage).load(function(){
newWidth = this.width, newHeight = this.height+35;
[.. Load transparent background other necessary html elements ..]
if(currPosition == totalItems){
var prevImageParentList = currPosition - 1;
var prevImage = $("#"+$(parentEl).attr("id")+" li:nth-child("+prevImageParentList+") a").attr("href");
$("#content").css({width:newWidth+'px',height:newHeight+'px',margin:'0'}).html("<div id='imageSelectPrevious'><a href='#' class='imageNavLink' title='"+prevImage+"'>Previous</a></div><img src='"+image+"' style='margin:0'></div>");
$("#imageSelectPrevious").add($(".imageNavLink")).css({height:this.height+'px'});
}else if(currPosition == 1){
var nextImageParentList = currPosition + 1;
var nextImage = $("#"+$(parentEl).attr("id")+" li:nth-child("+nextImageParentList+") a").attr("href");
$("#content").css({width:newWidth+'px',height:newHeight+'px',margin:'0'}).html("<div id='imageSelectNext'><a href='#' class='imageNavLink' title='"+nextImage+"'>Next</a></div><img src='"+image+"' style='margin:0'></div>");
$("#imageSelectNext").add($(".imageNavLink")).css({height:this.height+'px'});
}else{
var prevImageParentList = currPosition - 1;
var nextImageParentList = currPosition + 1;
var prevImage = $("#"+$(parentEl).attr("id")+" li:nth-child("+prevImageParentList+") a").attr("href");
var nextImage = $("#"+$(parentEl).attr("id")+" li:nth-child("+nextImageParentList+") a").attr("href");
$("#content").css({width:newWidth+'px',height:newHeight+'px',margin:'0'}).html("<div id='imageSelectPrevious'><a href='#' class='imageNavLink' title='"+prevImage+"'>Previous</a></div><div id='imageSelectNext'><a href='#' class='imageNavLink' title='"+nextImage+"'>Next</a></div><img src='"+image+"' style='margin:0'></div><img src='"+image+"' style='margin:0'></div>");
$("#imageSelectPrevious").add($("#imageSelectNext"),$(".imageNavLink")).css({height:this.height+'px',background:'red'});
}
$(".imageNavLink").click(function(event){
event.preventDefault();
alert(this.title);
});
});
});
```
The first and last images are working fine. If i click the link it alerts the appropriate image url, but the middle one doesn't do anything when i click the link and somehow it loads 2 images (seen screenshot (the red bars are just to check if the link is actually there))

Can anybody see what's going wrong here?
| Image somehow loads twice | CC BY-SA 2.5 | null | 2010-09-30T10:04:37.510 | 2010-09-30T10:25:18.303 | null | null | 450,454 | [
"jquery"
] |
3,829,841 | 1 | 4,126,553 | null | 26 | 99,576 | One of our customers has a hard time reading the grey text in disabled controls in our web-based application:

We would like to change the style to a light grey background and a black text. Unfortunately, most browsers (including IE, which is what the customer is using) ignore the `color: ...` CSS attribute on disabled controls, so we cannot change the foreground color.
For text boxes (`input type="text"`), this can easily be workarounded by using the `readonly` instead of the `disabled` attribute. Unfortunately, this is not an option for dropdowns (`select`) or checkboxes (`input type="checkbox"`).
Is there an easy workaround for that? Preferebly one where the control does not need to be replaced by another type of control? (...since our controls are rendered by ASP.NET)
PS: Using the `[disabled]` selector in CSS does not make a difference.
| Styling disabled <select> (dropdown boxes) in HTML | CC BY-SA 3.0 | 0 | 2010-09-30T10:48:10.450 | 2022-11-13T08:50:14.970 | 2013-09-06T05:02:32.293 | 87,698 | 87,698 | [
"html",
"css",
"accessibility"
] |
3,830,181 | 1 | 3,830,195 | null | 0 | 1,477 | I'm trying to create a website for myself and just ran into this issue:
 
As you can see there is some kind of selection visible in both images which
The first image is taken after I clicked the menu item.
The second image is taken after the first when I additionally move the mouse over it.
These menu items are shown in a table.
I am using FireFox 3.6.10.
Does anybody have an idea how to get rid of these selections?
| How to get rid of the selection box around my selection | CC BY-SA 2.5 | null | 2010-09-30T11:42:29.497 | 2010-09-30T11:47:17.220 | null | null | 453,895 | [
"html",
"css",
"html-table"
] |
3,830,514 | 1 | 3,830,546 | null | 0 | 603 | I'm following this tutorial on Flash Pro CS4:
[http://www.baycongroup.com/flashCS4/09_flashCS4.html](http://www.baycongroup.com/flashCS4/09_flashCS4.html)
I have a button. I pressed CTRL + E in this button, I clicked the 'hit' frame on the 'Text' layer and I created a new frame going in 'Insert > Timeline > frame' as said in the turorial. Like ins the image below.
But after I create a new Frame(F5), as said in the tutorial, the button disappears, like the image below.

So, what I'm doing wrong?
( Btw, is this kind of question allowed in SO? This is not exactly a source code question, but in the FAQ it's written that 'software tools commonly used by programmers' questions are also allowed. I don't know if Flash Professional would be a tool commonly used by but I thought wouldn't hurt asking.
Thanks in advance.
| Why my Flash button disappears (Flash Pro.)? | CC BY-SA 2.5 | null | 2010-09-30T12:37:17.367 | 2010-09-30T12:40:58.203 | null | null | 429,583 | [
"flash",
"actionscript-3",
"flash-cs4",
"flash-cs5"
] |
3,830,817 | 1 | 3,830,875 | null | 2 | 2,064 | I'm having a simple problem concerning the arrangement of floating divs with variables heights.
The goal:

The result:

I just have div containers with css float: left; and no height defined. The first red circle indicated that my technique fails, although the second one proves me wrong by showing it IS working. Unfortunately, the last (not on screenshots) just starts floating after the height of the previous one (so there's a whole empty space on the left).
How should i solve this?
Thanks!
| Float divs with variable heights (arrange) | CC BY-SA 3.0 | null | 2010-09-30T13:12:44.770 | 2012-05-17T19:42:34.183 | 2012-05-17T19:42:34.183 | 44,390 | 462,846 | [
"css",
"html",
"css-float"
] |
3,831,141 | 1 | 3,831,278 | null | 24 | 6,410 | 
Silly questions... purely aesthetic... given the picture above. How do you move the values up/down? For example, State belongs grouped with Height/Width/Top/Left (Window Position + state).
Not the only project where I later add stuff and it slowly gets out of order. Can delete/re-add, but that gets tedious and error prone. Can just leave it as is, but it's a minor annoyance.
Am I totally not seeting the setting somewhere to move the stuff around, because I've looked and I just don't see it.
| Visual Studio, Application Settings... rearrange | CC BY-SA 2.5 | 0 | 2010-09-30T13:47:23.080 | 2016-05-04T18:50:17.453 | null | null | 409,025 | [
"visual-studio",
"visual-studio-2010",
"application-settings"
] |
3,831,727 | 1 | 3,833,192 | null | 4 | 238 | I've been fiddling around with [CHESS](http://research.microsoft.com/en-us/projects/chess/), which seems like an incredibly useful tool. However, ironically, I seem to be dealing with a Heisenbug in one of my test methods. The results reported by CHESS when I run this test are unpredictable:
- - - -
Initially, I thought this inconsistency must be due to the fact that the test involves the use of `Random` objects. It must have been that different seed values were yielding different outcomes, right?
So I updated the test to simply run for a predefined set of seed values (0 to 10). Thread-local `Random` objects get seeded by a (pseudo-)random value produced by a shared `Random` within a lock. The code looks like this:

(: I am running this on .NET 3.5, as CHESS only supports VS 2008. I wonder if the problem could have something to do with [this](http://blogs.msdn.com/b/ericlippert/archive/2009/03/06/locks-and-exceptions-do-not-mix.aspx)?)
As I understand it, the above code should actually be pretty deterministic. Since `sharedRandom` is initialized with a known seed (between 0 and 10), the values produced by the `localRandom` object belonging to each thread running the code inside the `Parallel.For` call should be consistent from one test run to the next (which thread gets which seed from `sharedRandom` may differ between runs, but among the 5 iterations within `Parallel.For`, the same 5 seeds should be used for `localRandom`).
That's how understand it. But from the CHESS results, I'm inclined to believe I must be missing something.
1. Is there a deadlock in the above code that I'm too dumb to see?
2. Should I not be using the Random class in concurrency-related tests?
3. For those who have experience using CHESS: is it a reliable tool? Does it sometimes give false positives? This is actually a big one, as if it turns out that this scenario is common (inconsistent test results), then perhaps it'd be advisable for me to hold off on using CHESS at all for the time being.
| What could be causing a deadlock or otherwise causing this concurrency test to inconsistently fail? | CC BY-SA 2.5 | null | 2010-09-30T14:47:16.293 | 2019-08-17T18:46:32.187 | 2019-08-17T18:46:32.187 | 2,751,851 | 105,570 | [
".net",
"random",
"concurrency"
] |
3,831,891 | 1 | 3,849,087 | null | 4 | 2,403 | I need to be able to plot events on a vertical timeline and I like the way Google Calendar achieves this:

Currently I'm displaying the information with a ListView component, but this two practical drawbacks:
1. It's far from clear when there's a gap
2. Or, conversely, when there's an overlap
Both problems stem from the lack of representation of event length. This is the primary thing I'd like to rectify.
Is there a component available that will help me to do this? Else, does anyone have any suggestions for how I should go about making it from scratch?
I'm using C# and winforms.
| How could I represent a series of events like google calendar? | CC BY-SA 2.5 | null | 2010-09-30T15:04:53.733 | 2010-10-07T10:27:32.943 | 2010-09-30T15:11:46.337 | 50,151 | 50,151 | [
"c#",
".net",
"list",
"calendar",
"components"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.