Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
⌀ | ParentId
int64 1.68k
75.6M
⌀ | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
⌀ | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
⌀ | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
⌀ | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
⌀ | LastEditorUserId
int64 -1
21.3M
⌀ | OwnerUserId
int64 1
21.3M
⌀ | Tags
list |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4,601,318 | 1 | 4,601,384 | null | 1 | 1,047 | Sorry about the title. I'm not sure how to properly describe the problem.
I have four tables, tables A, B, X and D. A and B have a many-to-many relationship so I'm using X as the link table.
Here's the structure:

Assuming all I have is an ID corresponding to a row in table A, I want to select the rows in table B that match up with that ID plus a count of all rows in table D that have the same `b_id`. Eh, I suck at explaining in words.
Here's what I would like ( -- let's just say I have an "A"):
```
-------------------------------------------------------------
| b.id | (A COUNT of how many rows in D have a b_id = b.id) |
-------------------------------------------------------------
| 1 | 20 |
-------------------------------------------------------------
| 4 | 12 |
-------------------------------------------------------------
```
So, according to the above results, this particular "A" has two "B"s. One of those "B"s has 20 "D"s and the other has 12 "D"s.
How can I write a single query to give me the results I'm after (again, all I'm searching with is an ID in table A)?
| MySQL SELECT via xref table plus get count of another table's rows | CC BY-SA 2.5 | null | 2011-01-05T06:14:49.507 | 2011-01-05T07:17:57.927 | null | null | 21,677 | [
"mysql"
]
|
4,601,317 | 1 | 4,603,367 | null | 30 | 8,135 | My UI has an unordered list on the left. When a list item is selected, a `div` appears on the right of it. I'd like to have a curved where the `<li>` and the `<div>` meet. Some people call this a or an . See the white arrow in the image below.

To extend the blue `<li>` to the edge of the `<ul>`, I'm planning to do something like this:
```
li {
right-margin: 2em;
border-radius: 8px;
}
li.active {
right-margin: 0;
border-bottom-right-radius: 0;
border-top-right-radius: 0;
}
```
Is there a better way to extend the `<li>` to the edge of the `<ul>`? Obviously, I'll include the webkit and mozilla border radius CSS as well.
The main thing I'm unsure about is that underneath the bottom right corner of the active `<li>`. I have some ideas, but they seem like hacks. Any suggestions?
NOTE that the `<ul>` is indicated in grey, but it would be white in the real design. Also, I'm planning to use Javascript to position the `<div>` correctly when an `<li>` is selected.
| CSS to create curved corner between two elements? | CC BY-SA 2.5 | 0 | 2011-01-05T06:14:40.207 | 2016-12-20T09:15:14.370 | 2015-04-13T10:27:09.690 | 3,436,942 | 220,599 | [
"html",
"css",
"rounded-corners",
"css-shapes"
]
|
4,601,846 | 1 | null | null | 4 | 23,843 | how to make a text box like this?

I think all of use have seen this before and know its features.
| How to create a textbox to contains IPv4 address? | CC BY-SA 2.5 | null | 2011-01-05T07:49:34.687 | 2011-01-05T08:20:03.373 | null | null | null | [
"c#",
".net",
"winforms"
]
|
4,602,288 | 1 | 4,602,748 | null | 9 | 11,214 | I am using nunit 2.5.9.10348 and trying to extract the current test name in the TearDown event so I can assign a screengrab filename the test name however it is always null (see the attached image). The private _context variable does have the TestName however this is no use to me!
Has anyone had success using this new [TestContext](http://www.nunit.org/index.php?p=releaseNotes&r=2.5.7) functionality (from 2.5.7).

| Nunit - TestContext.CurrentContext.Test not working | CC BY-SA 2.5 | null | 2011-01-05T09:02:22.933 | 2011-01-27T22:43:21.477 | 2011-01-05T09:14:50.553 | 6,440 | 6,440 | [
"c#",
"unit-testing",
"nunit",
"nunit-2.5.9"
]
|
4,602,334 | 1 | 4,647,252 | null | 1 | 1,029 | I have a .Net 3.5 application installed on a server running Windows Server 2003 SP2, IIS 6.
Every few minutes the cache it clearing itself. This doesn't happen when the traffic is low.
This is the performance graph taken with Process Explorer, every drop in the graph is when the cache is cleared.

The system has 8GB of RAM.
In the same app pool there are several applications but the cache is not being reset at the same time.
The app pool doesn't have Memory Recycling turned on.

What should I check to find the problem?
| Why Does My ASP.NET Cache Keep Clearing Itself? | CC BY-SA 2.5 | null | 2011-01-05T09:08:21.570 | 2011-01-10T13:19:27.100 | 2011-01-10T13:18:57.087 | 113,589 | 113,589 | [
"caching",
".net-3.5",
"iis-6"
]
|
4,602,695 | 1 | null | null | 1 | 1,302 | I was asked if I can check some properties of SSL certificate during connection to improve performance.
Please see attached picture from PayPal website:

is there any way to read those values? If I'm able to get them by browsing the net with my browser, can I read them by connecting to the server using NSURLConnection, NSData or (most important) ASIHTTPRequest?
Of course the certificate I'm working on is valid, not self-signed/untrusted. Does this kind of verify do improve security in the application?
| Check SSL properties ASIHTTPRequest | CC BY-SA 3.0 | null | 2011-01-05T09:51:41.400 | 2013-12-17T19:57:58.567 | 2013-04-18T09:46:55.843 | 664,177 | 491,375 | [
"security",
"ssl",
"asihttprequest"
]
|
4,602,934 | 1 | null | null | 5 | 722 | I am using [Code Contracts](http://research.microsoft.com/en-us/projects/contracts/) together with the [Code Contracts Editor Extensions](http://visualstudiogallery.msdn.microsoft.com/en-us/85f0aa38-a8a8-4811-8b86-e7f0b8d8c71b) VS2010 add-in. I have a class that implements the `IEnumerable<T>` interface, and I've implemented an iterator block for the `GetEnumerator()` method. Above it, I can see the following inherited contract:
![ensures result != null ensures result.Model == ((IEnumerable)this).Model [Pure] public IEnumerator(of IBaseMessage) GetEnumerator() { ](https://i.stack.imgur.com/rh39r.png)
I understand the first and third contract requirement - `GetEnumerator()` must never return a null, and it must never cause a side-effect. But what does the second contract requirement mean? What is this `Model` property of `IEnumerator<T>` and of `IEnumerable`?
As Damien_The_Unbeliever pointed out in his comment, the contract for `IEnumerable<T>` and `IEnumerator<T>` are located in a seperate file, a Contracts Reference Assembly. Using [Reflector](http://www.red-gate.com/products/dotnet-development/reflector/), in the disassembly of the contract of those two interfaces (the full code is [here](http://pastebin.com/8sAmk7ee)), you can see the following:
```
[return: Fresh]
[Escapes(true, false), Pure, GlobalAccess(false)]
public IEnumerator GetEnumerator()
{
IEnumerator enumerator;
Contract.Ensures((bool) (Contract.Result<IEnumerator>() != null), null, "Contract.Result<IEnumerator>() != null");
Contract.Ensures((bool) (Contract.Result<IEnumerator>().Model == this.Model), null, "Contract.Result<IEnumerator>().Model == this.Model");
Contract.Ensures((bool) (Contract.Result<IEnumerator>().CurrentIndex == -1), null, "Contract.Result<IEnumerator>().CurrentIndex == -1");
return enumerator;
}
```
Interestingly, there's an additional contract in `GetEnumerator()` that isn't displayed by the editor extention:
```
Contract.Result<IEnumerator>().CurrentIndex == -1
```
And some additionaly mysteries (such as the `Fresh`, `Escapes` and `GlobalAccess` attributes).
| Code Contracts: IEnumerator<T>.GetEnumerator() weird inherited contract? | CC BY-SA 2.5 | 0 | 2011-01-05T10:18:21.240 | 2011-01-05T12:55:40.777 | 2011-01-05T12:20:54.847 | 149,265 | 149,265 | [
"c#",
"visual-studio-2010",
"ienumerable",
"code-contracts"
]
|
4,602,984 | 1 | 4,631,548 | null | 2 | 3,251 | I use the following code to display a tooltip
```
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataKeyNames="ID" DataSourceID="AccessDataSource1">
<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False"
ReadOnly="True" SortExpression="ID" />
<asp:BoundField DataField="datefu" HeaderText="date"
SortExpression="datefu" />
<asp:TemplateField HeaderText="title" SortExpression="titlefu">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("titlefu") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<a href="#" title="<asp:Literal ID="Label1" runat="server" Text='<%# Eval("fu") %>'/>"/>
<asp:Label ID="NamePatientLabel" runat="server" Text='<%# Eval("titlefu") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
```
display the following result

however when i edit the text as follows (making it bold and red in another gridview containing rich text editor)
i get the following (as a formatting result in the second grid view)

however when i view in the first gridview to display the tooltip i get the following reult

i really need your help to display the tooltip as rich text
although many people say that jquery is "very easy", please let me know if you have a solution other than jquery.
| How to display rich text in tooltip ASP.Net? | CC BY-SA 3.0 | 0 | 2011-01-05T10:23:09.193 | 2014-12-07T09:36:41.397 | 2014-12-07T09:36:41.397 | 521,066 | 521,066 | [
"asp.net",
"tooltip",
"richtext"
]
|
4,603,001 | 1 | 4,603,061 | null | 4 | 4,423 | I'm writing an application using WPF, and I need to make something that looks like the Visual Studio toolbox (please see pic). What control should I use for this?

| Is there a control in WPF similar to the Visual Studio toolbox? | CC BY-SA 2.5 | 0 | 2011-01-05T10:24:45.007 | 2011-01-05T10:34:41.370 | 2011-01-05T10:34:41.370 | 366,904 | 508,284 | [
"c#",
"wpf",
"xaml",
"wpf-controls"
]
|
4,603,070 | 1 | 4,603,118 | null | 3 | 1,472 | I want to commit my project to [https://code.google.com](https://code.google.com), but TortoiseSVN gives the following error:
> authorization failed: Could not authenticate to server: rejected Basic challenge ([https://personal-domain-mail-gadget.googlecode.com](https://personal-domain-mail-gadget.googlecode.com))

What is the solution for this error?
| Authorization error when using Google Code and TortoiseSVN | CC BY-SA 3.0 | 0 | 2011-01-05T10:32:45.103 | 2012-12-06T09:28:39.530 | 2012-12-06T09:28:39.530 | 761,095 | null | [
"svn",
"authentication",
"tortoisesvn",
"google-code"
]
|
4,603,076 | 1 | 4,603,160 | null | 16 | 6,666 | I have add-on installed

When I checks my application in Yslow I get which I don't know

I searched for relevant questions in SO and also Google I found this method appropriate
```
<?
header("Expires:".gmdate('D, d M Y H:i:s \G\M\T', time() + 3600));
header("Cache-Control: no-cache");
header("Pragma: no-cache");
ob_start();
session_cache_limiter('public');
session_start();
?>
<html>
```
But still it shows me same
As i am newbie I don't know much about .htaccess
Please help me improve applications performance
Thanks in advance
| Add Expire Headers in php can't make it work | CC BY-SA 3.0 | 0 | 2011-01-05T10:33:15.417 | 2013-04-03T16:40:24.453 | 2013-04-03T16:40:24.453 | 119,737 | 440,694 | [
"php",
"performance",
".htaccess",
"yslow"
]
|
4,603,383 | 1 | 4,605,023 | null | 2 | 1,390 | I wrote a perl script which uses some linux commands (`grep`, `ls` etc..). I can successfully run this from Cygwin or Linux. I want this task to be run periodically on a Windows Server which has Cygwin installed. I was planning to use Windows task scheduler. But I am not sure how to specify in a Windows bat file, that my perl script needs to be called in Cygwin mode?
EDIT: I tried the command by Glenn. When I tried running the perl script, it doesn't seem to respond. So I tried with a sample script: `test.sh`, which has the following two lines:
```
ls -l
cd ..
```
Here is the screen capture of what I am getting:

| How to specify in a bat file that a script needs to be called in Cygwin mode? | CC BY-SA 2.5 | 0 | 2011-01-05T11:09:42.527 | 2011-01-10T01:56:04.347 | 2011-01-05T19:20:10.250 | 263,266 | 263,266 | [
"perl",
"shell",
"cygwin",
"windows-server-2003",
"cmd"
]
|
4,603,457 | 1 | 4,604,611 | null | 16 | 4,214 | I am having a MKMapView of size 64x64. I am creating an image from map view using 'renderInContext:' method. And assigning the image to UITableViewCell's imageView. In normal iPhone, its showing the image correct. But in iPhone(Retina) its showing the image blurred. I am tesing this in simulator, not in actual device. I have attached the screen shots below.

The thumbnail in the left side, with rounded corners is the UITableViewCell's imageView. The thumbnail in the right side is MKMapView.
I am using the following code to get the image from map view.
```
UIGraphicsBeginImageContext(CGSizeMake(64, 64));
CGContextRef context = UIGraphicsGetCurrentContext();
[[mapView layer] renderInContext:context];
thumbnail_image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
```
Why this happens in iPhone(Retina)? How to fix this?
| MKMapView renderInContext - iPhone 4 (Retina) issue | CC BY-SA 3.0 | 0 | 2011-01-05T11:18:05.190 | 2011-10-19T12:49:33.330 | 2011-10-15T04:03:35.373 | 491,980 | 491,980 | [
"iphone",
"objective-c",
"ios"
]
|
4,603,851 | 1 | 4,604,206 | null | 2 | 512 | I have the highest layer called "" which is used to display picture. Then, I'm trying to use event menuCanvas_touchDown to lowest layer called "" which show my workspace menu. However, when I touch the picture, it go to menuCanvas_touchDown. It should be found at the menuCanvas layer.
```
<Canvas x:Name="menuCanvas"
TouchDown="menuCanvas_TouchDown" TouchUp="menuCanvas_TouchUp"
TouchMove="menuCanvas_TouchMove" TouchLeave="menuCanvas_TouchLeave"
TouchEnter="menuCanvas_TouchEnter"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
Background="Transparent"
IsManipulationEnabled="True">
<Canvas x:Name="drawCanvas"
TouchDown="drawCanvas_TouchDown" TouchUp="drawCanvas_TouchUp"
TouchMove="drawCanvas_TouchMove" TouchLeave="drawCanvas_TouchLeave"
TouchEnter="drawCanvas_TouchEnter"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
Background="Transparent"
IsManipulationEnabled="True">
<Canvas x:Name="canvas"></Canvas>
</Canvas>
</Canvas>
```

I want to touch picture and nothing happen to menuCanvas_touchDown event.
How do I solve this problem? I'm trying to use e.handle, but it break the manipulation of the picture.
Thanks
There are drawCanvas_TouchDown and drawCanvas_TouchUp code.
```
private void drawCanvas_TouchDown(object sender, TouchEventArgs e)
{
if (state == (int)STATE.Pen)
{
if (_activeStrokes.TryGetValue(e.TouchDevice.Id, out stroke))
{
FinishStroke(stroke);
return;
}
// Create new stroke, add point and assign a color to it.
Stroke newStroke = new Stroke();
newStroke.Color = _touchColor.GetColor();
newStroke.Id = e.TouchDevice.Id;
// Add new stroke to the collection of strokes in drawing.
_activeStrokes[newStroke.Id] = newStroke;
}
}private void drawCanvas_TouchUp(object sender, TouchEventArgs e)
{
// Find the stroke in the collection of the strokes in drawing.
if (state == (int)STATE.Pen)
{
if (_activeStrokes.TryGetValue(e.TouchDevice.Id, out stroke))
{
FinishStroke(stroke);
}
}
}
```
| WPF layer event separation | CC BY-SA 2.5 | 0 | 2011-01-05T12:12:09.133 | 2011-01-05T12:56:55.293 | 2011-01-05T12:46:42.963 | 556,917 | 556,917 | [
"c#",
"wpf",
"canvas"
]
|
4,604,222 | 1 | 4,632,283 | null | 2 | 2,515 | I am not able to properly align the controls in a group in custom ribbon in Word 2007.

In the above screenshot you can notice the textboxes and the dropdowns are not properly aligned. Following is my CustomUI ribbon XML:-
```
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="RibbonLoad">
<ribbon>
<tabs>
<tab id="tabZZZZ" label="ZZZZ">
<group id="grpItems" label="Items">
<dropDown id="ddlQQQ" getItemLabel="qqqq" onAction="rrrr" label="zzzz zzzzz">
<item id="item1" label="item1"/>
</dropDown>
<editBox id="editAAA1" label="AAAAA AAAAA AAAAA" onChange="ZZZ" />
<editBox id="editBBBB" label="BBBB BBBBB BBBBB BBBBB" onChange="BBB" />
<separator id="separator1" />
<editBox id="editCCCC" label="CCCCCC CC CCCCCC CCCC" onChange="CCC" />
<dropDown id="ddlDDD" label="DDDDDDD DDDD DDDDDDDD DDDD" onAction="DDD" getItemLabel="DDD">
<item id="Item1" label="Item1"/>
</dropDown>
<button id="btnEEE" label="EEEEEEEEEEEEEE" onAction="EEEE"/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
```
My apologies for such weird names for labels. However, the number of characters in each label in the above XML is same that for the actual labels I am using. Could anyone please advice?
| Word 2007 Ribbon - Properly aligning controls in a group | CC BY-SA 2.5 | 0 | 2011-01-05T12:58:02.520 | 2011-01-08T04:11:03.857 | null | null | 255,562 | [
"ms-word",
"ribbon",
"ribbon-control"
]
|
4,604,265 | 1 | 4,604,377 | null | 0 | 1,682 | I am creating CMC pages from the admin side. I have a 3 level menu in the front end. My database table structure for CMS pages has the fields `name`, `parent_id`, `description`, `status`.
Now I have to display all pages, subpages and subpages of subpages in the menu. How to write this query?
```
<!-- BEGIN Menu -->
<ul id="nav">
<li><a href="consumers.php">Consumers</a>
<ul><li><a href="personal_finance.php">Personal Finance </a>
<ul><li><a href="personal_financial_makeover.php">Personal Financial Makeover</a></li>
<li><a href="personal_finance_consultancy.php">Personal Finance Consultancy</a></li>
</ul>
</li>
<li><a href="investings.php">Investings</a>
<ul>
<li><a href="securities_analysis.php">Securities Analysis</a></li>
<li><a href="portfolio_investment.php">Bernie Madoff Shield (Portfolio and Investment Analysis)</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="entrepreneurs.php">Entrepreneurs</a>
<ul>
<li><a href="market_analysis.php">Market Analysis and Competitive Report </a></li>
<li><a href="business_plans_feasibility.php">Business Plans & Feasibility Studies </a>
<ul>
<li><a href="business_plans.php">Business Plans</a>
<ul>
<li><a href="level1.php">Level 1</a></li>
<li><a href="level2.php">Level 2</a></li>
<li><a href="level3.php">Level 3</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<!-- END Menu -->
```
---
as you said i tried. i have home page. it doesnot have childs. still its getting empty dropdown menus. and next displaying firstlevel menus correctly. and also displaying secondlevel menus. actually mouse over on firstlevel menus dropdown appear. i am getting dropdown. upto now fine. but dispalying menu names openly. see my attachment please. i was attached 2images. in first images directly displaying like this. in second image on mouseover on firstlevel displaying dropdown.

```
<?
$query = "SELECT
t1.auto_id AS l1_id, t1.name AS l1_name
,t2.auto_id AS l2_id, t2.name AS l2_name
,t3.auto_id AS l3_id, t3.name AS l3_name
FROM static_pages AS t1
LEFT JOIN static_pages AS t2 ON t2.parent_id = t1.auto_id
LEFT JOIN static_pages AS t3 ON t3.parent_id = t2.auto_id";
$result = mysql_query( $query );
$results = array() ;
while($row=mysql_fetch_assoc($result)){
$results[] = $row;
}
// Building the menu. Quick and dirty.
$menu = array() ;
foreach( $results as $result ) {
$menu_level_3 = array( 'auto_id' => $result['l3_id'], 'name' => $result['l3_name'], 'children' => array() ) ;
$menu_level_2 = array( 'auto_id' => $result['l2_id'], 'name' => $result['l2_name'], 'children' => array( $menu_level_3['auto_id'] => $menu_level_3 ) ) ;
$menu_level_1 = array( 'auto_id' => $result['l1_id'], 'name' => $result['l1_name'], 'children' => array( $menu_level_2['auto_id'] => $menu_level_2 ) ) ;
if( !isset( $menu[$menu_level_1['auto_id']] ) ) {
$menu[$menu_level_1['auto_id']] = $menu_level_1 ;
} elseif( !isset( $menu[$menu_level_1['auto_id']]['children'][$menu_level_2['auto_id']] ) ) {
$menu[$menu_level_1['auto_id']]['children'][$menu_level_2['auto_id']] = $menu_level_2 ;
} else {
$menu[$menu_level_1['auto_id']]['children'][$menu_level_2['auto_id']]['children'][$menu_level_3['auto_id']] = $menu_level_3;
}
}
?>
<ul id="nav">
<? foreach($menu as $item0) : ?>
<li>
<a href="?page=<?=$item0['auto_id']?>"><?=$item0['name']?></a>
<? if(!empty($item0['children'])){?>
<ul>
<? foreach($item0['children'] as $item1) : ?>
<li>
<a href="?page=<?=$item1['auto_id']?>"><?=$item1['name']?></a>
<? if(!empty($item1['children'])){?>
<ul>
<? foreach($item1['children'] as $item2) : ?>
<li><a href="?page=<?=$item2['auto_id']?>"><?=$item2['name']?></a></li>
<? endforeach; ?>
</ul>
<? }?>
</li>
<? endforeach; ?>
</ul>
<? }?>
</li>
<? endforeach;exit;?>
</ul>
```
| Menu display in php pages | CC BY-SA 3.0 | null | 2011-01-05T13:01:30.783 | 2011-08-05T18:39:53.087 | 2011-08-05T18:39:53.087 | 50,049 | 347,678 | [
"php",
"menu"
]
|
4,604,402 | 1 | 4,604,424 | null | 10 | 3,310 | I thinks that in this case A picture is worth a thousand words:

XAML:
```
<Grid>
<ItemsControl ItemsSource="{Binding Persons}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Name}" Background="LightBlue"/>
<TextBlock Text="{Binding Age}" Background="LightPink" Grid.Column="1"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
```
p.s - I don't want to set a specific with to the first column, but to give it the max with that it needs.
I've tried ColinE's link and done this:
```
<Grid.ColumnDefinitions>
<ColumnDefinition SharedSizeGroup="A" Width="Auto"/>
<ColumnDefinition />
</Grid.ColumnDefinitions>
```
but it didn't worked for me.
| How to align separate Grids created via templates along their columns / rows? | CC BY-SA 3.0 | 0 | 2011-01-05T13:15:47.273 | 2011-08-31T14:04:58.677 | 2011-08-31T14:04:58.677 | 546,730 | 138,627 | [
"wpf",
"grid-layout"
]
|
4,604,647 | 1 | 4,607,784 | null | 3 | 14,028 | In my iOS application, I want to provide a settings-view. "presentModalViewController" works very well:
```
ViewSettings *controller = [[ViewSettings alloc] initWithNibName:@"ViewSettings" bundle:nil];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:controller];
[self.navigationController presentModalViewController:navController animated:YES];
[controller release];
[navController release];
```
Unfortunately, I have to change my running code and create the ViewSettings including the UINavigationController in Interface Builder. Why? Long story, I'll explain it in the end of this thread...
I try to drag and drop an UINavigationController in my ViewSettings and create an IBOutlet to access it in my class. I give this controller to "presentModalViewController" but the application crashed...
What I'm doing wrong?
---
Error Message:
The error happens in the last line of this code:
```
ViewSettings *viewSettings = [[ViewSettings alloc] initWithNibName:@"ViewSettings" bundle:nil];
UINavigationController *navController = viewSettings.navigationController;
UINavigationBar *navBar = navController.navigationBar;
OwnNavigationBar *ownNavBar = (OwnNavigationBar *)navBar;
[ownNavBar drawHeaderImage:YES];
[self.navigationController presentModalViewController:navController animated:YES];
```
Detailed Error:
---
Thanks for your help!
Yes, navigationController is nil...
I think I add the UINavigationController in a wrong way... I put it in this window, because it was not possible to put it directly in my view:

How do I add the UINavigationController correct?
---
## PS: Why do I have to use IB? (you can skip this...)
I need an background image in my UINavigationBar. My first try was:
```
UIImage *image = [UIImage imageNamed: @"header.png"];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
[self.navigationController.navigationBar addSubview:imageView];
[self.navigationController.navigationBar sendSubviewToBack:imageView];
```
But in some issues, the title oder a UIBarButton is not visible! I tried a lot, e.g. sets the "tag" of the view and sendSubviewToBack in each view, but no success. This is a very annoying bug!
My second try was to create a category and overwrite the drawRect-method:
```
@implementation UINavigationBar(MyNavigationBar)
- (void)drawRect:(CGRect)rect {
UIImage *image = [UIImage imageNamed: @"header.png"];
[image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
}
@end
```
But now, all of my UINavigationBars have an background image and I can't deactivate it. The problem is, that "ViewSettings" needs the background image, but the following pushed views do not.
Unfortunately, it isn't possible to set a property in a category or call [super drawRect:rect] to avoid painting the image.
My last try is to write an own UINavigationBar
```
@interface OwnNavigationBar : UINavigationBar {
BOOL _drawHeaderImage;
}
```
Now I can control the drawRect-method!! GREAT!!
```
- (void)drawRect:(CGRect)rect {
if (_drawHeaderImage) {
UIImage *image = [UIImage imageNamed: @"header.png"];
[image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
}
else {
[super drawRect: rect];
}
}
```
But I celebrate to early... :-(
It isn't possible to set an own UINavigationBar in the UINavigationController!!!
"navigationBar" in UINavigationController is a read-only property!
AAAAHHHHHHHHHH!
I have one last chance: in Interface Builder it is possible to give an UINavigationController an own UINavigationBar!!
YES! I GOT IT!! :-)
I configured it in my MainWindow_iPhone.xib and it works great!
Now, I have to implement this for my ViewSettings, because this (modal) view needs a new UINavigationController.
| How to create an UIViewController with UINavigationController with Interface Builder? | CC BY-SA 2.5 | 0 | 2011-01-05T13:39:15.823 | 2011-01-07T16:38:31.300 | 2011-01-06T08:38:39.707 | 509,535 | 509,535 | [
"iphone",
"objective-c",
"ios",
"interface-builder",
"uinavigationcontroller"
]
|
4,604,684 | 1 | 4,604,856 | null | 0 | 800 | This html:
```
<html>
<head></head>
<body style="width:100%;">
<table style="width:100%;">
<tr>
<td>foo</td>
<td>bar</td>
<td>fizz</td>
<td>buzz</td>
</tr>
</table>
</body>
</html>
```
Draws:

is that I need something like this:

- - -
Any suggestions how to make this right?
| Html table column issue | CC BY-SA 2.5 | null | 2011-01-05T13:43:35.930 | 2011-01-05T14:33:21.530 | null | null | 82,062 | [
"html",
"css"
]
|
4,604,744 | 1 | 4,605,100 | null | 8 | 907 | We have a facebook page.In which we want to design Discussion Tab.We Want to design each topic view.one more question we have Can we restrict users to create a new topic?we want only admin can create a discussion.I have attached a image we want each image in separate discussion topic.for ex if we have 2 topic 1st->net & 2nd->php so we want to design both discussion topic page. I have tried a lot but not getting exact answer,Please help me to solve the issue.
Thanks in advance.
| How to design a discussion tab on a facebook page? | CC BY-SA 2.5 | null | 2011-01-05T13:48:55.387 | 2011-01-05T14:23:26.160 | null | null | 307,989 | [
"facebook"
]
|
4,604,834 | 1 | null | null | 0 | 994 | Hi I want to create a tree structure in a sql database. I need to have the following properties.
- - - - - -

I have looked at Materialized-Path and hierarchyId, but most examples use a sample like AdventureWorks, that’s just too complicated, for my need.
Just for the record I use Sql Server 2008 R2 and C# 4.0
| Represent tree structure in Sql Server including Virtual paths | CC BY-SA 2.5 | null | 2011-01-05T13:58:05.637 | 2012-05-20T22:51:20.693 | null | null | 363,274 | [
"sql",
"sql-server",
"hierarchy",
"hierarchyid",
"materialized-path-pattern"
]
|
4,605,015 | 1 | null | null | 3 | 1,143 | I wrote an application which detects a square within an image. To give you a good understanding of how such an image containing such a square, in this case a marker, could look like:

What I get, after the detection, are the coordinates of the four corners of my marker. Now I don't know how to display an object on my marker. The object should have the same rotation/angle/direction as the marker.
Are there any papers on how to achieve that, any algorithms that I can use that proofed to be pretty solid/working?
It doesn't need to be a working solution, it could be a simple description on how to achieve that or something similar. If you point me at a library or something, it should work under linux, windows is not needed but would be great in case I need to port the application at some point.
I already looked at the ARToolkit but they you camera parameter files and more complex matrices while I only got the four corner points and a single image instead of a whole video / camera stream.
| Computing orientation of a square and displaying an object with the same orientation | CC BY-SA 2.5 | 0 | 2011-01-05T14:15:03.357 | 2011-01-08T19:05:12.013 | 2011-01-05T14:24:56.840 | 388,987 | 388,987 | [
"c++",
"opengl",
"opencv",
"augmented-reality",
"photogrammetry"
]
|
4,605,299 | 1 | null | null | 0 | 1,225 | I have developed on plugin by using google chrome extension API.
By using "Load unpacked extension" button I can install the my plugin in to chrome browser,
I will get 3 option in the "Reload", "Disable" and "Uninstall".
How can I disable Reload option for my extension. I am attaching the image for reference

Thanks.
| how to disable reload option in chrome extension | CC BY-SA 2.5 | null | 2011-01-05T14:42:25.923 | 2011-06-24T06:23:45.477 | 2020-06-20T09:12:55.060 | -1 | 529,041 | [
"google-chrome-extension"
]
|
4,605,325 | 1 | 4,607,824 | null | 15 | 13,047 | I'm beating my head against a wall here, and I'm fairly certain I'm doing something stupid, so time to make my stupidity public.
I'm trying to take two images, blend them together into a third image using standard blending algorithms (Hardlight, softlight, overlay, multiply, etc).
Because Android does not have such blend properties build in, I've gone down the path of taking each pixel and combine them using an algorithm. However, the results are garbage. Below is the results of a simple multiply blend (images used, and expected result).
BASE: 
BLEND: 
EXPECTED RESULT: 
GARBAGE RESULT: 
Any help would be appreciated. Below is the code, which I've tried to strip out all the "junk", but some may have made it through. I'll clean it up if something isn't clear.
```
ImageView imageView = (ImageView) findViewById(R.id.ImageView01);
Bitmap base = BitmapFactory.decodeResource(getResources(), R.drawable.base);
Bitmap result = base.copy(Bitmap.Config.RGB_565, true);
Bitmap blend = BitmapFactory.decodeResource(getResources(), R.drawable.blend);
IntBuffer buffBase = IntBuffer.allocate(base.getWidth() * base.getHeight());
base.copyPixelsToBuffer(buffBase);
buffBase.rewind();
IntBuffer buffBlend = IntBuffer.allocate(blend.getWidth() * blend.getHeight());
blend.copyPixelsToBuffer(buffBlend);
buffBlend.rewind();
IntBuffer buffOut = IntBuffer.allocate(base.getWidth() * base.getHeight());
buffOut.rewind();
while (buffOut.position() < buffOut.limit()) {
int filterInt = buffBlend.get();
int srcInt = buffBase.get();
int redValueFilter = Color.red(filterInt);
int greenValueFilter = Color.green(filterInt);
int blueValueFilter = Color.blue(filterInt);
int redValueSrc = Color.red(srcInt);
int greenValueSrc = Color.green(srcInt);
int blueValueSrc = Color.blue(srcInt);
int redValueFinal = multiply(redValueFilter, redValueSrc);
int greenValueFinal = multiply(greenValueFilter, greenValueSrc);
int blueValueFinal = multiply(blueValueFilter, blueValueSrc);
int pixel = Color.argb(255, redValueFinal, greenValueFinal, blueValueFinal);
buffOut.put(pixel);
}
buffOut.rewind();
result.copyPixelsFromBuffer(buffOut);
BitmapDrawable drawable = new BitmapDrawable(getResources(), result);
imageView.setImageDrawable(drawable);
}
int multiply(int in1, int in2) {
return in1 * in2 / 255;
}
```
| Blending pixels from Two Bitmaps | CC BY-SA 2.5 | 0 | 2011-01-05T14:44:39.850 | 2012-03-22T05:01:22.537 | 2011-01-06T16:46:21.230 | 157,921 | 157,921 | [
"android",
"bitmap",
"blending"
]
|
4,605,432 | 1 | 4,617,926 | null | 3 | 9,216 | I have two images that I want to display on top of each other. one image a single channel image and the second image is a RGB image but with most of the area being transparent.
How these two images are generated in different functions. I know to just display these on top of each other, i can use the same window name when calling `cvShowImage()` but this doesn't work when they are drawn from different functions. When trying this, I used `cvCvtcolor()` to convert he binary image from single channel to RGB and then displaying the second image from another function. But this didn't work. Both images are same dimension, depth and number of channels (after conversion).
I want to avoid passing in one image into the second function and then draw them. So I'm looking for a quick dirty trick to display these two images overlapped.
Thank you
EDIT:

| overlaying images when displaying in OpenCV | CC BY-SA 2.5 | null | 2011-01-05T14:55:35.327 | 2011-01-28T09:19:48.407 | 2011-01-05T15:32:27.867 | 354,502 | 354,502 | [
"image-processing",
"opencv",
"overlay",
"overlap"
]
|
4,605,649 | 1 | 4,608,909 | null | 3 | 1,521 | I am new to core-animationI am basing this on a previous post: [spin image clockwise/anticlockwise on touch](https://stackoverflow.com/questions/1547171/spin-image-clockwise-anticlockwise-on-touch)
Probably a basic question, but I just want the circle to spin a certain distance and then stop. When the animation ends, it reverts back to the original location.
How do I keep the item to stay where it's at when the animation ends?
---
What I really want is free floating wheel that responds to user swiping. When the user swipes to the left on the wheel, the wheel spins to the left. Depending on the speed of the swipe, the wheel spins faster and then starts to slow down. If anyone can give some hints or directions on this, I would be greatly appreciative.

| iPhone/iPad Spinner to keep animation | CC BY-SA 2.5 | 0 | 2011-01-05T15:16:13.720 | 2011-01-06T04:11:34.347 | 2017-05-23T12:30:36.930 | -1 | 217,187 | [
"iphone",
"ipad",
"ios",
"core-animation"
]
|
4,605,897 | 1 | 4,605,966 | null | 0 | 742 | I'm making a website and I have this HTML for a bar chart:
```
<div class="chart">
<meter style="height: 160px;">80%</meter>
<meter style="height: 86px;">43%</meter>
<meter style="height: 128px;">64%</meter>
<meter style="height: 172px;">86%</meter>
<meter style="height: 70px;">35%</meter>
<meter style="height: 52px;">26%</meter>
</div>
```
To make this into a nice bar chart, I use this CSS:
```
div.chart {
background-color: #343434;
height: 200px;
padding: 10px;
}
div.chart meter {
display: inline-block;
background-color: #892399;
border-top: solid 1px #AB34CB;
color: #FFFFFF;
outline: solid 1px #670034;
text-align: center;
width: 60px;
vertical-align: text-bottom;
}
```
Because none of the bars in the chart is 100%, and thus 200px, there is a gap between the bottom of the chart container and the bars:

The only way to fix this I could think of is either by using JavaScript, or by inserting some aweful div after the bars that has a width of 1px and `visibility: hidden;` set, but this screws up my HTML.
How can I fix this in another way while retaining my HTML as is?
---
By the way, this web app won't be used by any IE users so I don't care about that ancient piece of %&@# either :)
| Vertical-align with non-full height children of div | CC BY-SA 2.5 | null | 2011-01-05T15:37:31.357 | 2011-01-05T16:02:24.667 | null | null | null | [
"html",
"css",
"vertical-alignment"
]
|
4,606,357 | 1 | 4,606,712 | null | 1 | 1,469 | Given:
[http://chart.apis.google.com/chart?chxr=0,0,21|1,0,320&chxt=x,y&chs=600x500&cht=s&chco=c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|000000|000000|000000|000000|000000|000000|000000|000000|000000|000000|000000|000000|000000|000000|000000|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0&chd=t:5,5,5,5,10,5,5,5,5,10,19,29,14,14,24,62,24,5,19,10,10,24,10,14,10,29,14,24,100,14,10,10,19,24,52,14,24,43,29,14,24,24,10,19,29,24,19,29,10,38,5,5,5,24,10,10,24,52,14,14,14,10,10,5,19,10,5,14,14,10,14,19,14,19,10,5,5,10,10,10,10,24,10,5,5,5,5,10,14,24,5,5,10,5,14,14,5,5,14,5,29,10,14,5,14,10,62,10,10,19,5,5|3,2,4,4,4,10,4,10,5,100,24,56,52,69,52,75,42,29,41,35,25,35,53,45,52,75,51,75,100,53,29,75,32,83,100,62,83,100,38,29,56,62,42,62,29,39,53,32,32,48,43,20,28,37,41,27,34,43,41,17,37,17,42,22,59,24,23,47,23,43,19,50,50,47,44,43,42,42,40,40,38,37,35,35,35,35,34,34,34,33,29,26,23,22,24,35,16,20,29,25,25,21,11,16,21,23,16,20,15,22,16,23](http://chart.apis.google.com/chart?chxr=0,0,21|1,0,320&chxt=x,y&chs=600x500&cht=s&chco=c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|000000|000000|000000|000000|000000|000000|000000|000000|000000|000000|000000|000000|000000|000000|000000|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0|c0c0c0&chd=t:5,5,5,5,10,5,5,5,5,10,19,29,14,14,24,62,24,5,19,10,10,24,10,14,10,29,14,24,100,14,10,10,19,24,52,14,24,43,29,14,24,24,10,19,29,24,19,29,10,38,5,5,5,24,10,10,24,52,14,14,14,10,10,5,19,10,5,14,14,10,14,19,14,19,10,5,5,10,10,10,10,24,10,5,5,5,5,10,14,24,5,5,10,5,14,14,5,5,14,5,29,10,14,5,14,10,62,10,10,19,5,5|3,2,4,4,4,10,4,10,5,100,24,56,52,69,52,75,42,29,41,35,25,35,53,45,52,75,51,75,100,53,29,75,32,83,100,62,83,100,38,29,56,62,42,62,29,39,53,32,32,48,43,20,28,37,41,27,34,43,41,17,37,17,42,22,59,24,23,47,23,43,19,50,50,47,44,43,42,42,40,40,38,37,35,35,35,35,34,34,34,33,29,26,23,22,24,35,16,20,29,25,25,21,11,16,21,23,16,20,15,22,16,23)
Which produces:

I'm having trouble forcing the black dots to the top, does anyone know how I can achieve this?
| Google Charts API Z-index | CC BY-SA 2.5 | 0 | 2011-01-05T16:15:18.113 | 2011-01-05T17:30:46.370 | null | null | 356,635 | [
"z-index",
"positioning",
"google-visualization"
]
|
4,606,386 | 1 | 4,608,693 | null | 2 | 2,262 | I'm using [zipfile](http://docs.python.org/library/zipfile.html) and [tarfile](http://docs.python.org/library/tarfile.html) Python modules to open, extract and compress archives.
I need to display the archive structure in a QTreeWidget, and I don't know how to go on. To get the infos I use the function `infos(path)` from [this file](https://gist.github.com/766505).
I would like to obtain something like this (from Ark):

For example, if I receive this filenames: `('GCI/PyFiles/prova3.py', 'GCI/', 'GCI/PyFiles/', 'GCI/Screenshots/', 'GCI/prova2.py', 'prova.py')`, I'd like to obtain this:
```
- prova.py
- GCI/
|
|- prova2.py
|- PyFiles/
|- prova3.py
|- Screenshots/
```
in my QTreeWidget.
Thank you,
rubik
| Directory tree in a QTreeWidget | CC BY-SA 2.5 | null | 2011-01-05T16:18:06.583 | 2011-01-05T20:08:47.390 | null | null | 448,496 | [
"python",
"directory",
"pyqt4",
"qtreewidget"
]
|
4,606,438 | 1 | 4,606,459 | null | 2 | 5,906 | I have designed an analog clock control. It uses the stroke from two ellipses to represent an outer border and an inner border to the clock face.

I have exposed properties in the UserControl that allow a user to alter the thickness of these two borders. The Ellipse.StrokeThickness properties are then bound to these UserControl properties. At the moment, I am binding the UserControl property for the outer border thickness to the margins of the inner elements so that they are not hidden when the border size is increased.
```
<Ellipse Name="OuterBorder" Panel.ZIndex="1" StrokeThickness="{Binding OuterBorderThickness,
ElementName=This}" Stroke="{StaticResource OuterBorderBrush}" />
<Ellipse Name="InnerBorder" Panel.ZIndex="5" StrokeThickness="{Binding InnerBorderThickness,
ElementName=This}" Margin="{Binding OuterBorderThickness, ElementName=This}"
Stroke="{StaticResource InnerBorderBrush}">
...
<Ellipse Name="Face" Panel.ZIndex="1" Margin="{Binding OuterBorderThickness, ElementName=This}"
Fill="{StaticResource FaceBackgroundBrush}" />
...
```
The problem is that if the inner border thickness is increased, this does not affect the margins and so the hour ticks and numbers can become partially obscured or hidden. So what I really need is to be able to bind the margin properties of the inner controls to the sum of the inner and outer border thickness values (they are of type double).
I have done this successfully using 'DataContext = this;', but am trying to rewrite the control without this as I hear it is not recommended. I also thought about using a converter and passing the second value as the ConverterParameter, but didn't know how to bind to the ConverterParameter. Any tips would be greatly appreciated.
EDIT>>
Thanks to Kent's suggestion, I've created a simple MultiConverter to add the input values and return the result. I've hooked the SAME multibinding with converter XAML to both a TextBlock.Text property and the TextBlock.Margin property to test it.
```
<TextBlock>
<TextBlock.Text>
<MultiBinding Converter="{StaticResource SumConverter}" ConverterParameter="Add">
<Binding Path="OuterBorderThickness" ElementName="This" />
<Binding Path="InnerBorderThickness" ElementName="This" />
</MultiBinding>
</TextBlock.Text>
<TextBlock.Margin>
<MultiBinding Converter="{StaticResource SumConverter}" ConverterParameter="Add">
<Binding Path="OuterBorderThickness" ElementName="This" />
<Binding Path="InnerBorderThickness" ElementName="This" />
</MultiBinding>
</TextBlock.Margin>
</TextBlock>
```
I can see the correct value displayed in the TexBlock, but the Margin is not set. Any ideas?
EDIT >> >>
Interestingly, the Margin property can be bound to a data property of type double, but this does not seem to apply within a MultiBinding. As advised by Kent, I changed the Converter to return the value as a Thickness object and now it works. Thanks Kent.
| How to bind to the sum of two data bound values in WPF? | CC BY-SA 2.5 | null | 2011-01-05T16:22:22.530 | 2011-09-27T16:28:24.287 | 2011-01-05T20:50:05.503 | 249,281 | 249,281 | [
"wpf",
"sum",
"data-binding"
]
|
4,606,680 | 1 | 4,612,946 | null | 15 | 9,187 | I'm creating a drawing app ( text ) for the iPad using OpenGL. I've already had a look at Apple's example GLPaint, and my app is now based on that code. My app should be just for drawing text, not for painting pictures.
Well, my App works, I can write some text. But the writing isn't really good, it doesn't make fun to write. The drawing path isn't smooth, it's angularly because I'm drawing a line from one point to another. And the path has everywhere the same width. My idea is: when you're writing fast the line is thinner than when you're writing slow. It should be the same experience like writing with a real pen.
How can I make the path look much smoother? How can I vary the width of the line depending on the speed of writing?
Here you can see what I mean:

| Drawing app on iPad using OpenGL | CC BY-SA 2.5 | 0 | 2011-01-05T16:43:02.240 | 2012-03-27T14:04:13.753 | 2011-04-09T00:21:33.973 | 44,729 | 264,529 | [
"iphone",
"xcode",
"ipad",
"opengl-es",
"drawing"
]
|
4,606,885 | 1 | 4,606,904 | null | 2 | 1,524 | I want to change the background of a MenuItem when the MenuItem is pressed.
```
<Style x:Key="{x:Type MenuItem}" TargetType="MenuItem">
<Style.Triggers>
<Trigger Property="MenuItem.IsPressed" Value="True">
<Setter Property="MenuItem.Background" Value="#FFE389" />
<Setter Property="MenuItem.BorderBrush" Value="#C2762B" />
</Trigger>
</Style.Triggers>
</Style>
```
I tried doing the above, but the trigger does not seem to work. Is the Trigger wrong?
Update: It works for the event IsMouseOver but IsPressed does not seem to work
Update 2: It works for TopLevelMenuItems but does not work for TopLevelMenuHeaderItems.

| Unable to set Background property of MenuItem for IsPressed event | CC BY-SA 2.5 | 0 | 2011-01-05T17:04:54.787 | 2011-01-05T17:58:40.820 | 2011-01-05T17:45:03.517 | 504,310 | 504,310 | [
"wpf",
"wpf-controls",
"styling"
]
|
4,607,107 | 1 | 4,607,483 | null | 3 | 4,781 | Is there a way to change the selection color of a checkbox/radiobutton?

| Change JCheckBox/JRadioButton selection color | CC BY-SA 3.0 | 0 | 2011-01-05T17:25:04.823 | 2011-09-07T08:08:03.910 | 2011-09-07T08:08:03.910 | 418,556 | 347,833 | [
"java",
"swing",
"jcheckbox",
"jradiobutton",
"uimanager"
]
|
4,607,391 | 1 | 4,608,178 | null | 1 | 609 | Recently I was pulled into the boss-man's office and told that one of my queries was slowing down the system. I then was told that it was because my `WHERE` clause began with `1 = 1`. In my script I was just appending each of the search terms to the query so I added the `1 = 1` so that I could just append `AND` before each search term. I was told that this is causing the query to do a full table scan before proceeding to narrow the results down.
I decided to test this. We have a `user` table with around 14,000 records. The queries were ran five times each using both phpmyadmin and PuTTY. In phpmyadmin I limited the queries to 500 but in PuTTY there was no limit. I tried a few different basic queries and tried clocking the times on them. I found that the `1 = 1` seemed to cause the query to be faster than just a query with no `WHERE` clause at all. This is on a live database but it seemed the results were fairly consistent.
I was hoping to post on here and see if someone could either break down the results for me or explain to me the logic for either side of this.

| MySQL queries testing WHERE clause search times | CC BY-SA 2.5 | 0 | 2011-01-05T17:50:40.470 | 2011-05-06T17:21:04.353 | 2011-05-06T17:21:04.353 | 135,152 | 376,386 | [
"mysql",
"sql",
"query-optimization",
"where-clause"
]
|
4,607,546 | 1 | null | null | 2 | 683 | I'm trying to make a Flex (Advanced)DataGrid component with some mechanism where the user can toggle the visibility of the columns. I've crudely implemented this by reading in the columns into the right-click menu, and when a column name is selected here, the visibility is toggled. It works, but it's not the most elegant solution.
Specifically, I'm trying to emulate the "datagrid" that Mozilla Thunderbird uses to display emails. Here is an image:

In the upper right, there is an icon over the scroll bar. If there is no scrollbar, the icon remains in the same place. When clicking the icon, it opens up a menu that shows all the possible columns, with the visible ones having a check mark next to them, like this:

Also, the scroll bar always appears under this button, never "pushing" it over into it's own column.
I'd like to re-create this in Flex. I believe the menu part and creating a column with a button headerRenderer is easy enough. But I can't figure out how (if at all possible) to do this with the scrollbar, because the scrollbar always seems to be "its own column". Any ideas or help would be appreciated. Thank you.
-
| adobe flex datagrid selectable columns | CC BY-SA 2.5 | 0 | 2011-01-05T18:06:04.527 | 2011-02-14T18:30:10.473 | null | null | 209,107 | [
"apache-flex",
"datagrid",
"selectable"
]
|
4,608,161 | 1 | 4,608,387 | null | 276 | 139,658 | After enabling `set mouse=a`, text copied inside of Vim will not paste outside of Vim. Does anybody know of a way to fix this?
Here, selecting text with the mouse turns on visual mode and disables the `Copy` option in the popup menu:

| Copying text outside of Vim with set mouse=a enabled | CC BY-SA 3.0 | 0 | 2011-01-05T19:06:36.680 | 2023-01-27T14:43:13.153 | 2017-09-02T17:24:08.650 | 1,037,526 | 350,789 | [
"vim",
"configuration",
"mouse",
"copy-paste"
]
|
4,608,262 | 1 | null | null | 0 | 1,031 | I am trying to extend a sample I found at [http://developer.android.com/resources/articles/layout-tricks-efficiency.html](http://developer.android.com/resources/articles/layout-tricks-efficiency.html). I am a brand new MonoDroid developer, just installed it yesterday, and trying to jump right into UI design and so far it is not clicking for me completely.
I have this main.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="?android:attr/listPreferredItemHeight"
android:padding="6dip">
<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_marginRight="6dip"
android:src="@drawable/icon" />
<TextView
android:id="@+id/secondLine"
android:layout_width="200dip"
android:layout_height="26dip"
android:layout_toRightOf="@id/icon"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:singleLine="true"
android:ellipsize="marquee"
android:text="Second line which is a long line of text and needs to scroll" />
<TextView
android:id="@+id/firstLine"
android:layout_width="200dip"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/icon"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_above="@id/secondLine"
android:layout_alignWithParentIfMissing="true"
android:singleLine="true"
android:ellipsize="marquee"
android:gravity="center_vertical"
android:text="First line" />
<Button
android:id="@+id/logonButton"
android:layout_width="50dip"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/secondLine"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:gravity="center_vertical"
android:text="Login" />
/>
</RelativeLayout>
```
What I am trying to do is have an icon on the left, 2 lines of text stacked in the middle and a button on the right. When I run this in my emulator I am seeing:

1. The second line is not scrolling.
2. The button does not show up.
Is there by any chance a simple WYSIWYG editor for layout? Or is there an app to give me a quick view of my layout XML? Something like FireBug in FireFox would be fine.
Barring the slim chance there are UI helpers for Droid, what am I doing wrong? :)
: I found and the button is not showing up at all (visible) though it does show in the heirarchy. [http://screencast.com/t/rdjaR0tCM6](http://screencast.com/t/rdjaR0tCM6)
| Newbie question: How do you layout an icon, 2 text lines and a button? | CC BY-SA 2.5 | null | 2011-01-05T19:16:41.193 | 2011-01-08T11:52:28.023 | 2011-01-08T11:52:28.023 | 1,320,510 | 86,555 | [
"android",
"android-layout",
"xamarin.android"
]
|
4,608,255 | 1 | 4,650,134 | null | 3 | 5,146 | I'm trying to draw contours around blobs in a binary image, however, sometimes, openCV draws a single contour around two distinct blobs. below is an example. How can i solve this issue?

Here it should draw two bounding boxes for the blob on the right and separately for the one of the left. I agree they are close but enough distance in between them. I'm only drawing External contours instead of the tree or list. I'm also using cvFindNextContour(contourscanner) as this is a easier implementation for my case.
Thanks
EDIT:
Image displayed in the "output" window is from a different function which does just image subtraction. Image displayed in the "contours" window is in the function pplfind(). "output" image is passed to img_con().
```
IplImage* img_con(IplImage* image){
int ppl;
CvMemStorage* memstr = cvCreateMemStorage();
IplImage* edges = cvCreateImage(cvGetSize(image),8,1);
cvCanny(image,edges,130,255);
CvContourScanner cscan = cvStartFindContours(image,memstr,sizeof(CvContour),CV_RETR_EXTERNAL,CV_CHAIN_APPROX_NONE,cvPoint(0,0));
ppl = pplfind(cscan,cvGetSize(image));
if (ppl !=0 )
printf("Estimated number of people: %d\n",ppl);
cvEndFindContours(&cscan);
cvClearMemStorage(memstr);
return edges;
}
int pplfind(CvContourScanner cscan, CvSize frSize){
ofstream file; char buff[50];
file.open("box.txt",ofstream::app);
int ppl =0;
CvSeq* c;
IplImage *out = cvCreateImage(frSize,8,3);
while (c = cvFindNextContour(cscan)){
CvRect box = cvBoundingRect(c,1);
if ((box.height > int(box.width*1.2))&&(box.height>20)){//&&(box.width<20)){//
ppl++;
cvRectangle(out,cvPoint(box.x,box.y),cvPoint(box.x+box.width,box.y+box.height),CV_RGB(255,0,50),1);
cvShowImage("contours",out);
//cvWaitKey();
}
//printf("Box Height: %d , Box Width: %d ,People: %d\n",box.height,box.width,ppl);
//cvWaitKey(0);
int coord = sprintf_s(buff,"%d,%d,%d\n",box.width,box.height,ppl);
file.write(buff,coord);
}
file.close();
cvReleaseImage(&out);
return ppl;
}
```
| OpenCV: Incorrect contour around blobs | CC BY-SA 2.5 | 0 | 2011-01-05T19:15:39.757 | 2020-12-21T15:33:42.537 | 2011-01-08T15:28:48.150 | 354,502 | 354,502 | [
"image-processing",
"opencv",
"contour",
"blobs"
]
|
4,608,278 | 1 | 7,737,475 | null | 16 | 33,173 | [According to quirks mode](http://www.quirksmode.org/css/display.html), internet explorer 8 does support table options for display property, but in this example it exhibits very strange behaviour
[http://jsfiddle.net/e3cUn/3/](http://jsfiddle.net/e3cUn/3/)
In a normal browser, inner image will be scaled to fit 150x150 box without changing dimension ratio (stretching).

But in IE8, outside box (blue one) will also stretch:

1) Have you seen anything like that? It seems to be related to `text-align:center`: removing this property fixes the problem, but I do need to center image (in non-ie browsers, at least).
2) If this can't be fixed properly, how can I provide a special `display` value for IE? I've seen a few examples on the web, like `#display: block;`, but all of them work up to IE7 only.
I know about `<!--[if IE 8]>` and similar commands to put in html, but I was actually looking for a way to do that in css file. Something like this
```
display: table-cell;
#display: block;
```
Second line isn't a comment, it overrides previous value for ie7 and below. (but not ie8)
Thanks!
| internet explorer 8 ignores width for 'display: table-cell' element | CC BY-SA 2.5 | 0 | 2011-01-05T19:18:17.290 | 2016-05-31T14:02:18.047 | 2011-02-01T17:42:35.077 | 330,565 | 330,565 | [
"html",
"css",
"internet-explorer",
"internet-explorer-8"
]
|
4,608,290 | 1 | 4,608,350 | null | 1 | 605 | Im new in WPF & Xaml
I dont know how to anchor how to dock...
On this screen gray is statusBar is docked but grid and menu is not all components are in canvas.
This is XAML
```
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="WpfApplication6.MainWindow"
x:Name="Window"
Title="MainWindow"
Width="640" Height="480">
<Grid x:Name="LayoutRoot">
<Canvas>
<StackPanel Height="40" Width="624" VerticalAlignment="Top" HorizontalAlignment="Center">
<Menu Height="39" Margin="1,0,0,0">
<Menu.Background>
<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="#FFF6F6F6" Offset="0.25"/>
<GradientStop Color="#FFEAE8E8" Offset="0.25"/>
<GradientStop Color="#FFDCD9D9" Offset="0.8"/>
<GradientStop Color="White" Offset="1"/>
</LinearGradientBrush>
</Menu.Background>
</Menu>
</StackPanel>
<StackPanel Height="356" Canvas.Top="44" Width="161" HorizontalAlignment="Left">
<Expander Header="Expander" Height="107">
<Grid Background="#FFE5E5E5"/>
</Expander>
</StackPanel>
<StackPanel Height="360" Canvas.Left="161" Canvas.Top="40" Width="463">
<DataGrid Height="361"/>
</StackPanel>
</Canvas>
<StackPanel Height="40" Margin="-1,0,0,0" VerticalAlignment="Bottom">
<StatusBar Height="40" Background="#FF897676"/>
</StackPanel>
</Grid>
```

| WPF & XAML problem | CC BY-SA 2.5 | null | 2011-01-05T19:19:59.567 | 2011-01-05T19:27:42.103 | null | null | 508,284 | [
"wpf",
"xaml",
"inkcanvas"
]
|
4,608,317 | 1 | null | null | 4 | 1,070 | I'm writing a Fluent NHibernate mapping for a legacy Oracle database. The challenge is that the tables have composite primary keys. If I were at total freedom, I would redesign the relationships and auto-generate primary keys, but other applications must write to the same database and read from it, so I cannot do it.
These are the two tables I'll focus on:

## Example data
```
Trips table:
1, 10:00, 11:00 ...
1, 12:00, 15:00 ...
1, 16:00, 19:00 ...
2, 12:00, 13:00 ...
3, 9:00, 18:00 ...
Faults table:
1, 13:00 ...
1, 23:00 ...
2, 12:30 ...
```
In this case, vehicle 1 made three trips and has two faults. The first fault happened during the second trip, and the second fault happened while the vehicle was resting. Vehicle 2 had one trip, during which a fault happened.
## Constraints
Trips of the same vehicle never overlap. So the tables have an because every fault either happens during a trip or it doesn't. If I wanted to join them in SQL, I would write:
```
select ...
from Faults left outer join Trips
on Faults.VehicleId = Trips.VehicleId
and Faults.FaultTime between Trips.TripStartTime and Trips.TripEndTime
```
and then I'd get a dataset where (one-to-many as I said).
Note that there is no Vehicles table, and I don't need one. But I did create a view that contains all VehicleIds from both tables, so I can use it as a junction table.
## What am I actually looking for?
The tables are huge because they cover years of data, and every time I only need to fetch a range of a few hours.
So I need a mapping and a criteria that will run something like the following SQL underneath:
```
select ...
from Faults left outer join Trips
on Faults.VehicleId = Trips.VehicleId
and Faults.FaultTime between Trips.TripStartTime and Trips.TripEndTime
where Faults.FaultTime between :p0 and :p1
```
Do you have any ideas how to achieve it?
Currently the application shouldn't write to the database, so persistence is not a must, although if the mapping supports persistence, it may help at some point in the future.
I know it's a tough one, so if you give me a great answer, you will be properly rewarded :)
Thank you for reading this long question, and now I only hope for the best :)
| Complex relationship between tables in NHibernate | CC BY-SA 2.5 | 0 | 2011-01-05T19:22:39.560 | 2016-09-27T16:28:46.200 | null | null | 326,370 | [
"c#",
"nhibernate",
"fluent-nhibernate",
"nhibernate-mapping",
"automapping"
]
|
4,608,867 | 1 | 4,609,992 | null | 2 | 2,236 | I've followed several tutorials and read official docs at code.google.com, but still didn't manage to resolve this thing.
I am creating simple service that'll check if user can be logged.
```
public interface LoginService extends RemoteService {
/**
* Checks, if user has valid login.
* @param user User's login.
* @return True if such a login is in the database.
*/
boolean isValidUser(User user);
}
```
And here is Async interface:
```
public interface LoginServiceAsync {
/**
* Checks, if user has valid login.
* @param user User's login.
* @param callback the callback to return True if such a login is in the database.
*/
void isValidUser(User user, AsyncCallback<Boolean> callback);
}
```
```
public class LoginServiceImpl extends RemoteServiceServlet implements LoginService {
/**
* serial version UID
*/
private static final long serialVersionUID = 1044980345057997696L;
/**{@inheritDoc} */
@Override
public boolean isValidUser(User user) {
boolean success = true; //TODO change
}
}
```
Now I have entry point class MailClient.java. I append here widget like:
`CustomWidgets.getLoginWidget(this); // access rootPanel and append widget`
Now I need to make actual call to my service,
```
LoginServiceAsync loginService = (LoginServiceAsync) GWT.create(LoginService.class);
User user = new User(boxName.getText(), boxPassword.getText());
AsyncCallback<Boolean> callback = new AsyncCallback<Boolean>() {
@Override
public void onFailure(Throwable caught) {
Window.alert(caught.getMessage()); //TODO change
}
@Override
public void onSuccess(Boolean result) {
Window.alert("success"); //TODO change
}
};
((ServiceDefTarget) loginService).setServiceEntryPoint(GWT.getModuleBaseURL()+"login"); // dunno what should be here
```
So to recap, .
Here's my MailClient.gwt.xml file:
```
<module>
<inherits name="com.google.gwt.user.User"/>
<inherits name="com.google.gwt.user.theme.standard.Standard"/>
<entry-point class="com.xorty.mailclient.client.MailClient"/>
<servlet path="/login"
class="com.xorty.mailclient.server.servlets.LoginServiceImpl" />
<inherits name="com.xorty.mailclient.MailClient"/>
<inherits name="com.xorty.mailclient.MailClient"/>
<inherits name="com.xorty.mailclient.MailClient"/>
<inherits name="com.xorty.mailclient.MailClient"/>
<inherits name="com.xorty.mailclient.MailClient"/>
</module>
```
My web.xml file:
```
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>MailClient.html</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>LoginService</servlet-name>
<servlet-class>com.xorty.mailclient.server.servlets.LoginServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>LoginService</servlet-name>
<url-pattern>/com.xorty.mailclient.MailClient/login</url-pattern>
</servlet-mapping>
</web-app>
```
And here is screenshot of project structure:

| Trouble with setting entry point for GWT service | CC BY-SA 3.0 | null | 2011-01-05T20:29:35.050 | 2014-02-03T14:16:16.130 | 2014-02-03T14:16:16.130 | 759,866 | 314,073 | [
"java",
"gwt"
]
|
4,609,601 | 1 | 4,609,723 | null | 0 | 164 | Has anyone ever seen an error similar to this?
""

The firebug console doesn't show any javascript errors.
| videoegg javascript unresponsive script | CC BY-SA 2.5 | null | 2011-01-05T21:56:01.353 | 2011-01-05T22:41:58.073 | 2011-01-05T22:41:58.073 | 467,453 | 467,453 | [
"javascript",
"ads"
]
|
4,609,825 | 1 | null | null | 6 | 7,033 | I want to draw a bitmap on a rectangle. I use the values below:
```
this.meshWidth = 1;
this.meshHeight = 1;
this.verts = new float[8];
this.points[0].x = (float)(this.getWidth()/4);
this.points[0].y = (float)(this.getHeight()/4);
this.points[1].x = (float)(this.points[0].x+this.getWidth()/2);
this.points[1].y = (float)(this.points[0].y);
this.points[2].x = (float)(this.points[0].x);
this.points[2].y = (float)(this.points[0].y+this.getHeight()/2);
this.points[3].x = (float)(this.points[1].x);
this.points[3].y = (float)(this.points[2].y);
```
points array is my vertex array.
my onDraw method
```
public void onDraw(Canvas canvas){
//canvas.drawBitmap(bitmap, 20,20, null);
Paint paint = new Paint();
paint.setColor(Color.BLUE);
canvas.drawLine(this.points[0].x, this.points[0].y, this.points[1].x, this.points[1].y, paint);
canvas.drawLine(this.points[1].x, this.points[1].y, this.points[3].x, this.points[3].y, paint);
canvas.drawLine(this.points[3].x, this.points[3].y, this.points[2].x, this.points[2].y, paint);
canvas.drawLine(this.points[2].x, this.points[2].y, this.points[0].x, this.points[0].y, paint);
canvas.drawBitmapMesh(this.bitmap, meshWidth, meshHeight, verts, 0, null, 0, null);
}
```
The output is this

I want to draw bitmap on rectangle surrounded with blue lines..
| How drawBitmapMesh works in android canvas | CC BY-SA 3.0 | 0 | 2011-01-05T22:23:19.687 | 2018-12-30T05:57:33.323 | 2012-11-06T16:16:24.257 | null | 459,904 | [
"android",
"canvas"
]
|
4,609,994 | 1 | 4,610,191 | null | 9 | 12,116 | Comparing must work on-the-fly, so this must be done via javascript or with php (will make javascript ajax request).
What I need is probably advanced difference showing, so it will be probably best if there is any kind of good supported library.
This picture shows exactly what I need >

I found this [http://ejohn.org/projects/javascript-diff-algorithm/](http://ejohn.org/projects/javascript-diff-algorithm/) (example [http://www.djsipe.com/js-diff/](http://www.djsipe.com/js-diff/)) which is ok, but doesn't support multiline? and it changes the whole word when only one character is different...
I tested php script ( [https://github.com/paulgb/simplediff/](https://github.com/paulgb/simplediff/) ) but it has flaws.
I found what i was looking for ( [http://code.google.com/p/google-diff-match-patch/](http://code.google.com/p/google-diff-match-patch/) )
| Compare 2 strings and display difference (php or javascript) | CC BY-SA 2.5 | 0 | 2011-01-05T22:48:49.023 | 2011-01-06T09:03:03.387 | 2011-01-06T09:03:03.387 | 67,332 | 67,332 | [
"php",
"javascript",
"jquery"
]
|
4,610,198 | 1 | 4,610,658 | null | 6 | 1,933 | I'm used to the iPhone API, and I used MBProgressHUD a lot in my iPhone applications, but since I started developing apps for the Mac I noticed that I can't use MBProgressHUD. Is there an alternative that will do the same job as the MBProgressHUD? I notice that apple has it in their OS as well.

| MBProgressHUD for Mac? - Cocoa | CC BY-SA 3.0 | 0 | 2011-01-05T23:14:29.500 | 2021-05-22T22:29:13.083 | 2018-03-14T16:25:15.960 | 1,033,581 | 158,088 | [
"macos",
"cocoa",
"hud"
]
|
4,610,224 | 1 | 4,622,531 | null | 1 | 1,342 | In [this question](https://stackoverflow.com/questions/4609478/combining-two-png-images-into-one-image-using-net/4609660#4609660) I managed to combine two .png images into one, and then display the result in a pictureBox image.
However, the pictureBox seems to scale up my image! Makes it bigger!
The pictureBox size is 96x128.
The two images I have combined are 96x128.
The pictureBox's SizeMode is set to "Normal"
I have noticed that even though the pictureBox's image seems to be zoomed, it is cut to keep the 96x128 rect. But I don't want it to be zoomed...
Thanks.

resourcesPath is simply the main path to my resources folder. And "Bases" is the folder in such path where I am taking the images from.
| VB .NET: PictureBox scales up my images! | CC BY-SA 2.5 | null | 2011-01-05T23:17:14.093 | 2011-01-07T04:33:51.313 | 2017-05-23T10:30:23.117 | -1 | 555,690 | [
"vb.net",
"zooming",
"scale",
"picturebox"
]
|
4,610,248 | 1 | 4,610,323 | null | 0 | 477 | How to set "from" when sendin email via smtp server with using microsoft c#
if you look this image you will understand what i mean
i use the code below for sending emails

```
MailMessage mail = new MailMessage();
mail.To.Add(srUserEmail);
string srBody = "bla bla bla";
mail.From = new MailAddress("[email protected]");
mail.Subject = "bla bla bla";
mail.Body = srBody;
mail.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
smtp.UseDefaultCredentials = true;
smtp.Host = "xxx.xx.xx.xx";
smtp.Port = xxx;
smtp.Send(mail);
```
| How to set from when sending email via smtp server with using microsoft c# | CC BY-SA 2.5 | null | 2011-01-05T23:19:51.417 | 2011-03-17T08:56:02.510 | 2011-03-17T08:56:02.510 | 491,044 | 310,370 | [
"c#",
"email",
"smtp",
"send"
]
|
4,610,255 | 1 | null | null | 0 | 332 | I am creating a store using Ubercart that sells metal cut to size.
The algorithm for the price of a piece of metal is (Width * Length * Thickness) * cost per lb.
I installed the module of Custom Price Calculation (uc_custom_price) to multiply the options together (because currently it simply adds the weights of the weight options together).
I basically want to come out with the following line - but I'm unsure of the correct syntax?
(I also used the module of uc_attribute_tokens to help simplify the code.)
```
$item->weight = [LengthFeet][weight] * [WidthFeet][weight] * [Gauge][weight];
$item->price = $item->cost * $item->weight;
```
Here is a screenshot of the devel: 
Thank you.
| Multiplying object weight options in Ubercart in Drupal | CC BY-SA 3.0 | null | 2011-01-05T23:20:32.847 | 2011-11-26T01:38:00.727 | 2011-11-26T01:38:00.727 | 234,976 | 376,936 | [
"drupal",
"ubercart"
]
|
4,610,877 | 1 | 4,611,083 | null | 0 | 341 | Hello im very new at AS3 so im a litle confused trying to get a simple modification to this code:
```
import flash.display.Loader;
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.net.URLRequest;
import flash.net.URLLoader;
import flash.text.StyleSheet;
var fonts:Array /* of String */ = ["fonts/DroidSerif.swf","fonts/Lobster.swf"];
var fontsLoaded:int = 0;
var textStyleSheet:StyleSheet;
loadFonts();
function loadFonts():void
{
for each (var fontURL:String in fonts)
{
var fontLoader:Loader = new Loader();
fontLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onFontLoaded);
fontLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onFontLoadError);
fontLoader.load(new URLRequest(fontURL));
}
}
function onFontLoadError(event:IOErrorEvent):void
{
trace("ERROR: Could not find font "+event.target.loaderURL);
}
function onFontLoaded(event:Event):void
{
fontsLoaded++;
if (fontsLoaded == fonts.length) {
onFontsLoadComplete();
}}
function onFontsLoadComplete():void
{
trace("FONTS");
trace(fonts.length + " fonts have been loaded");
loadCSS();
}
function loadCSS():void
{
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onCSSLoadComplete);
loader.load(new URLRequest("css/styles.css"));
}
function onCSSLoadComplete(event:Event):void
{
trace("CSS");
textStyleSheet = new StyleSheet();
textStyleSheet.parseCSS(event.target.data);
loadXML();
}
function loadXML():void
{
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onXMLLoadComplete);
loader.load(new URLRequest("xml/content.xml"));
}
function onXMLLoadComplete(event:Event):void
{
// get xml from event target data
var xml:XML = XML(event.target.data);
// convert the xml to a string
var xmlString:String = xml;
// send xml string to the displayHTML method
trace("CARGO XML");
displayHTML(xmlString);
}
function displayHTML(htmlText:String):void
{
var htmlTextBlock:HTMLTextBlock = new HTMLTextBlock();
htmlTextBlock.blockWidth = 720;
htmlTextBlock.textStyleSheet = textStyleSheet;
htmlTextBlock.setHTML(htmlText);
htmlTextBlock.x = 0;
htmlTextBlock.y = 0;
addChild(htmlTextBlock);
trace("AJA");
}
```
Now, lets concentrate in the last function, displayHTML(). As you can see and i barely understand this function creates a textfield and fill it with the html content. I dont want to create a new textfield, i already have one dinamic textfield on the movie, with the html option selected. The problem is that there is something that im doing wrong, i use this simple line: mydinamictext.htmlText = htmlText. But the result is a NON css formated text. Here is a screen capture, the one of top is with the textfield created in code, and the bottom one with my textfield:

So, how can i apply the css and the fonts to my dynamic textfield and not create a new one. THANKS ALOT!
| Help with this AS3 code | CC BY-SA 2.5 | null | 2011-01-06T01:06:11.710 | 2011-01-06T01:52:54.940 | 2011-01-06T01:22:23.183 | 310,648 | 310,648 | [
"css",
"flash",
"actionscript-3"
]
|
4,611,020 | 1 | 4,611,896 | null | -2 | 213 | What exactly is this output (which characterset) and how do I convert it to something that makes sense?
```
use Win32::API;
$EnumProcesses= new Win32::API( 'psapi', 'EnumProcesses','PNP');
$aBuffer = " " x 4096;
$bBuffer = " " x 4096;
$EnumProcesses->Call($aBuffer,4096,$bBuffer);
print $aBuffer,"\n",$bBuffer,"\n";
```
| Need help interpreting string's characters using perl | CC BY-SA 2.5 | null | 2011-01-06T01:36:54.033 | 2011-01-06T15:52:14.020 | null | null | 318,146 | [
"perl",
"winapi",
"character-encoding"
]
|
4,611,126 | 1 | 4,611,130 | null | 9 | 8,606 | I've created a custom UITableViewCell in IB, linked it to the root view controller's property for it, and set it up in CellForRowAtIndexPath. But the height of my drawn cells doesn't match what I setup in IB, advice? Here's some screenshots and the code.


```
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *AddressCellIdentifier = @"AddressCellIdent";
UITableViewCell *thisCell = [tableView dequeueReusableCellWithIdentifier:AddressCellIdentifier];
if (thisCell == nil) {
[[NSBundle mainBundle] loadNibNamed:@"AddressCell" owner:self options:nil];
thisCell = addressCell;
self.addressCell = nil;
}
return thisCell ;
}
```
addressCell is a @property (nonatomic, assign) IBOutlet UITableViewCell *addressCell;, and is linked up in IB to the file's owner (the table view controller).
I'm using the example from Apple's table view programming guide.
| Custom nib UITableViewCell height | CC BY-SA 2.5 | 0 | 2011-01-06T02:00:57.790 | 2018-10-12T11:31:28.933 | null | null | 557,913 | [
"iphone",
"objective-c",
"uitableview"
]
|
4,611,291 | 1 | 4,615,793 | null | 7 | 1,648 | I recently wrote a native NT registry editor for Windows, and ran it on Windows 7. To my surprise, in addition to the two standard root keys, MACHINE and USER, that are present on Windows XP, there was also a mysterious key named "A", that cannot be opened in any way, whether by permission changes or backup privileges or otherwise:

Does anyone know what this key is for? I don't believe it's for any software, because it was there before I installed anything on the machine, and I believe I saw it on another fresh installation as well. It's rather very suspicious, and I'm curious as to why it's there. (If I'm curious enough, I might end up writing a driver to open it up without a privilege check, to see what happens!)
(I wasn't sure whether to put this on SuperUser or StackOverflow, since I think it could go in either one. I could be wrong, though; sorry if this isn't the appropriate place.)
Edit:
If forgot to say, I don't believe you can even see this key using the Win32 API, like `RegOpenKey` -- you have to use the native API like `NtEnumerateKey` instead.
| Mysterious, Native "A" Registry Key with Path: Registry\A | CC BY-SA 2.5 | 0 | 2011-01-06T02:41:41.280 | 2018-11-22T13:38:21.817 | 2011-12-20T05:12:22.957 | 105,971 | 541,686 | [
"windows",
"windows-7",
"registry",
"registrykey"
]
|
4,611,322 | 1 | 4,618,105 | null | 0 | 236 | See the following screenshot for clarification:

I want to have a standard multi-select listbox that works normally. Unfortunately, the Windows Forms ListBox (with `SelectionMode.MultiExtended`) is not fully functional. The missing functionality is that it doesn’t let you select a disjoint set of items by using Ctrl+Arrow keys and Ctrl+Space. (Try it in Windows Explorer to see how it’s supposed to work.) I am trying to subclass ListBox and add this missing functionality. To this end, I intend to respond to Ctrl+Arrow keys in the `OnKeyDown` protected method, but in order to do so, I need to be able to move the outline without changing the set of selected items. How do I do that?
| How to change which item is “outlined” in a ListBox without changing the selection? | CC BY-SA 2.5 | null | 2011-01-06T02:49:44.203 | 2011-01-06T18:29:19.430 | null | null | 33,225 | [
"winforms",
"listbox",
"multi-select"
]
|
4,611,472 | 1 | 4,611,508 | null | 1 | 1,271 | I have this data in my table (tb_cash_transaction)

I want to group the TYPE column, CURRENCY_ID column and AMOUNT column so it will become like below:
```
**Currency** **Cash IN** **Cash OUT** **Balance**
14 40000 30000 10000
15 50000 40000 10000
```
Rule :
1.Group by currency
2.Then find the sum of cash in for that currency
3.Find the sum of cash out for that currency
4.Get the balance (sum cash in - sum cash out)
How to achieve it using mysql? I try using group by but cannot get the desired output.
Thanks in advance
| mysql with 3 group by and sum | CC BY-SA 2.5 | 0 | 2011-01-06T03:29:25.207 | 2011-05-06T17:11:23.140 | 2011-05-06T17:11:23.140 | 135,152 | 417,899 | [
"mysql",
"sql",
"aggregate-functions"
]
|
4,612,173 | 1 | 4,616,180 | null | 1 | 1,385 | I'm currently developing a script for a map in COD4. I think that the language is so simple that I'm tagging this as language-agnostic since the problem is in the algorithm for this situation.
There is a room which is 960 units wide. And inside it there's an object in the middle, which we'll count as the axis. The ball is supposed to move to a random position each time it is hit, but should not traverse further than the walls. Here's a diagram:

The API of the game only allows the moving of objects relative to its position, as far as I know, so here's code that I came up with. The problem is that it begins to produce unexpected results and this is crashing my head. Could somebody help me out?
```
while (1)
{
self waittill ("trigger", player); //Wait till player hits the object
head_origin thread head_move();
}
head_move()
{
/* level.prevx is a global variable which I use to store
the distance traveled in the previous shot. Defaults to 0 */
/*This works in the first and second hit, but then it begins to show
incorrect max and min values*/
x_min = (0-480) + level.prevx;
x_max = x_min + 960;
x_units = RandomIntRange( x_min, x_max ); //Create a random integrer
log2screen("MIN: " + x_min + " and MAX: " + x_max + " and MOVED " + x_units);
log2screen("Moved " + x_units);
//Movement function, first parameter is the distance to be traveled, and the second one is the speed
self movex (x_units , level.movespeed);
level.prevx = x_units;
}
```
Just to clarify. When the user shoots the ball, its position changes to a certain value. Now, if he hits it again, the min and max values of the random int generator should change to prevent the ball from moving outside the walls. Example:
1. Level starts. The ball is in the middle of the room. The min and max ranges are -480 and 480 respectively
2. The user hits the ball and its moved -200 units (200 units to the left).
3. Now, the min and max range should be -280 and 680.
I hope this is clear enough.
Edited the sign as FlipScript suggested. Here's the output from the log2screen functions, what is actually happening:
1. MIN: -480 and MAX 480. MOVED 67
2. MIN: -413 and MAX 547. MOVED 236
3. MIN: -244 and MAX 716. MOVED 461
Just a sample case. Something is backwards I believe, these aren't the right calculations to do.
| Movement algorithm for game | CC BY-SA 2.5 | 0 | 2011-01-06T05:54:36.563 | 2018-07-30T01:02:30.923 | 2018-07-30T01:02:30.923 | 2,370,483 | 101,066 | [
"algorithm",
"scripting",
"language-agnostic",
"game-physics"
]
|
4,612,827 | 1 | null | null | 2 | 970 | I'm new to the whole distributed system world. I need help to how to form a cluster on this environment and also decide which one is the CH(cluster header). I want use spanning tree to choose the nodes with highest energy to be the CH. When CH is chosen, every other nodes should send their information to CH and CH send it to the base station(the red node).
The problem is I don't know how the algorithm should be. Here's some algorithm I tried to do
Clustering algorithm
- - If a nodes which receive a “search” message:-compare the energy left of each nodes, if the energy from the sender is lower than itself. Reply
with it own ID. If the energy from the sender is higher than itself. Reply with the senders ID and pass it to the other neighbor- -
Environment:
Assume that this is a router network
The number is energy power of each nodes
The red nodes is the base station.

| How to form a cluster and choose cluster header on this environment? | CC BY-SA 2.5 | null | 2011-01-06T07:42:10.050 | 2017-01-08T21:14:49.483 | null | null | 289,944 | [
"algorithm",
"cluster-analysis",
"spanning-tree"
]
|
4,612,920 | 1 | null | null | 1 | 1,333 | On Windows 7, starting a program located in an Alternate Data Stream (e.g. start c:\temp\application.exe:hiddenProgram.exe) does not work anymore!
Using Process Monitor, I see that the access result is OK, but somehow, the OS is blocking access to this file. On Vista and earlier versions, this method used to work.

Does anyone knows how to start it using windows 7 ?
| Starting an application located in an Alternate Data Stream | CC BY-SA 2.5 | 0 | 2011-01-06T08:00:45.823 | 2011-05-19T20:51:29.213 | 2011-05-19T20:51:29.213 | 756,329 | 408,285 | [
"windows-7",
"ntfs",
"alternate-data-stream"
]
|
4,613,176 | 1 | null | null | 2 | 7,124 | I'm making a Web-App (still in "Beta") which uses the Flickr API to get information for the photos of a particular Flickr user and generates IPB code to post any of his/her images.
While Flickr now gives you the IPB code to show the image and link back to the photo site directly on its site, my App also has the option of embeding the title, description, select EXIF data, location information, etc. into the post for the IPB forum.
I've most recently added the option to integrate a Google Maps image of the photo's geolocation data into the post by using the Google Static Maps API.
The problem is that the image URL I have is in the following form (including IPB `[IMG]` tags):
```
[IMG]http://maps.google.com/maps/api/staticmap?zoom=16&size=600x600&maptype=hybrid&markers=19.387687,-99.251732&sensor=false[/IMG]
```
Which shows this example image (In practice the image size is user selectable):

However, some IPB forums seem to not support dyamic image URLs which gives me a broken image, I'd like to replace the
```
[IMG]http://maps.google.com/maps/api/staticmap?zoom=16&size=600x600&maptype=hybrid&markers=19.387687,-99.251732&sensor=false[/IMG]
```
with something like
```
[IMG]http://maps.google.com/maps/api/staticmap/map0000001.png[/IMG]
```
which should be supported by all IPB forums. Thanks in advance for your help.
In case you're interested, the most recent "released" version of my Web-App can be found here: [http://flickr.argote.mx/](http://flickr.argote.mx/) (The changes I mention here are still on local development server).
| How can I get a static URL to a map image using the Google Static Maps API? | CC BY-SA 2.5 | null | 2011-01-06T08:50:53.243 | 2011-04-01T00:00:25.493 | 2011-03-24T23:30:58.857 | 452,991 | 452,991 | [
"javascript",
"image",
"api",
"google-maps",
"static"
]
|
4,613,209 | 1 | null | null | 0 | 80 | I want to summary entry in section and display result in header like this picture

I try to read in document and tutorial but not found.
| How to add a summary entry in each section of a table view | CC BY-SA 3.0 | null | 2011-01-06T08:56:11.953 | 2015-09-14T16:42:40.510 | 2015-09-14T16:42:40.510 | 1,527,934 | 65,964 | [
"ios",
"iphone",
"uitableview",
"cocoa-touch"
]
|
4,613,377 | 1 | 4,613,421 | null | 3 | 181 | Ok, so I have the following array of data:
```
shipGrid = [
['0','0','0','0','0','0','0','0','0','0'],
['0','0','0','0','0','0','0','0','0','0'],
['0','0','1','0','0','0','0','1','0','0'],
['0','0','0','0','0','0','0','0','0','0'],
['0','0','0','0','1','1','0','0','0','0'],
['0','0','0','0','0','0','0','0','0','0'],
['0','0','1','0','0','0','0','1','0','0'],
['0','0','0','1','1','1','0','0','0','0'],
['0','0','0','0','0','0','0','0','0','0'],
['0','0','0','0','0','0','0','0','0','0']];
```
Which I have translated into this clickable group of `<li>`'s:

Is it possible to convert this array of `<li>`'s into an image of somekind?
It doesn't have to be just a PNG, GIF or JPG - it can be a SVG or Vector based thing.
I'm a bit stumped, I'd like to do it without a server side language - so I thought maybe a SVG library or would work well...?
Cheers.
This needs to be viewable in the browser itself.
| From Javascript array to an image of some kind | CC BY-SA 2.5 | null | 2011-01-06T09:20:58.350 | 2012-04-26T09:04:48.017 | 2011-01-06T11:43:50.660 | 285,178 | 285,178 | [
"javascript",
"arrays",
"image"
]
|
4,613,720 | 1 | 5,857,623 | null | 2 | 2,363 | I have implement functionality for exporting data from gridview to excel sheet in .net application.Rendered output of gridview on page is given below:

don't bother about header and footer as i am showing a litle part of gridview.
and data exported in excel-sheet is:

Code in aspx page is for particular currency column in grid-view is:
```
<asp:TemplateField HeaderText="Value" >
<HeaderStyle HorizontalAlign="Left" CssClass="lblBoldTextLeftPadding clsGridHeaderDashboard" />
<ItemTemplate>
£<%# Eval("Value") %>
</ItemTemplate>
<ItemStyle CssClass="lblNormalTextLeftPadding" Width="10%" VerticalAlign="Top" HorizontalAlign="Left" />
</asp:TemplateField>
```
As you can see in excel-sheet the currency column value is [ £100 ] but in grid-view [ £100 ] .
Can anybody suggest me how can we remove " Â " from excel-sheet output.
I am using following code for exporting functionaity:
```
Response.Clear()
Response.AddHeader("content-disposition", "attachment;filename=Report.xls")
Response.Charset = ""
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.ContentType = "application/vnd.xls"
Dim objStringWriter As StringWriter = New StringWriter(sb)
Dim objHtmlTextWriter As HtmlTextWriter = New HtmlTextWriter(objStringWriter)
gvBidTrackingExcel.DataSource = Getdata()
gvBidTrackingExcel.DataBind()
gvBidTrackingExcel.RenderControl(objHtmlTextWriter)
Response.Write(objStringWriter)
Response.End()
```
| Export to excel help in GridView | CC BY-SA 2.5 | 0 | 2011-01-06T10:02:13.987 | 2013-01-03T16:44:11.907 | null | null | 503,125 | [
"gridview",
"asp.net-2.0",
"export-to-excel"
]
|
4,613,835 | 1 | 4,613,867 | null | 0 | 1,422 | Table Entry has the following data. Certain records are duplicate. Duplicate criteria is same NoOfEntry and TypeOfEntry. Out of a record which has same NoOfEntry and TypeOfEntry, i want the EntryId of record which has min(dateOfEntry).
For Eg- We have 3 duplicate records for T1, I want record with EntryID 1001 as it was enterd first(minimum DateOfEntry).

| How to find id of duplicate records in SQL SERVER 2005 | CC BY-SA 2.5 | null | 2011-01-06T10:15:40.850 | 2011-01-06T10:19:09.203 | null | null | 139,357 | [
"sql",
"sql-server-2005"
]
|
4,614,093 | 1 | null | null | 0 | 341 | I would like to extract 3 different types of patterns from an image. The patterns are top-open rectangle, rectangle and bottom-open rectangle as shown in the image.  Kindly suggest an approach.
| extracting patterns in an image | CC BY-SA 2.5 | null | 2011-01-06T10:49:38.380 | 2011-01-06T10:58:09.013 | null | null | 362,261 | [
"c#"
]
|
4,614,135 | 1 | null | null | 10 | 2,926 | i want to detect collision detection two times in same row.
for example:-(see the below image)
the ellipse and rectangle or detcted. after that my ellipse will travelling in the straight line path to down and detect the another rectangle.
first one is( travelled in trajectory path ) working fine. second one i want to pass in straight line to down for collision detection.
how to do this process.

| collision detection in cocos2d | CC BY-SA 3.0 | 0 | 2011-01-06T10:53:48.487 | 2013-05-28T06:31:27.243 | 2011-11-12T16:52:55.377 | 201,863 | 494,589 | [
"iphone",
"objective-c",
"xcode",
"cocos2d-iphone",
"collision-detection"
]
|
4,614,180 | 1 | 4,614,232 | null | 3 | 2,399 | there are 3 Bar-Buttons in the UINavigationItem:
- - -
But there is no "nextBarButtonItem" (= rightBarButtonItem with arrow). How can I create it? Do I need an own image with an arrow? How can I put the image in the rightBarButtonItem? Or is there a better way without image?

| UINavigationItem: Create a "nextBarButtonItem" (= rightBarButtonItem with arrow) | CC BY-SA 2.5 | null | 2011-01-06T11:01:21.400 | 2011-01-06T12:35:56.060 | null | null | 509,535 | [
"iphone",
"objective-c",
"uinavigationbar",
"uibarbuttonitem"
]
|
4,614,202 | 1 | 4,616,296 | null | 0 | 1,477 | I have an HTML Table that looks like this:

The user can update any of the textboxes and select from the dropdowns.Once he has completed his actions, The data needs to be sent via ajax to the server.
It is acceptable to send all values (Not only those that changed).
Need help building the JSON string for an ajax transaction.
(Note that the description column can be either a string, textbox or a dropdown in addition the dropdowns do not contain the same options.)
The structure I am trying to map to looks like this:
```
[
{ id: "1" , desc: "Lenovo" , remark: "International" },
{ id: "2" , desc: "Hard Disks", remark: "" },
{ id: "3" , desc: "T400", remark: "Old Model" },
{ id: "4" , desc: "Poker", remark: "" }
]
```
Thanks a lot, if map can't do it, I am open to other options.
Be happy and enjoy life ;-)
There is a hidden column between the feature and the description. This is why the indices in the answer are refereeing to cells[2] and cells[5].
| JQuery map() for an html table - help needed | CC BY-SA 2.5 | null | 2011-01-06T11:04:31.373 | 2011-01-06T19:17:41.160 | 2011-01-06T19:17:41.160 | null | null | [
"jquery",
"json",
"dictionary"
]
|
4,614,205 | 1 | null | null | 0 | 622 | How to create the orange glow like the stock launcher has it when displaying the application list?
For example the highlighted aLogcat application below.

Is it built-in or do I need to calculate and create a new bitmap/drawable myself?
| Creating orange glow to indicate focused widget in Android | CC BY-SA 2.5 | null | 2011-01-06T11:04:40.323 | 2011-01-06T18:03:20.860 | null | null | 11,238 | [
"android",
"focus",
"widget",
"drawable"
]
|
4,614,327 | 1 | null | null | 1 | 1,084 | Consider the following image that shows the encryption hierarchy used in SQL Server. Please note the first blue block, that says the SMK is encrypted using [DPAPI](http://msdn.microsoft.com/en-us/library/ms995355.aspx). The DPAPI uses a currently logged-in user credentials (+ more) to encrypt data, so it's machine-specific. This means that SMK (as well as DMK and any derived password) will be machine-specific (actually it's generated by SQL Server's setup). OTOH, I can create/backup an X.509 certificate in SQL Server (using CREATE CERTIFICATE, BACKUP CERTIFICATE and so on).
I'm developing a Web App that needs to encrypt and store CC information in a database column. I need to access those data, later on another machine so the db backup should be actually readable when restored on another machine (albeit, for someone who has got access to the above-mentioned certificate).
I'm wondering how am I supposed to restore a backup on another machine when the SMK is specific to the current instance of SQL Server? What should I do to access those encrypted data once they are restored on another machine?
Correct me if I am wrong!
We could use the `BACKUP SERVICE MASTER KEY TO FILE` command to back the currently used SMK. This key, however, can be restored on any other SQLServer (on/out of the same machine) using the `RESTORE SERVICE MASTER KEY FROM FILE` command. When the SMK is restored, it's being encrypted once again using DPAPI so that can be stored somewhere on the machine.
Any help would be highly appreciated,

| Encrypting and storing sensitive data in SQL Server 2008 | CC BY-SA 2.5 | 0 | 2011-01-06T11:19:13.400 | 2011-01-10T12:59:14.840 | 2011-01-06T14:52:13.587 | 562,588 | 562,588 | [
"security",
"sql-server-2008",
"web-applications",
"encryption"
]
|
4,614,344 | 1 | 4,614,621 | null | 8 | 2,110 | An action method in my ASP.NET MVC2 application returns a JsonResult object and in my unit test I would like to check that the returned JSON object indeed contains the expected values.
I tried this:
```
1. dynamic json = ((JsonResult)myActionResult).Data;
2. Assert.AreEqual(JsonMessagesHelper.ErrorLevel.ERROR.ToString(), json.ErrorLevel);
```
But I get a RuntimeBinderException "'object' does not contain a definition for 'ErrorLevel'".
However, when I place a breakpoint on line 2 and inspect the json dynamic variable (see picture below), it obviously contain the ErrorLevel string and it has the expected value, so if the runtime binder wasn't playing funny the test would pass.

What am I not getting? What am I doing wrong and how can I fix this? How can I make the assertion pass?
| "dynamic" keyword and JSON data | CC BY-SA 2.5 | 0 | 2011-01-06T11:22:15.430 | 2011-01-06T12:02:16.690 | 2011-01-06T11:51:21.570 | 81,520 | 81,520 | [
"c#",
"unit-testing",
"json",
"asp.net-mvc-2",
"dynamic"
]
|
4,614,498 | 1 | 4,614,582 | null | 0 | 91 | I'm creating a page that searches for an item and then be able to edit/update it. I was able to do it when it returns just one result but when it gives me multiple results I could only edit the very last item. Below is my code:
```
.......
$dj =$_POST[djnum];
$sql= "SELECT * From dj WHERE datajack LIKE '$dj%'";
$result = mysql_query($sql);
//more code in here//
while ($info =mysql_fetch_array($result)) {
// display the result
echo "<form action=\"dj_update.php\" method=\"POST\"><input type=\"hidden\" name=\"djnumber\" value=\"".$info['datajack']."\">";
echo "<tr><td>DJ ".$info['datajack']."</td>";
echo "<td>".$info['building']." </td>";
echo "<td>Rm ".$info['room']." </td>";
echo "<td>".$info['switch']." </td>";
echo "<td>".$info['port']." </td>";
echo "<td>".$info['notes']." </td>";
echo "<td style=\"text-align:center;\"><input type=\"Submit\" value=\"Edit\" ></td></tr>";
}
// more code here //
```
Then this is the screen shot of the result:

The idea is the user should be able to click on "Edit" and be able to edit/update that particular item. But when I click any of the Edit button I could only edit the last item. What am I missing here? Is there an easier way to do this?
Thanks guys and Happy new year!
| Editing/Updating one of the results in a search query | CC BY-SA 2.5 | null | 2011-01-06T11:41:18.273 | 2011-01-06T12:10:06.070 | null | null | 457,862 | [
"php",
"mysql",
"html"
]
|
4,615,216 | 1 | null | null | 0 | 2,446 | I need the add to cart form on each product to display separate quantity fields so items of different attributes can be added at the same time. This is for a photography site, so it makes sense for the customer to order 2 6x4 prints and one 10x8.
Right now the add to cart form is something like this:

Here is a mockup of what I want to have:

I have no idea which hooks to use, or if it's even possible to add multiple product variants in one POST. Is anyone familiar enough with the Ubercart api to tell me how I can go about doing this.
| Ubercart add to cart form with quantity option per attribute | CC BY-SA 2.5 | null | 2011-01-06T13:08:22.687 | 2011-01-10T02:23:57.183 | null | null | 181,637 | [
"php",
"drupal",
"ubercart"
]
|
4,615,691 | 1 | 4,616,063 | null | 1 | 3,298 | My app is Navigation base application.In this application , UIViewController has button event . Tap on Button firing to (pushViewController) CalendarTableview. Now i need to add Tabbar and tabitem to calendartableview . how to add Tabbar and tabitem to CalendarTableview. help me .
here is my picture.
Thanks.
| how to add tabbar to uitableview | CC BY-SA 2.5 | 0 | 2011-01-06T14:02:50.527 | 2011-01-06T14:54:24.930 | 2011-01-06T14:50:53.873 | 508,535 | 508,535 | [
"iphone",
"uitableview",
"tabbarcontroller"
]
|
4,616,231 | 1 | 4,616,509 | null | 2 | 5,400 | Coca-Cola seems to have nailed it pretty well. Even before any user interaction, they manage to know where you are at [their Facebook page](http://www.facebook.com/cocacola?ref=ts&v=app_161193133389):

This works in IE, so no HTML5 involved (and after all, Facebook won't recognize the `navigator` object in Javascript).
How do they do this?
| Getting user location on Facebook page tab | CC BY-SA 2.5 | 0 | 2011-01-06T14:56:22.350 | 2011-10-18T20:20:00.933 | null | null | 214,773 | [
"javascript",
"facebook",
"geolocation",
"fbml"
]
|
4,616,345 | 1 | 4,616,464 | null | 17 | 24,379 | I would like to select multiple rows in a UITableview just like Apple does in the native Alarm app (see picture 
How can I do that?
All the answers I saw so far were old (and said "Can't do") or refer to the multiple row selection in the native Mail app. That method is not what I would like because you have to enter in the "edit"-mode first. I want to be able to select the rows right away.
Hope someone can help.
Christian
| Select multiple rows in UITableview | CC BY-SA 2.5 | 0 | 2011-01-06T15:07:59.003 | 2017-01-17T21:38:06.287 | 2011-01-06T15:13:53.403 | 224,907 | 224,907 | [
"iphone",
"uitableview"
]
|
4,617,419 | 1 | 4,617,750 | null | 1 | 1,176 | Trying to learn plyr, I have gotten stuck trying to reproduce code from the [introductory guide](http://had.co.nz/plyr/plyr-intro-090510.pdf).
The guide says that the code is in a file `plyr.r`, but not where I can find this file.
But reproducing one of the first examples seemed easy enough, so I decided to give it a try:

```
dat <- data.frame(c(10,100,50), mean=c(5,5,10), sd=c(1,2,1))
maply(dat, rnorm)
```
and I get this error:
```
Error in function (..., na.last = TRUE, decreasing = FALSE) :
unimplemented type 'list' in 'orderVector1'
```
trying
```
dat <- cbind(c(10,100,50), mean=c(5,5,10), sd=c(1,2,1))
maply(dat, rnorm)
```
gives
```
Error: Results must have the same dimensions.
```
questions:
1. what am I doing wrong?
2. where can I find plyr.r? (it is not here)
| getting started with plyr `m*ply` but unable to reproduce examples | CC BY-SA 2.5 | 0 | 2011-01-06T16:53:28.823 | 2015-12-17T16:29:21.190 | 2011-01-06T17:17:14.313 | 199,217 | 199,217 | [
"r",
"plyr"
]
|
4,617,749 | 1 | 4,640,259 | null | 6 | 6,257 | I'm using wpf toolkit AutoCompleteBox and I've set the Item template.
The problem : the Items in the pop-up list look great but it didn't take effect on the textbox above (the selected item).

XAML:
```
<Controls:AutoCompleteBox x:Name="x" ItemFilter="SearchPerson" Margin="20">
<Controls:AutoCompleteBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Name}" />
<Rectangle Width="10" Height="10" Fill="LightGreen"/>
<TextBlock Text="{Binding Age}" />
</StackPanel>
</DataTemplate>
</Controls:AutoCompleteBox.ItemTemplate>
</Controls:AutoCompleteBox>
```
Code behind:
```
public partial class MainWindow : Window
{
public List<Person> Persons { get; set; }
public MainWindow() {
InitializeComponent();
Persons = new List<Person> {
new Person{Name = "Jhon",Age=35},
new Person{Name = "Kelly",Age=40}};
x.ItemsSource = Persons;
DataContext = this;
}
bool SearchPerson(string search, object value) {
return (value as Person).Name.ToLower().Contains(search);
}
}
public class Person
{
public string Name { get; set; }
public int Age { get; set; }
}
```
| ItemTemplate does not affect selected item of AutoCompleteBox | CC BY-SA 3.0 | 0 | 2011-01-06T17:27:11.667 | 2012-05-25T10:38:41.293 | 2011-08-31T14:03:35.370 | 546,730 | 138,627 | [
"wpf",
"templates",
"controltemplate",
"autocompletebox"
]
|
4,617,780 | 1 | 4,844,970 | null | 2 | 270 | The [Web Platform Installer](http://www.microsoft.com/web/downloads/platform.aspx) has an option to load an external in order to present the user with more products

> In what should be that feed, what does it require?
and
> How can we send and setup the database (like Umbraco does)?
. Keep in mind that I do not want to [submit the app to Microsoft](http://www.microsoft.com/web/gallery/developer.aspx), just use the feed
| How to take advantage of WPI to distribute our software? | CC BY-SA 2.5 | 0 | 2011-01-06T17:30:03.987 | 2011-01-30T19:28:03.070 | null | null | 28,004 | [
"installation",
"feed",
"web-platform-installer"
]
|
4,617,845 | 1 | null | null | 5 | 24,733 | I have an integer array of RGB pixels that looks something like:
```
pixels[0] = <rgb-value of pixel(0,0)>
pixels[1] = <rgb-value of pixel(1,0)>
pixels[2] = <rgb-value of pixel(2,0)>
pixels[3] = <rgb-value of pixel(0,1)>
...etc...
```
And I'm trying to create a BufferedImage from it. I tried the following:
```
BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
img.getRaster().setPixels(0, 0, width, height, pixels);
```
But the resulting image has problems with the color bands. The image is unclear and there are diagonal and horizontal lines through it.
What is the proper way to initialize the image with the rgb values?
EDIT:
Here is what my image looks like
thanks,
Jeff
| Create a buffered image from rgb pixel values | CC BY-SA 2.5 | 0 | 2011-01-06T17:36:15.380 | 2013-02-21T12:19:15.543 | 2011-01-06T18:11:24.873 | 121,993 | 121,993 | [
"java",
"bufferedimage",
"pixel"
]
|
4,618,439 | 1 | null | null | 0 | 1,685 | I have a ListBox that specifies ItemContainerStyle. The ItemContainerStyle uses Triggers to set the ContentTemplate.
I would like to set the Visibility of a ContentControl (named "ExpanderContent") in the ContentTemplate when the template is applied. I'd prefer to use the value of an attached property set on the ListBoxItem, if possible.
Perhaps it will help make the question clearer to see this one example of what I've tried using a Style applied to the ContentControl (named "ExpanderContent"). I realize that the Style is not set on the ContentControl in the code below. I have set it and seen it applied and seen that there is no error regarding resolving the attached property.
```
<ListBox ItemContainerStyle="{StaticResource lbcStyle}"/>
<Style TargetType="ListBoxItem" x:Key="lbcStyle">
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="ContentTemplate" Value="{StaticResource editable}"/>
</Trigger>
</Style.Triggers>
<Setter Property="ContentTemplate" Value="{StaticResource nonEditable}"/>
</Style>
<DataTemplate x:Key="nonEditable">
<Grid Width="Auto" Height="Auto">
...
<ContentControl Name="ExpanderContent" Visibility="Collapsed" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="12"></ContentControl>
</Grid>
</DataTemplate>
<DataTemplate x:Key="editable">
<Grid x:Name="grdEditable" Width="Auto" Height="Auto">
...
<ContentControl Name="ExpanderContent" Visibility="Collapsed" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="12"></ContentControl>
</Grid>
</DataTemplate>
<Style x:Key="editorContentControl" TargetType="{x:Type ContentControl}">
<Style.Triggers>
<DataTrigger Binding="{Binding (local:AttachedProperties.IsExpanded),RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBoxItem}}}" Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
<DataTrigger Binding="{Binding (local:AttachedProperties.IsExpanded),RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBoxItem}}}" Value="False">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</Style.Triggers>
<Setter Property="Visibility" Value="Visible"/>
</Style>
```
The real world application of this nonsense is that I have a list box and the items in the list box have templates that change when selected. The templates have an expander and I'd like to leave the expander expanded even when the item is not selected. As it is now, whenever I change the list box selection, the content template is reapplied in its original state, which is collapsed - so I can never have more than one expanded at a time.

| How to set visibility of a member of a datatemplate when the template is applied? | CC BY-SA 2.5 | null | 2011-01-06T18:35:46.733 | 2011-01-06T20:01:17.163 | null | null | 33,102 | [
"wpf",
"datatemplate",
"visibility"
]
|
4,618,573 | 1 | 4,618,722 | null | 3 | 875 | i need a way to from a .

I deselected all the attributes from interface builder, but when i touch the text, the selection appear!
Have a solution? A magick tricks?
thanks.
| Is there a way to block copy/paste from textview? | CC BY-SA 2.5 | 0 | 2011-01-06T18:51:48.960 | 2011-01-06T19:06:38.077 | null | null | 88,461 | [
"iphone",
"objective-c",
"interface-builder",
"uitextview",
"selection"
]
|
4,618,703 | 1 | 4,618,775 | null | 0 | 923 | What do I have wrong here? This page is essentially broken into 5 divs, the middle 3 divs that represent the left, middle and right page columns are wrapped in a div with the id content. I linked to the page if you want to view the source. It wouldn't go in this message as a snippet very well when I tried.
Here is the style for #content
```
#content
{
background-color:White;
}
```
How do I get the whole background of #content to show as white?
[link to a live version of http://beta.sc-pa.com/](http://beta.sc-pa.com/)

| Applying Background-color property to a div does not work as expected | CC BY-SA 2.5 | null | 2011-01-06T19:04:34.467 | 2011-01-06T19:19:50.100 | null | null | 564,083 | [
"javascript",
"asp.net",
"jquery",
"html",
"css"
]
|
4,618,800 | 1 | 4,631,397 | null | 0 | 1,344 | This question, although [similar](https://stackoverflow.com/questions/2460599/binding-linq-to-entities-query-results-to-a-datagridview) [to](https://stackoverflow.com/questions/3090552/how-to-bind-a-query-with-a-join-to-a-datagridview) [others](https://stackoverflow.com/questions/2393223/binding-linq-query-to-datagridview), doesn't seem to be a duplicate. If it is, please clarify and I will be happy to merge.
I want to bind to a writable DataGridView using a linq-to-entities query containing a join. The model is as follows:

The denormalized DataGridView should be bound like so:

The following code binds but results in a readonly DataGridView because the linq-to-entities query returns an anonymous type ([see this post](https://stackoverflow.com/questions/2460599/binding-linq-to-entities-query-results-to-a-datagridview)). I'm at an impasse because I think I need the anonymous type to do the denormalization.
```
var query = from t in iDictionaryContext.DisplayTexts
from l in iDictionaryContext.Languages
where
t.LanguageID == l.LanguageID
select new
{
Key = t.DisplayKey,
Text = t.DisplayText1,
Language = l.LanguageName
};
```
I also tried the solution suggested [here](https://stackoverflow.com/questions/4065627/binding-datagridview-to-a-multiple-table-linq-to-sql-query) but it seems to apply to linq-to-sql but not to linq-to-entities. When setting the bindingsource.datasource to the linq-to-entities query, an exception is thrown reading "Only parameterless constructors and initializers are supported in LINQ to Entities."
Thank you for your advice,
Tim
| How do you bind a linq-to-entities query that contains a join to a writable datagridview? | CC BY-SA 2.5 | null | 2011-01-06T19:14:11.097 | 2011-01-07T23:58:22.647 | 2017-05-23T10:30:21.980 | -1 | 224,976 | [
"data-binding",
"datagridview",
"linq-to-entities",
"denormalization"
]
|
4,619,437 | 1 | 4,619,548 | null | 2 | 442 | I am fairly proficient in CSS but now I am running into a very strange rendering issue in Google Chrome 9. I am trying to create some fancy looking link buttons (basically heavily styled anchors). Here is some example markup:
```
<a href="" class="button">
<figure class="sprite icon icon_back"></figure>
Link button with icon</a>
```
This markup may look a litte strange to you, there's a few things you should know:
- -
All of this is working fine in Firefox, and actually also in Chrome. The correct rendering can be seen in the following image:

It renders like that in both Firefox and Chrome. Here comes the problem, if I place such a button within paragraph tags > `<p></p>` this is what happens in Chrome only:

Notice how the button is ripped apart? Only in Chrome and only when placed inside a paragraph. It gets even stranger: this only happens for the first button inside the paragraph, if I would place three buttons inside a paragraph, only the 1st one is screwed up.
Your first question would probably be about the CSS. It is rather verbose so hereby a temporary link to the page in question:
Edit: link to live page removed, was only temporary for problem inspection.
| Chrome renders button links completely screwed up when placed inside a paragraph | CC BY-SA 2.5 | 0 | 2011-01-06T20:19:48.457 | 2011-03-17T00:06:46.440 | 2011-01-06T21:38:17.530 | 80,969 | 80,969 | [
"css",
"google-chrome"
]
|
4,619,519 | 1 | 4,620,735 | null | 2 | 746 | I'd like to show the end user two documents side by side in separate columns. The document on the left makes a reference to the document on the right. I'd like to show this relationship by highlighting the text in the left column that makes the reference, and the referenced text on the right. This is easy enough with basic CSS. I'd like to take it a step further however and actually draw a connection between the two columns.
I suppose a screen shot is the easiest way to explain what I'd like to accomplish.

It's important that both columns scroll independently of each other, yet the lines connecting the two highlighted sections should remain accurate and update as the columns are scrolled.
Is there a way to accomplish this without using Flash or HTML 5 canvas? Are there any ready made jQuery plugins to accomplish this?
| jQuery/CSS to show merge style relationship between two columns like FileMerge | CC BY-SA 2.5 | 0 | 2011-01-06T20:30:00.540 | 2011-01-06T23:23:10.807 | null | null | 76,456 | [
"jquery",
"css"
]
|
4,619,840 | 1 | 4,629,807 | null | 0 | 286 | I have a make table query where some of the columns are calculated. An example of how one of those columns looks is as follows:
```
SQFTCost: (([SUPPLY_MASTER]![LAST_COST]+[SUPPLY_MASTER]![FREIGHT_COST])/[SUPPLY_MASTER]![SQFT_PER_CTN])
```
In this case, LAST_COST is a decimal with a precision of 9 and a scale of 3. FREIGHT_COST is is a decimal with a precision of 8 and a scale of 3, and SQFT_PER_CTN is a decimal with a precision of 7 and a scale of 3.
Whenever I run the make table query, that column and all the others like it are filled with nulls. I know that they are actually null, because I tested that in a routine that I wrote.

However, if I change the query to a SELECT query, all is well. The values are correct.

Does anyone have any idea what can be done to fix this? I am using Access 2003.
| Calculated columns in Access 2003 have null value when inserting into new table | CC BY-SA 2.5 | null | 2011-01-06T21:03:42.897 | 2011-01-07T20:10:41.887 | 2011-01-07T20:00:58.130 | 2,106 | 2,106 | [
"ms-access",
"cobol"
]
|
4,620,205 | 1 | 4,626,301 | null | 25 | 21,388 | I am using PHP's ZipArchive class to create a zip file containing photos and then serve it up to the browser for download. Here is my code:
```
/**
* Grabs the order, packages the files, and serves them up for download.
*
* @param string $intEntryID
* @return void
* @author Jesse Bunch
*/
public static function download_order_by_entry_id($intUniqueID) {
$objCustomer = PhotoCustomer::get_customer_by_unique_id($intUniqueID);
if ($objCustomer):
if (!class_exists('ZipArchive')):
trigger_error('ZipArchive Class does not exist', E_USER_ERROR);
endif;
$objZip = new ZipArchive();
$strZipFilename = sprintf('%s/application/tmp/%s-%s.zip', $_SERVER['DOCUMENT_ROOT'], $objCustomer->getEntryID(), time());
if ($objZip->open($strZipFilename, ZIPARCHIVE::CREATE) !== TRUE):
trigger_error('Unable to create zip archive', E_USER_ERROR);
endif;
foreach($objCustomer->arrPhotosRequested as $objPhoto):
$filename = PhotoCart::replace_ee_file_dir_in_string($objPhoto->strHighRes);
$objZip->addFile($filename,sprintf('/press_photos/%s-%s', $objPhoto->getEntryID(), basename($filename)));
endforeach;
$objZip->close();
header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($strZipFilename)).' GMT', TRUE, 200);
header('Cache-Control: no-cache', TRUE);
header('Pragma: Public', TRUE);
header('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT', TRUE);
header('Content-Length: '.filesize($strZipFilename), TRUE);
header('Content-disposition: attachment; filename=press_photos.zip', TRUE);
header('Content-Type: application/octet-stream', TRUE);
ob_start();
readfile($strZipFilename);
ob_end_flush();
exit;
else:
trigger_error('Invalid Customer', E_USER_ERROR);
endif;
}
```
This code works really well with all browsers but IE. In IE, the file downloads correctly, but the zip archive is empty. When trying to extract the files, Windows tells me that the zip archive is corrupt. Has anyone had this issue before?
Update: After suggestion from @profitphp, I changed my headers to this:
```
header("Cache-Control: public");
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
//header("Content-Description: File Transfer");
//header("Content-type: application/zip");
header("Content-Disposition: attachment; filename=\"pressphotos.zip\"");
//header("Content-Transfer-Encoding: binary");
header("Content-length: " . filesize($strZipFilename));
```
Also, here is a screenshot of the error in Windows after opening with Firefox:

This error occurs in both IE and Firefox on Windows. It works fine in Mac. Also, in Windows, the filesize appears to be correct:

This issue is sovled. See my answer below.
| PHP ZipArchive Corrupt in Windows | CC BY-SA 2.5 | 0 | 2011-01-06T21:42:22.793 | 2019-07-24T19:22:14.250 | 2011-01-07T14:15:00.433 | 277,757 | 277,757 | [
"php",
"windows",
"ziparchive"
]
|
4,620,458 | 1 | null | null | 0 | 2,091 | I am using an ASPxPivotGrid to display order data in an aspx website. When I put a column in the "filter area" that has a date value, it displays a checked list of dates to choose from (see below). Is there a setting or workaround to get it to show a date-range or calendar popup to filter by?

| Filter by date range in ASPxPivotGrid | CC BY-SA 2.5 | null | 2011-01-06T22:08:39.690 | 2011-01-11T07:38:19.107 | null | null | 458,416 | [
"asp.net",
"devexpress"
]
|
4,620,525 | 1 | 4,620,589 | null | 0 | 1,175 | Desktop apps have top level menus (File, Edit, Search, ..., Help).
Web apps have very similar thing, menu tabs (Logo, Questions, Tags, Users, Badges, ...).
However I cannot find equivalent of top level menu in Android framework. Assume that my app has 5 main activities. According to [menu design guidelines](http://developer.android.com/guide/practices/ui_guidelines/menu_design.html) options menu should contain actions related to current activity. So how an app should allow users to easily switch to one of five main activities.
It seems that different apps solve the problem in different ways. Some have a tab list at the top of the screen, some at the bottom. Even Google applications aren't consisted in that field. Google Listen has an options menu item called 'Listen Home', however Listen main activity has no that options menu item. Others have two icons in app luncher which start two different activities from one app.
I realize that due to small phone screens Android apps have to be designed in a slightly different way than web or desktop apps. But I have a feeling that the app top level menu topic was omitted in Android framework. And developers are on their own here. Or am I missing something?
Update: this is Google blueprint for a great app
Update2: this [an example app](http://code.google.com/p/iosched/) of these patterns
Update3: [GreenDroid](https://github.com/cyrilmottier/GreenDroid) library helps a lot implementing these patters in your apps. It seems that dashboard and action bar patterns are becoming quite popular.

| Android equivalent of top level menu | CC BY-SA 2.5 | null | 2011-01-06T22:14:55.360 | 2011-01-09T13:55:52.137 | 2011-01-09T13:55:52.137 | 3,315 | 3,315 | [
"android",
"design-patterns",
"user-interface"
]
|
4,620,581 | 1 | 4,621,025 | null | 0 | 1,716 | I am able to draw a Marker based upon a state (e.g. a field within my extended `OverlayItem` class) using the following code :
```
@Override
public Drawable getMarker(int pStateBitset)
{
Drawable currentMarker = super.getMarker(pStateBitset);
Drawable[] toDrawLayers;
if (mSelected)
{
BitmapDrawable overlay = (BitmapDrawable) mSELECTED_OVERLAY;
overlay.setAntiAlias(true);
toDrawLayers = new Drawable[] { currentMarker, overlay };
}
else
{
toDrawLayers = new Drawable[] { currentMarker };
}
return new LayerDrawable(toDrawLayers);
}
```
This works as expected (drawing a marker such as ). The glow of the marker is the effect I wish to achieve. As per the code above, it is generated via two layered `Drawable`s, namely (for instance)  and  .
I had to ensure that the size of the glow is the same as the normal marker image, so that the resulting `Drawable` doesn't rescale (marker image size is 32x37 px).
However, what I am aiming for is in fact a bigger glow (that would, indeed yield a bigger image), such as : 
How can I render a drawable which yields a bigger glow (thus using an image which is indeed bigger than the normal marker image) and does result in a scaled / resized normal marker ? Is that feasable ?
Thanks in advance, I can provide any additional details if necessary.
| Change Marker icon depending on state correctly? | CC BY-SA 2.5 | null | 2011-01-06T22:21:37.600 | 2011-01-06T23:15:09.140 | null | null | 132,735 | [
"android",
"google-maps"
]
|
4,620,892 | 1 | 4,621,473 | null | 1 | 1,926 | I've recently completed a (hopefully successful) VB to C# conversion on a decent-sized library. However, I am receiving some trouble from the compiler when trying to build it. I created a small helper library called `ExtensionMethods`, compiled it, dropped the .dll in the `bin` folder of the outlying project, and added a reference to it in the newly-converted library. The library has two namespaces, `ExtensionMethods.Json` and `ExtensionMethods.Enums`. In any class where I want to use the `Enums` namespace, I import it with `using ExtensionMethods.Enums`. I do the same for the `.Json` namespace (which works fine, by the way).
The following is picture evidence of what is happening:

Notice the blue squiggle under `Enums` with a simultaneous suggestion for `Enums` from Intellisense. Here is proof that VS actually recognizes the assembly (`.ToInt()` is the name of the extension method):

Notice how `.ToInt()` is both suggested by Intellisense as an extension method AND does not have a squiggle under it, even though ALLEGEDLY...

(three files use this namespace)
which would make sense, except for...

Essentially, what this is saying is that, "Yes, Jason, you have referenced all your assemblies correctly, yes, your assemblies contain the namespaces they should, but no, I don't feel like compiling today."
I just want to compile and be done with this monster. What am I missing here?
`ExtensionMethods.Json`, another namespace in `ExtensionMethods` works fine when referenced and does not produce an assembly reference error. Both projects were created on the same 64-Bit machine and everything targets .NET 4.
| Frustrating, nonsensical assembly reference errors | CC BY-SA 2.5 | null | 2011-01-06T22:59:45.127 | 2011-01-07T20:58:14.760 | 2011-01-07T20:58:14.760 | 49,246 | 7,173 | [
"c#",
"visual-studio-2010",
"reference",
"assemblies"
]
|
4,621,321 | 1 | 4,621,345 | null | 2 | 984 | When I add some items into a Java `Hashtable`, their order is different to that of a .NET `Hashtable`. Is there any way I can make sure the .NET `Hashtable` will have the same order as a Java `Hashtable`?
---
I'm trying to port some Java code to C#. The Java code uses a `Hashtable` to keep track of some data. When I check to see the the data is retrieved when I iterate through either the Java `Hashtable` or the .NET `Hashtable` (via an `Enumerator`), each one consistently has the same data, in the same order ... but has a different order.
Is there any way I can make it so that the .NET `Hashtable` data is in the same order as the Java `Hashtable`?
I understand that `Hashtable` do not handling ordering - so I feel like there's nothing that can be done. I also cannot change the datatype in the Java code from .. say .. a `Hashtable` to something else.
Here's some same data to illustrate my situation.
### Data, added sequential for either code base :-
1. num | someData
2. pagenum | someData
3. x | someData
4. top | someData
### Java Code:
```
private Hashtable identifiers = new Hashtable();
...
identifiers.put(symbol, identifier);
```
### Java output via iteration over an enumerator:

### .NET code:
```
private Hashtable Identifiers = new Hashtable();
...
Identifiers.Add(symbol, identifier);
```
### .NET output via iteration over an enumerator.

Any ideas or suggestions?
| How to make a .NET Hashtable work just like a Java Hashtable | CC BY-SA 2.5 | null | 2011-01-07T00:04:48.397 | 2011-01-07T00:29:30.193 | null | null | 30,674 | [
"java",
".net",
"iterator",
"hashtable",
"enumeration"
]
|
4,621,364 | 1 | 4,621,783 | null | 1 | 597 | I recently created a new Ruby on Rails 3 application locally on a Mac OS, named "test".
Since I use apache2, in the private/etc/apache2/ I set the VirtualHost for the "test" application:
```
<VirtualHost *:443>
ServerName test.pjtmain.localhost:443
DocumentRoot "/Users/<my_user_name>/Sites/test/public"
RackEnv development
<Directory "/Users/<my_user_name>/Sites/test/public">
Order allow,deny
Allow from all
</Directory>
# SSL Configuration
SSLEngine on
...
</VirtualHost>
<VirtualHost *:80>
ServerName test.pjtmain.localhost
DocumentRoot "/Users/<my_user_name>/Sites/test/public"
RackEnv development
<Directory "/Users/<my_user_name>/Sites/test/public">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
```
Of course I restart apache2, but trying to access to `http://test.pjtmain.localhost/` I have this error message from:
FIREFOX
```
Oops! Firefox could not find test.pjtmain.localhost
Suggestions:
*
Search on Google:
...
```
SAFARI
```
Safari can’t find the server.
Safari can’t open the page “http://test.pjtmain.localhost/” because Safari can’t find the server “test.pjtmain.localhost”.
```
:
`1.` Using the 'Network Uility'
I did a with the following result:
```
ping: cannot resolve test.pjtmain.localhost: Unknown host
```
and I did a with the follonwing result:
```
; <<>> DiG 9.6.0-APPLE-P2 <<>> test.pjtmain.localhost +multiline +nocomments +nocmd +noquestion +nostats +search
;; global options: +cmd
<MY_ISP_NAME>.com. 115 IN SOA dns1.<MY_ISP_NAME>.com. dnsmaster.<MY_ISP_NAME>.com. (
2010110500 ; serial
10800 ; refresh (3 hours)
900 ; retry (15 minutes)
604800 ; expire (1 week)
86400 ; minimum (1 day)
)
```
`2.` In /private/etc/hosts I have this code:
```
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
```
`3.` I am using Phusion Passenger
`4.` Since I not changed nothing to the new "test" application, I expect to see the default RoR index.html page:

`5.` It seems that in the 'Console Messages' there is any warning or error
`6.` After run 'dscacheutil -flushcache', the 'dscacheutil -statistics' response is:
```
Overall Statistics:
Average Call Time - 0.000304
Cache Hits - 5311
Cache Misses - 6113
Total External Calls - 5654
Statistics by procedure:
Procedure Cache Hits Cache Misses External Calls
------------------ ---------- ------------ --------------
getpwnam 1496 149 1645
getpwuid 749 11 760
getgrnam 157 28 185
getgrgid 76 7 83
getservbyname 2818 15 26
getservbyport 0 3 3
getprotobyname 1 1 2
getfsent 0 0 2
gethostbyname 14 2816 13
gethostbyaddr 0 116 116
gethostbyname_service 0 0 2817
_flushcache 0 0 2
```
| Strange problem publishing a fresh Ruby on Rails 3 application on localhost (Apache, Passenger and VirtualHosts) | CC BY-SA 2.5 | 0 | 2011-01-07T00:12:37.457 | 2011-01-07T01:37:59.507 | 2011-01-07T01:36:53.657 | 502,052 | 502,052 | [
"ruby-on-rails",
"apache",
"localhost"
]
|
4,621,592 | 1 | 4,621,666 | null | 3 | 183 | Please take a look at this example -

I know I'm using the `footer/nav` correctly but the `<side>` and `<section>` is kinda confusing.
The `<figure>` will be just one huge logo. Beside that will be the main content. Would `<aside>` be proper use? Its not side content like a sidebar so thats why i'm asking.
Also the `<section>` would be columns for the content, would that be right?
| Is this proper use of HTML5? | CC BY-SA 2.5 | null | 2011-01-07T00:59:58.147 | 2011-01-07T01:12:13.650 | 2011-01-07T01:06:27.277 | 538,786 | 538,786 | [
"html"
]
|
4,621,606 | 1 | 4,628,325 | null | 0 | 561 | I am trying to figure out why I keep getting bad characters when I import information into my database from a CSV file.
Database is UTF-8 encoding
HTML Page = UTF-8 Encoding (Meta Tag)
What I'm receiving when the file is imported is.

But in the CSV file everything looks clean, and the actual number is +1 (250) 862-8350
So I don't know what the issue is, my hunch is something to do with a form of trimming but I haven't been able to figure out what it is... any light would be appreciated!
| Bad characters from CSV into database | CC BY-SA 2.5 | null | 2011-01-07T01:02:20.800 | 2011-01-07T17:23:53.307 | null | null | 679,601 | [
"character-encoding",
"special-characters",
"character"
]
|
4,622,057 | 1 | 4,622,449 | null | 72 | 66,073 |
## I was unsuccessful browsing web for a solution for the following simple question:
How to draw 3D polygon (say a filled rectangle or triangle) using vertices values?
I have tried many ideas but all failed, see:
```
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.collections import PolyCollection
import matplotlib.pyplot as plt
fig = plt.figure()
ax = Axes3D(fig)
x = [0,1,1,0]
y = [0,0,1,1]
z = [0,1,0,1]
verts = [zip(x, y,z)]
ax.add_collection3d(PolyCollection(verts),zs=z)
plt.show()
```
I appreciate in advance any idea/comment.
```
import mpl_toolkits.mplot3d as a3
import matplotlib.colors as colors
import pylab as pl
import numpy as np
ax = a3.Axes3D(pl.figure())
for i in range(10000):
vtx = np.random.rand(3,3)
tri = a3.art3d.Poly3DCollection([vtx])
tri.set_color(colors.rgb2hex(np.random.rand(3)))
tri.set_edgecolor('k')
ax.add_collection3d(tri)
pl.show()
```
Here is the result:

| Plotting 3D Polygons in python-matplotlib | CC BY-SA 4.0 | 0 | 2011-01-07T02:38:37.047 | 2021-10-30T20:54:54.353 | 2021-01-22T15:59:16.120 | 1,396,516 | 566,326 | [
"python",
"matplotlib",
"plot"
]
|
4,622,096 | 1 | 4,622,385 | null | 6 | 8,386 | I try to fetch user's feeds via graph api from my Android application. It generally works but some feeds that I can see on the wall are missing in the json response.
I call the url [http://graph.facebook.com/someUserId/feed](http://graph.facebook.com/someUserId/feed), by using the Android Facebook SDK methods, so the access token should be provided automatically, but it's not really relevant I think in my case. Nevertheless fyi, the user of my app is authenticated via OAuth.
I already checked the following:
- - - - [http://graph.facebook.com/someUserId/feed](http://graph.facebook.com/someUserId/feed)
This is an example of the problem - since all my posts are public, I can just call the json url directly in a browser to do a test.
I want to get wall feeds from user:
[http://www.facebook.com/mathias.lin](http://www.facebook.com/mathias.lin)
Screenshot1: note the 3 marked postings, all posted by myself

and here the json response, as you can see, the 1st and 3rd wall posts are included in the json, but the 2nd post is not. Why?
The related json url is:
[http://graph.facebook.com/mathias.lin/feed](http://graph.facebook.com/mathias.lin/feed)

I am getting the 'missing' feed when I add an access_token to the url - but why? The posted feed has a privacy setting for 'everyone'?!
This is the missing feed that I get when using the access_token:
```
{"id":"504063796_485195138796","from":{"name":"Mathias Lin","id":"504063796"},"message":"Photo test upload from Android","picture":"http:\/\/photos-e.ak.fbcdn.net\/hphotos-ak-snc6\/hs021.snc6\/165194_485195123796_504063796_6062399_1841907_s.jpg","link":"http:\/\/www.facebook.com\/photo.php?fbid=485195123796&set=a.485195118796.256450.504063796","name":"Torres Photos","icon":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/yz\/r\/StEh3RhPvjk.gif","actions":[{"name":"Comment","link":"http:\/\/www.facebook.com\/504063796\/posts\/485195138796"},{"name":"Like","link":"http:\/\/www.facebook.com\/504063796\/posts\/485195138796"}],"privacy":{"description":"Everyone","value":"EVERYONE"},"type":"photo","created_time":"2011-01-06T05:10:43+0000","updated_time":"2011-01-06T09:00:23+0000","likes":6,"comments":{"data":[{"id":"504063796_485195138796_3607414","from":{"name":"Mathias Lin","id":"504063796"},"message":"Awesome, photo upload now works as well. Not so much fun working with the Facebook SDK for Android, would have expected more functionality beyond that just very very simple graph api wrapper. But need to be considered that the android sdk development was part of an internship - but since it's it's open source, it can luckily be modified. Which has to be done due to some bugs (mixing up the bundle parameters for a post, getString, getByteArray). Api documentation could be improved.","created_time":"2011-01-06T05:26:04+0000"},{"id":"504063796_485195138796_3608020","from":{"name":"Renate Hermanns","id":"628810487"},"message":"Wow
, how fast time passes by. Your daughter is nearly grown up ;-).","created_time":"2011-01-06T09:00:23+0000"}],"count":2},"attribution":"Torres"}
```
I've already posted the question to the FB dev forum, awaiting response.
Related threads:
[http://forum.developers.facebook.net/viewtopic.php?id=81365](http://forum.developers.facebook.net/viewtopic.php?id=81365)
[http://forum.developers.facebook.net/viewtopic.php?id=75984](http://forum.developers.facebook.net/viewtopic.php?id=75984)
[Facebook Graph API "/userid/feed" returning Blank](https://stackoverflow.com/questions/4139868/facebook-graph-api-userid-feed-returning-blank)
| Facebook graph API: feeds missing in json response | CC BY-SA 2.5 | 0 | 2011-01-07T02:48:45.713 | 2013-05-20T15:03:51.267 | 2017-05-23T11:48:22.880 | -1 | 241,475 | [
"facebook",
"facebook-graph-api"
]
|
4,622,162 | 1 | 4,622,175 | null | 2 | 1,260 | I am developing a asp.net website and need to add validator for multiple textboxes. I googled it and found a custom validator.
I add this as a project and do things.. and the website is running fine.
But whenever I run the project with Start Debugging icon, the following message appears.

I can click OK and continue but this has become really annoying.. Any idea not to appear this?
| debugger option in visual studio 2005 | CC BY-SA 2.5 | null | 2011-01-07T03:04:28.047 | 2013-11-15T15:32:58.313 | null | null | 398,909 | [
"debugging",
"visual-studio-2005"
]
|
4,622,694 | 1 | 4,622,882 | null | 0 | 300 | I have an additional Libary project which has a custom button classs:
> [MonoTouch.Foundation.Register("ItunesIphoneOpen")]
public class ItunesIphoneOpen: UIButton
When I set the class of a button in UIBuilder to ItunesIphoneOpen the partial code that is generated does not know about this class as it is in another namespace (and project)
Howe can I get the generated code to include a namespace reference to the namespace of ItunesIphoneOpen?

| Monotouch: Library with a Foundation.Register class | CC BY-SA 2.5 | null | 2011-01-07T05:12:34.087 | 2011-01-07T05:53:47.720 | null | null | 172,861 | [
"attributes",
"xamarin.ios"
]
|
4,623,025 | 1 | null | null | 0 | 107 | What is the minimum number of subsystems that need to be configured in parallel in order to increase the availability of the entire system to 99% or more, if the availability of each subsystem in the parallel system shown below is 70%?
Assume that the entire system is running as long as one subsystem is running.
diagram:

[http://postimage.org/image/tdv2xfwk/](http://postimage.org/image/tdv2xfwk/)
The answer is 4 but I don't know why?
| subsystem configuration | CC BY-SA 3.0 | null | 2011-01-07T06:24:01.223 | 2011-12-01T07:19:58.100 | 2011-12-01T07:19:58.100 | 234,976 | 566,498 | [
"probability",
"reliability",
"subsystem"
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.